@sentropic/cluster-mesh 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comments/storage-schema.d.ts +1 -1
- package/dist/comments/transport-contracts.d.ts +1 -1
- package/dist/compile/contract/diagnostics.d.ts +9 -0
- package/dist/compile/contract/diagnostics.d.ts.map +1 -0
- package/dist/compile/contract/diagnostics.js +82 -0
- package/dist/compile/contract/diagnostics.js.map +1 -0
- package/dist/compile/contract/encoding.d.ts +12 -0
- package/dist/compile/contract/encoding.d.ts.map +1 -0
- package/dist/compile/contract/encoding.js +95 -0
- package/dist/compile/contract/encoding.js.map +1 -0
- package/dist/compile/contract/index.d.ts +9 -0
- package/dist/compile/contract/index.d.ts.map +1 -0
- package/dist/compile/contract/index.js +9 -0
- package/dist/compile/contract/index.js.map +1 -0
- package/dist/compile/contract/json.d.ts +3 -0
- package/dist/compile/contract/json.d.ts.map +1 -0
- package/dist/compile/contract/json.js +75 -0
- package/dist/compile/contract/json.js.map +1 -0
- package/dist/compile/contract/output.d.ts +5 -0
- package/dist/compile/contract/output.d.ts.map +1 -0
- package/dist/compile/contract/output.js +57 -0
- package/dist/compile/contract/output.js.map +1 -0
- package/dist/compile/contract/recipe.d.ts +5 -0
- package/dist/compile/contract/recipe.d.ts.map +1 -0
- package/dist/compile/contract/recipe.js +86 -0
- package/dist/compile/contract/recipe.js.map +1 -0
- package/dist/compile/contract/schema.d.ts +26 -0
- package/dist/compile/contract/schema.d.ts.map +1 -0
- package/dist/compile/contract/schema.js +92 -0
- package/dist/compile/contract/schema.js.map +1 -0
- package/dist/compile/contract/types.d.ts +166 -0
- package/dist/compile/contract/types.d.ts.map +1 -0
- package/dist/compile/contract/types.js +21 -0
- package/dist/compile/contract/types.js.map +1 -0
- package/dist/compile/contract/vectors.d.ts +38 -0
- package/dist/compile/contract/vectors.d.ts.map +1 -0
- package/dist/compile/contract/vectors.js +29 -0
- package/dist/compile/contract/vectors.js.map +1 -0
- package/dist/forge/contracts.d.ts +60 -0
- package/dist/forge/contracts.d.ts.map +1 -0
- package/dist/forge/contracts.js +19 -0
- package/dist/forge/contracts.js.map +1 -0
- package/dist/forge/custody.d.ts +7 -0
- package/dist/forge/custody.d.ts.map +1 -0
- package/dist/forge/custody.js +76 -0
- package/dist/forge/custody.js.map +1 -0
- package/dist/forge/enrollment.d.ts +151 -0
- package/dist/forge/enrollment.d.ts.map +1 -0
- package/dist/forge/enrollment.js +98 -0
- package/dist/forge/enrollment.js.map +1 -0
- package/dist/forge/github-api.d.ts +6 -0
- package/dist/forge/github-api.d.ts.map +1 -0
- package/dist/forge/github-api.js +131 -0
- package/dist/forge/github-api.js.map +1 -0
- package/dist/forge/hono.d.ts +14 -0
- package/dist/forge/hono.d.ts.map +1 -0
- package/dist/forge/hono.js +141 -0
- package/dist/forge/hono.js.map +1 -0
- package/dist/forge/lifecycle.d.ts +108 -0
- package/dist/forge/lifecycle.d.ts.map +1 -0
- package/dist/forge/lifecycle.js +160 -0
- package/dist/forge/lifecycle.js.map +1 -0
- package/dist/forge/records.d.ts +70 -0
- package/dist/forge/records.d.ts.map +1 -0
- package/dist/forge/records.js +2 -0
- package/dist/forge/records.js.map +1 -0
- package/dist/forge/rotation.d.ts +46 -0
- package/dist/forge/rotation.d.ts.map +1 -0
- package/dist/forge/rotation.js +62 -0
- package/dist/forge/rotation.js.map +1 -0
- package/dist/identity/auth-abort.d.ts +9 -0
- package/dist/identity/auth-abort.d.ts.map +1 -0
- package/dist/identity/auth-abort.js +59 -0
- package/dist/identity/auth-abort.js.map +1 -0
- package/dist/identity/auth-binding.d.ts +3 -0
- package/dist/identity/auth-binding.d.ts.map +1 -0
- package/dist/identity/auth-binding.js +87 -0
- package/dist/identity/auth-binding.js.map +1 -0
- package/dist/identity/auth-boundary.d.ts +11 -0
- package/dist/identity/auth-boundary.d.ts.map +1 -0
- package/dist/identity/auth-boundary.js +73 -0
- package/dist/identity/auth-boundary.js.map +1 -0
- package/dist/identity/auth-completion.d.ts +9 -0
- package/dist/identity/auth-completion.d.ts.map +1 -0
- package/dist/identity/auth-completion.js +24 -0
- package/dist/identity/auth-completion.js.map +1 -0
- package/dist/identity/auth-credentials.d.ts +5 -0
- package/dist/identity/auth-credentials.d.ts.map +1 -0
- package/dist/identity/auth-credentials.js +82 -0
- package/dist/identity/auth-credentials.js.map +1 -0
- package/dist/identity/auth-email.d.ts +8 -0
- package/dist/identity/auth-email.d.ts.map +1 -0
- package/dist/identity/auth-email.js +104 -0
- package/dist/identity/auth-email.js.map +1 -0
- package/dist/identity/auth-hono.d.ts +5 -0
- package/dist/identity/auth-hono.d.ts.map +1 -0
- package/dist/identity/auth-hono.js +10 -0
- package/dist/identity/auth-hono.js.map +1 -0
- package/dist/identity/auth-proofs.d.ts +11 -0
- package/dist/identity/auth-proofs.d.ts.map +1 -0
- package/dist/identity/auth-proofs.js +107 -0
- package/dist/identity/auth-proofs.js.map +1 -0
- package/dist/identity/auth-service-tenant.d.ts +4 -0
- package/dist/identity/auth-service-tenant.d.ts.map +1 -0
- package/dist/identity/auth-service-tenant.js +54 -0
- package/dist/identity/auth-service-tenant.js.map +1 -0
- package/dist/identity/auth-sessions.d.ts +8 -0
- package/dist/identity/auth-sessions.d.ts.map +1 -0
- package/dist/identity/auth-sessions.js +141 -0
- package/dist/identity/auth-sessions.js.map +1 -0
- package/dist/identity/auth-social.d.ts +4 -0
- package/dist/identity/auth-social.d.ts.map +1 -0
- package/dist/identity/auth-social.js +82 -0
- package/dist/identity/auth-social.js.map +1 -0
- package/dist/identity/auth-users.d.ts +9 -0
- package/dist/identity/auth-users.d.ts.map +1 -0
- package/dist/identity/auth-users.js +116 -0
- package/dist/identity/auth-users.js.map +1 -0
- package/dist/identity/auth-webauthn.d.ts +22 -0
- package/dist/identity/auth-webauthn.d.ts.map +1 -0
- package/dist/identity/auth-webauthn.js +108 -0
- package/dist/identity/auth-webauthn.js.map +1 -0
- package/dist/identity/cascade.d.ts +12 -0
- package/dist/identity/cascade.d.ts.map +1 -0
- package/dist/identity/cascade.js +19 -0
- package/dist/identity/cascade.js.map +1 -0
- package/dist/identity/connector-custody.d.ts +85 -0
- package/dist/identity/connector-custody.d.ts.map +1 -0
- package/dist/identity/connector-custody.js +288 -0
- package/dist/identity/connector-custody.js.map +1 -0
- package/dist/identity/conversation.d.ts +50 -0
- package/dist/identity/conversation.d.ts.map +1 -0
- package/dist/identity/conversation.js +102 -0
- package/dist/identity/conversation.js.map +1 -0
- package/dist/identity/custody-crypto.d.ts +37 -0
- package/dist/identity/custody-crypto.d.ts.map +1 -0
- package/dist/identity/custody-crypto.js +173 -0
- package/dist/identity/custody-crypto.js.map +1 -0
- package/dist/identity/decision.d.ts +28 -0
- package/dist/identity/decision.d.ts.map +1 -0
- package/dist/identity/decision.js +97 -0
- package/dist/identity/decision.js.map +1 -0
- package/dist/identity/index.d.ts +9 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +13 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/ledger.d.ts +120 -0
- package/dist/identity/ledger.d.ts.map +1 -0
- package/dist/identity/ledger.js +226 -0
- package/dist/identity/ledger.js.map +1 -0
- package/dist/identity/postgres.d.ts +13 -0
- package/dist/identity/postgres.d.ts.map +1 -0
- package/dist/identity/postgres.js +207 -0
- package/dist/identity/postgres.js.map +1 -0
- package/dist/identity/sqlite.d.ts +14 -0
- package/dist/identity/sqlite.d.ts.map +1 -0
- package/dist/identity/sqlite.js +193 -0
- package/dist/identity/sqlite.js.map +1 -0
- package/dist/identity-contracts/accounts.d.ts.map +1 -1
- package/dist/identity-contracts/accounts.js +4 -3
- package/dist/identity-contracts/accounts.js.map +1 -1
- package/dist/identity-contracts/boundary-resolution.d.ts +31 -0
- package/dist/identity-contracts/boundary-resolution.d.ts.map +1 -0
- package/dist/identity-contracts/boundary-resolution.js +56 -0
- package/dist/identity-contracts/boundary-resolution.js.map +1 -0
- package/dist/identity-contracts/composition-descriptors.d.ts +17 -0
- package/dist/identity-contracts/composition-descriptors.d.ts.map +1 -0
- package/dist/identity-contracts/composition-descriptors.js +77 -0
- package/dist/identity-contracts/composition-descriptors.js.map +1 -0
- package/dist/identity-contracts/custody-auth.d.ts +122 -0
- package/dist/identity-contracts/custody-auth.d.ts.map +1 -0
- package/dist/identity-contracts/custody-auth.js +2 -0
- package/dist/identity-contracts/custody-auth.js.map +1 -0
- package/dist/identity-contracts/custody-descriptors.d.ts +18 -0
- package/dist/identity-contracts/custody-descriptors.d.ts.map +1 -0
- package/dist/identity-contracts/custody-descriptors.js +83 -0
- package/dist/identity-contracts/custody-descriptors.js.map +1 -0
- package/dist/identity-contracts/custody-errors.d.ts +21 -0
- package/dist/identity-contracts/custody-errors.d.ts.map +1 -0
- package/dist/identity-contracts/custody-errors.js +80 -0
- package/dist/identity-contracts/custody-errors.js.map +1 -0
- package/dist/identity-contracts/custody-operations.d.ts +79 -0
- package/dist/identity-contracts/custody-operations.d.ts.map +1 -0
- package/dist/identity-contracts/custody-operations.js +2 -0
- package/dist/identity-contracts/custody-operations.js.map +1 -0
- package/dist/identity-contracts/custody.d.ts +587 -0
- package/dist/identity-contracts/custody.d.ts.map +1 -0
- package/dist/identity-contracts/custody.js +7 -0
- package/dist/identity-contracts/custody.js.map +1 -0
- package/dist/identity-contracts/doubles.d.ts +11 -2
- package/dist/identity-contracts/doubles.d.ts.map +1 -1
- package/dist/identity-contracts/doubles.js +20 -0
- package/dist/identity-contracts/doubles.js.map +1 -1
- package/dist/identity-contracts/index.d.ts +10 -0
- package/dist/identity-contracts/index.d.ts.map +1 -1
- package/dist/identity-contracts/index.js +10 -0
- package/dist/identity-contracts/index.js.map +1 -1
- package/dist/identity-contracts/oauth-reads.d.ts +42 -0
- package/dist/identity-contracts/oauth-reads.d.ts.map +1 -0
- package/dist/identity-contracts/oauth-reads.js +38 -0
- package/dist/identity-contracts/oauth-reads.js.map +1 -0
- package/dist/identity-contracts/replica-sync.d.ts +89 -0
- package/dist/identity-contracts/replica-sync.d.ts.map +1 -0
- package/dist/identity-contracts/replica-sync.js +7 -0
- package/dist/identity-contracts/replica-sync.js.map +1 -0
- package/dist/identity-contracts/service-tenancy.d.ts +43 -0
- package/dist/identity-contracts/service-tenancy.d.ts.map +1 -0
- package/dist/identity-contracts/service-tenancy.js +75 -0
- package/dist/identity-contracts/service-tenancy.js.map +1 -0
- package/dist/identity-contracts/workspace-deletion.d.ts +56 -0
- package/dist/identity-contracts/workspace-deletion.d.ts.map +1 -0
- package/dist/identity-contracts/workspace-deletion.js +7 -0
- package/dist/identity-contracts/workspace-deletion.js.map +1 -0
- package/dist/identity-stores/index.d.ts +4 -0
- package/dist/identity-stores/index.d.ts.map +1 -0
- package/dist/identity-stores/index.js +7 -0
- package/dist/identity-stores/index.js.map +1 -0
- package/dist/identity-stores/tenancy-postgres.d.ts +23 -0
- package/dist/identity-stores/tenancy-postgres.d.ts.map +1 -0
- package/dist/identity-stores/tenancy-postgres.js +294 -0
- package/dist/identity-stores/tenancy-postgres.js.map +1 -0
- package/dist/identity-stores/tenancy-schema.d.ts +11 -0
- package/dist/identity-stores/tenancy-schema.d.ts.map +1 -0
- package/dist/identity-stores/tenancy-schema.js +74 -0
- package/dist/identity-stores/tenancy-schema.js.map +1 -0
- package/dist/identity-stores/tenancy-sqlite.d.ts +24 -0
- package/dist/identity-stores/tenancy-sqlite.d.ts.map +1 -0
- package/dist/identity-stores/tenancy-sqlite.js +288 -0
- package/dist/identity-stores/tenancy-sqlite.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/loaders/notifications/index.d.ts +5 -0
- package/dist/loaders/notifications/index.d.ts.map +1 -0
- package/dist/loaders/notifications/index.js +6 -0
- package/dist/loaders/notifications/index.js.map +1 -0
- package/dist/mcp/stateful-preflight.d.ts +1 -1
- package/dist/messaging/email-port.d.ts +49 -0
- package/dist/messaging/email-port.d.ts.map +1 -0
- package/dist/messaging/email-port.js +92 -0
- package/dist/messaging/email-port.js.map +1 -0
- package/dist/messaging/index.d.ts +1 -0
- package/dist/messaging/index.d.ts.map +1 -1
- package/dist/messaging/index.js +1 -0
- package/dist/messaging/index.js.map +1 -1
- package/dist/modules/catalog.d.ts +5 -4
- package/dist/modules/catalog.d.ts.map +1 -1
- package/dist/modules/catalog.js +10 -5
- package/dist/modules/catalog.js.map +1 -1
- package/dist/modules/contracts.d.ts +1 -1
- package/dist/modules/contracts.d.ts.map +1 -1
- package/dist/modules/contracts.js +1 -0
- package/dist/modules/contracts.js.map +1 -1
- package/dist/notifications/incident-policy.d.ts +6 -0
- package/dist/notifications/incident-policy.d.ts.map +1 -0
- package/dist/notifications/incident-policy.js +119 -0
- package/dist/notifications/incident-policy.js.map +1 -0
- package/dist/notifications/incident-schedule.d.ts +14 -0
- package/dist/notifications/incident-schedule.d.ts.map +1 -0
- package/dist/notifications/incident-schedule.js +36 -0
- package/dist/notifications/incident-schedule.js.map +1 -0
- package/dist/notifications/incident-state.d.ts +72 -0
- package/dist/notifications/incident-state.d.ts.map +1 -0
- package/dist/notifications/incident-state.js +72 -0
- package/dist/notifications/incident-state.js.map +1 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +9 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/ops-job-failure-contract.d.ts +19 -0
- package/dist/notifications/ops-job-failure-contract.d.ts.map +1 -0
- package/dist/notifications/ops-job-failure-contract.js +183 -0
- package/dist/notifications/ops-job-failure-contract.js.map +1 -0
- package/dist/notifications/ops-job-failure-types.d.ts +81 -0
- package/dist/notifications/ops-job-failure-types.d.ts.map +1 -0
- package/dist/notifications/ops-job-failure-types.js +73 -0
- package/dist/notifications/ops-job-failure-types.js.map +1 -0
- package/dist/notifications/recipients-http.d.ts +66 -0
- package/dist/notifications/recipients-http.d.ts.map +1 -0
- package/dist/notifications/recipients-http.js +148 -0
- package/dist/notifications/recipients-http.js.map +1 -0
- package/dist/notifications/recipients.d.ts +50 -0
- package/dist/notifications/recipients.d.ts.map +1 -0
- package/dist/notifications/recipients.js +59 -0
- package/dist/notifications/recipients.js.map +1 -0
- package/dist/prompts/registry.d.ts +55 -0
- package/dist/prompts/registry.d.ts.map +1 -0
- package/dist/prompts/registry.js +76 -0
- package/dist/prompts/registry.js.map +1 -0
- package/dist/remote/assembly-contract.d.ts +96 -0
- package/dist/remote/assembly-contract.d.ts.map +1 -0
- package/dist/remote/assembly-contract.js +150 -0
- package/dist/remote/assembly-contract.js.map +1 -0
- package/dist/remote/contract-receipt.d.ts +36 -0
- package/dist/remote/contract-receipt.d.ts.map +1 -0
- package/dist/remote/contract-receipt.js +109 -0
- package/dist/remote/contract-receipt.js.map +1 -0
- package/dist/remote/credit-baseline.d.ts +60 -0
- package/dist/remote/credit-baseline.d.ts.map +1 -0
- package/dist/remote/credit-baseline.js +117 -0
- package/dist/remote/credit-baseline.js.map +1 -0
- package/dist/runtime/heavy-phase-queue.d.ts +101 -0
- package/dist/runtime/heavy-phase-queue.d.ts.map +1 -0
- package/dist/runtime/heavy-phase-queue.js +129 -0
- package/dist/runtime/heavy-phase-queue.js.map +1 -0
- package/dist/sessions/content-policy.d.ts +55 -0
- package/dist/sessions/content-policy.d.ts.map +1 -0
- package/dist/sessions/content-policy.js +133 -0
- package/dist/sessions/content-policy.js.map +1 -0
- package/dist/sessions/registry-admin.d.ts +19 -0
- package/dist/sessions/registry-admin.d.ts.map +1 -0
- package/dist/sessions/registry-admin.js +42 -0
- package/dist/sessions/registry-admin.js.map +1 -0
- package/dist/sessions/registry-freshness.d.ts +8 -0
- package/dist/sessions/registry-freshness.d.ts.map +1 -0
- package/dist/sessions/registry-freshness.js +108 -0
- package/dist/sessions/registry-freshness.js.map +1 -0
- package/dist/sessions/registry-ingest.d.ts +5 -0
- package/dist/sessions/registry-ingest.d.ts.map +1 -0
- package/dist/sessions/registry-ingest.js +113 -0
- package/dist/sessions/registry-ingest.js.map +1 -0
- package/dist/sessions/registry-publish.d.ts +18 -0
- package/dist/sessions/registry-publish.d.ts.map +1 -0
- package/dist/sessions/registry-publish.js +134 -0
- package/dist/sessions/registry-publish.js.map +1 -0
- package/dist/sessions/registry-store.d.ts +51 -0
- package/dist/sessions/registry-store.d.ts.map +1 -0
- package/dist/sessions/registry-store.js +134 -0
- package/dist/sessions/registry-store.js.map +1 -0
- package/dist/sessions/registry-types.d.ts +180 -0
- package/dist/sessions/registry-types.d.ts.map +1 -0
- package/dist/sessions/registry-types.js +32 -0
- package/dist/sessions/registry-types.js.map +1 -0
- package/dist/sessions/registry.d.ts +45 -0
- package/dist/sessions/registry.d.ts.map +1 -0
- package/dist/sessions/registry.js +74 -0
- package/dist/sessions/registry.js.map +1 -0
- package/dist/sessions/relay-bind.d.ts +38 -0
- package/dist/sessions/relay-bind.d.ts.map +1 -0
- package/dist/sessions/relay-bind.js +74 -0
- package/dist/sessions/relay-bind.js.map +1 -0
- package/dist/sessions/relay-brand.d.ts +2 -0
- package/dist/sessions/relay-brand.d.ts.map +1 -0
- package/dist/sessions/relay-brand.js +7 -0
- package/dist/sessions/relay-brand.js.map +1 -0
- package/dist/sessions/relay-capsule.d.ts +50 -0
- package/dist/sessions/relay-capsule.d.ts.map +1 -0
- package/dist/sessions/relay-capsule.js +72 -0
- package/dist/sessions/relay-capsule.js.map +1 -0
- package/dist/sessions/relay-chain-failure.d.ts +25 -0
- package/dist/sessions/relay-chain-failure.d.ts.map +1 -0
- package/dist/sessions/relay-chain-failure.js +23 -0
- package/dist/sessions/relay-chain-failure.js.map +1 -0
- package/dist/sessions/relay-chain.d.ts +74 -0
- package/dist/sessions/relay-chain.d.ts.map +1 -0
- package/dist/sessions/relay-chain.js +71 -0
- package/dist/sessions/relay-chain.js.map +1 -0
- package/dist/sessions/relay-composition.d.ts +8 -0
- package/dist/sessions/relay-composition.d.ts.map +1 -0
- package/dist/sessions/relay-composition.js +65 -0
- package/dist/sessions/relay-composition.js.map +1 -0
- package/dist/sessions/relay-credit.d.ts +40 -0
- package/dist/sessions/relay-credit.d.ts.map +1 -0
- package/dist/sessions/relay-credit.js +68 -0
- package/dist/sessions/relay-credit.js.map +1 -0
- package/dist/sessions/relay-engine.d.ts +19 -0
- package/dist/sessions/relay-engine.d.ts.map +1 -0
- package/dist/sessions/relay-engine.js +34 -0
- package/dist/sessions/relay-engine.js.map +1 -0
- package/dist/sessions/relay-frames.d.ts +28 -0
- package/dist/sessions/relay-frames.d.ts.map +1 -0
- package/dist/sessions/relay-frames.js +72 -0
- package/dist/sessions/relay-frames.js.map +1 -0
- package/dist/sessions/relay-lane-client.d.ts +7 -0
- package/dist/sessions/relay-lane-client.d.ts.map +1 -0
- package/dist/sessions/relay-lane-client.js +137 -0
- package/dist/sessions/relay-lane-client.js.map +1 -0
- package/dist/sessions/relay-lane-lease.d.ts +20 -0
- package/dist/sessions/relay-lane-lease.d.ts.map +1 -0
- package/dist/sessions/relay-lane-lease.js +74 -0
- package/dist/sessions/relay-lane-lease.js.map +1 -0
- package/dist/sessions/relay-lane-record.d.ts +28 -0
- package/dist/sessions/relay-lane-record.d.ts.map +1 -0
- package/dist/sessions/relay-lane-record.js +28 -0
- package/dist/sessions/relay-lane-record.js.map +1 -0
- package/dist/sessions/relay-lane-stream.d.ts +13 -0
- package/dist/sessions/relay-lane-stream.d.ts.map +1 -0
- package/dist/sessions/relay-lane-stream.js +148 -0
- package/dist/sessions/relay-lane-stream.js.map +1 -0
- package/dist/sessions/relay-routes.d.ts +368 -0
- package/dist/sessions/relay-routes.d.ts.map +1 -0
- package/dist/sessions/relay-routes.js +46 -0
- package/dist/sessions/relay-routes.js.map +1 -0
- package/dist/sessions/relay-skeleton.d.ts +4 -0
- package/dist/sessions/relay-skeleton.d.ts.map +1 -0
- package/dist/sessions/relay-skeleton.js +85 -0
- package/dist/sessions/relay-skeleton.js.map +1 -0
- package/dist/sessions/relay-types.d.ts +107 -0
- package/dist/sessions/relay-types.d.ts.map +1 -0
- package/dist/sessions/relay-types.js +2 -0
- package/dist/sessions/relay-types.js.map +1 -0
- package/dist/sessions/relay-validate.d.ts +8 -0
- package/dist/sessions/relay-validate.d.ts.map +1 -0
- package/dist/sessions/relay-validate.js +169 -0
- package/dist/sessions/relay-validate.js.map +1 -0
- package/dist/sessions/relay-wire.d.ts +8 -0
- package/dist/sessions/relay-wire.d.ts.map +1 -0
- package/dist/sessions/relay-wire.js +37 -0
- package/dist/sessions/relay-wire.js.map +1 -0
- package/dist/sessions/relay-wiring.d.ts +26 -0
- package/dist/sessions/relay-wiring.d.ts.map +1 -0
- package/dist/sessions/relay-wiring.js +13 -0
- package/dist/sessions/relay-wiring.js.map +1 -0
- package/dist/sessions/relay.d.ts +11 -0
- package/dist/sessions/relay.d.ts.map +1 -0
- package/dist/sessions/relay.js +71 -0
- package/dist/sessions/relay.js.map +1 -0
- package/dist/storage/artifact-blob.d.ts +50 -0
- package/dist/storage/artifact-blob.d.ts.map +1 -0
- package/dist/storage/artifact-blob.js +2 -0
- package/dist/storage/artifact-blob.js.map +1 -0
- package/dist/storage/descriptor.d.ts +1 -1
- package/dist/storage/errors.d.ts +1 -1
- package/dist/storage/identity/atomic-deletion.d.ts +4 -0
- package/dist/storage/identity/atomic-deletion.d.ts.map +1 -0
- package/dist/storage/identity/atomic-deletion.js +235 -0
- package/dist/storage/identity/atomic-deletion.js.map +1 -0
- package/dist/storage/identity/custody-composition.d.ts +9 -0
- package/dist/storage/identity/custody-composition.d.ts.map +1 -0
- package/dist/storage/identity/custody-composition.js +31 -0
- package/dist/storage/identity/custody-composition.js.map +1 -0
- package/dist/storage/identity/custody-delivery-record.d.ts +4 -0
- package/dist/storage/identity/custody-delivery-record.d.ts.map +1 -0
- package/dist/storage/identity/custody-delivery-record.js +11 -0
- package/dist/storage/identity/custody-delivery-record.js.map +1 -0
- package/dist/storage/identity/custody-host.d.ts +16 -0
- package/dist/storage/identity/custody-host.d.ts.map +1 -0
- package/dist/storage/identity/custody-host.js +5 -0
- package/dist/storage/identity/custody-host.js.map +1 -0
- package/dist/storage/identity/custody-import-deliveries.d.ts +6 -0
- package/dist/storage/identity/custody-import-deliveries.d.ts.map +1 -0
- package/dist/storage/identity/custody-import-deliveries.js +46 -0
- package/dist/storage/identity/custody-import-deliveries.js.map +1 -0
- package/dist/storage/identity/custody-import.d.ts +4 -0
- package/dist/storage/identity/custody-import.d.ts.map +1 -0
- package/dist/storage/identity/custody-import.js +364 -0
- package/dist/storage/identity/custody-import.js.map +1 -0
- package/dist/storage/identity/custody-journal-postgres.d.ts +125 -0
- package/dist/storage/identity/custody-journal-postgres.d.ts.map +1 -0
- package/dist/storage/identity/custody-journal-postgres.js +428 -0
- package/dist/storage/identity/custody-journal-postgres.js.map +1 -0
- package/dist/storage/identity/custody-journal-sqlite.d.ts +121 -0
- package/dist/storage/identity/custody-journal-sqlite.d.ts.map +1 -0
- package/dist/storage/identity/custody-journal-sqlite.js +345 -0
- package/dist/storage/identity/custody-journal-sqlite.js.map +1 -0
- package/dist/storage/identity/custody-lifecycle.d.ts +4 -0
- package/dist/storage/identity/custody-lifecycle.d.ts.map +1 -0
- package/dist/storage/identity/custody-lifecycle.js +42 -0
- package/dist/storage/identity/custody-lifecycle.js.map +1 -0
- package/dist/storage/identity/custody-postgres.d.ts +96 -0
- package/dist/storage/identity/custody-postgres.d.ts.map +1 -0
- package/dist/storage/identity/custody-postgres.js +726 -0
- package/dist/storage/identity/custody-postgres.js.map +1 -0
- package/dist/storage/identity/custody-records.d.ts +17 -0
- package/dist/storage/identity/custody-records.d.ts.map +1 -0
- package/dist/storage/identity/custody-records.js +260 -0
- package/dist/storage/identity/custody-records.js.map +1 -0
- package/dist/storage/identity/custody-shared.d.ts +28 -0
- package/dist/storage/identity/custody-shared.d.ts.map +1 -0
- package/dist/storage/identity/custody-shared.js +24 -0
- package/dist/storage/identity/custody-shared.js.map +1 -0
- package/dist/storage/identity/custody-sqlite.d.ts +93 -0
- package/dist/storage/identity/custody-sqlite.d.ts.map +1 -0
- package/dist/storage/identity/custody-sqlite.js +568 -0
- package/dist/storage/identity/custody-sqlite.js.map +1 -0
- package/dist/storage/identity/custody-tombstone-record.d.ts +3 -0
- package/dist/storage/identity/custody-tombstone-record.d.ts.map +1 -0
- package/dist/storage/identity/custody-tombstone-record.js +8 -0
- package/dist/storage/identity/custody-tombstone-record.js.map +1 -0
- package/dist/storage/identity/custody-transaction-guards.d.ts +16 -0
- package/dist/storage/identity/custody-transaction-guards.d.ts.map +1 -0
- package/dist/storage/identity/custody-transaction-guards.js +64 -0
- package/dist/storage/identity/custody-transaction-guards.js.map +1 -0
- package/dist/storage/identity/custody-transaction-ports.d.ts +9 -0
- package/dist/storage/identity/custody-transaction-ports.d.ts.map +1 -0
- package/dist/storage/identity/custody-transaction-ports.js +106 -0
- package/dist/storage/identity/custody-transaction-ports.js.map +1 -0
- package/dist/storage/identity/deletion-planes.d.ts +10 -0
- package/dist/storage/identity/deletion-planes.d.ts.map +1 -0
- package/dist/storage/identity/deletion-planes.js +54 -0
- package/dist/storage/identity/deletion-planes.js.map +1 -0
- package/dist/storage/identity/index.d.ts +18 -0
- package/dist/storage/identity/index.d.ts.map +1 -0
- package/dist/storage/identity/index.js +22 -0
- package/dist/storage/identity/index.js.map +1 -0
- package/dist/storage/identity/postgres.d.ts +16 -0
- package/dist/storage/identity/postgres.d.ts.map +1 -0
- package/dist/storage/identity/postgres.js +345 -0
- package/dist/storage/identity/postgres.js.map +1 -0
- package/dist/storage/identity/records.d.ts +12 -0
- package/dist/storage/identity/records.d.ts.map +1 -0
- package/dist/storage/identity/records.js +84 -0
- package/dist/storage/identity/records.js.map +1 -0
- package/dist/storage/identity/replica-sync.d.ts +4 -0
- package/dist/storage/identity/replica-sync.d.ts.map +1 -0
- package/dist/storage/identity/replica-sync.js +402 -0
- package/dist/storage/identity/replica-sync.js.map +1 -0
- package/dist/storage/identity/schema.d.ts +13 -0
- package/dist/storage/identity/schema.d.ts.map +1 -0
- package/dist/storage/identity/schema.js +418 -0
- package/dist/storage/identity/schema.js.map +1 -0
- package/dist/storage/identity/sqlite-schema.d.ts +4 -0
- package/dist/storage/identity/sqlite-schema.d.ts.map +1 -0
- package/dist/storage/identity/sqlite-schema.js +17 -0
- package/dist/storage/identity/sqlite-schema.js.map +1 -0
- package/dist/storage/identity/sqlite.d.ts +25 -0
- package/dist/storage/identity/sqlite.d.ts.map +1 -0
- package/dist/storage/identity/sqlite.js +233 -0
- package/dist/storage/identity/sqlite.js.map +1 -0
- package/dist/storage/identity/stores.d.ts +10 -0
- package/dist/storage/identity/stores.d.ts.map +1 -0
- package/dist/storage/identity/stores.js +5 -0
- package/dist/storage/identity/stores.js.map +1 -0
- package/dist/storage/identity/wiring.d.ts +20 -0
- package/dist/storage/identity/wiring.d.ts.map +1 -0
- package/dist/storage/identity/wiring.js +26 -0
- package/dist/storage/identity/wiring.js.map +1 -0
- package/dist/storage/identity/workspace-deletion.d.ts +3 -0
- package/dist/storage/identity/workspace-deletion.d.ts.map +1 -0
- package/dist/storage/identity/workspace-deletion.js +100 -0
- package/dist/storage/identity/workspace-deletion.js.map +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/postgres/journal.d.ts +1 -1
- package/dist/storage/postgres/profiles.d.ts +2 -2
- package/dist/storage/postgres/scope.d.ts +1 -1
- package/dist/storage/root-facade.d.ts +1 -1
- package/dist/storage/root-journal.d.ts +1 -1
- package/dist/storage/root-profiles.d.ts +1 -1
- package/package.json +56 -4
- package/ui/AdminUsersScreen.svelte +197 -0
- package/ui/AdminUsersScreen.svelte.d.ts +4 -0
- package/ui/LoginScreen.svelte +15 -0
- package/ui/LoginScreen.svelte.d.ts +4 -0
- package/ui/MembershipDecisionsScreen.svelte +76 -0
- package/ui/MembershipDecisionsScreen.svelte.d.ts +4 -0
- package/ui/RegistrationScreen.svelte +15 -0
- package/ui/RegistrationScreen.svelte.d.ts +4 -0
- package/ui/WorkspaceMembersScreen.svelte +86 -0
- package/ui/WorkspaceMembersScreen.svelte.d.ts +4 -0
- package/ui/auth-flow.ts +44 -0
- package/ui/management-ports.ts +36 -0
- package/ui/management-transport.ts +29 -0
- package/contracts/engram-memory-neutral-contract-v1.d.ts +0 -367
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// A2.3 identity slice: the SQLite profile of this lot's store slice — the
|
|
2
|
+
// conversation authority store and the audit/escalation ledger over the
|
|
3
|
+
// kernel's published `SqliteConnection` contract (opened via
|
|
4
|
+
// `openSqliteEngine({ path, moduleId })`, which owns process isolation and
|
|
5
|
+
// the module identity). The `cm_identity_*` schema is idempotent; entries
|
|
6
|
+
// seal through the same shared digest and verifier as the in-memory double
|
|
7
|
+
// and the PostgreSQL profile, so chain tamper detection is one behavior.
|
|
8
|
+
import { applyAtomicSqliteDdl } from '../storage/identity/sqlite-schema.js';
|
|
9
|
+
import { ConversationSessionError } from './conversation.js';
|
|
10
|
+
import { escalationEntryDigest, verifyEscalationChainsOf, } from './ledger.js';
|
|
11
|
+
/** Idempotent `cm_identity_*` schema set; safe on every open. */
|
|
12
|
+
export const IDENTITY_SQLITE_SCHEMA = [
|
|
13
|
+
`CREATE TABLE IF NOT EXISTS cm_identity_conversation_sessions (
|
|
14
|
+
conversation_session_id TEXT PRIMARY KEY,
|
|
15
|
+
user_id TEXT NOT NULL,
|
|
16
|
+
workspace_id TEXT NOT NULL,
|
|
17
|
+
status TEXT NOT NULL,
|
|
18
|
+
opened_at TEXT NOT NULL,
|
|
19
|
+
expires_at TEXT NOT NULL,
|
|
20
|
+
revoked_at TEXT)`,
|
|
21
|
+
`CREATE INDEX IF NOT EXISTS cm_identity_conversation_sessions_user
|
|
22
|
+
ON cm_identity_conversation_sessions (user_id)`,
|
|
23
|
+
`CREATE TABLE IF NOT EXISTS cm_identity_audit_events (
|
|
24
|
+
ordinal INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
25
|
+
at TEXT NOT NULL,
|
|
26
|
+
kind TEXT NOT NULL,
|
|
27
|
+
actor_id TEXT,
|
|
28
|
+
subject_id TEXT,
|
|
29
|
+
detail TEXT)`,
|
|
30
|
+
`CREATE TABLE IF NOT EXISTS cm_identity_escalation_entries (
|
|
31
|
+
ordinal INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
32
|
+
escalation_id TEXT NOT NULL,
|
|
33
|
+
owner_user_id TEXT NOT NULL,
|
|
34
|
+
workspace_id TEXT NOT NULL,
|
|
35
|
+
target_ref TEXT NOT NULL,
|
|
36
|
+
entry_json TEXT NOT NULL,
|
|
37
|
+
prev_entry_hash TEXT,
|
|
38
|
+
entry_hash TEXT NOT NULL)`,
|
|
39
|
+
`CREATE INDEX IF NOT EXISTS cm_identity_escalation_entries_escalation
|
|
40
|
+
ON cm_identity_escalation_entries (escalation_id)`,
|
|
41
|
+
];
|
|
42
|
+
export function applyIdentitySqliteSchema(db) {
|
|
43
|
+
applyAtomicSqliteDdl(db, IDENTITY_SQLITE_SCHEMA);
|
|
44
|
+
}
|
|
45
|
+
const rowToConversationSession = (row) => ({
|
|
46
|
+
conversationSessionId: row.conversation_session_id,
|
|
47
|
+
userId: row.user_id,
|
|
48
|
+
workspaceId: row.workspace_id,
|
|
49
|
+
status: row.status,
|
|
50
|
+
openedAt: row.opened_at,
|
|
51
|
+
expiresAt: row.expires_at,
|
|
52
|
+
revokedAt: row.revoked_at ?? undefined,
|
|
53
|
+
});
|
|
54
|
+
const rowToEscalationEntry = (row) => ({
|
|
55
|
+
...JSON.parse(row.entry_json),
|
|
56
|
+
prevEntryHash: row.prev_entry_hash ?? null,
|
|
57
|
+
entryHash: row.entry_hash,
|
|
58
|
+
});
|
|
59
|
+
const rowToAuditEvent = (row) => ({
|
|
60
|
+
at: row.at,
|
|
61
|
+
kind: row.kind,
|
|
62
|
+
actorId: row.actor_id ?? undefined,
|
|
63
|
+
subjectId: row.subject_id ?? undefined,
|
|
64
|
+
detail: row.detail ?? undefined,
|
|
65
|
+
});
|
|
66
|
+
/** One transaction per call; the engine's exclusive lock serializes writers. */
|
|
67
|
+
const withTransaction = (db, operation) => {
|
|
68
|
+
db.exec('BEGIN IMMEDIATE');
|
|
69
|
+
try {
|
|
70
|
+
const result = operation();
|
|
71
|
+
db.exec('COMMIT');
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
db.exec('ROLLBACK');
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export function createIdentityEnforcementSqliteStores(input) {
|
|
80
|
+
const db = input.db;
|
|
81
|
+
if (!input.transactionBound)
|
|
82
|
+
applyIdentitySqliteSchema(db);
|
|
83
|
+
const run = (operation) => input.transactionBound ? operation() : withTransaction(db, operation);
|
|
84
|
+
const conversations = {
|
|
85
|
+
async saveSession(record) {
|
|
86
|
+
run(() => db
|
|
87
|
+
.prepare(`INSERT INTO cm_identity_conversation_sessions
|
|
88
|
+
(conversation_session_id, user_id, workspace_id, status, opened_at, expires_at, revoked_at)
|
|
89
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
90
|
+
ON CONFLICT (conversation_session_id) DO UPDATE SET
|
|
91
|
+
user_id = excluded.user_id,
|
|
92
|
+
workspace_id = excluded.workspace_id,
|
|
93
|
+
status = excluded.status,
|
|
94
|
+
opened_at = excluded.opened_at,
|
|
95
|
+
expires_at = excluded.expires_at,
|
|
96
|
+
revoked_at = excluded.revoked_at`)
|
|
97
|
+
.run(record.conversationSessionId, record.userId, record.workspaceId, record.status, record.openedAt, record.expiresAt, record.revokedAt ?? null));
|
|
98
|
+
},
|
|
99
|
+
async findSession(conversationSessionId) {
|
|
100
|
+
const row = run(() => db
|
|
101
|
+
.prepare('SELECT * FROM cm_identity_conversation_sessions WHERE conversation_session_id = ?')
|
|
102
|
+
.get(conversationSessionId));
|
|
103
|
+
return row ? rowToConversationSession(row) : null;
|
|
104
|
+
},
|
|
105
|
+
async revokeSession(conversationSessionId, at) {
|
|
106
|
+
const row = run(() => {
|
|
107
|
+
const existing = db
|
|
108
|
+
.prepare('SELECT * FROM cm_identity_conversation_sessions WHERE conversation_session_id = ?')
|
|
109
|
+
.get(conversationSessionId);
|
|
110
|
+
if (!existing)
|
|
111
|
+
return undefined;
|
|
112
|
+
db.prepare(`UPDATE cm_identity_conversation_sessions
|
|
113
|
+
SET status = 'revoked', revoked_at = ?
|
|
114
|
+
WHERE conversation_session_id = ?`).run(at, conversationSessionId);
|
|
115
|
+
return db
|
|
116
|
+
.prepare('SELECT * FROM cm_identity_conversation_sessions WHERE conversation_session_id = ?')
|
|
117
|
+
.get(conversationSessionId);
|
|
118
|
+
});
|
|
119
|
+
if (!row)
|
|
120
|
+
throw new ConversationSessionError('not_found');
|
|
121
|
+
return rowToConversationSession(row);
|
|
122
|
+
},
|
|
123
|
+
async listSessionsForUser(userId) {
|
|
124
|
+
const rows = run(() => db
|
|
125
|
+
.prepare('SELECT * FROM cm_identity_conversation_sessions WHERE user_id = ? ORDER BY opened_at, conversation_session_id')
|
|
126
|
+
.all(userId));
|
|
127
|
+
return rows.map(rowToConversationSession);
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
const ledger = {
|
|
131
|
+
async append(event) {
|
|
132
|
+
run(() => db
|
|
133
|
+
.prepare(`INSERT INTO cm_identity_audit_events (at, kind, actor_id, subject_id, detail)
|
|
134
|
+
VALUES (?, ?, ?, ?, ?)`)
|
|
135
|
+
.run(event.at, event.kind, event.actorId ?? null, event.subjectId ?? null, event.detail ?? null));
|
|
136
|
+
},
|
|
137
|
+
async listAuditEvents() {
|
|
138
|
+
const rows = run(() => db.prepare('SELECT * FROM cm_identity_audit_events ORDER BY ordinal').all());
|
|
139
|
+
return rows.map(rowToAuditEvent);
|
|
140
|
+
},
|
|
141
|
+
async appendEscalationEntry(draft) {
|
|
142
|
+
return run(() => {
|
|
143
|
+
const tail = db
|
|
144
|
+
.prepare(`SELECT entry_hash FROM cm_identity_escalation_entries
|
|
145
|
+
WHERE escalation_id = ? ORDER BY ordinal DESC LIMIT 1`)
|
|
146
|
+
.get(draft.escalationId);
|
|
147
|
+
const prevEntryHash = tail?.entry_hash ?? null;
|
|
148
|
+
const entry = {
|
|
149
|
+
...draft,
|
|
150
|
+
prevEntryHash,
|
|
151
|
+
entryHash: escalationEntryDigest(draft, prevEntryHash),
|
|
152
|
+
};
|
|
153
|
+
db.prepare(`INSERT INTO cm_identity_escalation_entries
|
|
154
|
+
(escalation_id, owner_user_id, workspace_id, target_ref, entry_json, prev_entry_hash, entry_hash)
|
|
155
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`).run(draft.escalationId, draft.ownerUserId, draft.workspaceId, draft.targetRef, JSON.stringify(draft), prevEntryHash, entry.entryHash);
|
|
156
|
+
return entry;
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
async listEscalationChain(escalationId) {
|
|
160
|
+
const rows = run(() => db
|
|
161
|
+
.prepare('SELECT * FROM cm_identity_escalation_entries WHERE escalation_id = ? ORDER BY ordinal')
|
|
162
|
+
.all(escalationId));
|
|
163
|
+
return rows.map(rowToEscalationEntry);
|
|
164
|
+
},
|
|
165
|
+
async listEscalations(query) {
|
|
166
|
+
const clauses = [];
|
|
167
|
+
const values = [];
|
|
168
|
+
if (query.ownerUserId !== undefined) {
|
|
169
|
+
values.push(query.ownerUserId);
|
|
170
|
+
clauses.push('owner_user_id = ?');
|
|
171
|
+
}
|
|
172
|
+
if (query.workspaceId !== undefined) {
|
|
173
|
+
values.push(query.workspaceId);
|
|
174
|
+
clauses.push('workspace_id = ?');
|
|
175
|
+
}
|
|
176
|
+
if (query.targetRef !== undefined) {
|
|
177
|
+
values.push(query.targetRef);
|
|
178
|
+
clauses.push('target_ref = ?');
|
|
179
|
+
}
|
|
180
|
+
const where = clauses.length > 0 ? ` WHERE ${clauses.join(' AND ')}` : '';
|
|
181
|
+
const rows = run(() => db.prepare(`SELECT * FROM cm_identity_escalation_entries${where} ORDER BY ordinal`).all(...values));
|
|
182
|
+
return rows.map(rowToEscalationEntry);
|
|
183
|
+
},
|
|
184
|
+
async verifyEscalationChains() {
|
|
185
|
+
const rows = run(() => db
|
|
186
|
+
.prepare('SELECT * FROM cm_identity_escalation_entries ORDER BY escalation_id, ordinal')
|
|
187
|
+
.all());
|
|
188
|
+
return verifyEscalationChainsOf(rows.map(rowToEscalationEntry));
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
return { conversations, ledger };
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=sqlite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/identity/sqlite.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,6DAA6D;AAC7D,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAmE,MAAM,mBAAmB,CAAC;AAC9H,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GAMzB,MAAM,aAAa,CAAC;AAGrB,iEAAiE;AACjE,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD;;;;;;;qBAOmB;IACnB;mDACiD;IACjD;;;;;;iBAMe;IACf;;;;;;;;8BAQ4B;IAC5B;sDACoD;CACrD,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,EAAoB;IAC5D,oBAAoB,CAAC,EAAE,EAAE,sBAAsB,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,wBAAwB,GAAG,CAAC,GAA4B,EAA6B,EAAE,CAAC,CAAC;IAC7F,qBAAqB,EAAE,GAAG,CAAC,uBAAiC;IAC5D,MAAM,EAAE,GAAG,CAAC,OAAiB;IAC7B,WAAW,EAAE,GAAG,CAAC,YAAsB;IACvC,MAAM,EAAE,GAAG,CAAC,MAA6C;IACzD,QAAQ,EAAE,GAAG,CAAC,SAAmB;IACjC,SAAS,EAAE,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CAAC,CAAC;CAC3C;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC,GAAG,iBAAiB,CAgGpB;AAID,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,KAAK,EAAE;QACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;QACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAC7B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3B,WAAW,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACtH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACvE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC,GAAG,mBAAmB,CAwBtB"}
|
|
@@ -51,7 +51,7 @@ export function createUserAccounts(input) {
|
|
|
51
51
|
const account = await requireAccount(userId);
|
|
52
52
|
if (isProtectedAdmin(account.globalRole))
|
|
53
53
|
throw new AdminUserProtectedError('disable');
|
|
54
|
-
if (account.accountStatus !== 'active')
|
|
54
|
+
if (account.accountStatus !== 'active' && account.accountStatus !== 'pending_admin_approval')
|
|
55
55
|
throw new AccountTransitionError();
|
|
56
56
|
const now = clock();
|
|
57
57
|
const updated = await input.accounts.setAccountStatus(userId, 'disabled', now);
|
|
@@ -73,8 +73,9 @@ export function createUserAccounts(input) {
|
|
|
73
73
|
const account = await requireAccount(userId);
|
|
74
74
|
if (isProtectedAdmin(account.globalRole))
|
|
75
75
|
throw new AdminUserProtectedError('delete');
|
|
76
|
-
if (account.accountStatus !== 'disabled')
|
|
77
|
-
throw new AccountTransitionError('User must be disabled before deletion');
|
|
76
|
+
if (account.accountStatus !== 'disabled' && account.accountStatus !== 'pending_admin_approval') {
|
|
77
|
+
throw new AccountTransitionError('User must be pending or disabled before deletion');
|
|
78
|
+
}
|
|
78
79
|
const now = clock();
|
|
79
80
|
await input.accounts.deleteAccount(userId, now);
|
|
80
81
|
await input.audit.append({ at: now, kind: 'account.deleted', actorId, subjectId: userId });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/identity-contracts/accounts.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,8EAA8E;AAE9E,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,GAQpB,MAAM,YAAY,CAAC;AAgBpB,SAAS,gBAAgB,CAAC,IAAgB;IACxC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAIlC;IACC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,mBAAmB,CAAC;IACjD,KAAK,UAAU,cAAc,CAAC,MAAc;QAC1C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC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AAO,EAAE,QAAQ;YACjC,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAC1D,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BoundaryDomain, type MembershipLookup } from '../boundaries.js';
|
|
2
|
+
import type { ClusterNodeId } from '../membership.js';
|
|
3
|
+
import type { TenantMembershipStore, TenantRegistryStore, WorkspaceDirectoryStore } from './ports.js';
|
|
4
|
+
import type { TenantRole } from './types.js';
|
|
5
|
+
export interface TenantBoundaryResolutionV1 {
|
|
6
|
+
/** Registry id (TenantRecord.tenantId). */
|
|
7
|
+
readonly tenantId: string;
|
|
8
|
+
/** Immutable slug (TenantRecord.slug); this is the tid on the wire. */
|
|
9
|
+
readonly tid: string;
|
|
10
|
+
readonly userId: string;
|
|
11
|
+
readonly tenantRole: TenantRole;
|
|
12
|
+
/** TenantMembershipRecord.updatedAt; keys membership-revision caches (r2 F12). */
|
|
13
|
+
readonly membershipRevision: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TenantBoundaryPortV1 {
|
|
16
|
+
resolveApproved(input: MembershipLookup): Promise<TenantBoundaryResolutionV1 | null>;
|
|
17
|
+
}
|
|
18
|
+
/** Authoritative read chain: workspace → tenant (must be active) → approved
|
|
19
|
+
membership. Attempt-agnostic: works over standalone or transaction-bound
|
|
20
|
+
(`tx.stores`) stores. No caching; fresh reads per call. */
|
|
21
|
+
export declare function createTenantBoundaryPortV1(input: {
|
|
22
|
+
readonly workspaces: WorkspaceDirectoryStore;
|
|
23
|
+
readonly tenants: TenantRegistryStore;
|
|
24
|
+
readonly memberships: TenantMembershipStore;
|
|
25
|
+
}): TenantBoundaryPortV1;
|
|
26
|
+
/** Frozen BoundaryDomain shape over the new port; tid is the tenant slug. */
|
|
27
|
+
export declare function createIdentityBoundaryDomainV1(input: {
|
|
28
|
+
readonly homeNodeId: ClusterNodeId;
|
|
29
|
+
readonly boundary: TenantBoundaryPortV1;
|
|
30
|
+
}): BoundaryDomain;
|
|
31
|
+
//# sourceMappingURL=boundary-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-resolution.d.ts","sourceRoot":"","sources":["../../src/identity-contracts/boundary-resolution.ts"],"names":[],"mappings":"AAOA,OAAO,EAA4B,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,0BAA0B;IACzC,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,kFAAkF;IAClF,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;CACtF;AAED;;8DAE8D;AAC9D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;CAC7C,GAAG,oBAAoB,CAmBvB;AAED,6EAA6E;AAC7E,wBAAgB,8BAA8B,CAAC,KAAK,EAAE;IACpD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;CACzC,GAAG,cAAc,CAqBjB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// A4 composition gaps, bundle 1.2.0 — P2 (F12): boundary resolution over the
|
|
2
|
+
// CM tenancy stores. Pure domain over the frozen store ports; the frozen 1.0
|
|
3
|
+
// createBoundaryDomain / ValidatedMembershipPort stay untouched (§3.2) and the
|
|
4
|
+
// app seam cut-over is lot G6. Port-level misses are null, store errors throw;
|
|
5
|
+
// the domain maps any miss to the frozen TenantBoundaryError.
|
|
6
|
+
import { TenantBoundaryError } from '../errors.js';
|
|
7
|
+
import { deriveWorkspaceReference } from '../boundaries.js';
|
|
8
|
+
/** Authoritative read chain: workspace → tenant (must be active) → approved
|
|
9
|
+
membership. Attempt-agnostic: works over standalone or transaction-bound
|
|
10
|
+
(`tx.stores`) stores. No caching; fresh reads per call. */
|
|
11
|
+
export function createTenantBoundaryPortV1(input) {
|
|
12
|
+
return {
|
|
13
|
+
async resolveApproved(lookup) {
|
|
14
|
+
const workspace = await input.workspaces.findWorkspace(lookup.workspaceId);
|
|
15
|
+
if (!workspace)
|
|
16
|
+
return null;
|
|
17
|
+
const tenant = await input.tenants.findTenant(workspace.tenantId);
|
|
18
|
+
if (!tenant || tenant.status !== 'active')
|
|
19
|
+
return null;
|
|
20
|
+
const membership = await input.memberships.findApprovedMembership(lookup.userId, workspace.tenantId);
|
|
21
|
+
if (!membership || membership.status !== 'approved' || membership.userId !== lookup.userId)
|
|
22
|
+
return null;
|
|
23
|
+
if (tenant.tenantId.trim().length === 0 || tenant.slug.trim().length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
tenantId: tenant.tenantId,
|
|
27
|
+
tid: tenant.slug,
|
|
28
|
+
userId: membership.userId,
|
|
29
|
+
tenantRole: membership.tenantRole,
|
|
30
|
+
membershipRevision: membership.updatedAt,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Frozen BoundaryDomain shape over the new port; tid is the tenant slug. */
|
|
36
|
+
export function createIdentityBoundaryDomainV1(input) {
|
|
37
|
+
return {
|
|
38
|
+
workspaceReference: deriveWorkspaceReference,
|
|
39
|
+
async resolve(lookup) {
|
|
40
|
+
const resolution = await input.boundary.resolveApproved(lookup);
|
|
41
|
+
if (!resolution
|
|
42
|
+
|| resolution.userId !== lookup.userId
|
|
43
|
+
|| resolution.tenantId.trim().length === 0
|
|
44
|
+
|| resolution.tid.trim().length === 0) {
|
|
45
|
+
throw new TenantBoundaryError();
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
tid: resolution.tid,
|
|
49
|
+
workspace: await deriveWorkspaceReference(lookup.workspaceId),
|
|
50
|
+
userId: resolution.userId,
|
|
51
|
+
homeNodeId: input.homeNodeId,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=boundary-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-resolution.js","sourceRoot":"","sources":["../../src/identity-contracts/boundary-resolution.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,8DAA8D;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAA8C,MAAM,kBAAkB,CAAC;AAoBxG;;8DAE8D;AAC9D,MAAM,UAAU,0BAA0B,CAAC,KAI1C;IACC,OAAO;QACL,KAAK,CAAC,eAAe,CAAC,MAAM;YAC1B,MAAM,SAAS,GAAG,MAAM,KAA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KAAK,MAAM,CAAC,MAAM;mBACnC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;mBACvC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACrC,CAAC;gBACD,MAAM,IAAI,mBAAmB,EAAE,CAAC;YAClC,CAAC;YACD,OAAO;gBACL,GAAG,EAAE,UAAU,CAAC,GAAG;gBACnB,SAAS,EAAE,MAAM,wBAAwB,CAAC,MAAM,CAAC,WAAW,CAAC;gBAC7D,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const IDENTITY_COMPOSITION_CONTRACT_VERSION: "1.2.0";
|
|
2
|
+
export type IdentityCompositionDomainV1 = 'boundary_resolution' | 'oauth_tenant_reads' | 'service_principal_tenancy' | 'atomic_workspace_deletion' | 'identity_replica_sync';
|
|
3
|
+
export interface IdentityCompositionDescriptorV1 {
|
|
4
|
+
readonly domain: IdentityCompositionDomainV1;
|
|
5
|
+
readonly version: typeof IDENTITY_COMPOSITION_CONTRACT_VERSION;
|
|
6
|
+
readonly baseContractVersion: '1.0.0';
|
|
7
|
+
readonly amendment: 'A4-composition-gaps';
|
|
8
|
+
readonly status: 'contract-only';
|
|
9
|
+
readonly profiles: readonly ['postgres', 'sqlite'];
|
|
10
|
+
readonly records: readonly string[];
|
|
11
|
+
readonly ports: readonly string[];
|
|
12
|
+
readonly factories: readonly string[];
|
|
13
|
+
readonly errorType: 'IdentityCustodyErrorV1';
|
|
14
|
+
}
|
|
15
|
+
export declare const IDENTITY_COMPOSITION_DESCRIPTORS: readonly IdentityCompositionDescriptorV1[];
|
|
16
|
+
export declare const identityCompositionDescriptorV1: (domain: IdentityCompositionDomainV1) => IdentityCompositionDescriptorV1 | undefined;
|
|
17
|
+
//# sourceMappingURL=composition-descriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-descriptors.d.ts","sourceRoot":"","sources":["../../src/identity-contracts/composition-descriptors.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qCAAqC,SAAmB,CAAC;AAEtE,MAAM,MAAM,2BAA2B,GACnC,qBAAqB,GACrB,oBAAoB,GACpB,2BAA2B,GAC3B,2BAA2B,GAC3B,uBAAuB,CAAC;AAE5B,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,qCAAqC,CAAC;IAC/D,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;CAC9C;AAED,eAAO,MAAM,gCAAgC,EAAE,SAAS,+BAA+B,EAoEtF,CAAC;AAEF,eAAO,MAAM,+BAA+B,WAClC,2BAA2B,KAClC,+BAA+B,GAAG,SACsC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// A4 composition-gaps bundle 1.2.0 descriptors (design a4-cm-gaps-r2 §3.1).
|
|
2
|
+
// The frozen 1.0 descriptor array and the A2.0b 1.1.0/2.0.0 amendment rows are
|
|
3
|
+
// untouched; this file names the additive composition bundle only. Each
|
|
4
|
+
// parallel lot appends its own domain row; the union below is the closed set
|
|
5
|
+
// of bundle domains.
|
|
6
|
+
export const IDENTITY_COMPOSITION_CONTRACT_VERSION = '1.2.0';
|
|
7
|
+
export const IDENTITY_COMPOSITION_DESCRIPTORS = [
|
|
8
|
+
{
|
|
9
|
+
domain: 'oauth_tenant_reads',
|
|
10
|
+
version: IDENTITY_COMPOSITION_CONTRACT_VERSION,
|
|
11
|
+
baseContractVersion: '1.0.0',
|
|
12
|
+
amendment: 'A4-composition-gaps',
|
|
13
|
+
status: 'contract-only',
|
|
14
|
+
profiles: ['postgres', 'sqlite'],
|
|
15
|
+
records: ['OAuthConsentRecord', 'ServiceClientBinding'],
|
|
16
|
+
ports: ['OAuthConsentReadStoreV1', 'ServiceClientReadStoreV1', 'OAuthTenantStoreV1'],
|
|
17
|
+
factories: ['oauthTenantStoreV1', 'oauthTenantStoreV1FromStores'],
|
|
18
|
+
errorType: 'IdentityCustodyErrorV1',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
domain: 'boundary_resolution',
|
|
22
|
+
version: IDENTITY_COMPOSITION_CONTRACT_VERSION,
|
|
23
|
+
baseContractVersion: '1.0.0',
|
|
24
|
+
amendment: 'A4-composition-gaps',
|
|
25
|
+
status: 'contract-only',
|
|
26
|
+
profiles: ['postgres', 'sqlite'],
|
|
27
|
+
records: ['TenantBoundaryResolutionV1'],
|
|
28
|
+
ports: ['TenantBoundaryPortV1'],
|
|
29
|
+
factories: ['createTenantBoundaryPortV1', 'createIdentityBoundaryDomainV1'],
|
|
30
|
+
errorType: 'IdentityCustodyErrorV1',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
domain: 'service_principal_tenancy',
|
|
34
|
+
version: IDENTITY_COMPOSITION_CONTRACT_VERSION,
|
|
35
|
+
baseContractVersion: '1.0.0',
|
|
36
|
+
amendment: 'A4-composition-gaps',
|
|
37
|
+
status: 'contract-only',
|
|
38
|
+
profiles: ['postgres', 'sqlite'],
|
|
39
|
+
records: ['ServiceTidClaimV1'],
|
|
40
|
+
ports: ['ServiceTenantEnrollmentSourceV1', 'ServicePrincipalTidIssuerV1'],
|
|
41
|
+
factories: ['createServicePrincipalTidIssuerV1'],
|
|
42
|
+
errorType: 'IdentityCustodyErrorV1',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
domain: 'atomic_workspace_deletion',
|
|
46
|
+
version: IDENTITY_COMPOSITION_CONTRACT_VERSION,
|
|
47
|
+
baseContractVersion: '1.0.0',
|
|
48
|
+
amendment: 'A4-composition-gaps',
|
|
49
|
+
status: 'contract-only',
|
|
50
|
+
profiles: ['postgres', 'sqlite'],
|
|
51
|
+
records: ['WorkspaceDeletionCommandV1', 'WorkspaceDeletionReceiptV1', 'WorkspaceBusinessDeletionReceiptV1'],
|
|
52
|
+
ports: ['AtomicWorkspaceDeletionV1', 'WorkspaceDeletionAuthorizationPortV1', 'WorkspaceBusinessDeletionPortV1', 'WorkspaceDeletionPlanePortV1'],
|
|
53
|
+
factories: ['createAtomicWorkspaceDeletionV1'],
|
|
54
|
+
errorType: 'IdentityCustodyErrorV1',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
domain: 'identity_replica_sync',
|
|
58
|
+
version: IDENTITY_COMPOSITION_CONTRACT_VERSION,
|
|
59
|
+
baseContractVersion: '1.0.0',
|
|
60
|
+
amendment: 'A4-composition-gaps',
|
|
61
|
+
status: 'contract-only',
|
|
62
|
+
profiles: ['postgres', 'sqlite'],
|
|
63
|
+
records: [
|
|
64
|
+
'IdentityReplicaSyncRowV1',
|
|
65
|
+
'IdentityReplicaSyncBatchV1',
|
|
66
|
+
'IdentityReplicaSyncCountsV1',
|
|
67
|
+
'IdentityReplicaSyncReceiptV1',
|
|
68
|
+
'IdentityReplicaSyncIssueReferenceV1',
|
|
69
|
+
'IdentityReplicaSyncValidationV1',
|
|
70
|
+
],
|
|
71
|
+
ports: ['IdentityReplicaSyncPortV1', 'IdentityReplicaExportPortV1'],
|
|
72
|
+
factories: ['createIdentityReplicaSyncV1', 'createIdentityReplicaExporterV1'],
|
|
73
|
+
errorType: 'IdentityCustodyErrorV1',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
export const identityCompositionDescriptorV1 = (domain) => IDENTITY_COMPOSITION_DESCRIPTORS.find((entry) => entry.domain === domain);
|
|
77
|
+
//# sourceMappingURL=composition-descriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition-descriptors.js","sourceRoot":"","sources":["../../src/identity-contracts/composition-descriptors.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,wEAAwE;AACxE,6EAA6E;AAC7E,qBAAqB;AAErB,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAgB,CAAC;AAsBtE,MAAM,CAAC,MAAM,gCAAgC,GAA+C;IAC1F;QACE,MAAM,EAAE,oBAAoB;QAC5B,OAAO,EAAE,qCAAqC;QAC9C,mBAAmB,EAAE,OAAO;QAC5B,SAAS,EAAE,qBAAqB;QAChC,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;QAChC,OAAO,EAAE,CAAC,oBAAoB,EAAE,sBAAsB,CAAC;QACvD,KAAK,EAAE,CAAC,yBAAyB,EAAE,0BAA0B,EAAE,oBAAoB,CAAC;QACpF,SAAS,EAAE,CAAC,oBAAoB,EAAE,8BAA8B,CAAC;QACjE,SAAS,EAAE,wBAAwB;KACpC;IACD;QACE,MAAM,EAAE,qBAAqB;QAC7B,OAAO,EAAE,qCAAqC;QAC9C,mBAAmB,EAAE,OAAO;QAC5B,SAAS,EAAE,qBAAqB;QAChC,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;QAChC,OAAO,EAAE,CAAC,4BAA4B,CAAC;QACvC,KAAK,EAAE,CAAC,sBAAsB,CAAC;QAC/B,SAAS,EAAE,CAAC,4BAA4B,EAAE,gCAAgC,CAAC;QAC3E,SAAS,EAAE,wBAAw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CAAC,MAAM,+BAA+B,GAAG,CAC7C,MAAmC,EACU,EAAE,CAC/C,gCAAgC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { AuthHonoPorts, AuthHonoUserRecord, AuthHonoAccountPolicyPort, AuthHonoRelyingPartyConfig, AuthHonoWebAuthnRegistrationService, AuthHonoWebAuthnAuthenticationService, AuthHonoMagicLinkService, AuthHonoSessionService, AuthHonoEmailVerificationService, FederationResolveInput, FederationResolveOutcome, AuthHonoRequestMagicLinkResult, AuthHonoRequestEmailCodeResult, AuthHonoVerifyRegistrationResult, AuthHonoVerifyAuthenticationResult, AuthHonoVerifyMagicLinkResult, AuthHonoVerifyEmailCodeResult } from '@sentropic/auth-hono';
|
|
2
|
+
import type { IdentityTransactionV1, IdentityDigestPortV1, IdentityLoginTokenPortV1, IdentityEmailTicketTokenPortV1, IdentityEmailCodeKeyRingV1 } from './custody.js';
|
|
3
|
+
import type { ServiceTenantEnrollmentSourceV1 } from './service-tenancy.js';
|
|
4
|
+
export type IdentityDeferredMailV1 = {
|
|
5
|
+
readonly kind: 'code';
|
|
6
|
+
readonly email: string;
|
|
7
|
+
readonly code: string;
|
|
8
|
+
readonly expiresAt: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'magic_link';
|
|
11
|
+
readonly email: string;
|
|
12
|
+
readonly token: string;
|
|
13
|
+
readonly expiresAt: string;
|
|
14
|
+
readonly url: string;
|
|
15
|
+
};
|
|
16
|
+
export type IdentityAuthAccountPolicyV1 = Pick<AuthHonoAccountPolicyPort, 'normalizeEmail' | 'deriveDisplayName' | 'resolveUserVerification' | 'roleForNewUser' | 'statusForNewUser'>;
|
|
17
|
+
export interface IdentityAuthBusinessHooksV1<H> {
|
|
18
|
+
afterUserCreated(user: AuthHonoUserRecord, tx: IdentityTransactionV1<H>): Promise<void>;
|
|
19
|
+
provisionWorkspace(userId: string, tx: IdentityTransactionV1<H>): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export type IdentityAuthCompletionFlowV1 = 'registration' | 'authentication' | 'magic_link' | 'email_code' | 'magic_link_issue' | 'email_code_issue' | 'session_validate' | 'session_refresh' | 'social' | 'credential_rename' | 'credential_revoke' | 'social_unlink';
|
|
22
|
+
export type IdentityAuthRefusalV1 = {
|
|
23
|
+
readonly flow: 'magic_link_issue';
|
|
24
|
+
readonly result: Extract<AuthHonoRequestMagicLinkResult, {
|
|
25
|
+
success: false;
|
|
26
|
+
}>;
|
|
27
|
+
} | {
|
|
28
|
+
readonly flow: 'email_code_issue';
|
|
29
|
+
readonly result: Extract<AuthHonoRequestEmailCodeResult, {
|
|
30
|
+
success: false;
|
|
31
|
+
}>;
|
|
32
|
+
} | {
|
|
33
|
+
readonly flow: 'registration';
|
|
34
|
+
readonly result: Extract<AuthHonoVerifyRegistrationResult, {
|
|
35
|
+
verified: false;
|
|
36
|
+
}>;
|
|
37
|
+
} | {
|
|
38
|
+
readonly flow: 'authentication';
|
|
39
|
+
readonly result: Extract<AuthHonoVerifyAuthenticationResult, {
|
|
40
|
+
verified: false;
|
|
41
|
+
}>;
|
|
42
|
+
} | {
|
|
43
|
+
readonly flow: 'magic_link';
|
|
44
|
+
readonly result: Extract<AuthHonoVerifyMagicLinkResult, {
|
|
45
|
+
valid: false;
|
|
46
|
+
}>;
|
|
47
|
+
} | {
|
|
48
|
+
readonly flow: 'email_code';
|
|
49
|
+
readonly result: Extract<AuthHonoVerifyEmailCodeResult, {
|
|
50
|
+
valid: false;
|
|
51
|
+
}>;
|
|
52
|
+
} | {
|
|
53
|
+
readonly flow: 'session_validate' | 'session_refresh' | 'credential_rename';
|
|
54
|
+
readonly result: null;
|
|
55
|
+
} | {
|
|
56
|
+
readonly flow: 'credential_revoke' | 'social_unlink';
|
|
57
|
+
readonly result: false;
|
|
58
|
+
};
|
|
59
|
+
export type IdentityAuthCompletionOutcomeV1<T> = {
|
|
60
|
+
readonly committed: true;
|
|
61
|
+
readonly value: T;
|
|
62
|
+
} | {
|
|
63
|
+
readonly committed: false;
|
|
64
|
+
readonly refusal: IdentityAuthRefusalV1;
|
|
65
|
+
};
|
|
66
|
+
export interface IdentityAuthHonoTransactionBindingV1 {
|
|
67
|
+
readonly ports: AuthHonoPorts;
|
|
68
|
+
readonly registration: AuthHonoWebAuthnRegistrationService;
|
|
69
|
+
readonly authentication: AuthHonoWebAuthnAuthenticationService;
|
|
70
|
+
readonly magicLink: AuthHonoMagicLinkService;
|
|
71
|
+
resolveFederatedUser(input: FederationResolveInput): Promise<FederationResolveOutcome>;
|
|
72
|
+
readonly sessions: AuthHonoSessionService;
|
|
73
|
+
readonly emailVerification: AuthHonoEmailVerificationService;
|
|
74
|
+
readonly deferredMail: readonly IdentityDeferredMailV1[];
|
|
75
|
+
flushAudit(): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
/** Factory input shared only by the implementation modules. */
|
|
78
|
+
export interface IdentityAuthBindingInput<H> {
|
|
79
|
+
readonly tx: IdentityTransactionV1<H>;
|
|
80
|
+
readonly hostPorts: AuthHonoPorts;
|
|
81
|
+
readonly digest: IdentityDigestPortV1;
|
|
82
|
+
readonly loginTokens: IdentityLoginTokenPortV1;
|
|
83
|
+
readonly ticketTokens: IdentityEmailTicketTokenPortV1;
|
|
84
|
+
readonly emailCodeKeys: IdentityEmailCodeKeyRingV1;
|
|
85
|
+
readonly rp: AuthHonoRelyingPartyConfig;
|
|
86
|
+
readonly accountPolicy: IdentityAuthAccountPolicyV1;
|
|
87
|
+
/**
|
|
88
|
+
* Optional per-flow ceremony timeouts in milliseconds. When present, both the
|
|
89
|
+
* client-facing `timeout` and the server-side challenge TTL derive from the
|
|
90
|
+
* same value so the stored proof never outlives the ceremony the user sees.
|
|
91
|
+
* When absent, the auth service defaults apply.
|
|
92
|
+
*/
|
|
93
|
+
readonly webAuthnPolicy: {
|
|
94
|
+
readonly registrationUserVerification: 'required' | 'preferred' | 'discouraged';
|
|
95
|
+
readonly authenticationUserVerification: 'required' | 'preferred' | 'discouraged';
|
|
96
|
+
readonly registrationTimeoutMs?: number;
|
|
97
|
+
readonly authenticationTimeoutMs?: number;
|
|
98
|
+
};
|
|
99
|
+
readonly magicLink: {
|
|
100
|
+
readonly baseUrl: string;
|
|
101
|
+
readonly tokenBytes: number;
|
|
102
|
+
readonly ttlSeconds: number;
|
|
103
|
+
};
|
|
104
|
+
readonly social: {
|
|
105
|
+
readonly autoLinkProviders: readonly string[];
|
|
106
|
+
};
|
|
107
|
+
readonly business: IdentityAuthBusinessHooksV1<H>;
|
|
108
|
+
readonly trustedRegistration: {
|
|
109
|
+
readonly email: string;
|
|
110
|
+
readonly clientId: string | null;
|
|
111
|
+
} | null;
|
|
112
|
+
/**
|
|
113
|
+
* P3 (lot G3): CM-owned service-principal tenancy. When present, the binding
|
|
114
|
+
* builds `ports.serviceTenant` itself from the issuer over `tx.stores`;
|
|
115
|
+
* setting it together with `hostPorts.serviceTenant` is refused at
|
|
116
|
+
* construction. When absent, the host port passes through unchanged.
|
|
117
|
+
*/
|
|
118
|
+
readonly serviceTenancy?: {
|
|
119
|
+
readonly enrollments?: ServiceTenantEnrollmentSourceV1;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=custody-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custody-auth.d.ts","sourceRoot":"","sources":["../../src/identity-contracts/custody-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,0BAA0B,EACxF,mCAAmC,EAAE,qCAAqC,EAAE,wBAAwB,EACpG,sBAAsB,EAAE,gCAAgC,EAAE,sBAAsB,EAAE,wBAAwB,EAC1G,8BAA8B,EAAE,8BAA8B,EAAE,gCAAgC,EAChG,kCAAkC,EAAE,6BAA6B,EAAE,6BAA6B,EACjG,MAAM,s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