@noodleseed/one 0.162.0 → 0.163.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/commands/billing-catalog-ops.d.ts +4 -0
- package/dist/commands/billing-catalog-ops.d.ts.map +1 -0
- package/dist/commands/billing-catalog-ops.js +58 -0
- package/dist/commands/billing-catalog-ops.js.map +1 -0
- package/dist/commands/billing-ops.d.ts.map +1 -1
- package/dist/commands/billing-ops.js +3 -0
- package/dist/commands/billing-ops.js.map +1 -1
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +2 -0
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/config-values.d.ts.map +1 -1
- package/dist/commands/config-values.js +16 -0
- package/dist/commands/config-values.js.map +1 -1
- package/dist/commands/installation-variables.d.ts +26 -0
- package/dist/commands/installation-variables.d.ts.map +1 -0
- package/dist/commands/installation-variables.js +171 -0
- package/dist/commands/installation-variables.js.map +1 -0
- package/dist/commands/solutions-activity.d.ts +5 -0
- package/dist/commands/solutions-activity.d.ts.map +1 -0
- package/dist/commands/solutions-activity.js +116 -0
- package/dist/commands/solutions-activity.js.map +1 -0
- package/dist/commands/solutions-connections.d.ts +7 -0
- package/dist/commands/solutions-connections.d.ts.map +1 -0
- package/dist/commands/solutions-connections.js +88 -0
- package/dist/commands/solutions-connections.js.map +1 -0
- package/dist/commands/solutions-installation-options.d.ts +5 -0
- package/dist/commands/solutions-installation-options.d.ts.map +1 -0
- package/dist/commands/solutions-installation-options.js +52 -0
- package/dist/commands/solutions-installation-options.js.map +1 -0
- package/dist/commands/solutions-onboarding.d.ts +5 -0
- package/dist/commands/solutions-onboarding.d.ts.map +1 -0
- package/dist/commands/solutions-onboarding.js +113 -0
- package/dist/commands/solutions-onboarding.js.map +1 -0
- package/dist/commands/solutions-ops.d.ts.map +1 -1
- package/dist/commands/solutions-ops.js +278 -17
- package/dist/commands/solutions-ops.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/admission-limits/dist/counter-store.d.ts +21 -2
- package/node_modules/@noodle-borg/admission-limits/dist/counter-store.js +10 -1
- package/node_modules/@noodle-borg/admission-limits/dist/in-memory-counter-store.d.ts +5 -1
- package/node_modules/@noodle-borg/admission-limits/dist/in-memory-counter-store.js +31 -2
- package/node_modules/@noodle-borg/admission-limits/dist/portable.d.ts +3 -0
- package/node_modules/@noodle-borg/admission-limits/dist/portable.js +3 -0
- package/node_modules/@noodle-borg/admission-limits/dist/public-admission-assertion.d.ts +28 -0
- package/node_modules/@noodle-borg/admission-limits/dist/public-admission-assertion.js +124 -0
- package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.d.ts +54 -0
- package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.js +74 -0
- package/node_modules/@noodle-borg/admission-limits/dist/request-attribution.d.ts +11 -0
- package/node_modules/@noodle-borg/admission-limits/dist/request-attribution.js +19 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +5 -5
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +3 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +15 -3
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-configuration.d.ts +9 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-configuration.js +33 -2
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-execution-bound.d.ts +3 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-execution-bound.js +29 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interaction-state.d.ts +5 -3
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interaction-state.js +21 -10
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js +3 -3
- package/node_modules/@noodle-borg/assistant-gateway/dist/portable.d.ts +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/portable.js +1 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/session-target.js +5 -4
- package/node_modules/@noodle-borg/authoring/dist/config.d.ts +20 -0
- package/node_modules/@noodle-borg/authoring/dist/config.js +29 -2
- package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +6 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.js +5 -0
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +2 -2
- package/node_modules/@noodle-borg/authoring/dist/json-schema.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/json-schema.js +15 -2
- package/node_modules/@noodle-borg/authoring/dist/load-authored.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/managed-collection.d.ts +18 -4
- package/node_modules/@noodle-borg/authoring/dist/managed-collection.js +22 -3
- package/node_modules/@noodle-borg/authoring/dist/platform.d.ts +3 -0
- package/node_modules/@noodle-borg/authoring/dist/platform.js +4 -0
- package/node_modules/@noodle-borg/authoring/dist/server-presentation.js +43 -0
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +4 -44
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-billing.js +18 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-config.js +31 -4
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +778 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-tenant-resources.js +0 -241
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-types.js +7 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/index.js +20 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +2 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/catalog-emission.js +3 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/config.js +3 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +17 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +6 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +6 -1
- package/node_modules/@noodle-borg/compiler/dist/business-variables.d.ts +27 -0
- package/node_modules/@noodle-borg/compiler/dist/business-variables.js +230 -0
- package/node_modules/@noodle-borg/compiler/dist/compile.js +7 -1
- package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
- package/node_modules/@noodle-borg/compiler/dist/index.d.ts +3 -0
- package/node_modules/@noodle-borg/compiler/dist/index.js +3 -0
- package/node_modules/@noodle-borg/compiler/dist/managed-collection-controls.d.ts +52 -0
- package/node_modules/@noodle-borg/compiler/dist/managed-collection-controls.js +92 -0
- package/node_modules/@noodle-borg/compiler/dist/managed-collections.d.ts +26 -1
- package/node_modules/@noodle-borg/compiler/dist/managed-collections.js +190 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +100 -36
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +2 -0
- package/node_modules/@noodle-borg/compiler/dist/native-record-operations.d.ts +7 -0
- package/node_modules/@noodle-borg/compiler/dist/native-record-operations.js +59 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile-http.js +83 -8
- package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +31 -1
- package/node_modules/@noodle-borg/connector-defs/dist/schema.js +16 -0
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +12 -3
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +41 -2
- package/node_modules/@noodle-borg/connector-http/dist/http-response.js +3 -2
- package/node_modules/@noodle-borg/connector-http/dist/mcp/config.js +1 -1
- package/node_modules/@noodle-borg/connector-http/dist/url-resolution.js +1 -1
- package/node_modules/@noodle-borg/control-plane/dist/contracts.d.ts +2 -1
- package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.d.ts +3 -0
- package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.js +11 -0
- package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.d.ts +45 -0
- package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.js +74 -0
- package/node_modules/@noodle-borg/control-plane/dist/portable.d.ts +1 -0
- package/node_modules/@noodle-borg/control-plane/dist/portable.js +1 -0
- package/node_modules/@noodle-borg/module/dist/contract.d.ts +20 -0
- package/node_modules/@noodle-borg/module/dist/platform-human-identity.d.ts +2 -0
- package/node_modules/@noodle-borg/protocol/dist/request-deps.js +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.js +11 -2
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts +2 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js +2 -1
- package/node_modules/@noodle-borg/protocol/dist/v2/server.js +2 -1
- package/node_modules/@noodle-borg/runtime/dist/ambient-context.js +6 -1
- package/node_modules/@noodle-borg/runtime/dist/broker/types.d.ts +2 -0
- package/node_modules/@noodle-borg/runtime/dist/business-variables.d.ts +15 -0
- package/node_modules/@noodle-borg/runtime/dist/business-variables.js +75 -0
- package/node_modules/@noodle-borg/runtime/dist/confirmation-continuation.js +2 -1
- package/node_modules/@noodle-borg/runtime/dist/confirmation.js +23 -3
- package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +17 -1
- package/node_modules/@noodle-borg/runtime/dist/connector-snapshot.js +6 -0
- package/node_modules/@noodle-borg/runtime/dist/execute.d.ts +18 -3
- package/node_modules/@noodle-borg/runtime/dist/execute.js +13 -3
- package/node_modules/@noodle-borg/runtime/dist/index.d.ts +2 -0
- package/node_modules/@noodle-borg/runtime/dist/index.js +1 -0
- package/node_modules/@noodle-borg/runtime/dist/interactive.js +11 -0
- package/node_modules/@noodle-borg/runtime/dist/managed-origins.d.ts +3 -1
- package/node_modules/@noodle-borg/runtime/dist/managed-origins.js +32 -7
- package/node_modules/@noodle-borg/runtime/dist/operation-credential.js +6 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-evidence.d.ts +30 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-evidence.js +68 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-execution.d.ts +2 -2
- package/node_modules/@noodle-borg/runtime/dist/operation-execution.js +142 -71
- package/node_modules/@noodle-borg/runtime/dist/result.d.ts +6 -4
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.d.ts +7 -0
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.js +48 -4
- package/node_modules/@noodle-borg/service/dist/admission.js +2 -1
- package/node_modules/@noodle-borg/service/dist/application-activity.js +236 -0
- package/node_modules/@noodle-borg/service/dist/application-business-notice.js +28 -0
- package/node_modules/@noodle-borg/service/dist/application-runtime-target.js +141 -0
- package/node_modules/@noodle-borg/service/dist/application-settings-targets.js +72 -0
- package/node_modules/@noodle-borg/service/dist/application-settings.js +210 -0
- package/node_modules/@noodle-borg/service/dist/business-api-admission.js +121 -0
- package/node_modules/@noodle-borg/service/dist/business-information/activity-pagination.js +73 -0
- package/node_modules/@noodle-borg/service/dist/business-information/business-notice.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/business-information/business-notice.js +18 -0
- package/node_modules/@noodle-borg/service/dist/business-information/collection-controls.js +51 -0
- package/node_modules/@noodle-borg/service/dist/business-information/contracts.d.ts +439 -0
- package/node_modules/@noodle-borg/service/dist/business-information/definition-resolver.js +94 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-installation-lifecycle.js +136 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-invitations.js +160 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-locks.js +23 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +287 -132
- package/node_modules/@noodle-borg/service/dist/business-information/installation-capacity.js +10 -0
- package/node_modules/@noodle-borg/service/dist/business-information/invitations.js +68 -0
- package/node_modules/@noodle-borg/service/dist/business-information/legacy-request-migration.js +60 -0
- package/node_modules/@noodle-borg/service/dist/business-information/managed-releases.js +245 -0
- package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-blueprints.js +51 -0
- package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-executable.js +76 -0
- package/node_modules/@noodle-borg/service/dist/business-information/model.js +124 -23
- package/node_modules/@noodle-borg/service/dist/business-information/native-query.js +162 -0
- package/node_modules/@noodle-borg/service/dist/business-information/native-storage-budget.js +60 -0
- package/node_modules/@noodle-borg/service/dist/business-information/pagination.js +28 -0
- package/node_modules/@noodle-borg/service/dist/business-information/portable.js +9 -0
- package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.d.ts +11 -0
- package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.js +42 -0
- package/node_modules/@noodle-borg/service/dist/business-information/profiles.js +137 -6
- package/node_modules/@noodle-borg/service/dist/business-information/reader-floor.js +26 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-credential-fence.js +79 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-custody-budget.js +30 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-custody-memory.js +122 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-executor.js +191 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-contracts.js +2 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-coordinator.js +136 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-failures.js +32 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-state.js +154 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-store.js +568 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-types.js +26 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-values.js +59 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-pagination.js +54 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-validation.js +163 -0
- package/node_modules/@noodle-borg/service/dist/business-information/source-refresh-retention.js +29 -0
- package/node_modules/@noodle-borg/service/dist/business-information-runtime.js +80 -0
- package/node_modules/@noodle-borg/service/dist/business-onboarding.js +73 -0
- package/node_modules/@noodle-borg/service/dist/connections/types.js +8 -0
- package/node_modules/@noodle-borg/service/dist/credential-binding-index.js +38 -33
- package/node_modules/@noodle-borg/service/dist/deployment-execution.js +275 -0
- package/node_modules/@noodle-borg/service/dist/external-credential-binding-broker.js +19 -1
- package/node_modules/@noodle-borg/service/dist/external-credential-exchange.d.ts +16 -1
- package/node_modules/@noodle-borg/service/dist/modules/host.js +4 -1
- package/node_modules/@noodle-borg/service/dist/native-record-connector.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/native-record-connector.js +206 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/operation-evidence.js +89 -0
- package/node_modules/@noodle-borg/service/dist/recovery-quarantine.js +49 -0
- package/node_modules/@noodle-borg/service/dist/registry-compile.js +60 -11
- package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.js +18 -0
- package/node_modules/@noodle-borg/service/dist/registry-rollback.js +2 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.js +6 -3
- package/node_modules/@noodle-borg/service/dist/registry-targets.js +49 -0
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +15 -3
- package/node_modules/@noodle-borg/service/dist/registry.js +177 -137
- package/node_modules/@noodle-borg/service/dist/routes/assistant-appearance.js +3 -2
- package/node_modules/@noodle-borg/service/dist/routes/assistant-clients.js +2 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-doctor.js +2 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.js +8 -3
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interaction-replay.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-interactions.js +48 -36
- package/node_modules/@noodle-borg/service/dist/routes/assistant-public-configuration.js +3 -2
- package/node_modules/@noodle-borg/service/dist/routes/assistant-public-session.js +10 -10
- package/node_modules/@noodle-borg/service/dist/routes/assistant-session-target.js +32 -3
- package/node_modules/@noodle-borg/service/dist/routes/assistant-suggestions.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant-transcript.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/assistant.js +10 -10
- package/node_modules/@noodle-borg/service/dist/routes/business-information-activity.js +83 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-admission.js +26 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-channels.js +153 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-connections.js +107 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +87 -4
- package/node_modules/@noodle-borg/service/dist/routes/business-information-external.js +79 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-installation.js +24 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-notice.js +69 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-onboarding.js +58 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +76 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-public.js +151 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-reader-floor.js +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-record-create.js +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-record-reads.js +36 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-request.js +64 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-settings.js +64 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-source.js +249 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-staff.js +258 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-wire.js +226 -26
- package/node_modules/@noodle-borg/service/dist/routes/business-information.js +238 -197
- package/node_modules/@noodle-borg/service/dist/routes/config-values-dispatch.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/config-values.js +26 -4
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +19 -233
- package/node_modules/@noodle-borg/service/dist/routes/deployment-activation-response.js +13 -4
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +4 -0
- package/node_modules/@noodle-borg/service/dist/service.js +57 -11
- package/node_modules/@noodle-borg/service/dist/solution-installation-activation.js +149 -0
- package/node_modules/@noodle-borg/service/dist/source-configuration-authority.js +94 -0
- package/node_modules/@noodle-borg/service/dist/state-catalog.js +6 -5
- package/node_modules/@noodle-borg/service/dist/store/config-values.d.ts +42 -17
- package/node_modules/@noodle-borg/service/dist/store/config-values.js +123 -24
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js +3 -0
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/json-file.js +3 -0
- package/node_modules/@noodle-borg/service/dist/store.d.ts +3 -1
- package/node_modules/@noodle-borg/service/package.json +2 -2
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +9 -0
- package/node_modules/@noodle-borg/transport-http/package.json +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.d.ts +143 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.js +90 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.d.ts +130 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.js +77 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-connections.d.ts +105 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-connections.js +67 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-onboarding.d.ts +27 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-onboarding.js +28 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-settings.d.ts +112 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/application-settings.js +88 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-catalog.d.ts +62 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-catalog.js +57 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-enforcement.d.ts +12 -12
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-metering.d.ts +4 -4
- package/node_modules/@noodle-borg/wire-contracts/dist/billing-org-transfer.d.ts +3 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information-query.d.ts +25 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information-query.js +37 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +1816 -158
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +416 -41
- package/node_modules/@noodle-borg/wire-contracts/dist/control-plane.d.ts +2 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/distribution.d.ts +5 -5
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +8 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +8 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/knowledge.d.ts +3 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/managed-assistant-sponsorship.d.ts +7 -7
- package/node_modules/@noodle-borg/wire-contracts/dist/platform-account-reset.d.ts +5 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/platform-account-reset.js +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/platform-auth.d.ts +66 -66
- package/node_modules/@noodle-borg/wire-contracts/dist/solution-onboarding.d.ts +143 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/solution-onboarding.js +94 -0
- package/node_modules/@noodleseed/assistant/README.md +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { sha256Canonical } from '@noodle-borg/app-package';
|
|
2
|
+
import { ApplicationSettings, installationSettingsTarget } from './application-settings.js';
|
|
3
|
+
import { privateDefinitionFromDeployment } from './business-information/definition-resolver.js';
|
|
4
|
+
import { managedSolutionManifest } from './business-information/managed-solution-executable.js';
|
|
5
|
+
import { BUSINESS_SETUP_MESSAGE, BusinessOnboarding } from './business-onboarding.js';
|
|
6
|
+
import { executeAuthorizedDeployment, } from './deployment-execution.js';
|
|
7
|
+
/** Called after installation authorization, and by the managed-runtime refresh boundary. Never copies configuration. */
|
|
8
|
+
export async function activateSolutionInstallation(input, dependencies) {
|
|
9
|
+
const { installation, actor } = input;
|
|
10
|
+
if (dependencies.options.businessOnboarding !== undefined &&
|
|
11
|
+
(!dependencies.businessInformationStore ||
|
|
12
|
+
!(await new BusinessOnboarding(dependencies.options.businessOnboarding, dependencies.controlPlane, dependencies.businessInformationStore).ready(installation)))) {
|
|
13
|
+
return reject(409, 'business_setup_required', BUSINESS_SETUP_MESSAGE);
|
|
14
|
+
}
|
|
15
|
+
const tenant = {
|
|
16
|
+
org: installation.scope.org,
|
|
17
|
+
app: installation.scope.app,
|
|
18
|
+
env: installation.scope.env,
|
|
19
|
+
};
|
|
20
|
+
const store = dependencies.businessInformationStore;
|
|
21
|
+
const stored = (await store?.getInstallation(installation.scope)) ?? installation;
|
|
22
|
+
const generation = await dependencies.registry.getAppGeneration(tenant.org, tenant.app);
|
|
23
|
+
if ((await dependencies.registry.getAppArchivedAt(tenant.org, tenant.app)) !== undefined ||
|
|
24
|
+
(stored.applicationGeneration !== 'pending' &&
|
|
25
|
+
(generation === undefined ||
|
|
26
|
+
(stored.applicationGeneration !== undefined &&
|
|
27
|
+
stored.applicationGeneration !== generation)))) {
|
|
28
|
+
return reject(409, 'installation_application_unavailable', 'Restore the original application before activation. Retained records remain accessible.');
|
|
29
|
+
}
|
|
30
|
+
if (store &&
|
|
31
|
+
stored.applicationGeneration !== 'pending' &&
|
|
32
|
+
!(await store.bindApplication(installation.scope, generation ?? ''))) {
|
|
33
|
+
return reject(409, 'installation_application_unavailable', 'The retained installation requires application ownership recovery before activation.');
|
|
34
|
+
}
|
|
35
|
+
const bind = async (deploymentId) => {
|
|
36
|
+
const currentGeneration = await dependencies.registry.getAppGeneration(tenant.org, tenant.app);
|
|
37
|
+
if (store &&
|
|
38
|
+
(!currentGeneration || !(await store.bindApplication(installation.scope, currentGeneration))))
|
|
39
|
+
return reject(409, 'installation_application_unavailable', 'Application activation was interrupted; retained records remain accessible.');
|
|
40
|
+
if ((installation.definition.variables?.length ?? 0) > 0)
|
|
41
|
+
await new ApplicationSettings(dependencies.registry.configStore).initialize(installationSettingsTarget(installation));
|
|
42
|
+
return { ok: true, deploymentId };
|
|
43
|
+
};
|
|
44
|
+
const source = await executableSource(installation, dependencies.registry);
|
|
45
|
+
if (!source.ok)
|
|
46
|
+
return source;
|
|
47
|
+
const current = await dependencies.registry.getActiveByTenant(tenant);
|
|
48
|
+
const declarations = current?.served.artifact.server.variables ?? installation.definition.variables ?? [];
|
|
49
|
+
if (declarations.length > 0)
|
|
50
|
+
await new ApplicationSettings(dependencies.registry.configStore).initialize({
|
|
51
|
+
...installationSettingsTarget(installation),
|
|
52
|
+
declarations,
|
|
53
|
+
});
|
|
54
|
+
const accessMode = current?.accessMode ?? source.value.accessMode;
|
|
55
|
+
const ownerSubject = accessMode === 'owner-only'
|
|
56
|
+
? (current?.ownerSubject ?? installation.createdBySubject)
|
|
57
|
+
: undefined;
|
|
58
|
+
const currentSource = current?.deploymentId === undefined
|
|
59
|
+
? undefined
|
|
60
|
+
: await dependencies.registry.getDeploymentSource(tenant, current.deploymentId);
|
|
61
|
+
if (current?.deploymentId !== undefined &&
|
|
62
|
+
currentSource !== undefined &&
|
|
63
|
+
currentSource.manifest === source.value.manifest &&
|
|
64
|
+
currentSource.connectors === source.value.connectors &&
|
|
65
|
+
JSON.stringify(currentSource.hostedAssets) === JSON.stringify(source.value.hostedAssets)) {
|
|
66
|
+
return bind(current.deploymentId);
|
|
67
|
+
}
|
|
68
|
+
const key = sha256Canonical({
|
|
69
|
+
scope: installation.scope,
|
|
70
|
+
definition: installation.definition.reference,
|
|
71
|
+
executable: source.value,
|
|
72
|
+
accessMode,
|
|
73
|
+
ownerSubject: ownerSubject ?? null,
|
|
74
|
+
orgMembershipSources: current?.orgMembershipSources ?? null,
|
|
75
|
+
predecessor: current?.deploymentId ?? null,
|
|
76
|
+
});
|
|
77
|
+
const deployed = await executeAuthorizedDeployment({
|
|
78
|
+
...source.value,
|
|
79
|
+
tenant,
|
|
80
|
+
identity: actor,
|
|
81
|
+
accessMode,
|
|
82
|
+
...(ownerSubject === undefined ? {} : { ownerSubject }),
|
|
83
|
+
...(current?.orgMembershipSources === undefined
|
|
84
|
+
? {}
|
|
85
|
+
: { orgMembershipSources: current.orgMembershipSources }),
|
|
86
|
+
deploymentSource: 'api',
|
|
87
|
+
idempotencyKey: key,
|
|
88
|
+
}, dependencies);
|
|
89
|
+
if (!deployed.ok)
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
status: deployed.status,
|
|
93
|
+
code: typeof deployed.body.code === 'string'
|
|
94
|
+
? deployed.body.code
|
|
95
|
+
: 'installation_activation_failed',
|
|
96
|
+
message: 'The installation is saved, but its application could not be activated. Retry installation after resolving the deployment requirement.',
|
|
97
|
+
};
|
|
98
|
+
return bind(deployed.result.deploymentId);
|
|
99
|
+
}
|
|
100
|
+
async function executableSource(installation, registry) {
|
|
101
|
+
const reference = installation.definition.reference;
|
|
102
|
+
if (reference.kind === 'managed') {
|
|
103
|
+
return {
|
|
104
|
+
ok: true,
|
|
105
|
+
value: {
|
|
106
|
+
manifest: JSON.stringify(managedSolutionManifest(installation.definition)),
|
|
107
|
+
accessMode: 'public',
|
|
108
|
+
serverVersion: '1',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (reference.kind !== 'private')
|
|
113
|
+
return reject(409, 'definition_unavailable', 'This historical definition has no executable application.');
|
|
114
|
+
if (reference.publisherOrg !== installation.scope.org)
|
|
115
|
+
return reject(403, 'definition_forbidden', 'Private definitions must belong to the installation organization.');
|
|
116
|
+
const sourceScope = { org: reference.publisherOrg, app: reference.app, env: reference.env };
|
|
117
|
+
const source = await registry.getDeploymentSource(sourceScope, reference.deploymentId);
|
|
118
|
+
if (source === undefined)
|
|
119
|
+
return reject(409, 'definition_unavailable', 'The immutable source deployment is unavailable or archived.');
|
|
120
|
+
const target = await registry.get(reference.deploymentId);
|
|
121
|
+
if (target === undefined)
|
|
122
|
+
return reject(409, 'definition_unavailable', 'The immutable source deployment cannot be loaded.');
|
|
123
|
+
const verified = privateDefinitionFromDeployment({
|
|
124
|
+
publisherOrg: reference.publisherOrg,
|
|
125
|
+
app: reference.app,
|
|
126
|
+
environment: reference.env,
|
|
127
|
+
deploymentId: reference.deploymentId,
|
|
128
|
+
}, {
|
|
129
|
+
...sourceScope,
|
|
130
|
+
environment: sourceScope.env,
|
|
131
|
+
deploymentId: reference.deploymentId,
|
|
132
|
+
artifact: target.served.artifact,
|
|
133
|
+
});
|
|
134
|
+
if (verified.reference.digest !== reference.digest)
|
|
135
|
+
return reject(409, 'definition_changed', 'The installation definition does not match its immutable source deployment.');
|
|
136
|
+
return {
|
|
137
|
+
ok: true,
|
|
138
|
+
value: {
|
|
139
|
+
...source,
|
|
140
|
+
accessMode: source.accessMode ?? 'public',
|
|
141
|
+
serverVersion: source.serverVersion ?? '1',
|
|
142
|
+
assetSourceScope: sourceScope,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function reject(status, code, message) {
|
|
147
|
+
return { ok: false, status, code, message };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=solution-installation-activation.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { sha256Canonical } from '@noodle-borg/compiler';
|
|
2
|
+
import { compileConnectors, connectorFileSchema, } from '@noodle-borg/connector-defs';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { SourceCredentialError, } from './business-information/source-credential-fence.js';
|
|
5
|
+
import { normalizePersistedConnectorsForCompile } from './connector-normalize.js';
|
|
6
|
+
import { buildCredentialBindingIndex } from './credential-binding-index.js';
|
|
7
|
+
import { scopeChain } from './store/config-values.js';
|
|
8
|
+
/** Capture only the source connector's declared dependencies; unrelated business settings do not invalidate it. */
|
|
9
|
+
export function sourceConfigurationAuthority(getRegistry, credential) {
|
|
10
|
+
return {
|
|
11
|
+
async withCurrent(binding, work) {
|
|
12
|
+
const registry = getRegistry();
|
|
13
|
+
const target = await registry.getActiveByTenant(binding.scope);
|
|
14
|
+
const deployed = target?.deploymentId
|
|
15
|
+
? await registry.getDeploymentSource(binding.scope, target.deploymentId)
|
|
16
|
+
: undefined;
|
|
17
|
+
if (!target || !deployed?.connectors || !registry.configStore.transactConfig)
|
|
18
|
+
throw new SourceCredentialError();
|
|
19
|
+
const file = connectorFileSchema.parse(parseYaml(normalizePersistedConnectorsForCompile(deployed.connectors)));
|
|
20
|
+
const selected = new Map();
|
|
21
|
+
const visit = (definition, name) => {
|
|
22
|
+
const operation = definition?.operations[name];
|
|
23
|
+
if (!definition || !operation)
|
|
24
|
+
throw new SourceCredentialError();
|
|
25
|
+
const names = selected.get(definition) ?? new Set();
|
|
26
|
+
if (names.has(name))
|
|
27
|
+
return;
|
|
28
|
+
names.add(name);
|
|
29
|
+
selected.set(definition, names);
|
|
30
|
+
if ('calls' in operation)
|
|
31
|
+
for (const call of Object.values(operation.calls ?? {})) {
|
|
32
|
+
const [id, child] = call.split('.');
|
|
33
|
+
const matches = file.connectors.filter((item) => item.id === id);
|
|
34
|
+
if (matches.length !== 1 || !child)
|
|
35
|
+
throw new SourceCredentialError();
|
|
36
|
+
visit(matches[0], child);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
visit(file.connectors.find((item) => item.id === binding.scan.connector && item.version === binding.scan.connectorVersion), binding.scan.operation);
|
|
40
|
+
const connectors = [...selected].map(([definition, names]) => ({
|
|
41
|
+
...definition,
|
|
42
|
+
operations: Object.fromEntries(Object.entries(definition.operations).filter(([name]) => names.has(name))),
|
|
43
|
+
}));
|
|
44
|
+
const compiled = compileConnectors(JSON.stringify({ connectors }));
|
|
45
|
+
if (!compiled.ok)
|
|
46
|
+
throw new SourceCredentialError();
|
|
47
|
+
const variables = new Set(compiled.variableBindings);
|
|
48
|
+
const secrets = new Set(compiled.secretBindings.flatMap((item) => (item.secretRef ? [item.secretRef] : [])));
|
|
49
|
+
const account = [...buildCredentialBindingIndex(target.served.artifact).byKey.values()].find((item) => item.descriptor.connectionId === binding.bindingReference &&
|
|
50
|
+
item.descriptor.connectorId === binding.scan.connector &&
|
|
51
|
+
item.descriptor.operation === binding.scan.operation)?.source;
|
|
52
|
+
for (const match of JSON.stringify(account ?? {}).matchAll(/\$\{env\.([A-Za-z0-9_]+)\}/g))
|
|
53
|
+
if (match[1])
|
|
54
|
+
variables.add(match[1]);
|
|
55
|
+
if (account?.kind === 'managedSecret')
|
|
56
|
+
secrets.add(account.secret);
|
|
57
|
+
if (account?.kind === 'clientCredentials')
|
|
58
|
+
secrets.add(account.clientSecret);
|
|
59
|
+
const defaults = target.served.artifact.server.variables?.filter((item) => variables.has(item.name)) ?? [];
|
|
60
|
+
return registry.configStore.transactConfig(binding.scope.org, async (transaction) => {
|
|
61
|
+
if ((await registry.getActiveByTenant(binding.scope))?.deploymentId !== target.deploymentId)
|
|
62
|
+
throw new SourceCredentialError();
|
|
63
|
+
const effective = new Map();
|
|
64
|
+
for (const scope of scopeChain({ level: 'env', ...binding.scope }))
|
|
65
|
+
for (const kind of ['variable', 'secret']) {
|
|
66
|
+
for (const row of await transaction.listConfigValues(kind, scope)) {
|
|
67
|
+
if (!(kind === 'variable' ? variables : secrets).has(row.name))
|
|
68
|
+
continue;
|
|
69
|
+
if (!row.generation)
|
|
70
|
+
throw new SourceCredentialError();
|
|
71
|
+
const key = `${kind}:${row.name}`;
|
|
72
|
+
if (row.valueOrigin !== 'default' ||
|
|
73
|
+
!effective.has(key) ||
|
|
74
|
+
effective.get(key)?.valueOrigin === 'default')
|
|
75
|
+
effective.set(key, row);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const configuration = sha256Canonical({
|
|
79
|
+
connectors,
|
|
80
|
+
account,
|
|
81
|
+
defaults: defaults
|
|
82
|
+
.filter((item) => !effective.has(`variable:${item.name}`))
|
|
83
|
+
.map((item) => ({ name: item.name, default: item.default })),
|
|
84
|
+
rows: [...effective]
|
|
85
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
86
|
+
.map(([key, row]) => [key, row.scope, row.generation]),
|
|
87
|
+
});
|
|
88
|
+
const guarded = async (identity) => work({ ...identity, configuration });
|
|
89
|
+
return credential ? credential.withCurrent(binding, guarded) : work({ configuration });
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=source-configuration-authority.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BUILTIN_RECORD_CATALOG_CONNECTOR } from '@noodle-borg/compiler';
|
|
1
2
|
import { STATE_CONNECTOR_ID, STATE_CONNECTOR_VERSION, STATE_OPERATION_SIGNATURES, } from '@noodle-borg/runtime';
|
|
2
3
|
export const BUILTIN_STATE_CATALOG_CONNECTOR = {
|
|
3
4
|
id: STATE_CONNECTOR_ID,
|
|
@@ -6,10 +7,10 @@ export const BUILTIN_STATE_CATALOG_CONNECTOR = {
|
|
|
6
7
|
operations: STATE_OPERATION_SIGNATURES,
|
|
7
8
|
};
|
|
8
9
|
export function withBuiltinStateCatalog(catalog) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const builtins = [BUILTIN_STATE_CATALOG_CONNECTOR, BUILTIN_RECORD_CATALOG_CONNECTOR];
|
|
11
|
+
return [
|
|
12
|
+
...builtins,
|
|
13
|
+
...catalog.filter((entry) => !builtins.some((builtin) => builtin.id === entry.id)),
|
|
14
|
+
];
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=state-catalog.js.map
|
|
@@ -13,6 +13,8 @@ export type ConfigScope = {
|
|
|
13
13
|
readonly env: string;
|
|
14
14
|
};
|
|
15
15
|
export interface ConfigValueMetadata {
|
|
16
|
+
/** Internal mutation identity; non-enumerable and excluded from operator wire projections. */
|
|
17
|
+
readonly generation?: string;
|
|
16
18
|
readonly kind: ManagedConfigKind;
|
|
17
19
|
readonly scope: ConfigScope;
|
|
18
20
|
readonly name: string;
|
|
@@ -20,38 +22,61 @@ export interface ConfigValueMetadata {
|
|
|
20
22
|
readonly updatedBySubject?: string;
|
|
21
23
|
readonly updatedByEmail?: string;
|
|
22
24
|
readonly value?: string;
|
|
25
|
+
readonly valueOrigin?: 'default';
|
|
26
|
+
}
|
|
27
|
+
export interface ConfigValueInput {
|
|
28
|
+
readonly kind: ManagedConfigKind;
|
|
29
|
+
readonly scope: ConfigScope;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly value: string;
|
|
32
|
+
readonly updatedBySubject?: string;
|
|
33
|
+
readonly updatedByEmail?: string;
|
|
34
|
+
readonly valueOrigin?: 'default';
|
|
23
35
|
}
|
|
24
36
|
export interface ConfigStore {
|
|
25
|
-
setConfigValue(input:
|
|
26
|
-
readonly kind: ManagedConfigKind;
|
|
27
|
-
readonly scope: ConfigScope;
|
|
28
|
-
readonly name: string;
|
|
29
|
-
readonly value: string;
|
|
30
|
-
readonly updatedBySubject?: string;
|
|
31
|
-
readonly updatedByEmail?: string;
|
|
32
|
-
}): Promise<ConfigValueMetadata>;
|
|
37
|
+
setConfigValue(input: ConfigValueInput): Promise<ConfigValueMetadata>;
|
|
33
38
|
deleteConfigValue(kind: ManagedConfigKind, scope: ConfigScope, name: string): Promise<boolean>;
|
|
34
39
|
listConfigValues(kind: ManagedConfigKind, scope: ConfigScope): Promise<readonly ConfigValueMetadata[]>;
|
|
35
40
|
resolveConfigValues(kind: ManagedConfigKind, scope: ConfigScope, name?: string): Promise<Record<string, string>>;
|
|
41
|
+
/** Atomic organization-scoped snapshot. Required for hosted business-setting mutations. */
|
|
42
|
+
transactConfig?<T>(org: string, work: (transaction: ConfigStore) => Promise<T>): Promise<T>;
|
|
36
43
|
}
|
|
37
|
-
|
|
44
|
+
declare class MemoryConfigSnapshot implements ConfigStore {
|
|
38
45
|
#private;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
readonly name: string;
|
|
43
|
-
readonly value: string;
|
|
44
|
-
readonly updatedBySubject?: string;
|
|
45
|
-
readonly updatedByEmail?: string;
|
|
46
|
-
}): Promise<ConfigValueMetadata>;
|
|
46
|
+
get records(): Map<string, ConfigRecord>;
|
|
47
|
+
set records(value: Map<string, ConfigRecord>);
|
|
48
|
+
setConfigValue(input: ConfigValueInput): Promise<ConfigValueMetadata>;
|
|
47
49
|
deleteConfigValue(kind: ManagedConfigKind, scope: ConfigScope, name: string): Promise<boolean>;
|
|
48
50
|
listConfigValues(kind: ManagedConfigKind, scope: ConfigScope): Promise<readonly ConfigValueMetadata[]>;
|
|
49
51
|
resolveConfigValues(kind: ManagedConfigKind, scope: ConfigScope, name?: string): Promise<Record<string, string>>;
|
|
50
52
|
}
|
|
53
|
+
/** Copy-on-commit isolates readers from partially applied batches; transactions serialize writers. */
|
|
54
|
+
export declare class InMemoryConfigStore extends MemoryConfigSnapshot {
|
|
55
|
+
#private;
|
|
56
|
+
setConfigValue(input: ConfigValueInput): Promise<ConfigValueMetadata>;
|
|
57
|
+
deleteConfigValue(kind: ManagedConfigKind, scope: ConfigScope, name: string): Promise<boolean>;
|
|
58
|
+
transactConfig<T>(org: string, work: (transaction: ConfigStore) => Promise<T>): Promise<T>;
|
|
59
|
+
}
|
|
60
|
+
/** Prevent a transaction from reaching an organization outside its acquired lock. */
|
|
61
|
+
export declare function scopeConfigTransaction(org: string, transaction: ConfigStore): ConfigStore;
|
|
51
62
|
export declare function resolveConfigScope(input: {
|
|
52
63
|
readonly org: string;
|
|
53
64
|
readonly app?: string;
|
|
54
65
|
readonly env?: string;
|
|
55
66
|
}): ConfigScope;
|
|
56
67
|
export declare function scopeChain(scope: ConfigScope): readonly ConfigScope[];
|
|
68
|
+
interface ConfigRecord {
|
|
69
|
+
readonly generation: string;
|
|
70
|
+
readonly kind: ManagedConfigKind;
|
|
71
|
+
readonly scope: ConfigScope;
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly value: string;
|
|
74
|
+
readonly updatedAt: string;
|
|
75
|
+
readonly updatedBySubject?: string;
|
|
76
|
+
readonly updatedByEmail?: string;
|
|
77
|
+
readonly valueOrigin?: 'default';
|
|
78
|
+
}
|
|
79
|
+
/** Explicit operator values outrank pinned publisher defaults at every hierarchy level. */
|
|
80
|
+
export declare function effectiveConfigValues(rows: readonly Pick<ConfigValueMetadata, 'name' | 'value' | 'valueOrigin'>[]): Record<string, string>;
|
|
81
|
+
export {};
|
|
57
82
|
//# sourceMappingURL=config-values.d.ts.map
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
1
3
|
import { validateConfigName, validateConfigScope } from './validate.js';
|
|
2
|
-
|
|
4
|
+
const memoryTransactions = new AsyncLocalStorage();
|
|
5
|
+
class MemoryConfigSnapshot {
|
|
3
6
|
#records = new Map();
|
|
7
|
+
get records() {
|
|
8
|
+
const context = memoryTransactions.getStore();
|
|
9
|
+
return context?.active && context.owner === this ? context.snapshot.records : this.#records;
|
|
10
|
+
}
|
|
11
|
+
set records(value) {
|
|
12
|
+
this.#records = value;
|
|
13
|
+
}
|
|
4
14
|
setConfigValue(input) {
|
|
5
15
|
const scope = validateConfigScope(input.scope);
|
|
6
16
|
const name = validateConfigName(input.name);
|
|
@@ -10,46 +20,108 @@ export class InMemoryConfigStore {
|
|
|
10
20
|
name,
|
|
11
21
|
value: input.value,
|
|
12
22
|
updatedAt: new Date().toISOString(),
|
|
23
|
+
generation: randomUUID(),
|
|
13
24
|
...(input.updatedBySubject !== undefined ? { updatedBySubject: input.updatedBySubject } : {}),
|
|
14
25
|
...(input.updatedByEmail !== undefined ? { updatedByEmail: input.updatedByEmail } : {}),
|
|
26
|
+
...(input.valueOrigin === undefined ? {} : { valueOrigin: input.valueOrigin }),
|
|
15
27
|
};
|
|
16
|
-
this
|
|
28
|
+
this.records.set(configKey(input.kind, scope, name), record);
|
|
17
29
|
return Promise.resolve(toMetadata(record));
|
|
18
30
|
}
|
|
19
31
|
deleteConfigValue(kind, scope, name) {
|
|
20
|
-
return Promise.resolve(this
|
|
32
|
+
return Promise.resolve(this.records.delete(configKey(kind, validateConfigScope(scope), validateConfigName(name))));
|
|
21
33
|
}
|
|
22
34
|
listConfigValues(kind, scope) {
|
|
23
35
|
const safe = validateConfigScope(scope);
|
|
24
|
-
return Promise.resolve([...this
|
|
36
|
+
return Promise.resolve([...this.records.values()]
|
|
25
37
|
.filter((record) => record.kind === kind && sameScope(record.scope, safe))
|
|
26
38
|
.sort((a, b) => a.name.localeCompare(b.name))
|
|
27
39
|
.map(toMetadata));
|
|
28
40
|
}
|
|
29
41
|
resolveConfigValues(kind, scope, name) {
|
|
30
42
|
const safeName = name === undefined ? undefined : validateConfigName(name);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
const rows = scopeChain(validateConfigScope(scope)).flatMap((current) => [...this.records.values()].filter((record) => record.kind === kind &&
|
|
44
|
+
sameScope(record.scope, current) &&
|
|
45
|
+
(safeName === undefined || record.name === safeName)));
|
|
46
|
+
return Promise.resolve(effectiveConfigValues(rows));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Copy-on-commit isolates readers from partially applied batches; transactions serialize writers. */
|
|
50
|
+
export class InMemoryConfigStore extends MemoryConfigSnapshot {
|
|
51
|
+
#pending = Promise.resolve();
|
|
52
|
+
setConfigValue(input) {
|
|
53
|
+
return this.transactConfig(input.scope.org, (transaction) => transaction.setConfigValue(input));
|
|
54
|
+
}
|
|
55
|
+
deleteConfigValue(kind, scope, name) {
|
|
56
|
+
return this.transactConfig(scope.org, (transaction) => transaction.deleteConfigValue(kind, scope, name));
|
|
57
|
+
}
|
|
58
|
+
async transactConfig(org, work) {
|
|
59
|
+
validateConfigScope({ level: 'org', org });
|
|
60
|
+
const active = memoryTransactions.getStore();
|
|
61
|
+
if (active?.active && active.owner === this) {
|
|
62
|
+
try {
|
|
63
|
+
if (active.org !== org)
|
|
64
|
+
throw new Error('configuration transaction organization mismatch');
|
|
65
|
+
return await work(scopeConfigTransaction(org, active.snapshot));
|
|
40
66
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
for (const current of chain) {
|
|
45
|
-
for (const record of this.#records.values()) {
|
|
46
|
-
if (record.kind === kind && sameScope(record.scope, current))
|
|
47
|
-
out[record.name] = record.value;
|
|
67
|
+
catch (error) {
|
|
68
|
+
active.failure ??= { error };
|
|
69
|
+
throw error;
|
|
48
70
|
}
|
|
49
71
|
}
|
|
50
|
-
|
|
72
|
+
const previous = this.#pending;
|
|
73
|
+
let release = () => { };
|
|
74
|
+
this.#pending = new Promise((resolve) => {
|
|
75
|
+
release = resolve;
|
|
76
|
+
});
|
|
77
|
+
await previous;
|
|
78
|
+
const snapshot = new MemoryConfigSnapshot();
|
|
79
|
+
snapshot.records = new Map(this.records);
|
|
80
|
+
const context = {
|
|
81
|
+
owner: this,
|
|
82
|
+
snapshot,
|
|
83
|
+
org,
|
|
84
|
+
active: true,
|
|
85
|
+
failure: undefined,
|
|
86
|
+
};
|
|
87
|
+
try {
|
|
88
|
+
const result = await memoryTransactions.run(context, () => work(scopeConfigTransaction(org, snapshot)));
|
|
89
|
+
if (context.failure)
|
|
90
|
+
throw context.failure.error;
|
|
91
|
+
this.records = snapshot.records;
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
context.active = false;
|
|
96
|
+
release();
|
|
97
|
+
}
|
|
51
98
|
}
|
|
52
99
|
}
|
|
100
|
+
/** Prevent a transaction from reaching an organization outside its acquired lock. */
|
|
101
|
+
export function scopeConfigTransaction(org, transaction) {
|
|
102
|
+
const check = (scope) => {
|
|
103
|
+
if (scope.org !== org)
|
|
104
|
+
throw new Error('configuration transaction organization mismatch');
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
setConfigValue(input) {
|
|
108
|
+
check(input.scope);
|
|
109
|
+
return transaction.setConfigValue(input);
|
|
110
|
+
},
|
|
111
|
+
deleteConfigValue(kind, scope, name) {
|
|
112
|
+
check(scope);
|
|
113
|
+
return transaction.deleteConfigValue(kind, scope, name);
|
|
114
|
+
},
|
|
115
|
+
listConfigValues(kind, scope) {
|
|
116
|
+
check(scope);
|
|
117
|
+
return transaction.listConfigValues(kind, scope);
|
|
118
|
+
},
|
|
119
|
+
resolveConfigValues(kind, scope, name) {
|
|
120
|
+
check(scope);
|
|
121
|
+
return transaction.resolveConfigValues(kind, scope, name);
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
53
125
|
export function resolveConfigScope(input) {
|
|
54
126
|
if (input.env !== undefined) {
|
|
55
127
|
if (input.app === undefined)
|
|
@@ -85,14 +157,41 @@ function sameScope(a, b) {
|
|
|
85
157
|
return scopePath(a) === scopePath(b);
|
|
86
158
|
}
|
|
87
159
|
function toMetadata(record) {
|
|
88
|
-
return {
|
|
160
|
+
return Object.defineProperty({
|
|
89
161
|
kind: record.kind,
|
|
90
162
|
scope: record.scope,
|
|
91
163
|
name: record.name,
|
|
92
164
|
updatedAt: record.updatedAt,
|
|
93
|
-
...(record.updatedBySubject !== undefined
|
|
165
|
+
...(record.updatedBySubject !== undefined
|
|
166
|
+
? { updatedBySubject: record.updatedBySubject }
|
|
167
|
+
: {}),
|
|
94
168
|
...(record.updatedByEmail !== undefined ? { updatedByEmail: record.updatedByEmail } : {}),
|
|
95
169
|
...(record.kind === 'variable' ? { value: record.value } : {}),
|
|
96
|
-
|
|
170
|
+
...(record.valueOrigin === undefined ? {} : { valueOrigin: record.valueOrigin }),
|
|
171
|
+
}, 'generation', { value: record.generation });
|
|
172
|
+
}
|
|
173
|
+
/** Explicit operator values outrank pinned publisher defaults at every hierarchy level. */
|
|
174
|
+
export function effectiveConfigValues(rows) {
|
|
175
|
+
const defaults = {};
|
|
176
|
+
const explicit = {};
|
|
177
|
+
for (const row of rows) {
|
|
178
|
+
if (row.value === undefined)
|
|
179
|
+
continue;
|
|
180
|
+
if (row.valueOrigin === 'default')
|
|
181
|
+
Object.defineProperty(defaults, row.name, {
|
|
182
|
+
value: row.value,
|
|
183
|
+
enumerable: true,
|
|
184
|
+
configurable: true,
|
|
185
|
+
writable: true,
|
|
186
|
+
});
|
|
187
|
+
else
|
|
188
|
+
Object.defineProperty(explicit, row.name, {
|
|
189
|
+
value: row.value,
|
|
190
|
+
enumerable: true,
|
|
191
|
+
configurable: true,
|
|
192
|
+
writable: true,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return { ...defaults, ...explicit };
|
|
97
196
|
}
|
|
98
197
|
//# sourceMappingURL=config-values.js.map
|
|
@@ -29,6 +29,7 @@ export declare class InMemoryArtifactStore implements ArtifactStore {
|
|
|
29
29
|
readonly apps: readonly AppSummary[];
|
|
30
30
|
readonly truncated: boolean;
|
|
31
31
|
}>;
|
|
32
|
+
getAppGeneration(org: string, app: string): Promise<string | undefined>;
|
|
32
33
|
getApp(org: string, app: string): Promise<AppSummary | undefined>;
|
|
33
34
|
listEnvironments(org: string, app: string, opts?: {
|
|
34
35
|
readonly includeArchived?: boolean;
|
|
@@ -178,6 +178,9 @@ export class InMemoryArtifactStore {
|
|
|
178
178
|
});
|
|
179
179
|
return paginateAppSummaries(summarized, opts.limit);
|
|
180
180
|
}
|
|
181
|
+
async getAppGeneration(org, app) {
|
|
182
|
+
return (await this.getApp(org, app))?.createdAt;
|
|
183
|
+
}
|
|
181
184
|
async getApp(org, app) {
|
|
182
185
|
const safeOrg = validateSlug('org', org);
|
|
183
186
|
const safeApp = validateSlug('app', app);
|
|
@@ -33,6 +33,7 @@ export declare class JsonFileArtifactStore implements ArtifactStore {
|
|
|
33
33
|
readonly apps: readonly AppSummary[];
|
|
34
34
|
readonly truncated: boolean;
|
|
35
35
|
}>;
|
|
36
|
+
getAppGeneration(org: string, app: string): Promise<string | undefined>;
|
|
36
37
|
getApp(org: string, app: string): Promise<AppSummary | undefined>;
|
|
37
38
|
listEnvironments(org: string, app: string, opts?: {
|
|
38
39
|
readonly includeArchived?: boolean;
|
|
@@ -244,6 +244,9 @@ export class JsonFileArtifactStore {
|
|
|
244
244
|
});
|
|
245
245
|
return paginateAppSummaries(summarized, opts.limit);
|
|
246
246
|
}
|
|
247
|
+
async getAppGeneration(org, app) {
|
|
248
|
+
return (await this.getApp(org, app))?.createdAt;
|
|
249
|
+
}
|
|
247
250
|
async getApp(org, app) {
|
|
248
251
|
const safeOrg = validateSlug('org', org);
|
|
249
252
|
const safeApp = validateSlug('app', app);
|
|
@@ -7,7 +7,7 @@ import type { DeploymentSource } from '@noodle-borg/wire-contracts';
|
|
|
7
7
|
import type { AppPackageSnapshotV1 } from './app-package-snapshot.js';
|
|
8
8
|
import type { ProductionEnvironmentChange } from './store/environment-production.js';
|
|
9
9
|
export type { ActiveMcpSubdomainClaim, ChangeMcpSubdomainInput, CreateOrgWithOwnerInput, McpSubdomainMutationResult, McpSubdomainSetting, OrgDomainRecord, OrgInvitationRecord, OrgMemberRecord, OrgOpenAIAppsChallengeRecord, OrgRecord, OrgRole, PersonalWorkspaceProvisionInput, PersonalWorkspaceProvisionResult, SignupAllowlistKind, SignupAllowlistRecord, WelcomeEmailRecord, } from '@noodle-borg/control-plane/portable';
|
|
10
|
-
export { type ConfigScope, type ConfigStore, type ConfigValueMetadata, InMemoryConfigStore, type ManagedConfigKind, resolveConfigScope, scopeChain, } from './store/config-values.js';
|
|
10
|
+
export { type ConfigScope, type ConfigStore, type ConfigValueInput, type ConfigValueMetadata, InMemoryConfigStore, type ManagedConfigKind, resolveConfigScope, scopeChain, } from './store/config-values.js';
|
|
11
11
|
export type { ProductionEnvironmentChange } from './store/environment-production.js';
|
|
12
12
|
export { InMemoryArtifactStore } from './store/in-memory.js';
|
|
13
13
|
export { JsonFileArtifactStore } from './store/json-file.js';
|
|
@@ -340,6 +340,8 @@ export interface ArtifactStore {
|
|
|
340
340
|
}>;
|
|
341
341
|
/** One app's {@link AppSummary}; `undefined` when the app has no records and no anchor. */
|
|
342
342
|
getApp(org: string, app: string): Promise<AppSummary | undefined>;
|
|
343
|
+
/** Authoritative app incarnation identity, independent of display summaries. */
|
|
344
|
+
getAppGeneration(org: string, app: string): Promise<string | undefined>;
|
|
343
345
|
/**
|
|
344
346
|
* The `envs` resource: one {@link EnvSummary} per environment for `app`, production first and then
|
|
345
347
|
* alphabetically (see {@link summarizeEnvs}). Archived envs are excluded unless `includeArchived`.
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
41
|
"@noodle-borg/admission-limits": "0.0.0",
|
|
42
|
-
"@noodle-borg/agent-kit": "0.
|
|
42
|
+
"@noodle-borg/agent-kit": "0.100.0",
|
|
43
43
|
"@noodle-borg/app-package": "0.0.0",
|
|
44
44
|
"@noodle-borg/assistant-gateway": "0.0.0",
|
|
45
45
|
"@noodle-borg/auth": "0.0.0",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@noodle-borg/knowledge": "0.0.0",
|
|
54
54
|
"@noodle-borg/knowledge-operations": "0.0.0",
|
|
55
55
|
"@noodle-borg/module": "0.0.0",
|
|
56
|
-
"@noodle-borg/observability": "0.0.0",
|
|
57
56
|
"@noodle-borg/module-audit": "0.0.0",
|
|
58
57
|
"@noodle-borg/oauth-client-registry": "0.0.0",
|
|
58
|
+
"@noodle-borg/observability": "0.0.0",
|
|
59
59
|
"@noodle-borg/protocol": "0.0.0",
|
|
60
60
|
"@noodle-borg/runtime": "0.0.0",
|
|
61
61
|
"@noodle-borg/service-modules": "0.0.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { trustedPublicAdmission } from '@noodle-borg/admission-limits/portable';
|
|
2
3
|
import { createDualEraMcpHandler, handleStatelessHttp, JSON_RPC, } from '@noodle-borg/protocol';
|
|
3
4
|
import { admissionContexts, requestsInvocationContext } from './admission-context.js';
|
|
4
5
|
import { authorizeIdentityMode, authorizeMixedMode, authorizePublicServiceMode, canonicalResourceUrl, isIdentityMode, } from './identity-authorization.js';
|
|
@@ -219,9 +220,17 @@ export async function serveRequest(req, res, target, auth, routeId, maxBody, all
|
|
|
219
220
|
protocolContext = { ...protocolContext, invocationContext };
|
|
220
221
|
}
|
|
221
222
|
}
|
|
223
|
+
const publicAdmission = trustedPublicAdmission({
|
|
224
|
+
scope: target.deps.tenantId,
|
|
225
|
+
sourceAddress: req.socket.remoteAddress,
|
|
226
|
+
...(protocolContext.caller?.subject === undefined
|
|
227
|
+
? {}
|
|
228
|
+
: { subject: protocolContext.caller.subject }),
|
|
229
|
+
});
|
|
222
230
|
protocolContext = {
|
|
223
231
|
...protocolContext,
|
|
224
232
|
...(auth.intentCaptureMode === 'starter-v1' ? { intentCapture: { enabled: true } } : {}),
|
|
233
|
+
...(publicAdmission === undefined ? {} : { publicAdmission }),
|
|
225
234
|
...(auth.deploymentId !== undefined ? { deploymentId: auth.deploymentId } : {}),
|
|
226
235
|
...(auth.requestState !== undefined ? { requestState: auth.requestState } : {}),
|
|
227
236
|
...(auth.confirmationNonceLedger !== undefined
|