@murphai/hosted-execution 0.1.15 → 0.1.17
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/LICENSE +201 -674
- package/README.md +15 -14
- package/dist/auth.d.ts +11 -25
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +32 -76
- package/dist/auth.js.map +1 -1
- package/dist/builders.d.ts +3 -4
- package/dist/builders.d.ts.map +1 -1
- package/dist/builders.js +24 -24
- package/dist/builders.js.map +1 -1
- package/dist/bundles.d.ts +3 -13
- package/dist/bundles.d.ts.map +1 -1
- package/dist/bundles.js +1 -16
- package/dist/bundles.js.map +1 -1
- package/dist/client.d.ts +2 -26
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -212
- package/dist/client.js.map +1 -1
- package/dist/contracts.d.ts +49 -118
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +15 -58
- package/dist/contracts.js.map +1 -1
- package/dist/dispatch-ref.d.ts +1 -2
- package/dist/dispatch-ref.d.ts.map +1 -1
- package/dist/dispatch-ref.js +16 -30
- package/dist/dispatch-ref.js.map +1 -1
- package/dist/env.d.ts +0 -38
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -87
- package/dist/env.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +3 -1
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +76 -53
- package/dist/observability.js.map +1 -1
- package/dist/outbox-payload.d.ts +7 -5
- package/dist/outbox-payload.d.ts.map +1 -1
- package/dist/outbox-payload.js +75 -38
- package/dist/outbox-payload.js.map +1 -1
- package/dist/parsers.d.ts +10 -10
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +192 -139
- package/dist/parsers.js.map +1 -1
- package/dist/routes.d.ts +4 -9
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +7 -18
- package/dist/routes.js.map +1 -1
- package/node_modules/@murphai/core/README.md +3 -0
- package/node_modules/@murphai/core/dist/assessment/index.d.ts +5 -0
- package/node_modules/@murphai/core/dist/assessment/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/index.js +4 -0
- package/node_modules/@murphai/core/dist/assessment/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/project.d.ts +9 -0
- package/node_modules/@murphai/core/dist/assessment/project.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/project.js +353 -0
- package/node_modules/@murphai/core/dist/assessment/project.js.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/storage.d.ts +13 -0
- package/node_modules/@murphai/core/dist/assessment/storage.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/storage.js +202 -0
- package/node_modules/@murphai/core/dist/assessment/storage.js.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/types.d.ts +112 -0
- package/node_modules/@murphai/core/dist/assessment/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/assessment/types.js +5 -0
- package/node_modules/@murphai/core/dist/assessment/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/atomic-write.d.ts +5 -0
- package/node_modules/@murphai/core/dist/atomic-write.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/atomic-write.js +120 -0
- package/node_modules/@murphai/core/dist/atomic-write.js.map +1 -0
- package/node_modules/@murphai/core/dist/audit.d.ts +27 -0
- package/node_modules/@murphai/core/dist/audit.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/audit.js +94 -0
- package/node_modules/@murphai/core/dist/audit.js.map +1 -0
- package/node_modules/@murphai/core/dist/automation.d.ts +55 -0
- package/node_modules/@murphai/core/dist/automation.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/automation.js +411 -0
- package/node_modules/@murphai/core/dist/automation.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/allergies.d.ts +5 -0
- package/node_modules/@murphai/core/dist/bank/allergies.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/allergies.js +209 -0
- package/node_modules/@murphai/core/dist/bank/allergies.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/conditions.d.ts +5 -0
- package/node_modules/@murphai/core/dist/bank/conditions.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/conditions.js +249 -0
- package/node_modules/@murphai/core/dist/bank/conditions.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/foods.d.ts +8 -0
- package/node_modules/@murphai/core/dist/bank/foods.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/foods.js +255 -0
- package/node_modules/@murphai/core/dist/bank/foods.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/goals.d.ts +5 -0
- package/node_modules/@murphai/core/dist/bank/goals.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/goals.js +289 -0
- package/node_modules/@murphai/core/dist/bank/goals.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/index.d.ts +10 -0
- package/node_modules/@murphai/core/dist/bank/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/index.js +10 -0
- package/node_modules/@murphai/core/dist/bank/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/protocols.d.ts +8 -0
- package/node_modules/@murphai/core/dist/bank/protocols.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/protocols.js +466 -0
- package/node_modules/@murphai/core/dist/bank/protocols.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/providers.d.ts +46 -0
- package/node_modules/@murphai/core/dist/bank/providers.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/providers.js +160 -0
- package/node_modules/@murphai/core/dist/bank/providers.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/recipes.d.ts +8 -0
- package/node_modules/@murphai/core/dist/bank/recipes.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/recipes.js +287 -0
- package/node_modules/@murphai/core/dist/bank/recipes.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/shared.d.ts +39 -0
- package/node_modules/@murphai/core/dist/bank/shared.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/shared.js +150 -0
- package/node_modules/@murphai/core/dist/bank/shared.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/types.d.ts +469 -0
- package/node_modules/@murphai/core/dist/bank/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/types.js +35 -0
- package/node_modules/@murphai/core/dist/bank/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/bank/workout-formats.d.ts +5 -0
- package/node_modules/@murphai/core/dist/bank/workout-formats.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/bank/workout-formats.js +204 -0
- package/node_modules/@murphai/core/dist/bank/workout-formats.js.map +1 -0
- package/node_modules/@murphai/core/dist/canonical-mutations.d.ts +54 -0
- package/node_modules/@murphai/core/dist/canonical-mutations.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/canonical-mutations.js +196 -0
- package/node_modules/@murphai/core/dist/canonical-mutations.js.map +1 -0
- package/node_modules/@murphai/core/dist/constants.d.ts +125 -0
- package/node_modules/@murphai/core/dist/constants.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/constants.js +132 -0
- package/node_modules/@murphai/core/dist/constants.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/events.d.ts +100 -0
- package/node_modules/@murphai/core/dist/domains/events.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/events.js +593 -0
- package/node_modules/@murphai/core/dist/domains/events.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/experiments.d.ts +71 -0
- package/node_modules/@murphai/core/dist/domains/experiments.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/experiments.js +275 -0
- package/node_modules/@murphai/core/dist/domains/experiments.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/journal.d.ts +52 -0
- package/node_modules/@murphai/core/dist/domains/journal.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/journal.js +173 -0
- package/node_modules/@murphai/core/dist/domains/journal.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/shared.d.ts +37 -0
- package/node_modules/@murphai/core/dist/domains/shared.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/shared.js +101 -0
- package/node_modules/@murphai/core/dist/domains/shared.js.map +1 -0
- package/node_modules/@murphai/core/dist/domains/vault-summary.d.ts +15 -0
- package/node_modules/@murphai/core/dist/domains/vault-summary.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/domains/vault-summary.js +58 -0
- package/node_modules/@murphai/core/dist/domains/vault-summary.js.map +1 -0
- package/node_modules/@murphai/core/dist/errors.d.ts +8 -0
- package/node_modules/@murphai/core/dist/errors.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/errors.js +14 -0
- package/node_modules/@murphai/core/dist/errors.js.map +1 -0
- package/node_modules/@murphai/core/dist/event-attachments.d.ts +69 -0
- package/node_modules/@murphai/core/dist/event-attachments.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/event-attachments.js +202 -0
- package/node_modules/@murphai/core/dist/event-attachments.js.map +1 -0
- package/node_modules/@murphai/core/dist/event-links.d.ts +15 -0
- package/node_modules/@murphai/core/dist/event-links.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/event-links.js +54 -0
- package/node_modules/@murphai/core/dist/event-links.js.map +1 -0
- package/node_modules/@murphai/core/dist/family/api.d.ts +5 -0
- package/node_modules/@murphai/core/dist/family/api.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/family/api.js +221 -0
- package/node_modules/@murphai/core/dist/family/api.js.map +1 -0
- package/node_modules/@murphai/core/dist/family/index.d.ts +3 -0
- package/node_modules/@murphai/core/dist/family/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/family/index.js +3 -0
- package/node_modules/@murphai/core/dist/family/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/family/types.d.ts +34 -0
- package/node_modules/@murphai/core/dist/family/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/family/types.js +2 -0
- package/node_modules/@murphai/core/dist/family/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/frontmatter.d.ts +4 -0
- package/node_modules/@murphai/core/dist/frontmatter.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/frontmatter.js +99 -0
- package/node_modules/@murphai/core/dist/frontmatter.js.map +1 -0
- package/node_modules/@murphai/core/dist/fs.d.ts +22 -0
- package/node_modules/@murphai/core/dist/fs.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/fs.js +172 -0
- package/node_modules/@murphai/core/dist/fs.js.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/api.d.ts +5 -0
- package/node_modules/@murphai/core/dist/genetics/api.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/api.js +226 -0
- package/node_modules/@murphai/core/dist/genetics/api.js.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/index.d.ts +3 -0
- package/node_modules/@murphai/core/dist/genetics/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/index.js +3 -0
- package/node_modules/@murphai/core/dist/genetics/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/types.d.ts +40 -0
- package/node_modules/@murphai/core/dist/genetics/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/genetics/types.js +4 -0
- package/node_modules/@murphai/core/dist/genetics/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/history/api.d.ts +7 -0
- package/node_modules/@murphai/core/dist/history/api.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/history/api.js +473 -0
- package/node_modules/@murphai/core/dist/history/api.js.map +1 -0
- package/node_modules/@murphai/core/dist/history/event-spine.d.ts +41 -0
- package/node_modules/@murphai/core/dist/history/event-spine.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/history/event-spine.js +111 -0
- package/node_modules/@murphai/core/dist/history/event-spine.js.map +1 -0
- package/node_modules/@murphai/core/dist/history/index.d.ts +3 -0
- package/node_modules/@murphai/core/dist/history/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/history/index.js +3 -0
- package/node_modules/@murphai/core/dist/history/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/history/shared.d.ts +25 -0
- package/node_modules/@murphai/core/dist/history/shared.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/history/shared.js +144 -0
- package/node_modules/@murphai/core/dist/history/shared.js.map +1 -0
- package/node_modules/@murphai/core/dist/history/types.d.ts +127 -0
- package/node_modules/@murphai/core/dist/history/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/history/types.js +8 -0
- package/node_modules/@murphai/core/dist/history/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/ids.d.ts +3 -0
- package/node_modules/@murphai/core/dist/ids.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/ids.js +20 -0
- package/node_modules/@murphai/core/dist/ids.js.map +1 -0
- package/node_modules/@murphai/core/dist/index.d.ts +30 -0
- package/node_modules/@murphai/core/dist/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/index.js +23 -0
- package/node_modules/@murphai/core/dist/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/jsonl.d.ts +12 -0
- package/node_modules/@murphai/core/dist/jsonl.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/jsonl.js +40 -0
- package/node_modules/@murphai/core/dist/jsonl.js.map +1 -0
- package/node_modules/@murphai/core/dist/memory.d.ts +17 -0
- package/node_modules/@murphai/core/dist/memory.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/memory.js +72 -0
- package/node_modules/@murphai/core/dist/memory.js.map +1 -0
- package/node_modules/@murphai/core/dist/mutations.d.ts +150 -0
- package/node_modules/@murphai/core/dist/mutations.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/mutations.js +1109 -0
- package/node_modules/@murphai/core/dist/mutations.js.map +1 -0
- package/node_modules/@murphai/core/dist/operations/canonical-write-lock.d.ts +29 -0
- package/node_modules/@murphai/core/dist/operations/canonical-write-lock.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/operations/canonical-write-lock.js +164 -0
- package/node_modules/@murphai/core/dist/operations/canonical-write-lock.js.map +1 -0
- package/node_modules/@murphai/core/dist/operations/index.d.ts +5 -0
- package/node_modules/@murphai/core/dist/operations/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/operations/index.js +3 -0
- package/node_modules/@murphai/core/dist/operations/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/operations/raw-manifests.d.ts +33 -0
- package/node_modules/@murphai/core/dist/operations/raw-manifests.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/operations/raw-manifests.js +105 -0
- package/node_modules/@murphai/core/dist/operations/raw-manifests.js.map +1 -0
- package/node_modules/@murphai/core/dist/operations/write-batch.d.ts +166 -0
- package/node_modules/@murphai/core/dist/operations/write-batch.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/operations/write-batch.js +886 -0
- package/node_modules/@murphai/core/dist/operations/write-batch.js.map +1 -0
- package/node_modules/@murphai/core/dist/path-safety.d.ts +19 -0
- package/node_modules/@murphai/core/dist/path-safety.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/path-safety.js +193 -0
- package/node_modules/@murphai/core/dist/path-safety.js.map +1 -0
- package/node_modules/@murphai/core/dist/profile/index.d.ts +4 -0
- package/node_modules/@murphai/core/dist/profile/index.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/profile/index.js +3 -0
- package/node_modules/@murphai/core/dist/profile/index.js.map +1 -0
- package/node_modules/@murphai/core/dist/profile/storage.d.ts +41 -0
- package/node_modules/@murphai/core/dist/profile/storage.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/profile/storage.js +225 -0
- package/node_modules/@murphai/core/dist/profile/storage.js.map +1 -0
- package/node_modules/@murphai/core/dist/profile/types.d.ts +29 -0
- package/node_modules/@murphai/core/dist/profile/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/profile/types.js +8 -0
- package/node_modules/@murphai/core/dist/profile/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/public-mutations.d.ts +120 -0
- package/node_modules/@murphai/core/dist/public-mutations.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/public-mutations.js +275 -0
- package/node_modules/@murphai/core/dist/public-mutations.js.map +1 -0
- package/node_modules/@murphai/core/dist/raw.d.ts +28 -0
- package/node_modules/@murphai/core/dist/raw.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/raw.js +107 -0
- package/node_modules/@murphai/core/dist/raw.js.map +1 -0
- package/node_modules/@murphai/core/dist/registry/api.d.ts +80 -0
- package/node_modules/@murphai/core/dist/registry/api.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/registry/api.js +113 -0
- package/node_modules/@murphai/core/dist/registry/api.js.map +1 -0
- package/node_modules/@murphai/core/dist/registry/id-or-slug.d.ts +15 -0
- package/node_modules/@murphai/core/dist/registry/id-or-slug.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/registry/id-or-slug.js +9 -0
- package/node_modules/@murphai/core/dist/registry/id-or-slug.js.map +1 -0
- package/node_modules/@murphai/core/dist/registry/markdown.d.ts +101 -0
- package/node_modules/@murphai/core/dist/registry/markdown.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/registry/markdown.js +136 -0
- package/node_modules/@murphai/core/dist/registry/markdown.js.map +1 -0
- package/node_modules/@murphai/core/dist/shares.d.ts +36 -0
- package/node_modules/@murphai/core/dist/shares.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/shares.js +333 -0
- package/node_modules/@murphai/core/dist/shares.js.map +1 -0
- package/node_modules/@murphai/core/dist/storage-spine.d.ts +3 -0
- package/node_modules/@murphai/core/dist/storage-spine.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/storage-spine.js +3 -0
- package/node_modules/@murphai/core/dist/storage-spine.js.map +1 -0
- package/node_modules/@murphai/core/dist/time.d.ts +11 -0
- package/node_modules/@murphai/core/dist/time.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/time.js +72 -0
- package/node_modules/@murphai/core/dist/time.js.map +1 -0
- package/node_modules/@murphai/core/dist/types.d.ts +18 -0
- package/node_modules/@murphai/core/dist/types.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/types.js +7 -0
- package/node_modules/@murphai/core/dist/types.js.map +1 -0
- package/node_modules/@murphai/core/dist/vault-core-document.d.ts +8 -0
- package/node_modules/@murphai/core/dist/vault-core-document.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/vault-core-document.js +16 -0
- package/node_modules/@murphai/core/dist/vault-core-document.js.map +1 -0
- package/node_modules/@murphai/core/dist/vault-metadata.d.ts +17 -0
- package/node_modules/@murphai/core/dist/vault-metadata.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/vault-metadata.js +44 -0
- package/node_modules/@murphai/core/dist/vault-metadata.js.map +1 -0
- package/node_modules/@murphai/core/dist/vault-upgrade.d.ts +24 -0
- package/node_modules/@murphai/core/dist/vault-upgrade.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/vault-upgrade.js +44 -0
- package/node_modules/@murphai/core/dist/vault-upgrade.js.map +1 -0
- package/node_modules/@murphai/core/dist/vault.d.ts +40 -0
- package/node_modules/@murphai/core/dist/vault.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/vault.js +649 -0
- package/node_modules/@murphai/core/dist/vault.js.map +1 -0
- package/node_modules/@murphai/core/dist/write-policy.d.ts +63 -0
- package/node_modules/@murphai/core/dist/write-policy.d.ts.map +1 -0
- package/node_modules/@murphai/core/dist/write-policy.js +146 -0
- package/node_modules/@murphai/core/dist/write-policy.js.map +1 -0
- package/node_modules/@murphai/core/package.json +27 -0
- package/node_modules/@murphai/device-syncd/README.md +123 -0
- package/node_modules/@murphai/device-syncd/dist/bin.d.ts +2 -0
- package/node_modules/@murphai/device-syncd/dist/bin.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/bin.js +29 -0
- package/node_modules/@murphai/device-syncd/dist/bin.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/client.d.ts +124 -0
- package/node_modules/@murphai/device-syncd/dist/client.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/client.js +199 -0
- package/node_modules/@murphai/device-syncd/dist/client.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/config.d.ts +18 -0
- package/node_modules/@murphai/device-syncd/dist/config.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/config.js +279 -0
- package/node_modules/@murphai/device-syncd/dist/config.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/crypto.d.ts +6 -0
- package/node_modules/@murphai/device-syncd/dist/crypto.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/crypto.js +27 -0
- package/node_modules/@murphai/device-syncd/dist/crypto.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/errors.d.ts +21 -0
- package/node_modules/@murphai/device-syncd/dist/errors.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/errors.js +32 -0
- package/node_modules/@murphai/device-syncd/dist/errors.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-hints.d.ts +3 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-hints.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-hints.js +110 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-hints.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.d.ts +139 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.js +336 -0
- package/node_modules/@murphai/device-syncd/dist/hosted-runtime.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/http.d.ts +34 -0
- package/node_modules/@murphai/device-syncd/dist/http.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/http.js +644 -0
- package/node_modules/@murphai/device-syncd/dist/http.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/index.d.ts +23 -0
- package/node_modules/@murphai/device-syncd/dist/index.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/index.js +15 -0
- package/node_modules/@murphai/device-syncd/dist/index.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/garmin.d.ts +15 -0
- package/node_modules/@murphai/device-syncd/dist/providers/garmin.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/garmin.js +485 -0
- package/node_modules/@murphai/device-syncd/dist/providers/garmin.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura-webhooks.d.ts +49 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura-webhooks.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura-webhooks.js +401 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura-webhooks.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura.d.ts +20 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura.js +804 -0
- package/node_modules/@murphai/device-syncd/dist/providers/oura.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.d.ts +104 -0
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.js +214 -0
- package/node_modules/@murphai/device-syncd/dist/providers/shared-oauth.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.d.ts +15 -0
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.js +551 -0
- package/node_modules/@murphai/device-syncd/dist/providers/whoop.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/public-account.d.ts +4 -0
- package/node_modules/@murphai/device-syncd/dist/public-account.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/public-account.js +13 -0
- package/node_modules/@murphai/device-syncd/dist/public-account.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/public-ingress.d.ts +43 -0
- package/node_modules/@murphai/device-syncd/dist/public-ingress.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/public-ingress.js +353 -0
- package/node_modules/@murphai/device-syncd/dist/public-ingress.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/registry.d.ts +3 -0
- package/node_modules/@murphai/device-syncd/dist/registry.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/registry.js +5 -0
- package/node_modules/@murphai/device-syncd/dist/registry.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/service.d.ts +61 -0
- package/node_modules/@murphai/device-syncd/dist/service.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/service.js +496 -0
- package/node_modules/@murphai/device-syncd/dist/service.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/shared.d.ts +26 -0
- package/node_modules/@murphai/device-syncd/dist/shared.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/shared.js +182 -0
- package/node_modules/@murphai/device-syncd/dist/shared.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/store.d.ts +105 -0
- package/node_modules/@murphai/device-syncd/dist/store.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/store.js +965 -0
- package/node_modules/@murphai/device-syncd/dist/store.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/types.d.ts +287 -0
- package/node_modules/@murphai/device-syncd/dist/types.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/types.js +2 -0
- package/node_modules/@murphai/device-syncd/dist/types.js.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/webhook-verification.d.ts +14 -0
- package/node_modules/@murphai/device-syncd/dist/webhook-verification.d.ts.map +1 -0
- package/node_modules/@murphai/device-syncd/dist/webhook-verification.js +16 -0
- package/node_modules/@murphai/device-syncd/dist/webhook-verification.js.map +1 -0
- package/node_modules/@murphai/device-syncd/package.json +85 -0
- package/node_modules/@murphai/importers/README.md +34 -0
- package/node_modules/@murphai/importers/dist/assessment/core-port.d.ts +13 -0
- package/node_modules/@murphai/importers/dist/assessment/core-port.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/assessment/core-port.js +13 -0
- package/node_modules/@murphai/importers/dist/assessment/core-port.js.map +1 -0
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.d.ts +15 -0
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.js +32 -0
- package/node_modules/@murphai/importers/dist/assessment/import-assessment-response.js.map +1 -0
- package/node_modules/@murphai/importers/dist/assessment/index.d.ts +4 -0
- package/node_modules/@murphai/importers/dist/assessment/index.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/assessment/index.js +2 -0
- package/node_modules/@murphai/importers/dist/assessment/index.js.map +1 -0
- package/node_modules/@murphai/importers/dist/core-port.d.ts +119 -0
- package/node_modules/@murphai/importers/dist/core-port.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/core-port.js +22 -0
- package/node_modules/@murphai/importers/dist/core-port.js.map +1 -0
- package/node_modules/@murphai/importers/dist/create-importers.d.ts +17 -0
- package/node_modules/@murphai/importers/dist/create-importers.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/create-importers.js +68 -0
- package/node_modules/@murphai/importers/dist/create-importers.js.map +1 -0
- package/node_modules/@murphai/importers/dist/csv-sample-importer.d.ts +22 -0
- package/node_modules/@murphai/importers/dist/csv-sample-importer.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/csv-sample-importer.js +153 -0
- package/node_modules/@murphai/importers/dist/csv-sample-importer.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/defaults.d.ts +5 -0
- package/node_modules/@murphai/importers/dist/device-providers/defaults.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/defaults.js +11 -0
- package/node_modules/@murphai/importers/dist/device-providers/defaults.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-activity-normalizers.d.ts +9 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-activity-normalizers.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-activity-normalizers.js +172 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-activity-normalizers.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-health-normalizers.d.ts +12 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-health-normalizers.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-health-normalizers.js +619 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-health-normalizers.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-helpers.d.ts +40 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-helpers.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-helpers.js +295 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin-helpers.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin.d.ts +19 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin.js +150 -0
- package/node_modules/@murphai/importers/dist/device-providers/garmin.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.d.ts +14 -0
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.js +37 -0
- package/node_modules/@murphai/importers/dist/device-providers/import-device-provider-snapshot.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/index.d.ts +10 -0
- package/node_modules/@murphai/importers/dist/device-providers/index.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/index.js +8 -0
- package/node_modules/@murphai/importers/dist/device-providers/index.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/oura.d.ts +20 -0
- package/node_modules/@murphai/importers/dist/device-providers/oura.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/oura.js +602 -0
- package/node_modules/@murphai/importers/dist/device-providers/oura.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/provider-descriptors.d.ts +491 -0
- package/node_modules/@murphai/importers/dist/device-providers/provider-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/provider-descriptors.js +326 -0
- package/node_modules/@murphai/importers/dist/device-providers/provider-descriptors.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/registry.d.ts +9 -0
- package/node_modules/@murphai/importers/dist/device-providers/registry.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/registry.js +5 -0
- package/node_modules/@murphai/importers/dist/device-providers/registry.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.d.ts +81 -0
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.js +215 -0
- package/node_modules/@murphai/importers/dist/device-providers/shared-normalization.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/types.d.ts +12 -0
- package/node_modules/@murphai/importers/dist/device-providers/types.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/types.js +2 -0
- package/node_modules/@murphai/importers/dist/device-providers/types.js.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/whoop.d.ts +16 -0
- package/node_modules/@murphai/importers/dist/device-providers/whoop.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/device-providers/whoop.js +410 -0
- package/node_modules/@murphai/importers/dist/device-providers/whoop.js.map +1 -0
- package/node_modules/@murphai/importers/dist/document-importer.d.ts +15 -0
- package/node_modules/@murphai/importers/dist/document-importer.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/document-importer.js +31 -0
- package/node_modules/@murphai/importers/dist/document-importer.js.map +1 -0
- package/node_modules/@murphai/importers/dist/index.d.ts +10 -0
- package/node_modules/@murphai/importers/dist/index.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/index.js +9 -0
- package/node_modules/@murphai/importers/dist/index.js.map +1 -0
- package/node_modules/@murphai/importers/dist/meal-importer.d.ts +15 -0
- package/node_modules/@murphai/importers/dist/meal-importer.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/meal-importer.js +39 -0
- package/node_modules/@murphai/importers/dist/meal-importer.js.map +1 -0
- package/node_modules/@murphai/importers/dist/preset-registry.d.ts +31 -0
- package/node_modules/@murphai/importers/dist/preset-registry.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/preset-registry.js +96 -0
- package/node_modules/@murphai/importers/dist/preset-registry.js.map +1 -0
- package/node_modules/@murphai/importers/dist/shared.d.ts +31 -0
- package/node_modules/@murphai/importers/dist/shared.d.ts.map +1 -0
- package/node_modules/@murphai/importers/dist/shared.js +154 -0
- package/node_modules/@murphai/importers/dist/shared.js.map +1 -0
- package/node_modules/@murphai/importers/package.json +36 -0
- package/node_modules/@murphai/runtime-state/README.md +37 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.js +80 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state-security.d.ts +29 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state-security.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state-security.js +159 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state-security.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state.d.ts +33 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state.js +47 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-state.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-usage.d.ts +56 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-usage.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-usage.js +189 -0
- package/node_modules/@murphai/runtime-state/dist/assistant-usage.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/atomic-write.d.ts +7 -0
- package/node_modules/@murphai/runtime-state/dist/atomic-write.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/atomic-write.js +27 -0
- package/node_modules/@murphai/runtime-state/dist/atomic-write.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/device-sync-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/device-sync-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/device-sync-local-state-descriptors.js +12 -0
- package/node_modules/@murphai/runtime-state/dist/device-sync-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/gateway-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/gateway-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/gateway-local-state-descriptors.js +13 -0
- package/node_modules/@murphai/runtime-state/dist/gateway-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-node.d.ts +43 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-node.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-node.js +203 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-node.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-ref.d.ts +13 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-ref.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-ref.js +46 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle-ref.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle.d.ts +67 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle.js +261 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundle.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.d.ts +31 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.js +211 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-bundles.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.d.ts +50 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.js +191 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-email.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-env.d.ts +14 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-env.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-env.js +59 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-env.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-keys.d.ts +83 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-keys.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-keys.js +308 -0
- package/node_modules/@murphai/runtime-state/dist/hosted-user-keys.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/inbox-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/inbox-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/inbox-local-state-descriptors.js +18 -0
- package/node_modules/@murphai/runtime-state/dist/inbox-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/index.d.ts +7 -0
- package/node_modules/@murphai/runtime-state/dist/index.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/index.js +7 -0
- package/node_modules/@murphai/runtime-state/dist/index.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-helpers.d.ts +31 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-helpers.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-helpers.js +120 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-helpers.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-manifests.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-manifests.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-manifests.js +17 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-descriptor-manifests.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-files.d.ts +10 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-files.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-files.js +27 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-files.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-taxonomy.d.ts +29 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-taxonomy.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-taxonomy.js +82 -0
- package/node_modules/@murphai/runtime-state/dist/local-state-taxonomy.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/locks.d.ts +46 -0
- package/node_modules/@murphai/runtime-state/dist/locks.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/locks.js +187 -0
- package/node_modules/@murphai/runtime-state/dist/locks.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/loopback-control-plane.d.ts +4 -0
- package/node_modules/@murphai/runtime-state/dist/loopback-control-plane.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/loopback-control-plane.js +35 -0
- package/node_modules/@murphai/runtime-state/dist/loopback-control-plane.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/node/index.d.ts +22 -0
- package/node_modules/@murphai/runtime-state/dist/node/index.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/node/index.js +22 -0
- package/node_modules/@murphai/runtime-state/dist/node/index.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/parser-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/parser-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/parser-local-state-descriptors.js +12 -0
- package/node_modules/@murphai/runtime-state/dist/parser-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/process-env.d.ts +4 -0
- package/node_modules/@murphai/runtime-state/dist/process-env.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/process-env.js +124 -0
- package/node_modules/@murphai/runtime-state/dist/process-env.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/query-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/query-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/query-local-state-descriptors.js +13 -0
- package/node_modules/@murphai/runtime-state/dist/query-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/runtime-paths.d.ts +48 -0
- package/node_modules/@murphai/runtime-state/dist/runtime-paths.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/runtime-paths.js +93 -0
- package/node_modules/@murphai/runtime-state/dist/runtime-paths.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/shared.d.ts +14 -0
- package/node_modules/@murphai/runtime-state/dist/shared.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/shared.js +46 -0
- package/node_modules/@murphai/runtime-state/dist/shared.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/sqlite.d.ts +26 -0
- package/node_modules/@murphai/runtime-state/dist/sqlite.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/sqlite.js +110 -0
- package/node_modules/@murphai/runtime-state/dist/sqlite.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/ulid.d.ts +5 -0
- package/node_modules/@murphai/runtime-state/dist/ulid.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/ulid.js +31 -0
- package/node_modules/@murphai/runtime-state/dist/ulid.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-files.d.ts +24 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-files.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-files.js +30 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-files.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-state.d.ts +18 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-state.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-state.js +25 -0
- package/node_modules/@murphai/runtime-state/dist/versioned-json-state.js.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/write-operation-local-state-descriptors.d.ts +3 -0
- package/node_modules/@murphai/runtime-state/dist/write-operation-local-state-descriptors.d.ts.map +1 -0
- package/node_modules/@murphai/runtime-state/dist/write-operation-local-state-descriptors.js +12 -0
- package/node_modules/@murphai/runtime-state/dist/write-operation-local-state-descriptors.js.map +1 -0
- package/node_modules/@murphai/runtime-state/package.json +30 -0
- package/package.json +45 -11
- package/dist/.tsbuildinfo +0 -1
- package/dist/callback-hosts.d.ts +0 -19
- package/dist/callback-hosts.d.ts.map +0 -1
- package/dist/callback-hosts.js +0 -19
- package/dist/callback-hosts.js.map +0 -1
- package/dist/web-control-plane.d.ts +0 -105
- package/dist/web-control-plane.d.ts.map +0 -1
- package/dist/web-control-plane.js +0 -358
- package/dist/web-control-plane.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ExperimentFrontmatter, ExperimentStatus } from "@murphai/contracts";
|
|
2
|
+
import type { ExperimentEventRecord } from "@murphai/contracts";
|
|
3
|
+
import type { DateInput } from "../types.ts";
|
|
4
|
+
export interface CreateExperimentInput {
|
|
5
|
+
vaultRoot: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
hypothesis?: string;
|
|
9
|
+
startedOn?: DateInput;
|
|
10
|
+
status?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateExperimentResult {
|
|
13
|
+
created: boolean;
|
|
14
|
+
experiment: {
|
|
15
|
+
id: string;
|
|
16
|
+
slug: string;
|
|
17
|
+
relativePath: string;
|
|
18
|
+
};
|
|
19
|
+
event: ExperimentEventRecord | null;
|
|
20
|
+
auditPath: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface UpdateExperimentInput {
|
|
23
|
+
vaultRoot: string;
|
|
24
|
+
relativePath: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
hypothesis?: string;
|
|
27
|
+
startedOn?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
body?: string;
|
|
30
|
+
tags?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface UpdateExperimentResult {
|
|
33
|
+
experimentId: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
relativePath: string;
|
|
36
|
+
status: ExperimentStatus;
|
|
37
|
+
updated: true;
|
|
38
|
+
}
|
|
39
|
+
interface AppendExperimentLifecycleEventInput {
|
|
40
|
+
vaultRoot: string;
|
|
41
|
+
relativePath: string;
|
|
42
|
+
phase: "checkpoint" | "stop";
|
|
43
|
+
occurredAt?: string;
|
|
44
|
+
title: string;
|
|
45
|
+
note?: string;
|
|
46
|
+
nextStatus?: ExperimentStatus;
|
|
47
|
+
endedOn?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AppendExperimentLifecycleEventResult extends UpdateExperimentResult {
|
|
50
|
+
eventId: string;
|
|
51
|
+
ledgerFile: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function readExperimentFrontmatterDocument(vaultRoot: string, relativePath: string): Promise<{
|
|
54
|
+
rawDocument: string;
|
|
55
|
+
document: {
|
|
56
|
+
attributes: ExperimentFrontmatter;
|
|
57
|
+
body: string;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
export declare function createExperiment({ vaultRoot, slug, title, hypothesis, startedOn, status, }: CreateExperimentInput): Promise<CreateExperimentResult>;
|
|
61
|
+
export declare function updateExperiment(input: UpdateExperimentInput): Promise<UpdateExperimentResult>;
|
|
62
|
+
export declare function checkpointExperiment(input: Omit<AppendExperimentLifecycleEventInput, "phase" | "nextStatus" | "endedOn">): Promise<AppendExperimentLifecycleEventResult>;
|
|
63
|
+
export declare function stopExperiment(input: {
|
|
64
|
+
vaultRoot: string;
|
|
65
|
+
relativePath: string;
|
|
66
|
+
occurredAt?: string;
|
|
67
|
+
title: string;
|
|
68
|
+
note?: string;
|
|
69
|
+
}): Promise<AppendExperimentLifecycleEventResult>;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=experiments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/domains/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AA6B5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;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C;IACpB,QAAQ,EAAE;QACR,UAAU,EAAE,qBAAqB,CAAC;QAClC,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC,CAQD;AA8BD,wBAAsB,gBAAgB,CAAC,EACrC,SAAS,EACT,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAsB,EACtB,MAAiB,GAClB,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAkIzD;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAiDjC;AAsED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,IAAI,CAAC,mCAAmC,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC,GACnF,OAAO,CAAC,oCAAoC,CAAC,CAK/C;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,OAAO,CAAC,oCAAoC,CAAC,CAc/C"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { EXPERIMENT_STATUSES, experimentFrontmatterSchema, safeParseContract, } from "@murphai/contracts";
|
|
2
|
+
import { FRONTMATTER_SCHEMA_VERSIONS, ID_PREFIXES, VAULT_LAYOUT } from "../constants.js";
|
|
3
|
+
import { emitAuditRecord } from "../audit.js";
|
|
4
|
+
import { VaultError } from "../errors.js";
|
|
5
|
+
import { parseFrontmatterDocument, stringifyFrontmatterDocument } from "../frontmatter.js";
|
|
6
|
+
import { readUtf8File } from "../fs.js";
|
|
7
|
+
import { generateRecordId } from "../ids.js";
|
|
8
|
+
import { toMonthlyShardRelativePath } from "../jsonl.js";
|
|
9
|
+
import { sanitizePathSegment } from "../path-safety.js";
|
|
10
|
+
import { defaultTimeZone, toIsoTimestamp, toLocalDayKey } from "../time.js";
|
|
11
|
+
import { loadVault } from "../vault.js";
|
|
12
|
+
import { buildExperimentEventRecord } from "./events.js";
|
|
13
|
+
import { compactObject, normalizeOptionalText, normalizeTimestampInput, readValidatedFrontmatterDocument, runLoadedCanonicalWrite, uniqueTrimmedStringList, validateContract, } from "./shared.js";
|
|
14
|
+
const EXPERIMENT_STATUS_SET = new Set(EXPERIMENT_STATUSES);
|
|
15
|
+
function normalizeExperimentHypothesis(value) {
|
|
16
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
17
|
+
}
|
|
18
|
+
function requireExperimentStatus(value) {
|
|
19
|
+
if (typeof value !== "string" || !EXPERIMENT_STATUS_SET.has(value)) {
|
|
20
|
+
throw new VaultError("EXPERIMENT_STATUS_INVALID", "Experiment status is invalid.");
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
function frontmatterString(value, key) {
|
|
25
|
+
const candidate = value[key];
|
|
26
|
+
return typeof candidate === "string" ? candidate : "";
|
|
27
|
+
}
|
|
28
|
+
function toExperimentComparableAttributes(attributes) {
|
|
29
|
+
return compactObject({
|
|
30
|
+
slug: frontmatterString(attributes, "slug").trim(),
|
|
31
|
+
status: requireExperimentStatus(attributes.status),
|
|
32
|
+
title: frontmatterString(attributes, "title").trim(),
|
|
33
|
+
startedOn: frontmatterString(attributes, "startedOn").trim(),
|
|
34
|
+
hypothesis: normalizeExperimentHypothesis(attributes.hypothesis),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function validateExperimentFrontmatter(value, relativePath = "experiment") {
|
|
38
|
+
return validateContract(experimentFrontmatterSchema, value, "EXPERIMENT_FRONTMATTER_INVALID", `Experiment frontmatter for "${relativePath}" is invalid.`, {
|
|
39
|
+
relativePath,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export async function readExperimentFrontmatterDocument(vaultRoot, relativePath) {
|
|
43
|
+
return readValidatedFrontmatterDocument(vaultRoot, relativePath, experimentFrontmatterSchema, "EXPERIMENT_FRONTMATTER_INVALID", `Experiment frontmatter for "${relativePath}" is invalid.`);
|
|
44
|
+
}
|
|
45
|
+
function appendExperimentNoteBlock(body, input) {
|
|
46
|
+
const trimmedBody = body.trimEnd();
|
|
47
|
+
const lines = [`### ${input.title} (${input.occurredAt})`];
|
|
48
|
+
const note = normalizeOptionalText(input.note);
|
|
49
|
+
if (note) {
|
|
50
|
+
lines.push("", note);
|
|
51
|
+
}
|
|
52
|
+
const block = `${lines.join("\n")}\n`;
|
|
53
|
+
if (trimmedBody.length === 0) {
|
|
54
|
+
return `## Notes\n\n${block}`;
|
|
55
|
+
}
|
|
56
|
+
if (trimmedBody.includes("\n## Notes\n")) {
|
|
57
|
+
return `${trimmedBody}\n\n${block}`;
|
|
58
|
+
}
|
|
59
|
+
return `${trimmedBody}\n\n## Notes\n\n${block}`;
|
|
60
|
+
}
|
|
61
|
+
export async function createExperiment({ vaultRoot, slug, title, hypothesis, startedOn = new Date(), status = "active", }) {
|
|
62
|
+
const vault = await loadVault({ vaultRoot });
|
|
63
|
+
const safeSlug = sanitizePathSegment(slug, "experiment");
|
|
64
|
+
const startedTimestamp = toIsoTimestamp(startedOn, "startedOn");
|
|
65
|
+
const startedDay = toLocalDayKey(startedOn, vault.metadata.timezone ?? defaultTimeZone(), "startedOn");
|
|
66
|
+
const relativePath = `${VAULT_LAYOUT.experimentsDirectory}/${safeSlug}.md`;
|
|
67
|
+
const normalizedTitle = String(title ?? safeSlug).trim();
|
|
68
|
+
const normalizedStatus = requireExperimentStatus(status);
|
|
69
|
+
const normalizedHypothesis = normalizeExperimentHypothesis(hypothesis);
|
|
70
|
+
const comparableAttributes = toExperimentComparableAttributes({
|
|
71
|
+
slug: safeSlug,
|
|
72
|
+
status: normalizedStatus,
|
|
73
|
+
title: normalizedTitle,
|
|
74
|
+
startedOn: startedDay,
|
|
75
|
+
hypothesis: normalizedHypothesis,
|
|
76
|
+
});
|
|
77
|
+
try {
|
|
78
|
+
const existingDocument = parseFrontmatterDocument(await readUtf8File(vaultRoot, relativePath));
|
|
79
|
+
const existingResult = safeParseContract(experimentFrontmatterSchema, existingDocument.attributes);
|
|
80
|
+
if (!existingResult.success) {
|
|
81
|
+
throw new VaultError("FRONTMATTER_INVALID", `Existing experiment "${safeSlug}" failed contract validation.`, {
|
|
82
|
+
relativePath,
|
|
83
|
+
errors: existingResult.errors,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const existingAttributes = existingResult.data;
|
|
87
|
+
if (JSON.stringify(toExperimentComparableAttributes(existingAttributes)) !==
|
|
88
|
+
JSON.stringify(comparableAttributes)) {
|
|
89
|
+
throw new VaultError("VAULT_EXPERIMENT_CONFLICT", `Experiment "${safeSlug}" already exists with different frontmatter.`, {
|
|
90
|
+
relativePath,
|
|
91
|
+
experimentId: existingAttributes.experimentId,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
created: false,
|
|
96
|
+
experiment: {
|
|
97
|
+
id: existingAttributes.experimentId,
|
|
98
|
+
slug: existingAttributes.slug,
|
|
99
|
+
relativePath,
|
|
100
|
+
},
|
|
101
|
+
event: null,
|
|
102
|
+
auditPath: null,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
if (!(error instanceof VaultError) || error.code !== "VAULT_FILE_MISSING") {
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const experimentId = generateRecordId(ID_PREFIXES.experiment);
|
|
111
|
+
const attributes = validateContract(experimentFrontmatterSchema, compactObject({
|
|
112
|
+
schemaVersion: FRONTMATTER_SCHEMA_VERSIONS.experiment,
|
|
113
|
+
docType: "experiment",
|
|
114
|
+
experimentId,
|
|
115
|
+
slug: safeSlug,
|
|
116
|
+
status: normalizedStatus,
|
|
117
|
+
title: normalizedTitle,
|
|
118
|
+
startedOn: startedDay,
|
|
119
|
+
hypothesis: normalizedHypothesis,
|
|
120
|
+
}), "FRONTMATTER_INVALID", "Experiment frontmatter failed contract validation before write.");
|
|
121
|
+
const markdown = stringifyFrontmatterDocument({
|
|
122
|
+
attributes: { ...attributes },
|
|
123
|
+
body: `# ${normalizedTitle}\n\n## Plan\n\n## Notes\n\n`,
|
|
124
|
+
});
|
|
125
|
+
const event = buildExperimentEventRecord({
|
|
126
|
+
occurredAt: startedTimestamp,
|
|
127
|
+
title: normalizedTitle,
|
|
128
|
+
experimentId,
|
|
129
|
+
experimentSlug: safeSlug,
|
|
130
|
+
phase: "start",
|
|
131
|
+
});
|
|
132
|
+
const ledgerFile = toMonthlyShardRelativePath(VAULT_LAYOUT.eventLedgerDirectory, startedTimestamp, "occurredAt");
|
|
133
|
+
return runLoadedCanonicalWrite({
|
|
134
|
+
vaultRoot,
|
|
135
|
+
operationType: "experiment_create",
|
|
136
|
+
summary: `Create experiment ${safeSlug}`,
|
|
137
|
+
occurredAt: startedTimestamp,
|
|
138
|
+
mutate: async ({ batch }) => {
|
|
139
|
+
await batch.stageTextWrite(relativePath, markdown, { overwrite: false });
|
|
140
|
+
await batch.stageJsonlAppend(ledgerFile, `${JSON.stringify(event)}\n`);
|
|
141
|
+
const audit = await emitAuditRecord({
|
|
142
|
+
vaultRoot,
|
|
143
|
+
batch,
|
|
144
|
+
action: "experiment_create",
|
|
145
|
+
commandName: "core.createExperiment",
|
|
146
|
+
summary: `Created experiment ${safeSlug}.`,
|
|
147
|
+
occurredAt: startedTimestamp,
|
|
148
|
+
files: [relativePath, ledgerFile],
|
|
149
|
+
targetIds: [experimentId, event.id],
|
|
150
|
+
});
|
|
151
|
+
return {
|
|
152
|
+
created: true,
|
|
153
|
+
experiment: {
|
|
154
|
+
id: experimentId,
|
|
155
|
+
slug: safeSlug,
|
|
156
|
+
relativePath,
|
|
157
|
+
},
|
|
158
|
+
event,
|
|
159
|
+
auditPath: audit.relativePath,
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export async function updateExperiment(input) {
|
|
165
|
+
const { document } = await readExperimentFrontmatterDocument(input.vaultRoot, input.relativePath);
|
|
166
|
+
const nextAttributes = validateExperimentFrontmatter(compactObject({
|
|
167
|
+
...document.attributes,
|
|
168
|
+
title: normalizeOptionalText(input.title) ?? document.attributes.title,
|
|
169
|
+
hypothesis: input.hypothesis === undefined
|
|
170
|
+
? document.attributes.hypothesis
|
|
171
|
+
: normalizeOptionalText(input.hypothesis) ?? undefined,
|
|
172
|
+
startedOn: input.startedOn ?? document.attributes.startedOn,
|
|
173
|
+
status: input.status === undefined
|
|
174
|
+
? document.attributes.status
|
|
175
|
+
: requireExperimentStatus(input.status),
|
|
176
|
+
tags: input.tags === undefined
|
|
177
|
+
? document.attributes.tags
|
|
178
|
+
: uniqueTrimmedStringList(input.tags) ?? undefined,
|
|
179
|
+
}), input.relativePath);
|
|
180
|
+
const nextMarkdown = stringifyFrontmatterDocument({
|
|
181
|
+
attributes: nextAttributes,
|
|
182
|
+
body: input.body ?? document.body,
|
|
183
|
+
});
|
|
184
|
+
return runLoadedCanonicalWrite({
|
|
185
|
+
vaultRoot: input.vaultRoot,
|
|
186
|
+
operationType: "experiment_update",
|
|
187
|
+
summary: `Update experiment ${nextAttributes.experimentId}`,
|
|
188
|
+
occurredAt: new Date(),
|
|
189
|
+
mutate: async ({ batch }) => {
|
|
190
|
+
await batch.stageTextWrite(input.relativePath, nextMarkdown, {
|
|
191
|
+
overwrite: true,
|
|
192
|
+
});
|
|
193
|
+
return {
|
|
194
|
+
experimentId: nextAttributes.experimentId,
|
|
195
|
+
slug: nextAttributes.slug,
|
|
196
|
+
relativePath: input.relativePath,
|
|
197
|
+
status: nextAttributes.status,
|
|
198
|
+
updated: true,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async function appendExperimentLifecycleEvent(input) {
|
|
204
|
+
const vault = await loadVault({ vaultRoot: input.vaultRoot });
|
|
205
|
+
const { document } = await readExperimentFrontmatterDocument(input.vaultRoot, input.relativePath);
|
|
206
|
+
const occurredAt = normalizeTimestampInput(input.occurredAt ?? new Date());
|
|
207
|
+
if (!occurredAt) {
|
|
208
|
+
throw new VaultError("INVALID_TIMESTAMP", "Experiment lifecycle event requires occurredAt.");
|
|
209
|
+
}
|
|
210
|
+
const nextAttributes = validateExperimentFrontmatter(compactObject({
|
|
211
|
+
...document.attributes,
|
|
212
|
+
endedOn: input.endedOn ?? document.attributes.endedOn,
|
|
213
|
+
status: input.nextStatus ?? document.attributes.status,
|
|
214
|
+
}), input.relativePath);
|
|
215
|
+
const nextMarkdown = stringifyFrontmatterDocument({
|
|
216
|
+
attributes: nextAttributes,
|
|
217
|
+
body: appendExperimentNoteBlock(document.body, {
|
|
218
|
+
occurredAt,
|
|
219
|
+
title: input.title,
|
|
220
|
+
note: input.note,
|
|
221
|
+
}),
|
|
222
|
+
});
|
|
223
|
+
const eventRecord = buildExperimentEventRecord({
|
|
224
|
+
occurredAt,
|
|
225
|
+
title: `${document.attributes.title} ${input.title}`.trim(),
|
|
226
|
+
note: input.note,
|
|
227
|
+
experimentId: document.attributes.experimentId,
|
|
228
|
+
experimentSlug: document.attributes.slug,
|
|
229
|
+
phase: input.phase,
|
|
230
|
+
timeZone: vault.metadata.timezone,
|
|
231
|
+
});
|
|
232
|
+
const ledgerFile = toMonthlyShardRelativePath(VAULT_LAYOUT.eventLedgerDirectory, occurredAt, "occurredAt");
|
|
233
|
+
return runLoadedCanonicalWrite({
|
|
234
|
+
vaultRoot: input.vaultRoot,
|
|
235
|
+
operationType: "experiment_lifecycle_event",
|
|
236
|
+
summary: `Append ${input.phase} lifecycle event for ${document.attributes.experimentId}`,
|
|
237
|
+
occurredAt,
|
|
238
|
+
mutate: async ({ batch }) => {
|
|
239
|
+
await batch.stageTextWrite(input.relativePath, nextMarkdown, {
|
|
240
|
+
overwrite: true,
|
|
241
|
+
});
|
|
242
|
+
await batch.stageJsonlAppend(ledgerFile, `${JSON.stringify(eventRecord)}\n`);
|
|
243
|
+
return {
|
|
244
|
+
experimentId: document.attributes.experimentId,
|
|
245
|
+
slug: document.attributes.slug,
|
|
246
|
+
relativePath: input.relativePath,
|
|
247
|
+
status: nextAttributes.status,
|
|
248
|
+
eventId: eventRecord.id,
|
|
249
|
+
ledgerFile,
|
|
250
|
+
updated: true,
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
export async function checkpointExperiment(input) {
|
|
256
|
+
return appendExperimentLifecycleEvent({
|
|
257
|
+
...input,
|
|
258
|
+
phase: "checkpoint",
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
export async function stopExperiment(input) {
|
|
262
|
+
const occurredAt = normalizeTimestampInput(input.occurredAt ?? new Date());
|
|
263
|
+
if (!occurredAt) {
|
|
264
|
+
throw new VaultError("INVALID_TIMESTAMP", "Experiment lifecycle event requires occurredAt.");
|
|
265
|
+
}
|
|
266
|
+
const vault = await loadVault({ vaultRoot: input.vaultRoot });
|
|
267
|
+
return appendExperimentLifecycleEvent({
|
|
268
|
+
...input,
|
|
269
|
+
phase: "stop",
|
|
270
|
+
occurredAt,
|
|
271
|
+
nextStatus: "completed",
|
|
272
|
+
endedOn: toLocalDayKey(occurredAt, vault.metadata.timezone ?? defaultTimeZone(), "occurredAt"),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=experiments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../src/domains/experiments.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAA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AE,CAAC,CAAC;IAE9D,OAAO,8BAA8B,CAAC;QACpC,GAAG,KAAK;QACR,KAAK,EAAE,MAAM;QACb,UAAU;QACV,UAAU,EAAE,WAAW;QACvB,OAAO,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,IAAI,eAAe,EAAE,EAAE,YAAY,CAAC;KAC/F,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { JournalDayFrontmatter } from "@murphai/contracts";
|
|
2
|
+
import type { DateInput } from "../types.ts";
|
|
3
|
+
type JournalMutationKey = "eventIds" | "sampleStreams";
|
|
4
|
+
type JournalMutationOperation = "link" | "unlink";
|
|
5
|
+
export interface EnsureJournalDayInput {
|
|
6
|
+
vaultRoot: string;
|
|
7
|
+
date?: DateInput;
|
|
8
|
+
}
|
|
9
|
+
export interface EnsureJournalDayResult {
|
|
10
|
+
created: boolean;
|
|
11
|
+
relativePath: string;
|
|
12
|
+
auditPath?: string;
|
|
13
|
+
}
|
|
14
|
+
interface AppendJournalInput {
|
|
15
|
+
vaultRoot: string;
|
|
16
|
+
date: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
interface AppendJournalResult {
|
|
20
|
+
relativePath: string;
|
|
21
|
+
created: boolean;
|
|
22
|
+
updated: true;
|
|
23
|
+
}
|
|
24
|
+
interface MutateJournalLinksInput {
|
|
25
|
+
vaultRoot: string;
|
|
26
|
+
date: string;
|
|
27
|
+
key: JournalMutationKey;
|
|
28
|
+
values: string[];
|
|
29
|
+
operation: JournalMutationOperation;
|
|
30
|
+
}
|
|
31
|
+
interface MutateJournalLinksResult {
|
|
32
|
+
relativePath: string;
|
|
33
|
+
created: boolean;
|
|
34
|
+
changed: number;
|
|
35
|
+
eventIds: string[];
|
|
36
|
+
sampleStreams: string[];
|
|
37
|
+
}
|
|
38
|
+
export declare function readJournalDayFrontmatterDocument(vaultRoot: string, relativePath: string): Promise<{
|
|
39
|
+
rawDocument: string;
|
|
40
|
+
document: {
|
|
41
|
+
attributes: JournalDayFrontmatter;
|
|
42
|
+
body: string;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
export declare function ensureJournalDay({ vaultRoot, date, }: EnsureJournalDayInput): Promise<EnsureJournalDayResult>;
|
|
46
|
+
export declare function appendJournal(input: AppendJournalInput): Promise<AppendJournalResult>;
|
|
47
|
+
export declare function linkJournalEventIds(input: Omit<MutateJournalLinksInput, "key" | "operation">): Promise<MutateJournalLinksResult>;
|
|
48
|
+
export declare function unlinkJournalEventIds(input: Omit<MutateJournalLinksInput, "key" | "operation">): Promise<MutateJournalLinksResult>;
|
|
49
|
+
export declare function linkJournalStreams(input: Omit<MutateJournalLinksInput, "key" | "operation">): Promise<MutateJournalLinksResult>;
|
|
50
|
+
export declare function unlinkJournalStreams(input: Omit<MutateJournalLinksInput, "key" | "operation">): Promise<MutateJournalLinksResult>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/domains/journal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAoBhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,kBAAkB,GAAG,UAAU,GAAG,eAAe,CAAC;AACvD,KAAK,wBAAwB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAkB;IAC1B,SAAS,EAAE,MAA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AwB,CAAC,CAMnC;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,IAAI,CAAC,uBAAuB,EAAE,KAAK,GAAG,WAAW,CAAC,GACxD,OAAO,CAAC,wBAAwB,CAAC,CAMnC;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,IAAI,CAAC,uBAAuB,EAAE,KAAK,GAAG,WAAW,CAAC,GACxD,OAAO,CAAC,wBAAwB,CAAC,CAMnC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { journalDayFrontmatterSchema } from "@murphai/contracts";
|
|
2
|
+
import { FRONTMATTER_SCHEMA_VERSIONS, VAULT_LAYOUT } from "../constants.js";
|
|
3
|
+
import { emitAuditRecord } from "../audit.js";
|
|
4
|
+
import { VaultError } from "../errors.js";
|
|
5
|
+
import { stringifyFrontmatterDocument } from "../frontmatter.js";
|
|
6
|
+
import { writeVaultTextFile } from "../fs.js";
|
|
7
|
+
import { loadVault } from "../vault.js";
|
|
8
|
+
import { defaultTimeZone, toLocalDayKey } from "../time.js";
|
|
9
|
+
import { appendMarkdownParagraph, readValidatedFrontmatterDocument, runLoadedCanonicalWrite, sortStrings, uniqueTrimmedStringList, validateContract, } from "./shared.js";
|
|
10
|
+
function validateJournalFrontmatter(value, relativePath = "journal") {
|
|
11
|
+
return validateContract(journalDayFrontmatterSchema, value, "JOURNAL_FRONTMATTER_INVALID", `Journal frontmatter for "${relativePath}" is invalid.`, {
|
|
12
|
+
relativePath,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export async function readJournalDayFrontmatterDocument(vaultRoot, relativePath) {
|
|
16
|
+
return readValidatedFrontmatterDocument(vaultRoot, relativePath, journalDayFrontmatterSchema, "JOURNAL_FRONTMATTER_INVALID", `Journal frontmatter for "${relativePath}" is invalid.`);
|
|
17
|
+
}
|
|
18
|
+
export async function ensureJournalDay({ vaultRoot, date, }) {
|
|
19
|
+
const vault = await loadVault({ vaultRoot });
|
|
20
|
+
const day = toLocalDayKey(date, vault.metadata.timezone ?? defaultTimeZone(), "date");
|
|
21
|
+
const [year] = day.split("-");
|
|
22
|
+
const relativePath = `${VAULT_LAYOUT.journalDirectory}/${year}/${day}.md`;
|
|
23
|
+
const attributes = validateContract(journalDayFrontmatterSchema, {
|
|
24
|
+
schemaVersion: FRONTMATTER_SCHEMA_VERSIONS.journalDay,
|
|
25
|
+
docType: "journal_day",
|
|
26
|
+
dayKey: day,
|
|
27
|
+
eventIds: [],
|
|
28
|
+
sampleStreams: [],
|
|
29
|
+
}, "FRONTMATTER_INVALID", "Journal frontmatter failed contract validation before write.");
|
|
30
|
+
try {
|
|
31
|
+
await writeVaultTextFile(vaultRoot, relativePath, stringifyFrontmatterDocument({
|
|
32
|
+
attributes: { ...attributes },
|
|
33
|
+
body: `# ${day}\n\n## Summary\n\n`,
|
|
34
|
+
}), { overwrite: false });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (error instanceof VaultError && error.code === "VAULT_FILE_EXISTS") {
|
|
38
|
+
return {
|
|
39
|
+
created: false,
|
|
40
|
+
relativePath,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
const audit = await emitAuditRecord({
|
|
46
|
+
vaultRoot,
|
|
47
|
+
action: "journal_ensure",
|
|
48
|
+
commandName: "core.ensureJournalDay",
|
|
49
|
+
summary: `Ensured journal page for ${day}.`,
|
|
50
|
+
occurredAt: `${day}T00:00:00.000Z`,
|
|
51
|
+
files: [relativePath],
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
created: true,
|
|
55
|
+
relativePath,
|
|
56
|
+
auditPath: audit.relativePath,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export async function appendJournal(input) {
|
|
60
|
+
const ensured = await ensureJournalDay({
|
|
61
|
+
vaultRoot: input.vaultRoot,
|
|
62
|
+
date: input.date,
|
|
63
|
+
});
|
|
64
|
+
const { document } = await readJournalDayFrontmatterDocument(input.vaultRoot, ensured.relativePath);
|
|
65
|
+
const nextMarkdown = stringifyFrontmatterDocument({
|
|
66
|
+
attributes: document.attributes,
|
|
67
|
+
body: appendMarkdownParagraph(document.body, input.text),
|
|
68
|
+
});
|
|
69
|
+
return runLoadedCanonicalWrite({
|
|
70
|
+
vaultRoot: input.vaultRoot,
|
|
71
|
+
operationType: "journal_append_text",
|
|
72
|
+
summary: `Append journal text for ${input.date}`,
|
|
73
|
+
occurredAt: `${input.date}T00:00:00.000Z`,
|
|
74
|
+
mutate: async ({ batch }) => {
|
|
75
|
+
await batch.stageTextWrite(ensured.relativePath, nextMarkdown, {
|
|
76
|
+
overwrite: true,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
relativePath: ensured.relativePath,
|
|
80
|
+
created: ensured.created,
|
|
81
|
+
updated: true,
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function mutateJournalLinks(input) {
|
|
87
|
+
const ensured = input.operation === "link"
|
|
88
|
+
? await ensureJournalDay({
|
|
89
|
+
vaultRoot: input.vaultRoot,
|
|
90
|
+
date: input.date,
|
|
91
|
+
})
|
|
92
|
+
: null;
|
|
93
|
+
const relativePath = ensured?.relativePath ?? `${VAULT_LAYOUT.journalDirectory}/${input.date.slice(0, 4)}/${input.date}.md`;
|
|
94
|
+
let document;
|
|
95
|
+
try {
|
|
96
|
+
({ document } = await readJournalDayFrontmatterDocument(input.vaultRoot, relativePath));
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (error instanceof VaultError && error.code === "VAULT_FILE_MISSING") {
|
|
100
|
+
throw new VaultError("JOURNAL_DAY_MISSING", `No journal day found for "${input.date}".`);
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
const currentValues = new Set(document.attributes[input.key]);
|
|
105
|
+
let changed = 0;
|
|
106
|
+
for (const value of uniqueTrimmedStringList(input.values) ?? []) {
|
|
107
|
+
if (input.operation === "link") {
|
|
108
|
+
if (!currentValues.has(value)) {
|
|
109
|
+
currentValues.add(value);
|
|
110
|
+
changed += 1;
|
|
111
|
+
}
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (currentValues.delete(value)) {
|
|
115
|
+
changed += 1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const nextAttributes = validateJournalFrontmatter({
|
|
119
|
+
...document.attributes,
|
|
120
|
+
[input.key]: sortStrings([...currentValues]),
|
|
121
|
+
}, relativePath);
|
|
122
|
+
const nextMarkdown = stringifyFrontmatterDocument({
|
|
123
|
+
attributes: nextAttributes,
|
|
124
|
+
body: document.body,
|
|
125
|
+
});
|
|
126
|
+
return runLoadedCanonicalWrite({
|
|
127
|
+
vaultRoot: input.vaultRoot,
|
|
128
|
+
operationType: input.operation === "link" ? "journal_link" : "journal_unlink",
|
|
129
|
+
summary: `${input.operation === "link" ? "Link" : "Unlink"} journal ${input.key} for ${input.date}`,
|
|
130
|
+
occurredAt: `${input.date}T00:00:00.000Z`,
|
|
131
|
+
mutate: async ({ batch }) => {
|
|
132
|
+
await batch.stageTextWrite(relativePath, nextMarkdown, {
|
|
133
|
+
overwrite: true,
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
relativePath,
|
|
137
|
+
created: ensured?.created ?? false,
|
|
138
|
+
changed,
|
|
139
|
+
eventIds: nextAttributes.eventIds,
|
|
140
|
+
sampleStreams: nextAttributes.sampleStreams,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
export async function linkJournalEventIds(input) {
|
|
146
|
+
return mutateJournalLinks({
|
|
147
|
+
...input,
|
|
148
|
+
key: "eventIds",
|
|
149
|
+
operation: "link",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
export async function unlinkJournalEventIds(input) {
|
|
153
|
+
return mutateJournalLinks({
|
|
154
|
+
...input,
|
|
155
|
+
key: "eventIds",
|
|
156
|
+
operation: "unlink",
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
export async function linkJournalStreams(input) {
|
|
160
|
+
return mutateJournalLinks({
|
|
161
|
+
...input,
|
|
162
|
+
key: "sampleStreams",
|
|
163
|
+
operation: "link",
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
export async function unlinkJournalStreams(input) {
|
|
167
|
+
return mutateJournalLinks({
|
|
168
|
+
...input,
|
|
169
|
+
key: "sampleStreams",
|
|
170
|
+
operation: "unlink",
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=journal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../src/domains/journal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAChC,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AA8CrB,SAAS,0BAA0B,CACjC,KAAc,EACd,YAAY,GAAG,SAAS;IAExB,OAAO,gBAAgB,CACrB,2BAA2B,EAC3B,KAAK,EACL,6BAA6B,EAC7B,4BAA4B,YAAY,eAAe,EACvD;QACE,YAAY;KACb,CACF,CAAC;AACJ,CAAC;AAED,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,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,KAAK;gBAClC,OAAO;gBACP,QAAQ,EAAE,cAAc,CAAC,QAAQ;gBACjC,aAAa,EAAE,cAAc,CAAC,aAAa;aAC5C,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAyD;IAEzD,OAAO,kBAAkB,CAAC;QACxB,GAAG,KAAK;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,MAAM;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,KAAyD;IAEzD,OAAO,kBAAkB,CAAC;QACxB,GAAG,KAAK;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAyD;IAEzD,OAAO,kBAAkB,CAAC;QACxB,GAAG,KAAK;QACR,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,MAAM;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAyD;IAEzD,OAAO,kBAAkB,CAAC;QACxB,GAAG,KAAK;QACR,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ContractSchema } from "@murphai/contracts";
|
|
2
|
+
import { type WriteBatch } from "../operations/write-batch.ts";
|
|
3
|
+
import type { DateInput } from "../types.ts";
|
|
4
|
+
export interface CanonicalWriteInput<TResult> {
|
|
5
|
+
vaultRoot: string;
|
|
6
|
+
operationType: string;
|
|
7
|
+
summary: string;
|
|
8
|
+
occurredAt?: DateInput;
|
|
9
|
+
mutate: (context: {
|
|
10
|
+
batch: WriteBatch;
|
|
11
|
+
vaultRoot: string;
|
|
12
|
+
}) => Promise<TResult>;
|
|
13
|
+
}
|
|
14
|
+
export declare function compactObject<TRecord extends Record<string, unknown>>(record: TRecord): TRecord;
|
|
15
|
+
export declare function normalizeOptionalText(value: unknown): string | null;
|
|
16
|
+
export declare function uniqueStrings(values: readonly string[]): string[];
|
|
17
|
+
export declare function uniqueTrimmedStringList(value: unknown): string[] | undefined;
|
|
18
|
+
export declare function sortStrings(values: readonly string[]): string[];
|
|
19
|
+
export declare function ensureMarkdownHeading(body: string, title: string): string;
|
|
20
|
+
export declare function appendMarkdownParagraph(body: string, text: string): string;
|
|
21
|
+
export declare function replaceMarkdownTitle(body: string, title: string): string;
|
|
22
|
+
export declare function normalizeTimestampInput(value: unknown): string | undefined;
|
|
23
|
+
export declare function normalizeLocalDate(value: string | undefined): string | undefined;
|
|
24
|
+
export declare function validateContract<TContract>(schema: ContractSchema<TContract>, value: unknown, code: string, message: string, details?: Record<string, unknown>): TContract;
|
|
25
|
+
export declare function safeParseFrontmatterDocument<TContract>(schema: ContractSchema<TContract>, markdown: string, relativePath: string, code: string, message: string): {
|
|
26
|
+
attributes: TContract;
|
|
27
|
+
body: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function readValidatedFrontmatterDocument<TContract>(vaultRoot: string, relativePath: string, schema: ContractSchema<TContract>, code: string, message: string): Promise<{
|
|
30
|
+
rawDocument: string;
|
|
31
|
+
document: {
|
|
32
|
+
attributes: TContract;
|
|
33
|
+
body: string;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export declare function runLoadedCanonicalWrite<TResult>(input: CanonicalWriteInput<TResult>): Promise<TResult>;
|
|
37
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/domains/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM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