@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,50 @@
|
|
|
1
|
+
import type { AccountStatus } from '../identity-contracts/types.js';
|
|
2
|
+
export interface OpsAlertRecipientV1 {
|
|
3
|
+
readonly accountId: string;
|
|
4
|
+
readonly email: string;
|
|
5
|
+
/**
|
|
6
|
+
* Why this account counts as an admin of the target: the validated product
|
|
7
|
+
* `basis` value (`workspace:manage_members` / `app:is_admin`), or the
|
|
8
|
+
* platform-owned fallback (`platform-declaration:<targetKey>` for declared
|
|
9
|
+
* ids, `platform-admin-fallback` for transverse `admin_app` operators).
|
|
10
|
+
* Persisted in the delivery audit so every mail is attributable.
|
|
11
|
+
*/
|
|
12
|
+
readonly basis: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Admins of target X. Empty means "no usable admin for this target": the
|
|
16
|
+
* host falls back to the platform admins and raises a configuration alert.
|
|
17
|
+
* Never rejects for an unknown target; silence is the failure this lot
|
|
18
|
+
* removes.
|
|
19
|
+
*/
|
|
20
|
+
export interface OpsAlertRecipientsPortV1 {
|
|
21
|
+
listRecipientsForTarget(targetKey: string): Promise<readonly OpsAlertRecipientV1[]>;
|
|
22
|
+
}
|
|
23
|
+
export interface OpsAccountRecordV1 {
|
|
24
|
+
readonly accountStatus: AccountStatus;
|
|
25
|
+
readonly email: string;
|
|
26
|
+
}
|
|
27
|
+
export interface OpsAccountLookupV1 {
|
|
28
|
+
findAccount(accountId: string): Promise<OpsAccountRecordV1 | null>;
|
|
29
|
+
}
|
|
30
|
+
export type OpsRecipientSkipReason = 'unknown_account' | 'account_not_active' | 'invalid_email';
|
|
31
|
+
export interface OpsDeclaredRecipientsInputV1 {
|
|
32
|
+
/** Platform declaration: product target key -> owning account ids. */
|
|
33
|
+
readonly declaration: Readonly<Record<string, readonly string[]>>;
|
|
34
|
+
readonly accounts: OpsAccountLookupV1;
|
|
35
|
+
readonly onSkipped?: (info: {
|
|
36
|
+
readonly targetKey: string;
|
|
37
|
+
readonly accountId: string;
|
|
38
|
+
readonly reason: OpsRecipientSkipReason;
|
|
39
|
+
}) => void;
|
|
40
|
+
}
|
|
41
|
+
/** Normalize a stored address; null when the stored value is not sendable. */
|
|
42
|
+
export declare function normalizeOpsRecipientEmail(email: unknown): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* v1 port implementation: validate the platform declaration against the
|
|
45
|
+
* identity store on every resolution. Declared ids that are missing,
|
|
46
|
+
* inactive or carry no sendable email are skipped (reported via onSkipped);
|
|
47
|
+
* the caller decides the empty-result fallback.
|
|
48
|
+
*/
|
|
49
|
+
export declare function createDeclaredOpsRecipientsPort(input: OpsDeclaredRecipientsInputV1): OpsAlertRecipientsPortV1;
|
|
50
|
+
//# sourceMappingURL=recipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipients.d.ts","sourceRoot":"","sources":["../../src/notifications/recipients.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAC;CACrF;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACpE;AAED,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAEhG,MAAM,WAAW,4BAA4B;IAC3C,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IAClE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE;QAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;KACzC,KAAK,IAAI,CAAC;CACZ;AAID,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,4BAA4B,GAAG,wBAAwB,CA8B7G"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Recipients resolution for platform job-failure alerts (notify L1).
|
|
2
|
+
//
|
|
3
|
+
// The routing target is a PRODUCT key, not an identity tenant. v1 resolves
|
|
4
|
+
// through a validated platform declaration (target -> account ids); every
|
|
5
|
+
// declared id must exist and be active in the identity store, otherwise it is
|
|
6
|
+
// skipped and reported. Emails are never hardcoded: they are read live from
|
|
7
|
+
// the account records. The port stays so a later identity-tenant resolver
|
|
8
|
+
// (or the pull HTTP variant) can replace the declaration without touching
|
|
9
|
+
// the policy or the host send path.
|
|
10
|
+
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
11
|
+
/** Normalize a stored address; null when the stored value is not sendable. */
|
|
12
|
+
export function normalizeOpsRecipientEmail(email) {
|
|
13
|
+
if (typeof email !== 'string')
|
|
14
|
+
return null;
|
|
15
|
+
const normalized = email.trim().toLowerCase();
|
|
16
|
+
if (normalized.length === 0 || normalized.length > 320)
|
|
17
|
+
return null;
|
|
18
|
+
return EMAIL_PATTERN.test(normalized) ? normalized : null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* v1 port implementation: validate the platform declaration against the
|
|
22
|
+
* identity store on every resolution. Declared ids that are missing,
|
|
23
|
+
* inactive or carry no sendable email are skipped (reported via onSkipped);
|
|
24
|
+
* the caller decides the empty-result fallback.
|
|
25
|
+
*/
|
|
26
|
+
export function createDeclaredOpsRecipientsPort(input) {
|
|
27
|
+
const { declaration, accounts, onSkipped } = input;
|
|
28
|
+
return {
|
|
29
|
+
async listRecipientsForTarget(targetKey) {
|
|
30
|
+
const declared = declaration[targetKey];
|
|
31
|
+
if (!declared)
|
|
32
|
+
return [];
|
|
33
|
+
const recipients = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
for (const accountId of declared) {
|
|
36
|
+
const record = await accounts.findAccount(accountId);
|
|
37
|
+
if (record === null) {
|
|
38
|
+
onSkipped?.({ targetKey, accountId, reason: 'unknown_account' });
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (record.accountStatus !== 'active') {
|
|
42
|
+
onSkipped?.({ targetKey, accountId, reason: 'account_not_active' });
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const email = normalizeOpsRecipientEmail(record.email);
|
|
46
|
+
if (email === null) {
|
|
47
|
+
onSkipped?.({ targetKey, accountId, reason: 'invalid_email' });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (seen.has(email))
|
|
51
|
+
continue;
|
|
52
|
+
seen.add(email);
|
|
53
|
+
recipients.push({ accountId, email, basis: `platform-declaration:${targetKey}` });
|
|
54
|
+
}
|
|
55
|
+
return recipients;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|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IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpB,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;oBACjE,SAAS;gBACX,CAAC;gBACD,IAAI,MAAM,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;oBACtC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;oBACpE,SAAS;gBACX,CAAC;gBACD,MAAM,KAAK,GAAG,0BAA0B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;oBACnB,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;oBAC/D,SAAS;gBACX,CAAC;gBACD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;oBAAE,SAAS;gBAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAChB,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,wBAAwB,SAAS,EAAE,EAAE,CAAC,CAAC;YACpF,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface PromptDefinition {
|
|
2
|
+
readonly promptId: string;
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PromptVersion {
|
|
7
|
+
readonly promptId: string;
|
|
8
|
+
readonly version: string;
|
|
9
|
+
readonly digest: string;
|
|
10
|
+
readonly content: string;
|
|
11
|
+
readonly author: string;
|
|
12
|
+
readonly createdAt: string;
|
|
13
|
+
readonly approvedBy?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PromptAuditEvent {
|
|
16
|
+
readonly at: string;
|
|
17
|
+
readonly by: string;
|
|
18
|
+
readonly action: 'register' | 'approve';
|
|
19
|
+
readonly promptId: string;
|
|
20
|
+
readonly version: string;
|
|
21
|
+
readonly digest: string;
|
|
22
|
+
}
|
|
23
|
+
/** Canonical content digest (`sha256:<hex>`); approval pins this value. */
|
|
24
|
+
export declare const promptContentDigest: (content: string) => string;
|
|
25
|
+
export interface PromptRegistry {
|
|
26
|
+
registerDefinition(def: PromptDefinition): PromptDefinition;
|
|
27
|
+
registerVersion(input: {
|
|
28
|
+
readonly promptId: string;
|
|
29
|
+
readonly version: string;
|
|
30
|
+
readonly content: string;
|
|
31
|
+
readonly author: string;
|
|
32
|
+
readonly approvedBy?: string;
|
|
33
|
+
}): PromptVersion;
|
|
34
|
+
get(promptId: string, version?: string): PromptVersion | undefined;
|
|
35
|
+
list(promptId?: string): readonly PromptVersion[];
|
|
36
|
+
audit(): readonly PromptAuditEvent[];
|
|
37
|
+
}
|
|
38
|
+
/** In-memory registry; the durable control-plane registry lands with GD-7. */
|
|
39
|
+
export declare class InMemoryPromptRegistry implements PromptRegistry {
|
|
40
|
+
private readonly defs;
|
|
41
|
+
private readonly versions;
|
|
42
|
+
private readonly events;
|
|
43
|
+
registerDefinition(def: PromptDefinition): PromptDefinition;
|
|
44
|
+
registerVersion(input: {
|
|
45
|
+
readonly promptId: string;
|
|
46
|
+
readonly version: string;
|
|
47
|
+
readonly content: string;
|
|
48
|
+
readonly author: string;
|
|
49
|
+
readonly approvedBy?: string;
|
|
50
|
+
}): PromptVersion;
|
|
51
|
+
get(promptId: string, version?: string): PromptVersion | undefined;
|
|
52
|
+
list(promptId?: string): readonly PromptVersion[];
|
|
53
|
+
audit(): readonly PromptAuditEvent[];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/prompts/registry.ts"],"names":[],"mappings":"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,CAAC;KAC9B,GAAG,aAAa,CAAC;IAClB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CAAC;IAClD,KAAK,IAAI,SAAS,gBAAgB,EAAE,CAAC;CACtC;AAKD,8EAA8E;AAC9E,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuC;IAC5D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAEjD,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB;IAU3D,eAAe,CAAC,KAAK,EAAE;QACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;KAC9B,GAAG,aAAa;IA+BjB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAMlE,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE;IAKjD,KAAK,IAAI,SAAS,gBAAgB,EAAE;CAGrC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMP-P1 prompt registry v1 (GD-7), code only.
|
|
3
|
+
*
|
|
4
|
+
* Versioned, content-addressed, immutable versions with an audit log.
|
|
5
|
+
* No database, no migration: the registry is pure and injectable; the
|
|
6
|
+
* API adapter seeds it from settings (current store) at composition time.
|
|
7
|
+
*/
|
|
8
|
+
import { createHash } from 'node:crypto';
|
|
9
|
+
const PROMPT_ID = /^[A-Za-z0-9_.-]+$/;
|
|
10
|
+
/** Canonical content digest (`sha256:<hex>`); approval pins this value. */
|
|
11
|
+
export const promptContentDigest = (content) => `sha256:${createHash('sha256').update(content, 'utf8').digest('hex')}`;
|
|
12
|
+
const nonEmpty = (value) => typeof value === 'string' && value.trim() !== '';
|
|
13
|
+
/** In-memory registry; the durable control-plane registry lands with GD-7. */
|
|
14
|
+
export class InMemoryPromptRegistry {
|
|
15
|
+
defs = new Map();
|
|
16
|
+
versions = new Map();
|
|
17
|
+
events = [];
|
|
18
|
+
registerDefinition(def) {
|
|
19
|
+
if (!nonEmpty(def?.promptId) || !PROMPT_ID.test(def.promptId)) {
|
|
20
|
+
throw new Error('prompt needs promptId ^[A-Za-z0-9_.-]+$');
|
|
21
|
+
}
|
|
22
|
+
if (!nonEmpty(def.title))
|
|
23
|
+
throw new Error('prompt needs title');
|
|
24
|
+
const frozen = Object.freeze({ ...def });
|
|
25
|
+
this.defs.set(def.promptId, frozen);
|
|
26
|
+
return frozen;
|
|
27
|
+
}
|
|
28
|
+
registerVersion(input) {
|
|
29
|
+
if (!this.defs.has(input.promptId))
|
|
30
|
+
throw new Error(`unknown prompt: ${input.promptId}`);
|
|
31
|
+
if (!nonEmpty(input.version))
|
|
32
|
+
throw new Error('prompt version is required');
|
|
33
|
+
if (!nonEmpty(input.content))
|
|
34
|
+
throw new Error('prompt content is required');
|
|
35
|
+
if (!nonEmpty(input.author))
|
|
36
|
+
throw new Error('prompt author is required');
|
|
37
|
+
const key = `${input.promptId}@${input.version}`;
|
|
38
|
+
const digest = promptContentDigest(input.content);
|
|
39
|
+
const existing = this.versions.get(key);
|
|
40
|
+
if (existing) {
|
|
41
|
+
if (existing.digest !== digest) {
|
|
42
|
+
throw new Error(`prompt version immutable: ${key}`);
|
|
43
|
+
}
|
|
44
|
+
return existing;
|
|
45
|
+
}
|
|
46
|
+
const version = Object.freeze({
|
|
47
|
+
promptId: input.promptId,
|
|
48
|
+
version: input.version,
|
|
49
|
+
digest,
|
|
50
|
+
content: input.content,
|
|
51
|
+
author: input.author,
|
|
52
|
+
createdAt: new Date().toISOString(),
|
|
53
|
+
...(input.approvedBy ? { approvedBy: input.approvedBy } : {}),
|
|
54
|
+
});
|
|
55
|
+
this.versions.set(key, version);
|
|
56
|
+
this.events.push({
|
|
57
|
+
at: version.createdAt, by: input.author, action: 'register',
|
|
58
|
+
promptId: input.promptId, version: input.version, digest,
|
|
59
|
+
});
|
|
60
|
+
return version;
|
|
61
|
+
}
|
|
62
|
+
get(promptId, version) {
|
|
63
|
+
if (version)
|
|
64
|
+
return this.versions.get(`${promptId}@${version}`);
|
|
65
|
+
const matches = [...this.versions.values()].filter((v) => v.promptId === promptId);
|
|
66
|
+
return matches.length > 0 ? matches[matches.length - 1] : undefined;
|
|
67
|
+
}
|
|
68
|
+
list(promptId) {
|
|
69
|
+
const all = [...this.versions.values()];
|
|
70
|
+
return promptId ? all.filter((v) => v.promptId === promptId) : all;
|
|
71
|
+
}
|
|
72
|
+
audit() {
|
|
73
|
+
return [...this.events];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/prompts/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AA2BtC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAU,EAAE,CAC7D,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAgBzE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CACnD,OAAO,KAAK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C,QAAgB,EAAE,OAAgB;QACpC,IAAI,OAAO;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC,CAAC;QAChE,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;QACnF,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;IAED,IAAI,CAAC,QAAiB;QACpB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACxC,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACrE,CAAC;IAED,KAAK;QACH,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ClusterMeshNamespace } from '@sentropic/contracts';
|
|
2
|
+
import { Hono } from 'hono';
|
|
3
|
+
import { type ClusterMeshHonoNamespaceModule } from '../hono/plugin.js';
|
|
4
|
+
import type { ClusterMeshRuntime } from '../runtime/generation.js';
|
|
5
|
+
export declare const REMOTE_MOUNT_MAP_V1: Readonly<{
|
|
6
|
+
root: "/";
|
|
7
|
+
pluginNamespace: "/apps";
|
|
8
|
+
pluginMount: "/";
|
|
9
|
+
enrolmentBase: "/enrolment/v1";
|
|
10
|
+
authBase: "/auth";
|
|
11
|
+
trunkUpgradePath: "/trunk/v1";
|
|
12
|
+
browserUpgradePath: "/ws/v1";
|
|
13
|
+
}>;
|
|
14
|
+
export type RemoteTier = 'preprod' | 'prod';
|
|
15
|
+
export type RemoteMeshId = 'remote-preprod' | 'remote-prod';
|
|
16
|
+
export interface RemoteStorageProfile {
|
|
17
|
+
readonly engine: 'postgres' | 'sqlite';
|
|
18
|
+
readonly storeMeshId: string;
|
|
19
|
+
readonly allowedTenants: readonly string[];
|
|
20
|
+
readonly dedicatedAuditWriter: boolean;
|
|
21
|
+
readonly allowSqliteForTest?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RemoteAuthorityBinding {
|
|
24
|
+
readonly serviceId: 'remote';
|
|
25
|
+
readonly tier: RemoteTier;
|
|
26
|
+
readonly meshId: RemoteMeshId;
|
|
27
|
+
readonly publicOrigin: string;
|
|
28
|
+
readonly trunkEndpoint: string;
|
|
29
|
+
readonly tenantId?: string;
|
|
30
|
+
readonly storage: RemoteStorageProfile;
|
|
31
|
+
readonly admissionReady: boolean;
|
|
32
|
+
readonly receiptPortReady: boolean;
|
|
33
|
+
}
|
|
34
|
+
export type RemoteBindingRefusalCode = 'invalid_tier' | 'invalid_service_id' | 'invalid_mesh_id' | 'invalid_public_origin' | 'invalid_trunk_endpoint' | 'invalid_tenant_id' | 'site_name_used_as_tenant' | 'isolation_fixture_forbidden_in_prod' | 'sqlite_forbidden_in_deployed_tier' | 'invalid_allowed_tenants' | 'mesh_storage_mismatch' | 'tenant_not_allowed_in_store' | 'audit_writer_not_dedicated' | 'authority_not_ready' | 'receipt_port_not_ready';
|
|
35
|
+
export type RemoteBindingValidationResult = {
|
|
36
|
+
readonly ok: true;
|
|
37
|
+
readonly binding: Readonly<RemoteAuthorityBinding>;
|
|
38
|
+
} | {
|
|
39
|
+
readonly ok: false;
|
|
40
|
+
readonly code: RemoteBindingRefusalCode;
|
|
41
|
+
readonly reason: string;
|
|
42
|
+
};
|
|
43
|
+
export type RemoteTenantAdmissionResult = {
|
|
44
|
+
readonly ok: true;
|
|
45
|
+
readonly meshId: RemoteMeshId;
|
|
46
|
+
readonly tenantId: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly ok: false;
|
|
49
|
+
readonly code: RemoteBindingRefusalCode;
|
|
50
|
+
readonly reason: string;
|
|
51
|
+
};
|
|
52
|
+
export type RemoteUpgradeResult = {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly path: '/trunk/v1' | '/ws/v1';
|
|
55
|
+
readonly meshId: string;
|
|
56
|
+
readonly tenantId: string;
|
|
57
|
+
readonly response?: Response;
|
|
58
|
+
} | {
|
|
59
|
+
readonly ok: false;
|
|
60
|
+
readonly status: 400 | 401 | 403 | 426 | 429 | 503;
|
|
61
|
+
readonly code: string;
|
|
62
|
+
};
|
|
63
|
+
export interface RemoteUpgradeAdapter {
|
|
64
|
+
handleTrunkUpgrade(request: Request): RemoteUpgradeResult | Promise<RemoteUpgradeResult>;
|
|
65
|
+
handleBrowserUpgrade(request: Request): RemoteUpgradeResult | Promise<RemoteUpgradeResult>;
|
|
66
|
+
}
|
|
67
|
+
export declare class RemoteAssemblyError extends Error {
|
|
68
|
+
readonly code: string;
|
|
69
|
+
constructor(code: string, reason: string);
|
|
70
|
+
}
|
|
71
|
+
export declare function validateRemoteAuthorityBinding(binding: RemoteAuthorityBinding): RemoteBindingValidationResult;
|
|
72
|
+
export declare function validateRemoteTenantAdmission(binding: RemoteAuthorityBinding, tenantId: string): RemoteTenantAdmissionResult;
|
|
73
|
+
export interface ComposeRemoteRootOptions {
|
|
74
|
+
readonly runtime: ClusterMeshRuntime;
|
|
75
|
+
readonly binding: RemoteAuthorityBinding;
|
|
76
|
+
readonly enrolmentModule: ClusterMeshHonoNamespaceModule;
|
|
77
|
+
readonly authRouter: Hono;
|
|
78
|
+
readonly uiRouter: Hono;
|
|
79
|
+
readonly upgradeAdapter: RemoteUpgradeAdapter;
|
|
80
|
+
readonly mounts?: Partial<Record<ClusterMeshNamespace, string>>;
|
|
81
|
+
readonly extraPluginNamespaces?: readonly ClusterMeshHonoNamespaceModule[];
|
|
82
|
+
}
|
|
83
|
+
export declare function composeRemoteRoot(options: ComposeRemoteRootOptions): {
|
|
84
|
+
app: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
85
|
+
binding: Readonly<RemoteAuthorityBinding>;
|
|
86
|
+
mountMap: Readonly<{
|
|
87
|
+
root: "/";
|
|
88
|
+
pluginNamespace: "/apps";
|
|
89
|
+
pluginMount: "/";
|
|
90
|
+
enrolmentBase: "/enrolment/v1";
|
|
91
|
+
authBase: "/auth";
|
|
92
|
+
trunkUpgradePath: "/trunk/v1";
|
|
93
|
+
browserUpgradePath: "/ws/v1";
|
|
94
|
+
}>;
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=assembly-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly-contract.d.ts","sourceRoot":"","sources":["../../src/remote/assembly-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAA2B,KAAK,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,eAAO,MAAM,mBAAmB;;;;;;;;EAQ9B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAC5C,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC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AC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,8BAA8B,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,8BAA8B,EAAE,CAAC;CAC5E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;EA6BlE"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { createClusterMeshPlugin } from '../hono/plugin.js';
|
|
3
|
+
import { createNamespaceRegistry } from '../runtime/namespace-registry.js';
|
|
4
|
+
export const REMOTE_MOUNT_MAP_V1 = Object.freeze({
|
|
5
|
+
root: '/',
|
|
6
|
+
pluginNamespace: '/apps',
|
|
7
|
+
pluginMount: '/',
|
|
8
|
+
enrolmentBase: '/enrolment/v1',
|
|
9
|
+
authBase: '/auth',
|
|
10
|
+
trunkUpgradePath: '/trunk/v1',
|
|
11
|
+
browserUpgradePath: '/ws/v1',
|
|
12
|
+
});
|
|
13
|
+
export class RemoteAssemblyError extends Error {
|
|
14
|
+
code;
|
|
15
|
+
constructor(code, reason) {
|
|
16
|
+
super(`${code}: ${reason}`);
|
|
17
|
+
this.name = 'RemoteAssemblyError';
|
|
18
|
+
this.code = code;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const RESERVED_NON_TENANT_NAMES = new Set([
|
|
22
|
+
'remote', 'pages', 'remote-prod', 'remote-preprod', 'pages-prod', 'pages-preprod',
|
|
23
|
+
]);
|
|
24
|
+
const TIER_SPECS = {
|
|
25
|
+
preprod: {
|
|
26
|
+
meshId: 'remote-preprod',
|
|
27
|
+
publicOrigin: 'https://preprod.remote.sent-tech.ca',
|
|
28
|
+
trunkEndpoint: 'wss://preprod.remote.sent-tech.ca/trunk/v1',
|
|
29
|
+
},
|
|
30
|
+
prod: {
|
|
31
|
+
meshId: 'remote-prod',
|
|
32
|
+
publicOrigin: 'https://remote.sent-tech.ca',
|
|
33
|
+
trunkEndpoint: 'wss://remote.sent-tech.ca/trunk/v1',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
function validateTenantIdForTier(tier, meshId, tenantId) {
|
|
37
|
+
if (typeof tenantId !== 'string' || !tenantId.trim() || tenantId !== tenantId.trim()) {
|
|
38
|
+
return { ok: false, code: 'invalid_tenant_id', reason: 'tenantId must be a non-empty trimmed string' };
|
|
39
|
+
}
|
|
40
|
+
if (RESERVED_NON_TENANT_NAMES.has(tenantId) || tenantId === meshId) {
|
|
41
|
+
return { ok: false, code: 'site_name_used_as_tenant', reason: `tenantId ${tenantId} collides with a mesh or site name (WET-2 clause 1)` };
|
|
42
|
+
}
|
|
43
|
+
if (tier === 'prod' && tenantId === 'isolation-fixture') {
|
|
44
|
+
return { ok: false, code: 'isolation_fixture_forbidden_in_prod', reason: 'isolation-fixture is test/preprod-only' };
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
export function validateRemoteAuthorityBinding(binding) {
|
|
49
|
+
if (!Object.hasOwn(TIER_SPECS, binding.tier)) {
|
|
50
|
+
return { ok: false, code: 'invalid_tier', reason: `unsupported Remote tier ${String(binding.tier)}` };
|
|
51
|
+
}
|
|
52
|
+
const expected = TIER_SPECS[binding.tier];
|
|
53
|
+
if (binding.serviceId !== 'remote')
|
|
54
|
+
return { ok: false, code: 'invalid_service_id', reason: 'serviceId must be remote' };
|
|
55
|
+
if (binding.meshId !== expected.meshId)
|
|
56
|
+
return { ok: false, code: 'invalid_mesh_id', reason: `tier ${binding.tier} requires mesh ${expected.meshId}` };
|
|
57
|
+
if (binding.publicOrigin !== expected.publicOrigin)
|
|
58
|
+
return { ok: false, code: 'invalid_public_origin', reason: `origin must equal ${expected.publicOrigin}` };
|
|
59
|
+
if (binding.trunkEndpoint !== expected.trunkEndpoint)
|
|
60
|
+
return { ok: false, code: 'invalid_trunk_endpoint', reason: `endpoint must equal ${expected.trunkEndpoint}` };
|
|
61
|
+
if (binding.storage.engine !== 'postgres') {
|
|
62
|
+
const sqliteAllowed = binding.tier === 'preprod'
|
|
63
|
+
&& binding.storage.engine === 'sqlite'
|
|
64
|
+
&& binding.storage.allowSqliteForTest === true;
|
|
65
|
+
if (!sqliteAllowed) {
|
|
66
|
+
return { ok: false, code: 'sqlite_forbidden_in_deployed_tier', reason: `tier ${binding.tier} requires postgres storage` };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (binding.storage.storeMeshId !== binding.meshId)
|
|
70
|
+
return { ok: false, code: 'mesh_storage_mismatch', reason: 'storage mesh does not match authority mesh' };
|
|
71
|
+
if (!Array.isArray(binding.storage.allowedTenants) || binding.storage.allowedTenants.length === 0) {
|
|
72
|
+
return { ok: false, code: 'invalid_allowed_tenants', reason: 'storage.allowedTenants must contain at least one tenant' };
|
|
73
|
+
}
|
|
74
|
+
const seenTenants = new Set();
|
|
75
|
+
for (const tenant of binding.storage.allowedTenants) {
|
|
76
|
+
const refusal = validateTenantIdForTier(binding.tier, binding.meshId, tenant);
|
|
77
|
+
if (refusal)
|
|
78
|
+
return refusal;
|
|
79
|
+
if (seenTenants.has(tenant)) {
|
|
80
|
+
return { ok: false, code: 'invalid_allowed_tenants', reason: `duplicate tenant ${tenant} in storage.allowedTenants` };
|
|
81
|
+
}
|
|
82
|
+
seenTenants.add(tenant);
|
|
83
|
+
}
|
|
84
|
+
if (binding.tenantId !== undefined) {
|
|
85
|
+
const refusal = validateTenantIdForTier(binding.tier, binding.meshId, binding.tenantId);
|
|
86
|
+
if (refusal)
|
|
87
|
+
return refusal;
|
|
88
|
+
if (!seenTenants.has(binding.tenantId)) {
|
|
89
|
+
return { ok: false, code: 'tenant_not_allowed_in_store', reason: 'tenant not admitted in tier storage' };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (!binding.storage.dedicatedAuditWriter)
|
|
93
|
+
return { ok: false, code: 'audit_writer_not_dedicated', reason: 'audit writer must be outside app writer role' };
|
|
94
|
+
if (!binding.admissionReady)
|
|
95
|
+
return { ok: false, code: 'authority_not_ready', reason: 'admission port is not ready' };
|
|
96
|
+
if (!binding.receiptPortReady)
|
|
97
|
+
return { ok: false, code: 'receipt_port_not_ready', reason: 'receipt port is not ready' };
|
|
98
|
+
return {
|
|
99
|
+
ok: true,
|
|
100
|
+
binding: Object.freeze({
|
|
101
|
+
...binding,
|
|
102
|
+
storage: Object.freeze({ ...binding.storage, allowedTenants: Object.freeze([...binding.storage.allowedTenants]) }),
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export function validateRemoteTenantAdmission(binding, tenantId) {
|
|
107
|
+
const validated = validateRemoteAuthorityBinding(binding);
|
|
108
|
+
if (!validated.ok)
|
|
109
|
+
return validated;
|
|
110
|
+
const refusal = validateTenantIdForTier(binding.tier, binding.meshId, tenantId);
|
|
111
|
+
if (refusal)
|
|
112
|
+
return refusal;
|
|
113
|
+
if (!binding.storage.allowedTenants.includes(tenantId)) {
|
|
114
|
+
return { ok: false, code: 'tenant_not_allowed_in_store', reason: `tenant ${tenantId} not admitted in ${binding.meshId} store` };
|
|
115
|
+
}
|
|
116
|
+
return { ok: true, meshId: binding.meshId, tenantId };
|
|
117
|
+
}
|
|
118
|
+
export function composeRemoteRoot(options) {
|
|
119
|
+
const validated = validateRemoteAuthorityBinding(options.binding);
|
|
120
|
+
if (!validated.ok)
|
|
121
|
+
throw new RemoteAssemblyError(validated.code, validated.reason);
|
|
122
|
+
if (options.enrolmentModule.namespace !== REMOTE_MOUNT_MAP_V1.pluginNamespace) {
|
|
123
|
+
throw new RemoteAssemblyError('invalid_plugin_namespace', 'Remote root permits only the /apps namespace module');
|
|
124
|
+
}
|
|
125
|
+
if (!options.enrolmentModule.enabled)
|
|
126
|
+
throw new RemoteAssemblyError('enrolment_module_disabled', '/apps enrolment module must be enabled');
|
|
127
|
+
const mounts = options.mounts ?? { '/apps': '/' };
|
|
128
|
+
if (Object.keys(mounts).length !== 1 || mounts['/apps'] !== '/') {
|
|
129
|
+
throw new RemoteAssemblyError('invalid_plugin_mount', 'Remote root requires exact mounts: { "/apps": "/" }');
|
|
130
|
+
}
|
|
131
|
+
const namespaces = [options.enrolmentModule, ...(options.extraPluginNamespaces ?? [])];
|
|
132
|
+
createNamespaceRegistry(namespaces);
|
|
133
|
+
if (namespaces.length > 1)
|
|
134
|
+
throw new RemoteAssemblyError('multiple_namespace_mounts_forbidden', 'Remote root allows exactly one /apps namespace module');
|
|
135
|
+
const plugin = createClusterMeshPlugin({ runtime: options.runtime, namespaces, mounts });
|
|
136
|
+
const app = new Hono();
|
|
137
|
+
app.route(REMOTE_MOUNT_MAP_V1.authBase, options.authRouter);
|
|
138
|
+
app.get(REMOTE_MOUNT_MAP_V1.trunkUpgradePath, async (c) => {
|
|
139
|
+
const decision = await options.upgradeAdapter.handleTrunkUpgrade(c.req.raw);
|
|
140
|
+
return decision.ok ? (decision.response ?? c.json(decision, 200)) : c.json({ error: decision.code }, decision.status);
|
|
141
|
+
});
|
|
142
|
+
app.get(REMOTE_MOUNT_MAP_V1.browserUpgradePath, async (c) => {
|
|
143
|
+
const decision = await options.upgradeAdapter.handleBrowserUpgrade(c.req.raw);
|
|
144
|
+
return decision.ok ? (decision.response ?? c.json(decision, 200)) : c.json({ error: decision.code }, decision.status);
|
|
145
|
+
});
|
|
146
|
+
app.route('/', plugin);
|
|
147
|
+
app.route('/', options.uiRouter);
|
|
148
|
+
return { app, binding: validated.binding, mountMap: REMOTE_MOUNT_MAP_V1 };
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=assembly-contract.js.map
|
|
@@ -0,0 +1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AO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const WET2_CONTRACT_VERSION: "WET-2.1";
|
|
2
|
+
export declare const REMOTE_SPEC_REVISION: "r11";
|
|
3
|
+
export declare const PINNED_R11_WET2_TEXT_HASH = "b3c8a8fa7f3eff0c7066d0618c6d4fae1ce7f018e4ce58439e0598f23975035c";
|
|
4
|
+
export declare const OBSOLETE_PG9_PAGES_SPEC_HASH = "df868b0f801ed11e71de892aa7d8fb1130c085785f3dd8d5305b2465fbf704ee";
|
|
5
|
+
export declare const REQUIRED_WET21_CLAUSES: readonly ["clause-18-state-sync-quota", "clause-19-propagation-quota", "section-7.2-authority-sync", "section-6.9-pages-alignment"];
|
|
6
|
+
export interface Wet2CountersignatureReceipt {
|
|
7
|
+
readonly contractVersion: string;
|
|
8
|
+
readonly remoteSpecRevision: string;
|
|
9
|
+
readonly wet2TextHash: string;
|
|
10
|
+
readonly pagesSpecRevision: string | null;
|
|
11
|
+
readonly pagesSpecHash: string | null;
|
|
12
|
+
readonly pagesCountersigned: boolean;
|
|
13
|
+
readonly pagesCountersignedBy: string | null;
|
|
14
|
+
readonly acceptedClauses: readonly string[];
|
|
15
|
+
readonly trackRecordId: string | null;
|
|
16
|
+
}
|
|
17
|
+
export type Wet2ReceiptRefusalCode = 'missing_receipt' | 'missing_pages_countersignature' | 'stale_contract_version' | 'wet2_hash_mismatch' | 'pages_hash_mismatch' | 'missing_wet21_clause_acceptance' | 'missing_track_record';
|
|
18
|
+
export type Wet2ReceiptDecision = {
|
|
19
|
+
readonly ok: true;
|
|
20
|
+
readonly contractVersion: typeof WET2_CONTRACT_VERSION;
|
|
21
|
+
readonly wet2TextHash: string;
|
|
22
|
+
readonly pagesSpecHash: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly ok: false;
|
|
25
|
+
readonly code: Wet2ReceiptRefusalCode;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
readonly liveWet2TextHash: string;
|
|
28
|
+
};
|
|
29
|
+
/** Canonical §6 slice per SPEC_EVOL_REMOTE_FASTLANE.md §10.2: LF-normalized UTF-8 from `## 6.` up to the byte before `## 7.`. */
|
|
30
|
+
export declare function extractWet2Section(markdown: string): string;
|
|
31
|
+
export declare function computeNormalizedDocumentHash(markdown: string): string;
|
|
32
|
+
export declare function computeWet2TextHash(markdown: string): string;
|
|
33
|
+
export declare function evaluateWet2ContractReceipt(receipt: Wet2CountersignatureReceipt | null, liveSpecMarkdown: string, livePagesMarkdown?: string): Wet2ReceiptDecision;
|
|
34
|
+
/** Live repository baseline: r11 §6 merged, pages WET-2.1 countersignature pending (never fake). */
|
|
35
|
+
export declare const RM0_REPO_BASELINE_RECEIPT: Wet2CountersignatureReceipt;
|
|
36
|
+
//# sourceMappingURL=contract-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-receipt.d.ts","sourceRoot":"","sources":["../../src/remote/contract-receipt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,WAAqB,CAAC;AACxD,eAAO,MAAM,oBAAoB,OAAiB,CAAC;AACnD,eAAO,MAAM,yBAAyB,qEAC8B,CAAC;AACrE,eAAO,MAAM,4BAA4B,qEAC2B,CAAC;AAErE,eAAO,MAAM,sBAAsB,qIAKxB,CAAC;AAEZ,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAA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