@murphai/murph 1.3.0 → 1.3.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/CHANGELOG.md +3077 -0
- package/config.schema.json +650 -30
- package/dist/cli-entry.js +1 -1
- package/dist/cli-entry.js.map +1 -1
- package/dist/commands/automation.d.ts +143 -104
- package/dist/commands/automation.d.ts.map +1 -1
- package/dist/commands/automation.js +71 -13
- package/dist/commands/automation.js.map +1 -1
- package/dist/commands/batch.d.ts +3 -0
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +18 -45
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/clinical-imports.d.ts +103 -103
- package/dist/commands/command-factory-primitives.d.ts +1 -1
- package/dist/commands/command-factory-primitives.d.ts.map +1 -1
- package/dist/commands/command-factory-primitives.js +1 -1
- package/dist/commands/command-factory-primitives.js.map +1 -1
- package/dist/commands/commons.d.ts +59 -0
- package/dist/commands/commons.d.ts.map +1 -1
- package/dist/commands/commons.js +81 -1
- package/dist/commands/commons.js.map +1 -1
- package/dist/commands/document.d.ts.map +1 -1
- package/dist/commands/document.js +31 -1
- package/dist/commands/document.js.map +1 -1
- package/dist/commands/encounter.d.ts +128 -128
- package/dist/commands/event.d.ts.map +1 -1
- package/dist/commands/event.js +7 -1
- package/dist/commands/event.js.map +1 -1
- package/dist/commands/experiment-progress-card-image.d.ts.map +1 -1
- package/dist/commands/experiment-progress-card-image.js +13 -4
- package/dist/commands/experiment-progress-card-image.js.map +1 -1
- package/dist/commands/experiment.d.ts.map +1 -1
- package/dist/commands/experiment.js +6 -0
- package/dist/commands/experiment.js.map +1 -1
- package/dist/commands/export-intake-read-helpers.d.ts.map +1 -1
- package/dist/commands/export-intake-read-helpers.js +7 -3
- package/dist/commands/export-intake-read-helpers.js.map +1 -1
- package/dist/commands/food.d.ts.map +1 -1
- package/dist/commands/food.js +12 -4
- package/dist/commands/food.js.map +1 -1
- package/dist/commands/meal.d.ts.map +1 -1
- package/dist/commands/meal.js +54 -3
- package/dist/commands/meal.js.map +1 -1
- package/dist/commands/measurement.d.ts +1 -0
- package/dist/commands/measurement.d.ts.map +1 -1
- package/dist/commands/measurement.js +48 -2
- package/dist/commands/measurement.js.map +1 -1
- package/dist/commands/medication.d.ts +6 -6
- package/dist/commands/model.js +7 -11
- package/dist/commands/model.js.map +1 -1
- package/dist/commands/occurred-at-option.d.ts.map +1 -1
- package/dist/commands/occurred-at-option.js +7 -41
- package/dist/commands/occurred-at-option.js.map +1 -1
- package/dist/commands/payload-schema-command.d.ts +2 -2
- package/dist/commands/payload-schema-command.d.ts.map +1 -1
- package/dist/commands/payload-schema-command.js +1 -1
- package/dist/commands/payload-schema-command.js.map +1 -1
- package/dist/commands/research.d.ts.map +1 -1
- package/dist/commands/research.js +26 -28
- package/dist/commands/research.js.map +1 -1
- package/dist/commands/route.d.ts.map +1 -1
- package/dist/commands/route.js +45 -1
- package/dist/commands/route.js.map +1 -1
- package/dist/commands/scheduled-log.d.ts +130 -124
- package/dist/commands/scheduled-log.d.ts.map +1 -1
- package/dist/commands/wearables.d.ts +1109 -20
- package/dist/commands/wearables.d.ts.map +1 -1
- package/dist/commands/wearables.js +102 -2
- package/dist/commands/wearables.js.map +1 -1
- package/dist/commands/workout-live.d.ts +3 -0
- package/dist/commands/workout-live.d.ts.map +1 -0
- package/dist/commands/workout-live.js +291 -0
- package/dist/commands/workout-live.js.map +1 -0
- package/dist/commands/workout.d.ts.map +1 -1
- package/dist/commands/workout.js +35 -11
- package/dist/commands/workout.js.map +1 -1
- package/dist/food-labels.d.ts +549 -277
- package/dist/food-labels.d.ts.map +1 -1
- package/dist/food-labels.js +19 -3
- package/dist/food-labels.js.map +1 -1
- package/dist/foreground-terminal-logging.js +0 -2
- package/dist/foreground-terminal-logging.js.map +1 -1
- package/dist/hosted-data-api-labels.d.ts +1683 -871
- package/dist/hosted-data-api-labels.d.ts.map +1 -1
- package/dist/hosted-data-api-labels.js +63 -1
- package/dist/hosted-data-api-labels.js.map +1 -1
- package/dist/incur.generated.d.ts +148 -2
- package/dist/incur.generated.d.ts.map +1 -1
- package/dist/mapbox-address.d.ts +41 -0
- package/dist/mapbox-address.d.ts.map +1 -0
- package/dist/mapbox-address.js +470 -0
- package/dist/mapbox-address.js.map +1 -0
- package/dist/mapbox-route-contracts.d.ts +60 -60
- package/dist/mapbox-route-contracts.d.ts.map +1 -1
- package/dist/mapbox-route-contracts.js +1 -1
- package/dist/mapbox-route-contracts.js.map +1 -1
- package/dist/mapbox-route-directions.js +1 -1
- package/dist/mapbox-route-directions.js.map +1 -1
- package/dist/research-scout-client.d.ts +3 -2
- package/dist/research-scout-client.d.ts.map +1 -1
- package/dist/research-scout-client.js +166 -37
- package/dist/research-scout-client.js.map +1 -1
- package/dist/research-scout.d.ts +1 -1
- package/dist/research-scout.d.ts.map +1 -1
- package/dist/research-scout.js +1 -1
- package/dist/research-scout.js.map +1 -1
- package/dist/supplement-labels.d.ts +545 -275
- package/dist/supplement-labels.d.ts.map +1 -1
- package/dist/supplement-labels.js +0 -1
- package/dist/supplement-labels.js.map +1 -1
- package/dist/vault-cli-command-manifest.d.ts +1878 -404
- package/dist/vault-cli-command-manifest.d.ts.map +1 -1
- package/dist/vault-cli-command-manifest.js +35 -10
- package/dist/vault-cli-command-manifest.js.map +1 -1
- package/dist/vault-cli-skill-hash.generated.d.ts +1 -1
- package/dist/vault-cli-skill-hash.generated.js +1 -1
- package/dist/vault-cli-vault-context.js +0 -1
- package/dist/vault-cli-vault-context.js.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/service.d.ts +9 -0
- package/node_modules/@murphai/assistant-cli/dist/assistant/service.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/chat-controller-models.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/chat-controller-models.js +0 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/chat-controller-models.js.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/ink.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/ink.js +4 -6
- package/node_modules/@murphai/assistant-cli/dist/assistant/ui/ink.js.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant-daemon-client.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/assistant-daemon-client.js +19 -9
- package/node_modules/@murphai/assistant-cli/dist/assistant-daemon-client.js.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/commands/assistant.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-cli/dist/commands/assistant.js +20 -56
- package/node_modules/@murphai/assistant-cli/dist/commands/assistant.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/README.md +69 -13
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-controller.d.ts +6 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-controller.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-controller.js +52 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-controller.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-journal.d.ts +75 -70
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-journal.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-journal.js +42 -17
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-journal.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/ask-continuation.d.ts +3 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/ask-continuation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/ask-continuation.js +27 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/ask-continuation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/attachment-evidence-model.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/attachment-evidence-model.js +4 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/attachment-evidence-model.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/cross-session-route-state.d.ts +77 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/cross-session-route-state.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/cross-session-route-state.js +777 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/cross-session-route-state.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/grouping.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/grouping.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/grouping.js +36 -4
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/grouping.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/input-summary.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/input-summary.js +3 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/input-summary.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/operation-scope.d.ts +3 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/operation-scope.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/prompt-builder.d.ts +10 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/prompt-builder.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/prompt-builder.js +33 -13
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/prompt-builder.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/reply.d.ts +12 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/reply.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/reply.js +803 -171
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/reply.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/run-loop.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/run-loop.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/run-loop.js +42 -17
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/run-loop.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/scanner.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/scanner.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/scanner.js +59 -30
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/scanner.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/shared.d.ts +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/shared.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/shared.js +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/shared.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/target-override.d.ts +10 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/target-override.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/target-override.js +62 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation/target-override.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/automation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channel-adapters.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channel-adapters.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channel-adapters.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channel-adapters.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/descriptors.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/descriptors.js +107 -44
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/descriptors.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/helpers.d.ts +3 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/helpers.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/helpers.js +34 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/helpers.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/runtime.d.ts +22 -14
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/runtime.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/runtime.js +352 -78
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/runtime.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/types.d.ts +43 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/types.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/channels/types.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cli-surface-bootstrap.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cli-surface-bootstrap.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cli-surface-bootstrap.js +6 -5
- package/node_modules/@murphai/assistant-engine/dist/assistant/cli-surface-bootstrap.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cli-surface-contract.generated.json +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-base-instructions.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-base-instructions.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-base-instructions.js +14 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-base-instructions.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-runtime.d.ts +17 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-runtime.js +25 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-runtime.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-thread-route.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-thread-route.js +9 -9
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-thread-route.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn/planning.d.ts +3 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn/planning.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn/planning.js +172 -48
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn/planning.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn-runner.d.ts +5 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn-runner.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn-runner.js +124 -25
- package/node_modules/@murphai/assistant-engine/dist/assistant/codex-turn-runner.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/content-types.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/content-types.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/context-snapshot.d.ts +4 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/context-snapshot.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/context-snapshot.js +75 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant/context-snapshot.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-persistence.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-persistence.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-persistence.js +0 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-persistence.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-ref.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-ref.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-ref.js +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/conversation-ref.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/authoring.d.ts +5 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/authoring.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/authoring.js +178 -31
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/authoring.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/canonical-jobs.d.ts +32 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/canonical-jobs.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/canonical-jobs.js +147 -31
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/canonical-jobs.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/delivery-reconciliation.d.ts +8 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/delivery-reconciliation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/delivery-reconciliation.js +73 -15
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/delivery-reconciliation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/execution.d.ts +3 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/execution.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/execution.js +420 -112
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/execution.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/mutations.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/mutations.js +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/mutations.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/output-history.d.ts +11 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/output-history.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/output-history.js +153 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/output-history.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/runtime-state.d.ts +47 -47
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/runtime-state.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/runtime-state.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/runtime-state.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/schedule.d.ts +8 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/schedule.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/schedule.js +16 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/schedule.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/store.d.ts +49 -39
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/store.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/store.js +19 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/store.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/targets.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/targets.js +1 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/targets.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/timing-verification.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/timing-verification.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/timing-verification.js +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron/timing-verification.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron.d.ts +9 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron.js +31 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/cron.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/delivery-service.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/delivery-service.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/delivery-service.js +32 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/delivery-service.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/device-activity-cron-tags.d.ts +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/device-activity-cron-tags.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/device-activity-cron-tags.js +8 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/device-activity-cron-tags.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-context.d.ts +91 -13
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-context.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-context.js +48 -11
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-context.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-plan.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-plan.js +2 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant/execution-plan.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/experiment-support-automations.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/experiment-support-automations.js +8 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/experiment-support-automations.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card-schema.d.ts +115 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card-schema.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card-schema.js +162 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card-schema.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card.js +118 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-response-card.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard-schema.d.ts +83 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard-schema.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard-schema.js +27 -22
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard-schema.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard.js +8 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-challenge-scorecard.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-email-outbox.d.ts +20 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-email-outbox.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/{newsletter-outbox.js → group-email-outbox.js} +65 -36
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-email-outbox.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-newsletter-automation.d.ts +2 -48
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-newsletter-automation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-newsletter-automation.js +14 -98
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-newsletter-automation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-room-model.d.ts +22 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-room-model.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-room-model.js +87 -28
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-room-model.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-freshness.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-freshness.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-freshness.js +5 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-freshness.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-read-limits.d.ts +3 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-read-limits.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-read-limits.js +21 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-shared-read-limits.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-image-completion.d.ts +31 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-image-completion.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-image-completion.js +164 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-image-completion.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-tool-context.d.ts +77 -24
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-tool-context.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-tool-context.js +184 -63
- package/node_modules/@murphai/assistant-engine/dist/assistant/hosted-tool-context.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-source.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-source.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-source.js +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-source.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-store.d.ts +273 -269
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-store.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-store.js +6 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/input-store.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/linq-delivery-posture.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/linq-delivery-posture.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/linq-delivery-posture.js +20 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/linq-delivery-posture.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/local-service.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/local-service.js +217 -84
- package/node_modules/@murphai/assistant-engine/dist/assistant/local-service.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/maintenance-evidence.d.ts +3 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/maintenance-evidence.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/maintenance-evidence.js +245 -6
- package/node_modules/@murphai/assistant-engine/dist/assistant/maintenance-evidence.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/managed-automations.d.ts +22 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/managed-automations.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/managed-automations.js +289 -34
- package/node_modules/@murphai/assistant-engine/dist/assistant/managed-automations.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/message-target-selection.d.ts +13 -22
- package/node_modules/@murphai/assistant-engine/dist/assistant/message-target-selection.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/message-target-selection.js +8 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/message-target-selection.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/model-behavior.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/model-behavior.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/model-behavior.js +40 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/model-behavior.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/notification-turn.d.ts +16 -14
- package/node_modules/@murphai/assistant-engine/dist/assistant/notification-turn.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/notification-turn.js +205 -56
- package/node_modules/@murphai/assistant-engine/dist/assistant/notification-turn.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-first-personal-read-automation.d.ts +14 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-first-personal-read-automation.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-first-personal-read-automation.js +94 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-first-personal-read-automation.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-automation.d.ts +22 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-automation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-automation.js +81 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-automation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-goal-checkin-automation.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-goal-checkin-automation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-goal-checkin-automation.js +184 -83
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-goal-checkin-automation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-state.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-state.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/automation-authority.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/automation-authority.js +24 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/automation-authority.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/dispatch-state.d.ts +15 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/dispatch-state.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/dispatch-state.js +314 -53
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/dispatch-state.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/intents.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/intents.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/intents.js +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/intents.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/receipt-repair.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/receipt-repair.js +5 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/receipt-repair.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/retry-policy.d.ts +4 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/retry-policy.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/retry-policy.js +33 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/retry-policy.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/store.d.ts +37 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/store.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/store.js +1031 -41
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/store.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/summary.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/summary.js +7 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox/summary.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox.d.ts +61 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox.js +561 -67
- package/node_modules/@murphai/assistant-engine/dist/assistant/outbox.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/private-completion-continuity.d.ts +23 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/private-completion-continuity.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/private-completion-continuity.js +293 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/private-completion-continuity.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/prompt-time.d.ts +12 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/prompt-time.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/prompt-time.js +38 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/prompt-time.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-catalog.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-catalog.js +2 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-catalog.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-start-critical-path.d.ts +48 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-start-critical-path.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-start-critical-path.js +101 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/provider-start-critical-path.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/codex-cli.d.ts +6 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/codex-cli.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/codex-cli.js +62 -96
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/codex-cli.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/helpers.d.ts +5 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/helpers.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/helpers.js +412 -568
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/helpers.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/types.d.ts +23 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/types.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/providers/types.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/redaction.d.ts +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/redaction.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/redaction.js +6 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/redaction.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/reminder-availability-maintenance.d.ts +17 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/reminder-availability-maintenance.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/reminder-availability-maintenance.js +287 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/reminder-availability-maintenance.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/response-media.d.ts +33 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/response-media.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/response-media.js +173 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/response-media.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/runtime-residue.d.ts +6 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/runtime-residue.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/runtime-residue.js +61 -29
- package/node_modules/@murphai/assistant-engine/dist/assistant/runtime-residue.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-contracts.d.ts +17 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-turn-routes.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-turn-routes.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-turn-routes.js +18 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-turn-routes.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-usage.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-usage.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-usage.js +23 -4
- package/node_modules/@murphai/assistant-engine/dist/assistant/service-usage.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service.d.ts +12 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/service.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/service.js +5 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/service.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/session-resolution.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/session-resolution.js +71 -16
- package/node_modules/@murphai/assistant-engine/dist/assistant/session-resolution.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/shared.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/shared.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/shared.js +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/shared.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/state-secrets.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/state-secrets.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/state-secrets.js +0 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/state-secrets.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/persistence.d.ts +11 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/persistence.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/persistence.js +410 -139
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/persistence.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/types.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/store/types.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/store.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/store.js +48 -13
- package/node_modules/@murphai/assistant-engine/dist/assistant/store.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/system-prompt.d.ts +4 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/system-prompt.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/system-prompt.js +274 -128
- package/node_modules/@murphai/assistant-engine/dist/assistant/system-prompt.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-digest.d.ts +9 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-digest.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-digest.js +133 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-digest.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-feedback.d.ts +11 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-feedback.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-feedback.js +59 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/tool-validation-feedback.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-finalizer.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-finalizer.js +109 -16
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-finalizer.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-input.d.ts +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-input.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-input.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-progress.d.ts +9 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-progress.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-progress.js +49 -6
- package/node_modules/@murphai/assistant-engine/dist/assistant/turn-progress.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turns.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/turns.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/turns.js +62 -22
- package/node_modules/@murphai/assistant-engine/dist/assistant/turns.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/vault-file-send.d.ts +7 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/vault-file-send.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/vault-file-send.js +47 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/vault-file-send.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-ask.d.ts +4 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-ask.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-ask.js +49 -23
- package/node_modules/@murphai/assistant-engine/dist/assistant-ask.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-adapters.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-adapters.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-adapters.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-adapters.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-runtime.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-runtime.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-channel-runtime.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-cli-access.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-cli-access.js +12 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-cli-access.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-diagnostics.d.ts +8 -4
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-diagnostics.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-diagnostics.js +136 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-diagnostics.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-outcome.d.ts +5 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-outcome.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-outcome.js +36 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/action-outcome.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-protocol.d.ts +59 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-protocol.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-protocol.js +181 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-protocol.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-requests.d.ts +5 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-requests.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-requests.js +19 -5
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-requests.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-rpc.d.ts +2 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-rpc.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-rpc.js +7 -14
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/app-server-rpc.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/ask-grok-tool.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/ask-grok-tool.js +77 -11
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/ask-grok-tool.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/command-family.d.ts +17 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/command-family.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/command-family.js +200 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/command-family.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tool-catalog.d.ts +3387 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tool-catalog.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tool-catalog.js +1379 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tool-catalog.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/ask-grok.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/ask-grok.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/ask-grok.js +2 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/ask-grok.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/assistant-style.d.ts +15 -32
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/assistant-style.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/assistant-style.js +11 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/assistant-style.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation.d.ts +26 -150
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation.js +537 -103
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/clinical-records.js +4 -4
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/clinical-records.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/connected-apps.d.ts +10 -54
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/connected-apps.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/connected-apps.js +134 -109
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/connected-apps.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/device.d.ts +2 -12
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/device.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/device.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/device.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/dynamic-tool-wrapper.d.ts +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/dynamic-tool-wrapper.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/dynamic-tool-wrapper.js +2 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/dynamic-tool-wrapper.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-song.d.ts +9 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-song.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-song.js +31 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-song.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-voice-memo.d.ts +7 -6
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-voice-memo.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-voice-memo.js +12 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/generate-voice-memo.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/group-room-model.d.ts +10 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/group-room-model.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/group-room-model.js +19 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/group-room-model.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/labs.d.ts +2 -16
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/labs.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/labs.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/labs.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/pending-vault-files.d.ts +65 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/pending-vault-files.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/pending-vault-files.js +214 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/pending-vault-files.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/phone-calls.d.ts +24 -16
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/phone-calls.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/phone-calls.js +78 -7
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/phone-calls.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/physical-notes.d.ts +91 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/physical-notes.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/physical-notes.js +199 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/physical-notes.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools.d.ts +108 -2427
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools.js +2248 -1509
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/failures.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/failures.js +39 -95
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/failures.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-image-tool.d.ts +5 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-image-tool.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-image-tool.js +88 -101
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-image-tool.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-voice-memo-tool.d.ts +58 -13
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-voice-memo-tool.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-voice-memo-tool.js +85 -122
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/generate-voice-memo-tool.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/image-reference-resolver.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/image-reference-resolver.js +5 -3
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/image-reference-resolver.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/images.d.ts +15 -2
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/images.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/images.js +99 -8
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/images.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/managed-voice-memo-runtime.d.ts +17 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/managed-voice-memo-runtime.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/managed-voice-memo-runtime.js +12 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/managed-voice-memo-runtime.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/openai-image-generation.d.ts +7 -11
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/openai-image-generation.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/openai-image-generation.js +237 -52
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/openai-image-generation.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/response-card-validation-feedback.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/response-card-validation-feedback.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/response-card-validation-feedback.js +7 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/response-card-validation-feedback.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex-events.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex-events.js +189 -486
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex-events.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex.d.ts +34 -6
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex.js +1014 -247
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime-residue.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime-residue.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime-residue.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime-residue.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime.d.ts +2 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime.js +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-runtime.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-skill-assets.d.ts +23 -23
- package/node_modules/@murphai/assistant-engine/dist/assistant-skill-assets.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant-skill-assets.js +26 -26
- package/node_modules/@murphai/assistant-engine/dist/assistant-skill-assets.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/attachment-prompt-contracts.d.ts +27 -27
- package/node_modules/@murphai/assistant-engine/dist/attachment-prompt-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/attachment-prompt-contracts.js +1 -1
- package/node_modules/@murphai/assistant-engine/dist/attachment-prompt-contracts.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/index.d.ts +8 -3
- package/node_modules/@murphai/assistant-engine/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/index.js +6 -1
- package/node_modules/@murphai/assistant-engine/dist/index.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/documents.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/documents.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/documents.js +5 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/documents.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/service.d.ts +1 -0
- package/node_modules/@murphai/assistant-engine/dist/knowledge/service.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/knowledge/service.js +16 -2
- package/node_modules/@murphai/assistant-engine/dist/knowledge/service.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/outbound-channel.d.ts +5 -2
- package/node_modules/@murphai/assistant-engine/dist/outbound-channel.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/outbound-channel.js +4 -2
- package/node_modules/@murphai/assistant-engine/dist/outbound-channel.js.map +1 -1
- package/node_modules/@murphai/assistant-engine/skills/README.md +29 -0
- package/node_modules/@murphai/assistant-engine/skills/appointment-scheduling/SKILL.md +23 -0
- package/node_modules/@murphai/assistant-engine/skills/automatic-meal-capture/SKILL.md +130 -5
- package/node_modules/@murphai/assistant-engine/skills/behavior-followthrough/SKILL.md +157 -116
- package/node_modules/@murphai/assistant-engine/skills/body-composition/SKILL.md +137 -27
- package/node_modules/@murphai/assistant-engine/skills/body-composition/references/evidence.md +150 -0
- package/node_modules/@murphai/assistant-engine/skills/body-composition/references/fat-loss.md +132 -0
- package/node_modules/@murphai/assistant-engine/skills/body-composition/references/muscle-gain.md +135 -0
- package/node_modules/@murphai/assistant-engine/skills/body-composition/references/safety.md +171 -0
- package/node_modules/@murphai/assistant-engine/skills/body-composition/references/tracking-and-adjustment.md +193 -0
- package/node_modules/@murphai/assistant-engine/skills/cardiometabolic-health/SKILL.md +10 -1
- package/node_modules/@murphai/assistant-engine/skills/computer-use/SKILL.md +0 -4
- package/node_modules/@murphai/assistant-engine/skills/connected-apps/SKILL.md +86 -12
- package/node_modules/@murphai/assistant-engine/skills/connected-apps/references/provider-data-exports.md +209 -0
- package/node_modules/@murphai/assistant-engine/skills/daily-activity/SKILL.md +16 -0
- package/node_modules/@murphai/assistant-engine/skills/experiment-onboarding/SKILL.md +22 -9
- package/node_modules/@murphai/assistant-engine/skills/food-journal/SKILL.md +140 -15
- package/node_modules/@murphai/assistant-engine/skills/group-challenge/SKILL.md +17 -737
- package/node_modules/@murphai/assistant-engine/skills/group-challenge-scorecards/SKILL.md +17 -328
- package/node_modules/@murphai/assistant-engine/skills/group-chat/SKILL.md +18 -912
- package/node_modules/@murphai/assistant-engine/skills/group-newsletter/SKILL.md +16 -237
- package/node_modules/@murphai/assistant-engine/skills/groupchat-comedy/SKILL.md +19 -351
- package/node_modules/@murphai/assistant-engine/skills/hosted-low-usage/SKILL.md +309 -117
- package/node_modules/@murphai/assistant-engine/skills/micronutrients-supplements/SKILL.md +30 -8
- package/node_modules/@murphai/assistant-engine/skills/mobility-posture/SKILL.md +1 -1
- package/node_modules/@murphai/assistant-engine/skills/murph-family/SKILL.md +91 -26
- package/node_modules/@murphai/assistant-engine/skills/murph-onboarding/SKILL.md +75 -751
- package/node_modules/@murphai/assistant-engine/skills/murph-onboarding/references/aspiration-foundation-delegation.md +443 -0
- package/node_modules/@murphai/assistant-engine/skills/murph-onboarding/references/persistence-recovery-follow-up.md +155 -0
- package/node_modules/@murphai/assistant-engine/skills/murph-onboarding/references/return-launch-completion.md +246 -0
- package/node_modules/@murphai/assistant-engine/skills/music-generation/SKILL.md +31 -163
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/SKILL.md +78 -7
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/daily-nutrition-card-goals.md +285 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/daily-nutrition-card-safety.md +211 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/carnivore-animal-based.md +145 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/dash.md +183 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/intermittent-fasting.md +153 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/ketogenic.md +149 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/low-carbohydrate.md +167 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/mediterranean.md +141 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/vegan-plant-based.md +175 -0
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/named-diets/vegetarian-spectrum.md +131 -0
- package/node_modules/@murphai/assistant-engine/skills/phone-calls/SKILL.md +47 -67
- package/node_modules/@murphai/assistant-engine/skills/physical-notes/SKILL.md +120 -0
- package/node_modules/@murphai/assistant-engine/skills/physical-therapy/SKILL.md +4 -2
- package/node_modules/@murphai/assistant-engine/skills/self-management-experiments/SKILL.md +19 -3
- package/node_modules/@murphai/assistant-engine/skills/shared/exercise-catalog-runtime.md +30 -19
- package/node_modules/@murphai/assistant-engine/skills/signup-link/SKILL.md +30 -0
- package/node_modules/@murphai/assistant-engine/skills/strength-training/SKILL.md +9 -0
- package/node_modules/@murphai/assistant-engine/skills/tracked-table/SKILL.md +202 -0
- package/node_modules/@murphai/assistant-engine/skills/workout-csv-import/SKILL.md +129 -0
- package/node_modules/@murphai/assistantd/dist/client.d.ts +2 -0
- package/node_modules/@murphai/assistantd/dist/client.d.ts.map +1 -1
- package/node_modules/@murphai/assistantd/dist/client.js +33 -0
- package/node_modules/@murphai/assistantd/dist/client.js.map +1 -1
- package/node_modules/@murphai/assistantd/dist/http-protocol.d.ts.map +1 -1
- package/node_modules/@murphai/assistantd/dist/http-protocol.js +25 -1
- package/node_modules/@murphai/assistantd/dist/http-protocol.js.map +1 -1
- package/node_modules/@murphai/clinical-records/dist/index.d.ts +660 -660
- package/node_modules/@murphai/clinical-records/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/clinical-records/dist/index.js +1 -1
- package/node_modules/@murphai/clinical-records/dist/index.js.map +1 -1
- package/node_modules/@murphai/core/dist/automation-availability.d.ts +51 -0
- package/node_modules/@murphai/core/dist/automation-availability.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/automation-availability.js +226 -0
- package/node_modules/@murphai/core/dist/automation-availability.js.map +1 -0
- package/node_modules/@murphai/core/dist/automation.d.ts +9 -2
- package/node_modules/@murphai/core/dist/automation.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/automation.js +107 -13
- package/node_modules/@murphai/core/dist/automation.js.map +1 -1
- package/node_modules/@murphai/core/dist/bank/habitat.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/bank/habitat.js +8 -1
- package/node_modules/@murphai/core/dist/bank/habitat.js.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/attachment-backed.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/attachment-backed.js +9 -123
- package/node_modules/@murphai/core/dist/domains/events/attachment-backed.js.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/capture-lookup.d.ts +33 -0
- package/node_modules/@murphai/core/dist/domains/events/capture-lookup.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/capture-lookup.js +119 -0
- package/node_modules/@murphai/core/dist/domains/events/capture-lookup.js.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/generated-image-capture-retention.d.ts +24 -0
- package/node_modules/@murphai/core/dist/domains/events/generated-image-capture-retention.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/events/generated-image-capture-retention.js +409 -0
- package/node_modules/@murphai/core/dist/domains/events/generated-image-capture-retention.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/events/ledger.d.ts +13 -0
- package/node_modules/@murphai/core/dist/domains/events/ledger.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events/ledger.js +86 -7
- package/node_modules/@murphai/core/dist/domains/events/ledger.js.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events.d.ts +6 -2
- package/node_modules/@murphai/core/dist/domains/events.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/domains/events.js +3 -1
- package/node_modules/@murphai/core/dist/domains/events.js.map +1 -1
- package/node_modules/@murphai/core/dist/domains/experiments.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/domains/experiments.js +5 -1
- package/node_modules/@murphai/core/dist/domains/experiments.js.map +1 -1
- package/node_modules/@murphai/core/dist/history/api.d.ts +8 -5
- package/node_modules/@murphai/core/dist/history/api.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/history/api.js +253 -20
- package/node_modules/@murphai/core/dist/history/api.js.map +1 -1
- package/node_modules/@murphai/core/dist/index.d.ts +8 -5
- package/node_modules/@murphai/core/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/index.js +5 -3
- package/node_modules/@murphai/core/dist/index.js.map +1 -1
- package/node_modules/@murphai/core/dist/memory.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/memory.js +1 -0
- package/node_modules/@murphai/core/dist/memory.js.map +1 -1
- package/node_modules/@murphai/core/dist/mutations.d.ts +20 -2
- package/node_modules/@murphai/core/dist/mutations.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/mutations.js +618 -21
- package/node_modules/@murphai/core/dist/mutations.js.map +1 -1
- package/node_modules/@murphai/core/dist/operations/write-batch.d.ts +3 -0
- package/node_modules/@murphai/core/dist/operations/write-batch.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/operations/write-batch.js +33 -2
- package/node_modules/@murphai/core/dist/operations/write-batch.js.map +1 -1
- package/node_modules/@murphai/core/dist/public-mutations.d.ts +2 -1
- package/node_modules/@murphai/core/dist/public-mutations.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/public-mutations.js +7 -2
- package/node_modules/@murphai/core/dist/public-mutations.js.map +1 -1
- package/node_modules/@murphai/device-syncd/README.md +143 -0
- package/node_modules/@murphai/device-syncd/dist/client.d.ts +1 -0
- package/node_modules/@murphai/device-syncd/dist/client.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/client.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/connect-routes.d.ts +25 -0
- package/node_modules/@murphai/device-syncd/dist/config/connect-routes.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/connect-routes.js +54 -0
- package/node_modules/@murphai/device-syncd/dist/config/connect-routes.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/connect-targets.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/connect-targets.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-client-config.d.ts +2 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-client-config.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-client-config.js +2 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-client-config.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-config.d.ts +1 -0
- package/node_modules/@murphai/device-syncd/dist/config/junction-config.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-config.js +9 -1
- package/node_modules/@murphai/device-syncd/dist/config/junction-config.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-configs.d.ts +2 -2
- package/node_modules/@murphai/device-syncd/dist/config/provider-configs.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-configs.js +2 -2
- package/node_modules/@murphai/device-syncd/dist/config/provider-configs.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-env.d.ts +4 -2
- package/node_modules/@murphai/device-syncd/dist/config/provider-env.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-env.js +6 -0
- package/node_modules/@murphai/device-syncd/dist/config/provider-env.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-manifests.d.ts +561 -0
- package/node_modules/@murphai/device-syncd/dist/config/provider-manifests.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-manifests.js +203 -148
- package/node_modules/@murphai/device-syncd/dist/config/provider-manifests.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/provider-types.d.ts +11 -0
- package/node_modules/@murphai/device-syncd/dist/config/provider-types.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/runtime-config.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/runtime-config.js +2 -2
- package/node_modules/@murphai/device-syncd/dist/config/runtime-config.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/serializable-provider-configs.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config/serializable-provider-configs.js +2 -0
- package/node_modules/@murphai/device-syncd/dist/config/serializable-provider-configs.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/config.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/config.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/config.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/configured-provider-runtime-descriptors.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/configured-provider-runtime-descriptors.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/configured-provider-runtime-descriptors.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/configured-provider-runtime-descriptors.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/connect-config.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/connect-config.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/connect-config.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/connect-config.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.d.ts +44 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.js +167 -1
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/index.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/index.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/index.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-historical-backfill-progress.d.ts +24 -0
- package/node_modules/@murphai/device-syncd/dist/junction-historical-backfill-progress.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-historical-backfill-progress.js +444 -9
- package/node_modules/@murphai/device-syncd/dist/junction-historical-backfill-progress.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-resources.d.ts +16 -0
- package/node_modules/@murphai/device-syncd/dist/junction-resources.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-resources.js +32 -0
- package/node_modules/@murphai/device-syncd/dist/junction-resources.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-timeseries-progress.d.ts +8 -0
- package/node_modules/@murphai/device-syncd/dist/junction-timeseries-progress.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/junction-timeseries-progress.js +13 -0
- package/node_modules/@murphai/device-syncd/dist/junction-timeseries-progress.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/prepared-webhook.d.ts +29 -0
- package/node_modules/@murphai/device-syncd/dist/prepared-webhook.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/prepared-webhook.js +263 -0
- package/node_modules/@murphai/device-syncd/dist/prepared-webhook.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/provider-configs.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/provider-configs.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/provider-configs.js +1 -1
- package/node_modules/@murphai/device-syncd/dist/provider-configs.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/provider-label.d.ts +1 -0
- package/node_modules/@murphai/device-syncd/dist/provider-label.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/provider-label.js +4 -2
- package/node_modules/@murphai/device-syncd/dist/provider-label.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/junction-client.d.ts +23 -1
- package/node_modules/@murphai/device-syncd/dist/providers/junction-client.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/junction-client.js +765 -192
- package/node_modules/@murphai/device-syncd/dist/providers/junction-client.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/junction.d.ts +2 -2
- package/node_modules/@murphai/device-syncd/dist/providers/junction.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/junction.js +3250 -205
- package/node_modules/@murphai/device-syncd/dist/providers/junction.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/oura.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/oura.js +2 -1
- package/node_modules/@murphai/device-syncd/dist/providers/oura.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.d.ts +12 -3
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.js +50 -12
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/strava.d.ts +3 -1
- package/node_modules/@murphai/device-syncd/dist/providers/strava.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/strava.js +51 -38
- package/node_modules/@murphai/device-syncd/dist/providers/strava.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.js +11 -1
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/public-account.d.ts +52 -2
- package/node_modules/@murphai/device-syncd/dist/public-account.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/public-account.js +147 -1
- package/node_modules/@murphai/device-syncd/dist/public-account.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/public-ingress.d.ts +9 -2
- package/node_modules/@murphai/device-syncd/dist/public-ingress.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/public-ingress.js +632 -199
- package/node_modules/@murphai/device-syncd/dist/public-ingress.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/service.d.ts +17 -4
- package/node_modules/@murphai/device-syncd/dist/service.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/service.js +362 -43
- package/node_modules/@murphai/device-syncd/dist/service.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/accounts.d.ts +3 -1
- package/node_modules/@murphai/device-syncd/dist/store/accounts.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/accounts.js +25 -2
- package/node_modules/@murphai/device-syncd/dist/store/accounts.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/hosted-account-hydration.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/hosted-account-hydration.js +7 -1
- package/node_modules/@murphai/device-syncd/dist/store/hosted-account-hydration.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/jobs.d.ts +13 -3
- package/node_modules/@murphai/device-syncd/dist/store/jobs.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/jobs.js +171 -20
- package/node_modules/@murphai/device-syncd/dist/store/jobs.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/oauth-states.d.ts +3 -1
- package/node_modules/@murphai/device-syncd/dist/store/oauth-states.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/oauth-states.js +62 -4
- package/node_modules/@murphai/device-syncd/dist/store/oauth-states.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sources.d.ts +1 -0
- package/node_modules/@murphai/device-syncd/dist/store/sources.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sources.js +56 -55
- package/node_modules/@murphai/device-syncd/dist/store/sources.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sync-state.d.ts +7 -2
- package/node_modules/@murphai/device-syncd/dist/store/sync-state.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sync-state.js +82 -28
- package/node_modules/@murphai/device-syncd/dist/store/sync-state.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/webhook-traces.js +2 -2
- package/node_modules/@murphai/device-syncd/dist/store/webhook-traces.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store.d.ts +19 -4
- package/node_modules/@murphai/device-syncd/dist/store.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store.js +62 -11
- package/node_modules/@murphai/device-syncd/dist/store.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/types.d.ts +169 -4
- package/node_modules/@murphai/device-syncd/dist/types.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/types.js +3 -0
- package/node_modules/@murphai/device-syncd/dist/types.js.map +1 -1
- package/node_modules/@murphai/device-syncd/package.json +8 -0
- package/node_modules/@murphai/health-commons/content/biomarkers/bilirubin.md +18 -0
- package/node_modules/@murphai/health-commons/content/biomarkers/carbon-dioxide.md +18 -0
- package/node_modules/@murphai/health-commons/content/biomarkers/potassium.md +18 -0
- package/node_modules/@murphai/health-commons/content/biomarkers/sodium.md +18 -0
- package/node_modules/@murphai/health-commons/content/families/general-eye-health.md +190 -0
- package/node_modules/@murphai/health-commons/content/families/photobiomodulation.md +97 -0
- package/node_modules/@murphai/health-commons/content/families/recovery-modalities.md +73 -0
- package/node_modules/@murphai/health-commons/content/protocols/whole-body-photobiomodulation/whole-body-red-and-near-infrared-light-exposure.md +1 -1
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/cdc-contact-lens-infection-symptoms.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/cdc-contact-lens-prevention.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/cdc-stroke-signs.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/cochrane-blue-light-filtering-lenses.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/fda-buying-contact-lenses.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/fda-eye-drops.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/imi-myopia-interventions.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/medlineplus-eye-emergencies.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/medlineplus-eye-pain.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-angle-closure-glaucoma.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-areds2-faq.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-contact-lenses.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-dry-eye.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-healthy-vision.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-myopia.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nei-retinal-detachment.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/nih-dream-omega3-dry-eye.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/osha-computer-monitors.md +20 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/pmc-9840372.md +22 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/pmid-35597519.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/pmid-36473088.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/general-eye-health/pmid-37062428.md +21 -0
- package/node_modules/@murphai/health-commons/content/sources/whole-body-photobiomodulation/clinicaltrials-gov-nct07047248-2026-04-23.md +0 -1
- package/node_modules/@murphai/health-commons/dist/biomarker-fallback-ranges.d.ts +3 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-fallback-ranges.d.ts.map +1 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-fallback-ranges.js +2 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-fallback-ranges.js.map +1 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-runtime-artifacts.d.ts +17 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-runtime-artifacts.d.ts.map +1 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-runtime-artifacts.js +16 -0
- package/node_modules/@murphai/health-commons/dist/biomarker-runtime-artifacts.js.map +1 -0
- package/node_modules/@murphai/health-commons/dist/build.d.ts.map +1 -1
- package/node_modules/@murphai/health-commons/dist/build.js +41 -7
- package/node_modules/@murphai/health-commons/dist/build.js.map +1 -1
- package/node_modules/@murphai/health-commons/dist/index.d.ts +1 -0
- package/node_modules/@murphai/health-commons/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/health-commons/dist/index.js +1 -0
- package/node_modules/@murphai/health-commons/dist/index.js.map +1 -1
- package/node_modules/@murphai/health-commons/dist/knowledge-index.d.ts +44 -0
- package/node_modules/@murphai/health-commons/dist/knowledge-index.d.ts.map +1 -0
- package/node_modules/@murphai/health-commons/dist/knowledge-index.js +540 -0
- package/node_modules/@murphai/health-commons/dist/knowledge-index.js.map +1 -0
- package/node_modules/@murphai/health-commons/dist/runtime.d.ts +17 -1
- package/node_modules/@murphai/health-commons/dist/runtime.d.ts.map +1 -1
- package/node_modules/@murphai/health-commons/dist/runtime.js +58 -4
- package/node_modules/@murphai/health-commons/dist/runtime.js.map +1 -1
- package/node_modules/@murphai/health-commons/generated/biomarker-desired-directions.json +410 -0
- package/node_modules/@murphai/health-commons/generated/catalog.hash +1 -1
- package/node_modules/@murphai/health-commons/generated/knowledge.sqlite +0 -0
- package/node_modules/@murphai/health-commons/generated/protocol-family-graph.json +187 -46
- package/node_modules/@murphai/health-commons/generated/protocol-index.json +47 -47
- package/node_modules/@murphai/health-commons/generated/protocol-run-specs.json +967 -967
- package/node_modules/@murphai/health-commons/generated/source-artifact-index.json +1 -1
- package/node_modules/@murphai/health-commons/generated/source-identities.ndjson +28 -0
- package/node_modules/@murphai/health-commons/generated/source-index.json +694 -2
- package/node_modules/@murphai/health-commons/generated/web/browse/biomarkers.json +77 -9
- package/node_modules/@murphai/health-commons/generated/web/browse/experiments.json +37 -37
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-basophils.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-eosinophils.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-immature-granulocytes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-lymphocytes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-monocytes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/absolute-neutrophils.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/added-sugar-intake.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/adherence.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/adjusted-calcium.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/adverse-symptoms.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alanine-aminotransferase.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/albumin-globulin-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/albumin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alcohol-craving.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alcohol-free-days.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alcohol-intake.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alcohol-withdrawal-symptoms.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/alkaline-phosphatase.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ana-screen.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/anion-gap.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ankle-knee-to-wall-distance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/apolipoprotein-b.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/arachidonic-acid-epa-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/arachidonic-acid.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/aspartate-aminotransferase.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/basophil-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/bedtime-delay.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/bilirubin.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/blood-glucose.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/blood-ketones-beta-hydroxybutyrate.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/blood-oxygen-spo2.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/blood-pressure.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/blood-urea-nitrogen.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/body-fat-percent.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/body-weight.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/bun-creatinine-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/c-peptide.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/calcium.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/carbon-dioxide.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/chloride.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/cholesterol-hdl-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/chosen-primary-outcome-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/continuous-glucose.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/cortisol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/creatine-kinase.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/daily-energy-intake-kcal.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/daily-protein-g-per-kg.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/daily-protein-grams.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/daily-step-count.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/daytime-sleepiness.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/deep-sleep-minutes.json +4 -4
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/dha.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/dhea-sulfate.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/dietary-fiber-g-day.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/digestive-comfort.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/dpa.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/egfr-ckd-epi.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/egfr.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/eosinophil-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/epa.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/estimated-gfr.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/estimated-vo2max.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/estradiol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/fasting-triglycerides.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ferritin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/fib4.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/follicle-stimulating-hormone.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/free-t3.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/free-t4.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/free-testosterone.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/gfr-mdrd-af-amer.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/gfr-mdrd-non-af-amer.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ggt.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/gi-symptom-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/gi-tolerance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hba1c.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hbot-session-tolerability.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hdl-c.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hematocrit.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hemoglobin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/homocysteine.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hrv-rmssd.json +4 -4
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/hs-crp.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/immature-granulocyte-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/insulin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/iron-saturation.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/iron.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lateral-knee-pain.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldh.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-c.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-calculated.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-chol-calc-nih.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-cholesterol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-large-particles.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-medium-particles.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-particle-number.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-pattern.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-peak-size.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/ldl-small-particles.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lead.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lean-body-mass.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lean-mass.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/leg-heaviness-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/linoleic-acid.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lipoprotein-a.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/liver-enzyme-panel.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/luteinizing-hormone.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/lymphocyte-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/macular-health-safety.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/magnesium-rbc.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mean-corpuscular-hemoglobin-concentration.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mean-corpuscular-hemoglobin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mean-corpuscular-volume.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mean-platelet-volume.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mercury.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/methylmalonic-acid.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/moderate-to-vigorous-activity-minutes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/monocyte-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/mood-affect.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/morning-blood-pressure.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/muscle-soreness-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/musculoskeletal-pain.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/neutrophil-percentage.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/non-hdl-c.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/non-hdl-cholesterol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/omega-3-index.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/omega-3-total-omegacheck.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/omega-6-3-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/omega-6-total.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/omegacheck-total.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/perceived-recovery-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/perceived-recovery.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/perceived-stiffness.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/perceived-stress.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/periocular-wrinkle-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/phosphate.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/platelet-count.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/poc-troponin-i.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/postprandial-glucose-excursion.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/potassium.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/pre-sleep-arousal.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/prolactin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/psa-free.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/psa-percent-free.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/psa-total.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/red-blood-cell-count.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/red-cell-distribution-width.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/rem-sleep-minutes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/resting-heart-rate.json +4 -4
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/rheumatoid-factor.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/running-tolerance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/saturated-fat-g-day.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sedentary-time.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/self-reported-mood.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/serum-25-hydroxyvitamin-d.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/serum-creatinine.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/serum-uric-acid.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sex-hormone-binding-globulin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/shoulder-reach-distance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sit-and-reach-distance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/skin-texture-roughness-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/skin-tolerability-symptoms.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sleep-efficiency.json +4 -4
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sleep-onset-latency.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sleep-quality.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/sodium.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/standardized-skin-photo-score.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/step-floor-days.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/stretching-adherence-sessions.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/stretching-session-burden.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/stretching-symptoms.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/subjective-eye-strain.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/subjective-satiety.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/supplement-adherence.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/task-performance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/thyroglobulin-antibodies.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/thyroid-peroxidase-antibodies.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/thyroid-stimulating-hormone.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/toe-touch-distance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-cholesterol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-globulin.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-iron-binding-capacity.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-protein.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-sleep-time.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/total-testosterone.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/training-performance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/training-volume.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/triglycerides.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/urine-albumin-creatinine-ratio.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/urine-albumin-random-without-creatinine.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/urine-protein.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/visual-fatigue.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/visual-performance.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/vldl-cholesterol-calculated.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/waist-circumference.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/wake-after-sleep-onset.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/wake-time-variability.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/walking-bout-minutes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/walking-cadence.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/walking-safety-events.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/white-blood-cell-count.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/biomarker/zinc.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/measurement_method/clinic-imaging-upgrade.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/measurement_method/home-standardized-photo-roi-analysis.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/measurement_method/standardized-photo-score-workflow.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/bryan-johnson-blueprint.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/cold-plunge.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/consistent-wake-time.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/daily-step-floor.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/finnish-sauna.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/five-minute-tomorrow-list.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/hyperbaric-oxygen-therapy.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/morning-outdoor-light-exposure.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/no-added-sugar-diet.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/norwegian-4x4.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/pneumatic-compression-pants.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/protein-floor-high-protein-intake.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/tabata-20-10-interval-training.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/time-restricted-eating-18-6.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/walking-after-every-meal.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/bundles/protocol_variant/whole-body-red-and-near-infrared-light-exposure.json +7 -8
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/blood-oxygen-spo2/overview.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/blood-oxygen-spo2/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/deep-sleep-minutes/overview.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/deep-sleep-minutes/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/estimated-vo2max/overview.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/estimated-vo2max/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/hrv-rmssd/overview.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/hrv-rmssd/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/rem-sleep-minutes/overview.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/rem-sleep-minutes/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/resting-heart-rate/overview.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/pages/biomarkers/resting-heart-rate/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/routes/index.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/blood-oxygen-spo2.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/deep-sleep-minutes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/estimated-vo2max.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/hrv-rmssd.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/rem-sleep-minutes.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/biomarkers/resting-heart-rate.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/bryan-johnson-blueprint.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/cold-plunge.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/consistent-wake-time.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/daily-step-floor.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/finnish-sauna.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/five-minute-tomorrow-list.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/hyperbaric-oxygen-therapy.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/morning-outdoor-light-exposure.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/no-added-sugar-diet.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/norwegian-4x4.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/pneumatic-compression-pants.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/protein-floor-high-protein-intake.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/tabata-20-10-interval-training.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/time-restricted-eating-18-6.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/walking-after-every-meal.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/shell/experiments/whole-body-red-and-near-infrared-light-exposure.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/bryan-johnson-blueprint/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/bryan-johnson-blueprint/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/bryan-johnson-blueprint/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/cold-plunge/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/cold-plunge/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/cold-plunge/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/consistent-wake-time/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/consistent-wake-time/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/consistent-wake-time/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/daily-step-floor/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/daily-step-floor/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/daily-step-floor/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/finnish-sauna/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/finnish-sauna/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/finnish-sauna/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/five-minute-tomorrow-list/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/five-minute-tomorrow-list/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/five-minute-tomorrow-list/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/hyperbaric-oxygen-therapy/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/hyperbaric-oxygen-therapy/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/hyperbaric-oxygen-therapy/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/morning-outdoor-light-exposure/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/morning-outdoor-light-exposure/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/morning-outdoor-light-exposure/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/no-added-sugar-diet/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/no-added-sugar-diet/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/no-added-sugar-diet/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/norwegian-4x4/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/norwegian-4x4/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/norwegian-4x4/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/pneumatic-compression-pants/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/pneumatic-compression-pants/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/pneumatic-compression-pants/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/protein-floor-high-protein-intake/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/protein-floor-high-protein-intake/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/protein-floor-high-protein-intake/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/tabata-20-10-interval-training/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/tabata-20-10-interval-training/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/tabata-20-10-interval-training/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/time-restricted-eating-18-6/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/time-restricted-eating-18-6/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/time-restricted-eating-18-6/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/walking-after-every-meal/protocol.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/walking-after-every-meal/research.json +1 -1
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/walking-after-every-meal/results-public.json +2 -2
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/whole-body-red-and-near-infrared-light-exposure/protocol.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/whole-body-red-and-near-infrared-light-exposure/research.json +3 -3
- package/node_modules/@murphai/health-commons/generated/web/tabs/experiments/whole-body-red-and-near-infrared-light-exposure/results-public.json +5 -5
- package/node_modules/@murphai/health-commons/package.json +5 -0
- package/node_modules/@murphai/health-metrics/dist/catalog.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/catalog.js +22 -2
- package/node_modules/@murphai/health-metrics/dist/catalog.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/definitions/activity.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/definitions/activity.js +99 -0
- package/node_modules/@murphai/health-metrics/dist/definitions/activity.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/definitions/body.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/definitions/body.js +69 -2
- package/node_modules/@murphai/health-metrics/dist/definitions/body.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/definitions/physiology.d.ts +55 -0
- package/node_modules/@murphai/health-metrics/dist/definitions/physiology.d.ts.map +1 -0
- package/node_modules/@murphai/health-metrics/dist/definitions/physiology.js +92 -0
- package/node_modules/@murphai/health-metrics/dist/definitions/physiology.js.map +1 -0
- package/node_modules/@murphai/health-metrics/dist/definitions/vitals.d.ts +1 -1
- package/node_modules/@murphai/health-metrics/dist/index.d.ts +1 -0
- package/node_modules/@murphai/health-metrics/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/index.js +1 -0
- package/node_modules/@murphai/health-metrics/dist/index.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/lab-reference-ranges.d.ts +45 -0
- package/node_modules/@murphai/health-metrics/dist/lab-reference-ranges.d.ts.map +1 -0
- package/node_modules/@murphai/health-metrics/dist/lab-reference-ranges.js +502 -0
- package/node_modules/@murphai/health-metrics/dist/lab-reference-ranges.js.map +1 -0
- package/node_modules/@murphai/health-metrics/dist/normalize.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/normalize.js +2 -0
- package/node_modules/@murphai/health-metrics/dist/normalize.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/selectors.d.ts +3 -0
- package/node_modules/@murphai/health-metrics/dist/selectors.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/selectors.js +52 -6
- package/node_modules/@murphai/health-metrics/dist/selectors.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/types.d.ts +1 -0
- package/node_modules/@murphai/health-metrics/dist/types.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-metric-catalog.d.ts +10 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-metric-catalog.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-metric-catalog.js +29 -0
- package/node_modules/@murphai/health-metrics/dist/wearable-metric-catalog.js.map +1 -1
- package/node_modules/@murphai/importers/README.md +2 -0
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.js +1 -1
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.js.map +1 -1
- package/node_modules/@murphai/importers/dist/core-port.d.ts +1 -0
- package/node_modules/@murphai/importers/dist/core-port.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/core-port.js.map +1 -1
- package/node_modules/@murphai/importers/dist/csv-sample-import-planner.d.ts +1 -0
- package/node_modules/@murphai/importers/dist/csv-sample-import-planner.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/csv-sample-import-planner.js +1 -1
- package/node_modules/@murphai/importers/dist/csv-sample-import-planner.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.js +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/index.d.ts +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/index.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/index.js +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/index.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-bounded-features.d.ts +27 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-bounded-features.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-bounded-features.js +403 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-bounded-features.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.d.ts +4 -12
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.js +18 -107
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-fidelity.d.ts +285 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-fidelity.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-fidelity.js +870 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-fidelity.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction.d.ts +38 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction.js +2682 -259
- package/node_modules/@murphai/importers/dist/device-providers/junction.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/oura.js +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/oura.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/whoop.js +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/whoop.js.map +1 -1
- package/node_modules/@murphai/importers/dist/document-importer.d.ts +1 -0
- package/node_modules/@murphai/importers/dist/document-importer.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/document-importer.js +3 -1
- package/node_modules/@murphai/importers/dist/document-importer.js.map +1 -1
- package/node_modules/@murphai/importers/dist/index.d.ts +1 -0
- package/node_modules/@murphai/importers/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/index.js +1 -0
- package/node_modules/@murphai/importers/dist/index.js.map +1 -1
- package/node_modules/@murphai/importers/dist/meal-importer.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/meal-importer.js +2 -1
- package/node_modules/@murphai/importers/dist/meal-importer.js.map +1 -1
- package/node_modules/@murphai/importers/dist/preset-registry.js +1 -1
- package/node_modules/@murphai/importers/dist/preset-registry.js.map +1 -1
- package/node_modules/@murphai/importers/dist/shared.d.ts +1 -1
- package/node_modules/@murphai/importers/dist/shared.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/shared.js +1 -1
- package/node_modules/@murphai/importers/dist/shared.js.map +1 -1
- package/node_modules/@murphai/importers/dist/workout-csv-planner.d.ts +49 -0
- package/node_modules/@murphai/importers/dist/workout-csv-planner.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/workout-csv-planner.js +860 -0
- package/node_modules/@murphai/importers/dist/workout-csv-planner.js.map +1 -0
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor-strategies.d.ts +2 -5
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor-strategies.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor-strategies.js +3 -50
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor-strategies.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor.js +9 -11
- package/node_modules/@murphai/inbox-services/dist/inbox-app/bootstrap-doctor.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/environment.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/environment.js +0 -160
- package/node_modules/@murphai/inbox-services/dist/inbox-app/environment.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/runtime.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/runtime.js +2 -4
- package/node_modules/@murphai/inbox-services/dist/inbox-app/runtime.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/sources.d.ts +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/sources.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/sources.js +2 -32
- package/node_modules/@murphai/inbox-services/dist/inbox-app/sources.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/types.d.ts +2 -79
- package/node_modules/@murphai/inbox-services/dist/inbox-app/types.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/types.js +0 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-app/types.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/connectors.d.ts +1 -2
- package/node_modules/@murphai/inbox-services/dist/inbox-services/connectors.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/connectors.js +15 -37
- package/node_modules/@murphai/inbox-services/dist/inbox-services/connectors.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/promotions.d.ts +21 -21
- package/node_modules/@murphai/inbox-services/dist/inbox-services/promotions.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/promotions.js +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/promotions.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/shared.d.ts +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/shared.d.ts.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/shared.js +0 -1
- package/node_modules/@murphai/inbox-services/dist/inbox-services/shared.js.map +1 -1
- package/node_modules/@murphai/inbox-services/dist/index.d.ts +1 -1
- package/node_modules/@murphai/inbox-services/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/README.md +3 -3
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize-parsed.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize-parsed.js +56 -5
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize-parsed.js.map +1 -1
- package/node_modules/@murphai/inboxd/dist/connectors/linq/normalize.js +8 -0
- package/node_modules/@murphai/inboxd/dist/connectors/linq/normalize.js.map +1 -1
- package/node_modules/@murphai/inboxd/dist/connectors/telegram/normalize.d.ts +1 -0
- package/node_modules/@murphai/inboxd/dist/connectors/telegram/normalize.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/connectors/telegram/normalize.js +1 -0
- package/node_modules/@murphai/inboxd/dist/connectors/telegram/normalize.js.map +1 -1
- package/node_modules/@murphai/inboxd/dist/index.d.ts +0 -5
- package/node_modules/@murphai/inboxd/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/index.js +0 -2
- package/node_modules/@murphai/inboxd/dist/index.js.map +1 -1
- package/node_modules/@murphai/inboxd/dist/indexing/attachment-storage-normalizer.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/indexing/attachment-storage-normalizer.js +141 -4
- package/node_modules/@murphai/inboxd/dist/indexing/attachment-storage-normalizer.js.map +1 -1
- package/node_modules/@murphai/messaging-ingress/README.md +5 -1
- package/node_modules/@murphai/messaging-ingress/dist/linq-webhook.d.ts +27 -1
- package/node_modules/@murphai/messaging-ingress/dist/linq-webhook.d.ts.map +1 -1
- package/node_modules/@murphai/messaging-ingress/dist/linq-webhook.js +164 -17
- package/node_modules/@murphai/messaging-ingress/dist/linq-webhook.js.map +1 -1
- package/node_modules/@murphai/messaging-ingress/dist/telegram-webhook-payload.d.ts +1 -0
- package/node_modules/@murphai/messaging-ingress/dist/telegram-webhook-payload.d.ts.map +1 -1
- package/node_modules/@murphai/messaging-ingress/dist/telegram-webhook-payload.js +2 -0
- package/node_modules/@murphai/messaging-ingress/dist/telegram-webhook-payload.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/codex-resume-state.d.ts +3 -3
- package/node_modules/@murphai/operator-config/dist/assistant/codex-resume-state.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/codex-resume-state.js +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/codex-resume-state.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/current-delivery-route.d.ts +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/current-delivery-route.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/current-delivery-route.js +7 -19
- package/node_modules/@murphai/operator-config/dist/assistant/current-delivery-route.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/hosted-config.d.ts +31 -33
- package/node_modules/@murphai/operator-config/dist/assistant/hosted-config.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/hosted-config.js +5 -8
- package/node_modules/@murphai/operator-config/dist/assistant/hosted-config.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/provider-config.d.ts +1 -15
- package/node_modules/@murphai/operator-config/dist/assistant/provider-config.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/provider-config.js +52 -84
- package/node_modules/@murphai/operator-config/dist/assistant/provider-config.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/target-runtime.d.ts +31 -48
- package/node_modules/@murphai/operator-config/dist/assistant/target-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant/target-runtime.js +33 -56
- package/node_modules/@murphai/operator-config/dist/assistant/target-runtime.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant-backend.d.ts +11 -11
- package/node_modules/@murphai/operator-config/dist/assistant-backend.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant-backend.js +33 -45
- package/node_modules/@murphai/operator-config/dist/assistant-backend.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant-cli-contracts.d.ts +1713 -1566
- package/node_modules/@murphai/operator-config/dist/assistant-cli-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant-cli-contracts.js +193 -23
- package/node_modules/@murphai/operator-config/dist/assistant-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/assistant-response-cards.d.ts +445 -0
- package/node_modules/@murphai/operator-config/dist/assistant-response-cards.d.ts.map +1 -0
- package/node_modules/@murphai/operator-config/dist/assistant-response-cards.js +1030 -0
- package/node_modules/@murphai/operator-config/dist/assistant-response-cards.js.map +1 -0
- package/node_modules/@murphai/operator-config/dist/command-helpers.d.ts +4 -2
- package/node_modules/@murphai/operator-config/dist/command-helpers.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/command-helpers.js +36 -1
- package/node_modules/@murphai/operator-config/dist/command-helpers.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/device-cli-contracts.d.ts +181 -181
- package/node_modules/@murphai/operator-config/dist/device-cli-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/device-cli-contracts.js +1 -1
- package/node_modules/@murphai/operator-config/dist/device-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/device-sync-client.js +1 -1
- package/node_modules/@murphai/operator-config/dist/device-sync-client.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/elevenlabs-runtime.d.ts +3 -0
- package/node_modules/@murphai/operator-config/dist/elevenlabs-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/elevenlabs-runtime.js +301 -63
- package/node_modules/@murphai/operator-config/dist/elevenlabs-runtime.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config-constants.d.ts +3 -2
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config-constants.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config-constants.js +3 -0
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config-constants.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config.js +2 -6
- package/node_modules/@murphai/operator-config/dist/hosted-assistant-config.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/http-json-retry.d.ts +7 -2
- package/node_modules/@murphai/operator-config/dist/http-json-retry.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/http-json-retry.js +33 -14
- package/node_modules/@murphai/operator-config/dist/http-json-retry.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/inbox-cli-contracts.d.ts +427 -462
- package/node_modules/@murphai/operator-config/dist/inbox-cli-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/inbox-cli-contracts.js +2 -14
- package/node_modules/@murphai/operator-config/dist/inbox-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/linq-runtime.d.ts +35 -1
- package/node_modules/@murphai/operator-config/dist/linq-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/linq-runtime.js +1115 -180
- package/node_modules/@murphai/operator-config/dist/linq-runtime.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/message-formatting.d.ts +1 -0
- package/node_modules/@murphai/operator-config/dist/message-formatting.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/message-formatting.js +3 -1
- package/node_modules/@murphai/operator-config/dist/message-formatting.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/message-table-fallback.d.ts +7 -0
- package/node_modules/@murphai/operator-config/dist/message-table-fallback.d.ts.map +1 -0
- package/node_modules/@murphai/operator-config/dist/message-table-fallback.js +109 -0
- package/node_modules/@murphai/operator-config/dist/message-table-fallback.js.map +1 -0
- package/node_modules/@murphai/operator-config/dist/operator-config/self-delivery-targets.d.ts +12 -12
- package/node_modules/@murphai/operator-config/dist/operator-config/self-delivery-targets.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/operator-config/self-delivery-targets.js +1 -1
- package/node_modules/@murphai/operator-config/dist/operator-config/self-delivery-targets.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/operator-config.d.ts +50 -53
- package/node_modules/@murphai/operator-config/dist/operator-config.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/operator-config.js +4 -5
- package/node_modules/@murphai/operator-config/dist/operator-config.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/setup-cli-contracts.d.ts +225 -226
- package/node_modules/@murphai/operator-config/dist/setup-cli-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/setup-cli-contracts.js +2 -2
- package/node_modules/@murphai/operator-config/dist/setup-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/setup-runtime-env.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/setup-runtime-env.js +0 -19
- package/node_modules/@murphai/operator-config/dist/setup-runtime-env.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/vault-cli-contracts.d.ts +336 -294
- package/node_modules/@murphai/operator-config/dist/vault-cli-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/vault-cli-contracts.js +36 -8
- package/node_modules/@murphai/operator-config/dist/vault-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.d.ts +5 -0
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.d.ts.map +1 -0
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.js +84 -0
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.js.map +1 -0
- package/node_modules/@murphai/operator-config/package.json +10 -5
- package/node_modules/@murphai/parsers/dist/adapters/ffmpeg.d.ts +2 -0
- package/node_modules/@murphai/parsers/dist/adapters/ffmpeg.d.ts.map +1 -1
- package/node_modules/@murphai/parsers/dist/adapters/ffmpeg.js +18 -0
- package/node_modules/@murphai/parsers/dist/adapters/ffmpeg.js.map +1 -1
- package/node_modules/@murphai/query/README.md +9 -0
- package/node_modules/@murphai/query/dist/automation.d.ts +5 -2
- package/node_modules/@murphai/query/dist/automation.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/automation.js +33 -8
- package/node_modules/@murphai/query/dist/automation.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-biomarkers.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser-biomarkers.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-biomarkers.js +1 -1
- package/node_modules/@murphai/query/dist/browser-biomarkers.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-experiments.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser-experiments.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-experiments.js +1 -1
- package/node_modules/@murphai/query/dist/browser-experiments.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-murph-age.d.ts +1 -1
- package/node_modules/@murphai/query/dist/browser-murph-age.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-overview.d.ts +2 -1
- package/node_modules/@murphai/query/dist/browser-overview.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/biomarker-panel.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser-replica/biomarker-panel.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/build.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/build.js +45 -27
- package/node_modules/@murphai/query/dist/browser-replica/build.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/client-overview.d.ts +3 -3
- package/node_modules/@murphai/query/dist/browser-replica/client-overview.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/client-overview.js +3 -0
- package/node_modules/@murphai/query/dist/browser-replica/client-overview.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/device-metrics.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser-replica/device-metrics.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/device-metrics.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/experiment-run-cards.d.ts +8 -0
- package/node_modules/@murphai/query/dist/browser-replica/experiment-run-cards.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/experiment-run-cards.js +548 -0
- package/node_modules/@murphai/query/dist/browser-replica/experiment-run-cards.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/experiments.d.ts +22 -2
- package/node_modules/@murphai/query/dist/browser-replica/experiments.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/experiments.js +209 -63
- package/node_modules/@murphai/query/dist/browser-replica/experiments.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/lab-result-status.d.ts +11 -0
- package/node_modules/@murphai/query/dist/browser-replica/lab-result-status.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/lab-result-status.js +233 -0
- package/node_modules/@murphai/query/dist/browser-replica/lab-result-status.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/lab-results.d.ts +4 -3
- package/node_modules/@murphai/query/dist/browser-replica/lab-results.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/lab-results.js +24 -5
- package/node_modules/@murphai/query/dist/browser-replica/lab-results.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/metric-buckets.d.ts +14 -0
- package/node_modules/@murphai/query/dist/browser-replica/metric-buckets.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/metric-buckets.js +25 -0
- package/node_modules/@murphai/query/dist/browser-replica/metric-buckets.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/murph-age.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser-replica/murph-age.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/murph-age.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/parse.d.ts +8 -0
- package/node_modules/@murphai/query/dist/browser-replica/parse.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/parse.js +327 -7
- package/node_modules/@murphai/query/dist/browser-replica/parse.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/query.d.ts +24 -1
- package/node_modules/@murphai/query/dist/browser-replica/query.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/query.js +246 -41
- package/node_modules/@murphai/query/dist/browser-replica/query.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/search-row.d.ts +3 -0
- package/node_modules/@murphai/query/dist/browser-replica/search-row.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/search-row.js +16 -0
- package/node_modules/@murphai/query/dist/browser-replica/search-row.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/shards.d.ts +76 -0
- package/node_modules/@murphai/query/dist/browser-replica/shards.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/shards.js +232 -0
- package/node_modules/@murphai/query/dist/browser-replica/shards.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/shared.d.ts +143 -9
- package/node_modules/@murphai/query/dist/browser-replica/shared.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/shared.js +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/shared.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/tracked-experiments.d.ts +3 -3
- package/node_modules/@murphai/query/dist/browser-replica/tracked-experiments.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/tracked-experiments.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/training.d.ts +7 -0
- package/node_modules/@murphai/query/dist/browser-replica/training.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/training.js +241 -0
- package/node_modules/@murphai/query/dist/browser-replica/training.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/views.d.ts +5 -5
- package/node_modules/@murphai/query/dist/browser-replica/views.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica/views.js +3 -0
- package/node_modules/@murphai/query/dist/browser-replica/views.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica-client.d.ts +11 -4
- package/node_modules/@murphai/query/dist/browser-replica-client.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica-client.js +7 -3
- package/node_modules/@murphai/query/dist/browser-replica-client.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica-server.d.ts +5 -0
- package/node_modules/@murphai/query/dist/browser-replica-server.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica-server.js +5 -0
- package/node_modules/@murphai/query/dist/browser-replica-server.js.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica.d.ts +13 -5
- package/node_modules/@murphai/query/dist/browser-replica.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser-replica.js +9 -4
- package/node_modules/@murphai/query/dist/browser-replica.js.map +1 -1
- package/node_modules/@murphai/query/dist/browser.d.ts +2 -2
- package/node_modules/@murphai/query/dist/browser.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/browser.js +1 -1
- package/node_modules/@murphai/query/dist/browser.js.map +1 -1
- package/node_modules/@murphai/query/dist/canonical-observation-metrics.d.ts +16 -0
- package/node_modules/@murphai/query/dist/canonical-observation-metrics.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/canonical-observation-metrics.js +70 -0
- package/node_modules/@murphai/query/dist/canonical-observation-metrics.js.map +1 -0
- package/node_modules/@murphai/query/dist/experiment-adherence.d.ts +20 -0
- package/node_modules/@murphai/query/dist/experiment-adherence.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/experiment-adherence.js +175 -29
- package/node_modules/@murphai/query/dist/experiment-adherence.js.map +1 -1
- package/node_modules/@murphai/query/dist/experiment-progress-card.d.ts +1 -0
- package/node_modules/@murphai/query/dist/experiment-progress-card.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/experiment-progress-card.js +1 -0
- package/node_modules/@murphai/query/dist/experiment-progress-card.js.map +1 -1
- package/node_modules/@murphai/query/dist/experiments.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/experiments.js +46 -22
- package/node_modules/@murphai/query/dist/experiments.js.map +1 -1
- package/node_modules/@murphai/query/dist/group-weekly.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/group-weekly.js +52 -1
- package/node_modules/@murphai/query/dist/group-weekly.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/shared.js +1 -1
- package/node_modules/@murphai/query/dist/health/shared.js.map +1 -1
- package/node_modules/@murphai/query/dist/index.d.ts +21 -4
- package/node_modules/@murphai/query/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/index.js +14 -3
- package/node_modules/@murphai/query/dist/index.js.map +1 -1
- package/node_modules/@murphai/query/dist/knowledge-contracts.d.ts +78 -75
- package/node_modules/@murphai/query/dist/knowledge-contracts.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/knowledge-contracts.js +2 -1
- package/node_modules/@murphai/query/dist/knowledge-contracts.js.map +1 -1
- package/node_modules/@murphai/query/dist/knowledge-graph.d.ts +1 -0
- package/node_modules/@murphai/query/dist/knowledge-graph.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/knowledge-graph.js +17 -1
- package/node_modules/@murphai/query/dist/knowledge-graph.js.map +1 -1
- package/node_modules/@murphai/query/dist/meal-nutrition.d.ts +26 -0
- package/node_modules/@murphai/query/dist/meal-nutrition.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/meal-nutrition.js +111 -5
- package/node_modules/@murphai/query/dist/meal-nutrition.js.map +1 -1
- package/node_modules/@murphai/query/dist/metrics/index.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/metrics/index.js +14 -1
- package/node_modules/@murphai/query/dist/metrics/index.js.map +1 -1
- package/node_modules/@murphai/query/dist/metrics/projection.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/metrics/projection.js +110 -3
- package/node_modules/@murphai/query/dist/metrics/projection.js.map +1 -1
- package/node_modules/@murphai/query/dist/personal-patterns.d.ts +55 -0
- package/node_modules/@murphai/query/dist/personal-patterns.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/personal-patterns.js +401 -0
- package/node_modules/@murphai/query/dist/personal-patterns.js.map +1 -0
- package/node_modules/@murphai/query/dist/projection/schema.d.ts +1 -1
- package/node_modules/@murphai/query/dist/projection/schema.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/projection/schema.js +3 -1
- package/node_modules/@murphai/query/dist/projection/schema.js.map +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-compose.js +4 -0
- package/node_modules/@murphai/query/dist/projection/wearable-summary-compose.js.map +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-projector.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-projector.js +2 -2
- package/node_modules/@murphai/query/dist/projection/wearable-summary-projector.js.map +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-stored-codec.js +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-stored-codec.js.map +1 -1
- package/node_modules/@murphai/query/dist/query-projection.d.ts +14 -0
- package/node_modules/@murphai/query/dist/query-projection.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/query-projection.js +31 -0
- package/node_modules/@murphai/query/dist/query-projection.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/candidates.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/candidates.js +6 -0
- package/node_modules/@murphai/query/dist/wearables/candidates.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/public-output.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/public-output.js +37 -2
- package/node_modules/@murphai/query/dist/wearables/public-output.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/sleep-pattern.d.ts +5 -1
- package/node_modules/@murphai/query/dist/wearables/sleep-pattern.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/sleep-pattern.js +16 -3
- package/node_modules/@murphai/query/dist/wearables/sleep-pattern.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/source-health.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/source-health.js +27 -4
- package/node_modules/@murphai/query/dist/wearables/source-health.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/types.d.ts +17 -4
- package/node_modules/@murphai/query/dist/wearables/types.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/types.js +34 -0
- package/node_modules/@murphai/query/dist/wearables/types.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables.js +55 -4
- package/node_modules/@murphai/query/dist/wearables.js.map +1 -1
- package/node_modules/@murphai/query/package.json +10 -0
- package/node_modules/@murphai/runtime-state/README.md +2 -2
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.js +15 -2
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.d.ts +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.js +45 -20
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-crypto-keyrings.d.ts +32 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-crypto-keyrings.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-crypto-keyrings.js +327 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-crypto-keyrings.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-domain-crypto.d.ts +3 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-domain-crypto.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-domain-crypto.js +23 -3
- package/node_modules/@murphai/runtime-state/dist/hosted-domain-crypto.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-storage.d.ts +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-storage.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-storage.js +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-storage.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/sqlite.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/sqlite.js +22 -6
- package/node_modules/@murphai/runtime-state/dist/sqlite.js.map +1 -1
- package/node_modules/@murphai/setup-cli/README.md +1 -1
- package/node_modules/@murphai/setup-cli/dist/index.d.ts +0 -1
- package/node_modules/@murphai/setup-cli/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/index.js +0 -1
- package/node_modules/@murphai/setup-cli/dist/index.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant-account.js +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant-account.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant-defaults.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant-defaults.js +14 -24
- package/node_modules/@murphai/setup-cli/dist/setup-assistant-defaults.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant.js +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-assistant.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-cli.d.ts +1 -2
- package/node_modules/@murphai/setup-cli/dist/setup-cli.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-cli.js +2 -4
- package/node_modules/@murphai/setup-cli/dist/setup-cli.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-services/channels.d.ts +0 -4
- package/node_modules/@murphai/setup-cli/dist/setup-services/channels.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-services/channels.js +126 -420
- package/node_modules/@murphai/setup-cli/dist/setup-services/channels.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-services.d.ts +0 -3
- package/node_modules/@murphai/setup-cli/dist/setup-services.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-services.js +0 -7
- package/node_modules/@murphai/setup-cli/dist/setup-services.js.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-wizard-options.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/setup-wizard-options.js +0 -7
- package/node_modules/@murphai/setup-cli/dist/setup-wizard-options.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/clinical-records.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/clinical-records.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/experiment-onboarding-options.d.ts +3 -3
- package/node_modules/@murphai/vault-usecases/dist/experiment-onboarding-options.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/experiment-onboarding-options.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/experiment-onboarding-options.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/export-packs.d.ts +7 -0
- package/node_modules/@murphai/vault-usecases/dist/export-packs.d.ts.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/export-packs.js +45 -0
- package/node_modules/@murphai/vault-usecases/dist/export-packs.js.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/health-cli-descriptors.d.ts +28 -28
- package/node_modules/@murphai/vault-usecases/dist/health-cli-descriptors.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/health-cli-descriptors.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/health-cli-descriptors.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/json-input.d.ts +1 -1
- package/node_modules/@murphai/vault-usecases/dist/json-input.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/json-input.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/json-input.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/query-runtime.d.ts +5 -1
- package/node_modules/@murphai/vault-usecases/dist/query-runtime.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/query-runtime.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/testing/junction-wearable-fixture.d.ts +1 -1
- package/node_modules/@murphai/vault-usecases/dist/testing/junction-wearable-fixture.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/capture.d.ts +21 -21
- package/node_modules/@murphai/vault-usecases/dist/usecases/capture.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/capture.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/capture.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/clinical-imports.d.ts +193 -193
- package/node_modules/@murphai/vault-usecases/dist/usecases/clinical-imports.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/clinical-imports.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/clinical-imports.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/document-meal-read.d.ts +12 -12
- package/node_modules/@murphai/vault-usecases/dist/usecases/document-meal-read.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/document-meal-read.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/document-meal-read.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/encounter.d.ts +130 -130
- package/node_modules/@murphai/vault-usecases/dist/usecases/encounter.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/encounter.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/encounter.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/event-record-mutations.d.ts +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/event-record-mutations.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/event-record-mutations.js +22 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/event-record-mutations.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.d.ts +28 -5
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.js +225 -37
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food-autolog.d.ts +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food-autolog.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food-autolog.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food-autolog.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food.js +0 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/food.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/integrated-services.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/integrated-services.js +77 -9
- package/node_modules/@murphai/vault-usecases/dist/usecases/integrated-services.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement-read.d.ts +95 -13
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement-read.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement-read.js +136 -3
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement-read.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement.js +3 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/measurement.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/provider-event.d.ts +4 -4
- package/node_modules/@murphai/vault-usecases/dist/usecases/provider-event.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/provider-event.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/provider-event.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/recipe.d.ts +3 -3
- package/node_modules/@murphai/vault-usecases/dist/usecases/recipe.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/recipe.js +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/recipe.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/runtime.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/runtime.js +2 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/runtime.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/types.d.ts +44 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/types.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-core.d.ts +7 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-core.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-core.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-format.d.ts +2 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-format.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-import.d.ts +60 -7
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-import.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-import.js +1282 -494
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-import.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-model.d.ts +84 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-model.d.ts.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-model.js +195 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-model.js.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-state.d.ts +36 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-state.d.ts.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-state.js +285 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live-state.js.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live.d.ts +122 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live.d.ts.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live.js +507 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-live.js.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-model.d.ts +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-model.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-model.js +2 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-model.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-read.d.ts +13 -13
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-read.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-read.js +3 -2
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout-read.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.d.ts +25 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.js +118 -3
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/vault-services.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/vault-services.js +3 -0
- package/node_modules/@murphai/vault-usecases/dist/vault-services.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/workouts.d.ts +1 -0
- package/node_modules/@murphai/vault-usecases/dist/workouts.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/workouts.js +1 -0
- package/node_modules/@murphai/vault-usecases/dist/workouts.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/package.json +4 -0
- package/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
- package/node_modules/ink/build/ansi-tokenizer.js +316 -0
- package/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
- package/node_modules/ink/build/apply-styles.js +175 -0
- package/node_modules/ink/build/build-layout.js +77 -0
- package/node_modules/ink/build/calculate-wrapped-text.js +53 -0
- package/node_modules/ink/build/colorize.d.ts +3 -0
- package/node_modules/ink/build/colorize.js +48 -0
- package/node_modules/ink/build/colorize.js.map +1 -0
- package/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
- package/node_modules/ink/build/components/AccessibilityContext.js +5 -0
- package/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
- package/node_modules/ink/build/components/App.d.ts +18 -0
- package/node_modules/ink/build/components/App.js +351 -0
- package/node_modules/ink/build/components/App.js.map +1 -0
- package/node_modules/ink/build/components/AppContext.d.ts +15 -0
- package/node_modules/ink/build/components/AppContext.js +11 -0
- package/node_modules/ink/build/components/AppContext.js.map +1 -0
- package/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
- package/node_modules/ink/build/components/BackgroundContext.js +3 -0
- package/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
- package/node_modules/ink/build/components/Box.d.ts +117 -0
- package/node_modules/ink/build/components/Box.js +34 -0
- package/node_modules/ink/build/components/Box.js.map +1 -0
- package/node_modules/ink/build/components/Color.js +62 -0
- package/node_modules/ink/build/components/Cursor.d.ts +83 -0
- package/node_modules/ink/build/components/Cursor.js +53 -0
- package/node_modules/ink/build/components/Cursor.js.map +1 -0
- package/node_modules/ink/build/components/CursorContext.d.ts +11 -0
- package/node_modules/ink/build/components/CursorContext.js +8 -0
- package/node_modules/ink/build/components/CursorContext.js.map +1 -0
- package/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
- package/node_modules/ink/build/components/ErrorBoundary.js +23 -0
- package/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
- package/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
- package/node_modules/ink/build/components/ErrorOverview.js +84 -0
- package/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
- package/node_modules/ink/build/components/FocusContext.d.ts +16 -0
- package/node_modules/ink/build/components/FocusContext.js +17 -0
- package/node_modules/ink/build/components/FocusContext.js.map +1 -0
- package/node_modules/ink/build/components/Newline.d.ts +13 -0
- package/node_modules/ink/build/components/Newline.js +8 -0
- package/node_modules/ink/build/components/Newline.js.map +1 -0
- package/node_modules/ink/build/components/Spacer.d.ts +7 -0
- package/node_modules/ink/build/components/Spacer.js +11 -0
- package/node_modules/ink/build/components/Spacer.js.map +1 -0
- package/node_modules/ink/build/components/Static.d.ts +24 -0
- package/node_modules/ink/build/components/Static.js +28 -0
- package/node_modules/ink/build/components/Static.js.map +1 -0
- package/node_modules/ink/build/components/StderrContext.d.ts +15 -0
- package/node_modules/ink/build/components/StderrContext.js +13 -0
- package/node_modules/ink/build/components/StderrContext.js.map +1 -0
- package/node_modules/ink/build/components/StdinContext.d.ts +22 -0
- package/node_modules/ink/build/components/StdinContext.js +19 -0
- package/node_modules/ink/build/components/StdinContext.js.map +1 -0
- package/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
- package/node_modules/ink/build/components/StdoutContext.js +13 -0
- package/node_modules/ink/build/components/StdoutContext.js.map +1 -0
- package/node_modules/ink/build/components/Text.d.ts +55 -0
- package/node_modules/ink/build/components/Text.js +50 -0
- package/node_modules/ink/build/components/Text.js.map +1 -0
- package/node_modules/ink/build/components/Transform.d.ts +16 -0
- package/node_modules/ink/build/components/Transform.js +15 -0
- package/node_modules/ink/build/components/Transform.js.map +1 -0
- package/node_modules/ink/build/cursor-helpers.d.ts +38 -0
- package/node_modules/ink/build/cursor-helpers.js +56 -0
- package/node_modules/ink/build/cursor-helpers.js.map +1 -0
- package/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
- package/node_modules/ink/build/devtools-window-polyfill.js +65 -0
- package/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
- package/node_modules/ink/build/devtools.d.ts +1 -0
- package/node_modules/ink/build/devtools.js +11 -0
- package/node_modules/ink/build/devtools.js.map +1 -0
- package/node_modules/ink/build/dom.d.ts +56 -0
- package/node_modules/ink/build/dom.js +124 -0
- package/node_modules/ink/build/dom.js.map +1 -0
- package/node_modules/ink/build/experimental/apply-style.js +140 -0
- package/node_modules/ink/build/experimental/dom.js +123 -0
- package/node_modules/ink/build/experimental/output.js +91 -0
- package/node_modules/ink/build/experimental/reconciler.js +141 -0
- package/node_modules/ink/build/experimental/renderer.js +81 -0
- package/node_modules/ink/build/get-max-width.d.ts +3 -0
- package/node_modules/ink/build/get-max-width.js +10 -0
- package/node_modules/ink/build/get-max-width.js.map +1 -0
- package/node_modules/ink/build/hooks/use-app.d.ts +5 -0
- package/node_modules/ink/build/hooks/use-app.js +8 -0
- package/node_modules/ink/build/hooks/use-app.js.map +1 -0
- package/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
- package/node_modules/ink/build/hooks/use-cursor.js +29 -0
- package/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
- package/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
- package/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
- package/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
- package/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
- package/node_modules/ink/build/hooks/use-focus.js +42 -0
- package/node_modules/ink/build/hooks/use-focus.js.map +1 -0
- package/node_modules/ink/build/hooks/use-input.d.ts +131 -0
- package/node_modules/ink/build/hooks/use-input.js +124 -0
- package/node_modules/ink/build/hooks/use-input.js.map +1 -0
- package/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
- package/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
- package/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
- package/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
- package/node_modules/ink/build/hooks/use-stderr.js +8 -0
- package/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
- package/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
- package/node_modules/ink/build/hooks/use-stdin.js +8 -0
- package/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
- package/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
- package/node_modules/ink/build/hooks/use-stdout.js +8 -0
- package/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
- package/node_modules/ink/build/hooks/useInput.js +38 -0
- package/node_modules/ink/build/index.d.ts +34 -0
- package/node_modules/ink/build/index.js +20 -0
- package/node_modules/ink/build/index.js.map +1 -0
- package/node_modules/ink/build/ink.d.ts +90 -0
- package/node_modules/ink/build/ink.js +637 -0
- package/node_modules/ink/build/ink.js.map +1 -0
- package/node_modules/ink/build/input-parser.d.ts +7 -0
- package/node_modules/ink/build/input-parser.js +154 -0
- package/node_modules/ink/build/input-parser.js.map +1 -0
- package/node_modules/ink/build/instance.js +205 -0
- package/node_modules/ink/build/instances.d.ts +3 -0
- package/node_modules/ink/build/instances.js +8 -0
- package/node_modules/ink/build/instances.js.map +1 -0
- package/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
- package/node_modules/ink/build/kitty-keyboard.js +32 -0
- package/node_modules/ink/build/kitty-keyboard.js.map +1 -0
- package/node_modules/ink/build/layout.d.ts +7 -0
- package/node_modules/ink/build/layout.js +33 -0
- package/node_modules/ink/build/layout.js.map +1 -0
- package/node_modules/ink/build/log-update.d.ts +19 -0
- package/node_modules/ink/build/log-update.js +242 -0
- package/node_modules/ink/build/log-update.js.map +1 -0
- package/node_modules/ink/build/measure-element.d.ts +16 -0
- package/node_modules/ink/build/measure-element.js +9 -0
- package/node_modules/ink/build/measure-element.js.map +1 -0
- package/node_modules/ink/build/measure-text.d.ts +6 -0
- package/node_modules/ink/build/measure-text.js +21 -0
- package/node_modules/ink/build/measure-text.js.map +1 -0
- package/node_modules/ink/build/options.d.ts +52 -0
- package/node_modules/ink/build/options.js +2 -0
- package/node_modules/ink/build/options.js.map +1 -0
- package/node_modules/ink/build/output.d.ts +35 -0
- package/node_modules/ink/build/output.js +183 -0
- package/node_modules/ink/build/output.js.map +1 -0
- package/node_modules/ink/build/parse-keypress.d.ts +22 -0
- package/node_modules/ink/build/parse-keypress.js +493 -0
- package/node_modules/ink/build/parse-keypress.js.map +1 -0
- package/node_modules/ink/build/reconciler.d.ts +4 -0
- package/node_modules/ink/build/reconciler.js +274 -0
- package/node_modules/ink/build/reconciler.js.map +1 -0
- package/node_modules/ink/build/render-background.d.ts +4 -0
- package/node_modules/ink/build/render-background.js +25 -0
- package/node_modules/ink/build/render-background.js.map +1 -0
- package/node_modules/ink/build/render-border.d.ts +4 -0
- package/node_modules/ink/build/render-border.js +73 -0
- package/node_modules/ink/build/render-border.js.map +1 -0
- package/node_modules/ink/build/render-node-to-output.d.ts +14 -0
- package/node_modules/ink/build/render-node-to-output.js +147 -0
- package/node_modules/ink/build/render-node-to-output.js.map +1 -0
- package/node_modules/ink/build/render-to-string.d.ts +38 -0
- package/node_modules/ink/build/render-to-string.js +115 -0
- package/node_modules/ink/build/render-to-string.js.map +1 -0
- package/node_modules/ink/build/render.d.ts +121 -0
- package/node_modules/ink/build/render.js +55 -0
- package/node_modules/ink/build/render.js.map +1 -0
- package/node_modules/ink/build/renderer.d.ts +8 -0
- package/node_modules/ink/build/renderer.js +55 -0
- package/node_modules/ink/build/renderer.js.map +1 -0
- package/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
- package/node_modules/ink/build/sanitize-ansi.js +27 -0
- package/node_modules/ink/build/sanitize-ansi.js.map +1 -0
- package/node_modules/ink/build/screen-reader-update.d.ts +13 -0
- package/node_modules/ink/build/screen-reader-update.js +38 -0
- package/node_modules/ink/build/screen-reader-update.js.map +1 -0
- package/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
- package/node_modules/ink/build/squash-text-nodes.js +36 -0
- package/node_modules/ink/build/squash-text-nodes.js.map +1 -0
- package/node_modules/ink/build/styles.d.ts +240 -0
- package/node_modules/ink/build/styles.js +232 -0
- package/node_modules/ink/build/styles.js.map +1 -0
- package/node_modules/ink/build/utils.d.ts +2 -0
- package/node_modules/ink/build/utils.js +4 -0
- package/node_modules/ink/build/utils.js.map +1 -0
- package/node_modules/ink/build/wrap-text.d.ts +3 -0
- package/node_modules/ink/build/wrap-text.js +31 -0
- package/node_modules/ink/build/wrap-text.js.map +1 -0
- package/node_modules/ink/build/write-synchronized.d.ts +4 -0
- package/node_modules/ink/build/write-synchronized.js +7 -0
- package/node_modules/ink/build/write-synchronized.js.map +1 -0
- package/node_modules/ink/package.json +126 -0
- package/package.json +35 -5
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-phone-call-preview-authority.d.ts +0 -24
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-phone-call-preview-authority.d.ts.map +0 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-phone-call-preview-authority.js +0 -125
- package/node_modules/@murphai/assistant-engine/dist/assistant/group-phone-call-preview-authority.js.map +0 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/newsletter-outbox.d.ts +0 -19
- package/node_modules/@murphai/assistant-engine/dist/assistant/newsletter-outbox.d.ts.map +0 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/newsletter-outbox.js.map +0 -1
- package/node_modules/@murphai/assistant-engine/skills/general-eye-health/SKILL.md +0 -77
- package/node_modules/@murphai/assistant-engine/skills/general-eye-health/references/evidence-register.md +0 -34
- package/node_modules/@murphai/assistant-engine/skills/general-eye-health/references/triage-and-contact-lenses.md +0 -103
- package/node_modules/@murphai/assistant-engine/skills/recovery-modalities/SKILL.md +0 -57
- package/node_modules/@murphai/assistant-engine/skills/red-light-therapy/SKILL.md +0 -145
- package/node_modules/@murphai/assistant-engine/skills/red-light-therapy/device-seeds.json +0 -259
- package/node_modules/@murphai/inboxd/dist/connectors/email/connector.d.ts +0 -57
- package/node_modules/@murphai/inboxd/dist/connectors/email/connector.d.ts.map +0 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/connector.js +0 -259
- package/node_modules/@murphai/inboxd/dist/connectors/email/connector.js.map +0 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize.d.ts +0 -44
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize.d.ts.map +0 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize.js +0 -212
- package/node_modules/@murphai/inboxd/dist/connectors/email/normalize.js.map +0 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/types.d.ts +0 -69
- package/node_modules/@murphai/inboxd/dist/connectors/email/types.d.ts.map +0 -1
- package/node_modules/@murphai/inboxd/dist/connectors/email/types.js +0 -2
- package/node_modules/@murphai/inboxd/dist/connectors/email/types.js.map +0 -1
- package/node_modules/@murphai/operator-config/dist/agentmail-runtime.d.ts +0 -194
- package/node_modules/@murphai/operator-config/dist/agentmail-runtime.d.ts.map +0 -1
- package/node_modules/@murphai/operator-config/dist/agentmail-runtime.js +0 -385
- package/node_modules/@murphai/operator-config/dist/agentmail-runtime.js.map +0 -1
- package/node_modules/@murphai/setup-cli/dist/setup-agentmail.d.ts +0 -30
- package/node_modules/@murphai/setup-cli/dist/setup-agentmail.d.ts.map +0 -1
- package/node_modules/@murphai/setup-cli/dist/setup-agentmail.js +0 -135
- package/node_modules/@murphai/setup-cli/dist/setup-agentmail.js.map +0 -1
- package/node_modules/incur/src/Cli.test.ts +0 -4808
- package/node_modules/incur/src/Completions.test.ts +0 -543
- package/node_modules/incur/src/Errors.test.ts +0 -100
- package/node_modules/incur/src/Fetch.test.ts +0 -285
- package/node_modules/incur/src/Filter.test.ts +0 -237
- package/node_modules/incur/src/Formatter.test.ts +0 -326
- package/node_modules/incur/src/Help.test.ts +0 -414
- package/node_modules/incur/src/Mcp.test.ts +0 -413
- package/node_modules/incur/src/Openapi.test.ts +0 -389
- package/node_modules/incur/src/Parser.test.ts +0 -378
- package/node_modules/incur/src/Schema.test.ts +0 -167
- package/node_modules/incur/src/Skill.test.ts +0 -441
- package/node_modules/incur/src/Skillgen.test.ts +0 -77
- package/node_modules/incur/src/SyncMcp.test.ts +0 -136
- package/node_modules/incur/src/SyncSkills.test.ts +0 -301
- package/node_modules/incur/src/Typegen.test.ts +0 -205
- package/node_modules/incur/src/bun-compile.test.ts +0 -84
- package/node_modules/incur/src/e2e.test.ts +0 -3441
- package/node_modules/incur/src/internal/configSchema.test.ts +0 -193
- package/node_modules/incur/src/internal/dereference.test.ts +0 -695
- package/node_modules/incur/src/internal/helpers.test.ts +0 -75
- package/node_modules/incur/src/internal/pm.test.ts +0 -38
- package/node_modules/incur/src/internal/utils.test.ts +0 -50
- package/node_modules/incur/src/middleware.test.ts +0 -6
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { extractIsoDatePrefix, ID_PREFIXES, MEAL_MICRONUTRIENT_KEYS, parseCompanionHrvRmssdAdmissionId, parseCompanionHrvRmssdObservation, serializeCompanionHrvRmssdObservation, toLocalDayKey, } from "@murphai/contracts";
|
|
3
|
-
import
|
|
2
|
+
import { extractIsoDatePrefix, ID_PREFIXES, JUNCTION_WEARABLE_TAG_EXTERNAL_REF_FACET, JUNCTION_WEARABLE_TAG_NOTE_TYPE, MEAL_MICRONUTRIENT_KEYS, parseCompanionHrvRmssdAdmissionId, parseCompanionHrvRmssdObservation, serializeCompanionHrvRmssdObservation, toLocalDayKey, } from "@murphai/contracts";
|
|
3
|
+
import * as z from "@murphai/contracts/zod-runtime";
|
|
4
4
|
import { stripUndefined } from "../shared.js";
|
|
5
5
|
import { asArray, asPlainObject, createEvidencePart, finiteNumber, kilojoulesToKilocalories, makeNormalizedDeviceBatch, makeProviderExternalRef, minutesBetween, pushEvidencePart, slugify, stringId, trimToLength, } from "./shared-normalization.js";
|
|
6
|
-
import { JUNCTION_ALLOWED_SUMMARY_RESOURCES, JUNCTION_ALLOWED_TIMESERIES_RESOURCES, JUNCTION_SLEEP_AVERAGE_HEART_RATE_PATHS, JUNCTION_SLEEP_AWAKE_MINUTE_PATHS, JUNCTION_SLEEP_AWAKE_SECOND_PATHS, JUNCTION_SLEEP_CONSISTENCY_PATHS, JUNCTION_SLEEP_DEEP_MINUTE_PATHS, JUNCTION_SLEEP_DEEP_SECOND_PATHS, JUNCTION_SLEEP_DURATION_MILLISECOND_PATHS, JUNCTION_SLEEP_DURATION_MINUTE_PATHS, JUNCTION_SLEEP_DURATION_SECOND_PATHS, JUNCTION_SLEEP_EFFICIENCY_RATIO_PATHS, JUNCTION_SLEEP_END_TIMESTAMP_PATHS, JUNCTION_SLEEP_HRV_PATHS, JUNCTION_SLEEP_LIGHT_MINUTE_PATHS, JUNCTION_SLEEP_LIGHT_SECOND_PATHS, JUNCTION_SLEEP_LOWEST_HEART_RATE_PATHS, JUNCTION_SLEEP_PERFORMANCE_PATHS, JUNCTION_SLEEP_REM_MINUTE_PATHS, JUNCTION_SLEEP_REM_SECOND_PATHS, JUNCTION_SLEEP_RESPIRATORY_RATE_PATHS, JUNCTION_SLEEP_RESTING_HEART_RATE_PATHS, JUNCTION_SLEEP_SCORE_PATHS, JUNCTION_SLEEP_SPO2_PATHS, JUNCTION_SLEEP_STAGE_ARRAY_PATHS, JUNCTION_SLEEP_STAGE_DURATION_MILLISECOND_PATHS, JUNCTION_SLEEP_STAGE_DURATION_MINUTE_PATHS, JUNCTION_SLEEP_STAGE_DURATION_SECOND_PATHS, JUNCTION_SLEEP_STAGE_VALUE_PATHS, JUNCTION_SLEEP_START_TIMESTAMP_PATHS, JUNCTION_SLEEP_TEMPERATURE_DEVIATION_PATHS, JUNCTION_SLEEP_TEMPERATURE_PATHS, JUNCTION_SLEEP_TIME_IN_BED_MINUTE_PATHS, JUNCTION_SLEEP_TIME_IN_BED_SECOND_PATHS, JUNCTION_SLEEP_TOTAL_MINUTE_PATHS, JUNCTION_SLEEP_TOTAL_SECOND_PATHS, isJunctionRawDirectIdentityContainerKey, isJunctionRawDirectIdentityKey, normalizeJunctionRawIdentityKey, normalizeJunctionSleepStageValue, normalizeJunctionResourceName, } from "./junction-resources.js";
|
|
6
|
+
import { JUNCTION_ALLOWED_SUMMARY_RESOURCES, JUNCTION_ALLOWED_TIMESERIES_RESOURCES, JUNCTION_SLEEP_AVERAGE_HEART_RATE_PATHS, JUNCTION_SLEEP_AWAKE_MINUTE_PATHS, JUNCTION_SLEEP_AWAKE_SECOND_PATHS, JUNCTION_SLEEP_CONSISTENCY_PATHS, JUNCTION_SLEEP_DEEP_MINUTE_PATHS, JUNCTION_SLEEP_DEEP_SECOND_PATHS, JUNCTION_SLEEP_DURATION_MILLISECOND_PATHS, JUNCTION_SLEEP_DURATION_MINUTE_PATHS, JUNCTION_SLEEP_DURATION_SECOND_PATHS, JUNCTION_SLEEP_EFFICIENCY_RATIO_PATHS, JUNCTION_SLEEP_END_TIMESTAMP_PATHS, JUNCTION_SLEEP_HRV_PATHS, JUNCTION_SLEEP_LATENCY_MINUTE_PATHS, JUNCTION_SLEEP_LATENCY_SECOND_PATHS, JUNCTION_SLEEP_LIGHT_MINUTE_PATHS, JUNCTION_SLEEP_LIGHT_SECOND_PATHS, JUNCTION_SLEEP_LOWEST_HEART_RATE_PATHS, JUNCTION_SLEEP_PERFORMANCE_PATHS, JUNCTION_SLEEP_REM_MINUTE_PATHS, JUNCTION_SLEEP_REM_SECOND_PATHS, JUNCTION_SLEEP_RESPIRATORY_RATE_PATHS, JUNCTION_SLEEP_RESTING_HEART_RATE_PATHS, JUNCTION_SLEEP_SCORE_PATHS, JUNCTION_SLEEP_SPO2_PATHS, JUNCTION_SLEEP_STAGE_ARRAY_PATHS, JUNCTION_SLEEP_STAGE_DURATION_MILLISECOND_PATHS, JUNCTION_SLEEP_STAGE_DURATION_MINUTE_PATHS, JUNCTION_SLEEP_STAGE_DURATION_SECOND_PATHS, JUNCTION_SLEEP_STAGE_VALUE_PATHS, JUNCTION_SLEEP_START_TIMESTAMP_PATHS, JUNCTION_SLEEP_TEMPERATURE_DEVIATION_PATHS, JUNCTION_SLEEP_TEMPERATURE_PATHS, JUNCTION_SLEEP_TIME_IN_BED_MINUTE_PATHS, JUNCTION_SLEEP_TIME_IN_BED_SECOND_PATHS, JUNCTION_SLEEP_TOTAL_MINUTE_PATHS, JUNCTION_SLEEP_TOTAL_SECOND_PATHS, JUNCTION_TIMESERIES_RESOURCE_POLICIES, isJunctionRawDirectIdentityContainerKey, isJunctionRawDirectIdentityKey, normalizeJunctionRawIdentityKey, normalizeJunctionSleepStageValue, normalizeJunctionResourceName, resolveJunctionTimeseriesResourcePolicy, usesJunctionTimeseriesIntervalStartOwnership, } from "./junction-resources.js";
|
|
7
|
+
import { assertJunctionTimeseriesResponseBound, assertJunctionTimeseriesSourceDayBound, assertJunctionTimeseriesOutputBounds, deriveJunctionTimeseriesFeatureEnvelope, getJunctionDenseFidelityPolicy, getJunctionSparseIntervalPolicy, isJunctionDenseFidelityResource, isJunctionSparseIntervalResource, } from "./junction-timeseries-fidelity.js";
|
|
8
|
+
import { JUNCTION_ECG_VOLTAGE_FEATURE_SCHEMA, JUNCTION_WORKOUT_STREAM_FEATURE_SCHEMA, buildJunctionBoundedFeatureIdentity, reduceJunctionElectrocardiogramVoltageRecords, reduceJunctionWorkoutStreamPayload, resolveJunctionBoundedFeatureRecords, selectJunctionWorkoutStreamCandidates, } from "./junction-bounded-features.js";
|
|
7
9
|
import { normalizeJunctionSourceProviderSlug, readJunctionSourceProviderSlug, resolveJunctionOrigin, } from "./junction-origin.js";
|
|
8
10
|
import { JUNCTION_DEVICE_PROVIDER_DESCRIPTOR } from "./provider-descriptors.js";
|
|
11
|
+
export { JUNCTION_DENSE_FIDELITY_RESOURCES, } from "./junction-timeseries-fidelity.js";
|
|
9
12
|
export { JUNCTION_ALLOWED_SUMMARY_RESOURCES, JUNCTION_ALLOWED_TIMESERIES_RESOURCES, JUNCTION_DEFAULT_SUMMARY_RESOURCES, JUNCTION_DEFAULT_TIMESERIES_RESOURCES, JUNCTION_KNOWN_TIMESERIES_RESOURCES, JUNCTION_OPT_IN_SUMMARY_RESOURCES, JUNCTION_OPT_IN_TIMESERIES_RESOURCES, JUNCTION_RAW_ONLY_SUMMARY_RESOURCES, normalizeJunctionResourceName, } from "./junction-resources.js";
|
|
13
|
+
export { JUNCTION_ECG_VOLTAGE_FEATURE_SCHEMA, JUNCTION_WORKOUT_STREAM_FEATURE_SCHEMA, buildJunctionBoundedFeatureIdentity, reduceJunctionElectrocardiogramVoltageRecords, reduceJunctionWorkoutStreamPayload, resolveJunctionBoundedFeatureRecords, selectJunctionWorkoutStreamCandidates, };
|
|
10
14
|
const junctionSnapshotSchema = z.object({
|
|
11
15
|
accountId: z.union([z.string(), z.number()]).optional(),
|
|
12
16
|
importedAt: z.union([z.string(), z.number(), z.date()]).optional(),
|
|
13
17
|
windowStart: z.union([z.string(), z.number(), z.date()]).optional(),
|
|
14
18
|
windowEnd: z.union([z.string(), z.number(), z.date()]).optional(),
|
|
19
|
+
timeseriesWindowKind: z.enum(["calendar_day", "precise"]).optional(),
|
|
20
|
+
strictSparseCalendarRepair: z.object({
|
|
21
|
+
dayKey: z.string(),
|
|
22
|
+
resource: z.enum(["caffeine", "water", "mindfulness_minutes"]),
|
|
23
|
+
sourceInstanceId: z.string().nullable().optional(),
|
|
24
|
+
sourceProviderSlug: z.string(),
|
|
25
|
+
sourceType: z.string().nullable().optional(),
|
|
26
|
+
}).strict().optional(),
|
|
15
27
|
connections: z.array(z.unknown()).optional(),
|
|
16
28
|
summaries: z.record(z.string(), z.unknown()).optional(),
|
|
17
29
|
timeseries: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -58,6 +70,27 @@ const ACTIVITY_METRICS = [
|
|
|
58
70
|
paths: [],
|
|
59
71
|
value: resolveJunctionDailyActivityMinutes,
|
|
60
72
|
},
|
|
73
|
+
{
|
|
74
|
+
metric: "low-activity-minutes",
|
|
75
|
+
unit: "minutes",
|
|
76
|
+
title: "Junction low activity minutes",
|
|
77
|
+
paths: [],
|
|
78
|
+
value: (entry) => resolveJunctionActivityIntensityMinutes(entry, "low"),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
metric: "medium-activity-minutes",
|
|
82
|
+
unit: "minutes",
|
|
83
|
+
title: "Junction medium activity minutes",
|
|
84
|
+
paths: [],
|
|
85
|
+
value: (entry) => resolveJunctionActivityIntensityMinutes(entry, "medium"),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
metric: "high-activity-minutes",
|
|
89
|
+
unit: "minutes",
|
|
90
|
+
title: "Junction high activity minutes",
|
|
91
|
+
paths: [],
|
|
92
|
+
value: (entry) => resolveJunctionActivityIntensityMinutes(entry, "high"),
|
|
93
|
+
},
|
|
61
94
|
{ metric: "daily-steps", unit: "count", title: "Junction activity steps", paths: ["steps", "step_count", "daily_steps"] },
|
|
62
95
|
{ metric: "active-calories", unit: "kcal", title: "Junction active calories", paths: ["activeCalories", "active_calories", "calories_active"] },
|
|
63
96
|
{ metric: "total-calories", unit: "kcal", title: "Junction total calories", paths: ["calories", "totalCalories", "total_calories", "calories_total"] },
|
|
@@ -70,6 +103,9 @@ const ACTIVITY_METRICS = [
|
|
|
70
103
|
{ metric: "percent-recorded", unit: "%", title: "Junction activity recording coverage", paths: [], percentRatioPaths: ["percentRecorded", "percent_recorded", "recordingCoverage", "recording_coverage", "recordedRatio", "recorded_ratio", "percentRecordedRatio", "percent_recorded_ratio"] },
|
|
71
104
|
{ metric: "workout-strain", unit: "score", title: "Junction workout strain", paths: ["workoutStrain", "workout_strain"] },
|
|
72
105
|
{ metric: "day-strain", unit: "score", title: "Junction day strain", paths: ["dayStrain", "day_strain", "strain"] },
|
|
106
|
+
{ metric: "average-heart-rate", unit: "bpm", title: "Junction activity average heart rate", paths: ["heart_rate.avg_bpm"] },
|
|
107
|
+
{ metric: "walking-average-heart-rate", unit: "bpm", title: "Junction activity walking average heart rate", paths: ["heart_rate.avg_walking_bpm"] },
|
|
108
|
+
{ metric: "lowest-heart-rate", unit: "bpm", title: "Junction activity lowest heart rate", paths: ["heart_rate.min_bpm"] },
|
|
73
109
|
{ metric: "max-heart-rate", unit: "bpm", title: "Junction activity max heart rate", paths: ["maxHeartRate", "max_heart_rate", "max_hr", "heart_rate.max_bpm"] },
|
|
74
110
|
{ metric: "resting-heart-rate", unit: "bpm", title: "Junction activity resting heart rate", paths: ["restingHeartRate", "resting_heart_rate", "resting_hr", "rhr", "heart_rate.resting_bpm"] },
|
|
75
111
|
];
|
|
@@ -77,6 +113,34 @@ const BODY_METRICS = [
|
|
|
77
113
|
{ metric: "weight", unit: "kg", title: "Junction body weight", paths: ["weightKg", "weight_kg", "weight"] },
|
|
78
114
|
{ metric: "bmi", unit: "kg_m2", title: "Junction BMI", paths: ["bmi", "body_mass_index"] },
|
|
79
115
|
{ metric: "body-fat-percentage", unit: "%", title: "Junction body fat", paths: ["bodyFatPercentage", "body_fat_percentage", "body_fat_percent", "bodyFat", "body_fat", "fat"] },
|
|
116
|
+
{
|
|
117
|
+
metric: "bone-mass-percentage",
|
|
118
|
+
unit: "%",
|
|
119
|
+
title: "Junction bone mass percentage",
|
|
120
|
+
paths: [],
|
|
121
|
+
value: (entry) => firstNumberFromPaths(entry, ["boneMassPercentage", "bone_mass_percentage"]),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
metric: "muscle-mass-percentage",
|
|
125
|
+
unit: "%",
|
|
126
|
+
title: "Junction muscle mass percentage",
|
|
127
|
+
paths: [],
|
|
128
|
+
value: (entry) => firstNumberFromPaths(entry, ["muscleMassPercentage", "muscle_mass_percentage"]),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
metric: "visceral-fat-index",
|
|
132
|
+
unit: "index",
|
|
133
|
+
title: "Junction visceral fat index",
|
|
134
|
+
paths: [],
|
|
135
|
+
value: (entry) => firstNumberFromPaths(entry, ["visceralFatIndex", "visceral_fat_index"]),
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
metric: "body-water-percentage",
|
|
139
|
+
unit: "%",
|
|
140
|
+
title: "Junction body water percentage",
|
|
141
|
+
paths: [],
|
|
142
|
+
value: (entry) => firstNumberFromPaths(entry, ["waterPercentage", "water_percentage"]),
|
|
143
|
+
},
|
|
80
144
|
{ metric: "lean-body-mass", unit: "kg", title: "Junction lean body mass", paths: ["leanBodyMassKg", "lean_body_mass_kg", "leanBodyMassKilogram", "lean_body_mass_kilogram", "leanMassKg", "lean_mass_kg"] },
|
|
81
145
|
{ metric: "waist-circumference", unit: "cm", title: "Junction waist circumference", paths: ["waistCircumference", "waist_circumference", "waistCircumferenceCentimeter", "waist_circumference_centimeter", "waistCircumferenceCm", "waist_circumference_cm"] },
|
|
82
146
|
{ metric: "temperature", unit: "celsius", title: "Junction body temperature", paths: ["temperature", "bodyTemperature", "body_temperature", "temperatureCelsius", "temperature_celsius", "skin_temperature"] },
|
|
@@ -96,6 +160,13 @@ const SLEEP_METRICS = [
|
|
|
96
160
|
{ metric: "sleep-awake-minutes", unit: "minutes", title: "Junction awake time", paths: JUNCTION_SLEEP_AWAKE_MINUTE_PATHS, secondsPaths: JUNCTION_SLEEP_AWAKE_SECOND_PATHS },
|
|
97
161
|
{ metric: "time-in-bed-minutes", unit: "minutes", title: "Junction time in bed", paths: JUNCTION_SLEEP_TIME_IN_BED_MINUTE_PATHS, secondsPaths: JUNCTION_SLEEP_TIME_IN_BED_SECOND_PATHS },
|
|
98
162
|
{ metric: "sleep-efficiency", unit: "%", title: "Junction sleep efficiency", paths: [], percentRatioPaths: JUNCTION_SLEEP_EFFICIENCY_RATIO_PATHS },
|
|
163
|
+
{
|
|
164
|
+
metric: "sleep-latency-minutes",
|
|
165
|
+
unit: "minutes",
|
|
166
|
+
title: "Junction sleep latency",
|
|
167
|
+
paths: [],
|
|
168
|
+
value: resolveJunctionSleepLatencyMinutes,
|
|
169
|
+
},
|
|
99
170
|
{ metric: "sleep-consistency", unit: "%", title: "Junction sleep consistency", paths: JUNCTION_SLEEP_CONSISTENCY_PATHS },
|
|
100
171
|
{ metric: "sleep-performance", unit: "%", title: "Junction sleep performance", paths: JUNCTION_SLEEP_PERFORMANCE_PATHS },
|
|
101
172
|
{ metric: "hrv", unit: "ms", title: "Junction sleep HRV", paths: JUNCTION_SLEEP_HRV_PATHS },
|
|
@@ -153,7 +224,7 @@ const JUNCTION_GENERIC_SUMMARY_ID_PATHS = [
|
|
|
153
224
|
"providerId",
|
|
154
225
|
"provider_id",
|
|
155
226
|
];
|
|
156
|
-
const
|
|
227
|
+
const JUNCTION_RECORD_POINT_TIMESTAMP_PATHS = [
|
|
157
228
|
"observedAtRaw",
|
|
158
229
|
"observed_at_raw",
|
|
159
230
|
"observedAt",
|
|
@@ -162,6 +233,8 @@ const JUNCTION_RECORD_TIMESTAMP_PATHS = [
|
|
|
162
233
|
"time",
|
|
163
234
|
"date",
|
|
164
235
|
"day",
|
|
236
|
+
];
|
|
237
|
+
const JUNCTION_RECORD_INTERVAL_END_TIMESTAMP_PATHS = [
|
|
165
238
|
"end",
|
|
166
239
|
"endAt",
|
|
167
240
|
"end_at",
|
|
@@ -169,6 +242,8 @@ const JUNCTION_RECORD_TIMESTAMP_PATHS = [
|
|
|
169
242
|
"time_end",
|
|
170
243
|
"bedtimeStop",
|
|
171
244
|
"bedtime_stop",
|
|
245
|
+
];
|
|
246
|
+
const JUNCTION_RECORD_INTERVAL_START_TIMESTAMP_PATHS = [
|
|
172
247
|
"start",
|
|
173
248
|
"startAt",
|
|
174
249
|
"start_at",
|
|
@@ -177,6 +252,48 @@ const JUNCTION_RECORD_TIMESTAMP_PATHS = [
|
|
|
177
252
|
"bedtimeStart",
|
|
178
253
|
"bedtime_start",
|
|
179
254
|
];
|
|
255
|
+
const JUNCTION_TIMESERIES_RECORD_ID_PATHS = [
|
|
256
|
+
"id",
|
|
257
|
+
"resourceId",
|
|
258
|
+
"resource_id",
|
|
259
|
+
"externalId",
|
|
260
|
+
"external_id",
|
|
261
|
+
"providerId",
|
|
262
|
+
"provider_id",
|
|
263
|
+
"recordId",
|
|
264
|
+
"record_id",
|
|
265
|
+
"sampleId",
|
|
266
|
+
"sample_id",
|
|
267
|
+
];
|
|
268
|
+
const JUNCTION_INTERVAL_START_TIMESTAMP_PATHS = [
|
|
269
|
+
"start",
|
|
270
|
+
"startAt",
|
|
271
|
+
"start_at",
|
|
272
|
+
"timeStart",
|
|
273
|
+
"time_start",
|
|
274
|
+
];
|
|
275
|
+
const JUNCTION_INTERVAL_END_TIMESTAMP_PATHS = [
|
|
276
|
+
"end",
|
|
277
|
+
"endAt",
|
|
278
|
+
"end_at",
|
|
279
|
+
"timeEnd",
|
|
280
|
+
"time_end",
|
|
281
|
+
];
|
|
282
|
+
const JUNCTION_INTERVAL_UNIT_PATHS = [
|
|
283
|
+
"unit",
|
|
284
|
+
"valueUnit",
|
|
285
|
+
"value_unit",
|
|
286
|
+
];
|
|
287
|
+
const JUNCTION_RECORD_TIMESTAMP_PATHS = [
|
|
288
|
+
...JUNCTION_RECORD_POINT_TIMESTAMP_PATHS,
|
|
289
|
+
...JUNCTION_RECORD_INTERVAL_END_TIMESTAMP_PATHS,
|
|
290
|
+
...JUNCTION_RECORD_INTERVAL_START_TIMESTAMP_PATHS,
|
|
291
|
+
];
|
|
292
|
+
const JUNCTION_INTERVAL_START_OWNED_TIMESTAMP_PATHS = [
|
|
293
|
+
...JUNCTION_RECORD_POINT_TIMESTAMP_PATHS,
|
|
294
|
+
...JUNCTION_RECORD_INTERVAL_START_TIMESTAMP_PATHS,
|
|
295
|
+
...JUNCTION_RECORD_INTERVAL_END_TIMESTAMP_PATHS,
|
|
296
|
+
];
|
|
180
297
|
const JUNCTION_MEAL_PROVIDER_ID_PATHS = [
|
|
181
298
|
"mealId",
|
|
182
299
|
"meal_id",
|
|
@@ -482,6 +599,53 @@ const JUNCTION_GLUCOSE_VALUE_PATHS = [
|
|
|
482
599
|
"bloodGlucose",
|
|
483
600
|
"blood_glucose",
|
|
484
601
|
];
|
|
602
|
+
const JUNCTION_STEPS_VALUE_PATHS = [
|
|
603
|
+
"value",
|
|
604
|
+
"steps",
|
|
605
|
+
"stepCount",
|
|
606
|
+
"step_count",
|
|
607
|
+
];
|
|
608
|
+
const JUNCTION_DISTANCE_VALUE_PATHS = [
|
|
609
|
+
"value",
|
|
610
|
+
"distance",
|
|
611
|
+
"distanceMeters",
|
|
612
|
+
"distance_meters",
|
|
613
|
+
"distanceKm",
|
|
614
|
+
"distance_km",
|
|
615
|
+
];
|
|
616
|
+
const JUNCTION_ACTIVE_CALORIES_VALUE_PATHS = [
|
|
617
|
+
"value",
|
|
618
|
+
"calories",
|
|
619
|
+
"activeCalories",
|
|
620
|
+
"active_calories",
|
|
621
|
+
"caloriesActive",
|
|
622
|
+
"calories_active",
|
|
623
|
+
];
|
|
624
|
+
const JUNCTION_HEARTRATE_VALUE_PATHS = [
|
|
625
|
+
"value",
|
|
626
|
+
"heartrate",
|
|
627
|
+
"heartRate",
|
|
628
|
+
"heart_rate",
|
|
629
|
+
"bpm",
|
|
630
|
+
];
|
|
631
|
+
const JUNCTION_WEIGHT_VALUE_PATHS = [
|
|
632
|
+
"value",
|
|
633
|
+
"weight",
|
|
634
|
+
"bodyWeight",
|
|
635
|
+
"body_weight",
|
|
636
|
+
"weightKg",
|
|
637
|
+
"weight_kg",
|
|
638
|
+
];
|
|
639
|
+
const JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS = ["value"];
|
|
640
|
+
const JUNCTION_READING_STABLE_ID_PATHS = [
|
|
641
|
+
"id",
|
|
642
|
+
"resourceId",
|
|
643
|
+
"resource_id",
|
|
644
|
+
"externalId",
|
|
645
|
+
"external_id",
|
|
646
|
+
"providerId",
|
|
647
|
+
"provider_id",
|
|
648
|
+
];
|
|
485
649
|
const JUNCTION_BLOOD_PRESSURE_SYSTOLIC_PATHS = [
|
|
486
650
|
"systolic",
|
|
487
651
|
];
|
|
@@ -597,6 +761,8 @@ export function normalizeJunctionSnapshot(snapshot, providerContext = {}) {
|
|
|
597
761
|
importedAt,
|
|
598
762
|
windowStart,
|
|
599
763
|
windowEnd,
|
|
764
|
+
timeseriesWindowKind: snapshot.timeseriesWindowKind,
|
|
765
|
+
strictSparseCalendarRepair: snapshot.strictSparseCalendarRepair,
|
|
600
766
|
connectionsByKey: buildConnectionsByKey(connections),
|
|
601
767
|
evidenceParts,
|
|
602
768
|
events,
|
|
@@ -605,6 +771,10 @@ export function normalizeJunctionSnapshot(snapshot, providerContext = {}) {
|
|
|
605
771
|
normalizeSummaries(snapshot.summaries, context);
|
|
606
772
|
normalizeTimeseries(snapshot.timeseries, context);
|
|
607
773
|
normalizeCompanionHrvRmssd(companionHrvRmssd, context);
|
|
774
|
+
assertJunctionTimeseriesOutputBounds({
|
|
775
|
+
eventCount: events.length,
|
|
776
|
+
evidencePartCount: evidenceParts.length,
|
|
777
|
+
});
|
|
608
778
|
return makeNormalizedDeviceBatch({
|
|
609
779
|
provider: "junction",
|
|
610
780
|
accountId: stringId(snapshot.accountId),
|
|
@@ -617,6 +787,7 @@ export function normalizeJunctionSnapshot(snapshot, providerContext = {}) {
|
|
|
617
787
|
normalizerVersion: "junction-normalizer.v1",
|
|
618
788
|
windowStart,
|
|
619
789
|
windowEnd,
|
|
790
|
+
timeseriesWindowKind: snapshot.timeseriesWindowKind,
|
|
620
791
|
connections: connections.length,
|
|
621
792
|
summaryResources: listAllowedResourceKeys(snapshot.summaries, SUMMARY_RESOURCE_ALLOWLIST),
|
|
622
793
|
timeseriesResources: listAllowedResourceKeys(snapshot.timeseries, TIMESERIES_RESOURCE_ALLOWLIST),
|
|
@@ -666,6 +837,81 @@ export function classifyJunctionSummaryNormalizationEvidence(snapshot, evidenceW
|
|
|
666
837
|
return [...evidenceByKey.values()].sort((left, right) => left.resource.localeCompare(right.resource)
|
|
667
838
|
|| left.sourceProviderSlug.localeCompare(right.sourceProviderSlug));
|
|
668
839
|
}
|
|
840
|
+
export function identifyJunctionBloodPressureProviderRecords(snapshot) {
|
|
841
|
+
const connections = asArray(snapshot.connections).flatMap((connection) => {
|
|
842
|
+
const normalized = asPlainObject(connection);
|
|
843
|
+
return normalized ? [normalized] : [];
|
|
844
|
+
});
|
|
845
|
+
const context = {
|
|
846
|
+
importedAt: normalizeTimestamp(snapshot.importedAt),
|
|
847
|
+
windowStart: normalizeTimestamp(snapshot.windowStart),
|
|
848
|
+
windowEnd: normalizeTimestamp(snapshot.windowEnd),
|
|
849
|
+
connectionsByKey: buildConnectionsByKey(connections),
|
|
850
|
+
evidenceParts: [],
|
|
851
|
+
events: [],
|
|
852
|
+
samples: [],
|
|
853
|
+
};
|
|
854
|
+
const repairStableExternalRefResourceIds = [];
|
|
855
|
+
for (const [resource, payload] of allowedResourceEntries(snapshot.timeseries, TIMESERIES_RESOURCE_ALLOWLIST)) {
|
|
856
|
+
if (resource !== JUNCTION_BLOOD_PRESSURE_RESOURCE) {
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
const resourceSlug = slugify(resource, "timeseries");
|
|
860
|
+
const baseArtifactRole = `junction-timeseries-reading-${resourceSlug}`;
|
|
861
|
+
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(payload).entries()) {
|
|
862
|
+
const resourceContext = buildResourceContext({
|
|
863
|
+
entry,
|
|
864
|
+
originFallback,
|
|
865
|
+
resource,
|
|
866
|
+
resourceSlug,
|
|
867
|
+
identityKind: "timeseries",
|
|
868
|
+
index,
|
|
869
|
+
fallbackArtifactRole: baseArtifactRole,
|
|
870
|
+
context,
|
|
871
|
+
});
|
|
872
|
+
repairStableExternalRefResourceIds.push(resourceContext
|
|
873
|
+
? buildJunctionBloodPressureRepairStableExternalRefResourceId(entry, resourceContext)
|
|
874
|
+
: null);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
return {
|
|
878
|
+
providerRecordCount: repairStableExternalRefResourceIds.length,
|
|
879
|
+
repairStableExternalRefResourceIds,
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
/** Count provider rows accepted by the canonical daily-aggregate parser. */
|
|
883
|
+
export function countAcceptedJunctionDailyTimeseriesProviderRecords(snapshot) {
|
|
884
|
+
const connections = asArray(snapshot.connections).flatMap((connection) => {
|
|
885
|
+
const normalized = asPlainObject(connection);
|
|
886
|
+
return normalized ? [normalized] : [];
|
|
887
|
+
});
|
|
888
|
+
const context = {
|
|
889
|
+
importedAt: normalizeTimestamp(snapshot.importedAt),
|
|
890
|
+
windowStart: normalizeTimestamp(snapshot.windowStart),
|
|
891
|
+
windowEnd: normalizeTimestamp(snapshot.windowEnd),
|
|
892
|
+
connectionsByKey: buildConnectionsByKey(connections),
|
|
893
|
+
evidenceParts: [],
|
|
894
|
+
events: [],
|
|
895
|
+
samples: [],
|
|
896
|
+
};
|
|
897
|
+
let acceptedProviderRecordCount = 0;
|
|
898
|
+
for (const [resource, payload] of allowedResourceEntries(snapshot.timeseries, TIMESERIES_RESOURCE_ALLOWLIST)) {
|
|
899
|
+
const descriptor = JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.get(resource);
|
|
900
|
+
if (!descriptor) {
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
acceptedProviderRecordCount += buildJunctionDailyTimeseriesAggregates({
|
|
904
|
+
context,
|
|
905
|
+
normalizeValue: descriptor.normalizeValue,
|
|
906
|
+
payload,
|
|
907
|
+
requireExplicitTimestamp: descriptor.requireExplicitTimestamp === true,
|
|
908
|
+
resource,
|
|
909
|
+
resourceSlug: slugify(resource, "timeseries"),
|
|
910
|
+
valuePaths: descriptor.valuePaths,
|
|
911
|
+
}).reduce((count, aggregate) => count + aggregate.sampleCount, 0);
|
|
912
|
+
}
|
|
913
|
+
return acceptedProviderRecordCount;
|
|
914
|
+
}
|
|
669
915
|
function isJunctionSummaryEvidenceEventInRange(event, evidenceRange) {
|
|
670
916
|
const occurredAtMs = Date.parse(event.occurredAt);
|
|
671
917
|
if (Number.isFinite(occurredAtMs)
|
|
@@ -898,21 +1144,41 @@ function buildJunctionMealFallbackIdentityDisambiguators(input) {
|
|
|
898
1144
|
}
|
|
899
1145
|
return disambiguators;
|
|
900
1146
|
}
|
|
901
|
-
// Every
|
|
902
|
-
//
|
|
903
|
-
//
|
|
904
|
-
//
|
|
905
|
-
//
|
|
906
|
-
//
|
|
1147
|
+
// Every daily-aggregate timeseries resource must appear here. `steps` and
|
|
1148
|
+
// `distance` use the scheduler's complete UTC-day owner; the other daily
|
|
1149
|
+
// resources keep their established bounded mapping. Paired/sparse and
|
|
1150
|
+
// feature-shaped resources use dedicated handlers below. Raw evidence stays
|
|
1151
|
+
// one compact ~430 B `junction.timeseries_daily_aggregate.v1` artifact per
|
|
1152
|
+
// day per resource (~160 KB/member-year/resource) no matter how dense the
|
|
1153
|
+
// provider stream is: glucose CGM streams (288 samples/day, ~10-15 MB/yr raw) reduce
|
|
907
1154
|
// to the same one artifact per day. Resource classifications and payload
|
|
908
1155
|
// field names are verified against docs.junction.com
|
|
909
1156
|
// (wearables/providers/resources; api-reference/data/timeseries/*): hrv,
|
|
910
1157
|
// respiratory_rate, blood_oxygen, glucose, and stress_level are discrete
|
|
911
1158
|
// timeseries; vo2_max, body_temperature(_delta), basal_body_temperature,
|
|
912
1159
|
// caffeine, water, mindfulness_minutes, heart_rate_recovery_one_minute,
|
|
913
|
-
// sleep_breathing_disturbance, and afib_burden are interval timeseries.
|
|
914
|
-
// reduce to daily-grain observations below.
|
|
1160
|
+
// sleep_breathing_disturbance, and afib_burden are interval timeseries.
|
|
915
1161
|
const JUNCTION_DAILY_TIMESERIES_DESCRIPTOR_ENTRIES = [
|
|
1162
|
+
["steps", {
|
|
1163
|
+
normalizeValue: normalizeStepCount,
|
|
1164
|
+
observations: [
|
|
1165
|
+
{ metric: "daily-steps", statistic: "sum", title: "Junction steps" },
|
|
1166
|
+
],
|
|
1167
|
+
requireExplicitTimestamp: true,
|
|
1168
|
+
retainSumValue: true,
|
|
1169
|
+
unit: "count",
|
|
1170
|
+
valuePaths: JUNCTION_STEPS_VALUE_PATHS,
|
|
1171
|
+
}],
|
|
1172
|
+
["distance", {
|
|
1173
|
+
normalizeValue: normalizeDistanceKilometers,
|
|
1174
|
+
observations: [
|
|
1175
|
+
{ metric: "distance-km", statistic: "sum", title: "Junction distance" },
|
|
1176
|
+
],
|
|
1177
|
+
requireExplicitTimestamp: true,
|
|
1178
|
+
retainSumValue: true,
|
|
1179
|
+
unit: "km",
|
|
1180
|
+
valuePaths: JUNCTION_DISTANCE_VALUE_PATHS,
|
|
1181
|
+
}],
|
|
916
1182
|
["blood_oxygen", {
|
|
917
1183
|
normalizeValue: normalizeBloodOxygenPercent,
|
|
918
1184
|
observations: [
|
|
@@ -1038,68 +1304,224 @@ const JUNCTION_DAILY_TIMESERIES_DESCRIPTOR_ENTRIES = [
|
|
|
1038
1304
|
unit: "mg/dL",
|
|
1039
1305
|
valuePaths: JUNCTION_GLUCOSE_VALUE_PATHS,
|
|
1040
1306
|
}],
|
|
1307
|
+
["calories_basal", {
|
|
1308
|
+
normalizeValue: normalizeBasalCaloriesKilocalories,
|
|
1309
|
+
observations: [
|
|
1310
|
+
{ metric: "basal-calories", statistic: "sum", title: "Junction basal calories" },
|
|
1311
|
+
],
|
|
1312
|
+
requireExplicitTimestamp: true,
|
|
1313
|
+
retainSumValue: true,
|
|
1314
|
+
unit: "kcal",
|
|
1315
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1316
|
+
}],
|
|
1317
|
+
["daylight_exposure", {
|
|
1318
|
+
normalizeValue: normalizeDaylightExposureMinutes,
|
|
1319
|
+
observations: [
|
|
1320
|
+
{ metric: "daylight-exposure-minutes", statistic: "sum", title: "Junction daylight exposure" },
|
|
1321
|
+
],
|
|
1322
|
+
requireExplicitTimestamp: true,
|
|
1323
|
+
retainSumValue: true,
|
|
1324
|
+
unit: "minutes",
|
|
1325
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1326
|
+
}],
|
|
1327
|
+
["floors_climbed", {
|
|
1328
|
+
normalizeValue: normalizeFloorsClimbedCount,
|
|
1329
|
+
observations: [
|
|
1330
|
+
{ metric: "floors-climbed", statistic: "sum", title: "Junction floors climbed" },
|
|
1331
|
+
],
|
|
1332
|
+
requireExplicitTimestamp: true,
|
|
1333
|
+
retainSumValue: true,
|
|
1334
|
+
unit: "count",
|
|
1335
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1336
|
+
}],
|
|
1337
|
+
["stand_duration", {
|
|
1338
|
+
normalizeValue: normalizeStandDurationMinutes,
|
|
1339
|
+
observations: [
|
|
1340
|
+
{ metric: "stand-duration-minutes", statistic: "sum", title: "Junction stand duration" },
|
|
1341
|
+
],
|
|
1342
|
+
requireExplicitTimestamp: true,
|
|
1343
|
+
retainSumValue: true,
|
|
1344
|
+
unit: "minutes",
|
|
1345
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1346
|
+
}],
|
|
1347
|
+
["stand_hour", {
|
|
1348
|
+
normalizeValue: normalizeStandHourCount,
|
|
1349
|
+
observations: [
|
|
1350
|
+
{ metric: "stand-hours", statistic: "sum", title: "Junction stand hours" },
|
|
1351
|
+
],
|
|
1352
|
+
requireExplicitTimestamp: true,
|
|
1353
|
+
retainSumValue: true,
|
|
1354
|
+
unit: "count",
|
|
1355
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1356
|
+
}],
|
|
1357
|
+
["wheelchair_push", {
|
|
1358
|
+
normalizeValue: normalizeWheelchairPushCount,
|
|
1359
|
+
observations: [
|
|
1360
|
+
{ metric: "wheelchair-push-count", statistic: "sum", title: "Junction wheelchair pushes" },
|
|
1361
|
+
],
|
|
1362
|
+
requireExplicitTimestamp: true,
|
|
1363
|
+
retainSumValue: true,
|
|
1364
|
+
unit: "count",
|
|
1365
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1366
|
+
}],
|
|
1041
1367
|
];
|
|
1042
1368
|
const JUNCTION_DAILY_TIMESERIES_DESCRIPTORS = new Map(JUNCTION_DAILY_TIMESERIES_DESCRIPTOR_ENTRIES);
|
|
1369
|
+
const JUNCTION_FEATURE_TIMESERIES_DESCRIPTOR_ENTRIES = [
|
|
1370
|
+
["calories_active", {
|
|
1371
|
+
normalizeValue: normalizeActiveCaloriesKilocalories,
|
|
1372
|
+
observations: [
|
|
1373
|
+
{ metric: "active-calories", statistic: "sum", title: "Junction active calories" },
|
|
1374
|
+
],
|
|
1375
|
+
unit: "kcal",
|
|
1376
|
+
valuePaths: JUNCTION_ACTIVE_CALORIES_VALUE_PATHS,
|
|
1377
|
+
}],
|
|
1378
|
+
["heartrate", {
|
|
1379
|
+
normalizeValue: normalizeHeartRateBpm,
|
|
1380
|
+
observations: [
|
|
1381
|
+
{ metric: "average-heart-rate", statistic: "mean", title: "Junction heart rate average" },
|
|
1382
|
+
{ metric: "lowest-heart-rate", statistic: "min", title: "Junction heart rate minimum" },
|
|
1383
|
+
{ metric: "max-heart-rate", statistic: "max", title: "Junction heart rate maximum" },
|
|
1384
|
+
],
|
|
1385
|
+
unit: "bpm",
|
|
1386
|
+
valuePaths: JUNCTION_HEARTRATE_VALUE_PATHS,
|
|
1387
|
+
}],
|
|
1388
|
+
["handwashing", {
|
|
1389
|
+
normalizeValue: normalizeHandwashingCount,
|
|
1390
|
+
observations: [
|
|
1391
|
+
{ metric: "handwashing-count", statistic: "sum", title: "Junction handwashing" },
|
|
1392
|
+
],
|
|
1393
|
+
unit: "count",
|
|
1394
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1395
|
+
}],
|
|
1396
|
+
["uv_exposure", {
|
|
1397
|
+
normalizeValue: normalizeUvExposureIndex,
|
|
1398
|
+
observations: [
|
|
1399
|
+
{ metric: "uv-exposure-index", statistic: "mean", title: "Junction UV exposure" },
|
|
1400
|
+
],
|
|
1401
|
+
unit: "index",
|
|
1402
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1403
|
+
}],
|
|
1404
|
+
["workout_distance", {
|
|
1405
|
+
normalizeValue: normalizeDistanceKilometers,
|
|
1406
|
+
observations: [
|
|
1407
|
+
{ metric: "workout-distance-km", statistic: "sum", title: "Junction workout distance" },
|
|
1408
|
+
],
|
|
1409
|
+
unit: "km",
|
|
1410
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1411
|
+
}],
|
|
1412
|
+
["workout_duration", {
|
|
1413
|
+
normalizeValue: normalizeWorkoutDurationMinutes,
|
|
1414
|
+
observations: [
|
|
1415
|
+
{ metric: "workout-minutes", statistic: "sum", title: "Junction workout duration" },
|
|
1416
|
+
],
|
|
1417
|
+
unit: "minutes",
|
|
1418
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1419
|
+
}],
|
|
1420
|
+
["workout_swimming_stroke", {
|
|
1421
|
+
normalizeValue: normalizeWorkoutSwimmingStrokeCount,
|
|
1422
|
+
observations: [
|
|
1423
|
+
{ metric: "swimming-stroke-count", statistic: "sum", title: "Junction swimming strokes" },
|
|
1424
|
+
],
|
|
1425
|
+
unit: "count",
|
|
1426
|
+
valuePaths: JUNCTION_GENERIC_TIMESERIES_VALUE_PATHS,
|
|
1427
|
+
}],
|
|
1428
|
+
];
|
|
1429
|
+
const JUNCTION_FEATURE_TIMESERIES_DESCRIPTORS = new Map(JUNCTION_FEATURE_TIMESERIES_DESCRIPTOR_ENTRIES);
|
|
1043
1430
|
// Junction's blood-pressure timeseries pairs `systolic`/`diastolic` per
|
|
1044
1431
|
// reading (docs.junction.com/api-reference/data/timeseries/blood-pressure),
|
|
1045
1432
|
// so it cannot reduce through the single-value daily-aggregate descriptors.
|
|
1046
1433
|
// Readings are sparse (10s-100s per member-year): each one lands as a paired
|
|
1047
1434
|
// `measurement` event plus one compact per-reading evidence part.
|
|
1048
1435
|
const JUNCTION_BLOOD_PRESSURE_RESOURCE = "blood_pressure";
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1436
|
+
const JUNCTION_NOTE_RESOURCE = "note";
|
|
1437
|
+
const JUNCTION_WEIGHT_RESOURCE = "weight";
|
|
1438
|
+
const JUNCTION_SPARSE_TIMESERIES_DESCRIPTORS = new Map([
|
|
1439
|
+
["body_mass_index", { canonicalUnit: "kg_m2", kind: "observation", maximum: 100, metric: "bmi", minimum: 5, title: "Junction BMI", upstreamUnit: "index" }],
|
|
1440
|
+
["carbohydrates", { canonicalUnit: "g", kind: "observation", maximum: 2_000, metric: "carbohydrates", minimum: 0, title: "Junction carbohydrates", upstreamUnit: "g" }],
|
|
1441
|
+
["fat", { canonicalUnit: "%", kind: "observation", maximum: 100, metric: "body-fat-percentage", minimum: 0, title: "Junction body fat", upstreamUnit: "%" }],
|
|
1442
|
+
["forced_expiratory_volume_1", { canonicalUnit: "L", kind: "observation", maximum: 15, metric: "forced-expiratory-volume-1", minimum: 0.05, title: "Junction FEV1", upstreamUnit: "L" }],
|
|
1443
|
+
["forced_vital_capacity", { canonicalUnit: "L", kind: "observation", maximum: 20, metric: "forced-vital-capacity", minimum: 0.05, title: "Junction forced vital capacity", upstreamUnit: "L" }],
|
|
1444
|
+
["heart_rate_alert", { canonicalUnit: "count", kind: "alert", maximum: 10_000, metric: "heart-rate-alert", minimum: 1, requireInteger: true, title: "Junction heart-rate alert", upstreamUnit: "count" }],
|
|
1445
|
+
["inhaler_usage", { canonicalUnit: "count", kind: "observation", maximum: 1_000, metric: "inhaler-usage", minimum: 1, requireInteger: true, title: "Junction inhaler usage", upstreamUnit: "count" }],
|
|
1446
|
+
["insulin_injection", { canonicalUnit: "unit", kind: "insulin", maximum: 1_000, minimum: 0.01, title: "Junction insulin injection", upstreamUnit: "unit" }],
|
|
1447
|
+
["lean_body_mass", { canonicalUnit: "kg", kind: "observation", maximum: 500, metric: "lean-body-mass", minimum: 1, title: "Junction lean body mass", upstreamUnit: "kg" }],
|
|
1448
|
+
["peak_expiratory_flow_rate", { canonicalUnit: "L/min", kind: "observation", maximum: 2_000, metric: "peak-expiratory-flow-rate", minimum: 1, title: "Junction peak expiratory flow rate", upstreamUnit: "L/min" }],
|
|
1449
|
+
["sleep_apnea_alert", { canonicalUnit: "count", kind: "alert", maximum: 10_000, metric: "sleep-apnea-alert", minimum: 1, requireInteger: true, title: "Junction sleep-apnea alert", upstreamUnit: "count" }],
|
|
1450
|
+
["waist_circumference", { canonicalUnit: "cm", kind: "observation", maximum: 300, metric: "waist-circumference", minimum: 20, title: "Junction waist circumference", upstreamUnit: "cm" }],
|
|
1451
|
+
["fall", { canonicalUnit: "count", kind: "alert", maximum: 1_000, metric: "fall-count", minimum: 1, requireInteger: true, title: "Junction fall", upstreamUnit: "count" }],
|
|
1452
|
+
]);
|
|
1453
|
+
const JUNCTION_HEART_ALERT_TYPES = new Set([
|
|
1454
|
+
"high",
|
|
1455
|
+
"high_heart_rate",
|
|
1456
|
+
"high_heart_rate_alert",
|
|
1457
|
+
"irregular_rhythm",
|
|
1458
|
+
"low",
|
|
1459
|
+
"low_heart_rate",
|
|
1460
|
+
"low_heart_rate_alert",
|
|
1055
1461
|
]);
|
|
1462
|
+
// Derived from the contracts-owned storage policy so admitting a new name
|
|
1463
|
+
// cannot silently make the raw-snapshot sanitizer retain an unsupported shape.
|
|
1464
|
+
const COMPACT_TIMESERIES_RESOURCE_ALLOWLIST = new Set(JUNCTION_TIMESERIES_RESOURCE_POLICIES.map((policy) => policy.resource));
|
|
1056
1465
|
function normalizeTimeseries(timeseries, context) {
|
|
1057
1466
|
for (const [resource, payload] of allowedResourceEntries(timeseries, TIMESERIES_RESOURCE_ALLOWLIST)) {
|
|
1467
|
+
if (resource === JUNCTION_NOTE_RESOURCE) {
|
|
1468
|
+
pushJunctionNoteTags(payload, resource, slugify(resource, "timeseries"), context);
|
|
1469
|
+
continue;
|
|
1470
|
+
}
|
|
1471
|
+
if (resource === "electrocardiogram_voltage" || resource === "workout_stream") {
|
|
1472
|
+
pushJunctionBoundedTimeseriesFeatures(payload, resource, context);
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1058
1475
|
if (resource === JUNCTION_BLOOD_PRESSURE_RESOURCE) {
|
|
1059
1476
|
pushJunctionBloodPressureReadings(payload, resource, slugify(resource, "timeseries"), context);
|
|
1060
1477
|
continue;
|
|
1061
1478
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1479
|
+
if (resource === JUNCTION_WEIGHT_RESOURCE) {
|
|
1480
|
+
pushJunctionWeightReadings(payload, resource, slugify(resource, "timeseries"), context);
|
|
1481
|
+
continue;
|
|
1065
1482
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
resource
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
}
|
|
1483
|
+
const sparseDescriptor = JUNCTION_SPARSE_TIMESERIES_DESCRIPTORS.get(resource);
|
|
1484
|
+
if (sparseDescriptor) {
|
|
1485
|
+
pushJunctionSparseTimeseriesRecords(payload, resource, slugify(resource, "timeseries"), context, sparseDescriptor);
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
const dailyDescriptor = JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.get(resource);
|
|
1489
|
+
if (dailyDescriptor) {
|
|
1490
|
+
let selectedSparseRecords;
|
|
1491
|
+
if (isJunctionSparseIntervalResource(resource)) {
|
|
1492
|
+
assertJunctionSparseCalendarRepairRowsValid({
|
|
1493
|
+
context,
|
|
1494
|
+
descriptor: dailyDescriptor,
|
|
1495
|
+
payload,
|
|
1496
|
+
resource,
|
|
1497
|
+
resourceSlug: slugify(resource, "timeseries"),
|
|
1498
|
+
});
|
|
1499
|
+
selectedSparseRecords = pushJunctionSparseIntervalReadings(payload, resource, slugify(resource, "timeseries"), context, dailyDescriptor);
|
|
1500
|
+
}
|
|
1501
|
+
if (!isJunctionSparseIntervalResource(resource)
|
|
1502
|
+
|| context.timeseriesWindowKind !== "precise") {
|
|
1503
|
+
pushJunctionDailyTimeseriesObservations(payload, resource, slugify(resource, "timeseries"), context, dailyDescriptor, selectedSparseRecords);
|
|
1504
|
+
}
|
|
1505
|
+
continue;
|
|
1506
|
+
}
|
|
1507
|
+
const featureDescriptor = JUNCTION_FEATURE_TIMESERIES_DESCRIPTORS.get(resource);
|
|
1508
|
+
if (featureDescriptor) {
|
|
1509
|
+
pushJunctionFeatureTimeseriesObservations(payload, resource, slugify(resource, "timeseries"), context, featureDescriptor);
|
|
1084
1510
|
}
|
|
1085
1511
|
}
|
|
1086
1512
|
}
|
|
1087
|
-
function
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
case "max":
|
|
1092
|
-
return aggregate.maxValue;
|
|
1093
|
-
case "sum":
|
|
1094
|
-
return aggregate.sum;
|
|
1095
|
-
case "mean":
|
|
1096
|
-
return aggregate.sum / aggregate.sampleCount;
|
|
1513
|
+
function assertJunctionSparseCalendarRepairRowsValid(input) {
|
|
1514
|
+
const expectation = input.context.strictSparseCalendarRepair;
|
|
1515
|
+
if (!expectation || expectation.resource !== input.resource) {
|
|
1516
|
+
return;
|
|
1097
1517
|
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1518
|
+
const entries = timeseriesResourceEntries(input.payload);
|
|
1519
|
+
assertJunctionTimeseriesResponseBound(input.resource, entries.length);
|
|
1520
|
+
if (entries.length === 1
|
|
1521
|
+
&& entries[0]?.entry.authoritativeEmptyCalendarSet === true) {
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
for (const [index, { entry, originFallback }] of entries.entries()) {
|
|
1103
1525
|
const resourceContext = buildResourceContext({
|
|
1104
1526
|
entry,
|
|
1105
1527
|
originFallback,
|
|
@@ -1107,44 +1529,1265 @@ function buildJunctionDailyTimeseriesAggregates(input) {
|
|
|
1107
1529
|
resourceSlug: input.resourceSlug,
|
|
1108
1530
|
identityKind: "timeseries",
|
|
1109
1531
|
index,
|
|
1110
|
-
fallbackArtifactRole:
|
|
1532
|
+
fallbackArtifactRole: `junction-timeseries-reading-${input.resourceSlug}`,
|
|
1111
1533
|
context: input.context,
|
|
1112
1534
|
});
|
|
1535
|
+
const providerValue = finiteNumber(firstValueFromPaths(entry, input.descriptor.valuePaths));
|
|
1536
|
+
const value = input.descriptor.normalizeValue(providerValue, entry);
|
|
1537
|
+
const startRaw = firstStringFromPaths(entry, JUNCTION_INTERVAL_START_TIMESTAMP_PATHS);
|
|
1538
|
+
const endRaw = firstStringFromPaths(entry, JUNCTION_INTERVAL_END_TIMESTAMP_PATHS);
|
|
1539
|
+
const startAt = resolveSafeTimestamp(startRaw);
|
|
1540
|
+
const endAt = resolveSafeTimestamp(endRaw);
|
|
1541
|
+
const timestamp = resourceContext && startRaw
|
|
1542
|
+
? resolveJunctionSparseIntervalTimestamp(entry, startRaw, input.context, resourceContext.sourceProviderSlug)
|
|
1543
|
+
: null;
|
|
1544
|
+
const dayKey = timestamp && startAt
|
|
1545
|
+
? resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, startAt, input.context.defaultTimeZone)
|
|
1546
|
+
: undefined;
|
|
1547
|
+
const valid = resourceContext !== null
|
|
1548
|
+
&& providerValue !== undefined
|
|
1549
|
+
&& value !== undefined
|
|
1550
|
+
&& startRaw !== undefined
|
|
1551
|
+
&& endRaw !== undefined
|
|
1552
|
+
&& startAt !== undefined
|
|
1553
|
+
&& endAt !== undefined
|
|
1554
|
+
&& Date.parse(endAt) >= Date.parse(startAt)
|
|
1555
|
+
&& dayKey === expectation.dayKey
|
|
1556
|
+
&& resourceContext.sourceProviderSlug === expectation.sourceProviderSlug
|
|
1557
|
+
&& (expectation.sourceType == null
|
|
1558
|
+
|| resourceContext.origin.sourceType === expectation.sourceType)
|
|
1559
|
+
&& (expectation.sourceInstanceId == null
|
|
1560
|
+
|| resourceContext.origin.sourceInstanceId === expectation.sourceInstanceId);
|
|
1561
|
+
if (!valid) {
|
|
1562
|
+
throw new JunctionSparseCalendarRepairNormalizationError();
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
export class JunctionSparseCalendarRepairNormalizationError extends Error {
|
|
1567
|
+
code = "JUNCTION_CALENDAR_REFRESH_INCOMPLETE_NORMALIZATION";
|
|
1568
|
+
retryable = true;
|
|
1569
|
+
constructor() {
|
|
1570
|
+
super("Junction calendar refresh contained a row that could not be applied completely.");
|
|
1571
|
+
this.name = "JunctionSparseCalendarRepairNormalizationError";
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
function pushJunctionBoundedTimeseriesFeatures(payload, resource, context) {
|
|
1575
|
+
const features = normalizeJunctionBoundedTimeseriesFeatures(resource, payload);
|
|
1576
|
+
const featureResourceSlug = slugify(resource, "timeseries");
|
|
1577
|
+
features.forEach((entry, index) => {
|
|
1578
|
+
const identity = buildJunctionBoundedFeatureIdentity(resource, entry);
|
|
1579
|
+
const evidenceRole = `junction-timeseries-feature-${featureResourceSlug}:${shortHash([
|
|
1580
|
+
resource,
|
|
1581
|
+
identity,
|
|
1582
|
+
])}`;
|
|
1583
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(evidenceRole, `${evidenceRole}.json`, entry), "timeseries_feature_aggregate"));
|
|
1584
|
+
const resourceContext = buildResourceContext({
|
|
1585
|
+
entry,
|
|
1586
|
+
resource,
|
|
1587
|
+
resourceSlug: featureResourceSlug,
|
|
1588
|
+
identityKind: "timeseries",
|
|
1589
|
+
index,
|
|
1590
|
+
fallbackArtifactRole: evidenceRole,
|
|
1591
|
+
fallbackIdentityDisambiguator: identity,
|
|
1592
|
+
context,
|
|
1593
|
+
});
|
|
1113
1594
|
if (!resourceContext) {
|
|
1114
|
-
|
|
1595
|
+
return;
|
|
1115
1596
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
const sampleAt = resolveJunctionDailyAggregateSampleAt(timestamp);
|
|
1119
|
-
const dayKey = resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, sampleAt, input.context.defaultTimeZone);
|
|
1120
|
-
const legacyDayKey = resolveLegacyJunctionTimeseriesAggregateDayKey(entry, timestamp, sampleAt);
|
|
1121
|
-
if (value === undefined || !sampleAt || !dayKey) {
|
|
1122
|
-
continue;
|
|
1597
|
+
if (resource === "electrocardiogram_voltage") {
|
|
1598
|
+
pushElectrocardiogramSummary(entry, resourceContext, context);
|
|
1123
1599
|
}
|
|
1124
|
-
|
|
1125
|
-
resourceContext
|
|
1126
|
-
resourceContext.origin.sourceType ?? "",
|
|
1127
|
-
resourceContext.origin.sourceInstanceId ?? "",
|
|
1128
|
-
dayKey,
|
|
1129
|
-
].join("\u0000");
|
|
1130
|
-
const existing = aggregates.get(key);
|
|
1131
|
-
const recordedAt = timestamp.recordedAt ?? sampleAt;
|
|
1132
|
-
const timeZone = firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"]);
|
|
1133
|
-
const legacyDayKeys = new Set();
|
|
1134
|
-
if (legacyDayKey && legacyDayKey !== dayKey) {
|
|
1135
|
-
legacyDayKeys.add(legacyDayKey);
|
|
1600
|
+
else {
|
|
1601
|
+
pushJunctionWorkoutStreamFeature(entry, resourceContext, context);
|
|
1136
1602
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
function pushJunctionWorkoutStreamFeature(entry, resourceContext, context) {
|
|
1606
|
+
const startRaw = firstValueFromPaths(entry, ["startAt"]);
|
|
1607
|
+
const occurredAt = resolveSafeTimestamp(startRaw, resourceContext.sourceProviderSlug);
|
|
1608
|
+
if (!occurredAt) {
|
|
1609
|
+
return;
|
|
1610
|
+
}
|
|
1611
|
+
const baseTimestamp = resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug);
|
|
1612
|
+
const timestamp = withTimestampOverride(baseTimestamp, {
|
|
1613
|
+
occurredAt,
|
|
1614
|
+
dayKey: extractIsoDatePrefix(occurredAt) ?? baseTimestamp.dayKey,
|
|
1615
|
+
observedAtRaw: stringId(startRaw) ?? occurredAt,
|
|
1616
|
+
});
|
|
1617
|
+
const durationSeconds = firstNonNegativeNumberFromPaths(entry, ["durationSeconds"]);
|
|
1618
|
+
const distanceMeters = firstNonNegativeNumberFromPaths(entry, ["distanceMeters"]);
|
|
1619
|
+
const averageHeartRate = firstNonNegativeNumberFromPaths(entry, ["averageHeartRate"]);
|
|
1620
|
+
const maxHeartRate = firstNonNegativeNumberFromPaths(entry, ["maxHeartRate"]);
|
|
1621
|
+
const measurements = [
|
|
1622
|
+
...(durationSeconds === undefined
|
|
1623
|
+
? []
|
|
1624
|
+
: [{ metric: "workout-minutes", value: durationSeconds / 60, unit: "minutes" }]),
|
|
1625
|
+
...(distanceMeters === undefined
|
|
1626
|
+
? []
|
|
1627
|
+
: [{ metric: "workout-distance-km", value: distanceMeters / 1_000, unit: "km" }]),
|
|
1628
|
+
...(averageHeartRate === undefined
|
|
1629
|
+
? []
|
|
1630
|
+
: [{ metric: "average-heart-rate", value: averageHeartRate, unit: "bpm" }]),
|
|
1631
|
+
...(maxHeartRate === undefined
|
|
1632
|
+
? []
|
|
1633
|
+
: [{ metric: "max-heart-rate", value: maxHeartRate, unit: "bpm" }]),
|
|
1634
|
+
];
|
|
1635
|
+
if (measurements.length === 0) {
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
context.events.push(stripUndefined({
|
|
1639
|
+
kind: "measurement",
|
|
1640
|
+
occurredAt,
|
|
1641
|
+
recordedAt: timestamp.recordedAt,
|
|
1642
|
+
dayKey: timestamp.dayKey,
|
|
1643
|
+
source: "device",
|
|
1644
|
+
title: "Junction workout stream features",
|
|
1645
|
+
evidenceRoles: resourceContext.evidenceRoles,
|
|
1646
|
+
externalRef: makeJunctionExternalRef(resourceContext, entry, timestamp, "workout-stream-feature"),
|
|
1647
|
+
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
1648
|
+
fields: { measurements },
|
|
1649
|
+
}));
|
|
1650
|
+
}
|
|
1651
|
+
function normalizeJunctionBoundedTimeseriesFeatures(resource, payload) {
|
|
1652
|
+
const records = timeseriesResourceEntries(payload).map(({ entry }) => entry);
|
|
1653
|
+
return resolveJunctionBoundedFeatureRecords(resource, records);
|
|
1654
|
+
}
|
|
1655
|
+
function pushJunctionSparseTimeseriesRecords(payload, resource, resourceSlug, context, descriptor) {
|
|
1656
|
+
const baseArtifactRole = `junction-timeseries-reading-${resourceSlug}`;
|
|
1657
|
+
const candidates = [];
|
|
1658
|
+
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(payload).entries()) {
|
|
1659
|
+
const resourceContext = buildResourceContext({
|
|
1660
|
+
entry,
|
|
1661
|
+
originFallback,
|
|
1662
|
+
resource,
|
|
1663
|
+
resourceSlug,
|
|
1664
|
+
identityKind: "timeseries",
|
|
1665
|
+
index,
|
|
1666
|
+
fallbackArtifactRole: baseArtifactRole,
|
|
1667
|
+
context,
|
|
1668
|
+
});
|
|
1669
|
+
if (!resourceContext) {
|
|
1670
|
+
continue;
|
|
1671
|
+
}
|
|
1672
|
+
const record = parseJunctionSparseTimeseriesRecord(entry, resource, descriptor);
|
|
1673
|
+
if (!record) {
|
|
1674
|
+
continue;
|
|
1675
|
+
}
|
|
1676
|
+
const timestamp = resolveRecordTimestamp({ ...entry, observedAtRaw: record.observedAtRaw }, context, resourceContext.sourceProviderSlug);
|
|
1677
|
+
const occurredAt = timestamp.occurredAt ?? timestamp.recordedAt;
|
|
1678
|
+
const dayKey = resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, occurredAt, context.defaultTimeZone);
|
|
1679
|
+
if (!occurredAt || !dayKey) {
|
|
1680
|
+
continue;
|
|
1681
|
+
}
|
|
1682
|
+
candidates.push({
|
|
1683
|
+
dayKey,
|
|
1684
|
+
entry,
|
|
1685
|
+
identityHash: buildJunctionSparseTimeseriesIdentityHash({
|
|
1686
|
+
record,
|
|
1687
|
+
resourceContext,
|
|
1688
|
+
resourceSlug,
|
|
1689
|
+
}),
|
|
1690
|
+
occurredAt,
|
|
1691
|
+
record,
|
|
1692
|
+
resourceContext,
|
|
1693
|
+
semanticContentKey: buildJunctionSparseTimeseriesSemanticContentKey({
|
|
1694
|
+
dayKey,
|
|
1695
|
+
entry,
|
|
1696
|
+
occurredAt,
|
|
1697
|
+
record,
|
|
1698
|
+
resourceContext,
|
|
1699
|
+
resourceSlug,
|
|
1700
|
+
timestamp,
|
|
1701
|
+
}),
|
|
1702
|
+
timestamp,
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
const semanticContentKeysByProviderIdentity = new Map();
|
|
1706
|
+
for (const candidate of candidates) {
|
|
1707
|
+
if (!candidate.record.providerRowId) {
|
|
1708
|
+
continue;
|
|
1709
|
+
}
|
|
1710
|
+
const contentKeys = semanticContentKeysByProviderIdentity.get(candidate.identityHash)
|
|
1711
|
+
?? new Set();
|
|
1712
|
+
contentKeys.add(candidate.semanticContentKey);
|
|
1713
|
+
semanticContentKeysByProviderIdentity.set(candidate.identityHash, contentKeys);
|
|
1714
|
+
}
|
|
1715
|
+
const conflictingProviderIdentityHashes = new Set([...semanticContentKeysByProviderIdentity.entries()]
|
|
1716
|
+
.filter(([, contentKeys]) => contentKeys.size > 1)
|
|
1717
|
+
.map(([identityHash]) => identityHash));
|
|
1718
|
+
const seenRecordIdentityHashes = new Set();
|
|
1719
|
+
for (const candidate of candidates) {
|
|
1720
|
+
const { dayKey, entry, identityHash, occurredAt, record, resourceContext, timestamp, } = candidate;
|
|
1721
|
+
if (conflictingProviderIdentityHashes.has(identityHash)
|
|
1722
|
+
|| seenRecordIdentityHashes.has(identityHash)) {
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
seenRecordIdentityHashes.add(identityHash);
|
|
1726
|
+
const role = `${baseArtifactRole}:${dayKey}:${identityHash}`;
|
|
1727
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
1728
|
+
schema: "junction.sparse_timeseries_record.v1",
|
|
1729
|
+
provider: "junction",
|
|
1730
|
+
resource,
|
|
1731
|
+
dayKey,
|
|
1732
|
+
sourceProviderSlug: resourceContext.sourceProviderSlug,
|
|
1733
|
+
sourceType: resourceContext.origin.sourceType,
|
|
1734
|
+
sourceInstanceId: resourceContext.origin.sourceInstanceId,
|
|
1735
|
+
providerRowId: record.providerRowId,
|
|
1736
|
+
observedAtRaw: record.observedAtRaw,
|
|
1737
|
+
occurredAt,
|
|
1738
|
+
recordedAt: timestamp.recordedAt,
|
|
1739
|
+
startAt: record.startAt,
|
|
1740
|
+
endAt: record.endAt,
|
|
1741
|
+
value: record.value,
|
|
1742
|
+
unit: record.unit,
|
|
1743
|
+
upstreamUnit: record.upstreamUnit,
|
|
1744
|
+
alertType: record.alertType,
|
|
1745
|
+
bolusPurpose: record.bolusPurpose,
|
|
1746
|
+
deliveryForm: record.deliveryForm,
|
|
1747
|
+
deliveryMode: record.deliveryMode,
|
|
1748
|
+
insulinType: record.insulinType,
|
|
1749
|
+
})), "timeseries_reading"));
|
|
1750
|
+
const externalRef = makeProviderExternalRef("junction", resourceContext.externalRefResourceType, `${resourceSlug}-${identityHash}`, undefined, descriptor.metric ?? resourceSlug);
|
|
1751
|
+
const dataOrigin = buildDataOrigin(entry, resourceContext, withTimestampOverride(timestamp, {
|
|
1752
|
+
occurredAt,
|
|
1753
|
+
dayKey,
|
|
1754
|
+
observedAtRaw: record.observedAtRaw,
|
|
1755
|
+
}), { normalizerVersion: "junction-sparse-timeseries.v1" });
|
|
1756
|
+
if (descriptor.kind === "insulin") {
|
|
1757
|
+
const insulinTags = [
|
|
1758
|
+
record.bolusPurpose,
|
|
1759
|
+
record.deliveryForm,
|
|
1760
|
+
record.deliveryMode,
|
|
1761
|
+
record.insulinType,
|
|
1762
|
+
].flatMap((value) => value ? [slugify(value, "insulin")] : []);
|
|
1763
|
+
context.events.push(stripUndefined({
|
|
1764
|
+
kind: "intervention_session",
|
|
1765
|
+
occurredAt,
|
|
1766
|
+
recordedAt: timestamp.recordedAt,
|
|
1767
|
+
dayKey,
|
|
1768
|
+
source: "device",
|
|
1769
|
+
title: descriptor.title,
|
|
1770
|
+
tags: insulinTags.length > 0 ? [...new Set(insulinTags)] : undefined,
|
|
1771
|
+
evidenceRoles: [role],
|
|
1772
|
+
externalRef,
|
|
1773
|
+
dataOrigin,
|
|
1774
|
+
fields: {
|
|
1775
|
+
interventionType: "insulin-injection",
|
|
1776
|
+
sessionStatus: "completed",
|
|
1777
|
+
fields: stripUndefined({
|
|
1778
|
+
"dose-amount": record.value,
|
|
1779
|
+
"dose-unit": record.unit,
|
|
1780
|
+
"start-at": record.startAt,
|
|
1781
|
+
"end-at": record.endAt,
|
|
1782
|
+
"bolus-purpose": record.bolusPurpose,
|
|
1783
|
+
"delivery-form": record.deliveryForm,
|
|
1784
|
+
"delivery-mode": record.deliveryMode,
|
|
1785
|
+
"insulin-type": record.insulinType,
|
|
1786
|
+
}),
|
|
1787
|
+
},
|
|
1788
|
+
}));
|
|
1789
|
+
continue;
|
|
1790
|
+
}
|
|
1791
|
+
if (!descriptor.metric) {
|
|
1792
|
+
continue;
|
|
1793
|
+
}
|
|
1794
|
+
const alertTag = record.alertType
|
|
1795
|
+
? slugify(`${resource}-${record.alertType}`, "alert")
|
|
1796
|
+
: undefined;
|
|
1797
|
+
context.events.push(stripUndefined({
|
|
1798
|
+
kind: "observation",
|
|
1799
|
+
occurredAt,
|
|
1800
|
+
recordedAt: timestamp.recordedAt,
|
|
1801
|
+
dayKey,
|
|
1802
|
+
source: "device",
|
|
1803
|
+
title: descriptor.title,
|
|
1804
|
+
tags: alertTag ? [alertTag] : undefined,
|
|
1805
|
+
evidenceRoles: [role],
|
|
1806
|
+
externalRef,
|
|
1807
|
+
dataOrigin,
|
|
1808
|
+
fields: {
|
|
1809
|
+
metric: descriptor.metric,
|
|
1810
|
+
observationGrain: "sample",
|
|
1811
|
+
value: record.value,
|
|
1812
|
+
unit: descriptor.canonicalUnit,
|
|
1813
|
+
},
|
|
1814
|
+
}));
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
function parseJunctionSparseTimeseriesRecord(entry, resource, descriptor) {
|
|
1818
|
+
const value = finiteNumber(entry.value);
|
|
1819
|
+
const unit = stringId(entry.unit);
|
|
1820
|
+
if (value === undefined
|
|
1821
|
+
|| unit !== descriptor.upstreamUnit
|
|
1822
|
+
|| value < descriptor.minimum
|
|
1823
|
+
|| value > descriptor.maximum
|
|
1824
|
+
|| (descriptor.requireInteger === true && !Number.isSafeInteger(value))) {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1827
|
+
const timestampRaw = stringId(entry.timestamp);
|
|
1828
|
+
const startRaw = stringId(entry.start);
|
|
1829
|
+
const endRaw = stringId(entry.end);
|
|
1830
|
+
const requiresTimestamp = resource !== "carbohydrates"
|
|
1831
|
+
&& resource !== "heart_rate_alert"
|
|
1832
|
+
&& resource !== "insulin_injection";
|
|
1833
|
+
const requiresInterval = resource !== "fat";
|
|
1834
|
+
if ((requiresTimestamp && !timestampRaw) || (requiresInterval && (!startRaw || !endRaw))) {
|
|
1835
|
+
return null;
|
|
1836
|
+
}
|
|
1837
|
+
const timestamp = timestampRaw ? normalizeTimestamp(timestampRaw) : undefined;
|
|
1838
|
+
const startAt = startRaw ? normalizeTimestamp(startRaw) : undefined;
|
|
1839
|
+
const endAt = endRaw ? normalizeTimestamp(endRaw) : undefined;
|
|
1840
|
+
if ((timestampRaw && !timestamp)
|
|
1841
|
+
|| (startRaw && !startAt)
|
|
1842
|
+
|| (endRaw && !endAt)
|
|
1843
|
+
|| (requiresInterval && (!startAt || !endAt))
|
|
1844
|
+
|| (startAt && endAt && Date.parse(endAt) < Date.parse(startAt))) {
|
|
1845
|
+
return null;
|
|
1846
|
+
}
|
|
1847
|
+
const observedAtRaw = timestampRaw ?? startRaw;
|
|
1848
|
+
if (!observedAtRaw) {
|
|
1849
|
+
return null;
|
|
1850
|
+
}
|
|
1851
|
+
const alertType = descriptor.kind === "alert" && resource === "heart_rate_alert"
|
|
1852
|
+
? normalizeJunctionSemanticToken(entry.type)
|
|
1853
|
+
: undefined;
|
|
1854
|
+
if (resource === "heart_rate_alert" && (!alertType || !JUNCTION_HEART_ALERT_TYPES.has(alertType))) {
|
|
1855
|
+
return null;
|
|
1856
|
+
}
|
|
1857
|
+
return stripUndefined({
|
|
1858
|
+
alertType,
|
|
1859
|
+
bolusPurpose: descriptor.kind === "insulin"
|
|
1860
|
+
? normalizeJunctionSemanticToken(entry.bolus_purpose ?? entry.bolusPurpose)
|
|
1861
|
+
: undefined,
|
|
1862
|
+
deliveryForm: descriptor.kind === "insulin"
|
|
1863
|
+
? normalizeJunctionSemanticToken(entry.delivery_form ?? entry.deliveryForm)
|
|
1864
|
+
: undefined,
|
|
1865
|
+
deliveryMode: descriptor.kind === "insulin"
|
|
1866
|
+
? normalizeJunctionSemanticToken(entry.delivery_mode ?? entry.deliveryMode)
|
|
1867
|
+
: undefined,
|
|
1868
|
+
insulinType: descriptor.kind === "insulin"
|
|
1869
|
+
? normalizeJunctionSemanticToken(entry.type)
|
|
1870
|
+
: undefined,
|
|
1871
|
+
endAt,
|
|
1872
|
+
observedAtRaw,
|
|
1873
|
+
providerRowId: trimOptionalToLength(firstStringFromPaths(entry, JUNCTION_GENERIC_SUMMARY_ID_PATHS), 200),
|
|
1874
|
+
startAt,
|
|
1875
|
+
unit: descriptor.canonicalUnit,
|
|
1876
|
+
upstreamUnit: descriptor.upstreamUnit,
|
|
1877
|
+
value,
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
function normalizeJunctionSemanticToken(value) {
|
|
1881
|
+
const normalized = stringId(value)
|
|
1882
|
+
?.trim()
|
|
1883
|
+
.toLowerCase()
|
|
1884
|
+
.replace(/[^a-z0-9]+/gu, "_")
|
|
1885
|
+
.replace(/^_+|_+$/gu, "")
|
|
1886
|
+
.slice(0, 80)
|
|
1887
|
+
.replace(/_+$/u, "");
|
|
1888
|
+
return normalized || undefined;
|
|
1889
|
+
}
|
|
1890
|
+
function buildJunctionSparseTimeseriesIdentityHash(input) {
|
|
1891
|
+
if (input.record.providerRowId) {
|
|
1892
|
+
return shortHash([
|
|
1893
|
+
input.resourceSlug,
|
|
1894
|
+
input.resourceContext.sourceProviderSlug,
|
|
1895
|
+
input.resourceContext.origin.sourceType ?? "",
|
|
1896
|
+
input.resourceContext.origin.sourceInstanceId ?? "",
|
|
1897
|
+
input.record.providerRowId,
|
|
1898
|
+
]);
|
|
1899
|
+
}
|
|
1900
|
+
return buildJunctionSparseTimeseriesSemanticIdentityHash(input);
|
|
1901
|
+
}
|
|
1902
|
+
function buildJunctionSparseTimeseriesSemanticIdentityHash(input) {
|
|
1903
|
+
return shortHash(junctionSparseTimeseriesSemanticIdentityParts(input));
|
|
1904
|
+
}
|
|
1905
|
+
function junctionSparseTimeseriesSemanticIdentityParts(input) {
|
|
1906
|
+
return [
|
|
1907
|
+
input.resourceSlug,
|
|
1908
|
+
input.resourceContext.sourceProviderSlug,
|
|
1909
|
+
input.resourceContext.origin.sourceType ?? "",
|
|
1910
|
+
input.resourceContext.origin.sourceInstanceId ?? "",
|
|
1911
|
+
input.record.providerRowId ?? "",
|
|
1912
|
+
input.record.observedAtRaw,
|
|
1913
|
+
input.record.startAt ?? "",
|
|
1914
|
+
input.record.endAt ?? "",
|
|
1915
|
+
input.record.value,
|
|
1916
|
+
input.record.unit,
|
|
1917
|
+
input.record.upstreamUnit,
|
|
1918
|
+
input.record.alertType ?? "",
|
|
1919
|
+
input.record.bolusPurpose ?? "",
|
|
1920
|
+
input.record.deliveryForm ?? "",
|
|
1921
|
+
input.record.deliveryMode ?? "",
|
|
1922
|
+
input.record.insulinType ?? "",
|
|
1923
|
+
];
|
|
1924
|
+
}
|
|
1925
|
+
function buildJunctionSparseTimeseriesSemanticContentKey(input) {
|
|
1926
|
+
return JSON.stringify([
|
|
1927
|
+
...junctionSparseTimeseriesSemanticIdentityParts(input),
|
|
1928
|
+
input.occurredAt,
|
|
1929
|
+
input.timestamp.recordedAt ?? "",
|
|
1930
|
+
input.dayKey,
|
|
1931
|
+
input.timestamp.timestampSemantics ?? "",
|
|
1932
|
+
readJunctionTimeZoneOffsetMinutes(input.entry) ?? "",
|
|
1933
|
+
input.resourceContext.origin.originConfidence ?? "",
|
|
1934
|
+
]);
|
|
1935
|
+
}
|
|
1936
|
+
function pushJunctionNoteTags(payload, resource, resourceSlug, context) {
|
|
1937
|
+
const baseArtifactRole = `junction-timeseries-reading-${resourceSlug}`;
|
|
1938
|
+
const noteSpines = new Map();
|
|
1939
|
+
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(payload).entries()) {
|
|
1940
|
+
const resourceContext = buildResourceContext({
|
|
1941
|
+
entry,
|
|
1942
|
+
originFallback,
|
|
1943
|
+
resource,
|
|
1944
|
+
resourceSlug,
|
|
1945
|
+
identityKind: "timeseries",
|
|
1946
|
+
index,
|
|
1947
|
+
fallbackArtifactRole: baseArtifactRole,
|
|
1948
|
+
context,
|
|
1949
|
+
});
|
|
1950
|
+
if (!resourceContext)
|
|
1951
|
+
continue;
|
|
1952
|
+
// A missing tag field is still a free-text-only provider note and stays
|
|
1953
|
+
// canonical-no-op. An explicit empty tag set is retained so a later replay
|
|
1954
|
+
// can clear the tag state on an existing neutral note spine.
|
|
1955
|
+
if (!Object.hasOwn(entry, "tags"))
|
|
1956
|
+
continue;
|
|
1957
|
+
const tags = normalizeJunctionNoteTags(entry.tags);
|
|
1958
|
+
const start = firstStringFromPaths(entry, ["start", "startAt", "start_at"]);
|
|
1959
|
+
const baseTimestamp = resolveRecordTimestamp(start ? { ...entry, observedAtRaw: start } : entry, context, resourceContext.sourceProviderSlug);
|
|
1960
|
+
const timestamp = withTimestampOverride(baseTimestamp, {
|
|
1961
|
+
dayKey: baseTimestamp.dayKey ?? extractIsoDatePrefix(start) ?? undefined,
|
|
1962
|
+
});
|
|
1963
|
+
if (!timestamp.occurredAt || !timestamp.dayKey)
|
|
1964
|
+
continue;
|
|
1965
|
+
const stableId = firstStringFromPaths(entry, JUNCTION_GENERIC_SUMMARY_ID_PATHS);
|
|
1966
|
+
const resourceId = buildJunctionNoteResourceId(resourceContext, stableId, timestamp);
|
|
1967
|
+
const spineKey = `${resourceContext.externalRefResourceType}:${resourceId}`;
|
|
1968
|
+
const existing = noteSpines.get(spineKey);
|
|
1969
|
+
if (existing) {
|
|
1970
|
+
if (stableId) {
|
|
1971
|
+
// Duplicate rows with an explicit provider identity describe one note.
|
|
1972
|
+
// Keep the final row's current tag state rather than unioning revisions.
|
|
1973
|
+
existing.entry = entry;
|
|
1974
|
+
existing.resourceContext = resourceContext;
|
|
1975
|
+
existing.tags = new Set(tags);
|
|
1976
|
+
existing.timestamp = timestamp;
|
|
1977
|
+
}
|
|
1978
|
+
else {
|
|
1979
|
+
// Without an upstream id, source + timestamp is the narrowest stable
|
|
1980
|
+
// spine available. Preserve every same-time tag while allowing a later
|
|
1981
|
+
// replay to revise or clear that timestamp's aggregate tag state.
|
|
1982
|
+
for (const tag of tags)
|
|
1983
|
+
existing.tags.add(tag);
|
|
1984
|
+
}
|
|
1985
|
+
continue;
|
|
1986
|
+
}
|
|
1987
|
+
noteSpines.set(spineKey, {
|
|
1988
|
+
entry,
|
|
1989
|
+
resourceContext,
|
|
1990
|
+
resourceId,
|
|
1991
|
+
tags: new Set(tags),
|
|
1992
|
+
timestamp,
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
for (const spine of noteSpines.values()) {
|
|
1996
|
+
const tags = [...spine.tags].sort();
|
|
1997
|
+
const dayKey = spine.timestamp.dayKey;
|
|
1998
|
+
const occurredAt = spine.timestamp.occurredAt;
|
|
1999
|
+
if (!dayKey || !occurredAt)
|
|
2000
|
+
continue;
|
|
2001
|
+
const role = `${baseArtifactRole}:${dayKey}:${spine.resourceId}`;
|
|
2002
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
2003
|
+
schema: "junction.note_tags.v1",
|
|
2004
|
+
provider: "junction",
|
|
2005
|
+
resource,
|
|
2006
|
+
dayKey,
|
|
2007
|
+
sourceProviderSlug: spine.resourceContext.sourceProviderSlug,
|
|
2008
|
+
sourceType: spine.resourceContext.origin.sourceType,
|
|
2009
|
+
sourceInstanceId: spine.resourceContext.origin.sourceInstanceId,
|
|
2010
|
+
occurredAt,
|
|
2011
|
+
recordedAt: spine.timestamp.recordedAt,
|
|
2012
|
+
tags,
|
|
2013
|
+
})), "timeseries_reading"));
|
|
2014
|
+
context.events.push(stripUndefined({
|
|
2015
|
+
kind: "note",
|
|
2016
|
+
occurredAt,
|
|
2017
|
+
recordedAt: spine.timestamp.recordedAt,
|
|
2018
|
+
dayKey,
|
|
2019
|
+
source: "device",
|
|
2020
|
+
title: "Wearable tags",
|
|
2021
|
+
// The canonical note body is a product-owned marker. Provider free text
|
|
2022
|
+
// never crosses the sanitizer; normalized tag facts live only in `tags`.
|
|
2023
|
+
note: "Wearable tags",
|
|
2024
|
+
tags,
|
|
2025
|
+
evidenceRoles: [role],
|
|
2026
|
+
// This facet is intentionally distinct from the legacy `tag-*`
|
|
2027
|
+
// intervention facets. Core event spines are kind-stable, so any repair
|
|
2028
|
+
// of already-persisted legacy rows must remain explicit.
|
|
2029
|
+
externalRef: makeProviderExternalRef("junction", spine.resourceContext.externalRefResourceType, spine.resourceId, undefined, JUNCTION_WEARABLE_TAG_EXTERNAL_REF_FACET),
|
|
2030
|
+
dataOrigin: buildDataOrigin(spine.entry, spine.resourceContext, spine.timestamp),
|
|
2031
|
+
fields: {
|
|
2032
|
+
noteType: JUNCTION_WEARABLE_TAG_NOTE_TYPE,
|
|
2033
|
+
},
|
|
2034
|
+
}));
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
function buildJunctionNoteResourceId(resourceContext, stableId, timestamp) {
|
|
2038
|
+
if (stableId) {
|
|
2039
|
+
// Junction ids are provider-local, not globally unique across two devices
|
|
2040
|
+
// or accounts of the same provider. Preserve edit/clear stability while
|
|
2041
|
+
// keeping each source instance on its own kind-stable note spine.
|
|
2042
|
+
return shortHash([
|
|
2043
|
+
resourceContext.externalRefResourceType,
|
|
2044
|
+
resourceContext.origin.sourceType,
|
|
2045
|
+
resourceContext.origin.sourceInstanceId,
|
|
2046
|
+
stableId,
|
|
2047
|
+
]);
|
|
2048
|
+
}
|
|
2049
|
+
return buildStableTimeseriesResourceId(resourceContext, timestamp);
|
|
2050
|
+
}
|
|
2051
|
+
function normalizeJunctionNoteTags(value) {
|
|
2052
|
+
return [...new Set(asArray(value).flatMap((entry) => {
|
|
2053
|
+
const label = stringId(entry);
|
|
2054
|
+
if (!label)
|
|
2055
|
+
return [];
|
|
2056
|
+
const tag = slugify(label, "").slice(0, 80).replace(/-+$/u, "");
|
|
2057
|
+
return tag ? [tag] : [];
|
|
2058
|
+
}))].sort();
|
|
2059
|
+
}
|
|
2060
|
+
function pushJunctionDailyTimeseriesObservations(payload, resource, resourceSlug, context, descriptor, selectedSparseRecords) {
|
|
2061
|
+
for (const aggregate of buildJunctionDailyTimeseriesAggregates({
|
|
2062
|
+
payload,
|
|
2063
|
+
resource,
|
|
2064
|
+
resourceSlug,
|
|
2065
|
+
context,
|
|
2066
|
+
valuePaths: descriptor.valuePaths,
|
|
2067
|
+
normalizeValue: descriptor.normalizeValue,
|
|
2068
|
+
selectedSparseRecords,
|
|
2069
|
+
requireExplicitTimestamp: descriptor.requireExplicitTimestamp === true,
|
|
2070
|
+
})) {
|
|
2071
|
+
for (const observation of descriptor.observations) {
|
|
2072
|
+
pushJunctionDailyTimeseriesObservation(context, aggregate, {
|
|
2073
|
+
metric: observation.metric,
|
|
2074
|
+
title: observation.title,
|
|
2075
|
+
unit: descriptor.unit,
|
|
2076
|
+
value: junctionDailyTimeseriesStatisticValue(aggregate, observation.statistic),
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
// Keep the complete feature identity present even when the provider supplied
|
|
2080
|
+
// only date precision, so an empty temporal view clears older clocked facts.
|
|
2081
|
+
if (isJunctionDenseFidelityResource(resource)) {
|
|
2082
|
+
pushJunctionTimeseriesFeatureEnvelope(context, aggregate, resource);
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
function junctionDailyTimeseriesStatisticValue(aggregate, statistic) {
|
|
2087
|
+
switch (statistic) {
|
|
2088
|
+
case "min":
|
|
2089
|
+
return aggregate.minValue;
|
|
2090
|
+
case "max":
|
|
2091
|
+
return aggregate.maxValue;
|
|
2092
|
+
case "sum":
|
|
2093
|
+
return aggregate.sum;
|
|
2094
|
+
case "mean":
|
|
2095
|
+
return aggregate.sum / aggregate.sampleCount;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
function buildJunctionTimeseriesFidelityRecordKey(input) {
|
|
2099
|
+
const stableId = firstStringFromPaths(input.entry, JUNCTION_TIMESERIES_RECORD_ID_PATHS);
|
|
2100
|
+
const shared = [
|
|
2101
|
+
input.resource,
|
|
2102
|
+
input.resourceContext.sourceProviderSlug,
|
|
2103
|
+
input.resourceContext.origin.sourceType ?? "",
|
|
2104
|
+
input.resourceContext.origin.sourceInstanceId ?? "",
|
|
2105
|
+
stableId ?? "",
|
|
2106
|
+
input.timestamp.dayKey ?? "",
|
|
2107
|
+
input.timestamp.timestampSemantics ?? "",
|
|
2108
|
+
firstStringFromPaths(input.entry, ["timeZone", "timezone", "time_zone"]) ?? "",
|
|
2109
|
+
readJunctionTimeZoneOffsetSeconds(input.entry) ?? "",
|
|
2110
|
+
];
|
|
2111
|
+
if (isJunctionSparseIntervalResource(input.resource)) {
|
|
2112
|
+
return JSON.stringify([
|
|
2113
|
+
...shared,
|
|
2114
|
+
firstStringFromPaths(input.entry, JUNCTION_INTERVAL_START_TIMESTAMP_PATHS) ?? "",
|
|
2115
|
+
firstStringFromPaths(input.entry, JUNCTION_INTERVAL_END_TIMESTAMP_PATHS) ?? "",
|
|
2116
|
+
input.providerUnit ?? "",
|
|
2117
|
+
input.providerValue,
|
|
2118
|
+
]);
|
|
2119
|
+
}
|
|
2120
|
+
return JSON.stringify([
|
|
2121
|
+
...shared,
|
|
2122
|
+
input.timestamp.observedAtRaw ?? "",
|
|
2123
|
+
input.providerUnit ?? "",
|
|
2124
|
+
input.providerValue,
|
|
2125
|
+
]);
|
|
2126
|
+
}
|
|
2127
|
+
function buildJunctionDenseFidelityStableIdentity(resource, entry, resourceContext) {
|
|
2128
|
+
const stableId = firstStringFromPaths(entry, JUNCTION_TIMESERIES_RECORD_ID_PATHS);
|
|
2129
|
+
return stableId
|
|
2130
|
+
? JSON.stringify([
|
|
2131
|
+
resource,
|
|
2132
|
+
resourceContext.sourceProviderSlug,
|
|
2133
|
+
resourceContext.origin.sourceType ?? "",
|
|
2134
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
2135
|
+
stableId,
|
|
2136
|
+
])
|
|
2137
|
+
: undefined;
|
|
2138
|
+
}
|
|
2139
|
+
function resolveJunctionExplicitSourceVersion(entry, sourceProviderSlug) {
|
|
2140
|
+
return resolveSafeTimestamp(firstValueFromPaths(entry, ["recordedAt", "recorded_at", "updatedAt", "updated_at"]), sourceProviderSlug);
|
|
2141
|
+
}
|
|
2142
|
+
function selectJunctionAuthoritativeRevision(resource, existing, candidate) {
|
|
2143
|
+
if (existing.contentFingerprint === candidate.contentFingerprint) {
|
|
2144
|
+
if (!existing.sourceVersion)
|
|
2145
|
+
return candidate.sourceVersion ? candidate : existing;
|
|
2146
|
+
if (!candidate.sourceVersion)
|
|
2147
|
+
return existing;
|
|
2148
|
+
return candidate.sourceVersion > existing.sourceVersion ? candidate : existing;
|
|
2149
|
+
}
|
|
2150
|
+
if (!existing.sourceVersion
|
|
2151
|
+
|| !candidate.sourceVersion
|
|
2152
|
+
|| existing.sourceVersion === candidate.sourceVersion) {
|
|
2153
|
+
throw new RangeError(`Junction ${resource} stable-id records with different bodies require distinct explicit provider revisions.`);
|
|
2154
|
+
}
|
|
2155
|
+
return candidate.sourceVersion > existing.sourceVersion ? candidate : existing;
|
|
2156
|
+
}
|
|
2157
|
+
function selectJunctionDenseFidelityRecordKeys(input) {
|
|
2158
|
+
const selected = new Map();
|
|
2159
|
+
const fallbackArtifactRole = `junction-timeseries-daily-${input.resourceSlug}`;
|
|
2160
|
+
for (const [index, { entry, originFallback }] of input.entries.entries()) {
|
|
2161
|
+
const resourceContext = buildResourceContext({
|
|
2162
|
+
entry,
|
|
2163
|
+
originFallback,
|
|
2164
|
+
resource: input.resource,
|
|
2165
|
+
resourceSlug: input.resourceSlug,
|
|
2166
|
+
identityKind: "timeseries",
|
|
2167
|
+
index,
|
|
2168
|
+
fallbackArtifactRole,
|
|
2169
|
+
context: input.context,
|
|
2170
|
+
});
|
|
2171
|
+
if (!resourceContext)
|
|
2172
|
+
continue;
|
|
2173
|
+
const stableIdentity = buildJunctionDenseFidelityStableIdentity(input.resource, entry, resourceContext);
|
|
2174
|
+
if (!stableIdentity)
|
|
2175
|
+
continue;
|
|
2176
|
+
const providerValue = firstValueFromPaths(entry, input.valuePaths);
|
|
2177
|
+
const value = input.normalizeValue(firstNumberFromPaths(entry, input.valuePaths), entry);
|
|
2178
|
+
const timestamp = resolveRecordTimestamp(entry, input.context, resourceContext.sourceProviderSlug);
|
|
2179
|
+
const sampleAt = resolveJunctionDailyAggregateSampleAt(timestamp, false);
|
|
2180
|
+
if (value === undefined || !sampleAt)
|
|
2181
|
+
continue;
|
|
2182
|
+
const providerUnit = trimOptionalToLength(firstStringFromPaths(entry, JUNCTION_INTERVAL_UNIT_PATHS), 160);
|
|
2183
|
+
const recordKey = buildJunctionTimeseriesFidelityRecordKey({
|
|
2184
|
+
entry,
|
|
2185
|
+
providerUnit,
|
|
2186
|
+
providerValue,
|
|
2187
|
+
resource: input.resource,
|
|
2188
|
+
resourceContext,
|
|
2189
|
+
timestamp,
|
|
2190
|
+
});
|
|
2191
|
+
const candidate = {
|
|
2192
|
+
contentFingerprint: recordKey,
|
|
2193
|
+
recordKey,
|
|
2194
|
+
sourceVersion: resolveJunctionExplicitSourceVersion(entry, resourceContext.sourceProviderSlug),
|
|
2195
|
+
};
|
|
2196
|
+
const existing = selected.get(stableIdentity);
|
|
2197
|
+
selected.set(stableIdentity, existing
|
|
2198
|
+
? selectJunctionAuthoritativeRevision(input.resource, existing, candidate)
|
|
2199
|
+
: candidate);
|
|
2200
|
+
}
|
|
2201
|
+
return selected;
|
|
2202
|
+
}
|
|
2203
|
+
function buildJunctionTimeseriesFidelityPoint(input) {
|
|
2204
|
+
if (!input.timestamp.observedAtRaw
|
|
2205
|
+
|| isDateOnlyJunctionTimestamp(input.timestamp.observedAtRaw)) {
|
|
2206
|
+
// Calendar precision belongs in the established daily aggregate only.
|
|
2207
|
+
return undefined;
|
|
2208
|
+
}
|
|
2209
|
+
const observedAtMs = resolveJunctionFidelityObservedAtMs(input.timestamp);
|
|
2210
|
+
const localMinute = resolveJunctionFidelityLocalMinute(input.entry, input.timestamp, input.sampleAt, input.defaultTimeZone);
|
|
2211
|
+
if (observedAtMs === undefined || localMinute === undefined)
|
|
2212
|
+
return undefined;
|
|
2213
|
+
return { localMinute, observedAtMs, value: input.value };
|
|
2214
|
+
}
|
|
2215
|
+
function resolveJunctionFidelityObservedAtMs(timestamp) {
|
|
2216
|
+
const raw = timestamp.observedAtRaw;
|
|
2217
|
+
if (raw && timestamp.timestampSemantics === "floating") {
|
|
2218
|
+
const floating = parseJunctionFloatingDateTime(raw);
|
|
2219
|
+
if (floating) {
|
|
2220
|
+
return Date.UTC(floating.year, floating.month - 1, floating.day, floating.hour, floating.minute, floating.second, floating.millisecond);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
const rawMs = raw ? Date.parse(raw) : Number.NaN;
|
|
2224
|
+
return Number.isFinite(rawMs) ? rawMs : undefined;
|
|
2225
|
+
}
|
|
2226
|
+
function resolveJunctionFidelityLocalMinute(entry, timestamp, sampleAt, defaultTimeZone) {
|
|
2227
|
+
const rawParts = timestamp.observedAtRaw
|
|
2228
|
+
? parseJunctionFloatingDateTime(timestamp.observedAtRaw)
|
|
2229
|
+
: undefined;
|
|
2230
|
+
const rawHasNumericOffset = timestamp.observedAtRaw
|
|
2231
|
+
? /[+-]\d{2}:?\d{2}$/u.test(timestamp.observedAtRaw.trim())
|
|
2232
|
+
: false;
|
|
2233
|
+
if (rawParts
|
|
2234
|
+
&& (timestamp.timestampSemantics === "floating" || rawHasNumericOffset)) {
|
|
2235
|
+
return rawParts.hour * 60
|
|
2236
|
+
+ rawParts.minute
|
|
2237
|
+
+ rawParts.second / 60
|
|
2238
|
+
+ rawParts.millisecond / 60_000;
|
|
2239
|
+
}
|
|
2240
|
+
const sampleMs = Date.parse(sampleAt);
|
|
2241
|
+
if (!Number.isFinite(sampleMs))
|
|
2242
|
+
return undefined;
|
|
2243
|
+
const offsetSeconds = readJunctionTimeZoneOffsetSeconds(entry);
|
|
2244
|
+
if (offsetSeconds !== null && offsetSeconds !== undefined) {
|
|
2245
|
+
const shifted = new Date(sampleMs + offsetSeconds * 1000);
|
|
2246
|
+
return shifted.getUTCHours() * 60
|
|
2247
|
+
+ shifted.getUTCMinutes()
|
|
2248
|
+
+ shifted.getUTCSeconds() / 60
|
|
2249
|
+
+ shifted.getUTCMilliseconds() / 60_000;
|
|
2250
|
+
}
|
|
2251
|
+
const timeZone = firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"])
|
|
2252
|
+
?? defaultTimeZone;
|
|
2253
|
+
if (timeZone) {
|
|
2254
|
+
try {
|
|
2255
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
2256
|
+
timeZone,
|
|
2257
|
+
hour: "2-digit",
|
|
2258
|
+
minute: "2-digit",
|
|
2259
|
+
second: "2-digit",
|
|
2260
|
+
hourCycle: "h23",
|
|
2261
|
+
}).formatToParts(new Date(sampleMs));
|
|
2262
|
+
const hour = Number(parts.find((part) => part.type === "hour")?.value);
|
|
2263
|
+
const minute = Number(parts.find((part) => part.type === "minute")?.value);
|
|
2264
|
+
const second = Number(parts.find((part) => part.type === "second")?.value);
|
|
2265
|
+
if (Number.isFinite(hour) && Number.isFinite(minute) && Number.isFinite(second)) {
|
|
2266
|
+
return (hour % 24) * 60 + minute + second / 60;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
catch {
|
|
2270
|
+
// Fall through to UTC when a provider/vault timezone label is invalid.
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
const utc = new Date(sampleMs);
|
|
2274
|
+
return utc.getUTCHours() * 60
|
|
2275
|
+
+ utc.getUTCMinutes()
|
|
2276
|
+
+ utc.getUTCSeconds() / 60
|
|
2277
|
+
+ utc.getUTCMilliseconds() / 60_000;
|
|
2278
|
+
}
|
|
2279
|
+
function parseJunctionFloatingDateTime(value) {
|
|
2280
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?/u.exec(value.trim());
|
|
2281
|
+
if (!match)
|
|
2282
|
+
return undefined;
|
|
2283
|
+
const [year, month, day, hour = "0", minute = "0", second = "0"] = match.slice(1, 7);
|
|
2284
|
+
const fraction = match[7] ?? "";
|
|
2285
|
+
const parsed = {
|
|
2286
|
+
year: Number(year),
|
|
2287
|
+
month: Number(month),
|
|
2288
|
+
day: Number(day),
|
|
2289
|
+
hour: Number(hour),
|
|
2290
|
+
minute: Number(minute),
|
|
2291
|
+
second: Number(second),
|
|
2292
|
+
millisecond: Number(fraction.padEnd(3, "0").slice(0, 3)),
|
|
2293
|
+
};
|
|
2294
|
+
return Object.values(parsed).every(Number.isFinite) ? parsed : undefined;
|
|
2295
|
+
}
|
|
2296
|
+
function buildJunctionDailyTimeseriesAggregates(input) {
|
|
2297
|
+
const evidencePartRole = `junction-timeseries-daily-${input.resourceSlug}`;
|
|
2298
|
+
const aggregates = new Map();
|
|
2299
|
+
const entries = timeseriesResourceEntries(input.payload);
|
|
2300
|
+
const fidelityResource = isJunctionDenseFidelityResource(input.resource)
|
|
2301
|
+
? input.resource
|
|
2302
|
+
: isJunctionSparseIntervalResource(input.resource)
|
|
2303
|
+
? input.resource
|
|
2304
|
+
: undefined;
|
|
2305
|
+
if (fidelityResource) {
|
|
2306
|
+
assertJunctionTimeseriesResponseBound(fidelityResource, entries.length);
|
|
2307
|
+
}
|
|
2308
|
+
const selectedDenseRecordKeys = isJunctionDenseFidelityResource(input.resource)
|
|
2309
|
+
? selectJunctionDenseFidelityRecordKeys({
|
|
2310
|
+
context: input.context,
|
|
2311
|
+
entries,
|
|
2312
|
+
normalizeValue: input.normalizeValue,
|
|
2313
|
+
resource: input.resource,
|
|
2314
|
+
resourceSlug: input.resourceSlug,
|
|
2315
|
+
valuePaths: input.valuePaths,
|
|
2316
|
+
})
|
|
2317
|
+
: undefined;
|
|
2318
|
+
const seenFidelityRecords = new Set();
|
|
2319
|
+
for (const [index, { entry, originFallback }] of entries.entries()) {
|
|
2320
|
+
const resourceContext = buildResourceContext({
|
|
2321
|
+
entry,
|
|
2322
|
+
originFallback,
|
|
2323
|
+
resource: input.resource,
|
|
2324
|
+
resourceSlug: input.resourceSlug,
|
|
2325
|
+
identityKind: "timeseries",
|
|
2326
|
+
index,
|
|
2327
|
+
fallbackArtifactRole: evidencePartRole,
|
|
2328
|
+
context: input.context,
|
|
2329
|
+
});
|
|
2330
|
+
if (!resourceContext) {
|
|
2331
|
+
continue;
|
|
2332
|
+
}
|
|
2333
|
+
const providerValue = firstValueFromPaths(entry, input.valuePaths);
|
|
2334
|
+
const value = input.normalizeValue(firstNumberFromPaths(entry, input.valuePaths), entry);
|
|
2335
|
+
const sparseStartRaw = isJunctionSparseIntervalResource(input.resource)
|
|
2336
|
+
? firstStringFromPaths(entry, JUNCTION_INTERVAL_START_TIMESTAMP_PATHS)
|
|
2337
|
+
: undefined;
|
|
2338
|
+
const timestamp = sparseStartRaw
|
|
2339
|
+
? resolveJunctionSparseIntervalTimestamp(entry, sparseStartRaw, input.context, resourceContext.sourceProviderSlug)
|
|
2340
|
+
: resolveRecordTimestamp(entry, input.context, resourceContext.sourceProviderSlug, JUNCTION_INTERVAL_START_OWNED_TIMESTAMP_PATHS);
|
|
2341
|
+
const sampleAt = resolveJunctionDailyAggregateSampleAt(timestamp, input.requireExplicitTimestamp);
|
|
2342
|
+
const dayKey = input.requireExplicitTimestamp
|
|
2343
|
+
? timestamp.timestampSemantics === "floating" && timestamp.dayKey
|
|
2344
|
+
? timestamp.dayKey
|
|
2345
|
+
: extractIsoDatePrefix(sampleAt) ?? undefined
|
|
2346
|
+
: resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, sampleAt, input.context.defaultTimeZone);
|
|
2347
|
+
const legacyDayKey = input.requireExplicitTimestamp
|
|
2348
|
+
? dayKey
|
|
2349
|
+
: resolveLegacyJunctionTimeseriesAggregateDayKey(entry, timestamp, sampleAt);
|
|
2350
|
+
if (value === undefined
|
|
2351
|
+
|| (input.requireExplicitTimestamp
|
|
2352
|
+
&& !hasValidJunctionExplicitTimeseriesTimestamp(timestamp))
|
|
2353
|
+
|| !sampleAt
|
|
2354
|
+
|| !dayKey) {
|
|
2355
|
+
continue;
|
|
2356
|
+
}
|
|
2357
|
+
const key = [
|
|
2358
|
+
resourceContext.externalRefResourceType,
|
|
2359
|
+
resourceContext.origin.sourceType ?? "",
|
|
2360
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
2361
|
+
dayKey,
|
|
2362
|
+
].join("\u0000");
|
|
2363
|
+
const existing = aggregates.get(key);
|
|
2364
|
+
const recordedAt = timestamp.recordedAt ?? sampleAt;
|
|
2365
|
+
const timeZone = input.requireExplicitTimestamp
|
|
2366
|
+
? "UTC"
|
|
2367
|
+
: firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"]);
|
|
2368
|
+
const providerUnit = trimOptionalToLength(firstStringFromPaths(entry, JUNCTION_INTERVAL_UNIT_PATHS), 160);
|
|
2369
|
+
const fidelityRecordKey = fidelityResource
|
|
2370
|
+
? buildJunctionTimeseriesFidelityRecordKey({
|
|
2371
|
+
entry,
|
|
2372
|
+
providerUnit,
|
|
2373
|
+
providerValue,
|
|
2374
|
+
resource: input.resource,
|
|
2375
|
+
resourceContext,
|
|
2376
|
+
timestamp,
|
|
2377
|
+
})
|
|
2378
|
+
: undefined;
|
|
2379
|
+
const denseStableIdentity = isJunctionDenseFidelityResource(input.resource)
|
|
2380
|
+
? buildJunctionDenseFidelityStableIdentity(input.resource, entry, resourceContext)
|
|
2381
|
+
: undefined;
|
|
2382
|
+
const denseSelection = denseStableIdentity
|
|
2383
|
+
? selectedDenseRecordKeys?.get(denseStableIdentity)
|
|
2384
|
+
: undefined;
|
|
2385
|
+
if (denseStableIdentity
|
|
2386
|
+
&& fidelityRecordKey
|
|
2387
|
+
&& denseSelection?.recordKey !== fidelityRecordKey) {
|
|
2388
|
+
continue;
|
|
2389
|
+
}
|
|
2390
|
+
const sparseSelection = fidelityRecordKey
|
|
2391
|
+
? input.selectedSparseRecords?.get(fidelityRecordKey)
|
|
2392
|
+
: undefined;
|
|
2393
|
+
if (isJunctionSparseIntervalResource(input.resource)
|
|
2394
|
+
&& entry.authoritativeEmptyCalendarSet !== true
|
|
2395
|
+
&& fidelityRecordKey
|
|
2396
|
+
&& input.selectedSparseRecords
|
|
2397
|
+
&& !sparseSelection) {
|
|
2398
|
+
continue;
|
|
2399
|
+
}
|
|
2400
|
+
if (fidelityRecordKey && seenFidelityRecords.has(fidelityRecordKey)) {
|
|
2401
|
+
if (existing) {
|
|
2402
|
+
existing.duplicateSampleCount += 1;
|
|
2403
|
+
}
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
if (fidelityRecordKey) {
|
|
2407
|
+
seenFidelityRecords.add(fidelityRecordKey);
|
|
2408
|
+
}
|
|
2409
|
+
const fidelitySample = isJunctionDenseFidelityResource(input.resource)
|
|
2410
|
+
? buildJunctionTimeseriesFidelityPoint({
|
|
2411
|
+
defaultTimeZone: input.context.defaultTimeZone,
|
|
2412
|
+
entry,
|
|
2413
|
+
resource: input.resource,
|
|
2414
|
+
sampleAt,
|
|
2415
|
+
timestamp,
|
|
2416
|
+
value,
|
|
2417
|
+
})
|
|
2418
|
+
: undefined;
|
|
2419
|
+
const legacyDayKeys = new Set();
|
|
2420
|
+
if (legacyDayKey && legacyDayKey !== dayKey) {
|
|
2421
|
+
legacyDayKeys.add(legacyDayKey);
|
|
2422
|
+
}
|
|
2423
|
+
if (!existing) {
|
|
2424
|
+
aggregates.set(key, {
|
|
2425
|
+
authoritativeEmptyCalendarSet: entry.authoritativeEmptyCalendarSet === true,
|
|
2426
|
+
dayKey,
|
|
2427
|
+
duplicateSampleCount: 0,
|
|
2428
|
+
entry,
|
|
2429
|
+
fidelitySamples: fidelitySample ? [fidelitySample] : [],
|
|
2430
|
+
firstSampleAt: sampleAt,
|
|
2431
|
+
lastRecordedAt: recordedAt,
|
|
2432
|
+
lastSampleAt: sampleAt,
|
|
2433
|
+
legacyDayKeys,
|
|
2434
|
+
maxValue: value,
|
|
2435
|
+
minValue: value,
|
|
2436
|
+
evidencePartRole,
|
|
2437
|
+
resourceContext,
|
|
2438
|
+
sampleCount: 1,
|
|
2439
|
+
sum: value,
|
|
2440
|
+
timestamp,
|
|
2441
|
+
timeZone,
|
|
2442
|
+
});
|
|
2443
|
+
if (fidelityResource) {
|
|
2444
|
+
assertJunctionTimeseriesSourceDayBound(fidelityResource, 1);
|
|
2445
|
+
}
|
|
2446
|
+
continue;
|
|
2447
|
+
}
|
|
2448
|
+
existing.sampleCount += 1;
|
|
2449
|
+
existing.authoritativeEmptyCalendarSet ||= entry.authoritativeEmptyCalendarSet === true;
|
|
2450
|
+
if (fidelitySample) {
|
|
2451
|
+
existing.fidelitySamples.push(fidelitySample);
|
|
2452
|
+
}
|
|
2453
|
+
if (fidelityResource) {
|
|
2454
|
+
assertJunctionTimeseriesSourceDayBound(fidelityResource, existing.sampleCount);
|
|
2455
|
+
}
|
|
2456
|
+
existing.sum += value;
|
|
2457
|
+
if (legacyDayKey && legacyDayKey !== dayKey) {
|
|
2458
|
+
existing.legacyDayKeys.add(legacyDayKey);
|
|
2459
|
+
}
|
|
2460
|
+
if (sampleAt < existing.firstSampleAt) {
|
|
2461
|
+
existing.firstSampleAt = sampleAt;
|
|
2462
|
+
}
|
|
2463
|
+
if (sampleAt >= existing.lastSampleAt) {
|
|
2464
|
+
existing.lastSampleAt = sampleAt;
|
|
2465
|
+
existing.lastRecordedAt = recordedAt;
|
|
2466
|
+
existing.timestamp = timestamp;
|
|
2467
|
+
}
|
|
2468
|
+
if (value < existing.minValue) {
|
|
2469
|
+
existing.minValue = value;
|
|
2470
|
+
}
|
|
2471
|
+
if (value > existing.maxValue) {
|
|
2472
|
+
existing.maxValue = value;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
const sortedAggregates = [...aggregates.values()].sort(compareJunctionDailyTimeseriesAggregates);
|
|
2476
|
+
if (sortedAggregates.length === 0) {
|
|
2477
|
+
pushJunctionEmptyDailyTimeseriesAggregateArtifact(input.context, input.resource, input.resourceSlug);
|
|
2478
|
+
return sortedAggregates;
|
|
2479
|
+
}
|
|
2480
|
+
pushJunctionDailyTimeseriesAggregateArtifacts(input.context, input.resource, sortedAggregates);
|
|
2481
|
+
return sortedAggregates;
|
|
2482
|
+
}
|
|
2483
|
+
function pushJunctionEmptyDailyTimeseriesAggregateArtifact(context, resource, resourceSlug) {
|
|
2484
|
+
const role = `junction-timeseries-daily-${resourceSlug}:no-valid-samples`;
|
|
2485
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, {
|
|
2486
|
+
schema: "junction.timeseries_daily_aggregate.v1",
|
|
2487
|
+
provider: "junction",
|
|
2488
|
+
resource,
|
|
2489
|
+
sampleCount: 0,
|
|
2490
|
+
status: "no_valid_samples",
|
|
2491
|
+
})));
|
|
2492
|
+
}
|
|
2493
|
+
function pushJunctionDailyTimeseriesAggregateArtifacts(context, resource, aggregates) {
|
|
2494
|
+
for (const aggregate of aggregates) {
|
|
2495
|
+
// The role derives only from the aggregate's stable grouping identity
|
|
2496
|
+
// (resource role + day + source); a sorted-position index here would
|
|
2497
|
+
// churn artifact roles across replays and differently-windowed payloads.
|
|
2498
|
+
const role = `${aggregate.evidencePartRole}:${aggregate.dayKey}:${shortHash([
|
|
2499
|
+
aggregate.resourceContext.sourceProviderSlug,
|
|
2500
|
+
aggregate.resourceContext.origin.sourceType ?? "",
|
|
2501
|
+
aggregate.resourceContext.origin.sourceInstanceId ?? "",
|
|
2502
|
+
])}`;
|
|
2503
|
+
aggregate.evidencePartRole = role;
|
|
2504
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
2505
|
+
schema: "junction.timeseries_daily_aggregate.v1",
|
|
2506
|
+
provider: "junction",
|
|
2507
|
+
resource,
|
|
2508
|
+
dayKey: aggregate.dayKey,
|
|
2509
|
+
sourceProviderSlug: aggregate.resourceContext.sourceProviderSlug,
|
|
2510
|
+
sourceType: aggregate.resourceContext.origin.sourceType,
|
|
2511
|
+
sourceInstanceId: aggregate.resourceContext.origin.sourceInstanceId,
|
|
2512
|
+
status: aggregate.authoritativeEmptyCalendarSet
|
|
2513
|
+
? "authoritative_empty_calendar_set"
|
|
2514
|
+
: undefined,
|
|
2515
|
+
sampleCount: aggregate.authoritativeEmptyCalendarSet ? 0 : aggregate.sampleCount,
|
|
2516
|
+
duplicateSampleCount: aggregate.duplicateSampleCount > 0
|
|
2517
|
+
? aggregate.duplicateSampleCount
|
|
2518
|
+
: undefined,
|
|
2519
|
+
firstSampleAt: aggregate.firstSampleAt,
|
|
2520
|
+
lastSampleAt: aggregate.lastSampleAt,
|
|
2521
|
+
lastRecordedAt: aggregate.lastRecordedAt,
|
|
2522
|
+
legacyDayKeys: aggregate.legacyDayKeys.size > 0
|
|
2523
|
+
? [...aggregate.legacyDayKeys].sort()
|
|
2524
|
+
: undefined,
|
|
2525
|
+
meanValue: aggregate.authoritativeEmptyCalendarSet
|
|
2526
|
+
? undefined
|
|
2527
|
+
: roundJunctionTimeseriesAggregateValue(resource, aggregate.sum / aggregate.sampleCount),
|
|
2528
|
+
minValue: aggregate.authoritativeEmptyCalendarSet
|
|
2529
|
+
? undefined
|
|
2530
|
+
: roundJunctionTimeseriesAggregateValue(resource, aggregate.minValue),
|
|
2531
|
+
maxValue: aggregate.authoritativeEmptyCalendarSet
|
|
2532
|
+
? undefined
|
|
2533
|
+
: roundJunctionTimeseriesAggregateValue(resource, aggregate.maxValue),
|
|
2534
|
+
sumValue: JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.get(resource)?.retainSumValue === true
|
|
2535
|
+
&& !aggregate.authoritativeEmptyCalendarSet
|
|
2536
|
+
? roundJunctionTimeseriesAggregateValue(resource, aggregate.sum)
|
|
2537
|
+
: undefined,
|
|
2538
|
+
unit: junctionDailyTimeseriesAggregateUnit(resource),
|
|
2539
|
+
}))));
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
function roundJunctionTimeseriesAggregateValue(resource, value) {
|
|
2543
|
+
return JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.has(resource)
|
|
2544
|
+
? roundJunctionDailyAggregateValue(value)
|
|
2545
|
+
: value;
|
|
2546
|
+
}
|
|
2547
|
+
function junctionDailyTimeseriesAggregateUnit(resource) {
|
|
2548
|
+
return JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.get(resource)?.unit;
|
|
2549
|
+
}
|
|
2550
|
+
function withJunctionCompactTimeseriesMetadata(resource, artifact, resourceCategory = "timeseries_daily_aggregate") {
|
|
2551
|
+
if (!artifact) {
|
|
2552
|
+
return null;
|
|
2553
|
+
}
|
|
2554
|
+
return {
|
|
2555
|
+
...artifact,
|
|
2556
|
+
metadata: {
|
|
2557
|
+
artifactClass: resourceCategory === "timeseries_reading"
|
|
2558
|
+
? "compact_provider_timeseries_reading"
|
|
2559
|
+
: resourceCategory === "timeseries_feature_envelope"
|
|
2560
|
+
? "compact_provider_timeseries_feature_envelope"
|
|
2561
|
+
: "compact_provider_timeseries_aggregate",
|
|
2562
|
+
provider: "junction",
|
|
2563
|
+
resource,
|
|
2564
|
+
resourceCategory,
|
|
2565
|
+
retentionClass: "provider_evidence",
|
|
2566
|
+
},
|
|
2567
|
+
};
|
|
2568
|
+
}
|
|
2569
|
+
function pushJunctionDailyTimeseriesObservation(context, aggregate, observation) {
|
|
2570
|
+
const metric = resolveJunctionHrvMetric(observation.metric, aggregate.resourceContext.sourceProviderSlug);
|
|
2571
|
+
const timestamp = withTimestampOverride(aggregate.timestamp, {
|
|
2572
|
+
occurredAt: aggregate.lastSampleAt,
|
|
2573
|
+
recordedAt: aggregate.lastRecordedAt,
|
|
2574
|
+
dayKey: aggregate.dayKey,
|
|
2575
|
+
observedAtRaw: `${aggregate.dayKey}:${aggregate.resourceContext.resource}:daily`,
|
|
2576
|
+
});
|
|
2577
|
+
const legacyExternalRefs = legacyJunctionDailyTimeseriesAggregateExternalRefs(aggregate, observation.metric);
|
|
2578
|
+
context.events.push(stripUndefined({
|
|
2579
|
+
kind: "observation",
|
|
2580
|
+
occurredAt: aggregate.lastSampleAt,
|
|
2581
|
+
recordedAt: aggregate.lastRecordedAt,
|
|
2582
|
+
dayKey: aggregate.dayKey,
|
|
2583
|
+
timeZone: aggregate.timeZone,
|
|
2584
|
+
source: "device",
|
|
2585
|
+
title: resolveJunctionHrvTitle(metric, observation.title),
|
|
2586
|
+
evidenceRoles: [aggregate.evidencePartRole],
|
|
2587
|
+
externalRef: makeJunctionExternalRef(aggregate.resourceContext, aggregate.entry, timestamp, observation.metric),
|
|
2588
|
+
legacyExternalRefs: legacyExternalRefs.length > 0 ? legacyExternalRefs : undefined,
|
|
2589
|
+
dataOrigin: buildDataOrigin(aggregate.entry, aggregate.resourceContext, timestamp),
|
|
2590
|
+
fields: {
|
|
2591
|
+
metric,
|
|
2592
|
+
observationGrain: "summary",
|
|
2593
|
+
value: roundJunctionDailyAggregateValue(observation.value),
|
|
2594
|
+
unit: observation.unit,
|
|
2595
|
+
},
|
|
2596
|
+
}));
|
|
2597
|
+
}
|
|
2598
|
+
function legacyJunctionDailyTimeseriesAggregateExternalRefs(aggregate, metric) {
|
|
2599
|
+
if (aggregate.legacyDayKeys.size === 0) {
|
|
2600
|
+
return [];
|
|
2601
|
+
}
|
|
2602
|
+
return [...aggregate.legacyDayKeys].sort().map((legacyDayKey) => makeJunctionExternalRef(aggregate.resourceContext, aggregate.entry, withTimestampOverride(aggregate.timestamp, {
|
|
2603
|
+
occurredAt: aggregate.lastSampleAt,
|
|
2604
|
+
recordedAt: aggregate.lastRecordedAt,
|
|
2605
|
+
dayKey: legacyDayKey,
|
|
2606
|
+
observedAtRaw: `${legacyDayKey}:${aggregate.resourceContext.resource}:daily`,
|
|
2607
|
+
}), metric));
|
|
2608
|
+
}
|
|
2609
|
+
function pushJunctionTimeseriesFeatureEnvelope(context, aggregate, resource) {
|
|
2610
|
+
const policy = getJunctionDenseFidelityPolicy(resource);
|
|
2611
|
+
const { envelope, facts } = deriveJunctionTimeseriesFeatureEnvelope(resource, aggregate.fidelitySamples);
|
|
2612
|
+
const featureSampleTimes = aggregate.fidelitySamples
|
|
2613
|
+
.map((sample) => sample.observedAtMs)
|
|
2614
|
+
.sort((left, right) => left - right);
|
|
2615
|
+
const firstFeatureSampleAt = featureSampleTimes[0];
|
|
2616
|
+
const lastFeatureSampleAt = featureSampleTimes[featureSampleTimes.length - 1];
|
|
2617
|
+
const identityHash = shortHash([
|
|
2618
|
+
policy.identityVersion,
|
|
2619
|
+
aggregate.resourceContext.resourceSlug,
|
|
2620
|
+
aggregate.resourceContext.sourceProviderSlug,
|
|
2621
|
+
aggregate.resourceContext.origin.sourceType ?? "",
|
|
2622
|
+
aggregate.resourceContext.origin.sourceInstanceId ?? "",
|
|
2623
|
+
aggregate.dayKey,
|
|
2624
|
+
]);
|
|
2625
|
+
const resourceId = `${aggregate.resourceContext.resourceSlug}-${identityHash}`;
|
|
2626
|
+
const role = [
|
|
2627
|
+
`junction-timeseries-features-${aggregate.resourceContext.resourceSlug}`,
|
|
2628
|
+
aggregate.dayKey,
|
|
2629
|
+
identityHash,
|
|
2630
|
+
].join(":");
|
|
2631
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
2632
|
+
...envelope,
|
|
2633
|
+
provider: "junction",
|
|
2634
|
+
resource,
|
|
2635
|
+
dayKey: aggregate.dayKey,
|
|
2636
|
+
sourceProviderSlug: aggregate.resourceContext.sourceProviderSlug,
|
|
2637
|
+
sourceType: aggregate.resourceContext.origin.sourceType,
|
|
2638
|
+
sourceInstanceId: aggregate.resourceContext.origin.sourceInstanceId,
|
|
2639
|
+
firstSampleAt: firstFeatureSampleAt === undefined
|
|
2640
|
+
? undefined
|
|
2641
|
+
: new Date(firstFeatureSampleAt).toISOString(),
|
|
2642
|
+
lastSampleAt: lastFeatureSampleAt === undefined
|
|
2643
|
+
? undefined
|
|
2644
|
+
: new Date(lastFeatureSampleAt).toISOString(),
|
|
2645
|
+
duplicateSampleCount: aggregate.duplicateSampleCount > 0
|
|
2646
|
+
? aggregate.duplicateSampleCount
|
|
2647
|
+
: undefined,
|
|
2648
|
+
})), "timeseries_feature_envelope"));
|
|
2649
|
+
const timestamp = withTimestampOverride(aggregate.timestamp, {
|
|
2650
|
+
occurredAt: aggregate.lastSampleAt,
|
|
2651
|
+
recordedAt: aggregate.lastRecordedAt,
|
|
2652
|
+
dayKey: aggregate.dayKey,
|
|
2653
|
+
observedAtRaw: `${aggregate.dayKey}:${resource}:features:${policy.policyVersion}`,
|
|
2654
|
+
});
|
|
2655
|
+
context.events.push(stripUndefined({
|
|
2656
|
+
kind: "measurement",
|
|
2657
|
+
occurredAt: aggregate.lastSampleAt,
|
|
2658
|
+
recordedAt: aggregate.lastRecordedAt,
|
|
2659
|
+
dayKey: aggregate.dayKey,
|
|
2660
|
+
timeZone: aggregate.timeZone,
|
|
2661
|
+
source: "device",
|
|
2662
|
+
title: `Junction ${resource.replaceAll("_", " ")} temporal features`,
|
|
2663
|
+
evidenceRoles: [role],
|
|
2664
|
+
externalRef: makeProviderExternalRef("junction", aggregate.resourceContext.externalRefResourceType, resourceId, undefined, "features"),
|
|
2665
|
+
dataOrigin: buildDataOrigin(aggregate.entry, aggregate.resourceContext, timestamp, { normalizerVersion: policy.policyVersion }),
|
|
2666
|
+
fields: {
|
|
2667
|
+
measurements: facts.map((fact) => ({
|
|
2668
|
+
metric: fact.metric,
|
|
2669
|
+
value: fact.value,
|
|
2670
|
+
unit: fact.unit,
|
|
2671
|
+
qualifiers: {
|
|
2672
|
+
"feature-policy-version": policy.policyVersion,
|
|
2673
|
+
},
|
|
2674
|
+
})),
|
|
2675
|
+
},
|
|
2676
|
+
}));
|
|
2677
|
+
}
|
|
2678
|
+
// Dense timeseries streams never retain provider rows. They collapse into one
|
|
2679
|
+
// provider-partitioned feature artifact per UTC hour. The import owner commits
|
|
2680
|
+
// closed UTC-day snapshots, so an hour is the broadest feature bucket whose
|
|
2681
|
+
// completeness is provable without persisted cross-window aggregation state.
|
|
2682
|
+
function pushJunctionFeatureTimeseriesObservations(payload, resource, resourceSlug, context, descriptor) {
|
|
2683
|
+
const aggregates = buildJunctionFeatureTimeseriesAggregates({
|
|
2684
|
+
context,
|
|
2685
|
+
descriptor,
|
|
2686
|
+
payload,
|
|
2687
|
+
resource,
|
|
2688
|
+
resourceSlug,
|
|
2689
|
+
});
|
|
2690
|
+
if (aggregates.length === 0) {
|
|
2691
|
+
const role = `junction-timeseries-feature-${resourceSlug}:no-valid-samples`;
|
|
2692
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, {
|
|
2693
|
+
schema: "junction.timeseries_feature_aggregate.v1",
|
|
2694
|
+
provider: "junction",
|
|
2695
|
+
resource,
|
|
2696
|
+
sampleCount: 0,
|
|
2697
|
+
status: "no_valid_samples",
|
|
2698
|
+
}), "timeseries_feature_aggregate"));
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
for (const aggregate of aggregates) {
|
|
2702
|
+
const role = `${aggregate.evidencePartRole}:${aggregate.bucketKind}:${shortHash([
|
|
2703
|
+
aggregate.resourceContext.externalRefResourceType,
|
|
2704
|
+
aggregate.resourceContext.origin.sourceType ?? "",
|
|
2705
|
+
aggregate.resourceContext.origin.sourceInstanceId ?? "",
|
|
2706
|
+
aggregate.bucketIdentity,
|
|
2707
|
+
])}`;
|
|
2708
|
+
aggregate.evidencePartRole = role;
|
|
2709
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
2710
|
+
schema: "junction.timeseries_feature_aggregate.v1",
|
|
2711
|
+
provider: "junction",
|
|
2712
|
+
resource,
|
|
2713
|
+
bucketKind: aggregate.bucketKind,
|
|
2714
|
+
bucketStartAt: aggregate.bucketStartAt,
|
|
2715
|
+
bucketEndAt: aggregate.bucketEndAt,
|
|
2716
|
+
dayKey: aggregate.dayKey,
|
|
2717
|
+
sourceProviderSlug: aggregate.resourceContext.sourceProviderSlug,
|
|
2718
|
+
sourceType: aggregate.resourceContext.origin.sourceType,
|
|
2719
|
+
sourceInstanceId: aggregate.resourceContext.origin.sourceInstanceId,
|
|
2720
|
+
sampleCount: aggregate.sampleCount,
|
|
2721
|
+
firstSampleAt: aggregate.firstSampleAt,
|
|
2722
|
+
lastSampleAt: aggregate.lastSampleAt,
|
|
2723
|
+
lastRecordedAt: aggregate.lastRecordedAt,
|
|
2724
|
+
sumValue: roundJunctionDailyAggregateValue(aggregate.sum),
|
|
2725
|
+
meanValue: roundJunctionDailyAggregateValue(aggregate.sum / aggregate.sampleCount),
|
|
2726
|
+
minValue: roundJunctionDailyAggregateValue(aggregate.minValue),
|
|
2727
|
+
maxValue: roundJunctionDailyAggregateValue(aggregate.maxValue),
|
|
2728
|
+
unit: descriptor.unit,
|
|
2729
|
+
})), "timeseries_feature_aggregate"));
|
|
2730
|
+
for (const observation of descriptor.observations) {
|
|
2731
|
+
pushJunctionFeatureTimeseriesObservation(context, aggregate, observation, descriptor.unit);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
function buildJunctionFeatureTimeseriesAggregates(input) {
|
|
2736
|
+
const evidencePartRole = `junction-timeseries-feature-${input.resourceSlug}`;
|
|
2737
|
+
const aggregates = new Map();
|
|
2738
|
+
const timestampPaths = usesJunctionTimeseriesIntervalStartOwnership(resolveJunctionTimeseriesResourcePolicy(input.resource))
|
|
2739
|
+
? JUNCTION_INTERVAL_START_OWNED_TIMESTAMP_PATHS
|
|
2740
|
+
: JUNCTION_RECORD_TIMESTAMP_PATHS;
|
|
2741
|
+
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(input.payload).entries()) {
|
|
2742
|
+
const resourceContext = buildResourceContext({
|
|
2743
|
+
entry,
|
|
2744
|
+
originFallback,
|
|
2745
|
+
resource: input.resource,
|
|
2746
|
+
resourceSlug: input.resourceSlug,
|
|
2747
|
+
identityKind: "timeseries",
|
|
2748
|
+
index,
|
|
2749
|
+
fallbackArtifactRole: evidencePartRole,
|
|
2750
|
+
context: input.context,
|
|
2751
|
+
});
|
|
2752
|
+
if (!resourceContext) {
|
|
2753
|
+
continue;
|
|
2754
|
+
}
|
|
2755
|
+
const value = input.descriptor.normalizeValue(firstNumberFromPaths(entry, input.descriptor.valuePaths), entry);
|
|
2756
|
+
const rawSampleAt = firstValueFromPaths(entry, timestampPaths);
|
|
2757
|
+
const sampleAt = resolveSafeTimestamp(rawSampleAt, resourceContext.sourceProviderSlug);
|
|
2758
|
+
if (value === undefined || !sampleAt) {
|
|
2759
|
+
continue;
|
|
2760
|
+
}
|
|
2761
|
+
const timestamp = resolveRecordTimestamp(entry, input.context, resourceContext.sourceProviderSlug, timestampPaths);
|
|
2762
|
+
const dayKey = extractIsoDatePrefix(sampleAt) ?? undefined;
|
|
2763
|
+
if (!dayKey) {
|
|
2764
|
+
continue;
|
|
2765
|
+
}
|
|
2766
|
+
const bucket = resolveJunctionFeatureTimeseriesBucket(sampleAt);
|
|
2767
|
+
const key = [
|
|
2768
|
+
resourceContext.externalRefResourceType,
|
|
2769
|
+
resourceContext.origin.sourceType ?? "",
|
|
2770
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
2771
|
+
bucket.kind,
|
|
2772
|
+
bucket.identity,
|
|
2773
|
+
].join("\u0000");
|
|
2774
|
+
const existing = aggregates.get(key);
|
|
2775
|
+
const recordedAt = timestamp.recordedAt ?? sampleAt;
|
|
2776
|
+
const timeZone = "UTC";
|
|
2777
|
+
if (!existing) {
|
|
2778
|
+
aggregates.set(key, {
|
|
2779
|
+
bucketEndAt: bucket.endAt,
|
|
2780
|
+
bucketIdentity: bucket.identity,
|
|
2781
|
+
bucketKind: bucket.kind,
|
|
2782
|
+
bucketStartAt: bucket.startAt,
|
|
2783
|
+
dayKey,
|
|
2784
|
+
entry,
|
|
2785
|
+
evidencePartRole,
|
|
2786
|
+
firstSampleAt: sampleAt,
|
|
2787
|
+
lastRecordedAt: recordedAt,
|
|
2788
|
+
lastSampleAt: sampleAt,
|
|
2789
|
+
maxValue: value,
|
|
1146
2790
|
minValue: value,
|
|
1147
|
-
evidencePartRole,
|
|
1148
2791
|
resourceContext,
|
|
1149
2792
|
sampleCount: 1,
|
|
1150
2793
|
sum: value,
|
|
@@ -1155,109 +2798,52 @@ function buildJunctionDailyTimeseriesAggregates(input) {
|
|
|
1155
2798
|
}
|
|
1156
2799
|
existing.sampleCount += 1;
|
|
1157
2800
|
existing.sum += value;
|
|
1158
|
-
|
|
1159
|
-
|
|
2801
|
+
existing.bucketStartAt = earlierIsoTimestamp(existing.bucketStartAt, bucket.startAt);
|
|
2802
|
+
existing.bucketEndAt = laterIsoTimestamp(existing.bucketEndAt, bucket.endAt);
|
|
2803
|
+
if (value < existing.minValue) {
|
|
2804
|
+
existing.minValue = value;
|
|
2805
|
+
}
|
|
2806
|
+
if (value > existing.maxValue) {
|
|
2807
|
+
existing.maxValue = value;
|
|
1160
2808
|
}
|
|
1161
2809
|
if (sampleAt < existing.firstSampleAt) {
|
|
1162
2810
|
existing.firstSampleAt = sampleAt;
|
|
1163
2811
|
}
|
|
1164
2812
|
if (sampleAt >= existing.lastSampleAt) {
|
|
1165
|
-
existing.
|
|
2813
|
+
existing.dayKey = dayKey;
|
|
2814
|
+
existing.entry = entry;
|
|
1166
2815
|
existing.lastRecordedAt = recordedAt;
|
|
2816
|
+
existing.lastSampleAt = sampleAt;
|
|
1167
2817
|
existing.timestamp = timestamp;
|
|
2818
|
+
existing.timeZone = timeZone;
|
|
1168
2819
|
}
|
|
1169
|
-
if (value < existing.minValue) {
|
|
1170
|
-
existing.minValue = value;
|
|
1171
|
-
}
|
|
1172
|
-
if (value > existing.maxValue) {
|
|
1173
|
-
existing.maxValue = value;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
const sortedAggregates = [...aggregates.values()].sort(compareJunctionDailyTimeseriesAggregates);
|
|
1177
|
-
if (sortedAggregates.length === 0) {
|
|
1178
|
-
pushJunctionEmptyDailyTimeseriesAggregateArtifact(input.context, input.resource, input.resourceSlug);
|
|
1179
|
-
return sortedAggregates;
|
|
1180
|
-
}
|
|
1181
|
-
pushJunctionDailyTimeseriesAggregateArtifacts(input.context, input.resource, sortedAggregates);
|
|
1182
|
-
return sortedAggregates;
|
|
1183
|
-
}
|
|
1184
|
-
function pushJunctionEmptyDailyTimeseriesAggregateArtifact(context, resource, resourceSlug) {
|
|
1185
|
-
const role = `junction-timeseries-daily-${resourceSlug}:no-valid-samples`;
|
|
1186
|
-
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, {
|
|
1187
|
-
schema: "junction.timeseries_daily_aggregate.v1",
|
|
1188
|
-
provider: "junction",
|
|
1189
|
-
resource,
|
|
1190
|
-
sampleCount: 0,
|
|
1191
|
-
status: "no_valid_samples",
|
|
1192
|
-
})));
|
|
1193
|
-
}
|
|
1194
|
-
function pushJunctionDailyTimeseriesAggregateArtifacts(context, resource, aggregates) {
|
|
1195
|
-
for (const aggregate of aggregates) {
|
|
1196
|
-
// The role derives only from the aggregate's stable grouping identity
|
|
1197
|
-
// (resource role + day + source); a sorted-position index here would
|
|
1198
|
-
// churn artifact roles across replays and differently-windowed payloads.
|
|
1199
|
-
const role = `${aggregate.evidencePartRole}:${aggregate.dayKey}:${shortHash([
|
|
1200
|
-
aggregate.resourceContext.sourceProviderSlug,
|
|
1201
|
-
aggregate.resourceContext.origin.sourceType ?? "",
|
|
1202
|
-
aggregate.resourceContext.origin.sourceInstanceId ?? "",
|
|
1203
|
-
])}`;
|
|
1204
|
-
aggregate.evidencePartRole = role;
|
|
1205
|
-
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
1206
|
-
schema: "junction.timeseries_daily_aggregate.v1",
|
|
1207
|
-
provider: "junction",
|
|
1208
|
-
resource,
|
|
1209
|
-
dayKey: aggregate.dayKey,
|
|
1210
|
-
sourceProviderSlug: aggregate.resourceContext.sourceProviderSlug,
|
|
1211
|
-
sourceType: aggregate.resourceContext.origin.sourceType,
|
|
1212
|
-
sourceInstanceId: aggregate.resourceContext.origin.sourceInstanceId,
|
|
1213
|
-
sampleCount: aggregate.sampleCount,
|
|
1214
|
-
firstSampleAt: aggregate.firstSampleAt,
|
|
1215
|
-
lastSampleAt: aggregate.lastSampleAt,
|
|
1216
|
-
lastRecordedAt: aggregate.lastRecordedAt,
|
|
1217
|
-
legacyDayKeys: aggregate.legacyDayKeys.size > 0
|
|
1218
|
-
? [...aggregate.legacyDayKeys].sort()
|
|
1219
|
-
: undefined,
|
|
1220
|
-
meanValue: roundJunctionTimeseriesAggregateValue(resource, aggregate.sum / aggregate.sampleCount),
|
|
1221
|
-
minValue: roundJunctionTimeseriesAggregateValue(resource, aggregate.minValue),
|
|
1222
|
-
maxValue: roundJunctionTimeseriesAggregateValue(resource, aggregate.maxValue),
|
|
1223
|
-
unit: junctionDailyTimeseriesAggregateUnit(resource),
|
|
1224
|
-
}))));
|
|
1225
2820
|
}
|
|
2821
|
+
return [...aggregates.values()].sort(compareJunctionFeatureTimeseriesAggregates);
|
|
1226
2822
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
: value;
|
|
1231
|
-
}
|
|
1232
|
-
function junctionDailyTimeseriesAggregateUnit(resource) {
|
|
1233
|
-
return JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.get(resource)?.unit;
|
|
1234
|
-
}
|
|
1235
|
-
function withJunctionCompactTimeseriesMetadata(resource, artifact, resourceCategory = "timeseries_daily_aggregate") {
|
|
1236
|
-
if (!artifact) {
|
|
1237
|
-
return null;
|
|
1238
|
-
}
|
|
2823
|
+
function resolveJunctionFeatureTimeseriesBucket(sampleAt) {
|
|
2824
|
+
const hourStartMs = Math.floor(Date.parse(sampleAt) / 3_600_000) * 3_600_000;
|
|
2825
|
+
const startAt = new Date(hourStartMs).toISOString();
|
|
1239
2826
|
return {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
: "compact_provider_timeseries_aggregate",
|
|
1245
|
-
provider: "junction",
|
|
1246
|
-
resource,
|
|
1247
|
-
resourceCategory,
|
|
1248
|
-
retentionClass: "provider_evidence",
|
|
1249
|
-
},
|
|
2827
|
+
endAt: new Date(hourStartMs + 3_600_000).toISOString(),
|
|
2828
|
+
identity: startAt,
|
|
2829
|
+
kind: "hour",
|
|
2830
|
+
startAt,
|
|
1250
2831
|
};
|
|
1251
2832
|
}
|
|
1252
|
-
function
|
|
1253
|
-
const
|
|
2833
|
+
function pushJunctionFeatureTimeseriesObservation(context, aggregate, observation, unit) {
|
|
2834
|
+
const value = junctionFeatureTimeseriesStatisticValue(aggregate, observation.statistic);
|
|
2835
|
+
const resourceId = `${aggregate.resourceContext.resourceSlug}-${shortHash([
|
|
2836
|
+
aggregate.resourceContext.externalRefResourceType,
|
|
2837
|
+
aggregate.resourceContext.origin.sourceType ?? "",
|
|
2838
|
+
aggregate.resourceContext.origin.sourceInstanceId ?? "",
|
|
2839
|
+
aggregate.bucketKind,
|
|
2840
|
+
aggregate.bucketIdentity,
|
|
2841
|
+
])}`;
|
|
1254
2842
|
const timestamp = withTimestampOverride(aggregate.timestamp, {
|
|
1255
2843
|
occurredAt: aggregate.lastSampleAt,
|
|
1256
2844
|
recordedAt: aggregate.lastRecordedAt,
|
|
1257
2845
|
dayKey: aggregate.dayKey,
|
|
1258
|
-
observedAtRaw: `${aggregate.dayKey}:${aggregate.resourceContext.resource}:daily`,
|
|
1259
2846
|
});
|
|
1260
|
-
const legacyExternalRefs = legacyJunctionDailyTimeseriesAggregateExternalRefs(aggregate, observation.metric);
|
|
1261
2847
|
context.events.push(stripUndefined({
|
|
1262
2848
|
kind: "observation",
|
|
1263
2849
|
occurredAt: aggregate.lastSampleAt,
|
|
@@ -1265,38 +2851,324 @@ function pushJunctionDailyTimeseriesObservation(context, aggregate, observation)
|
|
|
1265
2851
|
dayKey: aggregate.dayKey,
|
|
1266
2852
|
timeZone: aggregate.timeZone,
|
|
1267
2853
|
source: "device",
|
|
1268
|
-
title:
|
|
2854
|
+
title: observation.title,
|
|
1269
2855
|
evidenceRoles: [aggregate.evidencePartRole],
|
|
1270
|
-
externalRef:
|
|
1271
|
-
legacyExternalRefs: legacyExternalRefs.length > 0 ? legacyExternalRefs : undefined,
|
|
2856
|
+
externalRef: makeProviderExternalRef("junction", aggregate.resourceContext.externalRefResourceType, resourceId, undefined, observation.metric),
|
|
1272
2857
|
dataOrigin: buildDataOrigin(aggregate.entry, aggregate.resourceContext, timestamp),
|
|
1273
2858
|
fields: {
|
|
1274
|
-
metric,
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
2859
|
+
metric: observation.metric,
|
|
2860
|
+
// Hour aggregates are compact derived features, not competing
|
|
2861
|
+
// representations of one provider day. Keeping them non-summary stops
|
|
2862
|
+
// daily and sleep selectors from promoting a single bucket as a day fact.
|
|
2863
|
+
observationGrain: "derived_fact",
|
|
2864
|
+
value: roundJunctionDailyAggregateValue(value),
|
|
2865
|
+
unit,
|
|
1278
2866
|
},
|
|
1279
2867
|
}));
|
|
1280
2868
|
}
|
|
1281
|
-
function
|
|
1282
|
-
|
|
1283
|
-
|
|
2869
|
+
function pushJunctionSparseIntervalReadings(payload, resource, resourceSlug, context, descriptor) {
|
|
2870
|
+
const policy = getJunctionSparseIntervalPolicy(resource);
|
|
2871
|
+
const entries = timeseriesResourceEntries(payload);
|
|
2872
|
+
assertJunctionTimeseriesResponseBound(resource, entries.length);
|
|
2873
|
+
const readingsByIdentity = new Map();
|
|
2874
|
+
for (const [index, { entry, originFallback }] of entries.entries()) {
|
|
2875
|
+
const resourceContext = buildResourceContext({
|
|
2876
|
+
entry,
|
|
2877
|
+
originFallback,
|
|
2878
|
+
resource,
|
|
2879
|
+
resourceSlug,
|
|
2880
|
+
identityKind: "timeseries",
|
|
2881
|
+
index,
|
|
2882
|
+
fallbackArtifactRole: `junction-timeseries-reading-${resourceSlug}`,
|
|
2883
|
+
context,
|
|
2884
|
+
});
|
|
2885
|
+
if (!resourceContext)
|
|
2886
|
+
continue;
|
|
2887
|
+
const providerValue = finiteNumber(firstValueFromPaths(entry, descriptor.valuePaths));
|
|
2888
|
+
const value = descriptor.normalizeValue(providerValue, entry);
|
|
2889
|
+
const startRaw = firstStringFromPaths(entry, JUNCTION_INTERVAL_START_TIMESTAMP_PATHS);
|
|
2890
|
+
const endRaw = firstStringFromPaths(entry, JUNCTION_INTERVAL_END_TIMESTAMP_PATHS);
|
|
2891
|
+
const startAt = resolveSafeTimestamp(startRaw);
|
|
2892
|
+
const endAt = resolveSafeTimestamp(endRaw);
|
|
2893
|
+
if (providerValue === undefined
|
|
2894
|
+
|| value === undefined
|
|
2895
|
+
|| !startRaw
|
|
2896
|
+
|| !endRaw
|
|
2897
|
+
|| !startAt
|
|
2898
|
+
|| !endAt
|
|
2899
|
+
|| Date.parse(endAt) < Date.parse(startAt)) {
|
|
2900
|
+
continue;
|
|
2901
|
+
}
|
|
2902
|
+
const timestamp = resolveJunctionSparseIntervalTimestamp(entry, startRaw, context, resourceContext.sourceProviderSlug);
|
|
2903
|
+
const dayKey = resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, startAt, context.defaultTimeZone);
|
|
2904
|
+
if (!dayKey)
|
|
2905
|
+
continue;
|
|
2906
|
+
const providerUnit = trimOptionalToLength(firstStringFromPaths(entry, JUNCTION_INTERVAL_UNIT_PATHS), 160);
|
|
2907
|
+
const explicitId = firstStringFromPaths(entry, JUNCTION_TIMESERIES_RECORD_ID_PATHS);
|
|
2908
|
+
const externalIdentityHash = shortHash(explicitId
|
|
2909
|
+
? [
|
|
2910
|
+
policy.identityVersion,
|
|
2911
|
+
resourceSlug,
|
|
2912
|
+
resourceContext.sourceProviderSlug,
|
|
2913
|
+
resourceContext.origin.sourceType ?? "",
|
|
2914
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
2915
|
+
explicitId,
|
|
2916
|
+
]
|
|
2917
|
+
: [
|
|
2918
|
+
policy.identityVersion,
|
|
2919
|
+
resourceSlug,
|
|
2920
|
+
resourceContext.sourceProviderSlug,
|
|
2921
|
+
resourceContext.origin.sourceType ?? "",
|
|
2922
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
2923
|
+
startAt,
|
|
2924
|
+
endAt,
|
|
2925
|
+
providerValue,
|
|
2926
|
+
providerUnit ?? "",
|
|
2927
|
+
]);
|
|
2928
|
+
const fidelityRecordKey = buildJunctionTimeseriesFidelityRecordKey({
|
|
2929
|
+
entry,
|
|
2930
|
+
providerUnit,
|
|
2931
|
+
providerValue,
|
|
2932
|
+
resource,
|
|
2933
|
+
resourceContext,
|
|
2934
|
+
timestamp,
|
|
2935
|
+
});
|
|
2936
|
+
const durationSeconds = Number(((Date.parse(endAt) - Date.parse(startAt)) / 1000).toFixed(3));
|
|
2937
|
+
const candidate = {
|
|
2938
|
+
contentFingerprint: fidelityRecordKey,
|
|
2939
|
+
dayKey,
|
|
2940
|
+
durationSeconds,
|
|
2941
|
+
endAt,
|
|
2942
|
+
entry,
|
|
2943
|
+
fidelityRecordKey,
|
|
2944
|
+
externalIdentityHash,
|
|
2945
|
+
providerUnit,
|
|
2946
|
+
providerValue,
|
|
2947
|
+
recordedAt: timestamp.recordedAt,
|
|
2948
|
+
resourceContext,
|
|
2949
|
+
startAt,
|
|
2950
|
+
sourceVersion: explicitId
|
|
2951
|
+
? resolveJunctionExplicitSourceVersion(entry, resourceContext.sourceProviderSlug)
|
|
2952
|
+
: undefined,
|
|
2953
|
+
stableIdentity: explicitId !== undefined,
|
|
2954
|
+
timestamp,
|
|
2955
|
+
timeZone: firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"]),
|
|
2956
|
+
value,
|
|
2957
|
+
};
|
|
2958
|
+
const existing = readingsByIdentity.get(externalIdentityHash);
|
|
2959
|
+
readingsByIdentity.set(externalIdentityHash, existing && explicitId
|
|
2960
|
+
? selectJunctionAuthoritativeRevision(resource, existing, candidate)
|
|
2961
|
+
: existing ?? candidate);
|
|
2962
|
+
}
|
|
2963
|
+
const readings = [...readingsByIdentity.values()].sort(compareJunctionSparseIntervalReadingOrder);
|
|
2964
|
+
const sourceDayCounts = new Map();
|
|
2965
|
+
for (const reading of readings) {
|
|
2966
|
+
const sourceDayKey = [
|
|
2967
|
+
reading.resourceContext.externalRefResourceType,
|
|
2968
|
+
reading.resourceContext.origin.sourceType ?? "",
|
|
2969
|
+
reading.resourceContext.origin.sourceInstanceId ?? "",
|
|
2970
|
+
reading.dayKey,
|
|
2971
|
+
].join("\u0000");
|
|
2972
|
+
const sourceDayCount = (sourceDayCounts.get(sourceDayKey) ?? 0) + 1;
|
|
2973
|
+
assertJunctionTimeseriesSourceDayBound(resource, sourceDayCount);
|
|
2974
|
+
sourceDayCounts.set(sourceDayKey, sourceDayCount);
|
|
2975
|
+
pushJunctionSparseIntervalReading(context, resource, resourceSlug, reading);
|
|
2976
|
+
}
|
|
2977
|
+
return new Map(readings.map((reading) => [reading.fidelityRecordKey, reading]));
|
|
2978
|
+
}
|
|
2979
|
+
function resolveJunctionSparseIntervalTimestamp(entry, startRaw, context, sourceProviderSlug) {
|
|
2980
|
+
const startAt = resolveSafeTimestamp(startRaw);
|
|
2981
|
+
const timestamp = resolveRecordTimestamp({ ...entry, observedAtRaw: startRaw }, context, sourceProviderSlug);
|
|
2982
|
+
return startAt
|
|
2983
|
+
? withTimestampOverride(timestamp, {
|
|
2984
|
+
occurredAt: startAt,
|
|
2985
|
+
recordedAt: timestamp.recordedAt ?? startAt,
|
|
2986
|
+
observedAtRaw: startRaw,
|
|
2987
|
+
timestampSemantics: inferTimestampSemantics(startRaw),
|
|
2988
|
+
})
|
|
2989
|
+
: timestamp;
|
|
2990
|
+
}
|
|
2991
|
+
function compareJunctionSparseIntervalReadingOrder(left, right) {
|
|
2992
|
+
return left.startAt.localeCompare(right.startAt)
|
|
2993
|
+
|| left.endAt.localeCompare(right.endAt)
|
|
2994
|
+
|| left.resourceContext.sourceProviderSlug.localeCompare(right.resourceContext.sourceProviderSlug)
|
|
2995
|
+
|| left.externalIdentityHash.localeCompare(right.externalIdentityHash);
|
|
2996
|
+
}
|
|
2997
|
+
function pushJunctionSparseIntervalReading(context, resource, resourceSlug, reading) {
|
|
2998
|
+
const policy = getJunctionSparseIntervalPolicy(resource);
|
|
2999
|
+
const role = `junction-timeseries-reading-${resourceSlug}:${reading.dayKey}:${reading.externalIdentityHash}`;
|
|
3000
|
+
const externalRefUpdatePolicy = reading.sourceVersion ? undefined : "immutable";
|
|
3001
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
3002
|
+
schema: "junction.interval_reading.v1",
|
|
3003
|
+
policyVersion: policy.policyVersion,
|
|
3004
|
+
provider: "junction",
|
|
3005
|
+
resource,
|
|
3006
|
+
dayKey: reading.dayKey,
|
|
3007
|
+
sourceProviderSlug: reading.resourceContext.sourceProviderSlug,
|
|
3008
|
+
sourceType: reading.resourceContext.origin.sourceType,
|
|
3009
|
+
sourceInstanceId: reading.resourceContext.origin.sourceInstanceId,
|
|
3010
|
+
startAt: reading.startAt,
|
|
3011
|
+
endAt: reading.endAt,
|
|
3012
|
+
durationSeconds: reading.durationSeconds,
|
|
3013
|
+
providerValue: reading.providerValue,
|
|
3014
|
+
providerUnit: reading.providerUnit,
|
|
3015
|
+
value: reading.value,
|
|
3016
|
+
unit: policy.unit,
|
|
3017
|
+
recordedAt: reading.recordedAt,
|
|
3018
|
+
})), "timeseries_reading"));
|
|
3019
|
+
context.events.push(stripUndefined({
|
|
3020
|
+
kind: "measurement",
|
|
3021
|
+
occurredAt: reading.startAt,
|
|
3022
|
+
recordedAt: reading.recordedAt,
|
|
3023
|
+
dayKey: reading.dayKey,
|
|
3024
|
+
timeZone: reading.timeZone,
|
|
3025
|
+
source: "device",
|
|
3026
|
+
title: policy.title,
|
|
3027
|
+
evidenceRoles: [role],
|
|
3028
|
+
externalRef: makeProviderExternalRef("junction", reading.resourceContext.externalRefResourceType, `${resourceSlug}-${reading.externalIdentityHash}`, reading.sourceVersion, "interval"),
|
|
3029
|
+
externalRefUpdatePolicy,
|
|
3030
|
+
dataOrigin: buildDataOrigin(reading.entry, reading.resourceContext, reading.timestamp, { normalizerVersion: policy.policyVersion }),
|
|
3031
|
+
fields: {
|
|
3032
|
+
measurements: [{
|
|
3033
|
+
metric: policy.metric,
|
|
3034
|
+
value: reading.value,
|
|
3035
|
+
unit: policy.unit,
|
|
3036
|
+
qualifiers: stripUndefined({
|
|
3037
|
+
"interval-start-at": reading.startAt,
|
|
3038
|
+
"interval-end-at": reading.endAt,
|
|
3039
|
+
"interval-duration-seconds": reading.durationSeconds,
|
|
3040
|
+
"provider-unit": reading.providerUnit,
|
|
3041
|
+
}),
|
|
3042
|
+
}],
|
|
3043
|
+
},
|
|
3044
|
+
}));
|
|
3045
|
+
}
|
|
3046
|
+
function junctionFeatureTimeseriesStatisticValue(aggregate, statistic) {
|
|
3047
|
+
switch (statistic) {
|
|
3048
|
+
case "min":
|
|
3049
|
+
return aggregate.minValue;
|
|
3050
|
+
case "max":
|
|
3051
|
+
return aggregate.maxValue;
|
|
3052
|
+
case "sum":
|
|
3053
|
+
return aggregate.sum;
|
|
3054
|
+
case "mean":
|
|
3055
|
+
return aggregate.sum / aggregate.sampleCount;
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
function compareJunctionFeatureTimeseriesAggregates(left, right) {
|
|
3059
|
+
return left.bucketStartAt.localeCompare(right.bucketStartAt)
|
|
3060
|
+
|| left.resourceContext.sourceProviderSlug.localeCompare(right.resourceContext.sourceProviderSlug)
|
|
3061
|
+
|| (left.resourceContext.origin.sourceType ?? "").localeCompare(right.resourceContext.origin.sourceType ?? "")
|
|
3062
|
+
|| (left.resourceContext.origin.sourceInstanceId ?? "").localeCompare(right.resourceContext.origin.sourceInstanceId ?? "")
|
|
3063
|
+
|| left.bucketKind.localeCompare(right.bucketKind)
|
|
3064
|
+
|| left.bucketIdentity.localeCompare(right.bucketIdentity);
|
|
3065
|
+
}
|
|
3066
|
+
// Sparse paired blood-pressure readings land as-is: one canonical
|
|
3067
|
+
// `measurement` event (systolic + diastolic mmHg entries, so both flow into
|
|
3068
|
+
// the existing blood-pressure catalog metrics) plus one compact per-reading
|
|
3069
|
+
// evidence part (~350 B; readings arrive 10s-100s per member-year).
|
|
3070
|
+
function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, context) {
|
|
3071
|
+
const baseArtifactRole = `junction-timeseries-reading-${resourceSlug}`;
|
|
3072
|
+
let readingCount = 0;
|
|
3073
|
+
const seenReadingIdentityHashes = new Set();
|
|
3074
|
+
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(payload).entries()) {
|
|
3075
|
+
const resourceContext = buildResourceContext({
|
|
3076
|
+
entry,
|
|
3077
|
+
originFallback,
|
|
3078
|
+
resource,
|
|
3079
|
+
resourceSlug,
|
|
3080
|
+
identityKind: "timeseries",
|
|
3081
|
+
index,
|
|
3082
|
+
fallbackArtifactRole: baseArtifactRole,
|
|
3083
|
+
context,
|
|
3084
|
+
});
|
|
3085
|
+
if (!resourceContext) {
|
|
3086
|
+
continue;
|
|
3087
|
+
}
|
|
3088
|
+
const systolic = normalizeSystolicMmHg(firstNumberFromPaths(entry, JUNCTION_BLOOD_PRESSURE_SYSTOLIC_PATHS));
|
|
3089
|
+
const diastolic = normalizeDiastolicMmHg(firstNumberFromPaths(entry, JUNCTION_BLOOD_PRESSURE_DIASTOLIC_PATHS));
|
|
3090
|
+
const timestamp = resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug);
|
|
3091
|
+
const occurredAt = timestamp.occurredAt ?? timestamp.recordedAt;
|
|
3092
|
+
const dayKey = resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, occurredAt, context.defaultTimeZone);
|
|
3093
|
+
if (systolic === undefined || diastolic === undefined || systolic <= diastolic || !occurredAt || !dayKey) {
|
|
3094
|
+
continue;
|
|
3095
|
+
}
|
|
3096
|
+
// A stable provider row id is the primary reading identity (mirroring
|
|
3097
|
+
// the fetch-side dedupe key): two distinct readings with the same
|
|
3098
|
+
// timestamp AND the same values must not collapse when the provider
|
|
3099
|
+
// distinguishes them. Without an id, the identity includes the paired
|
|
3100
|
+
// values so same-second readings from coarse-timestamp providers never
|
|
3101
|
+
// collapse, while true duplicate deliveries still merge via externalRef.
|
|
3102
|
+
const readingIdentityHash = buildJunctionBloodPressureReadingIdentityHash({
|
|
3103
|
+
diastolic,
|
|
3104
|
+
entry,
|
|
3105
|
+
occurredAt,
|
|
3106
|
+
resourceContext,
|
|
3107
|
+
resourceSlug,
|
|
3108
|
+
systolic,
|
|
3109
|
+
timestamp,
|
|
3110
|
+
});
|
|
3111
|
+
// Exact in-payload duplicates are skipped and the raw role is derived
|
|
3112
|
+
// from the same stable identity as the event externalRef (never the
|
|
3113
|
+
// payload index), so replays and reorderings stage identical evidence
|
|
3114
|
+
// instead of minting new artifacts for an event core already dedupes.
|
|
3115
|
+
if (seenReadingIdentityHashes.has(readingIdentityHash)) {
|
|
3116
|
+
continue;
|
|
3117
|
+
}
|
|
3118
|
+
seenReadingIdentityHashes.add(readingIdentityHash);
|
|
3119
|
+
readingCount += 1;
|
|
3120
|
+
const role = `${baseArtifactRole}:${dayKey}:${readingIdentityHash}`;
|
|
3121
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
3122
|
+
schema: "junction.blood_pressure_reading.v1",
|
|
3123
|
+
provider: "junction",
|
|
3124
|
+
resource,
|
|
3125
|
+
dayKey,
|
|
3126
|
+
sourceProviderSlug: resourceContext.sourceProviderSlug,
|
|
3127
|
+
sourceType: resourceContext.origin.sourceType,
|
|
3128
|
+
sourceInstanceId: resourceContext.origin.sourceInstanceId,
|
|
3129
|
+
occurredAt,
|
|
3130
|
+
recordedAt: timestamp.recordedAt,
|
|
3131
|
+
systolic,
|
|
3132
|
+
diastolic,
|
|
3133
|
+
unit: "mmHg",
|
|
3134
|
+
})), "timeseries_reading"));
|
|
3135
|
+
context.events.push(stripUndefined({
|
|
3136
|
+
kind: "measurement",
|
|
3137
|
+
occurredAt,
|
|
3138
|
+
recordedAt: timestamp.recordedAt,
|
|
3139
|
+
dayKey,
|
|
3140
|
+
timeZone: firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"]),
|
|
3141
|
+
source: "device",
|
|
3142
|
+
title: "Junction blood pressure",
|
|
3143
|
+
evidenceRoles: [role],
|
|
3144
|
+
externalRef: makeProviderExternalRef("junction", resourceContext.externalRefResourceType, `${resourceSlug}-${readingIdentityHash}`, undefined, "blood-pressure"),
|
|
3145
|
+
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
3146
|
+
fields: {
|
|
3147
|
+
measurements: [
|
|
3148
|
+
{ metric: "systolic-blood-pressure", value: systolic, unit: "mmHg" },
|
|
3149
|
+
{ metric: "diastolic-blood-pressure", value: diastolic, unit: "mmHg" },
|
|
3150
|
+
],
|
|
3151
|
+
},
|
|
3152
|
+
}));
|
|
3153
|
+
}
|
|
3154
|
+
if (readingCount === 0) {
|
|
3155
|
+
const role = `${baseArtifactRole}:no-valid-samples`;
|
|
3156
|
+
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, {
|
|
3157
|
+
schema: "junction.blood_pressure_reading.v1",
|
|
3158
|
+
provider: "junction",
|
|
3159
|
+
resource,
|
|
3160
|
+
readingCount: 0,
|
|
3161
|
+
status: "no_valid_samples",
|
|
3162
|
+
}), "timeseries_reading"));
|
|
1284
3163
|
}
|
|
1285
|
-
return [...aggregate.legacyDayKeys].sort().map((legacyDayKey) => makeJunctionExternalRef(aggregate.resourceContext, aggregate.entry, withTimestampOverride(aggregate.timestamp, {
|
|
1286
|
-
occurredAt: aggregate.lastSampleAt,
|
|
1287
|
-
recordedAt: aggregate.lastRecordedAt,
|
|
1288
|
-
dayKey: legacyDayKey,
|
|
1289
|
-
observedAtRaw: `${legacyDayKey}:${aggregate.resourceContext.resource}:daily`,
|
|
1290
|
-
}), metric));
|
|
1291
3164
|
}
|
|
1292
|
-
// Sparse
|
|
1293
|
-
//
|
|
1294
|
-
//
|
|
1295
|
-
|
|
1296
|
-
function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, context) {
|
|
3165
|
+
// Sparse weight readings use the same canonical measurement path as
|
|
3166
|
+
// other queryable body measurements. Each accepted reading retains only one
|
|
3167
|
+
// compact evidence record and a replay-stable external reference.
|
|
3168
|
+
function pushJunctionWeightReadings(payload, resource, resourceSlug, context) {
|
|
1297
3169
|
const baseArtifactRole = `junction-timeseries-reading-${resourceSlug}`;
|
|
1298
|
-
let readingCount = 0;
|
|
1299
3170
|
const seenReadingIdentityHashes = new Set();
|
|
3171
|
+
let readingCount = 0;
|
|
1300
3172
|
for (const [index, { entry, originFallback }] of timeseriesResourceEntries(payload).entries()) {
|
|
1301
3173
|
const resourceContext = buildResourceContext({
|
|
1302
3174
|
entry,
|
|
@@ -1311,34 +3183,33 @@ function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, cont
|
|
|
1311
3183
|
if (!resourceContext) {
|
|
1312
3184
|
continue;
|
|
1313
3185
|
}
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1316
|
-
const
|
|
1317
|
-
|
|
3186
|
+
const { providerReadingId, weightKilograms } = resolveJunctionWeightProviderRecordIdentity(entry);
|
|
3187
|
+
const rawOccurredAt = firstValueFromPaths(entry, JUNCTION_RECORD_TIMESTAMP_PATHS);
|
|
3188
|
+
const occurredAt = resolveSafeTimestamp(rawOccurredAt, resourceContext.sourceProviderSlug);
|
|
3189
|
+
if (weightKilograms === undefined || !occurredAt) {
|
|
3190
|
+
continue;
|
|
3191
|
+
}
|
|
3192
|
+
const timestamp = withTimestampOverride(resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug), { occurredAt });
|
|
1318
3193
|
const dayKey = resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, occurredAt, context.defaultTimeZone);
|
|
1319
|
-
if (
|
|
3194
|
+
if (!dayKey) {
|
|
1320
3195
|
continue;
|
|
1321
3196
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
// Exact in-payload duplicates are skipped and the raw role is derived
|
|
1339
|
-
// from the same stable identity as the event externalRef (never the
|
|
1340
|
-
// payload index), so replays and reorderings stage identical evidence
|
|
1341
|
-
// instead of minting new artifacts for an event core already dedupes.
|
|
3197
|
+
const readingIdentityHash = providerReadingId
|
|
3198
|
+
? shortHash([
|
|
3199
|
+
resourceSlug,
|
|
3200
|
+
resourceContext.sourceProviderSlug,
|
|
3201
|
+
resourceContext.origin.sourceType ?? "",
|
|
3202
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
3203
|
+
providerReadingId,
|
|
3204
|
+
])
|
|
3205
|
+
: shortHash([
|
|
3206
|
+
resourceSlug,
|
|
3207
|
+
resourceContext.sourceProviderSlug,
|
|
3208
|
+
resourceContext.origin.sourceType ?? "",
|
|
3209
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
3210
|
+
timestamp.observedAtRaw ?? occurredAt,
|
|
3211
|
+
weightKilograms,
|
|
3212
|
+
]);
|
|
1342
3213
|
if (seenReadingIdentityHashes.has(readingIdentityHash)) {
|
|
1343
3214
|
continue;
|
|
1344
3215
|
}
|
|
@@ -1346,18 +3217,18 @@ function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, cont
|
|
|
1346
3217
|
readingCount += 1;
|
|
1347
3218
|
const role = `${baseArtifactRole}:${dayKey}:${readingIdentityHash}`;
|
|
1348
3219
|
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, stripUndefined({
|
|
1349
|
-
schema: "junction.
|
|
3220
|
+
schema: "junction.weight_reading.v1",
|
|
1350
3221
|
provider: "junction",
|
|
1351
3222
|
resource,
|
|
1352
3223
|
dayKey,
|
|
1353
3224
|
sourceProviderSlug: resourceContext.sourceProviderSlug,
|
|
1354
3225
|
sourceType: resourceContext.origin.sourceType,
|
|
1355
3226
|
sourceInstanceId: resourceContext.origin.sourceInstanceId,
|
|
3227
|
+
providerReadingId,
|
|
1356
3228
|
occurredAt,
|
|
1357
3229
|
recordedAt: timestamp.recordedAt,
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
unit: "mmHg",
|
|
3230
|
+
weightKilograms,
|
|
3231
|
+
unit: "kg",
|
|
1361
3232
|
})), "timeseries_reading"));
|
|
1362
3233
|
context.events.push(stripUndefined({
|
|
1363
3234
|
kind: "measurement",
|
|
@@ -1366,14 +3237,13 @@ function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, cont
|
|
|
1366
3237
|
dayKey,
|
|
1367
3238
|
timeZone: firstStringFromPaths(entry, ["timeZone", "timezone", "time_zone"]),
|
|
1368
3239
|
source: "device",
|
|
1369
|
-
title: "Junction
|
|
3240
|
+
title: "Junction body weight",
|
|
1370
3241
|
evidenceRoles: [role],
|
|
1371
|
-
externalRef: makeProviderExternalRef("junction", resourceContext.externalRefResourceType, `${resourceSlug}-${readingIdentityHash}`, undefined, "
|
|
3242
|
+
externalRef: makeProviderExternalRef("junction", resourceContext.externalRefResourceType, `${resourceSlug}-${readingIdentityHash}`, undefined, "weight"),
|
|
1372
3243
|
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
1373
3244
|
fields: {
|
|
1374
3245
|
measurements: [
|
|
1375
|
-
{ metric: "
|
|
1376
|
-
{ metric: "diastolic-blood-pressure", value: diastolic, unit: "mmHg" },
|
|
3246
|
+
{ metric: "weight", value: weightKilograms, unit: "kg" },
|
|
1377
3247
|
],
|
|
1378
3248
|
},
|
|
1379
3249
|
}));
|
|
@@ -1381,7 +3251,7 @@ function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, cont
|
|
|
1381
3251
|
if (readingCount === 0) {
|
|
1382
3252
|
const role = `${baseArtifactRole}:no-valid-samples`;
|
|
1383
3253
|
pushEvidencePart(context.evidenceParts, withJunctionCompactTimeseriesMetadata(resource, createEvidencePart(role, `${role}.json`, {
|
|
1384
|
-
schema: "junction.
|
|
3254
|
+
schema: "junction.weight_reading.v1",
|
|
1385
3255
|
provider: "junction",
|
|
1386
3256
|
resource,
|
|
1387
3257
|
readingCount: 0,
|
|
@@ -1389,7 +3259,67 @@ function pushJunctionBloodPressureReadings(payload, resource, resourceSlug, cont
|
|
|
1389
3259
|
}), "timeseries_reading"));
|
|
1390
3260
|
}
|
|
1391
3261
|
}
|
|
3262
|
+
function buildJunctionBloodPressureRepairStableExternalRefResourceId(entry, resourceContext) {
|
|
3263
|
+
const readingRowId = firstStringFromPaths(entry, ["id", "resourceId", "resource_id", "externalId", "external_id"]);
|
|
3264
|
+
if (!readingRowId) {
|
|
3265
|
+
return null;
|
|
3266
|
+
}
|
|
3267
|
+
return `${resourceContext.resourceSlug}-${shortHash([
|
|
3268
|
+
resourceContext.resourceSlug,
|
|
3269
|
+
resourceContext.sourceProviderSlug,
|
|
3270
|
+
resourceContext.origin.sourceType ?? "",
|
|
3271
|
+
resourceContext.origin.sourceInstanceId ?? "",
|
|
3272
|
+
readingRowId,
|
|
3273
|
+
])}`;
|
|
3274
|
+
}
|
|
3275
|
+
function buildJunctionBloodPressureReadingIdentityHash(input) {
|
|
3276
|
+
const repairStableResourceId = buildJunctionBloodPressureRepairStableExternalRefResourceId(input.entry, input.resourceContext);
|
|
3277
|
+
if (repairStableResourceId) {
|
|
3278
|
+
return repairStableResourceId.slice(`${input.resourceSlug}-`.length);
|
|
3279
|
+
}
|
|
3280
|
+
return shortHash([
|
|
3281
|
+
input.resourceSlug,
|
|
3282
|
+
input.resourceContext.sourceProviderSlug,
|
|
3283
|
+
input.resourceContext.origin.sourceType ?? "",
|
|
3284
|
+
input.resourceContext.origin.sourceInstanceId ?? "",
|
|
3285
|
+
input.timestamp.observedAtRaw ?? input.occurredAt,
|
|
3286
|
+
input.systolic,
|
|
3287
|
+
input.diastolic,
|
|
3288
|
+
]);
|
|
3289
|
+
}
|
|
1392
3290
|
function buildRawResourcePayload(resource, payload, connectionsByKey) {
|
|
3291
|
+
if (resource === JUNCTION_NOTE_RESOURCE) {
|
|
3292
|
+
return sanitizeJunctionNoteRawValue(sanitizeJunctionRawPayload(payload));
|
|
3293
|
+
}
|
|
3294
|
+
const policy = resolveJunctionTimeseriesResourcePolicy(resource);
|
|
3295
|
+
if (resource === "electrocardiogram_voltage" || resource === "workout_stream") {
|
|
3296
|
+
return normalizeJunctionBoundedTimeseriesFeatures(resource, payload);
|
|
3297
|
+
}
|
|
3298
|
+
const sparseDescriptor = JUNCTION_SPARSE_TIMESERIES_DESCRIPTORS.get(resource);
|
|
3299
|
+
if (policy
|
|
3300
|
+
&& (policy.normalizationMode === "sparse_alert"
|
|
3301
|
+
|| policy.normalizationMode === "sparse_intervention"
|
|
3302
|
+
|| policy.normalizationMode === "sparse_observation")) {
|
|
3303
|
+
return sparseDescriptor
|
|
3304
|
+
? sanitizeJunctionSparseTimeseriesRawPayload(resource, payload, sparseDescriptor)
|
|
3305
|
+
: undefined;
|
|
3306
|
+
}
|
|
3307
|
+
if (policy?.normalizationMode === "daily_aggregate"
|
|
3308
|
+
&& !JUNCTION_DAILY_TIMESERIES_DESCRIPTORS.has(resource)) {
|
|
3309
|
+
return undefined;
|
|
3310
|
+
}
|
|
3311
|
+
if (policy?.normalizationMode === "hourly_or_session_feature"
|
|
3312
|
+
&& !JUNCTION_FEATURE_TIMESERIES_DESCRIPTORS.has(resource)) {
|
|
3313
|
+
return undefined;
|
|
3314
|
+
}
|
|
3315
|
+
if (policy?.normalizationMode === "sparse_reading"
|
|
3316
|
+
&& resource !== JUNCTION_BLOOD_PRESSURE_RESOURCE
|
|
3317
|
+
&& resource !== JUNCTION_WEIGHT_RESOURCE) {
|
|
3318
|
+
return undefined;
|
|
3319
|
+
}
|
|
3320
|
+
if (policy?.normalizationMode === "note_tags" && resource !== JUNCTION_NOTE_RESOURCE) {
|
|
3321
|
+
return undefined;
|
|
3322
|
+
}
|
|
1393
3323
|
if (resource !== "profile") {
|
|
1394
3324
|
return sanitizeJunctionRawPayload(payload);
|
|
1395
3325
|
}
|
|
@@ -1403,11 +3333,65 @@ function buildRawResourcePayload(resource, payload, connectionsByKey) {
|
|
|
1403
3333
|
const profile = asPlainObject(payload);
|
|
1404
3334
|
return sanitizeProfilePayload(payload, profile && connectionsByKey ? resolveEntryConnection(profile, connectionsByKey) : undefined);
|
|
1405
3335
|
}
|
|
3336
|
+
function sanitizeJunctionSparseTimeseriesRawPayload(resource, payload, descriptor) {
|
|
3337
|
+
const recordDigests = new Set();
|
|
3338
|
+
for (const { entry, originFallback } of timeseriesResourceEntries(payload)) {
|
|
3339
|
+
const record = parseJunctionSparseTimeseriesRecord(entry, resource, descriptor);
|
|
3340
|
+
if (!record) {
|
|
3341
|
+
continue;
|
|
3342
|
+
}
|
|
3343
|
+
const origin = resolveJunctionOrigin(entry, originFallback);
|
|
3344
|
+
const sourceProviderSlug = readJunctionSourceProviderSlug(entry, originFallback)
|
|
3345
|
+
?? origin.sourceProviderSlug;
|
|
3346
|
+
if (!sourceProviderSlug) {
|
|
3347
|
+
continue;
|
|
3348
|
+
}
|
|
3349
|
+
recordDigests.add(shortHash([
|
|
3350
|
+
resource,
|
|
3351
|
+
sourceProviderSlug,
|
|
3352
|
+
origin.sourceType ?? "",
|
|
3353
|
+
origin.sourceInstanceId ?? "",
|
|
3354
|
+
record.providerRowId ?? "",
|
|
3355
|
+
record.observedAtRaw,
|
|
3356
|
+
record.startAt ?? "",
|
|
3357
|
+
record.endAt ?? "",
|
|
3358
|
+
record.value,
|
|
3359
|
+
record.unit,
|
|
3360
|
+
record.upstreamUnit,
|
|
3361
|
+
record.alertType ?? "",
|
|
3362
|
+
record.bolusPurpose ?? "",
|
|
3363
|
+
record.deliveryForm ?? "",
|
|
3364
|
+
record.deliveryMode ?? "",
|
|
3365
|
+
record.insulinType ?? "",
|
|
3366
|
+
]));
|
|
3367
|
+
}
|
|
3368
|
+
const digests = [...recordDigests].sort();
|
|
3369
|
+
return digests.length > 0
|
|
3370
|
+
? {
|
|
3371
|
+
schema: "junction.sparse_timeseries_digest.v1",
|
|
3372
|
+
resource,
|
|
3373
|
+
recordCount: digests.length,
|
|
3374
|
+
recordsDigest: shortHash([resource, ...digests]),
|
|
3375
|
+
}
|
|
3376
|
+
: undefined;
|
|
3377
|
+
}
|
|
3378
|
+
function sanitizeJunctionNoteRawValue(value) {
|
|
3379
|
+
if (Array.isArray(value)) {
|
|
3380
|
+
return value.map(sanitizeJunctionNoteRawValue);
|
|
3381
|
+
}
|
|
3382
|
+
if (!isPlainRecord(value)) {
|
|
3383
|
+
return value;
|
|
3384
|
+
}
|
|
3385
|
+
return Object.fromEntries(Object.entries(value)
|
|
3386
|
+
.filter(([key]) => normalizeJunctionRawIdentityKey(key) !== "value")
|
|
3387
|
+
.map(([key, entry]) => [key, sanitizeJunctionNoteRawValue(entry)]));
|
|
3388
|
+
}
|
|
1406
3389
|
function sanitizeJunctionRawSnapshot(snapshot) {
|
|
1407
3390
|
const sanitized = asPlainObject(sanitizeJunctionRawPayload(snapshot));
|
|
1408
3391
|
if (!sanitized) {
|
|
1409
3392
|
return sanitized;
|
|
1410
3393
|
}
|
|
3394
|
+
const sanitizedSnapshot = Object.fromEntries(Object.entries(sanitized).filter(([key]) => key !== "strictSparseCalendarRepair"));
|
|
1411
3395
|
const connections = asArray(snapshot.connections).flatMap((connection) => {
|
|
1412
3396
|
const normalized = asPlainObject(connection);
|
|
1413
3397
|
return normalized ? [normalized] : [];
|
|
@@ -1419,7 +3403,7 @@ function sanitizeJunctionRawSnapshot(snapshot) {
|
|
|
1419
3403
|
return {};
|
|
1420
3404
|
}
|
|
1421
3405
|
return stripUndefined({
|
|
1422
|
-
...
|
|
3406
|
+
...sanitizedSnapshot,
|
|
1423
3407
|
connections: sanitizeJunctionRawConnections(snapshot.connections),
|
|
1424
3408
|
summaries,
|
|
1425
3409
|
timeseries,
|
|
@@ -1484,9 +3468,17 @@ function sanitizeProfilePayload(payload, connection) {
|
|
|
1484
3468
|
return undefined;
|
|
1485
3469
|
}
|
|
1486
3470
|
const origin = resolveJunctionOrigin(profile, connection);
|
|
3471
|
+
const gender = firstStringFromPaths(profile, JUNCTION_PROFILE_GENDER_PATHS);
|
|
3472
|
+
const sourceProviderSlug = readJunctionSourceProviderSlug(profile, connection)
|
|
3473
|
+
?? origin.sourceProviderSlug;
|
|
3474
|
+
const updatedAt = resolveSafeTimestamp(firstValueFromPaths(profile, ["updatedAt", "updated_at", "createdAt", "created_at"]), origin.sourceProviderSlug);
|
|
1487
3475
|
const sanitized = stripUndefined({
|
|
1488
|
-
|
|
3476
|
+
gender: gender ? trimToLength(gender, 80) : undefined,
|
|
3477
|
+
stableResourceId: buildStableProfileResourceId(profile, sourceProviderSlug, origin.sourceType, origin.sourceInstanceId, updatedAt),
|
|
3478
|
+
sourceProviderSlug,
|
|
3479
|
+
sourceInstanceId: origin.sourceInstanceId,
|
|
1489
3480
|
sourceType: origin.sourceType,
|
|
3481
|
+
updatedAt,
|
|
1490
3482
|
});
|
|
1491
3483
|
return Object.keys(sanitized).length > 0 ? sanitized : undefined;
|
|
1492
3484
|
}
|
|
@@ -2378,10 +4370,12 @@ const JUNCTION_PROFILE_SEX_PATHS = [
|
|
|
2378
4370
|
"biologicalSex",
|
|
2379
4371
|
"biological_sex",
|
|
2380
4372
|
];
|
|
4373
|
+
const JUNCTION_PROFILE_GENDER_PATHS = ["gender"];
|
|
2381
4374
|
// Junction profile is a single current-state snapshot per source. Height
|
|
2382
|
-
// follows the body-summary observation pattern;
|
|
2383
|
-
//
|
|
2384
|
-
//
|
|
4375
|
+
// follows the body-summary observation pattern; gender is a distinct
|
|
4376
|
+
// categorical measurement, while birth date, biological sex, and wheelchair
|
|
4377
|
+
// use remain one structured note. Gender must never be folded into or labeled
|
|
4378
|
+
// as biological sex.
|
|
2385
4379
|
function pushProfileSummary(entry, resourceContext, context) {
|
|
2386
4380
|
const baseTimestamp = resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug);
|
|
2387
4381
|
// Profile entries carry no observed-at timestamp, so the generic resolver
|
|
@@ -2403,14 +4397,36 @@ function pushProfileSummary(entry, resourceContext, context) {
|
|
|
2403
4397
|
occurredAt: pinnedOccurredAt,
|
|
2404
4398
|
recordedAt: baseTimestamp.observedAtRaw ? baseTimestamp.recordedAt : providerTimestamp,
|
|
2405
4399
|
dayKey: extractIsoDatePrefix(pinnedOccurredAt) ?? baseTimestamp.dayKey,
|
|
2406
|
-
observedAtRaw:
|
|
2407
|
-
?? stringId(providerTimestampRaw)
|
|
2408
|
-
?? "current",
|
|
4400
|
+
observedAtRaw: pinnedOccurredAt,
|
|
2409
4401
|
});
|
|
2410
|
-
|
|
4402
|
+
const legacyExternalRefs = (facet) => buildJunctionProfileLegacyExternalRefs(resourceContext, entry, timestamp, providerTimestampRaw, facet);
|
|
4403
|
+
pushObservationMetrics(entry, resourceContext, context, JUNCTION_PROFILE_METRICS, timestamp, legacyExternalRefs);
|
|
2411
4404
|
if (!timestamp.occurredAt) {
|
|
2412
4405
|
return;
|
|
2413
4406
|
}
|
|
4407
|
+
const gender = firstStringFromPaths(entry, JUNCTION_PROFILE_GENDER_PATHS);
|
|
4408
|
+
if (gender) {
|
|
4409
|
+
context.events.push(stripUndefined({
|
|
4410
|
+
kind: "measurement",
|
|
4411
|
+
occurredAt: timestamp.occurredAt,
|
|
4412
|
+
recordedAt: timestamp.recordedAt,
|
|
4413
|
+
dayKey: timestamp.dayKey,
|
|
4414
|
+
source: "device",
|
|
4415
|
+
title: "Junction gender",
|
|
4416
|
+
evidenceRoles: resourceContext.evidenceRoles,
|
|
4417
|
+
externalRef: makeJunctionExternalRef(resourceContext, entry, timestamp, "gender"),
|
|
4418
|
+
legacyExternalRefs: legacyExternalRefs("gender"),
|
|
4419
|
+
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
4420
|
+
fields: {
|
|
4421
|
+
measurements: [{
|
|
4422
|
+
metric: "gender",
|
|
4423
|
+
value: 1,
|
|
4424
|
+
unit: "recording",
|
|
4425
|
+
qualifiers: { gender: trimToLength(gender, 80) },
|
|
4426
|
+
}],
|
|
4427
|
+
},
|
|
4428
|
+
}));
|
|
4429
|
+
}
|
|
2414
4430
|
const birthDate = firstIsoDateFromPaths(entry, JUNCTION_PROFILE_BIRTH_DATE_PATHS);
|
|
2415
4431
|
const sex = readJunctionProfileSex(entry);
|
|
2416
4432
|
const wheelchairUse = firstValueFromPaths(entry, ["wheelchairUse", "wheelchair_use"]);
|
|
@@ -2432,6 +4448,7 @@ function pushProfileSummary(entry, resourceContext, context) {
|
|
|
2432
4448
|
note: trimToLength(segments.join(" "), 4000),
|
|
2433
4449
|
evidenceRoles: resourceContext.evidenceRoles,
|
|
2434
4450
|
externalRef: makeJunctionExternalRef(resourceContext, entry, timestamp, "profile-demographics"),
|
|
4451
|
+
legacyExternalRefs: legacyExternalRefs("profile-demographics"),
|
|
2435
4452
|
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
2436
4453
|
}));
|
|
2437
4454
|
}
|
|
@@ -2544,6 +4561,54 @@ function pushMenstrualCycleSummary(entry, resourceContext, context) {
|
|
|
2544
4561
|
title: "Junction menstrual flow",
|
|
2545
4562
|
});
|
|
2546
4563
|
}
|
|
4564
|
+
for (const sub of junctionDatedSubEntries(entry, ["cervicalMucus", "cervical_mucus"])) {
|
|
4565
|
+
const quality = firstStringFromPaths(sub.entry, ["quality"]);
|
|
4566
|
+
if (!quality) {
|
|
4567
|
+
continue;
|
|
4568
|
+
}
|
|
4569
|
+
const boundedQuality = trimToLength(quality, 80);
|
|
4570
|
+
pushJunctionCycleDailyMeasurement(entry, resourceContext, context, baseTimestamp, {
|
|
4571
|
+
date: sub.date,
|
|
4572
|
+
facet: `cervical-mucus-quality-${trimSlugToLength(slugify(boundedQuality, "quality"), 80)}-${sub.date}`,
|
|
4573
|
+
measurement: {
|
|
4574
|
+
metric: "cervical-mucus-quality",
|
|
4575
|
+
value: 1,
|
|
4576
|
+
unit: "recording",
|
|
4577
|
+
qualifiers: { quality: boundedQuality },
|
|
4578
|
+
},
|
|
4579
|
+
title: "Junction cervical mucus quality",
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
for (const sub of junctionDatedSubEntries(entry, ["intermenstrualBleeding", "intermenstrual_bleeding"])) {
|
|
4583
|
+
pushJunctionCycleDailyMeasurement(entry, resourceContext, context, baseTimestamp, {
|
|
4584
|
+
date: sub.date,
|
|
4585
|
+
facet: `intermenstrual-bleeding-${sub.date}`,
|
|
4586
|
+
measurement: {
|
|
4587
|
+
metric: "intermenstrual-bleeding",
|
|
4588
|
+
value: 1,
|
|
4589
|
+
unit: "flag",
|
|
4590
|
+
},
|
|
4591
|
+
title: "Junction intermenstrual bleeding",
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4594
|
+
for (const sub of junctionDatedSubEntries(entry, ["contraceptive"])) {
|
|
4595
|
+
const contraceptiveType = firstStringFromPaths(sub.entry, ["type"]);
|
|
4596
|
+
if (!contraceptiveType) {
|
|
4597
|
+
continue;
|
|
4598
|
+
}
|
|
4599
|
+
const boundedType = trimToLength(contraceptiveType, 80);
|
|
4600
|
+
pushJunctionCycleDailyMeasurement(entry, resourceContext, context, baseTimestamp, {
|
|
4601
|
+
date: sub.date,
|
|
4602
|
+
facet: `contraceptive-type-${trimSlugToLength(slugify(boundedType, "type"), 80)}-${sub.date}`,
|
|
4603
|
+
measurement: {
|
|
4604
|
+
metric: "contraceptive-type",
|
|
4605
|
+
value: 1,
|
|
4606
|
+
unit: "recording",
|
|
4607
|
+
qualifiers: { type: boundedType },
|
|
4608
|
+
},
|
|
4609
|
+
title: "Junction contraceptive type",
|
|
4610
|
+
});
|
|
4611
|
+
}
|
|
2547
4612
|
for (const test of [
|
|
2548
4613
|
{ metric: "ovulation-test", paths: ["ovulationTest", "ovulation_test"], title: "Junction ovulation test" },
|
|
2549
4614
|
{ metric: "pregnancy-test", paths: ["homePregnancyTest", "home_pregnancy_test"], title: "Junction pregnancy test" },
|
|
@@ -2570,6 +4635,47 @@ function pushMenstrualCycleSummary(entry, resourceContext, context) {
|
|
|
2570
4635
|
});
|
|
2571
4636
|
}
|
|
2572
4637
|
}
|
|
4638
|
+
for (const sub of junctionDatedSubEntries(entry, ["homeProgesteroneTest", "home_progesterone_test"])) {
|
|
4639
|
+
const result = firstStringFromPaths(sub.entry, ["testResult", "test_result"]);
|
|
4640
|
+
if (!result) {
|
|
4641
|
+
continue;
|
|
4642
|
+
}
|
|
4643
|
+
const boundedResult = trimToLength(result, 80);
|
|
4644
|
+
// This records the provider's categorical result rather than coercing it
|
|
4645
|
+
// into a positive/negative scalar, so indeterminate and unknown remain
|
|
4646
|
+
// truthful queryable values instead of being dropped or guessed.
|
|
4647
|
+
pushJunctionCycleDailyMeasurement(entry, resourceContext, context, baseTimestamp, {
|
|
4648
|
+
date: sub.date,
|
|
4649
|
+
facet: `home-progesterone-test-${trimSlugToLength(slugify(boundedResult, "result"), 80)}-${sub.date}`,
|
|
4650
|
+
measurement: {
|
|
4651
|
+
metric: "home-progesterone-test",
|
|
4652
|
+
value: 1,
|
|
4653
|
+
unit: "recording",
|
|
4654
|
+
qualifiers: { result: boundedResult },
|
|
4655
|
+
},
|
|
4656
|
+
title: "Junction home progesterone test",
|
|
4657
|
+
});
|
|
4658
|
+
}
|
|
4659
|
+
for (const sub of junctionDatedSubEntries(entry, ["sexualActivity", "sexual_activity"])) {
|
|
4660
|
+
const protectionUsedRaw = firstValueFromPaths(sub.entry, ["protectionUsed", "protection_used"]);
|
|
4661
|
+
const protectionUsed = typeof protectionUsedRaw === "boolean" ? protectionUsedRaw : undefined;
|
|
4662
|
+
const protectionFacet = protectionUsed === true
|
|
4663
|
+
? "protected"
|
|
4664
|
+
: protectionUsed === false
|
|
4665
|
+
? "unprotected"
|
|
4666
|
+
: "protection-unspecified";
|
|
4667
|
+
pushJunctionCycleDailyMeasurement(entry, resourceContext, context, baseTimestamp, {
|
|
4668
|
+
date: sub.date,
|
|
4669
|
+
facet: `sexual-activity-${protectionFacet}-${sub.date}`,
|
|
4670
|
+
measurement: {
|
|
4671
|
+
metric: "sexual-activity",
|
|
4672
|
+
value: 1,
|
|
4673
|
+
unit: "recording",
|
|
4674
|
+
qualifiers: protectionUsed === undefined ? undefined : { "protection-used": protectionUsed },
|
|
4675
|
+
},
|
|
4676
|
+
title: "Junction sexual activity",
|
|
4677
|
+
});
|
|
4678
|
+
}
|
|
2573
4679
|
for (const sub of junctionDatedSubEntries(entry, ["detectedDeviations", "detected_deviations"])) {
|
|
2574
4680
|
const deviation = firstStringFromPaths(sub.entry, ["deviation"]);
|
|
2575
4681
|
if (!deviation) {
|
|
@@ -2612,7 +4718,7 @@ function pushJunctionCycleDailyMeasurement(entry, resourceContext, context, base
|
|
|
2612
4718
|
externalRef: makeJunctionExternalRef(resourceContext, entry, timestamp, input.facet),
|
|
2613
4719
|
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
2614
4720
|
fields: {
|
|
2615
|
-
measurements: [input.measurement],
|
|
4721
|
+
measurements: [stripUndefined(input.measurement)],
|
|
2616
4722
|
},
|
|
2617
4723
|
}));
|
|
2618
4724
|
}
|
|
@@ -2641,10 +4747,9 @@ function inclusiveDaysBetween(startDate, endDate) {
|
|
|
2641
4747
|
const days = Math.round((end - start) / 86_400_000) + 1;
|
|
2642
4748
|
return days >= 1 && days <= 120 ? days : undefined;
|
|
2643
4749
|
}
|
|
2644
|
-
//
|
|
2645
|
-
//
|
|
2646
|
-
//
|
|
2647
|
-
// a qualifier; the electrocardiogram_voltage waveform stays excluded.
|
|
4750
|
+
// Summary and voltage-feature contexts deliberately use different resource
|
|
4751
|
+
// identities. Core revisions are whole-record replacements, so sharing an
|
|
4752
|
+
// owner here would let a compact voltage feature erase summary classification.
|
|
2648
4753
|
function pushElectrocardiogramSummary(entry, resourceContext, context) {
|
|
2649
4754
|
const baseTimestamp = resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug);
|
|
2650
4755
|
const sessionStartRaw = firstValueFromPaths(entry, ["sessionStart", "session_start"]);
|
|
@@ -2805,12 +4910,13 @@ function buildJunctionMealNutrition(entry, resourceContext, foodItems) {
|
|
|
2805
4910
|
});
|
|
2806
4911
|
}
|
|
2807
4912
|
// Micronutrients land bounded and compactly: only the documented Junction
|
|
2808
|
-
// micro keys are read
|
|
4913
|
+
// micro keys are read. Preserve an explicit finite zero so downstream coverage
|
|
4914
|
+
// can distinguish a recorded zero from an absent provider field.
|
|
2809
4915
|
function readJunctionMealMicros(entry) {
|
|
2810
4916
|
const micros = {};
|
|
2811
4917
|
for (const key of MEAL_MICRONUTRIENT_KEYS) {
|
|
2812
4918
|
const value = roundMealNutritionValue(finiteNumber(readPath(entry, JUNCTION_MEAL_MICRO_PATHS[key])));
|
|
2813
|
-
if (value !== undefined && value
|
|
4919
|
+
if (value !== undefined && value >= 0) {
|
|
2814
4920
|
micros[key] = value;
|
|
2815
4921
|
}
|
|
2816
4922
|
}
|
|
@@ -3071,7 +5177,7 @@ function buildWorkoutRouteMetadata(entry) {
|
|
|
3071
5177
|
});
|
|
3072
5178
|
return Object.keys(route).length > 0 ? route : undefined;
|
|
3073
5179
|
}
|
|
3074
|
-
function pushObservationMetrics(entry, resourceContext, context, metrics, timestampOverride) {
|
|
5180
|
+
function pushObservationMetrics(entry, resourceContext, context, metrics, timestampOverride, legacyExternalRefs) {
|
|
3075
5181
|
const timestamp = timestampOverride ?? resolveRecordTimestamp(entry, context, resourceContext.sourceProviderSlug);
|
|
3076
5182
|
const occurredAt = timestamp.occurredAt;
|
|
3077
5183
|
if (!occurredAt) {
|
|
@@ -3096,6 +5202,7 @@ function pushObservationMetrics(entry, resourceContext, context, metrics, timest
|
|
|
3096
5202
|
// supersedes an existing generic Apple HRV event instead of duplicating
|
|
3097
5203
|
// it under the corrected SDNN metric.
|
|
3098
5204
|
externalRef: makeJunctionExternalRef(resourceContext, entry, timestamp, metric.metric),
|
|
5205
|
+
legacyExternalRefs: legacyExternalRefs?.(metric.metric),
|
|
3099
5206
|
dataOrigin: buildDataOrigin(entry, resourceContext, timestamp),
|
|
3100
5207
|
fields: {
|
|
3101
5208
|
metric: metricKey,
|
|
@@ -3173,6 +5280,13 @@ function resolveMetricDescriptorValue(entry, metric) {
|
|
|
3173
5280
|
}
|
|
3174
5281
|
return null;
|
|
3175
5282
|
}
|
|
5283
|
+
function resolveJunctionSleepLatencyMinutes(entry) {
|
|
5284
|
+
const explicitlyNamedMinutes = firstNumberFromPaths(entry, JUNCTION_SLEEP_LATENCY_MINUTE_PATHS);
|
|
5285
|
+
if (explicitlyNamedMinutes !== undefined) {
|
|
5286
|
+
return explicitlyNamedMinutes;
|
|
5287
|
+
}
|
|
5288
|
+
return secondsToMinutes(firstNumberFromPaths(entry, JUNCTION_SLEEP_LATENCY_SECOND_PATHS));
|
|
5289
|
+
}
|
|
3176
5290
|
function resolveJunctionDailyActivityMinutes(entry) {
|
|
3177
5291
|
// Get Summary reports these buckets in minutes and `daily_movement` as
|
|
3178
5292
|
// deprecated equivalent-walking meters. Sense's `*_second` query columns
|
|
@@ -3193,6 +5307,12 @@ function resolveJunctionDailyActivityMinutes(entry) {
|
|
|
3193
5307
|
? totalActivityMinutes
|
|
3194
5308
|
: undefined;
|
|
3195
5309
|
}
|
|
5310
|
+
function resolveJunctionActivityIntensityMinutes(entry, intensity) {
|
|
5311
|
+
const minutes = firstNumberFromPaths(entry, [intensity]);
|
|
5312
|
+
return minutes !== undefined && minutes >= 0 && minutes <= 24 * 60
|
|
5313
|
+
? minutes
|
|
5314
|
+
: undefined;
|
|
5315
|
+
}
|
|
3196
5316
|
function buildResourceContext(input) {
|
|
3197
5317
|
const connection = resolveEntryConnection(input.entry, input.context.connectionsByKey);
|
|
3198
5318
|
const originFallback = buildJunctionOriginFallback(connection, input.originFallback);
|
|
@@ -3259,8 +5379,8 @@ function withTimestampOverride(timestamp, override) {
|
|
|
3259
5379
|
timestampSemantics: override.timestampSemantics ?? timestamp.timestampSemantics,
|
|
3260
5380
|
};
|
|
3261
5381
|
}
|
|
3262
|
-
function makeJunctionExternalRef(resourceContext, entry, timestamp, facet) {
|
|
3263
|
-
return makeProviderExternalRef("junction", resourceContext.externalRefResourceType, buildStableResourceId(resourceContext, entry, timestamp), junctionCompanionExternalRefVersion(resourceContext, entry), slugify(facet, "value"));
|
|
5382
|
+
function makeJunctionExternalRef(resourceContext, entry, timestamp, facet, sourceVersion) {
|
|
5383
|
+
return makeProviderExternalRef("junction", resourceContext.externalRefResourceType, buildStableResourceId(resourceContext, entry, timestamp), sourceVersion ?? junctionCompanionExternalRefVersion(resourceContext, entry), slugify(facet, "value"));
|
|
3264
5384
|
}
|
|
3265
5385
|
function junctionCompanionExternalRefVersion(resourceContext, entry) {
|
|
3266
5386
|
if (resourceContext.sourceProviderSlug !== "apple-health-kit"
|
|
@@ -3282,6 +5402,12 @@ function buildStableResourceId(resourceContext, entry, timestamp) {
|
|
|
3282
5402
|
return buildStableSummaryResourceId(resourceContext, entry, timestamp);
|
|
3283
5403
|
}
|
|
3284
5404
|
function buildStableSummaryResourceId(resourceContext, entry, timestamp) {
|
|
5405
|
+
if (resourceContext.resource === "profile") {
|
|
5406
|
+
const profileResourceId = buildStableProfileResourceId(entry, resourceContext.sourceProviderSlug, resourceContext.origin.sourceType, resourceContext.origin.sourceInstanceId, timestamp.occurredAt);
|
|
5407
|
+
if (profileResourceId) {
|
|
5408
|
+
return profileResourceId;
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
3285
5411
|
const explicitId = resourceContext.resource === "workouts"
|
|
3286
5412
|
? firstStringFromPaths(entry, JUNCTION_WORKOUT_STABLE_ID_PATHS)
|
|
3287
5413
|
: resourceContext.resource === "meal"
|
|
@@ -3301,29 +5427,99 @@ function buildStableSummaryResourceId(resourceContext, entry, timestamp) {
|
|
|
3301
5427
|
resourceContext.origin.sourceType,
|
|
3302
5428
|
resourceContext.origin.sourceInstanceId,
|
|
3303
5429
|
timestamp.observedAtRaw ?? timestamp.occurredAt,
|
|
3304
|
-
...(resourceContext.resource === "meal" ? [
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
5430
|
+
...(resourceContext.resource === "meal" ? [resolveJunctionMealTitle(entry)] : []),
|
|
5431
|
+
...(resourceContext.fallbackIdentityDisambiguator
|
|
5432
|
+
? [resourceContext.fallbackIdentityDisambiguator]
|
|
5433
|
+
: []),
|
|
3308
5434
|
])}`;
|
|
3309
5435
|
}
|
|
3310
|
-
function
|
|
3311
|
-
|
|
3312
|
-
|
|
5436
|
+
function buildStableProfileResourceId(entry, sourceProviderSlug, sourceType, sourceInstanceId, updatedAt) {
|
|
5437
|
+
const retainedResourceId = firstStringFromPaths(entry, ["stableResourceId"]);
|
|
5438
|
+
if (retainedResourceId && /^profile-[a-f0-9]{16}$/u.test(retainedResourceId)) {
|
|
5439
|
+
return retainedResourceId;
|
|
5440
|
+
}
|
|
5441
|
+
const explicitId = firstStringFromPaths(entry, JUNCTION_GENERIC_SUMMARY_ID_PATHS);
|
|
5442
|
+
if (explicitId) {
|
|
5443
|
+
return `profile-${shortHash([
|
|
5444
|
+
sourceProviderSlug,
|
|
5445
|
+
sourceType,
|
|
5446
|
+
sourceInstanceId,
|
|
5447
|
+
explicitId,
|
|
5448
|
+
])}`;
|
|
5449
|
+
}
|
|
5450
|
+
return updatedAt
|
|
5451
|
+
? `profile-${shortHash([
|
|
5452
|
+
"profile",
|
|
5453
|
+
sourceProviderSlug,
|
|
5454
|
+
sourceType,
|
|
5455
|
+
sourceInstanceId,
|
|
5456
|
+
updatedAt,
|
|
5457
|
+
])}`
|
|
5458
|
+
: undefined;
|
|
5459
|
+
}
|
|
5460
|
+
function buildJunctionProfileLegacyExternalRefs(resourceContext, entry, timestamp, providerTimestampRaw, facet) {
|
|
5461
|
+
if (firstStringFromPaths(entry, ["stableResourceId"])
|
|
5462
|
+
|| firstStringFromPaths(entry, JUNCTION_GENERIC_SUMMARY_ID_PATHS)) {
|
|
5463
|
+
return undefined;
|
|
5464
|
+
}
|
|
5465
|
+
const rawTimestamp = stringId(providerTimestampRaw);
|
|
5466
|
+
if (!rawTimestamp) {
|
|
5467
|
+
return undefined;
|
|
5468
|
+
}
|
|
5469
|
+
const primary = makeJunctionExternalRef(resourceContext, entry, timestamp, facet);
|
|
5470
|
+
const legacyResourceId = `profile-${shortHash([
|
|
5471
|
+
"profile",
|
|
3313
5472
|
resourceContext.sourceProviderSlug,
|
|
3314
5473
|
resourceContext.origin.sourceType,
|
|
3315
5474
|
resourceContext.origin.sourceInstanceId,
|
|
3316
|
-
|
|
5475
|
+
rawTimestamp,
|
|
5476
|
+
])}`;
|
|
5477
|
+
return legacyResourceId === primary.resourceId
|
|
5478
|
+
? undefined
|
|
5479
|
+
: [{ ...primary, resourceId: legacyResourceId }];
|
|
5480
|
+
}
|
|
5481
|
+
function buildStableTimeseriesResourceId(resourceContext, timestamp) {
|
|
5482
|
+
if (resourceContext.fallbackIdentityDisambiguator) {
|
|
5483
|
+
return `${resourceContext.resourceSlug}-${shortHash([
|
|
5484
|
+
resourceContext.fallbackIdentityDisambiguator,
|
|
5485
|
+
])}`;
|
|
5486
|
+
}
|
|
5487
|
+
return buildJunctionTimeseriesResourceId({
|
|
5488
|
+
observedAtRaw: timestamp.observedAtRaw ?? timestamp.occurredAt,
|
|
5489
|
+
resourceSlug: resourceContext.resourceSlug,
|
|
5490
|
+
sourceInstanceId: resourceContext.origin.sourceInstanceId,
|
|
5491
|
+
sourceProviderSlug: resourceContext.sourceProviderSlug,
|
|
5492
|
+
sourceType: resourceContext.origin.sourceType,
|
|
5493
|
+
});
|
|
5494
|
+
}
|
|
5495
|
+
function buildJunctionTimeseriesResourceId(input) {
|
|
5496
|
+
return `${input.resourceSlug}-${shortHash([
|
|
5497
|
+
input.resourceSlug,
|
|
5498
|
+
input.sourceProviderSlug,
|
|
5499
|
+
input.sourceType,
|
|
5500
|
+
input.sourceInstanceId,
|
|
5501
|
+
input.observedAtRaw,
|
|
3317
5502
|
])}`;
|
|
3318
5503
|
}
|
|
5504
|
+
export function buildJunctionDailyTimeseriesAggregateResourceId(input) {
|
|
5505
|
+
const resourceSlug = slugify(input.resource, "timeseries");
|
|
5506
|
+
return buildJunctionTimeseriesResourceId({
|
|
5507
|
+
observedAtRaw: `${input.dayKey}:${input.resource}:daily`,
|
|
5508
|
+
resourceSlug,
|
|
5509
|
+
sourceInstanceId: input.sourceInstanceId,
|
|
5510
|
+
sourceProviderSlug: normalizeJunctionSourceProviderSlug(input.sourceProviderSlug)
|
|
5511
|
+
?? input.sourceProviderSlug,
|
|
5512
|
+
sourceType: input.sourceType,
|
|
5513
|
+
});
|
|
5514
|
+
}
|
|
3319
5515
|
function shortHash(parts) {
|
|
3320
5516
|
return createHash("sha256")
|
|
3321
5517
|
.update(JSON.stringify(parts))
|
|
3322
5518
|
.digest("hex")
|
|
3323
5519
|
.slice(0, 16);
|
|
3324
5520
|
}
|
|
3325
|
-
function resolveRecordTimestamp(entry, context, sourceProviderSlug) {
|
|
3326
|
-
const rawObservedAt = firstStringFromPaths(entry,
|
|
5521
|
+
function resolveRecordTimestamp(entry, context, sourceProviderSlug, timestampPaths = JUNCTION_RECORD_TIMESTAMP_PATHS) {
|
|
5522
|
+
const rawObservedAt = firstStringFromPaths(entry, timestampPaths);
|
|
3327
5523
|
const localCalendarDayKey = firstIsoDateFromPaths(entry, JUNCTION_LOCAL_CALENDAR_DATE_PATHS);
|
|
3328
5524
|
const explicitSemantics = firstTimestampSemantics(entry);
|
|
3329
5525
|
const hasSourceSpecificFloatingTime = hasFloatingTimestampSourceProvider(sourceProviderSlug);
|
|
@@ -3738,7 +5934,21 @@ function resolveJunctionTimeseriesAggregateDayKey(entry, timestamp, sampleAt, de
|
|
|
3738
5934
|
: undefined;
|
|
3739
5935
|
return timestamp.dayKey ?? vaultDayKey ?? extractIsoDatePrefix(sampleAt) ?? undefined;
|
|
3740
5936
|
}
|
|
3741
|
-
function
|
|
5937
|
+
function hasValidJunctionExplicitTimeseriesTimestamp(timestamp) {
|
|
5938
|
+
if (!timestamp.observedAtRaw) {
|
|
5939
|
+
return false;
|
|
5940
|
+
}
|
|
5941
|
+
if (timestamp.timestampSemantics === "floating") {
|
|
5942
|
+
return Boolean(timestamp.dayKey);
|
|
5943
|
+
}
|
|
5944
|
+
return normalizeTimestamp(timestamp.observedAtRaw) !== undefined;
|
|
5945
|
+
}
|
|
5946
|
+
function resolveJunctionDailyAggregateSampleAt(timestamp, preserveFloatingDay) {
|
|
5947
|
+
if (preserveFloatingDay
|
|
5948
|
+
&& timestamp.timestampSemantics === "floating"
|
|
5949
|
+
&& timestamp.dayKey) {
|
|
5950
|
+
return `${timestamp.dayKey}T23:59:59.999Z`;
|
|
5951
|
+
}
|
|
3742
5952
|
return timestamp.occurredAt ?? timestamp.recordedAt ?? (timestamp.timestampSemantics === "floating" && timestamp.dayKey
|
|
3743
5953
|
? `${timestamp.dayKey}T00:00:00.000Z`
|
|
3744
5954
|
: undefined);
|
|
@@ -3952,6 +6162,219 @@ function metersToKilometers(value) {
|
|
|
3952
6162
|
}
|
|
3953
6163
|
return numeric / 1000;
|
|
3954
6164
|
}
|
|
6165
|
+
function normalizeStepCount(value) {
|
|
6166
|
+
const numeric = finiteNumber(value);
|
|
6167
|
+
if (numeric === undefined
|
|
6168
|
+
|| !Number.isSafeInteger(numeric)
|
|
6169
|
+
|| numeric < 0
|
|
6170
|
+
|| numeric > 1_000_000) {
|
|
6171
|
+
return undefined;
|
|
6172
|
+
}
|
|
6173
|
+
return numeric;
|
|
6174
|
+
}
|
|
6175
|
+
function normalizeDistanceKilometers(value, entry) {
|
|
6176
|
+
const numeric = finiteNumber(value);
|
|
6177
|
+
if (numeric === undefined || numeric < 0) {
|
|
6178
|
+
return undefined;
|
|
6179
|
+
}
|
|
6180
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6181
|
+
let kilometers;
|
|
6182
|
+
switch (unit) {
|
|
6183
|
+
case undefined: {
|
|
6184
|
+
const kilometerField = firstNumberFromPaths(entry, ["distanceKm", "distance_km"]);
|
|
6185
|
+
const meterField = firstNumberFromPaths(entry, ["value", "distance", "distanceMeters", "distance_meters"]);
|
|
6186
|
+
kilometers = kilometerField !== undefined && meterField === undefined
|
|
6187
|
+
? numeric
|
|
6188
|
+
: numeric / 1000;
|
|
6189
|
+
break;
|
|
6190
|
+
}
|
|
6191
|
+
case "m":
|
|
6192
|
+
case "meter":
|
|
6193
|
+
case "meters":
|
|
6194
|
+
case "metre":
|
|
6195
|
+
case "metres":
|
|
6196
|
+
kilometers = numeric / 1000;
|
|
6197
|
+
break;
|
|
6198
|
+
case "km":
|
|
6199
|
+
case "kilometer":
|
|
6200
|
+
case "kilometers":
|
|
6201
|
+
case "kilometre":
|
|
6202
|
+
case "kilometres":
|
|
6203
|
+
kilometers = numeric;
|
|
6204
|
+
break;
|
|
6205
|
+
case "mi":
|
|
6206
|
+
case "mile":
|
|
6207
|
+
case "miles":
|
|
6208
|
+
kilometers = numeric * 1.609344;
|
|
6209
|
+
break;
|
|
6210
|
+
default:
|
|
6211
|
+
return undefined;
|
|
6212
|
+
}
|
|
6213
|
+
if (kilometers === undefined
|
|
6214
|
+
|| !Number.isFinite(kilometers)
|
|
6215
|
+
|| kilometers < 0
|
|
6216
|
+
|| kilometers > 1000) {
|
|
6217
|
+
return undefined;
|
|
6218
|
+
}
|
|
6219
|
+
return roundJunctionDailyAggregateValue(kilometers);
|
|
6220
|
+
}
|
|
6221
|
+
function normalizeActiveCaloriesKilocalories(value, entry) {
|
|
6222
|
+
const numeric = finiteNumber(value);
|
|
6223
|
+
if (numeric === undefined || numeric < 0) {
|
|
6224
|
+
return undefined;
|
|
6225
|
+
}
|
|
6226
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6227
|
+
const kilocalories = unit === undefined || isJunctionKilocalorieUnit(unit)
|
|
6228
|
+
? numeric
|
|
6229
|
+
: isJunctionKilojouleUnit(unit)
|
|
6230
|
+
? kilojoulesToKilocalories(numeric)
|
|
6231
|
+
: undefined;
|
|
6232
|
+
if (kilocalories === undefined || kilocalories < 0 || kilocalories > 20_000) {
|
|
6233
|
+
return undefined;
|
|
6234
|
+
}
|
|
6235
|
+
return roundJunctionDailyAggregateValue(kilocalories);
|
|
6236
|
+
}
|
|
6237
|
+
function normalizeBasalCaloriesKilocalories(value, entry) {
|
|
6238
|
+
return normalizeActiveCaloriesKilocalories(value, entry);
|
|
6239
|
+
}
|
|
6240
|
+
function normalizeDaylightExposureMinutes(value, entry) {
|
|
6241
|
+
return normalizeJunctionDurationMinutes(value, entry, 1440);
|
|
6242
|
+
}
|
|
6243
|
+
function normalizeStandDurationMinutes(value, entry) {
|
|
6244
|
+
return normalizeJunctionDurationMinutes(value, entry, 1440);
|
|
6245
|
+
}
|
|
6246
|
+
function normalizeWorkoutDurationMinutes(value, entry) {
|
|
6247
|
+
return normalizeJunctionDurationMinutes(value, entry, 7 * 24 * 60);
|
|
6248
|
+
}
|
|
6249
|
+
function normalizeJunctionDurationMinutes(value, entry, maximum) {
|
|
6250
|
+
const numeric = finiteNumber(value);
|
|
6251
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6252
|
+
if (numeric === undefined || numeric < 0) {
|
|
6253
|
+
return undefined;
|
|
6254
|
+
}
|
|
6255
|
+
let minutes;
|
|
6256
|
+
switch (unit) {
|
|
6257
|
+
case undefined:
|
|
6258
|
+
case "min":
|
|
6259
|
+
case "mins":
|
|
6260
|
+
case "minute":
|
|
6261
|
+
case "minutes":
|
|
6262
|
+
minutes = numeric;
|
|
6263
|
+
break;
|
|
6264
|
+
case "s":
|
|
6265
|
+
case "sec":
|
|
6266
|
+
case "secs":
|
|
6267
|
+
case "second":
|
|
6268
|
+
case "seconds":
|
|
6269
|
+
minutes = numeric / 60;
|
|
6270
|
+
break;
|
|
6271
|
+
case "ms":
|
|
6272
|
+
case "millisecond":
|
|
6273
|
+
case "milliseconds":
|
|
6274
|
+
minutes = numeric / 60_000;
|
|
6275
|
+
break;
|
|
6276
|
+
default:
|
|
6277
|
+
return undefined;
|
|
6278
|
+
}
|
|
6279
|
+
return minutes <= maximum
|
|
6280
|
+
? roundJunctionDailyAggregateValue(minutes)
|
|
6281
|
+
: undefined;
|
|
6282
|
+
}
|
|
6283
|
+
function normalizeFloorsClimbedCount(value, entry) {
|
|
6284
|
+
return normalizeJunctionIntegerCount(value, entry, 0, 10_000);
|
|
6285
|
+
}
|
|
6286
|
+
function normalizeStandHourCount(value, entry) {
|
|
6287
|
+
return normalizeJunctionIntegerCount(value, entry, 0, 24);
|
|
6288
|
+
}
|
|
6289
|
+
function normalizeWheelchairPushCount(value, entry) {
|
|
6290
|
+
return normalizeJunctionIntegerCount(value, entry, 0, 10_000_000);
|
|
6291
|
+
}
|
|
6292
|
+
function normalizeHandwashingCount(value, entry) {
|
|
6293
|
+
return normalizeJunctionIntegerCount(value, entry, 1, 1_000);
|
|
6294
|
+
}
|
|
6295
|
+
function normalizeWorkoutSwimmingStrokeCount(value, entry) {
|
|
6296
|
+
return normalizeJunctionIntegerCount(value, entry, 0, 1_000_000);
|
|
6297
|
+
}
|
|
6298
|
+
function normalizeJunctionIntegerCount(value, entry, minimum, maximum) {
|
|
6299
|
+
const numeric = finiteNumber(value);
|
|
6300
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6301
|
+
if (numeric === undefined
|
|
6302
|
+
|| !Number.isSafeInteger(numeric)
|
|
6303
|
+
|| numeric < minimum
|
|
6304
|
+
|| numeric > maximum
|
|
6305
|
+
|| (unit !== undefined && unit !== "count" && unit !== "counts")) {
|
|
6306
|
+
return undefined;
|
|
6307
|
+
}
|
|
6308
|
+
return numeric;
|
|
6309
|
+
}
|
|
6310
|
+
function normalizeUvExposureIndex(value, entry) {
|
|
6311
|
+
const numeric = finiteNumber(value);
|
|
6312
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6313
|
+
if (numeric === undefined
|
|
6314
|
+
|| numeric < 0
|
|
6315
|
+
|| numeric > 100
|
|
6316
|
+
|| (unit !== undefined && unit !== "index")) {
|
|
6317
|
+
return undefined;
|
|
6318
|
+
}
|
|
6319
|
+
return roundJunctionDailyAggregateValue(numeric);
|
|
6320
|
+
}
|
|
6321
|
+
function normalizeHeartRateBpm(value, entry) {
|
|
6322
|
+
const numeric = finiteNumber(value);
|
|
6323
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6324
|
+
if (numeric === undefined
|
|
6325
|
+
|| numeric < 20
|
|
6326
|
+
|| numeric > 300
|
|
6327
|
+
|| (unit !== undefined && !["bpm", "beatperminute", "beatsperminute"].includes(unit))) {
|
|
6328
|
+
return undefined;
|
|
6329
|
+
}
|
|
6330
|
+
return roundJunctionDailyAggregateValue(numeric);
|
|
6331
|
+
}
|
|
6332
|
+
export function resolveJunctionWeightProviderRecordIdentity(entry) {
|
|
6333
|
+
return {
|
|
6334
|
+
providerReadingId: trimOptionalToLength(firstStringFromPaths(entry, JUNCTION_READING_STABLE_ID_PATHS), 160),
|
|
6335
|
+
weightKilograms: normalizeWeightKilograms(firstNumberFromPaths(entry, JUNCTION_WEIGHT_VALUE_PATHS), entry),
|
|
6336
|
+
};
|
|
6337
|
+
}
|
|
6338
|
+
function normalizeWeightKilograms(value, entry) {
|
|
6339
|
+
const numeric = finiteNumber(value);
|
|
6340
|
+
if (numeric === undefined || numeric <= 0) {
|
|
6341
|
+
return undefined;
|
|
6342
|
+
}
|
|
6343
|
+
const unit = readJunctionTimeseriesUnit(entry);
|
|
6344
|
+
let kilograms;
|
|
6345
|
+
switch (unit) {
|
|
6346
|
+
case undefined:
|
|
6347
|
+
case "kg":
|
|
6348
|
+
case "kilogram":
|
|
6349
|
+
case "kilograms":
|
|
6350
|
+
kilograms = numeric;
|
|
6351
|
+
break;
|
|
6352
|
+
case "g":
|
|
6353
|
+
case "gram":
|
|
6354
|
+
case "grams":
|
|
6355
|
+
kilograms = numeric / 1000;
|
|
6356
|
+
break;
|
|
6357
|
+
case "lb":
|
|
6358
|
+
case "lbs":
|
|
6359
|
+
case "pound":
|
|
6360
|
+
case "pounds":
|
|
6361
|
+
kilograms = numeric / 2.2046226218;
|
|
6362
|
+
break;
|
|
6363
|
+
default:
|
|
6364
|
+
return undefined;
|
|
6365
|
+
}
|
|
6366
|
+
if (kilograms === undefined
|
|
6367
|
+
|| !Number.isFinite(kilograms)
|
|
6368
|
+
|| kilograms <= 0
|
|
6369
|
+
|| kilograms > 500) {
|
|
6370
|
+
return undefined;
|
|
6371
|
+
}
|
|
6372
|
+
return roundJunctionDailyAggregateValue(kilograms);
|
|
6373
|
+
}
|
|
6374
|
+
function readJunctionTimeseriesUnit(entry) {
|
|
6375
|
+
const unit = firstStringFromPaths(entry, ["unit", "units", "valueUnit", "value_unit"]);
|
|
6376
|
+
return unit ? normalizeNutritionUnit(unit) : undefined;
|
|
6377
|
+
}
|
|
3955
6378
|
function normalizePercentRatio(value) {
|
|
3956
6379
|
const numeric = finiteNumber(value);
|
|
3957
6380
|
if (numeric === undefined) {
|
|
@@ -4017,21 +6440,21 @@ function normalizeBodyTemperatureCelsius(value) {
|
|
|
4017
6440
|
// implausible single intake.
|
|
4018
6441
|
function normalizeCaffeineMilligrams(value) {
|
|
4019
6442
|
const numeric = finiteNumber(value);
|
|
4020
|
-
if (numeric === undefined || numeric
|
|
6443
|
+
if (numeric === undefined || numeric < 0 || numeric > 2) {
|
|
4021
6444
|
return undefined;
|
|
4022
6445
|
}
|
|
4023
6446
|
return roundJunctionDailyAggregateValue(numeric * 1000);
|
|
4024
6447
|
}
|
|
4025
6448
|
function normalizeWaterMilliliters(value) {
|
|
4026
6449
|
const numeric = finiteNumber(value);
|
|
4027
|
-
if (numeric === undefined || numeric
|
|
6450
|
+
if (numeric === undefined || numeric < 0 || numeric > 10_000) {
|
|
4028
6451
|
return undefined;
|
|
4029
6452
|
}
|
|
4030
6453
|
return roundJunctionDailyAggregateValue(numeric);
|
|
4031
6454
|
}
|
|
4032
6455
|
function normalizeMindfulnessMinutesValue(value) {
|
|
4033
6456
|
const numeric = finiteNumber(value);
|
|
4034
|
-
if (numeric === undefined || numeric
|
|
6457
|
+
if (numeric === undefined || numeric < 0 || numeric > 1440) {
|
|
4035
6458
|
return undefined;
|
|
4036
6459
|
}
|
|
4037
6460
|
return roundJunctionDailyAggregateValue(numeric);
|