@murphai/murph 1.3.0 → 1.3.2
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 +3885 -0
- package/config.schema.json +731 -60
- package/dist/bin.js +6 -4
- package/dist/bin.js.map +1 -1
- package/dist/cli-entry.d.ts +8 -1
- package/dist/cli-entry.d.ts.map +1 -1
- package/dist/cli-entry.js +80 -4
- package/dist/cli-entry.js.map +1 -1
- package/dist/commands/audit-command-helpers.d.ts.map +1 -1
- package/dist/commands/audit-command-helpers.js +7 -5
- package/dist/commands/audit-command-helpers.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 +7 -4
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +16 -62
- 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 +83 -5
- 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/exercise.d.ts.map +1 -1
- package/dist/commands/exercise.js +16 -3
- package/dist/commands/exercise.js.map +1 -1
- package/dist/commands/experiment-progress-card-image.d.ts.map +1 -1
- package/dist/commands/experiment-progress-card-image.js +76 -16
- 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 +51 -5
- 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 +9 -6
- 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 +13 -11
- package/dist/commands/food.js.map +1 -1
- package/dist/commands/habitat.d.ts.map +1 -1
- package/dist/commands/habitat.js +120 -9
- package/dist/commands/habitat.js.map +1 -1
- package/dist/commands/health-blood-test-save.d.ts.map +1 -1
- package/dist/commands/health-blood-test-save.js +42 -8
- package/dist/commands/health-blood-test-save.js.map +1 -1
- package/dist/commands/meal.d.ts.map +1 -1
- package/dist/commands/meal.js +58 -4
- 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 +51 -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/murph-age.d.ts +9 -1
- package/dist/commands/murph-age.d.ts.map +1 -1
- package/dist/commands/murph-age.js +132 -7
- package/dist/commands/murph-age.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/public-validation-issue.d.ts +7 -0
- package/dist/commands/public-validation-issue.d.ts.map +1 -0
- package/dist/commands/public-validation-issue.js +7 -0
- package/dist/commands/public-validation-issue.js.map +1 -0
- 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 +142 -124
- package/dist/commands/scheduled-log.d.ts.map +1 -1
- package/dist/commands/scheduled-log.js +456 -106
- package/dist/commands/scheduled-log.js.map +1 -1
- package/dist/commands/wearables.d.ts +1520 -145
- package/dist/commands/wearables.d.ts.map +1 -1
- package/dist/commands/wearables.js +135 -3
- 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 +372 -0
- package/dist/commands/workout-live.js.map +1 -0
- package/dist/commands/workout-typed-options.d.ts +38 -0
- package/dist/commands/workout-typed-options.d.ts.map +1 -0
- package/dist/commands/workout-typed-options.js +90 -0
- package/dist/commands/workout-typed-options.js.map +1 -0
- package/dist/commands/workout.d.ts.map +1 -1
- package/dist/commands/workout.js +115 -84
- 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 +224 -31
- package/dist/hosted-data-api-labels.js.map +1 -1
- package/dist/incur-error-bridge.d.ts.map +1 -1
- package/dist/incur-error-bridge.js +7 -15
- package/dist/incur-error-bridge.js.map +1 -1
- package/dist/incur.generated.d.ts +158 -3
- 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 +469 -0
- package/dist/mapbox-address.js.map +1 -0
- package/dist/mapbox-route-client.d.ts +2 -2
- package/dist/mapbox-route-client.d.ts.map +1 -1
- package/dist/mapbox-route-client.js +49 -12
- package/dist/mapbox-route-client.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/mapbox-route-directions.js +1 -2
- package/dist/mapbox-route-directions.js.map +1 -1
- package/dist/mapbox-route-elevation.js +0 -1
- package/dist/mapbox-route-elevation.js.map +1 -1
- package/dist/mapbox-route-points.js +0 -2
- package/dist/mapbox-route-points.js.map +1 -1
- package/dist/mapbox-route.d.ts.map +1 -1
- package/dist/mapbox-route.js +1 -1
- package/dist/mapbox-route.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 +2472 -700
- 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 +10 -8
- 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 +73 -16
- package/node_modules/@murphai/assistant-engine/dist/assistant/active-turn-input-controller.d.ts +21 -4
- 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 +173 -43
- 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 +44 -19
- 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 +28 -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 +851 -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 +51 -18
- 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 +3 -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 +4 -8
- 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 +284 -59
- 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 +152 -24
- 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 +76 -24
- 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 +8 -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 +438 -116
- 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 +10 -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 +28 -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 +8 -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 +38 -8
- 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 +123 -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 +57 -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 +10 -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 +80 -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 +191 -62
- 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/issue-reporting.d.ts +3 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/issue-reporting.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/issue-reporting.js +26 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/issue-reporting.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 +886 -436
- 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 +338 -47
- 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 +2 -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 +43 -9
- 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 +339 -62
- 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-followup-seed.d.ts +25 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-seed.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-seed.js +72 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-followup-seed.js.map +1 -0
- 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.d.ts +4 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-state.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/onboarding-state.js +15 -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 +38 -4
- 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 +1034 -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 +65 -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 +569 -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 +294 -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 +86 -97
- 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 +16 -5
- 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 +379 -644
- 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 +40 -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/reply-delivery-context.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/reply-delivery-context.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/reply-delivery-context.js +10 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant/reply-delivery-context.js.map +1 -1
- 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 +25 -4
- 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 +137 -69
- 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 +20 -4
- 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 +5 -2
- 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 +31 -11
- 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 +3 -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 +54 -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 +7 -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 +312 -138
- 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 +10 -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 +150 -10
- 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 +8 -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 +74 -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 +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 +115 -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 +3 -2
- 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/usage-attribution.d.ts +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/usage-attribution.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/assistant/usage-attribution.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 +57 -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 +13 -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/analyze-video-tool.d.ts +49 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/analyze-video-tool.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/analyze-video-tool.js +387 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/analyze-video-tool.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 +180 -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 +6 -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 +35 -10
- 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 +3 -4
- 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 +9 -15
- 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 +21 -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 +213 -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 +3320 -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 +1403 -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/analyze-video.d.ts +50 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/analyze-video.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/analyze-video.js +79 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/analyze-video.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-model-input-schema.d.ts +4 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation-model-input-schema.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation-model-input-schema.js +153 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation-model-input-schema.js.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/automation.d.ts +29 -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 -109
- 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 +6 -13
- 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 +44 -10
- 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 +8 -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/member-memory.d.ts +60 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/member-memory.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/member-memory.js +91 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/dynamic-tools/member-memory.js.map +1 -0
- 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 +131 -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 +275 -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 +131 -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 +2505 -1575
- 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 +5 -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/workout-delivery-context.d.ts +19 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/workout-delivery-context.d.ts.map +1 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/workout-delivery-context.js +203 -0
- package/node_modules/@murphai/assistant-engine/dist/assistant-codex/workout-delivery-context.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 +42 -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 +1196 -339
- 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 +24 -24
- 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 +27 -27
- 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 +9 -3
- package/node_modules/@murphai/assistant-engine/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/assistant-engine/dist/index.js +7 -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 +180 -12
- package/node_modules/@murphai/assistant-engine/skills/behavior-followthrough/SKILL.md +155 -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 +27 -4
- package/node_modules/@murphai/assistant-engine/skills/experiment-onboarding/SKILL.md +22 -9
- package/node_modules/@murphai/assistant-engine/skills/food-journal/SKILL.md +200 -14
- 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 +310 -118
- 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 +84 -7
- package/node_modules/@murphai/assistant-engine/skills/nutrition-strategy/references/daily-nutrition-card-goals.md +313 -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 +167 -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 +36 -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 +17 -1
- package/node_modules/@murphai/assistant-engine/skills/tracked-table/SKILL.md +292 -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 +121 -19
- package/node_modules/@murphai/core/dist/automation.js.map +1 -1
- package/node_modules/@murphai/core/dist/bank/habitat.d.ts +2 -0
- package/node_modules/@murphai/core/dist/bank/habitat.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/bank/habitat.js +35 -1
- package/node_modules/@murphai/core/dist/bank/habitat.js.map +1 -1
- package/node_modules/@murphai/core/dist/bank/regimens.js +1 -1
- package/node_modules/@murphai/core/dist/bank/regimens.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 +34 -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 +188 -15
- 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 +268 -20
- package/node_modules/@murphai/core/dist/history/api.js.map +1 -1
- package/node_modules/@murphai/core/dist/index.d.ts +11 -6
- package/node_modules/@murphai/core/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/index.js +8 -4
- 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 +45 -4
- package/node_modules/@murphai/core/dist/mutations.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/mutations.js +2204 -97
- package/node_modules/@murphai/core/dist/mutations.js.map +1 -1
- package/node_modules/@murphai/core/dist/operations/index.d.ts +1 -1
- package/node_modules/@murphai/core/dist/operations/index.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/operations/index.js +1 -1
- package/node_modules/@murphai/core/dist/operations/index.js.map +1 -1
- package/node_modules/@murphai/core/dist/operations/write-batch.d.ts +5 -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 +40 -2
- package/node_modules/@murphai/core/dist/operations/write-batch.js.map +1 -1
- package/node_modules/@murphai/core/dist/protocols.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/protocols.js +52 -9
- package/node_modules/@murphai/core/dist/protocols.js.map +1 -1
- package/node_modules/@murphai/core/dist/public-mutations.d.ts +3 -2
- package/node_modules/@murphai/core/dist/public-mutations.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/public-mutations.js +9 -4
- package/node_modules/@murphai/core/dist/public-mutations.js.map +1 -1
- package/node_modules/@murphai/core/dist/scheduled-logs.d.ts +3 -0
- package/node_modules/@murphai/core/dist/scheduled-logs.d.ts.map +1 -1
- package/node_modules/@murphai/core/dist/scheduled-logs.js +65 -29
- package/node_modules/@murphai/core/dist/scheduled-logs.js.map +1 -1
- package/node_modules/@murphai/device-syncd/README.md +237 -0
- package/node_modules/@murphai/device-syncd/dist/client.d.ts +15 -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 +29 -1
- 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 +78 -2
- 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/junction-connect-sources.js +2 -2
- package/node_modules/@murphai/device-syncd/dist/config/junction-connect-sources.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 +614 -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 +216 -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/fitbit-migration.d.ts +57 -0
- package/node_modules/@murphai/device-syncd/dist/fitbit-migration.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/fitbit-migration.js +166 -0
- package/node_modules/@murphai/device-syncd/dist/fitbit-migration.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.d.ts +87 -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 +296 -6
- 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 +27 -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 +464 -9
- package/node_modules/@murphai/device-syncd/dist/junction-historical-backfill-progress.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-inline-authority.d.ts +17 -2
- package/node_modules/@murphai/device-syncd/dist/junction-inline-authority.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/junction-inline-authority.js +99 -40
- package/node_modules/@murphai/device-syncd/dist/junction-inline-authority.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-source-reconnect.d.ts +17 -0
- package/node_modules/@murphai/device-syncd/dist/junction-source-reconnect.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/junction-source-reconnect.js +45 -0
- package/node_modules/@murphai/device-syncd/dist/junction-source-reconnect.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/junction-timeseries-progress.d.ts +15 -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 +24 -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 +30 -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 +1005 -193
- 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 +11 -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 +5033 -310
- 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 +54 -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 +243 -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 +634 -199
- package/node_modules/@murphai/device-syncd/dist/public-ingress.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/service.d.ts +21 -4
- package/node_modules/@murphai/device-syncd/dist/service.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/service.js +728 -68
- package/node_modules/@murphai/device-syncd/dist/service.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/source-staleness.d.ts +15 -0
- package/node_modules/@murphai/device-syncd/dist/source-staleness.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/source-staleness.js +25 -1
- package/node_modules/@murphai/device-syncd/dist/source-staleness.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 +22 -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 +266 -21
- 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/schema.d.ts +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/schema.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/schema.js +25 -3
- package/node_modules/@murphai/device-syncd/dist/store/schema.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sources.d.ts +25 -2
- package/node_modules/@murphai/device-syncd/dist/store/sources.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store/sources.js +268 -58
- 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 +30 -5
- package/node_modules/@murphai/device-syncd/dist/store.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/store.js +146 -13
- package/node_modules/@murphai/device-syncd/dist/store.js.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/types.d.ts +260 -8
- package/node_modules/@murphai/device-syncd/dist/types.d.ts.map +1 -1
- package/node_modules/@murphai/device-syncd/dist/types.js +7 -0
- package/node_modules/@murphai/device-syncd/dist/types.js.map +1 -1
- package/node_modules/@murphai/device-syncd/package.json +16 -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 +165 -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 +5 -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 +12 -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 +34 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-metric-catalog.js.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-provider-catalog.d.ts +79 -0
- package/node_modules/@murphai/health-metrics/dist/wearable-provider-catalog.d.ts.map +1 -1
- package/node_modules/@murphai/health-metrics/dist/wearable-provider-catalog.js +19 -0
- package/node_modules/@murphai/health-metrics/dist/wearable-provider-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 +16 -1
- 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/create-importers.d.ts +9 -1
- package/node_modules/@murphai/importers/dist/create-importers.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/create-importers.js +12 -2
- package/node_modules/@murphai/importers/dist/create-importers.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.d.ts +17 -3
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.js +103 -9
- 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 +5 -4
- package/node_modules/@murphai/importers/dist/device-providers/index.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/index.js +4 -3
- 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 +37 -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 +796 -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-origin.d.ts +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-origin.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-origin.js +7 -2
- package/node_modules/@murphai/importers/dist/device-providers/junction-origin.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.d.ts +7 -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 +55 -103
- package/node_modules/@murphai/importers/dist/device-providers/junction-resources.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-features.d.ts +79 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-features.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-features.js +356 -0
- package/node_modules/@murphai/importers/dist/device-providers/junction-timeseries-features.js.map +1 -0
- 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 +111 -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 +4058 -306
- 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/shared-normalization.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.js +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.js.map +1 -1
- package/node_modules/@murphai/importers/dist/device-providers/types.d.ts +9 -1
- package/node_modules/@murphai/importers/dist/device-providers/types.d.ts.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 +3 -2
- package/node_modules/@murphai/importers/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/importers/dist/index.js +2 -1
- 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 +4 -4
- 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/inboxd/dist/indexing/retention.d.ts +6 -0
- package/node_modules/@murphai/inboxd/dist/indexing/retention.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/indexing/retention.js +64 -18
- package/node_modules/@murphai/inboxd/dist/indexing/retention.js.map +1 -1
- package/node_modules/@murphai/inboxd/dist/retention.d.ts +1 -1
- package/node_modules/@murphai/inboxd/dist/retention.d.ts.map +1 -1
- package/node_modules/@murphai/inboxd/dist/retention.js +1 -1
- package/node_modules/@murphai/inboxd/dist/retention.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 +1714 -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 +198 -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 +468 -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 +1051 -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.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/device-sync-client.js +2 -6
- 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 +402 -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 +94 -8
- package/node_modules/@murphai/operator-config/dist/vault-cli-contracts.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/vault-cli-error-projection.d.ts +24 -0
- package/node_modules/@murphai/operator-config/dist/vault-cli-error-projection.d.ts.map +1 -0
- package/node_modules/@murphai/operator-config/dist/vault-cli-error-projection.js +219 -0
- package/node_modules/@murphai/operator-config/dist/vault-cli-error-projection.js.map +1 -0
- package/node_modules/@murphai/operator-config/dist/vault-cli-errors.d.ts.map +1 -1
- package/node_modules/@murphai/operator-config/dist/vault-cli-errors.js.map +1 -1
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.d.ts +14 -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 +127 -0
- package/node_modules/@murphai/operator-config/dist/workout-action-binding.js.map +1 -0
- package/node_modules/@murphai/operator-config/package.json +15 -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 +29 -5
- 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 +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 +68 -41
- 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/json.d.ts +6 -0
- package/node_modules/@murphai/query/dist/browser-replica/json.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/json.js +103 -0
- package/node_modules/@murphai/query/dist/browser-replica/json.js.map +1 -0
- 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 +144 -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/source.d.ts +13 -0
- package/node_modules/@murphai/query/dist/browser-replica/source.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/browser-replica/source.js +45 -0
- package/node_modules/@murphai/query/dist/browser-replica/source.js.map +1 -0
- 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 +7 -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 +7 -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/blood-tests.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/blood-tests.js +3 -2
- package/node_modules/@murphai/query/dist/health/blood-tests.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/canonical-collector.d.ts +11 -1
- package/node_modules/@murphai/query/dist/health/canonical-collector.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/canonical-collector.js +39 -16
- package/node_modules/@murphai/query/dist/health/canonical-collector.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/entity-slices.d.ts +9 -3
- package/node_modules/@murphai/query/dist/health/entity-slices.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/entity-slices.js +6 -6
- package/node_modules/@murphai/query/dist/health/entity-slices.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/immunizations.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/immunizations.js +14 -11
- package/node_modules/@murphai/query/dist/health/immunizations.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/loaders.d.ts +21 -7
- package/node_modules/@murphai/query/dist/health/loaders.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/loaders.js +53 -15
- package/node_modules/@murphai/query/dist/health/loaders.js.map +1 -1
- package/node_modules/@murphai/query/dist/health/registries.d.ts +1 -0
- package/node_modules/@murphai/query/dist/health/registries.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/health/registries.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 +25 -7
- package/node_modules/@murphai/query/dist/index.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/index.js +18 -6
- 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 +27 -1
- package/node_modules/@murphai/query/dist/meal-nutrition.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/meal-nutrition.js +120 -7
- 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 +123 -3
- package/node_modules/@murphai/query/dist/metrics/projection.js.map +1 -1
- package/node_modules/@murphai/query/dist/murph-age.d.ts +5 -1
- package/node_modules/@murphai/query/dist/murph-age.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/murph-age.js +22 -8
- package/node_modules/@murphai/query/dist/murph-age.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/entity-store.js +4 -4
- package/node_modules/@murphai/query/dist/projection/entity-store.js.map +1 -1
- 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 +5 -1
- package/node_modules/@murphai/query/dist/projection/schema.js.map +1 -1
- package/node_modules/@murphai/query/dist/projection/wearable-summary-compose.js +8 -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 +6 -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/query-visibility.d.ts +5 -0
- package/node_modules/@murphai/query/dist/query-visibility.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/query-visibility.js +11 -5
- package/node_modules/@murphai/query/dist/query-visibility.js.map +1 -1
- package/node_modules/@murphai/query/dist/read-model.d.ts +8 -0
- package/node_modules/@murphai/query/dist/read-model.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/read-model.js +11 -1
- package/node_modules/@murphai/query/dist/read-model.js.map +1 -1
- package/node_modules/@murphai/query/dist/scheduled-logs.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/scheduled-logs.js +55 -79
- package/node_modules/@murphai/query/dist/scheduled-logs.js.map +1 -1
- package/node_modules/@murphai/query/dist/vault-source.d.ts +22 -4
- package/node_modules/@murphai/query/dist/vault-source.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/vault-source.js +188 -59
- package/node_modules/@murphai/query/dist/vault-source.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 +32 -15
- 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 +43 -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 +31 -4
- package/node_modules/@murphai/query/dist/wearables/source-health.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/types.d.ts +54 -4
- package/node_modules/@murphai/query/dist/wearables/types.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/types.js +36 -0
- package/node_modules/@murphai/query/dist/wearables/types.js.map +1 -1
- package/node_modules/@murphai/query/dist/wearables/workout-features.d.ts +5 -0
- package/node_modules/@murphai/query/dist/wearables/workout-features.d.ts.map +1 -0
- package/node_modules/@murphai/query/dist/wearables/workout-features.js +179 -0
- package/node_modules/@murphai/query/dist/wearables/workout-features.js.map +1 -0
- package/node_modules/@murphai/query/dist/wearables.d.ts.map +1 -1
- package/node_modules/@murphai/query/dist/wearables.js +74 -6
- package/node_modules/@murphai/query/dist/wearables.js.map +1 -1
- package/node_modules/@murphai/query/package.json +15 -0
- package/node_modules/@murphai/runtime-state/README.md +3 -3
- 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/assistant-runtime-issues.d.ts +4 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-runtime-issues.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/assistant-runtime-issues.js +16 -3
- package/node_modules/@murphai/runtime-state/dist/assistant-runtime-issues.js.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.d.ts +2 -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 +76 -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-email.d.ts +5 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.d.ts.map +1 -1
- package/node_modules/@murphai/runtime-state/dist/hosted-email.js +10 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.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/incur-error-bridge.d.ts.map +1 -1
- package/node_modules/@murphai/setup-cli/dist/incur-error-bridge.js +6 -15
- package/node_modules/@murphai/setup-cli/dist/incur-error-bridge.js.map +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/README.md +9 -0
- 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/commands/query-record-command-helpers.d.ts +6 -0
- package/node_modules/@murphai/vault-usecases/dist/commands/query-record-command-helpers.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/commands/query-record-command-helpers.js +49 -1
- package/node_modules/@murphai/vault-usecases/dist/commands/query-record-command-helpers.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 +23 -13
- 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 +2 -4
- 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 +25 -19
- 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 +2 -4
- 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 +9 -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 +78 -5
- package/node_modules/@murphai/vault-usecases/dist/usecases/event-record-mutations.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/exact-event-record.d.ts +20 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/exact-event-record.d.ts.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/exact-event-record.js +72 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/exact-event-record.js.map +1 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.d.ts +29 -6
- 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 +267 -46
- package/node_modules/@murphai/vault-usecases/dist/usecases/experiment-journal-vault.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/explicit-health-family-services.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/explicit-health-family-services.js +158 -24
- package/node_modules/@murphai/vault-usecases/dist/usecases/explicit-health-family-services.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 +98 -6
- 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 +97 -13
- package/node_modules/@murphai/vault-usecases/dist/usecases/integrated-services.js.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/intervention-experiment-link.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/intervention-experiment-link.js +49 -24
- package/node_modules/@murphai/vault-usecases/dist/usecases/intervention-experiment-link.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 +149 -14
- 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 +19 -12
- 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 +44 -2
- 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/shared.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/shared.js +1 -3
- package/node_modules/@murphai/vault-usecases/dist/usecases/shared.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/vault-usecase-helpers.d.ts +2 -0
- package/node_modules/@murphai/vault-usecases/dist/usecases/vault-usecase-helpers.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/vault-usecase-helpers.js +24 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/vault-usecase-helpers.js.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 +4 -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 +116 -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 +231 -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 +287 -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 +134 -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 +744 -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 +22 -19
- 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 +39 -2
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.d.ts.map +1 -1
- package/node_modules/@murphai/vault-usecases/dist/usecases/workout.js +144 -4
- 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/incur/dist/Cli.js +7 -32
- package/node_modules/incur/dist/Errors.d.ts +17 -0
- package/node_modules/incur/dist/Errors.js +23 -0
- package/node_modules/incur/dist/internal/command.d.ts +2 -0
- package/node_modules/incur/dist/internal/command.js +2 -6
- package/node_modules/incur/src/Cli.ts +11 -32
- package/node_modules/incur/src/Errors.ts +36 -0
- package/node_modules/incur/src/internal/command.ts +4 -6
- 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,5 +1,8 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { stat } from "node:fs/promises";
|
|
4
|
+
import { performance } from "node:perf_hooks";
|
|
5
|
+
import { auditRecordSchema, assertContractId, collectEventRawReferencePaths, compareIsoTimestampsAscending, deviceDataOriginSchema, experimentFrontmatterSchema, externalRefSchema, journalDayFrontmatterSchema, eventRecordSchema, eventImportDecisionSchema, isWritableIsoDateTime, resolveFloatingIsoTimestampInTimeZone, safeParseContract, sampleRecordSchema, } from "@murphai/contracts";
|
|
3
6
|
import { BASELINE_EVENT_KINDS, BASELINE_SAMPLE_STREAMS, EVENT_SCHEMA_VERSION, EVENT_SOURCES, FRONTMATTER_SCHEMA_VERSIONS, ID_PREFIXES, SAMPLE_QUALITIES, SAMPLE_SCHEMA_VERSION, SAMPLE_SOURCES, VAULT_LAYOUT, } from "./constants.js";
|
|
4
7
|
import { emitAuditRecord } from "./audit.js";
|
|
5
8
|
import { prepareEventAttachments, stagePreparedEventAttachmentsInBatch, } from "./event-attachments.js";
|
|
@@ -10,20 +13,22 @@ import { parseFrontmatterDocument, stringifyFrontmatterDocument } from "./frontm
|
|
|
10
13
|
import { deterministicContractId, generateRecordId } from "./ids.js";
|
|
11
14
|
import { readJsonlRecords, toMonthlyShardRelativePath, visitJsonlRecordsInterruptible, } from "./jsonl.js";
|
|
12
15
|
import { buildEventSpineLifecycle, collapseEventSpineEntries, compareEventSpineEntries, eventSpineRevision, isDeletedEventSpineRecord, selectLatestEventSpineEntry, } from "./history/event-spine.js";
|
|
13
|
-
import { buildPublicEventImportRecord, loadEventLedgerShardsById, selectLatestMatchedEvent, toEventLedgerFile, } from "./domains/events/ledger.js";
|
|
16
|
+
import { buildEventImportDecisionRecord, buildPublicEventImportRecord, loadEventLedgerShardsById, selectLatestMatchedEvent, toEventLedgerFile, } from "./domains/events/ledger.js";
|
|
14
17
|
import { normalizeMealNutrition, } from "./nutrition.js";
|
|
15
|
-
import { stageRawImportManifest } from "./operations/raw-manifests.js";
|
|
16
|
-
import { runCanonicalWrite } from "./operations/write-batch.js";
|
|
18
|
+
import { parseRawImportManifest, resolveRawManifestPath, stageRawImportManifest, } from "./operations/raw-manifests.js";
|
|
19
|
+
import { runCanonicalWrite, } from "./operations/write-batch.js";
|
|
17
20
|
import { assertCanonicalWriteLockScope } from "./operations/canonical-write-lock.js";
|
|
18
21
|
import { resolveVaultPath } from "./path-safety.js";
|
|
19
22
|
import { sanitizePathSegment } from "./path-safety.js";
|
|
20
|
-
import { prepareInlineRawArtifact, prepareRawArtifact, resolveRawAssetDirectory } from "./raw.js";
|
|
23
|
+
import { prepareInlineRawArtifact, prepareRawArtifact, rawDirectoryMatchesOwner, resolveRawAssetDirectory, } from "./raw.js";
|
|
21
24
|
import { buildIntegrationEvidencePart, buildIntegrationIngestAppendPlan, buildIntegrationIngestAppendPlanFromInspection, buildIntegrationIngestRecord, stageIntegrationIngestAppendPlan, compactIntegrationIngestReceipt, inspectIntegrationIngestIdsForImportedAt, selectNovelIntegrationIngestEvidence, } from "./integration-ingests.js";
|
|
22
25
|
import { normalizeUniqueTextList } from "./bank/shared.js";
|
|
23
26
|
import { defaultTimeZone, normalizeTimeZone, toIsoTimestamp, toLocalDayKey, } from "./time.js";
|
|
24
27
|
import { loadVault } from "./vault.js";
|
|
28
|
+
import { statAndHashVaultFile } from "./raw-artifact-integrity.js";
|
|
25
29
|
const DENSE_DEVICE_TELEMETRY_NOT_ALLOWED_CODE = "VAULT_DENSE_DEVICE_TELEMETRY_NOT_ALLOWED";
|
|
26
30
|
const DENSE_DEVICE_SAMPLES_NOT_ALLOWED_LEGACY_CODE = "VAULT_DENSE_DEVICE_SAMPLES_NOT_ALLOWED";
|
|
31
|
+
const MAX_JUNCTION_DAILY_ALIAS_REPAIR_REVISIONS = 64;
|
|
27
32
|
const RESERVED_DEVICE_EVENT_FIELD_NAMES = new Set([
|
|
28
33
|
"schemaVersion",
|
|
29
34
|
"id",
|
|
@@ -47,6 +52,9 @@ const RESERVED_DEVICE_EVENT_FIELD_NAMES = new Set([
|
|
|
47
52
|
"visibility",
|
|
48
53
|
]);
|
|
49
54
|
const MAX_DEVICE_PROVIDER_SAMPLE_ROWS_DEFAULT = 1_000;
|
|
55
|
+
// Junction menstrual resources admit 512 dated non-BBT facts plus the
|
|
56
|
+
// period-length and cycle-length scalar facets for the same resource version.
|
|
57
|
+
const MAX_DEVICE_AUTHORITATIVE_CURRENT_FACETS = 514;
|
|
50
58
|
const EVENT_KIND_SET = new Set(BASELINE_EVENT_KINDS);
|
|
51
59
|
const EVENT_SOURCE_SET = new Set(EVENT_SOURCES);
|
|
52
60
|
const SAMPLE_STREAM_SET = new Set(BASELINE_SAMPLE_STREAMS);
|
|
@@ -541,7 +549,8 @@ function normalizeDeviceEventInputs(eventInputs, context) {
|
|
|
541
549
|
const inputTimeZone = typeof eventInput.timeZone === "string" ? eventInput.timeZone : undefined;
|
|
542
550
|
const preservesProviderDayWithoutTimeZone = Boolean(inputDayKey &&
|
|
543
551
|
!inputTimeZone &&
|
|
544
|
-
(
|
|
552
|
+
(context.provider === "junction"
|
|
553
|
+
|| isJunctionSleepStageExternalRefInput(eventInput.externalRef)
|
|
545
554
|
|| isDateOnlyFloatingProviderDayInput(inputDayKey, eventInput.dataOrigin)));
|
|
546
555
|
const seed = buildNormalizedEventSeed({
|
|
547
556
|
kind,
|
|
@@ -656,7 +665,65 @@ function normalizeDeviceBatchObjectArray(input) {
|
|
|
656
665
|
}
|
|
657
666
|
return input.value.map((entry, index) => assertPlainObject(entry, input.itemCode, `${input.itemLabel} ${index + 1} must be a plain object.`));
|
|
658
667
|
}
|
|
659
|
-
function
|
|
668
|
+
function normalizeDeviceAuthoritativeEventSets(inputs, events) {
|
|
669
|
+
if (inputs.length > 128) {
|
|
670
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SETS", "Device batch authoritativeEventSets exceeds 128 resources.");
|
|
671
|
+
}
|
|
672
|
+
const sets = inputs.map((input, index) => {
|
|
673
|
+
const parsedRef = safeParseContract(externalRefSchema, {
|
|
674
|
+
system: input.system,
|
|
675
|
+
resourceType: input.resourceType,
|
|
676
|
+
resourceId: input.resourceId,
|
|
677
|
+
version: input.version,
|
|
678
|
+
});
|
|
679
|
+
if (!parsedRef.success || !parsedRef.data.version || !isWritableIsoDateTime(parsedRef.data.version)) {
|
|
680
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SET", `Device authoritative event set ${index + 1} requires a valid versioned externalRef identity.`);
|
|
681
|
+
}
|
|
682
|
+
const facetPrefixes = normalizeUniqueTextList(input.facetPrefixes, `authoritativeEventSets[${index}].facetPrefixes`, 32, 200);
|
|
683
|
+
const currentFacets = normalizeUniqueTextList(input.currentFacets, `authoritativeEventSets[${index}].currentFacets`, MAX_DEVICE_AUTHORITATIVE_CURRENT_FACETS, 200) ?? [];
|
|
684
|
+
if (!facetPrefixes || facetPrefixes.length === 0) {
|
|
685
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SET", `Device authoritative event set ${index + 1} requires at least one facet prefix.`);
|
|
686
|
+
}
|
|
687
|
+
const ownsFacet = (facet) => facetPrefixes.some((prefix) => facet === prefix || facet.startsWith(`${prefix}-`));
|
|
688
|
+
if (currentFacets.some((facet) => !ownsFacet(facet))) {
|
|
689
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SET", `Device authoritative event set ${index + 1} contains a current facet outside its owned prefixes.`);
|
|
690
|
+
}
|
|
691
|
+
return {
|
|
692
|
+
system: parsedRef.data.system,
|
|
693
|
+
resourceType: parsedRef.data.resourceType,
|
|
694
|
+
resourceId: parsedRef.data.resourceId,
|
|
695
|
+
version: parsedRef.data.version,
|
|
696
|
+
facetPrefixes: [...facetPrefixes].sort(),
|
|
697
|
+
currentFacets: new Set(currentFacets),
|
|
698
|
+
};
|
|
699
|
+
});
|
|
700
|
+
const identityKeys = sets.map((set) => stableStringify({
|
|
701
|
+
system: set.system,
|
|
702
|
+
resourceType: set.resourceType,
|
|
703
|
+
resourceId: set.resourceId,
|
|
704
|
+
}));
|
|
705
|
+
if (new Set(identityKeys).size !== identityKeys.length) {
|
|
706
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SETS", "Device batch authoritativeEventSets contains duplicate resource identities.");
|
|
707
|
+
}
|
|
708
|
+
for (const set of sets) {
|
|
709
|
+
for (const facet of set.currentFacets) {
|
|
710
|
+
// Unversioned members follow complete-set reconciliation: the set's
|
|
711
|
+
// version orders only retraction tombstones, while member events collapse
|
|
712
|
+
// by semantic content and reassert through the serialized set seam.
|
|
713
|
+
const hasCurrentEvent = events.some(({ seed }) => seed.externalRef?.system === set.system
|
|
714
|
+
&& seed.externalRef.resourceType === set.resourceType
|
|
715
|
+
&& seed.externalRef.resourceId === set.resourceId
|
|
716
|
+
&& (seed.externalRef.version === set.version
|
|
717
|
+
|| seed.externalRef.version === undefined)
|
|
718
|
+
&& seed.externalRef.facet === facet);
|
|
719
|
+
if (!hasCurrentEvent) {
|
|
720
|
+
throw new VaultError("VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SET", `Device authoritative event set current facet "${facet}" has no matching current event.`);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return sets;
|
|
725
|
+
}
|
|
726
|
+
function normalizeDeviceBatchInputs({ provider, accountId, importedAt = new Date(), defaultTimeZone: fallbackTimeZone, source = "device", events = [], samples = [], evidenceParts = [], authoritativeEventSets = [], ingestReceipt, provenance, }) {
|
|
660
727
|
const normalizedProvider = sanitizePathSegment(provider, "provider");
|
|
661
728
|
const normalizedAccountId = typeof accountId === "string" && accountId.trim() ? accountId.trim() : undefined;
|
|
662
729
|
const normalizedImportedAt = toIsoTimestamp(importedAt, "importedAt");
|
|
@@ -686,12 +753,26 @@ function normalizeDeviceBatchInputs({ provider, accountId, importedAt = new Date
|
|
|
686
753
|
itemCode: "VAULT_INVALID_RAW_ARTIFACT",
|
|
687
754
|
itemLabel: "Device raw artifact",
|
|
688
755
|
});
|
|
756
|
+
const authoritativeEventSetInputs = normalizeDeviceBatchObjectArray({
|
|
757
|
+
value: authoritativeEventSets,
|
|
758
|
+
code: "VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SETS",
|
|
759
|
+
message: "Device batch authoritativeEventSets must be an array when provided.",
|
|
760
|
+
itemCode: "VAULT_INVALID_DEVICE_AUTHORITATIVE_EVENT_SET",
|
|
761
|
+
itemLabel: "Device authoritative event set",
|
|
762
|
+
});
|
|
689
763
|
if (eventInputs.length === 0
|
|
690
764
|
&& sampleInputs.length === 0
|
|
691
765
|
&& evidencePartInputs.length === 0
|
|
692
766
|
&& !normalizedIngestReceipt) {
|
|
693
767
|
throw new VaultError("VAULT_INVALID_DEVICE_BATCH", "importDeviceBatch requires at least one event, sample, evidence part, or ingest receipt.");
|
|
694
768
|
}
|
|
769
|
+
const normalizedEvents = normalizeDeviceEventInputs(eventInputs, {
|
|
770
|
+
provider: normalizedProvider,
|
|
771
|
+
accountId: normalizedAccountId,
|
|
772
|
+
importedAt: normalizedImportedAt,
|
|
773
|
+
source: normalizedSource,
|
|
774
|
+
defaultTimeZone,
|
|
775
|
+
});
|
|
695
776
|
return {
|
|
696
777
|
provider: normalizedProvider,
|
|
697
778
|
accountId: normalizedAccountId,
|
|
@@ -701,13 +782,7 @@ function normalizeDeviceBatchInputs({ provider, accountId, importedAt = new Date
|
|
|
701
782
|
provenance: normalizedProvenance,
|
|
702
783
|
ingestReceipt: normalizedIngestReceipt,
|
|
703
784
|
legacyIngestReceipt,
|
|
704
|
-
events:
|
|
705
|
-
provider: normalizedProvider,
|
|
706
|
-
accountId: normalizedAccountId,
|
|
707
|
-
importedAt: normalizedImportedAt,
|
|
708
|
-
source: normalizedSource,
|
|
709
|
-
defaultTimeZone,
|
|
710
|
-
}),
|
|
785
|
+
events: normalizedEvents,
|
|
711
786
|
samples: normalizeDeviceSampleInputs(sampleInputs, {
|
|
712
787
|
provider: normalizedProvider,
|
|
713
788
|
accountId: normalizedAccountId,
|
|
@@ -715,6 +790,7 @@ function normalizeDeviceBatchInputs({ provider, accountId, importedAt = new Date
|
|
|
715
790
|
defaultTimeZone,
|
|
716
791
|
}),
|
|
717
792
|
evidenceParts: normalizeDeviceEvidencePartInputs(evidencePartInputs, normalizedProvider),
|
|
793
|
+
authoritativeEventSets: normalizeDeviceAuthoritativeEventSets(authoritativeEventSetInputs, normalizedEvents),
|
|
718
794
|
};
|
|
719
795
|
}
|
|
720
796
|
function prepareDeviceEvidenceParts(evidenceParts) {
|
|
@@ -785,12 +861,119 @@ function compareIncomingExternalRefVersion(existing, incoming) {
|
|
|
785
861
|
}
|
|
786
862
|
return compareIsoTimestampsAscending(incomingVersion, existingVersion);
|
|
787
863
|
}
|
|
864
|
+
const JUNCTION_SPARSE_INTERVAL_RESOURCE_TYPE_SUFFIXES = [
|
|
865
|
+
"-caffeine",
|
|
866
|
+
"-mindfulness-minutes",
|
|
867
|
+
"-water",
|
|
868
|
+
];
|
|
869
|
+
const MAX_JUNCTION_SPARSE_AFFECTED_DAY_KEYS = 64;
|
|
870
|
+
function isJunctionSparseIntervalExternalRef(externalRef) {
|
|
871
|
+
return externalRef.system === "junction"
|
|
872
|
+
&& externalRef.facet === "interval"
|
|
873
|
+
&& JUNCTION_SPARSE_INTERVAL_RESOURCE_TYPE_SUFFIXES.some((suffix) => externalRef.resourceType.endsWith(suffix));
|
|
874
|
+
}
|
|
875
|
+
function junctionSparseAffectedCalendarTargets(events, index) {
|
|
876
|
+
const targets = new Map();
|
|
877
|
+
for (const event of events) {
|
|
878
|
+
if (!event.externalRef || !isJunctionSparseIntervalExternalRef(event.externalRef)) {
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
const sourceProviderSlug = event.dataOrigin?.sourceProviderSlug;
|
|
882
|
+
const externalRefSourceProviderSlug = JUNCTION_SPARSE_INTERVAL_RESOURCE_TYPE_SUFFIXES
|
|
883
|
+
.find((suffix) => event.externalRef?.resourceType.endsWith(suffix));
|
|
884
|
+
const resolvedSourceProviderSlug = sourceProviderSlug ?? (externalRefSourceProviderSlug
|
|
885
|
+
? event.externalRef.resourceType.slice("junction-".length, -externalRefSourceProviderSlug.length)
|
|
886
|
+
: "");
|
|
887
|
+
if (!resolvedSourceProviderSlug) {
|
|
888
|
+
continue;
|
|
889
|
+
}
|
|
890
|
+
const addTarget = (dayKey) => {
|
|
891
|
+
const target = {
|
|
892
|
+
dayKey,
|
|
893
|
+
sourceProviderSlug: resolvedSourceProviderSlug,
|
|
894
|
+
...(event.dataOrigin?.sourceInstanceId === undefined
|
|
895
|
+
? {}
|
|
896
|
+
: { sourceInstanceId: event.dataOrigin.sourceInstanceId }),
|
|
897
|
+
...(event.dataOrigin?.sourceType
|
|
898
|
+
? { sourceType: event.dataOrigin.sourceType }
|
|
899
|
+
: {}),
|
|
900
|
+
};
|
|
901
|
+
targets.set(stableStringify(target), target);
|
|
902
|
+
};
|
|
903
|
+
addTarget(event.dayKey);
|
|
904
|
+
// Include the immediately displaced provider day so the caller can persist
|
|
905
|
+
// one calendar-refresh job for each side of this accepted transition.
|
|
906
|
+
const previousRevision = eventSpineRevision(event) - 1;
|
|
907
|
+
if (previousRevision < 1) {
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
const dayHistory = index.junctionSparseDayHistoryById.get(event.id);
|
|
911
|
+
const previousDayKey = dayHistory?.latest.revision === previousRevision
|
|
912
|
+
? dayHistory.latest.dayKey
|
|
913
|
+
: dayHistory?.previous?.revision === previousRevision
|
|
914
|
+
? dayHistory.previous.dayKey
|
|
915
|
+
: undefined;
|
|
916
|
+
if (previousDayKey) {
|
|
917
|
+
addTarget(previousDayKey);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
const affectedTargets = [...targets.values()].sort((left, right) => left.dayKey.localeCompare(right.dayKey)
|
|
921
|
+
|| left.sourceProviderSlug.localeCompare(right.sourceProviderSlug)
|
|
922
|
+
|| (left.sourceType ?? "").localeCompare(right.sourceType ?? "")
|
|
923
|
+
|| (left.sourceInstanceId ?? "").localeCompare(right.sourceInstanceId ?? ""));
|
|
924
|
+
const affectedDayKeys = new Set(affectedTargets.map((target) => target.dayKey));
|
|
925
|
+
if (affectedDayKeys.size > MAX_JUNCTION_SPARSE_AFFECTED_DAY_KEYS
|
|
926
|
+
|| affectedTargets.length > MAX_JUNCTION_SPARSE_AFFECTED_DAY_KEYS) {
|
|
927
|
+
throw new VaultError("DEVICE_IMPORT_AFFECTED_DAY_LIMIT_EXCEEDED", "Junction sparse import exceeded the affected provider-day limit; nothing was imported.", {
|
|
928
|
+
affectedDayCount: affectedDayKeys.size,
|
|
929
|
+
affectedTargetCount: affectedTargets.length,
|
|
930
|
+
maxAllowed: MAX_JUNCTION_SPARSE_AFFECTED_DAY_KEYS,
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
return affectedTargets;
|
|
934
|
+
}
|
|
935
|
+
function junctionSparseAffectedDayKeys(targets) {
|
|
936
|
+
return [...new Set(targets.map((target) => target.dayKey))].sort();
|
|
937
|
+
}
|
|
788
938
|
// Device-sync content equality ignores per-import identity (id, lifecycle,
|
|
789
939
|
// recordedAt) AND rawRefs, because device imports mint fresh raw-artifact
|
|
790
|
-
// paths on every sync run.
|
|
791
|
-
|
|
940
|
+
// paths on every sync run. Member-edit comparison additionally excludes the
|
|
941
|
+
// immutable provider attribution fields while retaining every public edit.
|
|
942
|
+
function eventContentKey(record, options) {
|
|
792
943
|
const { id: _id, rawRefs: _rawRefs, lifecycle: _lifecycle, recordedAt: _recordedAt, ...content } = record;
|
|
793
|
-
|
|
944
|
+
if (options.includeProviderAttribution) {
|
|
945
|
+
return stableStringify(content);
|
|
946
|
+
}
|
|
947
|
+
const { dataOrigin: _dataOrigin, externalRef: _externalRef, ...memberMutableContent } = content;
|
|
948
|
+
return stableStringify(memberMutableContent);
|
|
949
|
+
}
|
|
950
|
+
function deviceEventContentKey(record) {
|
|
951
|
+
const { id: _id, rawRefs: _rawRefs, lifecycle: _lifecycle, recordedAt: _recordedAt, externalRef, dataOrigin, ...semanticContent } = record;
|
|
952
|
+
return stableStringify({
|
|
953
|
+
...semanticContent,
|
|
954
|
+
// Identity and source ordering are enforced independently. Keeping them
|
|
955
|
+
// out of semantic equality prevents a newer provider capture/version from
|
|
956
|
+
// masquerading as a health-data change over a member-authored revision.
|
|
957
|
+
externalRef: externalRef
|
|
958
|
+
? {
|
|
959
|
+
system: externalRef.system,
|
|
960
|
+
resourceType: externalRef.resourceType,
|
|
961
|
+
resourceId: externalRef.resourceId,
|
|
962
|
+
facet: externalRef.facet ?? null,
|
|
963
|
+
}
|
|
964
|
+
: null,
|
|
965
|
+
dataOrigin: dataOrigin
|
|
966
|
+
? {
|
|
967
|
+
// This is the fixed data-origin schema discriminator, not the
|
|
968
|
+
// provider resource version used for ordering.
|
|
969
|
+
version: dataOrigin.version,
|
|
970
|
+
aggregatorProvider: dataOrigin.aggregatorProvider ?? null,
|
|
971
|
+
sourceProviderSlug: dataOrigin.sourceProviderSlug ?? null,
|
|
972
|
+
sourceType: dataOrigin.sourceType ?? null,
|
|
973
|
+
sourceInstanceId: dataOrigin.sourceInstanceId ?? null,
|
|
974
|
+
}
|
|
975
|
+
: null,
|
|
976
|
+
});
|
|
794
977
|
}
|
|
795
978
|
function deviceEventContentFingerprint(record) {
|
|
796
979
|
return createHash("sha256").update(deviceEventContentKey(record)).digest("hex");
|
|
@@ -872,7 +1055,11 @@ function orderEventImportDecisionsBySourceVersion(decisions) {
|
|
|
872
1055
|
return ordered;
|
|
873
1056
|
}
|
|
874
1057
|
async function indexLatestEventsByExternalRef(vaultRoot, relativePaths, signal) {
|
|
1058
|
+
const aliasRepairContaminatedEventIds = new Set();
|
|
1059
|
+
const aliasRepairContaminatedRefKeys = new Set();
|
|
875
1060
|
const deviceOwnerRevisionsByRefKeyAndFingerprint = new Map();
|
|
1061
|
+
const junctionSparseDayHistoryById = new Map();
|
|
1062
|
+
const liveOwnerIdsByRefKey = new Map();
|
|
876
1063
|
const latestByRefKey = new Map();
|
|
877
1064
|
const latestById = new Map();
|
|
878
1065
|
const maxRevisionById = new Map();
|
|
@@ -892,13 +1079,41 @@ async function indexLatestEventsByExternalRef(vaultRoot, relativePaths, signal)
|
|
|
892
1079
|
signal?.throwIfAborted();
|
|
893
1080
|
const parsed = safeParseContract(eventRecordSchema, raw);
|
|
894
1081
|
if (!parsed.success) {
|
|
1082
|
+
if (isLooseRecordValue(raw)) {
|
|
1083
|
+
if (typeof raw.id === "string" && raw.id.length > 0) {
|
|
1084
|
+
aliasRepairContaminatedEventIds.add(raw.id);
|
|
1085
|
+
}
|
|
1086
|
+
const rejectedRefKey = readRejectedEventExternalRefKey(raw.externalRef);
|
|
1087
|
+
if (rejectedRefKey) {
|
|
1088
|
+
aliasRepairContaminatedRefKeys.add(rejectedRefKey);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
895
1091
|
return;
|
|
896
1092
|
}
|
|
897
1093
|
const entry = { relativePath, record: parsed.data };
|
|
898
1094
|
maxRevisionById.set(entry.record.id, Math.max(maxRevisionById.get(entry.record.id) ?? 0, eventSpineRevision(entry.record)));
|
|
899
1095
|
const revisions = revisionsById.get(entry.record.id) ?? new Set();
|
|
900
|
-
|
|
1096
|
+
const revision = eventSpineRevision(entry.record);
|
|
1097
|
+
revisions.add(revision);
|
|
901
1098
|
revisionsById.set(entry.record.id, revisions);
|
|
1099
|
+
if (entry.record.externalRef
|
|
1100
|
+
&& isJunctionSparseIntervalExternalRef(entry.record.externalRef)) {
|
|
1101
|
+
const candidate = { dayKey: entry.record.dayKey, revision };
|
|
1102
|
+
const history = junctionSparseDayHistoryById.get(entry.record.id);
|
|
1103
|
+
if (!history || revision > history.latest.revision) {
|
|
1104
|
+
junctionSparseDayHistoryById.set(entry.record.id, {
|
|
1105
|
+
latest: candidate,
|
|
1106
|
+
...(history ? { previous: history.latest } : {}),
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
else if (revision < history.latest.revision
|
|
1110
|
+
&& (!history.previous || revision > history.previous.revision)) {
|
|
1111
|
+
junctionSparseDayHistoryById.set(entry.record.id, {
|
|
1112
|
+
latest: history.latest,
|
|
1113
|
+
previous: candidate,
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
902
1117
|
const state = entriesById.get(entry.record.id);
|
|
903
1118
|
const latestDeviceExternalRefEntryByRefKey = state?.latestDeviceExternalRefEntryByRefKey ?? new Map();
|
|
904
1119
|
if (entry.record.source === "device" && entry.record.externalRef) {
|
|
@@ -949,13 +1164,19 @@ async function indexLatestEventsByExternalRef(vaultRoot, relativePaths, signal)
|
|
|
949
1164
|
const refKey = eventExternalRefKey(externalRefEntry.record.externalRef);
|
|
950
1165
|
const indexedExternalRefEntry = state.latestDeviceExternalRefEntryByRefKey.get(refKey) ?? externalRefEntry;
|
|
951
1166
|
const refGroup = groupedByRefKey.get(refKey) ?? [];
|
|
952
|
-
|
|
1167
|
+
const indexedMatch = {
|
|
953
1168
|
indexedExternalRef: indexedExternalRefEntry.record.externalRef ?? externalRefEntry.record.externalRef,
|
|
954
1169
|
indexedRecord: indexedExternalRefEntry.record,
|
|
955
1170
|
relativePath: latestForId.relativePath,
|
|
956
1171
|
record: latestForId.record,
|
|
957
|
-
}
|
|
1172
|
+
};
|
|
1173
|
+
refGroup.push(indexedMatch);
|
|
958
1174
|
groupedByRefKey.set(refKey, refGroup);
|
|
1175
|
+
if (!isDeletedEventSpineRecord(latestForId.record)) {
|
|
1176
|
+
const liveOwnerIds = liveOwnerIdsByRefKey.get(refKey) ?? new Set();
|
|
1177
|
+
liveOwnerIds.add(latestForId.record.id);
|
|
1178
|
+
liveOwnerIdsByRefKey.set(refKey, liveOwnerIds);
|
|
1179
|
+
}
|
|
959
1180
|
}
|
|
960
1181
|
for (const [refKey, group] of groupedByRefKey) {
|
|
961
1182
|
signal?.throwIfAborted();
|
|
@@ -966,14 +1187,45 @@ async function indexLatestEventsByExternalRef(vaultRoot, relativePaths, signal)
|
|
|
966
1187
|
latestByRefKey.set(refKey, latest);
|
|
967
1188
|
}
|
|
968
1189
|
}
|
|
1190
|
+
const junctionNoIdProfilePredecessorsByScope = indexJunctionNoIdProfilePredecessors(latestByRefKey.values());
|
|
969
1191
|
return {
|
|
1192
|
+
aliasRepairContaminatedEventIds,
|
|
1193
|
+
aliasRepairContaminatedRefKeys,
|
|
1194
|
+
aliasRepairHistoryById: new Map(),
|
|
970
1195
|
deviceOwnerRevisionsByRefKeyAndFingerprint,
|
|
1196
|
+
junctionNoIdProfilePredecessorsByScope,
|
|
1197
|
+
junctionSparseDayHistoryById,
|
|
971
1198
|
latestByRefKey,
|
|
972
1199
|
latestById,
|
|
1200
|
+
liveOwnerIdsByRefKey,
|
|
973
1201
|
maxRevisionById,
|
|
974
1202
|
revisionsById,
|
|
975
1203
|
};
|
|
976
1204
|
}
|
|
1205
|
+
async function loadBoundedAliasRepairHistories(vaultRoot, relativePaths, eventIds) {
|
|
1206
|
+
const histories = new Map();
|
|
1207
|
+
for (const relativePath of relativePaths) {
|
|
1208
|
+
await visitJsonlRecordsInterruptible({
|
|
1209
|
+
vaultRoot,
|
|
1210
|
+
relativePath,
|
|
1211
|
+
visit(raw) {
|
|
1212
|
+
const parsed = safeParseContract(eventRecordSchema, raw);
|
|
1213
|
+
if (!parsed.success || !eventIds.has(parsed.data.id)) {
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
const history = histories.get(parsed.data.id) ?? [];
|
|
1217
|
+
if (history.length <= MAX_JUNCTION_DAILY_ALIAS_REPAIR_REVISIONS) {
|
|
1218
|
+
history.push({ relativePath, record: parsed.data });
|
|
1219
|
+
histories.set(parsed.data.id, history);
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
for (const history of histories.values()) {
|
|
1225
|
+
history.sort((left, right) => eventSpineRevision(left.record) - eventSpineRevision(right.record));
|
|
1226
|
+
}
|
|
1227
|
+
return histories;
|
|
1228
|
+
}
|
|
977
1229
|
function isSameObservationFacet(existing, incoming) {
|
|
978
1230
|
return existing.kind === "observation" &&
|
|
979
1231
|
incoming.kind === "observation" &&
|
|
@@ -995,6 +1247,8 @@ const JUNCTION_SLEEP_STAGE_METRIC_FACETS = new Set([
|
|
|
995
1247
|
]);
|
|
996
1248
|
const JUNCTION_SLEEP_STAGE_SUMMARY_NORMALIZER_VERSION = "junction-sleep-stage-summary.v1";
|
|
997
1249
|
const JUNCTION_SLEEP_STAGE_CYCLE_FALLBACK_NORMALIZER_VERSION = "junction-sleep-stage-cycle-fallback.v1";
|
|
1250
|
+
const JUNCTION_NO_ID_PROFILE_NORMALIZER_VERSION = "junction-no-id-profile.v1";
|
|
1251
|
+
const JUNCTION_STABLE_PROFILE_CREATED_AT_NORMALIZER_VERSION = "junction-stable-profile-created-at.v1";
|
|
998
1252
|
function deviceDataOriginSourceMatches(existing, incoming) {
|
|
999
1253
|
if (!existing || !incoming) {
|
|
1000
1254
|
return false;
|
|
@@ -1013,6 +1267,193 @@ function deviceDataOriginSourceMatches(existing, incoming) {
|
|
|
1013
1267
|
}
|
|
1014
1268
|
return compared;
|
|
1015
1269
|
}
|
|
1270
|
+
function junctionNoIdProfileScopeKey(externalRef, origin) {
|
|
1271
|
+
if (externalRef?.system !== "junction"
|
|
1272
|
+
|| !externalRef.resourceType.endsWith("-profile")
|
|
1273
|
+
|| typeof externalRef.facet !== "string"
|
|
1274
|
+
|| !/^profile-[a-f0-9]{16}$/u.test(externalRef.resourceId)
|
|
1275
|
+
|| origin?.sourceProviderSlug === undefined) {
|
|
1276
|
+
return null;
|
|
1277
|
+
}
|
|
1278
|
+
return stableStringify({
|
|
1279
|
+
resourceType: externalRef.resourceType,
|
|
1280
|
+
facet: externalRef.facet,
|
|
1281
|
+
aggregatorProvider: origin.aggregatorProvider,
|
|
1282
|
+
sourceProviderSlug: origin.sourceProviderSlug,
|
|
1283
|
+
sourceType: origin.sourceType,
|
|
1284
|
+
sourceInstanceId: origin.sourceInstanceId,
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
function junctionNoIdProfileResourceId(origin, occurredAt) {
|
|
1288
|
+
return `profile-${createHash("sha256")
|
|
1289
|
+
.update(JSON.stringify([
|
|
1290
|
+
"profile",
|
|
1291
|
+
origin.sourceProviderSlug,
|
|
1292
|
+
origin.sourceType,
|
|
1293
|
+
origin.sourceInstanceId,
|
|
1294
|
+
occurredAt,
|
|
1295
|
+
]))
|
|
1296
|
+
.digest("hex")
|
|
1297
|
+
.slice(0, 16)}`;
|
|
1298
|
+
}
|
|
1299
|
+
function junctionNoIdProfileProviderBaselineRevision(match) {
|
|
1300
|
+
const externalRef = match.indexedExternalRef;
|
|
1301
|
+
const providerRecord = match.indexedRecord;
|
|
1302
|
+
const origin = providerRecord.dataOrigin;
|
|
1303
|
+
const isCurrentNoIdProfile = origin?.normalizerVersion
|
|
1304
|
+
=== JUNCTION_NO_ID_PROFILE_NORMALIZER_VERSION;
|
|
1305
|
+
const isLegacyNoIdProfile = origin?.normalizerVersion === "junction-normalizer.v1";
|
|
1306
|
+
const persistedRevision = isCurrentNoIdProfile
|
|
1307
|
+
? externalRef.version
|
|
1308
|
+
: externalRef.version ?? providerRecord.occurredAt;
|
|
1309
|
+
if ((!isCurrentNoIdProfile && !isLegacyNoIdProfile)
|
|
1310
|
+
|| !junctionNoIdProfileScopeKey(externalRef, origin)
|
|
1311
|
+
|| persistedRevision === undefined
|
|
1312
|
+
|| !isWritableIsoDateTime(persistedRevision)
|
|
1313
|
+
|| !isWritableIsoDateTime(providerRecord.occurredAt)
|
|
1314
|
+
|| origin?.observedAtRaw !== providerRecord.occurredAt
|
|
1315
|
+
|| (isLegacyNoIdProfile && providerRecord.occurredAt !== persistedRevision)) {
|
|
1316
|
+
return null;
|
|
1317
|
+
}
|
|
1318
|
+
const expectedResourceId = junctionNoIdProfileResourceId(origin, providerRecord.occurredAt);
|
|
1319
|
+
return externalRef.resourceId === expectedResourceId ? persistedRevision : null;
|
|
1320
|
+
}
|
|
1321
|
+
function junctionNoIdProfilePredecessorRevision(match) {
|
|
1322
|
+
return isDeletedEventSpineRecord(match.record)
|
|
1323
|
+
? null
|
|
1324
|
+
: junctionNoIdProfileProviderBaselineRevision(match);
|
|
1325
|
+
}
|
|
1326
|
+
function isJunctionNoIdProfilePredecessor(match) {
|
|
1327
|
+
return junctionNoIdProfileProviderBaselineRevision(match) !== null;
|
|
1328
|
+
}
|
|
1329
|
+
function indexJunctionNoIdProfilePredecessors(matches) {
|
|
1330
|
+
const byScope = new Map();
|
|
1331
|
+
for (const match of matches) {
|
|
1332
|
+
if (!isJunctionNoIdProfilePredecessor(match)) {
|
|
1333
|
+
continue;
|
|
1334
|
+
}
|
|
1335
|
+
const scopeKey = junctionNoIdProfileScopeKey(match.indexedExternalRef, match.indexedRecord.dataOrigin);
|
|
1336
|
+
if (!scopeKey) {
|
|
1337
|
+
continue;
|
|
1338
|
+
}
|
|
1339
|
+
const scopedMatches = byScope.get(scopeKey) ?? [];
|
|
1340
|
+
scopedMatches.push(match);
|
|
1341
|
+
byScope.set(scopeKey, scopedMatches);
|
|
1342
|
+
}
|
|
1343
|
+
return byScope;
|
|
1344
|
+
}
|
|
1345
|
+
function isIncomingJunctionNoIdProfile(record) {
|
|
1346
|
+
return record.dataOrigin?.normalizerVersion === JUNCTION_NO_ID_PROFILE_NORMALIZER_VERSION
|
|
1347
|
+
&& junctionNoIdProfileScopeKey(record.externalRef, record.dataOrigin) !== null;
|
|
1348
|
+
}
|
|
1349
|
+
function isIncomingJunctionStableProfileCreatedAt(record) {
|
|
1350
|
+
return record.dataOrigin?.normalizerVersion === JUNCTION_STABLE_PROFILE_CREATED_AT_NORMALIZER_VERSION
|
|
1351
|
+
&& junctionNoIdProfileScopeKey(record.externalRef, record.dataOrigin) !== null;
|
|
1352
|
+
}
|
|
1353
|
+
function isExactJunctionProfileCreatedAtTimestampReplay(existing, incoming) {
|
|
1354
|
+
const existingRef = existing.externalRef;
|
|
1355
|
+
const incomingRef = incoming.externalRef;
|
|
1356
|
+
const existingOrigin = existing.dataOrigin;
|
|
1357
|
+
const incomingOrigin = incoming.dataOrigin;
|
|
1358
|
+
const existingRevision = existingRef?.version ?? existing.occurredAt;
|
|
1359
|
+
const existingScopeKey = junctionNoIdProfileScopeKey(existingRef, existingOrigin);
|
|
1360
|
+
const incomingScopeKey = junctionNoIdProfileScopeKey(incomingRef, incomingOrigin);
|
|
1361
|
+
if (!existingOrigin
|
|
1362
|
+
|| !incomingOrigin
|
|
1363
|
+
|| existingScopeKey === null
|
|
1364
|
+
|| existingScopeKey !== incomingScopeKey
|
|
1365
|
+
|| !existingRef
|
|
1366
|
+
|| !incomingRef?.version
|
|
1367
|
+
|| !isWritableIsoDateTime(existingRevision)
|
|
1368
|
+
|| !isWritableIsoDateTime(incomingRef.version)
|
|
1369
|
+
|| !isWritableIsoDateTime(existing.occurredAt)
|
|
1370
|
+
|| !isWritableIsoDateTime(existing.recordedAt)
|
|
1371
|
+
|| !isWritableIsoDateTime(incoming.occurredAt)
|
|
1372
|
+
|| !isWritableIsoDateTime(incoming.recordedAt)
|
|
1373
|
+
|| compareIsoTimestampsAscending(incomingRef.version, existingRevision) !== 0
|
|
1374
|
+
|| (!isDeletedEventSpineRecord(existing)
|
|
1375
|
+
&& compareIsoTimestampsAscending(existing.recordedAt, existing.occurredAt) !== 0)
|
|
1376
|
+
|| (isDeletedEventSpineRecord(existing)
|
|
1377
|
+
&& compareIsoTimestampsAscending(existing.recordedAt, existing.occurredAt) < 0)
|
|
1378
|
+
|| existing.dayKey !== toIsoTimestamp(existing.occurredAt, "existing.occurredAt").slice(0, 10)
|
|
1379
|
+
|| compareIsoTimestampsAscending(incoming.occurredAt, existing.occurredAt) >= 0
|
|
1380
|
+
|| compareIsoTimestampsAscending(incoming.recordedAt, incoming.occurredAt) !== 0
|
|
1381
|
+
|| incoming.dayKey !== toIsoTimestamp(incoming.occurredAt, "incoming.occurredAt").slice(0, 10)
|
|
1382
|
+
|| existingOrigin.observedAtRaw !== existing.occurredAt
|
|
1383
|
+
|| incomingOrigin.observedAtRaw !== incoming.occurredAt
|
|
1384
|
+
|| !deviceDataOriginSourceMatches(existingOrigin, incomingOrigin)
|
|
1385
|
+
|| existingOrigin.timeZoneOffsetMinutes !== incomingOrigin.timeZoneOffsetMinutes
|
|
1386
|
+
|| existingOrigin.timestampSemantics !== incomingOrigin.timestampSemantics
|
|
1387
|
+
|| existingOrigin.originConfidence !== incomingOrigin.originConfidence) {
|
|
1388
|
+
return false;
|
|
1389
|
+
}
|
|
1390
|
+
return deviceEventContentKey({
|
|
1391
|
+
...existing,
|
|
1392
|
+
occurredAt: incoming.occurredAt,
|
|
1393
|
+
recordedAt: incoming.recordedAt,
|
|
1394
|
+
dayKey: incoming.dayKey,
|
|
1395
|
+
externalRef: incomingRef,
|
|
1396
|
+
dataOrigin: incomingOrigin,
|
|
1397
|
+
}) === deviceEventContentKey(incoming);
|
|
1398
|
+
}
|
|
1399
|
+
// One released Junction normalizer pinned stable-profile occurrence to the
|
|
1400
|
+
// mutable updated-at revision. The successor pins occurrence to created-at but
|
|
1401
|
+
// deliberately keeps updated-at as source ordering. Admit only that exact,
|
|
1402
|
+
// one-way timestamp-only replay so the generic equal-revision guard remains
|
|
1403
|
+
// fail-closed for health-data changes.
|
|
1404
|
+
function isJunctionStableProfileCreatedAtTimestampMigration(existing, incoming) {
|
|
1405
|
+
const existingRef = existing.externalRef;
|
|
1406
|
+
const incomingRef = incoming.externalRef;
|
|
1407
|
+
return isIncomingJunctionStableProfileCreatedAt(incoming)
|
|
1408
|
+
&& existing.dataOrigin?.normalizerVersion === "junction-normalizer.v1"
|
|
1409
|
+
&& existingRef?.version !== undefined
|
|
1410
|
+
&& incomingRef !== undefined
|
|
1411
|
+
&& eventExternalRefKey(existingRef) === eventExternalRefKey(incomingRef)
|
|
1412
|
+
&& isExactJunctionProfileCreatedAtTimestampReplay(existing, incoming);
|
|
1413
|
+
}
|
|
1414
|
+
// Revision-2 admission is account-wide, so a released no-ID profile can be
|
|
1415
|
+
// replayed after created_at becomes available while updated_at (the provider
|
|
1416
|
+
// revision) is unchanged. Its timestamp-derived resource identity changes,
|
|
1417
|
+
// but the replay must not split a member edit or bypass a deletion. Retain the
|
|
1418
|
+
// old identity only for this exact timestamp-only transition; changed health
|
|
1419
|
+
// data at the same source revision remains a conflict.
|
|
1420
|
+
function isJunctionNoIdProfileEqualRevisionTimestampReplay(existing, incoming) {
|
|
1421
|
+
const existingRef = existing.externalRef;
|
|
1422
|
+
const incomingRef = incoming.externalRef;
|
|
1423
|
+
const existingOrigin = existing.dataOrigin;
|
|
1424
|
+
const incomingOrigin = incoming.dataOrigin;
|
|
1425
|
+
if (!isIncomingJunctionNoIdProfile(incoming)
|
|
1426
|
+
|| !existingRef
|
|
1427
|
+
|| !incomingRef
|
|
1428
|
+
|| !existingOrigin
|
|
1429
|
+
|| !incomingOrigin
|
|
1430
|
+
|| eventExternalRefKey(existingRef) === eventExternalRefKey(incomingRef)
|
|
1431
|
+
|| junctionNoIdProfileResourceId(existingOrigin, existing.occurredAt)
|
|
1432
|
+
!== existingRef.resourceId
|
|
1433
|
+
|| junctionNoIdProfileResourceId(incomingOrigin, incoming.occurredAt)
|
|
1434
|
+
!== incomingRef.resourceId
|
|
1435
|
+
|| !(existingOrigin.normalizerVersion === "junction-normalizer.v1"
|
|
1436
|
+
|| existingOrigin.normalizerVersion === JUNCTION_NO_ID_PROFILE_NORMALIZER_VERSION)) {
|
|
1437
|
+
return false;
|
|
1438
|
+
}
|
|
1439
|
+
return isExactJunctionProfileCreatedAtTimestampReplay(existing, incoming);
|
|
1440
|
+
}
|
|
1441
|
+
function isMemberDeletedJunctionStableProfile(existing, incoming) {
|
|
1442
|
+
const existingRef = existing.externalRef;
|
|
1443
|
+
const incomingRef = incoming.externalRef;
|
|
1444
|
+
if (!existingRef || !incomingRef) {
|
|
1445
|
+
return false;
|
|
1446
|
+
}
|
|
1447
|
+
return isDeletedEventSpineRecord(existing)
|
|
1448
|
+
&& isIncomingJunctionStableProfileCreatedAt(incoming)
|
|
1449
|
+
&& junctionNoIdProfileScopeKey(existingRef, existing.dataOrigin) !== null
|
|
1450
|
+
&& eventExternalRefKey(existingRef) === eventExternalRefKey(incomingRef)
|
|
1451
|
+
&& deviceDataOriginSourceMatches(existing.dataOrigin, incoming.dataOrigin)
|
|
1452
|
+
&& existingRef?.version !== undefined
|
|
1453
|
+
&& isWritableIsoDateTime(existingRef.version)
|
|
1454
|
+
&& isWritableIsoDateTime(existing.recordedAt)
|
|
1455
|
+
&& compareIsoTimestampsAscending(existing.recordedAt, existingRef.version) > 0;
|
|
1456
|
+
}
|
|
1016
1457
|
function isDateLikeWhoopBodyMeasurementResourceId(resourceId) {
|
|
1017
1458
|
return /^\d{4}-\d{2}-\d{2}$/u.test(resourceId) ||
|
|
1018
1459
|
/^date:\d{4}-\d{2}-\d{2}$/u.test(resourceId);
|
|
@@ -1077,6 +1518,95 @@ function shouldKeepExistingJunctionSleepStageSummaryObservation(existing, incomi
|
|
|
1077
1518
|
isJunctionSleepStageCycleFallbackObservation(incoming);
|
|
1078
1519
|
}
|
|
1079
1520
|
const JUNCTION_COMPANION_HEALTH_METADATA_SOURCE_TYPE = "companion-whoop-metadata-unverified";
|
|
1521
|
+
const JUNCTION_SPARSE_FLOATING_FALLBACK_NORMALIZER_VERSION = "junction-sparse-timeseries.floating-fallback.v2";
|
|
1522
|
+
function resolveJunctionFloatingFallbackTime(existing, incoming) {
|
|
1523
|
+
if (incoming.externalRef?.system !== "junction"
|
|
1524
|
+
|| incoming.dataOrigin?.normalizerVersion
|
|
1525
|
+
!== JUNCTION_SPARSE_FLOATING_FALLBACK_NORMALIZER_VERSION
|
|
1526
|
+
|| incoming.dataOrigin.timestampSemantics !== "floating") {
|
|
1527
|
+
return incoming;
|
|
1528
|
+
}
|
|
1529
|
+
if (!incoming.timeZone) {
|
|
1530
|
+
return incoming;
|
|
1531
|
+
}
|
|
1532
|
+
// Junction documents Libre's +00:00 values as wall clocks, not instants.
|
|
1533
|
+
// The importer carries those raw wall values through a schema-valid transient
|
|
1534
|
+
// event. Resolve them only after stable external identity lookup, so a matched
|
|
1535
|
+
// row uses its event spine's accepted zone while a new row uses the incoming
|
|
1536
|
+
// fallback zone. Each endpoint resolves independently across DST transitions.
|
|
1537
|
+
const acceptedExisting = existing?.externalRef?.system === "junction"
|
|
1538
|
+
&& existing.dataOrigin?.timestampSemantics === "floating"
|
|
1539
|
+
&& deviceDataOriginSourceMatches(existing.dataOrigin, incoming.dataOrigin)
|
|
1540
|
+
? existing
|
|
1541
|
+
: undefined;
|
|
1542
|
+
const targetTimeZone = acceptedExisting?.timeZone ?? incoming.timeZone;
|
|
1543
|
+
const startRaw = incoming.dataOrigin.observedAtRaw;
|
|
1544
|
+
if (typeof startRaw !== "string") {
|
|
1545
|
+
return incoming;
|
|
1546
|
+
}
|
|
1547
|
+
const resolvedOccurrence = resolveFloatingIsoTimestampInTimeZone(startRaw, targetTimeZone);
|
|
1548
|
+
const resolvedStart = incoming.kind === "intervention_session"
|
|
1549
|
+
&& typeof incoming.fields?.["start-at"] === "string"
|
|
1550
|
+
? resolveFloatingIsoTimestampInTimeZone(incoming.fields["start-at"], targetTimeZone)
|
|
1551
|
+
: undefined;
|
|
1552
|
+
const resolvedStartAt = resolvedStart?.timestamp;
|
|
1553
|
+
const resolvedEndAt = incoming.kind === "intervention_session"
|
|
1554
|
+
&& typeof incoming.fields?.["end-at"] === "string"
|
|
1555
|
+
? resolveFloatingIsoTimestampInTimeZone(incoming.fields["end-at"], targetTimeZone)?.timestamp
|
|
1556
|
+
: undefined;
|
|
1557
|
+
if (!resolvedOccurrence
|
|
1558
|
+
|| (incoming.kind === "intervention_session"
|
|
1559
|
+
&& (!resolvedStartAt
|
|
1560
|
+
|| !resolvedEndAt
|
|
1561
|
+
|| Date.parse(resolvedEndAt) < Date.parse(resolvedStartAt)))) {
|
|
1562
|
+
return null;
|
|
1563
|
+
}
|
|
1564
|
+
const resolvedInterventionFields = incoming.kind === "intervention_session"
|
|
1565
|
+
&& incoming.fields
|
|
1566
|
+
? {
|
|
1567
|
+
...incoming.fields,
|
|
1568
|
+
...(resolvedStartAt ? { "start-at": resolvedStartAt } : {}),
|
|
1569
|
+
...(resolvedEndAt ? { "end-at": resolvedEndAt } : {}),
|
|
1570
|
+
}
|
|
1571
|
+
: undefined;
|
|
1572
|
+
const canonicalOccurrence = incoming.kind === "intervention_session"
|
|
1573
|
+
&& resolvedStartAt
|
|
1574
|
+
? resolvedStartAt
|
|
1575
|
+
: resolvedOccurrence.timestamp;
|
|
1576
|
+
const canonicalDayKey = incoming.kind === "intervention_session"
|
|
1577
|
+
&& resolvedStart
|
|
1578
|
+
? resolvedStart.dayKey
|
|
1579
|
+
: resolvedOccurrence.dayKey;
|
|
1580
|
+
return {
|
|
1581
|
+
...incoming,
|
|
1582
|
+
occurredAt: canonicalOccurrence,
|
|
1583
|
+
recordedAt: acceptedExisting?.recordedAt ?? incoming.recordedAt,
|
|
1584
|
+
dayKey: canonicalDayKey,
|
|
1585
|
+
timeZone: targetTimeZone,
|
|
1586
|
+
...(incoming.kind === "intervention_session" && resolvedInterventionFields
|
|
1587
|
+
? { fields: resolvedInterventionFields }
|
|
1588
|
+
: {}),
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
function resolveJunctionFloatingFallbackEntries(entries, context) {
|
|
1592
|
+
return entries.flatMap((entry) => {
|
|
1593
|
+
if (entry.record.externalRef?.system !== "junction"
|
|
1594
|
+
|| entry.record.dataOrigin?.normalizerVersion
|
|
1595
|
+
!== JUNCTION_SPARSE_FLOATING_FALLBACK_NORMALIZER_VERSION) {
|
|
1596
|
+
return [entry];
|
|
1597
|
+
}
|
|
1598
|
+
const resolved = resolveDeviceEventIdentity(entry, context, { strict: true });
|
|
1599
|
+
const indexedProviderMatch = resolved?.matchedEntries.find((match) => match.indexedMatch.record.id === resolved.latest?.id)?.indexedMatch ?? resolved?.matchedEntries[0]?.indexedMatch;
|
|
1600
|
+
const canonicalRecord = resolveJunctionFloatingFallbackTime(indexedProviderMatch?.indexedRecord, entry.record);
|
|
1601
|
+
return canonicalRecord
|
|
1602
|
+
? [{
|
|
1603
|
+
...entry,
|
|
1604
|
+
relativePath: toEventLedgerFile(canonicalRecord.occurredAt),
|
|
1605
|
+
record: canonicalRecord,
|
|
1606
|
+
}]
|
|
1607
|
+
: [];
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1080
1610
|
function parseJunctionCompanionSyncVersion(version) {
|
|
1081
1611
|
if (!version || !/^(?:0|[1-9]\d*)$/u.test(version)) {
|
|
1082
1612
|
return undefined;
|
|
@@ -1178,12 +1708,126 @@ function toIndexedExternalRefMatch(record, externalRef, relativePath = "") {
|
|
|
1178
1708
|
record,
|
|
1179
1709
|
};
|
|
1180
1710
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1711
|
+
const deviceBatchImportSessionState = new WeakMap();
|
|
1712
|
+
export function createDeviceBatchImportSession() {
|
|
1713
|
+
const session = Object.freeze({
|
|
1714
|
+
kind: "device_batch_import_session",
|
|
1715
|
+
});
|
|
1716
|
+
deviceBatchImportSessionState.set(session, new Map());
|
|
1717
|
+
return session;
|
|
1718
|
+
}
|
|
1719
|
+
function buildDeviceEventIdentityDependency(plan, additionalEventIds = []) {
|
|
1720
|
+
const externalRefs = plan.preparedEvents.flatMap((entry) => [
|
|
1721
|
+
...(entry.record.externalRef ? [entry.record.externalRef] : []),
|
|
1722
|
+
...entry.legacyExternalRefs,
|
|
1723
|
+
]);
|
|
1724
|
+
return {
|
|
1725
|
+
authoritativeEventSets: plan.authoritativeEventSets,
|
|
1726
|
+
eventIds: new Set([
|
|
1727
|
+
...plan.preparedEvents.map((entry) => entry.record.id),
|
|
1728
|
+
...additionalEventIds,
|
|
1729
|
+
]),
|
|
1730
|
+
externalRefs,
|
|
1731
|
+
junctionNoIdProfileScopes: new Set(plan.preparedEvents.flatMap((entry) => {
|
|
1732
|
+
const externalRef = entry.record.externalRef;
|
|
1733
|
+
const scope = externalRef
|
|
1734
|
+
? junctionNoIdProfileScopeKey(externalRef, entry.record.dataOrigin)
|
|
1735
|
+
: null;
|
|
1736
|
+
return scope ? [scope] : [];
|
|
1737
|
+
})),
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
function eventRefBelongsToAuthoritativeSet(externalRef, set) {
|
|
1741
|
+
if (externalRef.system !== set.system
|
|
1742
|
+
|| externalRef.resourceType !== set.resourceType
|
|
1743
|
+
|| externalRef.resourceId !== set.resourceId
|
|
1744
|
+
|| externalRef.facet === undefined) {
|
|
1745
|
+
return false;
|
|
1746
|
+
}
|
|
1747
|
+
return set.facetPrefixes.some((prefix) => externalRef.facet === prefix || externalRef.facet?.startsWith(`${prefix}-`));
|
|
1748
|
+
}
|
|
1749
|
+
function authoritativeEventSetsOverlap(left, right) {
|
|
1750
|
+
if (left.system !== right.system
|
|
1751
|
+
|| left.resourceType !== right.resourceType
|
|
1752
|
+
|| left.resourceId !== right.resourceId) {
|
|
1753
|
+
return false;
|
|
1754
|
+
}
|
|
1755
|
+
return left.facetPrefixes.some((leftPrefix) => right.facetPrefixes.some((rightPrefix) => leftPrefix === rightPrefix
|
|
1756
|
+
|| leftPrefix.startsWith(`${rightPrefix}-`)
|
|
1757
|
+
|| rightPrefix.startsWith(`${leftPrefix}-`)));
|
|
1758
|
+
}
|
|
1759
|
+
function deviceEventIdentityDependenciesOverlap(left, right) {
|
|
1760
|
+
if ([...left.eventIds].some((eventId) => right.eventIds.has(eventId))) {
|
|
1761
|
+
return true;
|
|
1762
|
+
}
|
|
1763
|
+
const rightRefKeys = new Set(right.externalRefs.map(eventExternalRefKey));
|
|
1764
|
+
if (left.externalRefs.some((externalRef) => rightRefKeys.has(eventExternalRefKey(externalRef)))) {
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
if ([...left.junctionNoIdProfileScopes].some((scope) => right.junctionNoIdProfileScopes.has(scope))) {
|
|
1768
|
+
return true;
|
|
1769
|
+
}
|
|
1770
|
+
if (left.externalRefs.some((externalRef) => right.authoritativeEventSets.some((set) => eventRefBelongsToAuthoritativeSet(externalRef, set)))) {
|
|
1771
|
+
return true;
|
|
1772
|
+
}
|
|
1773
|
+
if (right.externalRefs.some((externalRef) => left.authoritativeEventSets.some((set) => eventRefBelongsToAuthoritativeSet(externalRef, set)))) {
|
|
1774
|
+
return true;
|
|
1775
|
+
}
|
|
1776
|
+
return left.authoritativeEventSets.some((leftSet) => right.authoritativeEventSets.some((rightSet) => authoritativeEventSetsOverlap(leftSet, rightSet)));
|
|
1777
|
+
}
|
|
1778
|
+
function readDeviceBatchImportSessionVaultState(session, vaultRoot) {
|
|
1779
|
+
return session ? deviceBatchImportSessionState.get(session)?.get(vaultRoot) : undefined;
|
|
1780
|
+
}
|
|
1781
|
+
function replaceDeviceBatchImportSessionVaultState(session, vaultRoot, state) {
|
|
1782
|
+
if (!session) {
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
deviceBatchImportSessionState.get(session)?.set(vaultRoot, state);
|
|
1786
|
+
}
|
|
1787
|
+
function clearDeviceBatchImportSessionVaultState(session, vaultRoot) {
|
|
1788
|
+
if (!session) {
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
deviceBatchImportSessionState.get(session)?.delete(vaultRoot);
|
|
1792
|
+
}
|
|
1793
|
+
function emitDeviceBatchImportTiming(observer, timing) {
|
|
1794
|
+
try {
|
|
1795
|
+
observer?.({ ...timing });
|
|
1796
|
+
}
|
|
1797
|
+
catch {
|
|
1798
|
+
// Diagnostics must not turn an already-committed canonical write into an
|
|
1799
|
+
// apparent import failure.
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
async function buildDeviceEventLedgerFingerprint(vaultRoot) {
|
|
1803
|
+
const shardPaths = await walkVaultFiles(vaultRoot, VAULT_LAYOUT.eventLedgerDirectory, {
|
|
1804
|
+
extension: ".jsonl",
|
|
1186
1805
|
});
|
|
1806
|
+
const metadata = await Promise.all(shardPaths.map(async (relativePath) => {
|
|
1807
|
+
const shard = await stat(resolveVaultPath(vaultRoot, relativePath).absolutePath);
|
|
1808
|
+
return [
|
|
1809
|
+
relativePath,
|
|
1810
|
+
shard.dev,
|
|
1811
|
+
shard.ino,
|
|
1812
|
+
shard.size,
|
|
1813
|
+
shard.mtimeMs,
|
|
1814
|
+
shard.ctimeMs,
|
|
1815
|
+
].join("\0");
|
|
1816
|
+
}));
|
|
1817
|
+
return createHash("sha256").update(metadata.join("\n")).digest("hex");
|
|
1818
|
+
}
|
|
1819
|
+
async function tryBuildDeviceEventLedgerFingerprint(vaultRoot) {
|
|
1820
|
+
try {
|
|
1821
|
+
return await buildDeviceEventLedgerFingerprint(vaultRoot);
|
|
1822
|
+
}
|
|
1823
|
+
catch {
|
|
1824
|
+
// A failed cache fence disables reuse. The canonical import path remains
|
|
1825
|
+
// authoritative and will surface any real ledger read failure itself.
|
|
1826
|
+
return undefined;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
function userAuthoredEventStateKey(record) {
|
|
1830
|
+
return eventContentKey(record, { includeProviderAttribution: false });
|
|
1187
1831
|
}
|
|
1188
1832
|
function hasHistoricalExternalRefUserAuthoredChanges(match) {
|
|
1189
1833
|
return eventSpineRevision(match.record) > eventSpineRevision(match.indexedRecord) &&
|
|
@@ -1191,39 +1835,99 @@ function hasHistoricalExternalRefUserAuthoredChanges(match) {
|
|
|
1191
1835
|
}
|
|
1192
1836
|
function buildLegacyExternalRefReservations(entries, index) {
|
|
1193
1837
|
const reservations = new Map();
|
|
1838
|
+
const reserve = (entry, refKey, indexedMatch) => {
|
|
1839
|
+
const existing = reservations.get(refKey);
|
|
1840
|
+
if (existing && existing.entry !== entry) {
|
|
1841
|
+
const externalRef = indexedMatch.indexedExternalRef;
|
|
1842
|
+
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", `Event legacy externalRef "${externalRef.system}/${externalRef.resourceType}/` +
|
|
1843
|
+
`${externalRef.resourceId}${externalRef.facet ? `#${externalRef.facet}` : ""}" ` +
|
|
1844
|
+
"matched multiple incoming device events; ambiguous legacy cleanup must be repaired explicitly.");
|
|
1845
|
+
}
|
|
1846
|
+
reservations.set(refKey, { entry, indexedMatch });
|
|
1847
|
+
};
|
|
1194
1848
|
for (const entry of entries) {
|
|
1195
1849
|
const externalRef = entry.record.externalRef;
|
|
1196
1850
|
if (!externalRef) {
|
|
1197
1851
|
continue;
|
|
1198
1852
|
}
|
|
1199
1853
|
const primaryRefKey = eventExternalRefKey(externalRef);
|
|
1854
|
+
const dailyAliasOwnerSplit = resolveJunctionDailyAggregateAliasOwnerSplit(entry, index);
|
|
1200
1855
|
for (const legacyExternalRef of entry.legacyExternalRefs) {
|
|
1201
1856
|
const legacyRefKey = eventExternalRefKey(legacyExternalRef);
|
|
1202
1857
|
if (legacyRefKey === primaryRefKey) {
|
|
1203
1858
|
continue;
|
|
1204
1859
|
}
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1860
|
+
const persistedAliasMatch = dailyAliasOwnerSplit?.legacyRefKey === legacyRefKey
|
|
1861
|
+
? dailyAliasOwnerSplit.legacyOwner
|
|
1862
|
+
: undefined;
|
|
1863
|
+
const indexedMatch = persistedAliasMatch ?? index.latestByRefKey.get(legacyRefKey);
|
|
1864
|
+
if (!indexedMatch
|
|
1865
|
+
|| (!persistedAliasMatch
|
|
1866
|
+
&& !isCompatibleLegacyExternalRefMatch(indexedMatch, entry.record, legacyExternalRef))) {
|
|
1207
1867
|
continue;
|
|
1208
1868
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1869
|
+
reserve(entry, legacyRefKey, indexedMatch);
|
|
1870
|
+
}
|
|
1871
|
+
if (!isIncomingJunctionNoIdProfile(entry.record)) {
|
|
1872
|
+
continue;
|
|
1873
|
+
}
|
|
1874
|
+
const scopeKey = junctionNoIdProfileScopeKey(externalRef, entry.record.dataOrigin);
|
|
1875
|
+
const incomingRevision = externalRef.version;
|
|
1876
|
+
if (!scopeKey || !incomingRevision || !isWritableIsoDateTime(incomingRevision)) {
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
const scopedMatches = (index.junctionNoIdProfilePredecessorsByScope.get(scopeKey) ?? [])
|
|
1880
|
+
.filter((match) => eventExternalRefKey(match.indexedExternalRef) !== primaryRefKey);
|
|
1881
|
+
const equalRevisionMatches = scopedMatches.filter((match) => {
|
|
1882
|
+
const predecessorRevision = junctionNoIdProfileProviderBaselineRevision(match);
|
|
1883
|
+
return predecessorRevision !== null
|
|
1884
|
+
&& compareIsoTimestampsAscending(incomingRevision, predecessorRevision) === 0;
|
|
1885
|
+
});
|
|
1886
|
+
if (equalRevisionMatches.length > 1) {
|
|
1887
|
+
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", `Junction profile externalRef "${externalRef.system}/${externalRef.resourceType}/` +
|
|
1888
|
+
`${externalRef.resourceId}${externalRef.facet ? `#${externalRef.facet}` : ""}" ` +
|
|
1889
|
+
"matched multiple persisted identities at the same provider revision; nothing was imported.");
|
|
1890
|
+
}
|
|
1891
|
+
const equalRevisionMatch = equalRevisionMatches[0];
|
|
1892
|
+
if (equalRevisionMatch) {
|
|
1893
|
+
if (!isJunctionNoIdProfileEqualRevisionTimestampReplay(equalRevisionMatch.indexedRecord, entry.record)) {
|
|
1894
|
+
throw new VaultError("EVENT_SOURCE_REVISION_CONFLICT", `Junction profile externalRef "${externalRef.system}/${externalRef.resourceType}/` +
|
|
1895
|
+
`${externalRef.resourceId}${externalRef.facet ? `#${externalRef.facet}` : ""}" ` +
|
|
1896
|
+
`has conflicting content for source revision "${incomingRevision}"; nothing was imported.`);
|
|
1214
1897
|
}
|
|
1215
|
-
|
|
1898
|
+
reserve(entry, eventExternalRefKey(equalRevisionMatch.indexedExternalRef), equalRevisionMatch);
|
|
1899
|
+
continue;
|
|
1900
|
+
}
|
|
1901
|
+
const predecessorMatches = scopedMatches.filter((match) => {
|
|
1902
|
+
const predecessorRevision = junctionNoIdProfilePredecessorRevision(match);
|
|
1903
|
+
return predecessorRevision !== null
|
|
1904
|
+
&& compareIsoTimestampsAscending(incomingRevision, predecessorRevision) > 0;
|
|
1905
|
+
});
|
|
1906
|
+
if (predecessorMatches.length > 1) {
|
|
1907
|
+
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", `Junction profile externalRef "${externalRef.system}/${externalRef.resourceType}/` +
|
|
1908
|
+
`${externalRef.resourceId}${externalRef.facet ? `#${externalRef.facet}` : ""}" ` +
|
|
1909
|
+
"matched multiple persisted predecessor identities; nothing was imported.");
|
|
1910
|
+
}
|
|
1911
|
+
const predecessor = predecessorMatches[0];
|
|
1912
|
+
if (predecessor) {
|
|
1913
|
+
reserve(entry, eventExternalRefKey(predecessor.indexedExternalRef), predecessor);
|
|
1216
1914
|
}
|
|
1217
1915
|
}
|
|
1218
1916
|
return reservations;
|
|
1219
1917
|
}
|
|
1220
|
-
async function buildDeviceEventIdentityContext(vaultRoot, entries) {
|
|
1221
|
-
if (entries.length === 0) {
|
|
1918
|
+
async function buildDeviceEventIdentityContext(vaultRoot, entries, authoritativeEventSets = []) {
|
|
1919
|
+
if (entries.length === 0 && authoritativeEventSets.length === 0) {
|
|
1222
1920
|
return {
|
|
1223
1921
|
index: {
|
|
1922
|
+
aliasRepairContaminatedEventIds: new Set(),
|
|
1923
|
+
aliasRepairContaminatedRefKeys: new Set(),
|
|
1924
|
+
aliasRepairHistoryById: new Map(),
|
|
1224
1925
|
deviceOwnerRevisionsByRefKeyAndFingerprint: new Map(),
|
|
1926
|
+
junctionNoIdProfilePredecessorsByScope: new Map(),
|
|
1927
|
+
junctionSparseDayHistoryById: new Map(),
|
|
1225
1928
|
latestByRefKey: new Map(),
|
|
1226
1929
|
latestById: new Map(),
|
|
1930
|
+
liveOwnerIdsByRefKey: new Map(),
|
|
1227
1931
|
maxRevisionById: new Map(),
|
|
1228
1932
|
revisionsById: new Map(),
|
|
1229
1933
|
},
|
|
@@ -1234,28 +1938,55 @@ async function buildDeviceEventIdentityContext(vaultRoot, entries) {
|
|
|
1234
1938
|
extension: ".jsonl",
|
|
1235
1939
|
});
|
|
1236
1940
|
const index = await indexLatestEventsByExternalRef(vaultRoot, shardPaths);
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1941
|
+
const context = { index, legacyReservations: new Map() };
|
|
1942
|
+
// A legitimate primary spine may advance before the duplicate is repaired.
|
|
1943
|
+
// Load only structural candidates first so reservations can use the bounded
|
|
1944
|
+
// common-initial-history proof instead of latest-record equality.
|
|
1945
|
+
const aliasRepairOwnerIds = new Set();
|
|
1946
|
+
for (const entry of entries) {
|
|
1947
|
+
const ownerSplit = resolveStructuralJunctionDailyAggregateAliasOwnerSplit(entry, index);
|
|
1948
|
+
if (!ownerSplit) {
|
|
1949
|
+
continue;
|
|
1950
|
+
}
|
|
1951
|
+
assertJunctionDailyAggregateAliasHistoryIsUncontaminated(entry, context);
|
|
1952
|
+
aliasRepairOwnerIds.add(ownerSplit.primaryOwner.record.id);
|
|
1953
|
+
aliasRepairOwnerIds.add(ownerSplit.legacyOwner.record.id);
|
|
1954
|
+
}
|
|
1955
|
+
if (aliasRepairOwnerIds.size > 0) {
|
|
1956
|
+
index.aliasRepairHistoryById = await loadBoundedAliasRepairHistories(vaultRoot, shardPaths, aliasRepairOwnerIds);
|
|
1957
|
+
}
|
|
1958
|
+
context.legacyReservations = buildLegacyExternalRefReservations(entries, index);
|
|
1959
|
+
return context;
|
|
1241
1960
|
}
|
|
1242
1961
|
function cloneDeviceEventIdentityContext(context) {
|
|
1243
1962
|
return {
|
|
1244
1963
|
index: {
|
|
1964
|
+
aliasRepairContaminatedEventIds: new Set(context.index.aliasRepairContaminatedEventIds),
|
|
1965
|
+
aliasRepairContaminatedRefKeys: new Set(context.index.aliasRepairContaminatedRefKeys),
|
|
1966
|
+
aliasRepairHistoryById: new Map([...context.index.aliasRepairHistoryById].map(([id, history]) => [id, [...history]])),
|
|
1245
1967
|
deviceOwnerRevisionsByRefKeyAndFingerprint: context.index.deviceOwnerRevisionsByRefKeyAndFingerprint,
|
|
1968
|
+
junctionNoIdProfilePredecessorsByScope: context.index.junctionNoIdProfilePredecessorsByScope,
|
|
1969
|
+
junctionSparseDayHistoryById: context.index.junctionSparseDayHistoryById,
|
|
1246
1970
|
latestByRefKey: new Map(context.index.latestByRefKey),
|
|
1247
1971
|
latestById: new Map(context.index.latestById),
|
|
1972
|
+
liveOwnerIdsByRefKey: new Map([...context.index.liveOwnerIdsByRefKey].map(([key, ids]) => [key, new Set(ids)])),
|
|
1248
1973
|
maxRevisionById: new Map(context.index.maxRevisionById),
|
|
1249
|
-
revisionsById: new Map(context.index.revisionsById),
|
|
1974
|
+
revisionsById: new Map([...context.index.revisionsById].map(([id, revisions]) => [id, new Set(revisions)])),
|
|
1250
1975
|
},
|
|
1251
1976
|
legacyReservations: new Map(context.legacyReservations),
|
|
1252
1977
|
};
|
|
1253
1978
|
}
|
|
1254
1979
|
function buildEmptyDeviceEventIdentityContext(entries) {
|
|
1255
1980
|
const index = {
|
|
1981
|
+
aliasRepairContaminatedEventIds: new Set(),
|
|
1982
|
+
aliasRepairContaminatedRefKeys: new Set(),
|
|
1983
|
+
aliasRepairHistoryById: new Map(),
|
|
1256
1984
|
deviceOwnerRevisionsByRefKeyAndFingerprint: new Map(),
|
|
1985
|
+
junctionNoIdProfilePredecessorsByScope: new Map(),
|
|
1986
|
+
junctionSparseDayHistoryById: new Map(),
|
|
1257
1987
|
latestByRefKey: new Map(),
|
|
1258
1988
|
latestById: new Map(),
|
|
1989
|
+
liveOwnerIdsByRefKey: new Map(),
|
|
1259
1990
|
maxRevisionById: new Map(),
|
|
1260
1991
|
revisionsById: new Map(),
|
|
1261
1992
|
};
|
|
@@ -1272,6 +2003,470 @@ function eventSpineRevisionsAreComplete(index, eventId) {
|
|
|
1272
2003
|
&& revisions !== undefined
|
|
1273
2004
|
&& revisions.size === maxRevision;
|
|
1274
2005
|
}
|
|
2006
|
+
function buildDeviceEventAliasRepairContext(plan) {
|
|
2007
|
+
return {
|
|
2008
|
+
evidenceByRole: new Map(plan.preparedEvidenceParts.map((part) => [part.role, part])),
|
|
2009
|
+
evidenceRolesByPreparedRecordId: plan.evidenceRolesByPreparedRecordId,
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function isLooseRecordValue(value) {
|
|
2013
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2014
|
+
}
|
|
2015
|
+
function readRejectedEventExternalRefKey(value) {
|
|
2016
|
+
if (!isLooseRecordValue(value)) {
|
|
2017
|
+
return undefined;
|
|
2018
|
+
}
|
|
2019
|
+
const parsed = safeParseContract(externalRefSchema, {
|
|
2020
|
+
system: value.system,
|
|
2021
|
+
resourceType: value.resourceType,
|
|
2022
|
+
resourceId: value.resourceId,
|
|
2023
|
+
...(value.facet === undefined ? {} : { facet: value.facet }),
|
|
2024
|
+
...(value.version === undefined ? {} : { version: value.version }),
|
|
2025
|
+
});
|
|
2026
|
+
return parsed.success ? eventExternalRefKey(parsed.data) : undefined;
|
|
2027
|
+
}
|
|
2028
|
+
function junctionDailyAggregateAliasRefShape(externalRef) {
|
|
2029
|
+
return stableStringify({
|
|
2030
|
+
facet: externalRef.facet ?? null,
|
|
2031
|
+
resourceType: externalRef.resourceType,
|
|
2032
|
+
system: externalRef.system,
|
|
2033
|
+
version: externalRef.version ?? null,
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
function junctionDailyAggregateAliasOriginKey(origin) {
|
|
2037
|
+
if (!origin) {
|
|
2038
|
+
return null;
|
|
2039
|
+
}
|
|
2040
|
+
const { observedAtRaw: _observedAtRaw, ...stableOrigin } = origin;
|
|
2041
|
+
return stableStringify(stableOrigin);
|
|
2042
|
+
}
|
|
2043
|
+
function junctionDailyAggregateAliasHistoricalOriginMatches(historical, current) {
|
|
2044
|
+
if (!historical) {
|
|
2045
|
+
return false;
|
|
2046
|
+
}
|
|
2047
|
+
if (junctionDailyAggregateAliasOriginKey(historical)
|
|
2048
|
+
=== junctionDailyAggregateAliasOriginKey(current)) {
|
|
2049
|
+
return true;
|
|
2050
|
+
}
|
|
2051
|
+
if (historical.timeZoneOffsetMinutes !== undefined) {
|
|
2052
|
+
return false;
|
|
2053
|
+
}
|
|
2054
|
+
const { observedAtRaw: _historicalObservedAtRaw, timeZoneOffsetMinutes: _historicalOffset, ...stableHistorical } = historical;
|
|
2055
|
+
const { observedAtRaw: _currentObservedAtRaw, timeZoneOffsetMinutes: _currentOffset, ...stableCurrent } = current;
|
|
2056
|
+
return stableStringify(stableHistorical) === stableStringify(stableCurrent);
|
|
2057
|
+
}
|
|
2058
|
+
function junctionDailyAggregateProviderStateKey(record) {
|
|
2059
|
+
const { dataOrigin: _dataOrigin, dayKey: _dayKey, externalRef: _externalRef, id: _id, lifecycle: _lifecycle, links: _links, note: _note, recordedAt: _recordedAt, source: _source, tags: _tags, ...providerState } = record;
|
|
2060
|
+
return stableStringify(providerState);
|
|
2061
|
+
}
|
|
2062
|
+
function isJunctionDailyAggregateAliasCandidate(entry) {
|
|
2063
|
+
const externalRef = entry.record.externalRef;
|
|
2064
|
+
const legacyExternalRef = entry.legacyExternalRefs[0];
|
|
2065
|
+
return externalRef !== undefined
|
|
2066
|
+
&& legacyExternalRef !== undefined
|
|
2067
|
+
&& entry.legacyExternalRefs.length === 1
|
|
2068
|
+
&& entry.record.kind === "observation"
|
|
2069
|
+
&& entry.record.source === "device"
|
|
2070
|
+
&& entry.record.dataOrigin?.aggregatorProvider === "junction"
|
|
2071
|
+
&& entry.record.dataOrigin.normalizerVersion === "junction-normalizer.v1"
|
|
2072
|
+
&& externalRef.system === "junction"
|
|
2073
|
+
&& externalRef.version === undefined
|
|
2074
|
+
&& legacyExternalRef.version === undefined
|
|
2075
|
+
&& eventExternalRefKey(externalRef) !== eventExternalRefKey(legacyExternalRef)
|
|
2076
|
+
&& junctionDailyAggregateAliasRefShape(externalRef)
|
|
2077
|
+
=== junctionDailyAggregateAliasRefShape(legacyExternalRef)
|
|
2078
|
+
&& entry.record.note === undefined
|
|
2079
|
+
&& entry.record.tags === undefined
|
|
2080
|
+
&& entry.record.links === undefined
|
|
2081
|
+
&& entry.record.rawRefs === undefined
|
|
2082
|
+
&& entry.record.evidence === undefined
|
|
2083
|
+
&& entry.record.attachments === undefined;
|
|
2084
|
+
}
|
|
2085
|
+
function resolveStructuralJunctionDailyAggregateAliasOwnerSplit(entry, index) {
|
|
2086
|
+
const externalRef = entry.record.externalRef;
|
|
2087
|
+
const legacyExternalRef = entry.legacyExternalRefs[0];
|
|
2088
|
+
if (!externalRef
|
|
2089
|
+
|| !legacyExternalRef
|
|
2090
|
+
|| !isJunctionDailyAggregateAliasCandidate(entry)) {
|
|
2091
|
+
return null;
|
|
2092
|
+
}
|
|
2093
|
+
const primaryRefKey = eventExternalRefKey(externalRef);
|
|
2094
|
+
const legacyRefKey = eventExternalRefKey(legacyExternalRef);
|
|
2095
|
+
const primaryOwnerIds = index.liveOwnerIdsByRefKey.get(primaryRefKey)
|
|
2096
|
+
?? new Set();
|
|
2097
|
+
const legacyOwnerIds = index.liveOwnerIdsByRefKey.get(legacyRefKey)
|
|
2098
|
+
?? new Set();
|
|
2099
|
+
if (primaryOwnerIds.size === 0 || legacyOwnerIds.size === 0) {
|
|
2100
|
+
return null;
|
|
2101
|
+
}
|
|
2102
|
+
const primaryOwner = index.latestByRefKey.get(primaryRefKey);
|
|
2103
|
+
const legacyOwner = index.latestByRefKey.get(legacyRefKey);
|
|
2104
|
+
if (!primaryOwner || !legacyOwner) {
|
|
2105
|
+
return null;
|
|
2106
|
+
}
|
|
2107
|
+
const primaryProviderRecord = primaryOwner.indexedRecord;
|
|
2108
|
+
const legacyProviderRecord = legacyOwner.indexedRecord;
|
|
2109
|
+
const primaryOrigin = primaryProviderRecord.dataOrigin;
|
|
2110
|
+
const legacyOrigin = legacyProviderRecord.dataOrigin;
|
|
2111
|
+
const incomingOrigin = entry.record.dataOrigin;
|
|
2112
|
+
const observedAtRaw = incomingOrigin?.observedAtRaw;
|
|
2113
|
+
const observedAtRawPrefix = `${entry.record.dayKey}:`;
|
|
2114
|
+
const resource = observedAtRaw?.startsWith(observedAtRawPrefix)
|
|
2115
|
+
&& observedAtRaw.endsWith(":daily")
|
|
2116
|
+
? observedAtRaw.slice(observedAtRawPrefix.length, -":daily".length)
|
|
2117
|
+
: "";
|
|
2118
|
+
if (primaryProviderRecord.dayKey !== entry.record.dayKey
|
|
2119
|
+
|| !isSameObservationFacet(primaryProviderRecord, entry.record)
|
|
2120
|
+
|| !isSameObservationFacet(primaryProviderRecord, legacyProviderRecord)
|
|
2121
|
+
|| junctionDailyAggregateAliasRefShape(primaryOwner.indexedExternalRef)
|
|
2122
|
+
!== junctionDailyAggregateAliasRefShape(externalRef)
|
|
2123
|
+
|| junctionDailyAggregateAliasRefShape(legacyOwner.indexedExternalRef)
|
|
2124
|
+
!== junctionDailyAggregateAliasRefShape(legacyExternalRef)
|
|
2125
|
+
|| !primaryOrigin
|
|
2126
|
+
|| !legacyOrigin
|
|
2127
|
+
|| !incomingOrigin
|
|
2128
|
+
|| resource.length === 0
|
|
2129
|
+
|| !deviceDataOriginSourceMatches(primaryOrigin, incomingOrigin)
|
|
2130
|
+
|| !deviceDataOriginSourceMatches(legacyOrigin, incomingOrigin)) {
|
|
2131
|
+
return null;
|
|
2132
|
+
}
|
|
2133
|
+
const distinctOwnerIds = new Set([...primaryOwnerIds, ...legacyOwnerIds]);
|
|
2134
|
+
if (distinctOwnerIds.size < 2) {
|
|
2135
|
+
return null;
|
|
2136
|
+
}
|
|
2137
|
+
if (primaryOwnerIds.size !== 1
|
|
2138
|
+
|| legacyOwnerIds.size !== 1
|
|
2139
|
+
|| distinctOwnerIds.size !== 2) {
|
|
2140
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_OWNER_REFUSED", "Junction daily aggregate alias repair requires exactly one live owner per claimed reference.");
|
|
2141
|
+
}
|
|
2142
|
+
if (!primaryOwnerIds.has(primaryOwner.record.id)
|
|
2143
|
+
|| !legacyOwnerIds.has(legacyOwner.record.id)
|
|
2144
|
+
|| primaryOwner.record.id === legacyOwner.record.id) {
|
|
2145
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_OWNER_REFUSED", "Junction daily aggregate alias repair could not prove the two live reference owners.");
|
|
2146
|
+
}
|
|
2147
|
+
return { legacyOwner, legacyRefKey, primaryOwner, primaryRefKey, resource };
|
|
2148
|
+
}
|
|
2149
|
+
function assertJunctionDailyAggregateAliasHistoryIsUncontaminated(entry, context) {
|
|
2150
|
+
const externalRef = entry.record.externalRef;
|
|
2151
|
+
const legacyExternalRef = entry.legacyExternalRefs[0];
|
|
2152
|
+
if (!externalRef || !legacyExternalRef) {
|
|
2153
|
+
return;
|
|
2154
|
+
}
|
|
2155
|
+
const primaryRefKey = eventExternalRefKey(externalRef);
|
|
2156
|
+
const legacyRefKey = eventExternalRefKey(legacyExternalRef);
|
|
2157
|
+
const ownerIds = new Set([
|
|
2158
|
+
...(context.index.liveOwnerIdsByRefKey.get(primaryRefKey) ?? []),
|
|
2159
|
+
...(context.index.liveOwnerIdsByRefKey.get(legacyRefKey) ?? []),
|
|
2160
|
+
]);
|
|
2161
|
+
if ([...ownerIds].some((id) => context.index.aliasRepairContaminatedEventIds.has(id))
|
|
2162
|
+
|| context.index.aliasRepairContaminatedRefKeys.has(primaryRefKey)
|
|
2163
|
+
|| context.index.aliasRepairContaminatedRefKeys.has(legacyRefKey)) {
|
|
2164
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_HISTORY_REFUSED", "Junction daily aggregate alias repair found a schema-rejected candidate revision.");
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
function parseJunctionDailyAggregateAliasEvidence(entry, context) {
|
|
2168
|
+
const roles = context.evidenceRolesByPreparedRecordId.get(entry.record.id) ?? [];
|
|
2169
|
+
const part = roles.length === 1 ? context.evidenceByRole.get(roles[0]) : undefined;
|
|
2170
|
+
const metadata = part?.metadata;
|
|
2171
|
+
if (!part
|
|
2172
|
+
|| !isLooseRecordValue(metadata)
|
|
2173
|
+
|| metadata.artifactClass !== "compact_provider_timeseries_aggregate"
|
|
2174
|
+
|| metadata.provider !== "junction"
|
|
2175
|
+
|| metadata.resourceCategory !== "timeseries_daily_aggregate"
|
|
2176
|
+
|| metadata.retentionClass !== "provider_evidence") {
|
|
2177
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_EVIDENCE_REFUSED", "Junction daily aggregate alias repair requires one exact compact provider evidence role.");
|
|
2178
|
+
}
|
|
2179
|
+
let parsed;
|
|
2180
|
+
try {
|
|
2181
|
+
parsed = JSON.parse(part.content);
|
|
2182
|
+
}
|
|
2183
|
+
catch {
|
|
2184
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_EVIDENCE_REFUSED", "Junction daily aggregate alias repair evidence was not valid JSON.");
|
|
2185
|
+
}
|
|
2186
|
+
if (!isLooseRecordValue(parsed)) {
|
|
2187
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_EVIDENCE_REFUSED", "Junction daily aggregate alias repair evidence did not contain an object.");
|
|
2188
|
+
}
|
|
2189
|
+
const legacyDayKeys = parsed.legacyDayKeys;
|
|
2190
|
+
const origin = entry.record.dataOrigin;
|
|
2191
|
+
if (parsed.schema !== "junction.timeseries_daily_aggregate.v1"
|
|
2192
|
+
|| parsed.provider !== "junction"
|
|
2193
|
+
|| typeof parsed.resource !== "string"
|
|
2194
|
+
|| parsed.resource.length === 0
|
|
2195
|
+
|| metadata.resource !== parsed.resource
|
|
2196
|
+
|| typeof parsed.dayKey !== "string"
|
|
2197
|
+
|| !/^\d{4}-\d{2}-\d{2}$/u.test(parsed.dayKey)
|
|
2198
|
+
|| parsed.dayKey !== entry.record.dayKey
|
|
2199
|
+
|| typeof parsed.sourceProviderSlug !== "string"
|
|
2200
|
+
|| parsed.sourceProviderSlug.length === 0
|
|
2201
|
+
|| typeof parsed.sampleCount !== "number"
|
|
2202
|
+
|| !Number.isSafeInteger(parsed.sampleCount)
|
|
2203
|
+
|| parsed.sampleCount <= 0
|
|
2204
|
+
|| !Array.isArray(legacyDayKeys)
|
|
2205
|
+
|| legacyDayKeys.length !== 1
|
|
2206
|
+
|| typeof legacyDayKeys[0] !== "string"
|
|
2207
|
+
|| !/^\d{4}-\d{2}-\d{2}$/u.test(legacyDayKeys[0])
|
|
2208
|
+
|| legacyDayKeys[0] === parsed.dayKey
|
|
2209
|
+
|| (parsed.sourceType !== undefined && typeof parsed.sourceType !== "string")
|
|
2210
|
+
|| (parsed.sourceInstanceId !== undefined
|
|
2211
|
+
&& parsed.sourceInstanceId !== null
|
|
2212
|
+
&& typeof parsed.sourceInstanceId !== "string")
|
|
2213
|
+
|| origin?.sourceProviderSlug !== parsed.sourceProviderSlug
|
|
2214
|
+
|| (origin.sourceType ?? null) !== (parsed.sourceType ?? null)
|
|
2215
|
+
|| (origin.sourceInstanceId ?? null) !== (parsed.sourceInstanceId ?? null)
|
|
2216
|
+
|| origin.observedAtRaw !== `${parsed.dayKey}:${parsed.resource}:daily`) {
|
|
2217
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_EVIDENCE_REFUSED", "Junction daily aggregate alias repair evidence did not prove one normalized primary and legacy day split.");
|
|
2218
|
+
}
|
|
2219
|
+
return {
|
|
2220
|
+
dayKey: parsed.dayKey,
|
|
2221
|
+
legacyDayKey: legacyDayKeys[0],
|
|
2222
|
+
resource: parsed.resource,
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
function readCompleteJunctionDailyAggregateAliasHistory(index, eventId) {
|
|
2226
|
+
const history = index.aliasRepairHistoryById.get(eventId) ?? [];
|
|
2227
|
+
const maxRevision = index.maxRevisionById.get(eventId) ?? 0;
|
|
2228
|
+
const revisions = index.revisionsById.get(eventId);
|
|
2229
|
+
if (maxRevision < 1
|
|
2230
|
+
|| maxRevision > MAX_JUNCTION_DAILY_ALIAS_REPAIR_REVISIONS
|
|
2231
|
+
|| !revisions
|
|
2232
|
+
|| revisions.size !== maxRevision
|
|
2233
|
+
|| history.length !== maxRevision
|
|
2234
|
+
|| history.some((entry, historyIndex) => eventSpineRevision(entry.record) !== historyIndex + 1)) {
|
|
2235
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_HISTORY_REFUSED", "Junction daily aggregate alias repair requires a complete bounded event history.");
|
|
2236
|
+
}
|
|
2237
|
+
return history;
|
|
2238
|
+
}
|
|
2239
|
+
function junctionDailyAggregateAliasPersistedOriginsMatch(left, right) {
|
|
2240
|
+
if (!left || !right) {
|
|
2241
|
+
return false;
|
|
2242
|
+
}
|
|
2243
|
+
return junctionDailyAggregateAliasHistoricalOriginMatches(left, right)
|
|
2244
|
+
|| junctionDailyAggregateAliasHistoricalOriginMatches(right, left);
|
|
2245
|
+
}
|
|
2246
|
+
function junctionDailyAggregateAliasInitialRecordMatches(record, input) {
|
|
2247
|
+
return record !== undefined
|
|
2248
|
+
&& record.source === "device"
|
|
2249
|
+
&& !isDeletedEventSpineRecord(record)
|
|
2250
|
+
&& record.dayKey === input.expectedDayKey
|
|
2251
|
+
&& record.dataOrigin?.observedAtRaw === input.expectedObservedAtRaw
|
|
2252
|
+
&& record.externalRef !== undefined
|
|
2253
|
+
&& eventExternalRefKey(record.externalRef)
|
|
2254
|
+
=== eventExternalRefKey(input.expectedExternalRef)
|
|
2255
|
+
&& junctionDailyAggregateAliasRefShape(record.externalRef)
|
|
2256
|
+
=== junctionDailyAggregateAliasRefShape(input.expectedExternalRef);
|
|
2257
|
+
}
|
|
2258
|
+
function analyzeJunctionDailyAggregateAliasHistoryEvolution(input) {
|
|
2259
|
+
const expectedRefKey = eventExternalRefKey(input.expectedExternalRef);
|
|
2260
|
+
let providerStateKey = input.initialProviderStateKey;
|
|
2261
|
+
let memberCarrierStateKey;
|
|
2262
|
+
for (const { record } of input.history) {
|
|
2263
|
+
const recordProviderStateKey = junctionDailyAggregateProviderStateKey(record);
|
|
2264
|
+
const providerRecord = record.source === "device";
|
|
2265
|
+
const manualMatchesProvider = recordProviderStateKey === providerStateKey;
|
|
2266
|
+
const manualMatchesCarrier = memberCarrierStateKey !== undefined
|
|
2267
|
+
&& recordProviderStateKey === memberCarrierStateKey;
|
|
2268
|
+
if (isDeletedEventSpineRecord(record)
|
|
2269
|
+
|| (record.source !== "device" && record.source !== "manual")
|
|
2270
|
+
|| record.dayKey !== input.expectedDayKey
|
|
2271
|
+
|| !isSameObservationFacet(input.initialRecord, record)
|
|
2272
|
+
|| (providerRecord
|
|
2273
|
+
&& (!record.externalRef
|
|
2274
|
+
|| !record.dataOrigin))
|
|
2275
|
+
|| (record.externalRef !== undefined
|
|
2276
|
+
&& (eventExternalRefKey(record.externalRef) !== expectedRefKey
|
|
2277
|
+
|| junctionDailyAggregateAliasRefShape(record.externalRef)
|
|
2278
|
+
!== junctionDailyAggregateAliasRefShape(input.expectedExternalRef)))
|
|
2279
|
+
|| (record.dataOrigin !== undefined
|
|
2280
|
+
&& (record.dataOrigin.observedAtRaw !== input.expectedObservedAtRaw
|
|
2281
|
+
|| !junctionDailyAggregateAliasHistoricalOriginMatches(record.dataOrigin, input.expectedOrigin)))
|
|
2282
|
+
|| (providerRecord
|
|
2283
|
+
? !input.allowProviderEvolution
|
|
2284
|
+
&& recordProviderStateKey !== input.initialProviderStateKey
|
|
2285
|
+
: !manualMatchesProvider && !manualMatchesCarrier)) {
|
|
2286
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_HISTORY_REFUSED", "Junction daily aggregate alias repair found unsupported or divergent historical state.");
|
|
2287
|
+
}
|
|
2288
|
+
if (providerRecord) {
|
|
2289
|
+
providerStateKey = recordProviderStateKey;
|
|
2290
|
+
}
|
|
2291
|
+
else if (manualMatchesProvider) {
|
|
2292
|
+
memberCarrierStateKey = recordProviderStateKey;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
const latest = input.history.at(-1)?.record;
|
|
2296
|
+
if (!latest) {
|
|
2297
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_HISTORY_REFUSED", "Junction daily aggregate alias repair requires a complete bounded event history.");
|
|
2298
|
+
}
|
|
2299
|
+
const links = [...(latest.links ?? [])];
|
|
2300
|
+
const tags = [...(latest.tags ?? [])];
|
|
2301
|
+
return {
|
|
2302
|
+
links,
|
|
2303
|
+
memberAuthored: latest.source === "manual"
|
|
2304
|
+
|| latest.note !== undefined
|
|
2305
|
+
|| tags.length > 0
|
|
2306
|
+
|| links.length > 0,
|
|
2307
|
+
...(latest.note ? { note: latest.note } : {}),
|
|
2308
|
+
tags,
|
|
2309
|
+
};
|
|
2310
|
+
}
|
|
2311
|
+
function resolveJunctionDailyAggregateAliasOwnerSplit(entry, index) {
|
|
2312
|
+
const ownerSplit = resolveStructuralJunctionDailyAggregateAliasOwnerSplit(entry, index);
|
|
2313
|
+
const externalRef = entry.record.externalRef;
|
|
2314
|
+
const legacyExternalRef = entry.legacyExternalRefs[0];
|
|
2315
|
+
if (!ownerSplit || !externalRef || !legacyExternalRef || !entry.record.dataOrigin) {
|
|
2316
|
+
return null;
|
|
2317
|
+
}
|
|
2318
|
+
const primaryInitial = index.aliasRepairHistoryById.get(ownerSplit.primaryOwner.record.id)?.[0]?.record;
|
|
2319
|
+
const legacyInitial = index.aliasRepairHistoryById.get(ownerSplit.legacyOwner.record.id)?.[0]?.record;
|
|
2320
|
+
const legacyDayKey = ownerSplit.legacyOwner.indexedRecord.dayKey;
|
|
2321
|
+
// Divergent initial baselines are ordinary adjacent-day owners. Once the
|
|
2322
|
+
// baselines match, every later revision must satisfy the bounded evolution
|
|
2323
|
+
// rules before this pair can reserve or mutate either identity.
|
|
2324
|
+
if (!junctionDailyAggregateAliasInitialRecordMatches(primaryInitial, {
|
|
2325
|
+
expectedDayKey: entry.record.dayKey,
|
|
2326
|
+
expectedExternalRef: externalRef,
|
|
2327
|
+
expectedObservedAtRaw: `${entry.record.dayKey}:${ownerSplit.resource}:daily`,
|
|
2328
|
+
})
|
|
2329
|
+
|| !junctionDailyAggregateAliasInitialRecordMatches(legacyInitial, {
|
|
2330
|
+
expectedDayKey: legacyDayKey,
|
|
2331
|
+
expectedExternalRef: legacyExternalRef,
|
|
2332
|
+
expectedObservedAtRaw: `${legacyDayKey}:${ownerSplit.resource}:daily`,
|
|
2333
|
+
})
|
|
2334
|
+
|| !isSameObservationFacet(primaryInitial, legacyInitial)
|
|
2335
|
+
|| junctionDailyAggregateProviderStateKey(primaryInitial)
|
|
2336
|
+
!== junctionDailyAggregateProviderStateKey(legacyInitial)
|
|
2337
|
+
|| !junctionDailyAggregateAliasPersistedOriginsMatch(primaryInitial.dataOrigin, legacyInitial.dataOrigin)) {
|
|
2338
|
+
return null;
|
|
2339
|
+
}
|
|
2340
|
+
const primaryHistory = readCompleteJunctionDailyAggregateAliasHistory(index, ownerSplit.primaryOwner.record.id);
|
|
2341
|
+
const legacyHistory = readCompleteJunctionDailyAggregateAliasHistory(index, ownerSplit.legacyOwner.record.id);
|
|
2342
|
+
const primaryOverlay = analyzeJunctionDailyAggregateAliasHistoryEvolution({
|
|
2343
|
+
allowProviderEvolution: true,
|
|
2344
|
+
expectedDayKey: entry.record.dayKey,
|
|
2345
|
+
expectedExternalRef: externalRef,
|
|
2346
|
+
expectedOrigin: entry.record.dataOrigin,
|
|
2347
|
+
expectedObservedAtRaw: `${entry.record.dayKey}:${ownerSplit.resource}:daily`,
|
|
2348
|
+
history: primaryHistory,
|
|
2349
|
+
initialProviderStateKey: junctionDailyAggregateProviderStateKey(primaryInitial),
|
|
2350
|
+
initialRecord: primaryInitial,
|
|
2351
|
+
});
|
|
2352
|
+
const legacyOverlay = analyzeJunctionDailyAggregateAliasHistoryEvolution({
|
|
2353
|
+
allowProviderEvolution: false,
|
|
2354
|
+
expectedDayKey: legacyDayKey,
|
|
2355
|
+
expectedExternalRef: legacyExternalRef,
|
|
2356
|
+
expectedOrigin: entry.record.dataOrigin,
|
|
2357
|
+
expectedObservedAtRaw: `${legacyDayKey}:${ownerSplit.resource}:daily`,
|
|
2358
|
+
history: legacyHistory,
|
|
2359
|
+
initialProviderStateKey: junctionDailyAggregateProviderStateKey(legacyInitial),
|
|
2360
|
+
initialRecord: legacyInitial,
|
|
2361
|
+
});
|
|
2362
|
+
return { ...ownerSplit, legacyOverlay, primaryOverlay };
|
|
2363
|
+
}
|
|
2364
|
+
function hasJunctionDailyAggregateAliasSplit(entry, context) {
|
|
2365
|
+
return resolveJunctionDailyAggregateAliasOwnerSplit(entry, context.index) !== null;
|
|
2366
|
+
}
|
|
2367
|
+
function mergeJunctionDailyAggregateAliasOverlays(primary, legacy) {
|
|
2368
|
+
if (primary.note && legacy.note && primary.note !== legacy.note) {
|
|
2369
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_OVERLAY_REFUSED", "Junction daily aggregate alias repair found conflicting member notes.");
|
|
2370
|
+
}
|
|
2371
|
+
const linksByKey = new Map();
|
|
2372
|
+
for (const link of [...primary.links, ...legacy.links]) {
|
|
2373
|
+
linksByKey.set(stableStringify(link), link);
|
|
2374
|
+
}
|
|
2375
|
+
return {
|
|
2376
|
+
links: [...linksByKey.entries()]
|
|
2377
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
2378
|
+
.map(([, link]) => link),
|
|
2379
|
+
memberAuthored: primary.memberAuthored || legacy.memberAuthored,
|
|
2380
|
+
...(primary.note || legacy.note ? { note: primary.note ?? legacy.note } : {}),
|
|
2381
|
+
tags: [...new Set([...primary.tags, ...legacy.tags])].sort(),
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
function buildJunctionDailyAggregateAliasRepairPlan(input) {
|
|
2385
|
+
const { aliasRepairContext, context, entry } = input;
|
|
2386
|
+
const externalRef = entry.record.externalRef;
|
|
2387
|
+
const legacyExternalRef = entry.legacyExternalRefs[0];
|
|
2388
|
+
const ownerSplit = resolveJunctionDailyAggregateAliasOwnerSplit(entry, context.index);
|
|
2389
|
+
if (!aliasRepairContext
|
|
2390
|
+
|| !externalRef
|
|
2391
|
+
|| !legacyExternalRef
|
|
2392
|
+
|| !ownerSplit) {
|
|
2393
|
+
return null;
|
|
2394
|
+
}
|
|
2395
|
+
assertJunctionDailyAggregateAliasHistoryIsUncontaminated(entry, context);
|
|
2396
|
+
const { legacyOverlay, legacyOwner, legacyRefKey, primaryOverlay, primaryOwner, primaryRefKey, } = ownerSplit;
|
|
2397
|
+
const evidence = parseJunctionDailyAggregateAliasEvidence(entry, aliasRepairContext);
|
|
2398
|
+
if (primaryOwner.record.dayKey !== evidence.dayKey
|
|
2399
|
+
|| legacyOwner.record.dayKey !== evidence.legacyDayKey
|
|
2400
|
+
|| ownerSplit.resource !== evidence.resource) {
|
|
2401
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_HISTORY_REFUSED", "Junction daily aggregate alias repair owner days did not match the normalized evidence.");
|
|
2402
|
+
}
|
|
2403
|
+
const overlay = mergeJunctionDailyAggregateAliasOverlays(primaryOverlay, legacyOverlay);
|
|
2404
|
+
const primaryRevision = (context.index.maxRevisionById.get(primaryOwner.record.id) ?? 0) + 1;
|
|
2405
|
+
const legacyRevision = (context.index.maxRevisionById.get(legacyOwner.record.id) ?? 0) + 1;
|
|
2406
|
+
const providerSurvivor = {
|
|
2407
|
+
...entry.record,
|
|
2408
|
+
id: primaryOwner.record.id,
|
|
2409
|
+
lifecycle: buildEventSpineLifecycle(primaryRevision),
|
|
2410
|
+
};
|
|
2411
|
+
const loserTombstone = {
|
|
2412
|
+
...entry.record,
|
|
2413
|
+
id: legacyOwner.record.id,
|
|
2414
|
+
lifecycle: buildEventSpineLifecycle(legacyRevision, "deleted"),
|
|
2415
|
+
};
|
|
2416
|
+
const overlaySurvivor = overlay.memberAuthored
|
|
2417
|
+
? {
|
|
2418
|
+
...providerSurvivor,
|
|
2419
|
+
source: "manual",
|
|
2420
|
+
...(overlay.note ? { note: overlay.note } : {}),
|
|
2421
|
+
...(overlay.tags.length > 0 ? { tags: overlay.tags } : {}),
|
|
2422
|
+
...(overlay.links.length > 0 ? { links: overlay.links } : {}),
|
|
2423
|
+
lifecycle: buildEventSpineLifecycle(primaryRevision + 1),
|
|
2424
|
+
}
|
|
2425
|
+
: undefined;
|
|
2426
|
+
return {
|
|
2427
|
+
legacyRefKey,
|
|
2428
|
+
loserPath: legacyOwner.relativePath || toEventLedgerFile(legacyOwner.record.occurredAt),
|
|
2429
|
+
loserTombstone,
|
|
2430
|
+
...(overlaySurvivor ? { overlaySurvivor } : {}),
|
|
2431
|
+
primaryExternalRef: externalRef,
|
|
2432
|
+
primaryRefKey,
|
|
2433
|
+
providerSurvivor,
|
|
2434
|
+
survivorPath: entry.relativePath,
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
function applyJunctionDailyAggregateAliasRepairToIndex(plan, index) {
|
|
2438
|
+
const survivor = plan.overlaySurvivor ?? plan.providerSurvivor;
|
|
2439
|
+
index.latestByRefKey.set(plan.primaryRefKey, {
|
|
2440
|
+
indexedExternalRef: plan.primaryExternalRef,
|
|
2441
|
+
indexedRecord: plan.providerSurvivor,
|
|
2442
|
+
relativePath: plan.survivorPath,
|
|
2443
|
+
record: survivor,
|
|
2444
|
+
});
|
|
2445
|
+
index.latestByRefKey.delete(plan.legacyRefKey);
|
|
2446
|
+
index.latestById.set(survivor.id, survivor);
|
|
2447
|
+
index.latestById.set(plan.loserTombstone.id, plan.loserTombstone);
|
|
2448
|
+
index.liveOwnerIdsByRefKey.set(plan.primaryRefKey, new Set([survivor.id]));
|
|
2449
|
+
index.liveOwnerIdsByRefKey.delete(plan.legacyRefKey);
|
|
2450
|
+
for (const record of [
|
|
2451
|
+
plan.providerSurvivor,
|
|
2452
|
+
...(plan.overlaySurvivor ? [plan.overlaySurvivor] : []),
|
|
2453
|
+
plan.loserTombstone,
|
|
2454
|
+
]) {
|
|
2455
|
+
const revision = eventSpineRevision(record);
|
|
2456
|
+
index.maxRevisionById.set(record.id, revision);
|
|
2457
|
+
const revisions = index.revisionsById.get(record.id) ?? new Set();
|
|
2458
|
+
revisions.add(revision);
|
|
2459
|
+
index.revisionsById.set(record.id, revisions);
|
|
2460
|
+
const history = index.aliasRepairHistoryById.get(record.id) ?? [];
|
|
2461
|
+
history.push({
|
|
2462
|
+
relativePath: record.id === plan.loserTombstone.id
|
|
2463
|
+
? plan.loserPath
|
|
2464
|
+
: plan.survivorPath,
|
|
2465
|
+
record,
|
|
2466
|
+
});
|
|
2467
|
+
index.aliasRepairHistoryById.set(record.id, history);
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
1275
2470
|
function whoopSleepTypeProviderBaselineRevision(index, refKey, eventId, incoming) {
|
|
1276
2471
|
if (incoming.kind !== "sleep_session"
|
|
1277
2472
|
|| incoming.externalRef?.system !== "whoop"
|
|
@@ -1314,6 +2509,7 @@ function resolveDeviceEventIdentity(entry, context, options = {}) {
|
|
|
1314
2509
|
const primaryMatch = reservedForLegacyClaim && reservedForLegacyClaim.entry !== entry
|
|
1315
2510
|
? undefined
|
|
1316
2511
|
: index.latestByRefKey.get(refKey);
|
|
2512
|
+
const explicitLegacyRefKeys = new Set(entry.legacyExternalRefs.map((legacyExternalRef) => eventExternalRefKey(legacyExternalRef)));
|
|
1317
2513
|
const legacyMatchedEntries = entry.legacyExternalRefs
|
|
1318
2514
|
.map((legacyExternalRef) => ({
|
|
1319
2515
|
legacyExternalRef,
|
|
@@ -1338,9 +2534,18 @@ function resolveDeviceEventIdentity(entry, context, options = {}) {
|
|
|
1338
2534
|
return (!reservation || reservation.entry === entry)
|
|
1339
2535
|
&& isCompatibleLegacyExternalRefMatch(match.indexedMatch, entry.record, match.legacyExternalRef);
|
|
1340
2536
|
});
|
|
2537
|
+
const implicitReservedEntries = [...legacyReservations.entries()]
|
|
2538
|
+
.filter(([reservedRefKey, reservation]) => reservation.entry === entry
|
|
2539
|
+
&& reservedRefKey !== refKey
|
|
2540
|
+
&& !explicitLegacyRefKeys.has(reservedRefKey))
|
|
2541
|
+
.map(([reservedRefKey, reservation]) => ({
|
|
2542
|
+
refKey: reservedRefKey,
|
|
2543
|
+
indexedMatch: reservation.indexedMatch,
|
|
2544
|
+
}));
|
|
1341
2545
|
const matchedEntries = [
|
|
1342
2546
|
...(primaryMatch ? [{ refKey, indexedMatch: primaryMatch }] : []),
|
|
1343
2547
|
...legacyMatchedEntries,
|
|
2548
|
+
...implicitReservedEntries,
|
|
1344
2549
|
];
|
|
1345
2550
|
const selectedPrimaryMatch = matchedEntries.find((match) => match.refKey === refKey);
|
|
1346
2551
|
const latest = selectedPrimaryMatch?.indexedMatch.record ?? matchedEntries[0]?.indexedMatch.record;
|
|
@@ -1447,6 +2652,8 @@ function mapCurrentDeviceEventOwners(entries, context) {
|
|
|
1447
2652
|
? []
|
|
1448
2653
|
: resolved.matchedEntries.map(({ indexedMatch }) => compareIncomingExternalRefVersion(indexedMatch.indexedExternalRef, incomingExternalRef)).filter((comparison) => comparison !== null);
|
|
1449
2654
|
const incomingHasEqualOrNewerComparableVersion = sourceVersionComparisons.some((comparison) => comparison >= 0);
|
|
2655
|
+
const incomingHasOnlyOlderComparableVersions = sourceVersionComparisons.length > 0
|
|
2656
|
+
&& !incomingHasEqualOrNewerComparableVersion;
|
|
1450
2657
|
if (sourceVersionComparisons.some((comparison) => comparison > 0)) {
|
|
1451
2658
|
incomingNewerPreparedIds.add(entry.record.id);
|
|
1452
2659
|
}
|
|
@@ -1456,6 +2663,7 @@ function mapCurrentDeviceEventOwners(entries, context) {
|
|
|
1456
2663
|
historicallyDeliveredPreparedIds.add(entry.record.id);
|
|
1457
2664
|
}
|
|
1458
2665
|
if (resolved.associationSafe
|
|
2666
|
+
&& !incomingHasOnlyOlderComparableVersions
|
|
1459
2667
|
&& !isDeletedEventSpineRecord(current)
|
|
1460
2668
|
&& deviceEventContentKey(current) === deviceEventContentKey(entry.record)) {
|
|
1461
2669
|
associationSafePreparedIds.add(entry.record.id);
|
|
@@ -1479,18 +2687,63 @@ function mapCurrentDeviceEventOwners(entries, context) {
|
|
|
1479
2687
|
// skipped; changed content normally appends an event-spine revision onto the
|
|
1480
2688
|
// existing event id instead of a new event. Callers may mark a capture's
|
|
1481
2689
|
// externalRef immutable when changed content must be rejected instead.
|
|
1482
|
-
async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, existingContext, preferredCanonicalIdByPreparedId = new Map()) {
|
|
2690
|
+
async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, existingContext, preferredCanonicalIdByPreparedId = new Map(), authoritativeEventSets = [], aliasRepairContext) {
|
|
1483
2691
|
assertCanonicalWriteLockScope(vaultRoot);
|
|
1484
2692
|
const context = existingContext ?? await buildDeviceEventIdentityContext(vaultRoot, entries);
|
|
1485
2693
|
const { index } = context;
|
|
1486
2694
|
const appendEntries = [];
|
|
1487
2695
|
const appendRecordIdByPreparedRecordId = new Map();
|
|
1488
|
-
const
|
|
2696
|
+
const recordsByEntryIndex = new Map();
|
|
1489
2697
|
const forceAppendIds = new Set();
|
|
1490
2698
|
const retainedPreparedIds = new Set();
|
|
1491
2699
|
let skippedDuplicateCount = 0;
|
|
1492
2700
|
let supersededCount = 0;
|
|
1493
|
-
|
|
2701
|
+
let retractedCount = 0;
|
|
2702
|
+
const aliasRepairByEntryIndex = new Map();
|
|
2703
|
+
for (const [entryIndex, entry] of entries.entries()) {
|
|
2704
|
+
const aliasRepair = buildJunctionDailyAggregateAliasRepairPlan({
|
|
2705
|
+
aliasRepairContext,
|
|
2706
|
+
context,
|
|
2707
|
+
entry,
|
|
2708
|
+
});
|
|
2709
|
+
if (aliasRepair) {
|
|
2710
|
+
aliasRepairByEntryIndex.set(entryIndex, aliasRepair);
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
const aliasRepairOwnerIds = new Set();
|
|
2714
|
+
for (const aliasRepair of aliasRepairByEntryIndex.values()) {
|
|
2715
|
+
for (const ownerId of [
|
|
2716
|
+
aliasRepair.providerSurvivor.id,
|
|
2717
|
+
aliasRepair.loserTombstone.id,
|
|
2718
|
+
]) {
|
|
2719
|
+
if (aliasRepairOwnerIds.has(ownerId)) {
|
|
2720
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_OWNER_REFUSED", "Junction daily aggregate alias repair operations cannot share persisted owners.");
|
|
2721
|
+
}
|
|
2722
|
+
aliasRepairOwnerIds.add(ownerId);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
for (const [entryIndex, aliasRepair] of aliasRepairByEntryIndex) {
|
|
2726
|
+
const entry = entries[entryIndex];
|
|
2727
|
+
appendEntries.push({ relativePath: aliasRepair.survivorPath, record: aliasRepair.providerSurvivor }, { relativePath: aliasRepair.loserPath, record: aliasRepair.loserTombstone });
|
|
2728
|
+
if (aliasRepair.overlaySurvivor) {
|
|
2729
|
+
appendEntries.push({
|
|
2730
|
+
relativePath: aliasRepair.survivorPath,
|
|
2731
|
+
record: aliasRepair.overlaySurvivor,
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2734
|
+
appendRecordIdByPreparedRecordId.set(entry.record.id, aliasRepair.providerSurvivor.id);
|
|
2735
|
+
forceAppendIds.add(aliasRepair.providerSurvivor.id);
|
|
2736
|
+
forceAppendIds.add(aliasRepair.loserTombstone.id);
|
|
2737
|
+
recordsByEntryIndex.set(entryIndex, aliasRepair.overlaySurvivor ?? aliasRepair.providerSurvivor);
|
|
2738
|
+
applyJunctionDailyAggregateAliasRepairToIndex(aliasRepair, index);
|
|
2739
|
+
supersededCount += 1;
|
|
2740
|
+
retractedCount += 1;
|
|
2741
|
+
}
|
|
2742
|
+
for (const [entryIndex, originalEntry] of entries.entries()) {
|
|
2743
|
+
if (aliasRepairByEntryIndex.has(entryIndex)) {
|
|
2744
|
+
continue;
|
|
2745
|
+
}
|
|
2746
|
+
let entry = originalEntry;
|
|
1494
2747
|
const externalRef = entry.record.externalRef;
|
|
1495
2748
|
if (!externalRef) {
|
|
1496
2749
|
const current = index.latestById.get(entry.record.id);
|
|
@@ -1499,20 +2752,25 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1499
2752
|
&& deviceEventContentKey(current) === deviceEventContentKey(entry.record)) {
|
|
1500
2753
|
skippedDuplicateCount += 1;
|
|
1501
2754
|
retainedPreparedIds.add(entry.record.id);
|
|
1502
|
-
|
|
2755
|
+
recordsByEntryIndex.set(entryIndex, current);
|
|
1503
2756
|
continue;
|
|
1504
2757
|
}
|
|
1505
2758
|
appendEntries.push(entry);
|
|
1506
2759
|
appendRecordIdByPreparedRecordId.set(entry.record.id, entry.record.id);
|
|
1507
|
-
|
|
2760
|
+
recordsByEntryIndex.set(entryIndex, entry.record);
|
|
1508
2761
|
continue;
|
|
1509
2762
|
}
|
|
1510
2763
|
const resolved = resolveDeviceEventIdentity(entry, context, { strict: true });
|
|
1511
2764
|
if (!resolved) {
|
|
1512
2765
|
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", "Device event identity unexpectedly lost its externalRef during reconciliation.");
|
|
1513
2766
|
}
|
|
2767
|
+
if (resolved.latest && aliasRepairOwnerIds.has(resolved.latest.id)) {
|
|
2768
|
+
throw new VaultError("EVENT_ALIAS_REPAIR_OWNER_REFUSED", "Junction daily aggregate alias repair operations cannot share persisted owners.");
|
|
2769
|
+
}
|
|
1514
2770
|
const { matchedEntries, refKey } = resolved;
|
|
1515
2771
|
let latest = resolved.latest;
|
|
2772
|
+
const migratesJunctionNoIdProfileIdentity = isIncomingJunctionNoIdProfile(entry.record)
|
|
2773
|
+
&& matchedEntries.some((match) => match.refKey !== refKey);
|
|
1516
2774
|
if (!latest) {
|
|
1517
2775
|
const canonicalRecordId = preferredCanonicalIdByPreparedId.get(entry.record.id)
|
|
1518
2776
|
?? entry.record.id;
|
|
@@ -1522,9 +2780,59 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1522
2780
|
index.latestByRefKey.set(refKey, toIndexedExternalRefMatch(canonicalRecord, externalRef));
|
|
1523
2781
|
appendEntries.push({ relativePath: entry.relativePath, record: canonicalRecord });
|
|
1524
2782
|
appendRecordIdByPreparedRecordId.set(entry.record.id, canonicalRecord.id);
|
|
1525
|
-
|
|
2783
|
+
recordsByEntryIndex.set(entryIndex, canonicalRecord);
|
|
2784
|
+
continue;
|
|
2785
|
+
}
|
|
2786
|
+
const indexedProviderMatch = matchedEntries.find((match) => match.indexedMatch.record.id === latest.id)?.indexedMatch ?? matchedEntries[0]?.indexedMatch;
|
|
2787
|
+
const replaysJunctionNoIdProfileTimestamp = indexedProviderMatch !== undefined
|
|
2788
|
+
&& isJunctionNoIdProfileEqualRevisionTimestampReplay(indexedProviderMatch.indexedRecord, entry.record);
|
|
2789
|
+
if (replaysJunctionNoIdProfileTimestamp) {
|
|
2790
|
+
skippedDuplicateCount += 1;
|
|
2791
|
+
retainedPreparedIds.add(entry.record.id);
|
|
2792
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1526
2793
|
continue;
|
|
1527
2794
|
}
|
|
2795
|
+
const matchesIndexedProviderContent = indexedProviderMatch !== undefined
|
|
2796
|
+
&& deviceEventContentKey(indexedProviderMatch.indexedRecord)
|
|
2797
|
+
=== deviceEventContentKey(entry.record);
|
|
2798
|
+
const indexedSourceVersionComparison = indexedProviderMatch
|
|
2799
|
+
? compareIncomingExternalRefVersion(indexedProviderMatch.indexedExternalRef, externalRef)
|
|
2800
|
+
: null;
|
|
2801
|
+
const migratesJunctionStableProfileTimestamp = indexedProviderMatch !== undefined
|
|
2802
|
+
&& isJunctionStableProfileCreatedAtTimestampMigration(indexedProviderMatch.indexedRecord, entry.record);
|
|
2803
|
+
const retainsDeletedJunctionStableProfile = isMemberDeletedJunctionStableProfile(latest, entry.record);
|
|
2804
|
+
if (isDeletedEventSpineRecord(latest)
|
|
2805
|
+
&& (migratesJunctionStableProfileTimestamp || retainsDeletedJunctionStableProfile)) {
|
|
2806
|
+
skippedDuplicateCount += 1;
|
|
2807
|
+
retainedPreparedIds.add(entry.record.id);
|
|
2808
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
2809
|
+
continue;
|
|
2810
|
+
}
|
|
2811
|
+
const authoritativeSet = authoritativeEventSets.find((set) => externalRef.system === set.system
|
|
2812
|
+
&& externalRef.resourceType === set.resourceType
|
|
2813
|
+
&& externalRef.resourceId === set.resourceId
|
|
2814
|
+
&& externalRef.facet !== undefined
|
|
2815
|
+
&& set.currentFacets.has(externalRef.facet));
|
|
2816
|
+
if (authoritativeSet) {
|
|
2817
|
+
const sourceVersionComparison = compareIncomingExternalRefVersion(matchedEntries.find((match) => match.refKey === refKey)?.indexedMatch.indexedExternalRef
|
|
2818
|
+
?? matchedEntries[0]?.indexedMatch.indexedExternalRef
|
|
2819
|
+
?? latest.externalRef
|
|
2820
|
+
?? externalRef, externalRef);
|
|
2821
|
+
if (sourceVersionComparison !== null && sourceVersionComparison < 0) {
|
|
2822
|
+
skippedDuplicateCount += 1;
|
|
2823
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
2824
|
+
continue;
|
|
2825
|
+
}
|
|
2826
|
+
if (sourceVersionComparison === 0
|
|
2827
|
+
&& (isDeletedEventSpineRecord(latest)
|
|
2828
|
+
|| deviceEventContentKey(latest) !== deviceEventContentKey(entry.record))
|
|
2829
|
+
&& !matchesIndexedProviderContent
|
|
2830
|
+
&& !migratesJunctionStableProfileTimestamp) {
|
|
2831
|
+
throw new VaultError("EVENT_SOURCE_REVISION_CONFLICT", `Authoritative device event externalRef "${externalRef.system}/${externalRef.resourceType}/` +
|
|
2832
|
+
`${externalRef.resourceId}#${externalRef.facet}" has conflicting content for source revision ` +
|
|
2833
|
+
`"${authoritativeSet.version}"; nothing was imported.`);
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
1528
2836
|
// externalRef identity does not include kind. Event spines are kind-stable,
|
|
1529
2837
|
// so device reconciliation must reject under-faceted provider refs instead
|
|
1530
2838
|
// of rewriting an existing event id as a different event kind.
|
|
@@ -1533,24 +2841,111 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1533
2841
|
`${externalRef.facet ? `#${externalRef.facet}` : ""}" already belongs to kind ` +
|
|
1534
2842
|
`"${latest.kind}" and cannot be rewritten as "${entry.record.kind}"; nothing was imported.`);
|
|
1535
2843
|
}
|
|
1536
|
-
|
|
2844
|
+
// An unversioned member declared current by this batch's authoritative set
|
|
2845
|
+
// reasserts a retracted facet in serialized arrival order rather than
|
|
2846
|
+
// treating the tombstone's identical content as an exact replay. Ordinary
|
|
2847
|
+
// versionless deliveries without complete-set authority never resurrect.
|
|
2848
|
+
// Only provider-owned authoritative-set retractions may be reasserted.
|
|
2849
|
+
// Their tombstones carry the set's explicit version marker on the external
|
|
2850
|
+
// reference, while a member deletion preserves the member's unversioned
|
|
2851
|
+
// reference and must stay deleted under authoritative replay.
|
|
2852
|
+
const reassertsUnversionedSetMember = Boolean(authoritativeSet
|
|
2853
|
+
&& indexedSourceVersionComparison === null
|
|
2854
|
+
&& isDeletedEventSpineRecord(latest)
|
|
2855
|
+
&& latest.source === "device"
|
|
2856
|
+
&& latest.externalRef?.version !== undefined);
|
|
2857
|
+
if (deviceEventContentKey(latest) === deviceEventContentKey(entry.record)
|
|
2858
|
+
&& (indexedSourceVersionComparison === null || indexedSourceVersionComparison === 0)
|
|
2859
|
+
&& !reassertsUnversionedSetMember) {
|
|
1537
2860
|
skippedDuplicateCount += 1;
|
|
1538
2861
|
retainedPreparedIds.add(entry.record.id);
|
|
1539
|
-
|
|
2862
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1540
2863
|
continue;
|
|
1541
2864
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
2865
|
+
if (matchesIndexedProviderContent && !reassertsUnversionedSetMember) {
|
|
2866
|
+
const historicalUserEditMatch = matchedEntries.find((match) => hasHistoricalExternalRefUserAuthoredChanges(match.indexedMatch));
|
|
2867
|
+
if (historicalUserEditMatch
|
|
2868
|
+
&& indexedSourceVersionComparison !== null
|
|
2869
|
+
&& indexedSourceVersionComparison > 0) {
|
|
2870
|
+
const providerRevision = Math.max(eventSpineRevision(latest), index.maxRevisionById.get(latest.id) ?? 0) + 1;
|
|
2871
|
+
const providerBaseline = {
|
|
2872
|
+
...entry.record,
|
|
2873
|
+
id: latest.id,
|
|
2874
|
+
lifecycle: buildEventSpineLifecycle(providerRevision),
|
|
2875
|
+
};
|
|
2876
|
+
const retainedMemberRevision = {
|
|
2877
|
+
...latest,
|
|
2878
|
+
...(migratesJunctionNoIdProfileIdentity
|
|
2879
|
+
? { externalRef, dataOrigin: entry.record.dataOrigin }
|
|
2880
|
+
: {}),
|
|
2881
|
+
lifecycle: buildEventSpineLifecycle(providerRevision + 1),
|
|
2882
|
+
};
|
|
2883
|
+
const retainedMemberPath = historicalUserEditMatch.indexedMatch.relativePath
|
|
2884
|
+
|| toEventLedgerFile(latest.occurredAt);
|
|
2885
|
+
forceAppendIds.add(latest.id);
|
|
2886
|
+
index.latestByRefKey.set(refKey, {
|
|
2887
|
+
indexedExternalRef: externalRef,
|
|
2888
|
+
indexedRecord: providerBaseline,
|
|
2889
|
+
relativePath: retainedMemberPath,
|
|
2890
|
+
record: retainedMemberRevision,
|
|
2891
|
+
});
|
|
2892
|
+
for (const { refKey: matchedRefKey, indexedMatch } of matchedEntries) {
|
|
2893
|
+
const currentMatch = index.latestByRefKey.get(matchedRefKey);
|
|
2894
|
+
if (matchedRefKey !== refKey
|
|
2895
|
+
&& indexedMatch.record.id === latest.id
|
|
2896
|
+
&& currentMatch?.record.id === latest.id) {
|
|
2897
|
+
index.latestByRefKey.delete(matchedRefKey);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
index.maxRevisionById.set(latest.id, providerRevision + 1);
|
|
2901
|
+
appendEntries.push({ relativePath: entry.relativePath, record: providerBaseline });
|
|
2902
|
+
appendEntries.push({
|
|
2903
|
+
relativePath: retainedMemberPath,
|
|
2904
|
+
record: retainedMemberRevision,
|
|
2905
|
+
});
|
|
2906
|
+
appendRecordIdByPreparedRecordId.set(entry.record.id, providerBaseline.id);
|
|
2907
|
+
recordsByEntryIndex.set(entryIndex, retainedMemberRevision);
|
|
2908
|
+
supersededCount += 1;
|
|
2909
|
+
continue;
|
|
2910
|
+
}
|
|
2911
|
+
if (indexedSourceVersionComparison === null || indexedSourceVersionComparison === 0) {
|
|
2912
|
+
skippedDuplicateCount += 1;
|
|
2913
|
+
retainedPreparedIds.add(entry.record.id);
|
|
2914
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
2915
|
+
continue;
|
|
2916
|
+
}
|
|
1550
2917
|
}
|
|
1551
2918
|
if (entry.externalRefUpdatePolicy === "immutable") {
|
|
1552
2919
|
throw new VaultError("EVENT_IMMUTABLE_EXTERNAL_REF_CONFLICT", "Immutable device event externalRef already exists with different content; nothing was imported.");
|
|
1553
2920
|
}
|
|
2921
|
+
if (indexedProviderMatch
|
|
2922
|
+
&& isJunctionSparseIntervalExternalRef(indexedProviderMatch.indexedExternalRef)
|
|
2923
|
+
&& isJunctionSparseIntervalExternalRef(externalRef)
|
|
2924
|
+
&& (indexedProviderMatch.indexedExternalRef.version !== undefined
|
|
2925
|
+
|| externalRef.version !== undefined)) {
|
|
2926
|
+
const sourceVersionComparison = compareIncomingExternalRefVersion(indexedProviderMatch.indexedExternalRef, externalRef);
|
|
2927
|
+
if (sourceVersionComparison === null) {
|
|
2928
|
+
const incomingVersion = externalRef.version;
|
|
2929
|
+
const existingVersion = indexedProviderMatch.indexedExternalRef.version;
|
|
2930
|
+
const replacesUnorderedBaseline = incomingVersion !== undefined
|
|
2931
|
+
&& isWritableIsoDateTime(incomingVersion)
|
|
2932
|
+
&& (existingVersion === undefined || !isWritableIsoDateTime(existingVersion));
|
|
2933
|
+
if (!replacesUnorderedBaseline) {
|
|
2934
|
+
throw new VaultError("EVENT_SOURCE_REVISION_UNORDERED", "Changed Junction sparse intervals require comparable explicit provider revisions; nothing was imported.");
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
if (sourceVersionComparison !== null && sourceVersionComparison < 0) {
|
|
2938
|
+
skippedDuplicateCount += 1;
|
|
2939
|
+
if (eventSpineRevisionsAreComplete(index, latest.id)) {
|
|
2940
|
+
retainedPreparedIds.add(entry.record.id);
|
|
2941
|
+
}
|
|
2942
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
2943
|
+
continue;
|
|
2944
|
+
}
|
|
2945
|
+
if (sourceVersionComparison === 0) {
|
|
2946
|
+
throw new VaultError("EVENT_SOURCE_REVISION_CONFLICT", "Junction sparse interval content conflicts at the same provider revision; nothing was imported.");
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
1554
2949
|
if (indexedProviderMatch
|
|
1555
2950
|
&& indexedProviderMatch.indexedExternalRef.system === "whoop"
|
|
1556
2951
|
&& externalRef.system === "whoop") {
|
|
@@ -1560,7 +2955,7 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1560
2955
|
if (eventSpineRevisionsAreComplete(index, latest.id)) {
|
|
1561
2956
|
retainedPreparedIds.add(entry.record.id);
|
|
1562
2957
|
}
|
|
1563
|
-
|
|
2958
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1564
2959
|
continue;
|
|
1565
2960
|
}
|
|
1566
2961
|
const sleepTypeBaselineRevision = sourceVersionComparison === 0
|
|
@@ -1586,7 +2981,7 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1586
2981
|
if (eventSpineRevisionsAreComplete(index, latest.id)) {
|
|
1587
2982
|
retainedPreparedIds.add(entry.record.id);
|
|
1588
2983
|
}
|
|
1589
|
-
|
|
2984
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1590
2985
|
continue;
|
|
1591
2986
|
}
|
|
1592
2987
|
}
|
|
@@ -1597,37 +2992,87 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1597
2992
|
if (eventSpineRevisionsAreComplete(index, latest.id)) {
|
|
1598
2993
|
retainedPreparedIds.add(entry.record.id);
|
|
1599
2994
|
}
|
|
1600
|
-
|
|
2995
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1601
2996
|
continue;
|
|
1602
2997
|
}
|
|
1603
|
-
|
|
2998
|
+
const replaysProviderOwnedRetractionWithoutSetAuthority = Boolean(isDeletedEventSpineRecord(latest)
|
|
2999
|
+
&& latest.source === "device"
|
|
3000
|
+
&& latest.externalRef?.version !== undefined
|
|
3001
|
+
&& externalRef.version === undefined
|
|
3002
|
+
&& !authoritativeSet);
|
|
3003
|
+
if (replaysProviderOwnedRetractionWithoutSetAuthority) {
|
|
3004
|
+
skippedDuplicateCount += 1;
|
|
3005
|
+
retainedPreparedIds.add(entry.record.id);
|
|
3006
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
3007
|
+
continue;
|
|
3008
|
+
}
|
|
3009
|
+
if (isDeletedEventSpineRecord(latest) && !reassertsUnversionedSetMember) {
|
|
3010
|
+
// A member-authored deletion tombstone (unversioned reference) stays
|
|
3011
|
+
// dead under authoritative replay: no append, no index change, so a
|
|
3012
|
+
// later empty-then-populated cadence cannot launder the deletion away.
|
|
3013
|
+
if (authoritativeSet && indexedSourceVersionComparison === null) {
|
|
3014
|
+
skippedDuplicateCount += 1;
|
|
3015
|
+
retainedPreparedIds.add(entry.record.id);
|
|
3016
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
3017
|
+
continue;
|
|
3018
|
+
}
|
|
1604
3019
|
index.latestByRefKey.set(refKey, toIndexedExternalRefMatch(entry.record, externalRef));
|
|
1605
3020
|
appendEntries.push(entry);
|
|
1606
3021
|
appendRecordIdByPreparedRecordId.set(entry.record.id, entry.record.id);
|
|
1607
|
-
|
|
3022
|
+
recordsByEntryIndex.set(entryIndex, entry.record);
|
|
1608
3023
|
continue;
|
|
1609
3024
|
}
|
|
3025
|
+
// A member declared current by this batch's authoritative set falls
|
|
3026
|
+
// through to the superseding append below, so the reassertion lands as
|
|
3027
|
+
// the next serialized event-spine revision over the retraction tombstone.
|
|
1610
3028
|
if (shouldKeepExistingJunctionSleepStageSummaryObservation(latest, entry.record)) {
|
|
1611
3029
|
if (eventSpineRevisionsAreComplete(index, latest.id)) {
|
|
1612
3030
|
retainedPreparedIds.add(entry.record.id);
|
|
1613
3031
|
}
|
|
1614
|
-
|
|
3032
|
+
recordsByEntryIndex.set(entryIndex, latest);
|
|
1615
3033
|
continue;
|
|
1616
3034
|
}
|
|
1617
3035
|
const historicalUserEditMatch = matchedEntries.find((match) => hasHistoricalExternalRefUserAuthoredChanges(match.indexedMatch));
|
|
1618
|
-
if (historicalUserEditMatch) {
|
|
1619
|
-
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", `Event externalRef "${externalRef.system}/${externalRef.resourceType}/${externalRef.resourceId}` +
|
|
1620
|
-
`${externalRef.facet ? `#${externalRef.facet}` : ""}" matched a historical provider identity ` +
|
|
1621
|
-
"whose latest event revision contains user-authored changes; merge must be repaired explicitly.");
|
|
1622
|
-
}
|
|
1623
3036
|
const revision = Math.max(eventSpineRevision(latest), index.maxRevisionById.get(latest.id) ?? 0) + 1;
|
|
1624
3037
|
const superseding = {
|
|
1625
3038
|
...entry.record,
|
|
1626
3039
|
id: latest.id,
|
|
1627
3040
|
lifecycle: buildEventSpineLifecycle(revision),
|
|
1628
3041
|
};
|
|
3042
|
+
const migratesRetainedMemberOccurrence = migratesJunctionStableProfileTimestamp
|
|
3043
|
+
&& indexedProviderMatch !== undefined
|
|
3044
|
+
&& latest.occurredAt === indexedProviderMatch.indexedRecord.occurredAt
|
|
3045
|
+
&& latest.dayKey === indexedProviderMatch.indexedRecord.dayKey;
|
|
3046
|
+
const retainedMemberRevision = historicalUserEditMatch
|
|
3047
|
+
? {
|
|
3048
|
+
...latest,
|
|
3049
|
+
...(migratesJunctionStableProfileTimestamp
|
|
3050
|
+
? {
|
|
3051
|
+
...(migratesRetainedMemberOccurrence
|
|
3052
|
+
? { occurredAt: entry.record.occurredAt, dayKey: entry.record.dayKey }
|
|
3053
|
+
: {}),
|
|
3054
|
+
externalRef,
|
|
3055
|
+
dataOrigin: entry.record.dataOrigin,
|
|
3056
|
+
}
|
|
3057
|
+
: migratesJunctionNoIdProfileIdentity
|
|
3058
|
+
? { externalRef, dataOrigin: entry.record.dataOrigin }
|
|
3059
|
+
: {}),
|
|
3060
|
+
lifecycle: buildEventSpineLifecycle(revision + 1),
|
|
3061
|
+
}
|
|
3062
|
+
: null;
|
|
3063
|
+
const retainedMemberPath = migratesRetainedMemberOccurrence
|
|
3064
|
+
? entry.relativePath
|
|
3065
|
+
: historicalUserEditMatch?.indexedMatch.relativePath
|
|
3066
|
+
|| toEventLedgerFile(latest.occurredAt);
|
|
1629
3067
|
forceAppendIds.add(latest.id);
|
|
1630
|
-
index.latestByRefKey.set(refKey,
|
|
3068
|
+
index.latestByRefKey.set(refKey, retainedMemberRevision
|
|
3069
|
+
? {
|
|
3070
|
+
indexedExternalRef: externalRef,
|
|
3071
|
+
indexedRecord: superseding,
|
|
3072
|
+
relativePath: retainedMemberPath,
|
|
3073
|
+
record: retainedMemberRevision,
|
|
3074
|
+
}
|
|
3075
|
+
: toIndexedExternalRefMatch(superseding, externalRef));
|
|
1631
3076
|
for (const { refKey: matchedRefKey, indexedMatch } of matchedEntries) {
|
|
1632
3077
|
const currentMatch = index.latestByRefKey.get(matchedRefKey);
|
|
1633
3078
|
if (matchedRefKey !== refKey &&
|
|
@@ -1636,12 +3081,87 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1636
3081
|
index.latestByRefKey.delete(matchedRefKey);
|
|
1637
3082
|
}
|
|
1638
3083
|
}
|
|
1639
|
-
index.maxRevisionById.set(latest.id, revision);
|
|
3084
|
+
index.maxRevisionById.set(latest.id, retainedMemberRevision ? revision + 1 : revision);
|
|
1640
3085
|
appendEntries.push({ relativePath: entry.relativePath, record: superseding });
|
|
3086
|
+
if (retainedMemberRevision) {
|
|
3087
|
+
appendEntries.push({ relativePath: retainedMemberPath, record: retainedMemberRevision });
|
|
3088
|
+
}
|
|
1641
3089
|
appendRecordIdByPreparedRecordId.set(entry.record.id, superseding.id);
|
|
1642
|
-
|
|
3090
|
+
recordsByEntryIndex.set(entryIndex, retainedMemberRevision ?? superseding);
|
|
1643
3091
|
supersededCount += 1;
|
|
1644
3092
|
}
|
|
3093
|
+
for (const set of authoritativeEventSets) {
|
|
3094
|
+
const ownsFacet = (facet) => set.facetPrefixes.some((prefix) => facet === prefix || facet.startsWith(`${prefix}-`));
|
|
3095
|
+
const candidates = [...index.latestByRefKey.entries()].filter(([, match]) => {
|
|
3096
|
+
const externalRef = match.record.externalRef;
|
|
3097
|
+
return externalRef?.system === set.system
|
|
3098
|
+
&& externalRef.resourceType === set.resourceType
|
|
3099
|
+
&& externalRef.resourceId === set.resourceId
|
|
3100
|
+
&& typeof externalRef.facet === "string"
|
|
3101
|
+
&& ownsFacet(externalRef.facet)
|
|
3102
|
+
&& !set.currentFacets.has(externalRef.facet)
|
|
3103
|
+
&& !isDeletedEventSpineRecord(match.record);
|
|
3104
|
+
});
|
|
3105
|
+
for (const [refKey, latestMatch] of candidates) {
|
|
3106
|
+
const latest = latestMatch.record;
|
|
3107
|
+
const latestRef = latest.externalRef;
|
|
3108
|
+
if (!latestRef?.facet) {
|
|
3109
|
+
continue;
|
|
3110
|
+
}
|
|
3111
|
+
const incomingRef = { ...latestRef, version: set.version };
|
|
3112
|
+
const sourceVersionComparison = compareIncomingExternalRefVersion(latestMatch.indexedExternalRef, incomingRef);
|
|
3113
|
+
if (sourceVersionComparison !== null && sourceVersionComparison < 0) {
|
|
3114
|
+
continue;
|
|
3115
|
+
}
|
|
3116
|
+
if (sourceVersionComparison === 0
|
|
3117
|
+
&& isDeletedEventSpineRecord(latestMatch.indexedRecord)) {
|
|
3118
|
+
continue;
|
|
3119
|
+
}
|
|
3120
|
+
if (sourceVersionComparison === 0) {
|
|
3121
|
+
throw new VaultError("EVENT_SOURCE_REVISION_CONFLICT", `Authoritative device event externalRef "${set.system}/${set.resourceType}/` +
|
|
3122
|
+
`${set.resourceId}#${latestRef.facet}" has conflicting membership for source revision ` +
|
|
3123
|
+
`"${set.version}"; nothing was imported.`);
|
|
3124
|
+
}
|
|
3125
|
+
const hasMemberEdit = hasHistoricalExternalRefUserAuthoredChanges(latestMatch);
|
|
3126
|
+
const revision = Math.max(eventSpineRevision(latest), index.maxRevisionById.get(latest.id) ?? 0) + 1;
|
|
3127
|
+
const tombstone = {
|
|
3128
|
+
...latestMatch.indexedRecord,
|
|
3129
|
+
source: "device",
|
|
3130
|
+
recordedAt: set.version,
|
|
3131
|
+
externalRef: incomingRef,
|
|
3132
|
+
lifecycle: buildEventSpineLifecycle(revision, "deleted"),
|
|
3133
|
+
};
|
|
3134
|
+
const retainedMemberRevision = hasMemberEdit
|
|
3135
|
+
? {
|
|
3136
|
+
...latest,
|
|
3137
|
+
lifecycle: buildEventSpineLifecycle(revision + 1),
|
|
3138
|
+
}
|
|
3139
|
+
: null;
|
|
3140
|
+
const latestPath = latestMatch.relativePath || toEventLedgerFile(latest.occurredAt);
|
|
3141
|
+
forceAppendIds.add(latest.id);
|
|
3142
|
+
index.latestByRefKey.set(refKey, retainedMemberRevision
|
|
3143
|
+
? {
|
|
3144
|
+
indexedExternalRef: incomingRef,
|
|
3145
|
+
indexedRecord: tombstone,
|
|
3146
|
+
relativePath: latestPath,
|
|
3147
|
+
record: retainedMemberRevision,
|
|
3148
|
+
}
|
|
3149
|
+
: toIndexedExternalRefMatch(tombstone, incomingRef, latestPath));
|
|
3150
|
+
index.maxRevisionById.set(latest.id, retainedMemberRevision ? revision + 1 : revision);
|
|
3151
|
+
appendEntries.push({ relativePath: latestPath, record: tombstone });
|
|
3152
|
+
if (retainedMemberRevision) {
|
|
3153
|
+
appendEntries.push({ relativePath: latestPath, record: retainedMemberRevision });
|
|
3154
|
+
}
|
|
3155
|
+
retractedCount += 1;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
const records = entries.map((entry, entryIndex) => {
|
|
3159
|
+
const record = recordsByEntryIndex.get(entryIndex);
|
|
3160
|
+
if (!record) {
|
|
3161
|
+
throw new VaultError("EVENT_EXTERNAL_REF_ALIAS_CONFLICT", `Device event reconciliation did not produce a result for "${entry.record.id}".`);
|
|
3162
|
+
}
|
|
3163
|
+
return record;
|
|
3164
|
+
});
|
|
1645
3165
|
return {
|
|
1646
3166
|
appendEntries,
|
|
1647
3167
|
appendRecordIdByPreparedRecordId,
|
|
@@ -1650,6 +3170,7 @@ async function reconcileDeviceEventEntriesByExternalRef(vaultRoot, entries, exis
|
|
|
1650
3170
|
retainedPreparedIds,
|
|
1651
3171
|
skippedDuplicateCount,
|
|
1652
3172
|
supersededCount,
|
|
3173
|
+
retractedCount,
|
|
1653
3174
|
};
|
|
1654
3175
|
}
|
|
1655
3176
|
// Public bulk import reconciles externalRef identity vault-wide, not per
|
|
@@ -1665,6 +3186,22 @@ async function reconcileEventImportDecisionsByExternalRef(vaultRoot, decisions,
|
|
|
1665
3186
|
signal,
|
|
1666
3187
|
});
|
|
1667
3188
|
const index = await indexLatestEventsByExternalRef(vaultRoot, shardPaths, signal);
|
|
3189
|
+
for (const decision of decisions) {
|
|
3190
|
+
signal?.throwIfAborted();
|
|
3191
|
+
if (decision.action !== "upsert" || !decision.expectedLatest) {
|
|
3192
|
+
continue;
|
|
3193
|
+
}
|
|
3194
|
+
const externalRef = decision.entry.record.externalRef;
|
|
3195
|
+
const latestById = index.latestById.get(decision.expectedLatest.eventId);
|
|
3196
|
+
const latestByRef = externalRef
|
|
3197
|
+
? index.latestByRefKey.get(eventExternalRefKey(externalRef))?.record
|
|
3198
|
+
: undefined;
|
|
3199
|
+
if (!latestById
|
|
3200
|
+
|| latestById.id !== latestByRef?.id
|
|
3201
|
+
|| eventSpineRevision(latestById) !== decision.expectedLatest.lifecycleRevision) {
|
|
3202
|
+
throw new VaultError("EVENT_EXPECTED_LATEST_MISMATCH", "An imported event changed after it was inspected; the whole batch was rejected without writes.");
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
1668
3205
|
const appendEntries = [];
|
|
1669
3206
|
const forceAppendIds = new Set();
|
|
1670
3207
|
const eventIds = [];
|
|
@@ -2003,6 +3540,9 @@ function buildDeviceBatchAuditSummary(input) {
|
|
|
2003
3540
|
if (input.supersededCount > 0) {
|
|
2004
3541
|
dedupeNotes.push(`${input.supersededCount} event(s) updated in place by externalRef`);
|
|
2005
3542
|
}
|
|
3543
|
+
if (input.retractedCount > 0) {
|
|
3544
|
+
dedupeNotes.push(`${input.retractedCount} omitted authoritative event(s) retracted`);
|
|
3545
|
+
}
|
|
2006
3546
|
const dedupeSuffix = dedupeNotes.length > 0 ? ` (${dedupeNotes.join(", ")})` : "";
|
|
2007
3547
|
return `Imported ${input.provider} device batch with ${input.eventCount} event(s) and ${input.sampleCount} sample(s)${dedupeSuffix}.`;
|
|
2008
3548
|
}
|
|
@@ -2034,7 +3574,7 @@ function buildLegacyReceiptFingerprint(receipt, provider) {
|
|
|
2034
3574
|
sha256: createHash("sha256").update(content).digest("hex"),
|
|
2035
3575
|
}];
|
|
2036
3576
|
}
|
|
2037
|
-
function prepareDeviceBatchPlan({ provider, accountId, importedAt = new Date(), defaultTimeZone: fallbackTimeZone, source = "device", events = [], samples = [], evidenceParts = [], ingestReceipt, provenance, }) {
|
|
3577
|
+
function prepareDeviceBatchPlan({ provider, accountId, importedAt = new Date(), defaultTimeZone: fallbackTimeZone, source = "device", events = [], samples = [], evidenceParts = [], authoritativeEventSets = [], ingestReceipt, provenance, }) {
|
|
2038
3578
|
const normalizedInputs = normalizeDeviceBatchInputs({
|
|
2039
3579
|
provider,
|
|
2040
3580
|
accountId,
|
|
@@ -2044,6 +3584,7 @@ function prepareDeviceBatchPlan({ provider, accountId, importedAt = new Date(),
|
|
|
2044
3584
|
events,
|
|
2045
3585
|
samples,
|
|
2046
3586
|
evidenceParts,
|
|
3587
|
+
authoritativeEventSets,
|
|
2047
3588
|
ingestReceipt,
|
|
2048
3589
|
provenance,
|
|
2049
3590
|
});
|
|
@@ -2080,6 +3621,18 @@ function prepareDeviceBatchPlan({ provider, accountId, importedAt = new Date(),
|
|
|
2080
3621
|
receipt: compactedIngestReceipt ?? null,
|
|
2081
3622
|
eventIds: normalizedInputs.events.map(({ recordId }) => recordId),
|
|
2082
3623
|
sampleIds: normalizedInputs.samples.map(({ recordId }) => recordId),
|
|
3624
|
+
...(normalizedInputs.authoritativeEventSets.length === 0
|
|
3625
|
+
? {}
|
|
3626
|
+
: {
|
|
3627
|
+
authoritativeEventSets: normalizedInputs.authoritativeEventSets.map((set) => ({
|
|
3628
|
+
system: set.system,
|
|
3629
|
+
resourceType: set.resourceType,
|
|
3630
|
+
resourceId: set.resourceId,
|
|
3631
|
+
version: set.version,
|
|
3632
|
+
facetPrefixes: set.facetPrefixes,
|
|
3633
|
+
currentFacets: [...set.currentFacets].sort(),
|
|
3634
|
+
})),
|
|
3635
|
+
}),
|
|
2083
3636
|
evidenceParts: fingerprint,
|
|
2084
3637
|
}));
|
|
2085
3638
|
const importId = buildImportId(rawArtifactFingerprint);
|
|
@@ -2101,10 +3654,399 @@ function prepareDeviceBatchPlan({ provider, accountId, importedAt = new Date(),
|
|
|
2101
3654
|
evidenceRolesByPreparedRecordId: eventPlan.evidenceRolesByPreparedRecordId,
|
|
2102
3655
|
preparedSamples,
|
|
2103
3656
|
preparedEvidenceParts,
|
|
3657
|
+
authoritativeEventSets: normalizedInputs.authoritativeEventSets,
|
|
3658
|
+
};
|
|
3659
|
+
}
|
|
3660
|
+
async function hashSourceFile(sourcePath) {
|
|
3661
|
+
const hash = createHash("sha256");
|
|
3662
|
+
let byteLength = 0;
|
|
3663
|
+
await new Promise((resolve, reject) => {
|
|
3664
|
+
const stream = createReadStream(sourcePath);
|
|
3665
|
+
stream.on("data", (chunk) => {
|
|
3666
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
3667
|
+
byteLength += bytes.byteLength;
|
|
3668
|
+
hash.update(bytes);
|
|
3669
|
+
});
|
|
3670
|
+
stream.on("error", reject);
|
|
3671
|
+
stream.on("end", resolve);
|
|
3672
|
+
});
|
|
3673
|
+
return { byteLength, sha256: hash.digest("hex") };
|
|
3674
|
+
}
|
|
3675
|
+
const DOCUMENT_SOURCE_AUDIT_COMMAND = "core.importDocument";
|
|
3676
|
+
const WORKOUT_SOURCE_IMPORT_AUDIT_COMMAND = "core.importEventBatch.sourceRawRefOnce";
|
|
3677
|
+
function buildRawSourceReceiptTarget(sourceReceipt) {
|
|
3678
|
+
return `raw-source-v1:sha256:${sourceReceipt.sha256}:bytes:${sourceReceipt.byteLength}`;
|
|
3679
|
+
}
|
|
3680
|
+
function rejectDamagedExactDocumentEvidence(input) {
|
|
3681
|
+
throw new VaultError("RAW_MANIFEST_INVALID", "Preserved exact source evidence is incomplete or damaged. Exact reuse will not create a replacement identity.", {
|
|
3682
|
+
documentId: input.documentId,
|
|
3683
|
+
...(input.manifestPath ? { manifestPath: input.manifestPath } : {}),
|
|
3684
|
+
reason: input.reason,
|
|
3685
|
+
});
|
|
3686
|
+
}
|
|
3687
|
+
async function inspectExactSourceAuditEvidence(input) {
|
|
3688
|
+
const targetId = buildRawSourceReceiptTarget(input.sourceReceipt);
|
|
3689
|
+
const auditPaths = await walkVaultFiles(input.vaultRoot, VAULT_LAYOUT.auditDirectory, {
|
|
3690
|
+
extension: ".jsonl",
|
|
3691
|
+
});
|
|
3692
|
+
const completionTargetEventIds = new Set();
|
|
3693
|
+
const documentIdsByEventId = new Map();
|
|
3694
|
+
for (const relativePath of auditPaths) {
|
|
3695
|
+
for (const rawRecord of await readJsonlRecords({ vaultRoot: input.vaultRoot, relativePath })) {
|
|
3696
|
+
const parsed = safeParseContract(auditRecordSchema, rawRecord);
|
|
3697
|
+
if (!parsed.success
|
|
3698
|
+
|| parsed.data.status !== "success"
|
|
3699
|
+
|| parsed.data.targetIds?.includes(targetId) !== true) {
|
|
3700
|
+
continue;
|
|
3701
|
+
}
|
|
3702
|
+
const targetIds = parsed.data.targetIds;
|
|
3703
|
+
if (parsed.data.commandName === DOCUMENT_SOURCE_AUDIT_COMMAND) {
|
|
3704
|
+
let documentId;
|
|
3705
|
+
let eventId;
|
|
3706
|
+
try {
|
|
3707
|
+
if (targetIds.length !== 3 || targetIds[0] !== targetId) {
|
|
3708
|
+
throw new TypeError("source receipt audit must retain exactly one owner");
|
|
3709
|
+
}
|
|
3710
|
+
documentId = assertContractId(targetIds[1], ID_PREFIXES.document, "documentId");
|
|
3711
|
+
eventId = assertContractId(targetIds[2], ID_PREFIXES.event, "eventId");
|
|
3712
|
+
}
|
|
3713
|
+
catch {
|
|
3714
|
+
rejectDamagedExactDocumentEvidence({
|
|
3715
|
+
documentId: typeof targetIds[1] === "string" ? targetIds[1] : "unknown",
|
|
3716
|
+
reason: "source receipt audit does not retain one valid document owner",
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
const existing = documentIdsByEventId.get(eventId);
|
|
3720
|
+
if (existing && existing !== documentId) {
|
|
3721
|
+
rejectDamagedExactDocumentEvidence({
|
|
3722
|
+
documentId,
|
|
3723
|
+
reason: "source receipt audit assigns one event to multiple document owners",
|
|
3724
|
+
});
|
|
3725
|
+
}
|
|
3726
|
+
documentIdsByEventId.set(eventId, documentId);
|
|
3727
|
+
continue;
|
|
3728
|
+
}
|
|
3729
|
+
if (parsed.data.commandName === WORKOUT_SOURCE_IMPORT_AUDIT_COMMAND) {
|
|
3730
|
+
for (const candidate of targetIds.slice(1)) {
|
|
3731
|
+
try {
|
|
3732
|
+
completionTargetEventIds.add(assertContractId(candidate, ID_PREFIXES.event, "eventId"));
|
|
3733
|
+
}
|
|
3734
|
+
catch {
|
|
3735
|
+
// The bounded audit target list may contain non-event context.
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
return { completionTargetEventIds, documentIdsByEventId };
|
|
3742
|
+
}
|
|
3743
|
+
async function inspectExactDocumentSourceSet(input) {
|
|
3744
|
+
const auditEvidence = await inspectExactSourceAuditEvidence(input);
|
|
3745
|
+
const emptyActivityIndex = new Map();
|
|
3746
|
+
if (auditEvidence.documentIdsByEventId.size === 0
|
|
3747
|
+
&& auditEvidence.completionTargetEventIds.size === 0) {
|
|
3748
|
+
return {
|
|
3749
|
+
activityEventIdsByRawRef: emptyActivityIndex,
|
|
3750
|
+
completionAuditEventIds: new Set(),
|
|
3751
|
+
deletedExactSourceExists: false,
|
|
3752
|
+
liveSources: [],
|
|
3753
|
+
};
|
|
3754
|
+
}
|
|
3755
|
+
const shardPaths = await walkVaultFiles(input.vaultRoot, VAULT_LAYOUT.eventLedgerDirectory, {
|
|
3756
|
+
extension: ".jsonl",
|
|
3757
|
+
});
|
|
3758
|
+
const entries = [];
|
|
3759
|
+
const activityEventIds = new Set();
|
|
3760
|
+
const activityEventIdsByRawRef = new Map();
|
|
3761
|
+
for (const relativePath of shardPaths) {
|
|
3762
|
+
for (const rawRecord of await readJsonlRecords({ vaultRoot: input.vaultRoot, relativePath })) {
|
|
3763
|
+
const parsed = safeParseContract(eventRecordSchema, rawRecord);
|
|
3764
|
+
const rawEventId = typeof rawRecord === "object"
|
|
3765
|
+
&& rawRecord !== null
|
|
3766
|
+
&& "id" in rawRecord
|
|
3767
|
+
&& typeof rawRecord.id === "string"
|
|
3768
|
+
? rawRecord.id
|
|
3769
|
+
: null;
|
|
3770
|
+
if (!parsed.success) {
|
|
3771
|
+
if (rawEventId && auditEvidence.documentIdsByEventId.has(rawEventId)) {
|
|
3772
|
+
rejectDamagedExactDocumentEvidence({
|
|
3773
|
+
documentId: auditEvidence.documentIdsByEventId.get(rawEventId) ?? "unknown",
|
|
3774
|
+
reason: "source receipt audit points to a contract-invalid document event",
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3777
|
+
continue;
|
|
3778
|
+
}
|
|
3779
|
+
if (parsed.data.kind === "document"
|
|
3780
|
+
&& auditEvidence.documentIdsByEventId.has(parsed.data.id)) {
|
|
3781
|
+
entries.push({ relativePath, record: parsed.data });
|
|
3782
|
+
}
|
|
3783
|
+
if (parsed.data.kind === "activity_session") {
|
|
3784
|
+
activityEventIds.add(parsed.data.id);
|
|
3785
|
+
for (const rawRef of collectEventRawReferencePaths(parsed.data)) {
|
|
3786
|
+
const ids = activityEventIdsByRawRef.get(rawRef) ?? new Set();
|
|
3787
|
+
ids.add(parsed.data.id);
|
|
3788
|
+
activityEventIdsByRawRef.set(rawRef, ids);
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
const completionAuditEventIds = new Set([...auditEvidence.completionTargetEventIds].filter((eventId) => activityEventIds.has(eventId)));
|
|
3794
|
+
if (auditEvidence.documentIdsByEventId.size === 0) {
|
|
3795
|
+
if (completionAuditEventIds.size > 0) {
|
|
3796
|
+
rejectDamagedExactDocumentEvidence({
|
|
3797
|
+
documentId: "unknown",
|
|
3798
|
+
reason: "whole-source completion survives without its source receipt owner",
|
|
3799
|
+
});
|
|
3800
|
+
}
|
|
3801
|
+
return {
|
|
3802
|
+
activityEventIdsByRawRef,
|
|
3803
|
+
completionAuditEventIds,
|
|
3804
|
+
deletedExactSourceExists: false,
|
|
3805
|
+
liveSources: [],
|
|
3806
|
+
};
|
|
3807
|
+
}
|
|
3808
|
+
// Exact-source identity needs the latest revision even when it is a
|
|
3809
|
+
// tombstone. The ordinary collapse helper intentionally removes deleted
|
|
3810
|
+
// records, which would make a deleted source look like it never existed.
|
|
3811
|
+
const latestDocuments = new Map();
|
|
3812
|
+
for (const entry of entries) {
|
|
3813
|
+
const current = latestDocuments.get(entry.record.id);
|
|
3814
|
+
if (!current || compareEventSpineEntries(current, entry) < 0) {
|
|
3815
|
+
latestDocuments.set(entry.record.id, entry);
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
// The content-derived import audit owns source recreation identity. Its
|
|
3819
|
+
// document/event targets select the lifecycle row; that row derives the one
|
|
3820
|
+
// manifest and raw artifact to verify. No vault-wide manifest discovery or
|
|
3821
|
+
// compatibility reader participates in the decision.
|
|
3822
|
+
const claims = new Map();
|
|
3823
|
+
for (const [eventId, documentId] of auditEvidence.documentIdsByEventId) {
|
|
3824
|
+
let origin = null;
|
|
3825
|
+
let raw = null;
|
|
3826
|
+
for (const entry of entries) {
|
|
3827
|
+
if (entry.record.id !== eventId || entry.record.documentId !== documentId) {
|
|
3828
|
+
continue;
|
|
3829
|
+
}
|
|
3830
|
+
const candidateRaw = entry.record.attachments?.find((attachment) => attachment.role === "source_document"
|
|
3831
|
+
&& attachment.sha256 === input.sourceReceipt.sha256);
|
|
3832
|
+
if (candidateRaw
|
|
3833
|
+
&& (!origin || compareEventSpineEntries(entry, origin) < 0)) {
|
|
3834
|
+
origin = entry;
|
|
3835
|
+
raw = candidateRaw;
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
if (!origin || !raw) {
|
|
3839
|
+
rejectDamagedExactDocumentEvidence({
|
|
3840
|
+
documentId,
|
|
3841
|
+
reason: "source receipt audit has no matching canonical document event",
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
claims.set(eventId, { entry: origin, raw });
|
|
3845
|
+
}
|
|
3846
|
+
const verified = new Map();
|
|
3847
|
+
for (const claim of [...claims.values()]
|
|
3848
|
+
.sort((left, right) => left.entry.record.id.localeCompare(right.entry.record.id))) {
|
|
3849
|
+
const documentId = claim.entry.record.documentId;
|
|
3850
|
+
const manifestPath = resolveRawManifestPath({
|
|
3851
|
+
artifacts: [claim.raw],
|
|
3852
|
+
importId: documentId,
|
|
3853
|
+
importedAt: claim.entry.record.recordedAt,
|
|
3854
|
+
});
|
|
3855
|
+
const latest = latestDocuments.get(claim.entry.record.id);
|
|
3856
|
+
if (!latest
|
|
3857
|
+
|| latest.record.documentId !== documentId
|
|
3858
|
+
|| !claim.entry.record.rawRefs?.includes(claim.raw.relativePath)) {
|
|
3859
|
+
rejectDamagedExactDocumentEvidence({
|
|
3860
|
+
documentId,
|
|
3861
|
+
manifestPath,
|
|
3862
|
+
reason: "canonical document history does not retain one stable source owner",
|
|
3863
|
+
});
|
|
3864
|
+
}
|
|
3865
|
+
let manifestText;
|
|
3866
|
+
try {
|
|
3867
|
+
manifestText = await readUtf8File(input.vaultRoot, manifestPath);
|
|
3868
|
+
}
|
|
3869
|
+
catch (error) {
|
|
3870
|
+
if (error instanceof VaultError && error.code === "VAULT_FILE_MISSING") {
|
|
3871
|
+
rejectDamagedExactDocumentEvidence({
|
|
3872
|
+
documentId,
|
|
3873
|
+
manifestPath,
|
|
3874
|
+
reason: "required raw manifest is missing",
|
|
3875
|
+
});
|
|
3876
|
+
}
|
|
3877
|
+
throw error;
|
|
3878
|
+
}
|
|
3879
|
+
let manifest;
|
|
3880
|
+
try {
|
|
3881
|
+
manifest = parseRawImportManifest(JSON.parse(manifestText));
|
|
3882
|
+
}
|
|
3883
|
+
catch {
|
|
3884
|
+
rejectDamagedExactDocumentEvidence({
|
|
3885
|
+
documentId,
|
|
3886
|
+
manifestPath,
|
|
3887
|
+
reason: "required raw manifest is malformed",
|
|
3888
|
+
});
|
|
3889
|
+
}
|
|
3890
|
+
const sourceArtifacts = manifest.artifacts.filter((artifact) => artifact.role === "source_document");
|
|
3891
|
+
const artifact = sourceArtifacts[0];
|
|
3892
|
+
let resolvedManifestPath = null;
|
|
3893
|
+
try {
|
|
3894
|
+
resolvedManifestPath = resolveRawManifestPath({
|
|
3895
|
+
artifacts: manifest.artifacts,
|
|
3896
|
+
rawDirectory: manifest.rawDirectory,
|
|
3897
|
+
importId: manifest.importId,
|
|
3898
|
+
importedAt: manifest.importedAt,
|
|
3899
|
+
});
|
|
3900
|
+
}
|
|
3901
|
+
catch {
|
|
3902
|
+
// The shared resolver supplies the semantic owner/directory check below.
|
|
3903
|
+
}
|
|
3904
|
+
if (manifest.importKind !== "document"
|
|
3905
|
+
|| manifest.importId !== documentId
|
|
3906
|
+
|| manifest.importedAt !== claim.entry.record.recordedAt
|
|
3907
|
+
|| manifest.owner.kind !== "document"
|
|
3908
|
+
|| manifest.owner.id !== documentId
|
|
3909
|
+
|| !rawDirectoryMatchesOwner(manifest.rawDirectory, manifest.owner)
|
|
3910
|
+
|| resolvedManifestPath !== manifestPath
|
|
3911
|
+
|| sourceArtifacts.length !== 1
|
|
3912
|
+
|| !artifact
|
|
3913
|
+
|| artifact.relativePath !== claim.raw.relativePath
|
|
3914
|
+
|| artifact.originalFileName !== claim.raw.originalFileName
|
|
3915
|
+
|| artifact.mediaType !== claim.raw.mediaType
|
|
3916
|
+
|| artifact.byteSize !== input.sourceReceipt.byteLength
|
|
3917
|
+
|| artifact.sha256 !== input.sourceReceipt.sha256) {
|
|
3918
|
+
rejectDamagedExactDocumentEvidence({
|
|
3919
|
+
documentId,
|
|
3920
|
+
manifestPath,
|
|
3921
|
+
reason: "raw manifest does not match its canonical document owner",
|
|
3922
|
+
});
|
|
3923
|
+
}
|
|
3924
|
+
const integrity = await statAndHashVaultFile(input.vaultRoot, artifact.relativePath);
|
|
3925
|
+
if (!integrity) {
|
|
3926
|
+
throw new VaultError("RAW_REFERENCE_MISSING", "Preserved exact source evidence is missing its immutable raw artifact. Exact reuse will not create a replacement identity.", { documentId, manifestPath, relativePath: artifact.relativePath });
|
|
3927
|
+
}
|
|
3928
|
+
if (integrity.byteSize !== artifact.byteSize
|
|
3929
|
+
|| integrity.sha256 !== artifact.sha256) {
|
|
3930
|
+
rejectDamagedExactDocumentEvidence({
|
|
3931
|
+
documentId,
|
|
3932
|
+
manifestPath,
|
|
3933
|
+
reason: "raw artifact bytes do not match the immutable manifest",
|
|
3934
|
+
});
|
|
3935
|
+
}
|
|
3936
|
+
const latestRaw = latest.record.attachments?.find((attachment) => attachment.role === "source_document"
|
|
3937
|
+
&& attachment.relativePath === artifact.relativePath
|
|
3938
|
+
&& attachment.sha256 === artifact.sha256);
|
|
3939
|
+
if (!latest.record.rawRefs?.includes(artifact.relativePath) || !latestRaw) {
|
|
3940
|
+
rejectDamagedExactDocumentEvidence({
|
|
3941
|
+
documentId,
|
|
3942
|
+
manifestPath,
|
|
3943
|
+
reason: "latest document lifecycle no longer retains its source attachment",
|
|
3944
|
+
});
|
|
3945
|
+
}
|
|
3946
|
+
verified.set(claim.entry.record.id, {
|
|
3947
|
+
latest,
|
|
3948
|
+
manifestPath,
|
|
3949
|
+
raw: claim.raw,
|
|
3950
|
+
});
|
|
3951
|
+
}
|
|
3952
|
+
// A deleted identity must fence the whole exact-byte equivalence set. An
|
|
3953
|
+
// ordinary import may have created a live alias later, but returning that
|
|
3954
|
+
// alias would reset raw-reference-scoped workout completion.
|
|
3955
|
+
const deletedExactSourceExists = [...verified.values()].some(({ latest }) => isDeletedEventSpineRecord(latest.record));
|
|
3956
|
+
const liveSources = [];
|
|
3957
|
+
for (const stored of verified.values()) {
|
|
3958
|
+
const entry = stored.latest;
|
|
3959
|
+
if (isDeletedEventSpineRecord(entry.record)) {
|
|
3960
|
+
continue;
|
|
3961
|
+
}
|
|
3962
|
+
liveSources.push({
|
|
3963
|
+
rawRef: stored.raw.relativePath,
|
|
3964
|
+
result: {
|
|
3965
|
+
created: false,
|
|
3966
|
+
documentId: entry.record.documentId,
|
|
3967
|
+
raw: {
|
|
3968
|
+
relativePath: stored.raw.relativePath,
|
|
3969
|
+
originalFileName: stored.raw.originalFileName,
|
|
3970
|
+
mediaType: stored.raw.mediaType,
|
|
3971
|
+
},
|
|
3972
|
+
event: entry.record,
|
|
3973
|
+
eventPath: entry.relativePath,
|
|
3974
|
+
auditPath: null,
|
|
3975
|
+
manifestPath: stored.manifestPath,
|
|
3976
|
+
},
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
return {
|
|
3980
|
+
activityEventIdsByRawRef,
|
|
3981
|
+
completionAuditEventIds,
|
|
3982
|
+
deletedExactSourceExists,
|
|
3983
|
+
liveSources,
|
|
3984
|
+
};
|
|
3985
|
+
}
|
|
3986
|
+
async function findExactDocumentImport(input) {
|
|
3987
|
+
const exactSources = await inspectExactDocumentSourceSet(input);
|
|
3988
|
+
if (exactSources.deletedExactSourceExists) {
|
|
3989
|
+
throw new VaultError("DOCUMENT_EXACT_SOURCE_DELETED", "An exact source document existed but was deleted. Exact reuse will not create a replacement identity.");
|
|
3990
|
+
}
|
|
3991
|
+
return exactSources.liveSources[0]?.result ?? null;
|
|
3992
|
+
}
|
|
3993
|
+
export const WORKOUT_SOURCE_IMPORT_STATUS_VALUES = [
|
|
3994
|
+
"not_imported",
|
|
3995
|
+
"completed",
|
|
3996
|
+
"partial_conflict",
|
|
3997
|
+
];
|
|
3998
|
+
async function inspectWorkoutSourceImportStatus(input) {
|
|
3999
|
+
const sourceIntegrity = await statAndHashVaultFile(input.vaultRoot, input.rawRef);
|
|
4000
|
+
if (sourceIntegrity === null) {
|
|
4001
|
+
throw new VaultError("EVENT_BATCH_SOURCE_RAW_REF_MISSING", "The workout source does not exist as a vault file.");
|
|
4002
|
+
}
|
|
4003
|
+
const sourceReceipt = {
|
|
4004
|
+
byteLength: sourceIntegrity.byteSize,
|
|
4005
|
+
sha256: sourceIntegrity.sha256,
|
|
4006
|
+
};
|
|
4007
|
+
const exactSources = await inspectExactDocumentSourceSet({
|
|
4008
|
+
vaultRoot: input.vaultRoot,
|
|
4009
|
+
sourceReceipt,
|
|
4010
|
+
});
|
|
4011
|
+
if (!exactSources.liveSources.some((source) => source.rawRef === input.rawRef)) {
|
|
4012
|
+
throw new VaultError("EVENT_BATCH_SOURCE_DOCUMENT_NOT_LIVE", "The workout source is no longer owned by a live source document.");
|
|
4013
|
+
}
|
|
4014
|
+
if (exactSources.deletedExactSourceExists) {
|
|
4015
|
+
throw new VaultError("DOCUMENT_EXACT_SOURCE_DELETED", "An exact source document existed but was deleted. Workout import will not reuse a replacement identity.");
|
|
4016
|
+
}
|
|
4017
|
+
const completionTargetId = buildRawSourceReceiptTarget(sourceReceipt);
|
|
4018
|
+
const exactRawRefs = new Set(exactSources.liveSources.map((source) => source.rawRef));
|
|
4019
|
+
const sourceEventIds = new Set();
|
|
4020
|
+
for (const rawRef of exactRawRefs) {
|
|
4021
|
+
for (const eventId of exactSources.activityEventIdsByRawRef.get(rawRef) ?? []) {
|
|
4022
|
+
sourceEventIds.add(eventId);
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
if ([...exactSources.completionAuditEventIds].some((eventId) => sourceEventIds.has(eventId))) {
|
|
4026
|
+
return { status: "completed", completionTargetId };
|
|
4027
|
+
}
|
|
4028
|
+
return {
|
|
4029
|
+
status: sourceEventIds.size > 0 ? "partial_conflict" : "not_imported",
|
|
4030
|
+
completionTargetId,
|
|
2104
4031
|
};
|
|
2105
4032
|
}
|
|
2106
|
-
export async function
|
|
4033
|
+
export async function resolveWorkoutSourceImportStatus(input) {
|
|
4034
|
+
return (await inspectWorkoutSourceImportStatus(input)).status;
|
|
4035
|
+
}
|
|
4036
|
+
export async function importDocument({ vaultRoot, sourcePath, occurredAt = new Date(), title, note, source = "import", reuseExact = false, }) {
|
|
2107
4037
|
const vault = await loadVault({ vaultRoot });
|
|
4038
|
+
const sourceReceipt = await hashSourceFile(sourcePath);
|
|
4039
|
+
if (reuseExact) {
|
|
4040
|
+
const existing = await findExactDocumentImport({ vaultRoot, sourceReceipt });
|
|
4041
|
+
if (existing) {
|
|
4042
|
+
const verifiedSourceReceipt = await hashSourceFile(sourcePath);
|
|
4043
|
+
if (verifiedSourceReceipt.byteLength !== sourceReceipt.byteLength
|
|
4044
|
+
|| verifiedSourceReceipt.sha256 !== sourceReceipt.sha256) {
|
|
4045
|
+
throw new VaultError("DOCUMENT_SOURCE_CHANGED", "Document source changed while exact reuse was being verified.");
|
|
4046
|
+
}
|
|
4047
|
+
return existing;
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
2108
4050
|
const documentId = generateRecordId(ID_PREFIXES.document);
|
|
2109
4051
|
const eventId = generateRecordId(ID_PREFIXES.event);
|
|
2110
4052
|
const preparedAttachments = prepareEventAttachments({
|
|
@@ -2116,6 +4058,7 @@ export async function importDocument({ vaultRoot, sourcePath, occurredAt = new D
|
|
|
2116
4058
|
role: "source_document",
|
|
2117
4059
|
kind: "document",
|
|
2118
4060
|
sourcePath,
|
|
4061
|
+
expectedSourceReceipt: sourceReceipt,
|
|
2119
4062
|
},
|
|
2120
4063
|
],
|
|
2121
4064
|
});
|
|
@@ -2164,6 +4107,14 @@ export async function importDocument({ vaultRoot, sourcePath, occurredAt = new D
|
|
|
2164
4107
|
if (!stagedAttachments) {
|
|
2165
4108
|
throw new VaultError("EVENT_ATTACHMENTS_MISSING", "Document import expected one staged attachment.");
|
|
2166
4109
|
}
|
|
4110
|
+
const stagedSourceAttachment = stagedAttachments.attachments.find((attachment) => attachment.role === "source_document");
|
|
4111
|
+
if (!stagedSourceAttachment) {
|
|
4112
|
+
throw new VaultError("EVENT_ATTACHMENTS_MISSING", "Document import expected one source attachment receipt.");
|
|
4113
|
+
}
|
|
4114
|
+
const sourceTargetId = buildRawSourceReceiptTarget({
|
|
4115
|
+
byteLength: sourceReceipt.byteLength,
|
|
4116
|
+
sha256: stagedSourceAttachment.sha256,
|
|
4117
|
+
});
|
|
2167
4118
|
const event = prepareStoredEventLedgerEntry({
|
|
2168
4119
|
...eventSeed,
|
|
2169
4120
|
rawRefs: stagedAttachments.rawRefs,
|
|
@@ -2182,9 +4133,10 @@ export async function importDocument({ vaultRoot, sourcePath, occurredAt = new D
|
|
|
2182
4133
|
summary: `Imported document ${raw.originalFileName}.`,
|
|
2183
4134
|
occurredAt,
|
|
2184
4135
|
files: [raw.relativePath, manifestPath, event.relativePath],
|
|
2185
|
-
targetIds: [documentId, event.record.id],
|
|
4136
|
+
targetIds: [sourceTargetId, documentId, event.record.id],
|
|
2186
4137
|
});
|
|
2187
4138
|
return {
|
|
4139
|
+
created: true,
|
|
2188
4140
|
documentId,
|
|
2189
4141
|
raw,
|
|
2190
4142
|
event: event.record,
|
|
@@ -2670,7 +4622,8 @@ function preparedDeviceEventRetainsCurrentOutput(input) {
|
|
|
2670
4622
|
}
|
|
2671
4623
|
const current = input.currentEventOwners.currentRecordByPreparedId.get(preparedId);
|
|
2672
4624
|
return current !== undefined && (isDeletedEventSpineRecord(current)
|
|
2673
|
-
|| (
|
|
4625
|
+
|| (current.source !== "device"
|
|
4626
|
+
&& eventSpineRevision(current) > eventSpineRevision(input.entry.record)
|
|
2674
4627
|
&& userAuthoredEventStateKey(current) !== userAuthoredEventStateKey(input.entry.record)));
|
|
2675
4628
|
}
|
|
2676
4629
|
function storedIntegrationIngestRetainsCurrentOutputLocators(input) {
|
|
@@ -2797,7 +4750,28 @@ function buildStoredDeviceDeliveryNoopResult(input) {
|
|
|
2797
4750
|
auditPath: null,
|
|
2798
4751
|
};
|
|
2799
4752
|
}
|
|
2800
|
-
export async function importDeviceBatch(
|
|
4753
|
+
export async function importDeviceBatch(input, options = {}) {
|
|
4754
|
+
assertCanonicalWriteLockScope(input.vaultRoot);
|
|
4755
|
+
const startedAt = performance.now();
|
|
4756
|
+
const timing = {
|
|
4757
|
+
canonicalWriteElapsedMs: 0,
|
|
4758
|
+
eventIdentityIndexCacheHit: false,
|
|
4759
|
+
eventIdentityIndexElapsedMs: 0,
|
|
4760
|
+
totalElapsedMs: 0,
|
|
4761
|
+
};
|
|
4762
|
+
try {
|
|
4763
|
+
return await importDeviceBatchWithExecutionOptions(input, options, timing);
|
|
4764
|
+
}
|
|
4765
|
+
catch (error) {
|
|
4766
|
+
clearDeviceBatchImportSessionVaultState(options.session, input.vaultRoot);
|
|
4767
|
+
throw error;
|
|
4768
|
+
}
|
|
4769
|
+
finally {
|
|
4770
|
+
timing.totalElapsedMs = Math.max(0, performance.now() - startedAt);
|
|
4771
|
+
emitDeviceBatchImportTiming(options.onTiming, timing);
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
async function importDeviceBatchWithExecutionOptions({ vaultRoot, provider, accountId, importedAt = new Date(), source = "device", events = [], samples = [], evidenceParts = [], authoritativeEventSets = [], ingestReceipt, provenance, }, options, timing) {
|
|
2801
4775
|
assertDeviceSampleRowLimit(Array.isArray(samples) ? samples.length : 0);
|
|
2802
4776
|
const vault = await loadVault({ vaultRoot });
|
|
2803
4777
|
const deviceBatchPlan = prepareDeviceBatchPlan({
|
|
@@ -2809,17 +4783,66 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
2809
4783
|
events,
|
|
2810
4784
|
samples,
|
|
2811
4785
|
evidenceParts,
|
|
4786
|
+
authoritativeEventSets,
|
|
2812
4787
|
ingestReceipt,
|
|
2813
4788
|
provenance,
|
|
2814
4789
|
});
|
|
2815
|
-
const eventTargetShardPaths = [
|
|
2816
|
-
...new Set(deviceBatchPlan.preparedEvents.map((entry) => entry.relativePath)),
|
|
2817
|
-
].sort();
|
|
2818
4790
|
const sampleRecords = deviceBatchPlan.preparedSamples.map((entry) => entry.record);
|
|
2819
4791
|
const sampleAppendPlan = await buildJsonlAppendPlan(vaultRoot, deviceBatchPlan.preparedSamples, {
|
|
2820
4792
|
dedupeWithinPlan: true,
|
|
2821
4793
|
});
|
|
2822
|
-
const
|
|
4794
|
+
const requiresEventIdentityContext = deviceBatchPlan.preparedEvents.length > 0
|
|
4795
|
+
|| deviceBatchPlan.authoritativeEventSets.length > 0;
|
|
4796
|
+
const eventIdentityDependency = buildDeviceEventIdentityDependency(deviceBatchPlan);
|
|
4797
|
+
const indexStartedAt = performance.now();
|
|
4798
|
+
const sessionVaultState = requiresEventIdentityContext
|
|
4799
|
+
? readDeviceBatchImportSessionVaultState(options.session, vaultRoot)
|
|
4800
|
+
: undefined;
|
|
4801
|
+
const currentEventLedgerFingerprint = sessionVaultState
|
|
4802
|
+
? await tryBuildDeviceEventLedgerFingerprint(vaultRoot)
|
|
4803
|
+
: undefined;
|
|
4804
|
+
const sessionFingerprintMatches = sessionVaultState
|
|
4805
|
+
&& currentEventLedgerFingerprint !== undefined
|
|
4806
|
+
? sessionVaultState.eventLedgerFingerprint
|
|
4807
|
+
=== currentEventLedgerFingerprint
|
|
4808
|
+
: false;
|
|
4809
|
+
const cachedEventIdentityContext = sessionVaultState
|
|
4810
|
+
&& sessionFingerprintMatches
|
|
4811
|
+
&& sessionVaultState.dependencyChanges.every((dependencyChange) => !deviceEventIdentityDependenciesOverlap(eventIdentityDependency, dependencyChange))
|
|
4812
|
+
? cloneDeviceEventIdentityContext(sessionVaultState.eventIdentityContext)
|
|
4813
|
+
: undefined;
|
|
4814
|
+
let initialEventIdentityContext = cachedEventIdentityContext
|
|
4815
|
+
?? await buildDeviceEventIdentityContext(vaultRoot, deviceBatchPlan.preparedEvents, deviceBatchPlan.authoritativeEventSets);
|
|
4816
|
+
if (cachedEventIdentityContext
|
|
4817
|
+
&& deviceBatchPlan.preparedEvents.some((entry) => resolveStructuralJunctionDailyAggregateAliasOwnerSplit(entry, cachedEventIdentityContext.index) !== null)) {
|
|
4818
|
+
initialEventIdentityContext = await buildDeviceEventIdentityContext(vaultRoot, deviceBatchPlan.preparedEvents, deviceBatchPlan.authoritativeEventSets);
|
|
4819
|
+
}
|
|
4820
|
+
else if (cachedEventIdentityContext) {
|
|
4821
|
+
timing.eventIdentityIndexCacheHit = true;
|
|
4822
|
+
}
|
|
4823
|
+
timing.eventIdentityIndexElapsedMs = Math.max(0, performance.now() - indexStartedAt);
|
|
4824
|
+
if (requiresEventIdentityContext && !timing.eventIdentityIndexCacheHit) {
|
|
4825
|
+
const eventLedgerFingerprint = await tryBuildDeviceEventLedgerFingerprint(vaultRoot);
|
|
4826
|
+
if (eventLedgerFingerprint) {
|
|
4827
|
+
replaceDeviceBatchImportSessionVaultState(options.session, vaultRoot, {
|
|
4828
|
+
dependencyChanges: [],
|
|
4829
|
+
eventIdentityContext: cloneDeviceEventIdentityContext(initialEventIdentityContext),
|
|
4830
|
+
eventLedgerFingerprint,
|
|
4831
|
+
});
|
|
4832
|
+
}
|
|
4833
|
+
else {
|
|
4834
|
+
clearDeviceBatchImportSessionVaultState(options.session, vaultRoot);
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
deviceBatchPlan.preparedEvents = resolveJunctionFloatingFallbackEntries(deviceBatchPlan.preparedEvents, initialEventIdentityContext);
|
|
4838
|
+
const eventIdentityContext = {
|
|
4839
|
+
index: initialEventIdentityContext.index,
|
|
4840
|
+
legacyReservations: buildLegacyExternalRefReservations(deviceBatchPlan.preparedEvents, initialEventIdentityContext.index),
|
|
4841
|
+
};
|
|
4842
|
+
const aliasRepairContext = buildDeviceEventAliasRepairContext(deviceBatchPlan);
|
|
4843
|
+
const eventTargetShardPaths = [
|
|
4844
|
+
...new Set(deviceBatchPlan.preparedEvents.map((entry) => entry.relativePath)),
|
|
4845
|
+
].sort();
|
|
2823
4846
|
const currentEventOwners = mapCurrentDeviceEventOwners(deviceBatchPlan.preparedEvents, eventIdentityContext);
|
|
2824
4847
|
const baselineEventReconciliation = await reconcileDeviceEventEntriesByExternalRef(vaultRoot, deviceBatchPlan.preparedEvents, buildEmptyDeviceEventIdentityContext(deviceBatchPlan.preparedEvents));
|
|
2825
4848
|
const baselineRetainedPreparedIds = new Set(baselineEventReconciliation.appendRecordIdByPreparedRecordId.keys());
|
|
@@ -2834,6 +4857,7 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
2834
4857
|
});
|
|
2835
4858
|
const protectedPreparedEventIds = new Set(deviceBatchPlan.preparedEvents
|
|
2836
4859
|
.filter((entry) => baselineRetainedPreparedIds.has(entry.record.id)
|
|
4860
|
+
&& !hasJunctionDailyAggregateAliasSplit(entry, eventIdentityContext)
|
|
2837
4861
|
&& (currentEventOwners.historicallyDeliveredPreparedIds.has(entry.record.id)
|
|
2838
4862
|
|| (entry.record.externalRef === undefined
|
|
2839
4863
|
&& currentEventOwners.currentRecordByPreparedId.has(entry.record.id)
|
|
@@ -2842,7 +4866,7 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
2842
4866
|
.map((entry) => entry.record.id));
|
|
2843
4867
|
const ordinaryReconciliationEntries = deviceBatchPlan.preparedEvents.filter((entry) => baselineRetainedPreparedIds.has(entry.record.id)
|
|
2844
4868
|
&& !protectedPreparedEventIds.has(entry.record.id));
|
|
2845
|
-
const currentEventReconciliation = await reconcileDeviceEventEntriesByExternalRef(vaultRoot, ordinaryReconciliationEntries, cloneDeviceEventIdentityContext(eventIdentityContext));
|
|
4869
|
+
const currentEventReconciliation = await reconcileDeviceEventEntriesByExternalRef(vaultRoot, ordinaryReconciliationEntries, cloneDeviceEventIdentityContext(eventIdentityContext), new Map(), deviceBatchPlan.authoritativeEventSets, aliasRepairContext);
|
|
2846
4870
|
const replayRetainedPreparedIds = new Set([
|
|
2847
4871
|
...protectedPreparedEventIds,
|
|
2848
4872
|
...currentEventReconciliation.retainedPreparedIds,
|
|
@@ -2935,15 +4959,22 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
2935
4959
|
throw new VaultError("INTEGRATION_INGEST_ID_CONFLICT", `Device ingest id "${incrementalEvidenceImportId}" already belongs to a different delivery.`, { ingestId: incrementalEvidenceImportId });
|
|
2936
4960
|
}
|
|
2937
4961
|
};
|
|
2938
|
-
const buildExactNoopResult = (storedDelivery) =>
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
4962
|
+
const buildExactNoopResult = (storedDelivery) => {
|
|
4963
|
+
const result = buildStoredDeviceDeliveryNoopResult({
|
|
4964
|
+
associationEvidenceRolesByPreparedRecordId,
|
|
4965
|
+
currentEventOwners,
|
|
4966
|
+
deviceBatchPlan,
|
|
4967
|
+
eventTargetShardPaths,
|
|
4968
|
+
preparedEventOutputOwners,
|
|
4969
|
+
sampleRecords,
|
|
4970
|
+
storedDelivery,
|
|
4971
|
+
});
|
|
4972
|
+
const affectedSparseCalendarTargets = junctionSparseAffectedCalendarTargets(result.events, eventIdentityContext.index);
|
|
4973
|
+
const affectedEventDayKeys = junctionSparseAffectedDayKeys(affectedSparseCalendarTargets);
|
|
4974
|
+
return affectedSparseCalendarTargets.length > 0
|
|
4975
|
+
? { ...result, affectedEventDayKeys, affectedSparseCalendarTargets }
|
|
4976
|
+
: result;
|
|
4977
|
+
};
|
|
2947
4978
|
let fullInspectionAttempted = false;
|
|
2948
4979
|
const ensureFullInspection = async () => {
|
|
2949
4980
|
if (fullInspectionAttempted || (ingestIdInspection.historyComplete && !ingestIdInspection.unsafe)) {
|
|
@@ -3144,7 +5175,7 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3144
5175
|
const persistenceReconciliationEntries = reconciliationEntries.filter((entry) => !storedEventRepairIds.has(entry.record.id));
|
|
3145
5176
|
const repairedProtectedPreparedEventCount = [...historicalRepairEntryByPreparedId.keys()].filter((preparedId) => persistenceProtectedPreparedEventIds.has(preparedId)).length;
|
|
3146
5177
|
const reconciled = evidenceRepairRequired
|
|
3147
|
-
? await reconcileDeviceEventEntriesByExternalRef(vaultRoot, persistenceReconciliationEntries, cloneDeviceEventIdentityContext(eventIdentityContext))
|
|
5178
|
+
? await reconcileDeviceEventEntriesByExternalRef(vaultRoot, persistenceReconciliationEntries, cloneDeviceEventIdentityContext(eventIdentityContext), new Map(), deviceBatchPlan.authoritativeEventSets, aliasRepairContext)
|
|
3148
5179
|
: currentEventReconciliation;
|
|
3149
5180
|
const reconciledRecordByPreparedId = new Map(persistenceReconciliationEntries.map((entry, index) => [
|
|
3150
5181
|
entry.record.id,
|
|
@@ -3207,6 +5238,8 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3207
5238
|
const preparedId = deviceBatchPlan.preparedEvents[index]?.record.id;
|
|
3208
5239
|
return preparedId !== undefined && associablePreparedEventIds.has(preparedId);
|
|
3209
5240
|
});
|
|
5241
|
+
const affectedSparseCalendarTargets = junctionSparseAffectedCalendarTargets(canonicalEventRecords, eventIdentityContext.index);
|
|
5242
|
+
const affectedEventDayKeys = junctionSparseAffectedDayKeys(affectedSparseCalendarTargets);
|
|
3210
5243
|
const persistenceEvidenceRolesByPreparedRecordId = new Map(deviceBatchPlan.preparedEvents
|
|
3211
5244
|
.filter((entry) => associablePreparedEventIds.has(entry.record.id)
|
|
3212
5245
|
&& acceptedEvidenceRolesByPreparedRecordId.has(entry.record.id))
|
|
@@ -3216,7 +5249,7 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3216
5249
|
]));
|
|
3217
5250
|
const persistencePreparedEvents = deviceBatchPlan.preparedEvents.filter((entry) => associablePreparedEventIds.has(entry.record.id)
|
|
3218
5251
|
&& persistenceEvidenceRolesByPreparedRecordId.has(entry.record.id));
|
|
3219
|
-
const hasAppendedOutputs =
|
|
5252
|
+
const hasAppendedOutputs = eventAppendPlan.appendedRecordIds.length > 0
|
|
3220
5253
|
|| sampleAppendPlan.appendedRecordIds.length > 0;
|
|
3221
5254
|
const eventIdsByEvidenceRole = new Map();
|
|
3222
5255
|
for (const entry of deviceBatchPlan.preparedEvents) {
|
|
@@ -3270,6 +5303,9 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3270
5303
|
}
|
|
3271
5304
|
const eventOutputs = buildIntegrationEventOutputs(shouldPersistDelivery ? persistencePreparedEvents : [], canonicalIdByPreparedId, retainedEvidenceRolesByPreparedRecordId);
|
|
3272
5305
|
const buildNoopResult = () => ({
|
|
5306
|
+
...(affectedEventDayKeys.length > 0
|
|
5307
|
+
? { affectedEventDayKeys, affectedSparseCalendarTargets }
|
|
5308
|
+
: {}),
|
|
3273
5309
|
applied: false,
|
|
3274
5310
|
ingestId: null,
|
|
3275
5311
|
ingestShardPath: null,
|
|
@@ -3285,6 +5321,8 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3285
5321
|
auditPath: null,
|
|
3286
5322
|
});
|
|
3287
5323
|
return {
|
|
5324
|
+
affectedEventDayKeys,
|
|
5325
|
+
affectedSparseCalendarTargets,
|
|
3288
5326
|
buildNoopResult,
|
|
3289
5327
|
eventAppendPlan,
|
|
3290
5328
|
eventOutputs,
|
|
@@ -3334,7 +5372,7 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3334
5372
|
assertInspectionCanAuthorizeNoop();
|
|
3335
5373
|
return persistence.buildNoopResult();
|
|
3336
5374
|
}
|
|
3337
|
-
const { buildNoopResult, eventAppendPlan, eventOutputs, eventReconciliation, canonicalEventRecords, retainedEvidenceParts, } = persistence;
|
|
5375
|
+
const { affectedEventDayKeys, affectedSparseCalendarTargets, buildNoopResult, eventAppendPlan, eventOutputs, eventReconciliation, canonicalEventRecords, retainedEvidenceParts, } = persistence;
|
|
3338
5376
|
const currentImportIdOccupied = ingestIdInspection.entriesById.has(deviceBatchPlan.importId)
|
|
3339
5377
|
|| ingestIdInspection.invalidIds.has(deviceBatchPlan.importId);
|
|
3340
5378
|
const finalAssociationImportId = buildAssociationImportId(eventOutputs);
|
|
@@ -3380,7 +5418,8 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3380
5418
|
assertInspectionCanAuthorizeNoop();
|
|
3381
5419
|
return buildNoopResult();
|
|
3382
5420
|
}
|
|
3383
|
-
|
|
5421
|
+
const canonicalWriteStartedAt = performance.now();
|
|
5422
|
+
const result = await runCanonicalWrite({
|
|
3384
5423
|
vaultRoot,
|
|
3385
5424
|
operationType: "device_batch_import",
|
|
3386
5425
|
summary: `Import ${deviceBatchPlan.provider} device batch ${persistedImportId}`,
|
|
@@ -3405,12 +5444,16 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3405
5444
|
sampleCount: sampleRecords.length,
|
|
3406
5445
|
skippedDuplicateCount: eventReconciliation.skippedDuplicateCount,
|
|
3407
5446
|
supersededCount: eventReconciliation.supersededCount,
|
|
5447
|
+
retractedCount: eventReconciliation.retractedCount,
|
|
3408
5448
|
}),
|
|
3409
5449
|
occurredAt: deviceBatchPlan.importedAt,
|
|
3410
5450
|
files: touchedPaths,
|
|
3411
5451
|
targetIds: [persistedImportId],
|
|
3412
5452
|
});
|
|
3413
5453
|
return {
|
|
5454
|
+
...(affectedEventDayKeys.length > 0
|
|
5455
|
+
? { affectedEventDayKeys, affectedSparseCalendarTargets }
|
|
5456
|
+
: {}),
|
|
3414
5457
|
applied: true,
|
|
3415
5458
|
ingestId: persistedImportId,
|
|
3416
5459
|
ingestShardPath,
|
|
@@ -3419,7 +5462,12 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3419
5462
|
importedAt: deviceBatchPlan.importedAt,
|
|
3420
5463
|
events: canonicalEventRecords,
|
|
3421
5464
|
samples: sampleRecords,
|
|
3422
|
-
eventShardPaths:
|
|
5465
|
+
eventShardPaths: [
|
|
5466
|
+
...new Set([
|
|
5467
|
+
...eventTargetShardPaths,
|
|
5468
|
+
...eventAppendPlan.targetShardPaths,
|
|
5469
|
+
]),
|
|
5470
|
+
].sort(),
|
|
3423
5471
|
sampleShardPaths: sampleAppendPlan.targetShardPaths,
|
|
3424
5472
|
evidencePartCount: deviceBatchPlan.preparedEvidenceParts.length,
|
|
3425
5473
|
persistedEvidencePartCount: retainedEvidenceParts.length,
|
|
@@ -3427,6 +5475,27 @@ export async function importDeviceBatch({ vaultRoot, provider, accountId, import
|
|
|
3427
5475
|
};
|
|
3428
5476
|
},
|
|
3429
5477
|
});
|
|
5478
|
+
timing.canonicalWriteElapsedMs = Math.max(0, performance.now() - canonicalWriteStartedAt);
|
|
5479
|
+
if (eventAppendPlan.appendedRecordIds.length > 0) {
|
|
5480
|
+
const currentSessionState = readDeviceBatchImportSessionVaultState(options.session, vaultRoot);
|
|
5481
|
+
if (currentSessionState) {
|
|
5482
|
+
const eventLedgerFingerprint = await tryBuildDeviceEventLedgerFingerprint(vaultRoot);
|
|
5483
|
+
if (eventLedgerFingerprint) {
|
|
5484
|
+
replaceDeviceBatchImportSessionVaultState(options.session, vaultRoot, {
|
|
5485
|
+
...currentSessionState,
|
|
5486
|
+
dependencyChanges: [
|
|
5487
|
+
...currentSessionState.dependencyChanges,
|
|
5488
|
+
buildDeviceEventIdentityDependency(deviceBatchPlan, eventReconciliation.records.map((record) => record.id)),
|
|
5489
|
+
],
|
|
5490
|
+
eventLedgerFingerprint,
|
|
5491
|
+
});
|
|
5492
|
+
}
|
|
5493
|
+
else {
|
|
5494
|
+
clearDeviceBatchImportSessionVaultState(options.session, vaultRoot);
|
|
5495
|
+
}
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
return result;
|
|
3430
5499
|
}
|
|
3431
5500
|
const EVENT_BATCH_FAILURE_REPORT_LIMIT = 20;
|
|
3432
5501
|
// importEventBatch is public API surface, so the batch-shape invariants live
|
|
@@ -3471,6 +5540,12 @@ export async function importEventBatch(input) {
|
|
|
3471
5540
|
if (usesPayloads === usesDecisions) {
|
|
3472
5541
|
throw new VaultError("EVENT_BATCH_INVALID", "Event batch must define exactly one of payloads or decisions.");
|
|
3473
5542
|
}
|
|
5543
|
+
const sourceRawRef = usesPayloads
|
|
5544
|
+
? input.rejectIfSourceRawRefAlreadyImported?.trim()
|
|
5545
|
+
: undefined;
|
|
5546
|
+
if (usesPayloads && input.rejectIfSourceRawRefAlreadyImported !== undefined && !sourceRawRef) {
|
|
5547
|
+
throw new VaultError("EVENT_BATCH_INVALID", "Event batch source raw reference must not be empty.");
|
|
5548
|
+
}
|
|
3474
5549
|
const normalizedRows = usesDecisions
|
|
3475
5550
|
? normalizeImportEventBatchDecisions(input.decisions, signal)
|
|
3476
5551
|
: normalizeImportEventBatchPayloads(input.payloads, signal);
|
|
@@ -3519,11 +5594,15 @@ export async function importEventBatch(input) {
|
|
|
3519
5594
|
});
|
|
3520
5595
|
return;
|
|
3521
5596
|
}
|
|
3522
|
-
|
|
5597
|
+
// Decisions are the trusted importer-owner path. Their contract permits
|
|
5598
|
+
// verified workout CSV evidence to retain an unknown duration, while the
|
|
5599
|
+
// generic public payload path above remains stricter.
|
|
5600
|
+
const record = buildEventImportDecisionRecord({ ...decision.payload }, vault.metadata.timezone);
|
|
3523
5601
|
decisions.push({
|
|
3524
5602
|
action: "upsert",
|
|
3525
5603
|
allowsKindReplacement: true,
|
|
3526
5604
|
entry: { relativePath: toEventLedgerFile(record.occurredAt), record },
|
|
5605
|
+
...(decision.expectedLatest ? { expectedLatest: decision.expectedLatest } : {}),
|
|
3527
5606
|
});
|
|
3528
5607
|
}
|
|
3529
5608
|
catch (error) {
|
|
@@ -3539,6 +5618,29 @@ export async function importEventBatch(input) {
|
|
|
3539
5618
|
failures: failures.slice(0, EVENT_BATCH_FAILURE_REPORT_LIMIT),
|
|
3540
5619
|
});
|
|
3541
5620
|
}
|
|
5621
|
+
let sourceCompletionTargetId = null;
|
|
5622
|
+
if (sourceRawRef) {
|
|
5623
|
+
const invalidSourceIndexes = decisions.flatMap((decision, index) => decision.action === "upsert"
|
|
5624
|
+
&& decision.entry.record.kind === "activity_session"
|
|
5625
|
+
&& decision.entry.record.externalRef === undefined
|
|
5626
|
+
&& collectEventRawReferencePaths(decision.entry.record).includes(sourceRawRef)
|
|
5627
|
+
? []
|
|
5628
|
+
: [index]);
|
|
5629
|
+
if (invalidSourceIndexes.length > 0) {
|
|
5630
|
+
throw new VaultError("EVENT_BATCH_SOURCE_ROW_INVALID", "Every event in a source-guarded batch must be an externalRef-free activity session that references the guarded raw source; nothing was imported.", { indexes: invalidSourceIndexes.slice(0, EVENT_BATCH_FAILURE_REPORT_LIMIT) });
|
|
5631
|
+
}
|
|
5632
|
+
const sourceState = await inspectWorkoutSourceImportStatus({
|
|
5633
|
+
vaultRoot,
|
|
5634
|
+
rawRef: sourceRawRef,
|
|
5635
|
+
});
|
|
5636
|
+
if (sourceState.status === "completed") {
|
|
5637
|
+
throw new VaultError("EVENT_BATCH_SOURCE_ALREADY_IMPORTED", "The atomic workout import for this exact source already completed; nothing was imported.");
|
|
5638
|
+
}
|
|
5639
|
+
if (sourceState.status === "partial_conflict") {
|
|
5640
|
+
throw new VaultError("EVENT_BATCH_SOURCE_PARTIAL_CONFLICT", "This exact source has workout history without a whole-source completion receipt; nothing was imported. Resolve the partial import before retrying.");
|
|
5641
|
+
}
|
|
5642
|
+
sourceCompletionTargetId = sourceState.completionTargetId;
|
|
5643
|
+
}
|
|
3542
5644
|
signal?.throwIfAborted();
|
|
3543
5645
|
const reconciliation = await reconcileEventImportDecisionsByExternalRef(vaultRoot, decisions, signal);
|
|
3544
5646
|
const appendPlan = await buildJsonlAppendPlan(vaultRoot, reconciliation.appendEntries, {
|
|
@@ -3581,14 +5683,19 @@ export async function importEventBatch(input) {
|
|
|
3581
5683
|
vaultRoot,
|
|
3582
5684
|
batch,
|
|
3583
5685
|
action: "event_upsert",
|
|
3584
|
-
commandName:
|
|
5686
|
+
commandName: sourceCompletionTargetId
|
|
5687
|
+
? WORKOUT_SOURCE_IMPORT_AUDIT_COMMAND
|
|
5688
|
+
: "core.importEventBatch",
|
|
3585
5689
|
summary: `Imported event batch: ${counts.createdCount} created, ` +
|
|
3586
5690
|
`${counts.supersededCount} superseded, ` +
|
|
3587
5691
|
`${counts.retractedCount} retracted, ` +
|
|
3588
5692
|
`${counts.skippedExistingCount} skipped existing of ${counts.receivedCount} received.`,
|
|
3589
5693
|
occurredAt,
|
|
3590
5694
|
files: appendPlan.appendedShardPaths,
|
|
3591
|
-
targetIds: [
|
|
5695
|
+
targetIds: [
|
|
5696
|
+
...(sourceCompletionTargetId ? [sourceCompletionTargetId] : []),
|
|
5697
|
+
...new Set(appendPlan.appendedRecordIds),
|
|
5698
|
+
].slice(0, AUDIT_TARGET_ID_LIMIT),
|
|
3592
5699
|
});
|
|
3593
5700
|
return {
|
|
3594
5701
|
applied: true,
|