@harperfast/harper 5.2.9 → 5.3.0-alpha.1
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/agent/mcpTools.ts +1 -1
- package/agent/session.ts +25 -14
- package/bin/cliOperations.ts +46 -9
- package/bin/copyDb.ts +282 -59
- package/bin/deploySetup.ts +16 -5
- package/bin/harper.ts +1 -1
- package/bin/help.ts +4 -1
- package/bin/lite.ts +4 -1
- package/bin/restart.ts +59 -3
- package/bin/run.ts +6 -11
- package/bin/upgrade.js +7 -3
- package/bin/workloadIdentity.ts +119 -0
- package/components/Application.ts +2414 -242
- package/components/ApplicationScope.ts +8 -0
- package/components/EntryHandler.ts +59 -39
- package/components/OptionsWatcher.ts +150 -74
- package/components/RuntimeModuleTracker.ts +38 -7
- package/components/Scope.ts +37 -15
- package/components/awaitRestart.ts +84 -0
- package/components/componentLoader.ts +340 -30
- package/components/componentPreparationLock.ts +16 -5
- package/components/mcp/adapters/harperHttp.ts +4 -0
- package/components/mcp/listChanged.ts +4 -0
- package/components/mcp/toolRegistry.ts +2 -0
- package/components/mcp/tools/operations.ts +9 -0
- package/components/mcp/tools/schemas/operationDescriptions.ts +2 -2
- package/components/operations.js +270 -78
- package/components/operationsValidation.js +49 -1
- package/components/status/ComponentStatusRegistry.ts +59 -0
- package/config/RootConfigWatcher.ts +80 -34
- package/config/configUtils.ts +291 -34
- package/config/harperConfigEnvVars.ts +170 -27
- package/config-root.schema.json +29 -0
- package/dataLayer/blobBackup.ts +160 -50
- package/dataLayer/delete.ts +6 -1
- package/dataLayer/harperBridge/ResourceBridge.ts +52 -8
- package/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
- package/dataLayer/hdbInfoController.ts +34 -1
- package/dataLayer/insert.ts +44 -1
- package/dataLayer/rocksdbBackup.ts +53 -10
- package/dataLayer/schema.ts +11 -1
- package/dataLayer/schemaDescribe.ts +8 -1
- package/dist/agent/mcpTools.js +1 -1
- package/dist/agent/mcpTools.js.map +1 -1
- package/dist/agent/session.d.ts +22 -0
- package/dist/agent/session.js +26 -15
- package/dist/agent/session.js.map +1 -1
- package/dist/bin/cliOperations.js +48 -9
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/copyDb.d.ts +12 -1
- package/dist/bin/copyDb.js +248 -60
- package/dist/bin/copyDb.js.map +1 -1
- package/dist/bin/deploySetup.d.ts +2 -0
- package/dist/bin/deploySetup.js +11 -3
- package/dist/bin/deploySetup.js.map +1 -1
- package/dist/bin/harper.js +1 -1
- package/dist/bin/harper.js.map +1 -1
- package/dist/bin/help.js +4 -1
- package/dist/bin/help.js.map +1 -1
- package/dist/bin/lite.js +4 -1
- package/dist/bin/lite.js.map +1 -1
- package/dist/bin/restart.js +54 -5
- package/dist/bin/restart.js.map +1 -1
- package/dist/bin/run.js +4 -10
- package/dist/bin/run.js.map +1 -1
- package/dist/bin/upgrade.js +4 -3
- package/dist/bin/upgrade.js.map +1 -1
- package/dist/bin/workloadIdentity.d.ts +18 -0
- package/dist/bin/workloadIdentity.js +100 -0
- package/dist/bin/workloadIdentity.js.map +1 -0
- package/dist/components/Application.d.ts +139 -16
- package/dist/components/Application.js +2215 -267
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.d.ts +8 -0
- package/dist/components/ApplicationScope.js +7 -0
- package/dist/components/ApplicationScope.js.map +1 -1
- package/dist/components/EntryHandler.js +26 -10
- package/dist/components/EntryHandler.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +1 -0
- package/dist/components/OptionsWatcher.js +141 -74
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/RuntimeModuleTracker.js +40 -6
- package/dist/components/RuntimeModuleTracker.js.map +1 -1
- package/dist/components/Scope.js +38 -13
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/awaitRestart.d.ts +33 -0
- package/dist/components/awaitRestart.js +61 -0
- package/dist/components/awaitRestart.js.map +1 -0
- package/dist/components/componentLoader.d.ts +38 -1
- package/dist/components/componentLoader.js +279 -22
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/componentPreparationLock.d.ts +5 -0
- package/dist/components/componentPreparationLock.js +14 -6
- package/dist/components/componentPreparationLock.js.map +1 -1
- package/dist/components/mcp/adapters/harperHttp.js +4 -0
- package/dist/components/mcp/adapters/harperHttp.js.map +1 -1
- package/dist/components/mcp/listChanged.js +5 -0
- package/dist/components/mcp/listChanged.js.map +1 -1
- package/dist/components/mcp/toolRegistry.d.ts +1 -0
- package/dist/components/mcp/toolRegistry.js.map +1 -1
- package/dist/components/mcp/tools/operations.d.ts +5 -0
- package/dist/components/mcp/tools/operations.js +9 -0
- package/dist/components/mcp/tools/operations.js.map +1 -1
- package/dist/components/mcp/tools/schemas/operationDescriptions.js +2 -2
- package/dist/components/mcp/tools/schemas/operationDescriptions.js.map +1 -1
- package/dist/components/operations.js +231 -77
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.js +49 -1
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/components/status/ComponentStatusRegistry.d.ts +0 -4
- package/dist/components/status/ComponentStatusRegistry.js +63 -0
- package/dist/components/status/ComponentStatusRegistry.js.map +1 -1
- package/dist/config/RootConfigWatcher.d.ts +7 -1
- package/dist/config/RootConfigWatcher.js +64 -27
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configUtils.d.ts +9 -1
- package/dist/config/configUtils.js +254 -33
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/harperConfigEnvVars.d.ts +16 -0
- package/dist/config/harperConfigEnvVars.js +162 -25
- package/dist/config/harperConfigEnvVars.js.map +1 -1
- package/dist/dataLayer/blobBackup.d.ts +49 -20
- package/dist/dataLayer/blobBackup.js +139 -50
- package/dist/dataLayer/blobBackup.js.map +1 -1
- package/dist/dataLayer/delete.js +1 -1
- package/dist/dataLayer/delete.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.d.ts +14 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.js +51 -10
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.d.ts +3 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js +3 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbMethods/DeleteAuditLogsBeforeResults.js.map +1 -1
- package/dist/dataLayer/hdbInfoController.d.ts +10 -0
- package/dist/dataLayer/hdbInfoController.js +30 -1
- package/dist/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/dataLayer/insert.d.ts +9 -1
- package/dist/dataLayer/insert.js +30 -0
- package/dist/dataLayer/insert.js.map +1 -1
- package/dist/dataLayer/rocksdbBackup.d.ts +2 -2
- package/dist/dataLayer/rocksdbBackup.js +45 -8
- package/dist/dataLayer/rocksdbBackup.js.map +1 -1
- package/dist/dataLayer/schema.js +8 -0
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.js +8 -1
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +52 -0
- package/dist/resources/DatabaseTransaction.d.ts +55 -0
- package/dist/resources/DatabaseTransaction.js +459 -45
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/LMDBTransaction.js +22 -4
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/PrimaryRocksDatabase.d.ts +1 -0
- package/dist/resources/PrimaryRocksDatabase.js +29 -0
- package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +20 -0
- package/dist/resources/RecordEncoder.js +94 -9
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/RequestTarget.d.ts +2 -0
- package/dist/resources/RequestTarget.js.map +1 -1
- package/dist/resources/Resource.js +20 -11
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +20 -1
- package/dist/resources/ResourceInterface.js.map +1 -1
- package/dist/resources/RocksIndexStore.d.ts +6 -1
- package/dist/resources/RocksIndexStore.js +24 -9
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +14 -1
- package/dist/resources/RocksTransactionLogStore.js +57 -17
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +112 -8
- package/dist/resources/Table.js +1073 -191
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/auditStore.d.ts +11 -2
- package/dist/resources/auditStore.js +325 -71
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +129 -9
- package/dist/resources/blob.js +992 -114
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/branchDatabase.d.ts +48 -0
- package/dist/resources/branchDatabase.js +892 -0
- package/dist/resources/branchDatabase.js.map +1 -0
- package/dist/resources/crdt.js +50 -12
- package/dist/resources/crdt.js.map +1 -1
- package/dist/resources/databases.d.ts +150 -0
- package/dist/resources/databases.js +1200 -239
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/defineTable.d.ts +10 -2
- package/dist/resources/defineTable.js +9 -1
- package/dist/resources/defineTable.js.map +1 -1
- package/dist/resources/graphql.d.ts +1 -1
- package/dist/resources/graphql.js +50 -15
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +1 -0
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +6 -2
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/longLivedTransactions.d.ts +71 -0
- package/dist/resources/longLivedTransactions.js +358 -0
- package/dist/resources/longLivedTransactions.js.map +1 -0
- package/dist/resources/models/backendRegistry.d.ts +26 -0
- package/dist/resources/models/backendRegistry.js +60 -2
- package/dist/resources/models/backendRegistry.js.map +1 -1
- package/dist/resources/models/bootstrap.d.ts +33 -1
- package/dist/resources/models/bootstrap.js +416 -31
- package/dist/resources/models/bootstrap.js.map +1 -1
- package/dist/resources/recordLock.d.ts +80 -0
- package/dist/resources/recordLock.js +184 -0
- package/dist/resources/recordLock.js.map +1 -0
- package/dist/resources/replayLogs.d.ts +14 -1
- package/dist/resources/replayLogs.js +152 -24
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/replayLogsGuards.d.ts +94 -7
- package/dist/resources/replayLogsGuards.js +111 -7
- package/dist/resources/replayLogsGuards.js.map +1 -1
- package/dist/resources/search.js +158 -6
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/transactionBroadcast.d.ts +1 -1
- package/dist/resources/transactionBroadcast.js +2 -2
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.js +61 -30
- package/dist/security/auth.js.map +1 -1
- package/dist/security/authn/oidc/claims.d.ts +22 -0
- package/dist/security/authn/oidc/claims.js +71 -0
- package/dist/security/authn/oidc/claims.js.map +1 -0
- package/dist/security/authn/oidc/identityToken.d.ts +27 -0
- package/dist/security/authn/oidc/identityToken.js +111 -0
- package/dist/security/authn/oidc/identityToken.js.map +1 -0
- package/dist/security/authn/oidc/jwks.d.ts +25 -0
- package/dist/security/authn/oidc/jwks.js +261 -0
- package/dist/security/authn/oidc/jwks.js.map +1 -0
- package/dist/security/authn/oidc/providers/generic.d.ts +13 -0
- package/dist/security/authn/oidc/providers/generic.js +34 -0
- package/dist/security/authn/oidc/providers/generic.js.map +1 -0
- package/dist/security/authn/oidc/providers/githubActions.d.ts +11 -0
- package/dist/security/authn/oidc/providers/githubActions.js +129 -0
- package/dist/security/authn/oidc/providers/githubActions.js.map +1 -0
- package/dist/security/authn/oidc/providers/index.d.ts +37 -0
- package/dist/security/authn/oidc/providers/index.js +24 -0
- package/dist/security/authn/oidc/providers/index.js.map +1 -0
- package/dist/security/authn/oidc/tokenExchange.d.ts +12 -0
- package/dist/security/authn/oidc/tokenExchange.js +306 -0
- package/dist/security/authn/oidc/tokenExchange.js.map +1 -0
- package/dist/security/authn/oidc/trustPolicyOperations.d.ts +49 -0
- package/dist/security/authn/oidc/trustPolicyOperations.js +358 -0
- package/dist/security/authn/oidc/trustPolicyOperations.js.map +1 -0
- package/dist/security/authn/oidc/types.d.ts +38 -0
- package/dist/security/authn/oidc/types.js +6 -0
- package/dist/security/authn/oidc/types.js.map +1 -0
- package/dist/security/certificateVerification/index.js +40 -11
- package/dist/security/certificateVerification/index.js.map +1 -1
- package/dist/security/certificateVerification/trustedIssuers.d.ts +24 -0
- package/dist/security/certificateVerification/trustedIssuers.js +79 -0
- package/dist/security/certificateVerification/trustedIssuers.js.map +1 -0
- package/dist/security/certificateVerification/types.d.ts +1 -0
- package/dist/security/credentialProvenance.d.ts +35 -0
- package/dist/security/credentialProvenance.js +51 -0
- package/dist/security/credentialProvenance.js.map +1 -0
- package/dist/security/credentialRejection.d.ts +4 -0
- package/dist/security/credentialRejection.js +24 -0
- package/dist/security/credentialRejection.js.map +1 -0
- package/dist/security/deferredAuthentication.d.ts +36 -0
- package/dist/security/deferredAuthentication.js +70 -0
- package/dist/security/deferredAuthentication.js.map +1 -0
- package/dist/security/impersonation.d.ts +21 -0
- package/dist/security/impersonation.js +108 -9
- package/dist/security/impersonation.js.map +1 -1
- package/dist/security/jsLoader.d.ts +6 -0
- package/dist/security/jsLoader.js +75 -15
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/security/keys.js +301 -71
- package/dist/security/keys.js.map +1 -1
- package/dist/security/operationScope.d.ts +21 -0
- package/dist/security/operationScope.js +36 -0
- package/dist/security/operationScope.js.map +1 -0
- package/dist/security/permissionsTranslator.js +21 -0
- package/dist/security/permissionsTranslator.js.map +1 -1
- package/dist/security/tokenAuthentication.d.ts +19 -1
- package/dist/security/tokenAuthentication.js +191 -10
- package/dist/security/tokenAuthentication.js.map +1 -1
- package/dist/security/user.js +4 -3
- package/dist/security/user.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.d.ts +2 -2
- package/dist/server/DurableSubscriptionsSession.js +67 -10
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/REST.js +73 -0
- package/dist/server/REST.js.map +1 -1
- package/dist/server/graphqlQuerying.js +4 -0
- package/dist/server/graphqlQuerying.js.map +1 -1
- package/dist/server/http.d.ts +11 -0
- package/dist/server/http.js +88 -15
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +8 -1
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/jobProcess.js +6 -2
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobs.js +4 -1
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/liveSubscriptionAuth.d.ts +26 -4
- package/dist/server/liveSubscriptionAuth.js +105 -39
- package/dist/server/liveSubscriptionAuth.js.map +1 -1
- package/dist/server/loadRootComponents.js +49 -10
- package/dist/server/loadRootComponents.js.map +1 -1
- package/dist/server/mqtt.d.ts +2 -0
- package/dist/server/mqtt.js +165 -30
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/nodeName.d.ts +2 -0
- package/dist/server/nodeName.js +107 -23
- package/dist/server/nodeName.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +25 -0
- package/dist/server/serverHelpers/Headers.js +139 -1
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +9 -0
- package/dist/server/serverHelpers/contentTypes.js +32 -25
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/deployValidationState.d.ts +3 -0
- package/dist/server/serverHelpers/deployValidationState.js +9 -19
- package/dist/server/serverHelpers/deployValidationState.js.map +1 -1
- package/dist/server/serverHelpers/operationAuthorizationState.d.ts +12 -0
- package/dist/server/serverHelpers/operationAuthorizationState.js +24 -2
- package/dist/server/serverHelpers/operationAuthorizationState.js.map +1 -1
- package/dist/server/serverHelpers/registeredOperations.d.ts +5 -4
- package/dist/server/serverHelpers/registeredOperations.js +74 -21
- package/dist/server/serverHelpers/registeredOperations.js.map +1 -1
- package/dist/server/serverHelpers/requestSanitization.d.ts +11 -0
- package/dist/server/serverHelpers/requestSanitization.js +20 -0
- package/dist/server/serverHelpers/requestSanitization.js.map +1 -0
- package/dist/server/serverHelpers/serverHandlers.js +6 -3
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +18 -0
- package/dist/server/serverHelpers/serverUtilities.js +90 -20
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/serverHelpers/sharedMessageEncoding.d.ts +67 -0
- package/dist/server/serverHelpers/sharedMessageEncoding.js +280 -0
- package/dist/server/serverHelpers/sharedMessageEncoding.js.map +1 -0
- package/dist/server/serverHelpers/uwsServer.js +19 -1
- package/dist/server/serverHelpers/uwsServer.js.map +1 -1
- package/dist/server/static.js +24 -28
- package/dist/server/static.js.map +1 -1
- package/dist/server/storageReclamation.d.ts +12 -0
- package/dist/server/storageReclamation.js +26 -0
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/itc.d.ts +7 -2
- package/dist/server/threads/itc.js +5 -1
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +26 -3
- package/dist/server/threads/manageThreads.js +517 -65
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.js +89 -26
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadHeapMemory.d.ts +2 -0
- package/dist/server/threads/threadHeapMemory.js +31 -0
- package/dist/server/threads/threadHeapMemory.js.map +1 -0
- package/dist/server/threads/threadServer.js +46 -15
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/sqlEngine/config.d.ts +1 -3
- package/dist/sqlEngine/config.js +19 -16
- package/dist/sqlEngine/config.js.map +1 -1
- package/dist/sqlTranslator/index.d.ts +1 -1
- package/dist/sqlTranslator/index.js +30 -7
- package/dist/sqlTranslator/index.js.map +1 -1
- package/dist/upgrade/directives/5-3-0.d.ts +7 -0
- package/dist/upgrade/directives/5-3-0.js +148 -0
- package/dist/upgrade/directives/5-3-0.js.map +1 -0
- package/dist/upgrade/directives/directivesController.js +2 -1
- package/dist/upgrade/directives/directivesController.js.map +1 -1
- package/dist/utility/OperationFunctionCaller.js +2 -1
- package/dist/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/utility/common_utils.d.ts +16 -0
- package/dist/utility/common_utils.js +32 -6
- package/dist/utility/common_utils.js.map +1 -1
- package/dist/utility/componentNames.d.ts +8 -0
- package/dist/utility/componentNames.js +12 -1
- package/dist/utility/componentNames.js.map +1 -1
- package/dist/utility/environment/environmentManager.js +3 -6
- package/dist/utility/environment/environmentManager.js.map +1 -1
- package/dist/utility/environment/systemInformation.d.ts +1 -0
- package/dist/utility/environment/systemInformation.js +1 -0
- package/dist/utility/environment/systemInformation.js.map +1 -1
- package/dist/utility/errors/commonErrors.d.ts +2 -0
- package/dist/utility/errors/commonErrors.js +2 -0
- package/dist/utility/errors/commonErrors.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +17 -0
- package/dist/utility/errors/hdbError.js +30 -1
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/globalSchema.d.ts +18 -0
- package/dist/utility/hdbTerms.d.ts +16 -0
- package/dist/utility/hdbTerms.js +18 -2
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +2 -0
- package/dist/utility/logging/harper_logger.js +91 -14
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logRotator.js +76 -49
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/nodeIdentity.d.ts +9 -0
- package/dist/utility/nodeIdentity.js +58 -0
- package/dist/utility/nodeIdentity.js.map +1 -0
- package/dist/utility/npmUtilities.js +9 -7
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/operationPermissions.d.ts +3 -1
- package/dist/utility/operationPermissions.js +16 -1
- package/dist/utility/operationPermissions.js.map +1 -1
- package/dist/utility/operation_authorization.d.ts +10 -7
- package/dist/utility/operation_authorization.js +212 -41
- package/dist/utility/operation_authorization.js.map +1 -1
- package/dist/utility/watchPath.d.ts +29 -0
- package/dist/utility/watchPath.js +68 -0
- package/dist/utility/watchPath.js.map +1 -0
- package/dist/utility/watcherFallback.d.ts +86 -0
- package/dist/utility/watcherFallback.js +278 -1
- package/dist/utility/watcherFallback.js.map +1 -1
- package/dist/validation/configValidator.d.ts +12 -0
- package/dist/validation/configValidator.js +199 -72
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/installValidator.js +12 -0
- package/dist/validation/installValidator.js.map +1 -1
- package/dist/validation/validationWrapper.d.ts +11 -0
- package/dist/validation/validationWrapper.js +16 -3
- package/dist/validation/validationWrapper.js.map +1 -1
- package/index.ts +2 -0
- package/json/systemSchema.json +52 -0
- package/npm-shrinkwrap.json +196 -194
- package/package.json +7 -6
- package/resources/DESIGN.md +114 -52
- package/resources/DatabaseTransaction.ts +521 -43
- package/resources/LMDBTransaction.ts +26 -4
- package/resources/PrimaryRocksDatabase.ts +28 -1
- package/resources/RecordEncoder.ts +103 -8
- package/resources/RequestTarget.ts +2 -0
- package/resources/Resource.ts +17 -9
- package/resources/ResourceInterface.ts +23 -0
- package/resources/RocksIndexStore.ts +30 -9
- package/resources/RocksTransactionLogStore.ts +78 -21
- package/resources/Table.ts +1110 -159
- package/resources/auditStore.ts +331 -73
- package/resources/blob.ts +1029 -110
- package/resources/branchDatabase.ts +941 -0
- package/resources/crdt.ts +76 -12
- package/resources/databases.ts +1310 -252
- package/resources/defineTable.ts +18 -2
- package/resources/graphql.ts +70 -16
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +6 -2
- package/resources/longLivedTransactions.ts +360 -0
- package/resources/models/backendRegistry.ts +84 -2
- package/resources/models/bootstrap.ts +473 -28
- package/resources/recordLock.ts +253 -0
- package/resources/replayLogs.ts +147 -26
- package/resources/replayLogsGuards.ts +171 -8
- package/resources/search.ts +154 -7
- package/resources/transactionBroadcast.ts +3 -3
- package/security/auth.ts +68 -29
- package/security/authn/oidc/claims.ts +72 -0
- package/security/authn/oidc/identityToken.ts +129 -0
- package/security/authn/oidc/jwks.ts +260 -0
- package/security/authn/oidc/providers/generic.ts +40 -0
- package/security/authn/oidc/providers/githubActions.ts +137 -0
- package/security/authn/oidc/providers/index.ts +52 -0
- package/security/authn/oidc/tokenExchange.ts +300 -0
- package/security/authn/oidc/trustPolicyOperations.ts +343 -0
- package/security/authn/oidc/types.ts +41 -0
- package/security/certificateVerification/index.ts +54 -13
- package/security/certificateVerification/trustedIssuers.ts +76 -0
- package/security/certificateVerification/types.ts +1 -0
- package/security/credentialProvenance.ts +47 -0
- package/security/credentialRejection.ts +22 -0
- package/security/deferredAuthentication.ts +71 -0
- package/security/impersonation.ts +117 -12
- package/security/jsLoader.ts +81 -18
- package/security/keys.ts +298 -72
- package/security/operationScope.ts +33 -0
- package/security/permissionsTranslator.js +23 -0
- package/security/tokenAuthentication.ts +233 -12
- package/security/user.ts +4 -3
- package/server/DESIGN.md +183 -16
- package/server/DurableSubscriptionsSession.ts +71 -11
- package/server/REST.ts +79 -1
- package/server/graphqlQuerying.ts +4 -0
- package/server/http.ts +99 -18
- package/server/itc/serverHandlers.js +8 -1
- package/server/jobs/jobProcess.ts +8 -2
- package/server/jobs/jobs.ts +4 -1
- package/server/liveSubscriptionAuth.ts +129 -46
- package/server/loadRootComponents.js +50 -8
- package/server/mqtt.ts +179 -38
- package/server/nodeName.ts +103 -21
- package/server/serverHelpers/Headers.ts +131 -0
- package/server/serverHelpers/contentTypes.ts +29 -21
- package/server/serverHelpers/deployValidationState.ts +24 -13
- package/server/serverHelpers/operationAuthorizationState.ts +34 -3
- package/server/serverHelpers/registeredOperations.ts +79 -22
- package/server/serverHelpers/requestSanitization.ts +15 -0
- package/server/serverHelpers/serverHandlers.js +6 -3
- package/server/serverHelpers/serverUtilities.ts +104 -31
- package/server/serverHelpers/sharedMessageEncoding.ts +307 -0
- package/server/serverHelpers/uwsServer.ts +17 -2
- package/server/static.ts +23 -29
- package/server/storageReclamation.ts +23 -0
- package/server/threads/itc.js +11 -1
- package/server/threads/manageThreads.js +526 -56
- package/server/threads/socketRouter.ts +81 -26
- package/server/threads/threadHeapMemory.ts +26 -0
- package/server/threads/threadServer.js +43 -15
- package/sqlTranslator/index.ts +31 -8
- package/studio/web/assets/Chat-BnCBegQz.js +2267 -0
- package/studio/web/assets/FloatingChat-CoDW1ySS.js +23 -0
- package/studio/web/assets/{abnfDiagram-VCTEODGH-C0_BAZyO.js → abnfDiagram-VCTEODGH-B0BebmD2.js} +1 -1
- package/studio/web/assets/{alertDialog-DIHt7Z0r.js → alertDialog-CQyAJJhl.js} +1 -1
- package/studio/web/assets/{apiToken-c3Rd-w6g.js → apiToken-Bwk5BLXW.js} +1 -1
- package/studio/web/assets/applications-DHxGi7JH.js +296 -0
- package/studio/web/assets/architecture-7GRP2DOG-LB-MLAAb.js +1 -0
- package/studio/web/assets/{architectureDiagram-5GKGNRK7-BWzrASgm.js → architectureDiagram-5GKGNRK7-7SW3GD-K.js} +1 -1
- package/studio/web/assets/authStore-C3Nfubqr.js +3 -0
- package/studio/web/assets/{blockDiagram-NRAW4CY4-BdJX9Khj.js → blockDiagram-I7D4REHJ-BqguiadH.js} +2 -2
- package/studio/web/assets/{button-DhiX-njv.js → button-BIsUKRZq.js} +2 -2
- package/studio/web/assets/{c4Diagram-UCG6FXSJ-CI6MzGmQ.js → c4Diagram-7LVT6UL2-LBNf8t_X.js} +1 -1
- package/studio/web/assets/channel-yictG-U-.js +1 -0
- package/studio/web/assets/{chevron-up-Df2c8uoU.js → chevron-up-DtKGqDn3.js} +1 -1
- package/studio/web/assets/{chunk-TEH6E4GO-P87k5mNi.js → chunk-4HAMMTFA-DWtTut21.js} +1 -1
- package/studio/web/assets/{chunk-75Z2AOVW-BT8tVmks.js → chunk-75Z2AOVW-QGQD6th2.js} +1 -1
- package/studio/web/assets/{chunk-DU6HZSFF-9kAOOmI6.js → chunk-DU6HZSFF-Chq20Ba5.js} +1 -1
- package/studio/web/assets/{chunk-F27PBJKO-BW7ao8AY.js → chunk-F27PBJKO-BVA5EPhV.js} +1 -1
- package/studio/web/assets/{chunk-GMAD6QVW-BNyXpoQO.js → chunk-GMAD6QVW-BeS7S07A.js} +1 -1
- package/studio/web/assets/{chunk-OBVCFTLP-D4wWOqDQ.js → chunk-GVQU2GXP-sbwVIQ8i.js} +1 -1
- package/studio/web/assets/{chunk-G27WJ6UU-COyLMcgK.js → chunk-IMKFNOWR-Bnh3tAVd.js} +1 -1
- package/studio/web/assets/{chunk-JQ64N6SF-Cyz1IeLf.js → chunk-L3NEJ4N5-COfUyKII.js} +1 -1
- package/studio/web/assets/chunk-OSK3NFVY-ByciRftO.js +10 -0
- package/studio/web/assets/{chunk-P2QGCYS3-DmIFY4d7.js → chunk-P2QGCYS3-CP1VhG_c.js} +1 -1
- package/studio/web/assets/{chunk-POPQ4Y6H-BPrvMyKz.js → chunk-POPQ4Y6H-ClWhhkwW.js} +1 -1
- package/studio/web/assets/{chunk-PWAF6VOD-2zB6IW9i.js → chunk-PWAF6VOD-1z1THyS5.js} +1 -1
- package/studio/web/assets/{chunk-RHFEMEQ7-2FgyI8YU.js → chunk-SHT3W25Y-LpQkMsah.js} +2 -2
- package/studio/web/assets/{chunk-SVP7TREG-FwtbH2QC.js → chunk-SVP7TREG-jtdAHw0S.js} +1 -1
- package/studio/web/assets/{chunk-LCL6LL3I-HOzK_ppE.js → chunk-TICWLB2K-VOwzetX-.js} +1 -1
- package/studio/web/assets/classDiagram-ZZMXUADV-VaEwSy_g.js +1 -0
- package/studio/web/assets/classDiagram-v2-VYDZK3BY-VaEwSy_g.js +1 -0
- package/studio/web/assets/{createLucideIcon-BKGPfjm2.js → createLucideIcon-CzW9508A.js} +1 -1
- package/studio/web/assets/{cssMode-CEN2mzSA.js → cssMode-s0cWI-_M.js} +1 -1
- package/studio/web/assets/{cynefin-OW5HDTMX-BRkpLFQV.js → cynefin-OW5HDTMX-BbdbCvub.js} +1 -1
- package/studio/web/assets/{cynefinDiagram-5FMLGOSQ-CHT1DaX6.js → cynefinDiagram-5FMLGOSQ-TP-aIqbt.js} +1 -1
- package/studio/web/assets/{dagre-3AP2YEHR-DpUXBh63.js → dagre-GXQ25YYZ-DShnGpGo.js} +1 -1
- package/studio/web/assets/{diagram-S7CK7UJ4-BuymVFZT.js → diagram-S7CK7UJ4-aoCVTtcy.js} +1 -1
- package/studio/web/assets/{diagram-UQ7AKVKN-CyP148RM.js → diagram-UQ7AKVKN-DglXtQ6x.js} +1 -1
- package/studio/web/assets/{diagram-VSXAHHWV-CoCAg3M9.js → diagram-VSXAHHWV-fhEdmkwM.js} +1 -1
- package/studio/web/assets/{diagram-VX7I27RA-BpOqCFca.js → diagram-VX7I27RA-DccVJet6.js} +1 -1
- package/studio/web/assets/{diagram-Z3DM3KII-Bfpw7Vbj.js → diagram-Z3DM3KII-D-RyJJb7.js} +1 -1
- package/studio/web/assets/{dialog-CBf0Mr1d.js → dialog-Cn2uWgD4.js} +1 -1
- package/studio/web/assets/{dist-lkA3O3eM.js → dist-DP8UjMB_.js} +1 -1
- package/studio/web/assets/{download-BtTOBem-.js → download-B5T5r7ss.js} +1 -1
- package/studio/web/assets/{ebnfDiagram-PWID7BFC-DS_6aWqL.js → ebnfDiagram-PWID7BFC-DJGpIpz_.js} +1 -1
- package/studio/web/assets/{editor-D8oDeCTL.js → editor-DNcRHK54.js} +1 -1
- package/studio/web/assets/{erDiagram-SSCWMZ5O-DJNk6Fgw.js → erDiagram-RLTQ6QDP-CIfNlgkC.js} +1 -1
- package/studio/web/assets/eventmodeling-NTZA5JFV-CLxnp2CR.js +1 -0
- package/studio/web/assets/flowDiagram-HODETNUW-BIbhmz9f.js +1 -0
- package/studio/web/assets/{ganttDiagram-EL5Y4UJY-2pOExxMY.js → ganttDiagram-EL5Y4UJY-BxToTzzD.js} +1 -1
- package/studio/web/assets/{getAnalytics-D4LKGeVy.js → getAnalytics-GHK8ORfM.js} +1 -1
- package/studio/web/assets/{gitGraph-4MIJSDKK-CH5ZxwzF.js → gitGraph-4MIJSDKK-D2s2w8lE.js} +1 -1
- package/studio/web/assets/{gitGraphDiagram-WWUBYQGX-DVIsIhbO.js → gitGraphDiagram-WWUBYQGX-Dwntd4-x.js} +1 -1
- package/studio/web/assets/{html-u3vOg7LJ.js → html-Bdssedlg.js} +1 -1
- package/studio/web/assets/{htmlMode-DyO31v-P.js → htmlMode-CoDlJ3fw.js} +1 -1
- package/studio/web/assets/{index-Cxj2_wsl.css → index-7RMEgVG1.css} +1 -1
- package/studio/web/assets/index-D6sxmFLR.js +824 -0
- package/studio/web/assets/index.lazy-tmU5BS8s.js +2 -0
- package/studio/web/assets/{info-A6RAGUB7-CPQfTnaG.js → info-A6RAGUB7-DYjkvb0C.js} +1 -1
- package/studio/web/assets/{infoDiagram-RXCK75RN-DlwLYlwm.js → infoDiagram-27XIBGKW-Bnp1FJE5.js} +1 -1
- package/studio/web/assets/{ishikawaDiagram-5VMMS53U-BRXRp29U.js → ishikawaDiagram-5VMMS53U-D9Xh2r6X.js} +1 -1
- package/studio/web/assets/{javascript-CUvxOyTC.js → javascript-B8meVSTH.js} +1 -1
- package/studio/web/assets/{journeyDiagram-EYS64GPL-B0ou8k0n.js → journeyDiagram-3NMN7TZE-CokIi6ll.js} +2 -2
- package/studio/web/assets/{jsonMode-f_IwbF3D.js → jsonMode-DpIPd35T.js} +1 -1
- package/studio/web/assets/{kanban-definition-3QL26DDD-uYg7iYzp.js → kanban-definition-UXKFOSKX-CukSFJfX.js} +1 -1
- package/studio/web/assets/{languageServices-DXtZ6rEF.js → languageServices-C_5FMJzQ.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-B4pCF1zO.js → lspLanguageFeatures-BIzNBzPK.js} +1 -1
- package/studio/web/assets/{mermaid-parser.core-Ck-fC8b7.js → mermaid-parser.core-BlEsOWNO.js} +3 -3
- package/studio/web/assets/{mermaid.core-CP8aNNYm.js → mermaid.core-BlkGaMIH.js} +5 -5
- package/studio/web/assets/{mindmap-definition-FBJOCRG2-CgTZ-rit.js → mindmap-definition-YA3MSWOX-IprMc_0j.js} +1 -1
- package/studio/web/assets/{notifications-D3tIQ4sg.js → notifications-CQf18QKb.js} +1 -1
- package/studio/web/assets/notifications-CvZivSbh.js +1 -0
- package/studio/web/assets/{packet-AYTQ26CC-DEyoPtPb.js → packet-AYTQ26CC-Bi3V04Zi.js} +1 -1
- package/studio/web/assets/{pegDiagram-XKGWAZYB-DrD-7sD9.js → pegDiagram-XKGWAZYB-BNuPDLZY.js} +1 -1
- package/studio/web/assets/{pie-WAS4IAKB-wjj-EI1d.js → pie-WAS4IAKB-_6DoDbng.js} +1 -1
- package/studio/web/assets/{pieDiagram-E7YTZNPT-GntqDCzv.js → pieDiagram-E7YTZNPT-DqNb6Ht2.js} +1 -1
- package/studio/web/assets/{profile-DZWU7MgT.js → profile-DdOwtntb.js} +1 -1
- package/studio/web/assets/{quadrantDiagram-AXDQQJYC-0UeqXQGd.js → quadrantDiagram-AXDQQJYC-BGH9E2YR.js} +1 -1
- package/studio/web/assets/{radar-RG4KPBEZ-DFSA5h7k.js → radar-RG4KPBEZ-DDdVczcL.js} +1 -1
- package/studio/web/assets/{railroad-74A4TZTK-CaOUG9wR.js → railroad-74A4TZTK-BJUP4Jds.js} +1 -1
- package/studio/web/assets/railroad-abnf-HS5TGJTU-Bm3L1L0h.js +1 -0
- package/studio/web/assets/railroad-ebnf-LZEXJU2U-CKzLGlkw.js +1 -0
- package/studio/web/assets/railroad-peg-WCYAUIDC-S8xLjslx.js +1 -0
- package/studio/web/assets/{railroadDiagram-O6MQD6OU-yHUELZaV.js → railroadDiagram-O6MQD6OU-DGTPh2KZ.js} +1 -1
- package/studio/web/assets/{regions-CkyurXzE.js → regions-n69fwagr.js} +1 -1
- package/studio/web/assets/{register-BUyhWjBO.js → register-PfWTCXWB.js} +3 -3
- package/studio/web/assets/{requirementDiagram-EFPCY7ZU-DNEGFjuW.js → requirementDiagram-BXWQKSXE-BJnO6uLz.js} +1 -1
- package/studio/web/assets/{sankeyDiagram-P5KCCOFB-DpyAmSVR.js → sankeyDiagram-P5KCCOFB-0vSOdymH.js} +1 -1
- package/studio/web/assets/{sequenceDiagram-WJ2MYXX4-TyaT7xNk.js → sequenceDiagram-WJ2MYXX4-hETizDWE.js} +1 -1
- package/studio/web/assets/{setComponentFile-CeyKSZAa.js → setComponentFile-Bg6O7X0S.js} +1 -1
- package/studio/web/assets/{setup-D2kn7cAA.js → setup-CUx_aUDl.js} +2 -2
- package/studio/web/assets/{stateDiagram-HBIQ2CUA-CeEdTArZ.js → stateDiagram-D77RDMKH-CdYQ_KtC.js} +1 -1
- package/studio/web/assets/stateDiagram-v2-MP3YSRHH-CdKuzQMT.js +1 -0
- package/studio/web/assets/status-D7BVKqX9.js +61 -0
- package/studio/web/assets/{swimlanes-XN3QIQJK-B54FmF46.js → swimlanes-42K2YHIH-B8cHIpU4.js} +1 -1
- package/studio/web/assets/swimlanesDiagram-VR7AAH4N-DmOSJwaH.js +8 -0
- package/studio/web/assets/{tabs-B_G5zscN.js → tabs-BrHu7gJi.js} +1 -1
- package/studio/web/assets/{timeline-definition-24CTP7MA-D-a9ujbo.js → timeline-definition-24CTP7MA-BJWYSXqF.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-C0UW6rI2.js → toggleHighContrast-DBSyXzMr.js} +1 -1
- package/studio/web/assets/{treeView-Q6P3EWNA-CrW_6JnS.js → treeView-Q6P3EWNA-qxe_v6CQ.js} +1 -1
- package/studio/web/assets/{treemap-WGGIJYW6-BxyYLdP_.js → treemap-WGGIJYW6-dDo97XXF.js} +1 -1
- package/studio/web/assets/{tsMode-DBC0zmDx.js → tsMode-BByKCjBS.js} +1 -1
- package/studio/web/assets/{typescript-DApRQir3.js → typescript-DDLnLpw9.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-DB6JStU1.js → useEntityRestURL-31CHGaHk.js} +1 -1
- package/studio/web/assets/{useLocalStorage-Dtj1QS8_.js → useLocalStorage-BqMR3D8_.js} +1 -1
- package/studio/web/assets/vendor-core-c2JRRJpV.js +58 -0
- package/studio/web/assets/vendor-datadog-CLUcJXOo.js +6 -0
- package/studio/web/assets/{vendor-react-Dyj4O3HE.js → vendor-react-CJV_K1u4.js} +1 -1
- package/studio/web/assets/vendor-tanstack-DxzraizX.js +1 -0
- package/studio/web/assets/{vendor-ui-vhu-UHhF.js → vendor-ui-BUjK0h8a.js} +2 -2
- package/studio/web/assets/{vennDiagram-4TSXK5OY-Cy7s7Mpy.js → vennDiagram-4TSXK5OY-A3i-lCdl.js} +1 -1
- package/studio/web/assets/{wardley-WFR3VGLG-BeBL35g2.js → wardley-WFR3VGLG-B0ik-_6g.js} +1 -1
- package/studio/web/assets/{wardleyDiagram-VM6X3IG4-BylmIGSg.js → wardleyDiagram-VM6X3IG4-CjrkKWUR.js} +1 -1
- package/studio/web/assets/{workers-C0bFIedw.js → workers-pR3jRY9D.js} +1 -1
- package/studio/web/assets/x-DIzaLEdK.js +1 -0
- package/studio/web/assets/{xml-HWd01lU-.js → xml-2iRnMhQO.js} +1 -1
- package/studio/web/assets/{xychartDiagram-S5SC5T6Z-CoKALMXr.js → xychartDiagram-S5SC5T6Z-Biok4GYV.js} +1 -1
- package/studio/web/assets/{yaml-CIH0Nt-h.js → yaml-Bf92gJpd.js} +1 -1
- package/studio/web/index.html +14 -14
- package/upgrade/directives/5-3-0.ts +132 -0
- package/upgrade/directives/directivesController.ts +2 -1
- package/utility/OperationFunctionCaller.ts +2 -1
- package/utility/common_utils.ts +30 -5
- package/utility/componentNames.ts +12 -0
- package/utility/environment/environmentManager.ts +3 -7
- package/utility/environment/systemInformation.ts +7 -0
- package/utility/errors/commonErrors.ts +4 -0
- package/utility/errors/hdbError.ts +29 -0
- package/utility/hdbTerms.ts +17 -0
- package/utility/logging/harper_logger.ts +87 -14
- package/utility/logging/logRotator.ts +72 -45
- package/utility/nodeIdentity.ts +45 -0
- package/utility/npmUtilities.ts +10 -8
- package/utility/operationPermissions.ts +18 -1
- package/utility/operation_authorization.ts +231 -42
- package/utility/watchPath.ts +63 -0
- package/utility/watcherFallback.ts +270 -0
- package/validation/configValidator.ts +209 -72
- package/validation/installValidator.ts +15 -0
- package/validation/validationWrapper.ts +18 -4
- package/studio/web/assets/Chat-JpO8EtUu.js +0 -2067
- package/studio/web/assets/FloatingChat-Bcj3xSZu.js +0 -23
- package/studio/web/assets/applications-ByqLRKyZ.js +0 -296
- package/studio/web/assets/architecture-7GRP2DOG-DNdx5tEU.js +0 -1
- package/studio/web/assets/authStore-qKmCZcaf.js +0 -3
- package/studio/web/assets/channel-DtCV8PTL.js +0 -1
- package/studio/web/assets/chunk-R7TYR2AO-Irip67yr.js +0 -10
- package/studio/web/assets/classDiagram-DTDB5LWJ-DbO_dCNE.js +0 -1
- package/studio/web/assets/classDiagram-v2-JRS7N3AN-DbO_dCNE.js +0 -1
- package/studio/web/assets/eventmodeling-NTZA5JFV-5jbe4A5P.js +0 -1
- package/studio/web/assets/flowDiagram-A5DVABFB-Dp9Ezlow.js +0 -1
- package/studio/web/assets/index-aSt5tY-L.js +0 -824
- package/studio/web/assets/index.lazy-B9jiPwT8.js +0 -2
- package/studio/web/assets/notifications-CUoYgU98.js +0 -1
- package/studio/web/assets/railroad-abnf-HS5TGJTU-Bc0Qi0WH.js +0 -1
- package/studio/web/assets/railroad-ebnf-LZEXJU2U-G8rVVZ2C.js +0 -1
- package/studio/web/assets/railroad-peg-WCYAUIDC-CrehKBhC.js +0 -1
- package/studio/web/assets/stateDiagram-v2-4QOOHH4V-D4tuw9Su.js +0 -1
- package/studio/web/assets/status-D7Xn5ePA.js +0 -61
- package/studio/web/assets/swimlanesDiagram-VK2B7HYN-XOhmNEvq.js +0 -8
- package/studio/web/assets/vendor-core-RCcadM3e.js +0 -73
- package/studio/web/assets/vendor-datadog-BRv-mOv1.js +0 -6
- package/studio/web/assets/vendor-tanstack-BiFWSB3W.js +0 -1
- package/studio/web/assets/x-B9o9hsep.js +0 -1
- /package/studio/web/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -23,6 +23,7 @@ export interface ComponentPreparationLockOwner {
|
|
|
23
23
|
processInstanceId: string;
|
|
24
24
|
token: string;
|
|
25
25
|
ticket?: number;
|
|
26
|
+
purpose?: string;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface ComponentPreparationLockOptions {
|
|
@@ -30,8 +31,12 @@ export interface ComponentPreparationLockOptions {
|
|
|
30
31
|
onWait?: (owner: ComponentPreparationLockOwner | null) => void;
|
|
31
32
|
onReleaseError?: (error: unknown) => void;
|
|
32
33
|
isOwnerAlive?: (owner: ComponentPreparationLockOwner) => boolean | Promise<boolean>;
|
|
34
|
+
purpose?: string;
|
|
35
|
+
renewTimeoutWhileOwnerAlive?: boolean | ((owner: ComponentPreparationLockOwner) => boolean | Promise<boolean>);
|
|
33
36
|
}
|
|
34
37
|
|
|
38
|
+
export class ComponentPreparationLockTimeoutError extends Error {}
|
|
39
|
+
|
|
35
40
|
export function componentPreparationLockIdentity(
|
|
36
41
|
componentDirPath: string,
|
|
37
42
|
platform: NodeJS.Platform = process.platform
|
|
@@ -244,10 +249,12 @@ async function acquireComponentPreparationLock(
|
|
|
244
249
|
threadId,
|
|
245
250
|
processInstanceId: COMPONENT_PREPARATION_PROCESS_INSTANCE_ID,
|
|
246
251
|
token: randomUUID(),
|
|
252
|
+
purpose: options.purpose,
|
|
247
253
|
};
|
|
248
254
|
const choosingPath = join(lockRoot, `${lockName}.choosing.${owner.token}.json`);
|
|
249
255
|
let ticketPath: string | undefined;
|
|
250
256
|
const timeoutMs = options.timeoutMs ?? DEFAULT_LOCK_WAIT_TIMEOUT_MS;
|
|
257
|
+
const renewTimeoutWhileOwnerAlive = options.renewTimeoutWhileOwnerAlive ?? timeoutMs > 0;
|
|
251
258
|
let deadline = performance.now() + timeoutMs;
|
|
252
259
|
|
|
253
260
|
await mkdir(lockRoot, { recursive: true, mode: 0o700 });
|
|
@@ -264,7 +271,7 @@ async function acquireComponentPreparationLock(
|
|
|
264
271
|
await rm(choosingPath, { force: true }).catch(() => {});
|
|
265
272
|
}
|
|
266
273
|
|
|
267
|
-
let
|
|
274
|
+
let waitingReportedForToken: string | undefined;
|
|
268
275
|
try {
|
|
269
276
|
for (;;) {
|
|
270
277
|
const claims = await scanLiveClaims(lockRoot, lockName, options, owner.token);
|
|
@@ -276,17 +283,21 @@ async function acquireComponentPreparationLock(
|
|
|
276
283
|
})[0];
|
|
277
284
|
const blocker = claims.choosing[0] ?? precedingTicket;
|
|
278
285
|
if (!blocker) break;
|
|
279
|
-
if (
|
|
280
|
-
|
|
286
|
+
if (waitingReportedForToken !== blocker.token) {
|
|
287
|
+
waitingReportedForToken = blocker.token;
|
|
281
288
|
options.onWait?.(blocker);
|
|
282
289
|
}
|
|
283
290
|
if (performance.now() >= deadline) {
|
|
284
|
-
|
|
291
|
+
const renewForOwner =
|
|
292
|
+
typeof renewTimeoutWhileOwnerAlive === 'function'
|
|
293
|
+
? await renewTimeoutWhileOwnerAlive(blocker)
|
|
294
|
+
: renewTimeoutWhileOwnerAlive;
|
|
295
|
+
if (renewForOwner && (await ownerLivenessConfirmed(blocker, options))) {
|
|
285
296
|
// A confirmed-live holder is allowed to finish; the deadline only bounds owners whose
|
|
286
297
|
// liveness cannot be positively established.
|
|
287
298
|
deadline = performance.now() + timeoutMs;
|
|
288
299
|
} else {
|
|
289
|
-
throw new
|
|
300
|
+
throw new ComponentPreparationLockTimeoutError(
|
|
290
301
|
`Timed out waiting for component preparation lock for ${canonicalPath}` +
|
|
291
302
|
` held by process ${blocker.pid}, thread ${blocker.threadId}`
|
|
292
303
|
);
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* automatically and pipes the iterable to the wire.
|
|
13
13
|
*/
|
|
14
14
|
import { handleMcpRequest, type McpProfile, type NormRequest, type NormResponse } from '../transport.ts';
|
|
15
|
+
import { settleDeferredCredentialRejection } from '../../../security/deferredAuthentication.ts';
|
|
15
16
|
import { toSseStream, type SseFrameSource } from '../sse.ts';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -56,6 +57,9 @@ export function createHarperHttpHandler(profile: McpProfile) {
|
|
|
56
57
|
// WebSocket upgrades aren't ours — let the next handler take it.
|
|
57
58
|
if (request.isWebSocket) return nextHandler(request);
|
|
58
59
|
|
|
60
|
+
const settledCredentialRejection = settleDeferredCredentialRejection(request);
|
|
61
|
+
if (settledCredentialRejection) return settledCredentialRejection;
|
|
62
|
+
|
|
59
63
|
const norm: NormRequest = {
|
|
60
64
|
method: request.method,
|
|
61
65
|
headers: normalizeHeaders(request.headers),
|
|
@@ -215,6 +215,10 @@ function snapshotSessions(profile: McpProfile): RegisteredSession[] {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
async function refreshSessionUser(record: RegisteredSession): Promise<void> {
|
|
218
|
+
// A scoped token's username is attribution only — re-resolving it against hdb_user could
|
|
219
|
+
// substitute a real principal (created later with that name) and advertise a surface the token
|
|
220
|
+
// never granted. Its embedded role is fixed for the token's life, so there is nothing to refresh.
|
|
221
|
+
if (record.user?._scopedToken) return;
|
|
218
222
|
const fresh = await resolveUser(record.user?.username);
|
|
219
223
|
if (fresh) record.user = fresh;
|
|
220
224
|
}
|
|
@@ -60,6 +60,8 @@ export interface ToolDescriptor {
|
|
|
60
60
|
/** Authenticated user object as Harper builds it (subset we touch). */
|
|
61
61
|
export interface AuthedUser {
|
|
62
62
|
username?: string;
|
|
63
|
+
// Attribution-only principal that must not be re-resolved against hdb_user (see refreshSessionUser).
|
|
64
|
+
_scopedToken?: boolean;
|
|
63
65
|
role?: {
|
|
64
66
|
role?: string;
|
|
65
67
|
permission?: {
|
|
@@ -144,6 +144,11 @@ export const DEFAULT_ALLOW: readonly string[] = [
|
|
|
144
144
|
* `mcp.operations.allow` (an explicit allow list replaces the default and is
|
|
145
145
|
* not filtered by this set), where the audit-log redaction of
|
|
146
146
|
* `value`/`values`/`envelope` applies.
|
|
147
|
+
*
|
|
148
|
+
* OIDC trust policies (#2171) are excluded on the same grounds and then some: a
|
|
149
|
+
* policy grants an external CI workflow the right to authenticate as a Harper
|
|
150
|
+
* user, so reading the set tells an attacker exactly which repository and
|
|
151
|
+
* workflow to compromise, and writing one is a way to grant itself access.
|
|
147
152
|
*/
|
|
148
153
|
export const DEFAULT_EXCLUDED: ReadonlySet<string> = new Set([
|
|
149
154
|
'set_secret',
|
|
@@ -152,6 +157,10 @@ export const DEFAULT_EXCLUDED: ReadonlySet<string> = new Set([
|
|
|
152
157
|
'list_secrets',
|
|
153
158
|
'delete_secret',
|
|
154
159
|
'get_secrets_public_key',
|
|
160
|
+
'add_oidc_trust',
|
|
161
|
+
'list_oidc_trust',
|
|
162
|
+
'drop_oidc_trust',
|
|
163
|
+
'exchange_oidc_token',
|
|
155
164
|
]);
|
|
156
165
|
|
|
157
166
|
/**
|
|
@@ -195,9 +195,9 @@ export const OPERATION_DESCRIPTIONS: Record<string, string> = {
|
|
|
195
195
|
// drop_role: security/role.ts:126 — Delete a role; refuses if assigned.
|
|
196
196
|
drop_role:
|
|
197
197
|
'Deletes a role. Refused if any active user is still assigned to the role — drop or reassign those users first.',
|
|
198
|
-
// create_authentication_tokens: security/tokenAuthentication.ts:108 — Mint operation + refresh token pair,
|
|
198
|
+
// create_authentication_tokens: security/tokenAuthentication.ts:108 — Mint operation + refresh token pair, (purpose: 'login') a login-exchange token, or (role object) a scoped token.
|
|
199
199
|
create_authentication_tokens:
|
|
200
|
-
"Creates a JWT operation token and a refresh token after validating credentials. Stores the refresh token on the user record. With purpose: 'login', instead mints a single short-lived login-exchange token (not usable as a Bearer API credential) intended for the `login` operation.",
|
|
200
|
+
"Creates a JWT operation token and a refresh token after validating credentials. Stores the refresh token on the user record. With purpose: 'login', instead mints a single short-lived login-exchange token (not usable as a Bearer API credential) intended for the `login` operation. With `role` as an inline role object (e.g. { permission: { operations: ['read_only'] } }), instead mints a single scoped token whose bearer is limited to the embedded permissions — requires a super_user caller; `username` is attribution only and must NOT name an existing user (defaults to 'scoped:<minter>'); no refresh token is issued and the token cannot be revoked before expiry. The operations allowlist gates the operations API (including sql); application/REST endpoints are governed by the embedded table permissions, so make those restrictive too.",
|
|
201
201
|
// refresh_operation_token: security/tokenAuthentication.ts:171 — Mint new operation token from refresh.
|
|
202
202
|
refresh_operation_token:
|
|
203
203
|
'Issues a new operation token using a valid refresh token, without re-authenticating with username/password.',
|
package/components/operations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('node:path');
|
|
4
|
-
const { isMainThread } = require('node:worker_threads');
|
|
4
|
+
const { isMainThread, parentPort } = require('node:worker_threads');
|
|
5
5
|
const fs = require('fs-extra');
|
|
6
6
|
const fg = require('fast-glob');
|
|
7
7
|
const normalize = require('normalize-path');
|
|
@@ -29,8 +29,14 @@ const {
|
|
|
29
29
|
streamPackagedDirectory,
|
|
30
30
|
} = require('../components/packageComponent.ts');
|
|
31
31
|
const { Resources } = require('../resources/Resources.ts');
|
|
32
|
-
const {
|
|
33
|
-
|
|
32
|
+
const {
|
|
33
|
+
Application,
|
|
34
|
+
prepareApplication,
|
|
35
|
+
ASIDE_STAGING_DIR,
|
|
36
|
+
DEPLOY_STAGING_DIR,
|
|
37
|
+
dropComponentDirectory,
|
|
38
|
+
} = require('./Application.ts');
|
|
39
|
+
const { COMPONENT_PREPARATION_LOCK_DIR, withComponentPreparationLock } = require('./componentPreparationLock.ts');
|
|
34
40
|
const { server } = require('../server/Server.ts');
|
|
35
41
|
const {
|
|
36
42
|
DeploymentRecorder,
|
|
@@ -41,6 +47,21 @@ const {
|
|
|
41
47
|
} = require('./deploymentRecorder.ts');
|
|
42
48
|
const { ProgressEmitter } = require('../server/serverHelpers/progressEmitter.ts');
|
|
43
49
|
|
|
50
|
+
const DROP_COMPONENT_LOCK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
51
|
+
|
|
52
|
+
function componentDropLockOptions(project) {
|
|
53
|
+
return {
|
|
54
|
+
timeoutMs: DROP_COMPONENT_LOCK_TIMEOUT_MS,
|
|
55
|
+
onWait: (owner) =>
|
|
56
|
+
log.info(
|
|
57
|
+
`Waiting to drop ${project} while component preparation is in progress` +
|
|
58
|
+
(owner ? ` in process ${owner.pid}, thread ${owner.threadId}` : '')
|
|
59
|
+
),
|
|
60
|
+
onReleaseError: (error) => log.error(`Failed to release the component preparation lock for ${project}:`, error),
|
|
61
|
+
isOwnerAlive: (owner) => owner.pid !== process.pid || manageThreads.isThreadRunning(owner.threadId),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
44
65
|
/**
|
|
45
66
|
* Read the settings.js file and return the
|
|
46
67
|
*
|
|
@@ -238,14 +259,12 @@ async function addComponent(req) {
|
|
|
238
259
|
}
|
|
239
260
|
|
|
240
261
|
log.trace(`adding component`);
|
|
241
|
-
const cfDir = configUtils.getConfigPath(hdbTerms.CONFIG_PARAMS.COMPONENTSROOT);
|
|
242
262
|
const { project, install_command, install_timeout, install_allow_scripts } = req;
|
|
243
263
|
|
|
244
264
|
const template = req.template || 'https://github.com/harperdb/application-template';
|
|
245
265
|
|
|
246
266
|
try {
|
|
247
|
-
|
|
248
|
-
fs.mkdirSync(projectDir, { recursive: true });
|
|
267
|
+
await fs.mkdir(configUtils.getConfigPath(hdbTerms.CONFIG_PARAMS.COMPONENTSROOT), { recursive: true });
|
|
249
268
|
const application = new Application({
|
|
250
269
|
name: project,
|
|
251
270
|
packageIdentifier: template,
|
|
@@ -310,8 +329,16 @@ async function dropCustomFunctionProject(req) {
|
|
|
310
329
|
|
|
311
330
|
try {
|
|
312
331
|
const projectDir = path.join(cfDir, project);
|
|
313
|
-
|
|
314
|
-
|
|
332
|
+
const stagingDir = path.join(cfDir, ASIDE_STAGING_DIR, project);
|
|
333
|
+
if (!(await fs.pathExists(projectDir)) && !(await fs.pathExists(stagingDir))) await fs.stat(projectDir);
|
|
334
|
+
await withComponentPreparationLock(
|
|
335
|
+
projectDir,
|
|
336
|
+
async () => {
|
|
337
|
+
await dropComponentDirectory(projectDir, project, log);
|
|
338
|
+
},
|
|
339
|
+
componentDropLockOptions(project)
|
|
340
|
+
);
|
|
341
|
+
const response = await server.replication.replicateOperation(req);
|
|
315
342
|
response.message = `Successfully deleted project: ${project}`;
|
|
316
343
|
return response;
|
|
317
344
|
} catch (err) {
|
|
@@ -410,6 +437,134 @@ async function packageComponent(req) {
|
|
|
410
437
|
return { project, payload };
|
|
411
438
|
}
|
|
412
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Load the built candidate to surface load-time errors. A load-ERROR PROBE, not a safety guarantee: it runs
|
|
442
|
+
* the component's own top-level code with incomplete side-effect isolation.
|
|
443
|
+
*
|
|
444
|
+
* A no-op on the main thread, and the operations API deploys there — so operator deploys are unvalidated
|
|
445
|
+
* (#2315 step 2). What this guarantees is ORDER: where validation runs, a rejected candidate never goes live.
|
|
446
|
+
*/
|
|
447
|
+
// `componentLoader.setErrorReporter` is ONE process-global callback, so two components validating
|
|
448
|
+
// concurrently on the same worker cross-attribute their failures: B installs its reporter while A is
|
|
449
|
+
// loading, A's load error lands in B, and A then activates broken code while B rejects a good candidate.
|
|
450
|
+
// Validation is serialized (it is already the slow path) and the previous reporter is restored, so the
|
|
451
|
+
// global is only ever owned by one in-flight validation.
|
|
452
|
+
let validationChain = Promise.resolve();
|
|
453
|
+
|
|
454
|
+
async function validateComponentLoads(candidateDirPath, emit) {
|
|
455
|
+
const run = validationChain.then(
|
|
456
|
+
() => validateComponentLoadsExclusive(candidateDirPath, emit),
|
|
457
|
+
() => validateComponentLoadsExclusive(candidateDirPath, emit)
|
|
458
|
+
);
|
|
459
|
+
validationChain = run.then(
|
|
460
|
+
() => {},
|
|
461
|
+
() => {}
|
|
462
|
+
);
|
|
463
|
+
return run;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
async function validateComponentLoadsExclusive(candidateDirPath, emit) {
|
|
467
|
+
// now we attempt to actually load the component in case there is
|
|
468
|
+
// an error we can immediately detect and report, but app code should not run on the main thread
|
|
469
|
+
if (!isMainThread && !process.env.HARPER_SAFE_MODE) {
|
|
470
|
+
const pseudoResources = new Resources();
|
|
471
|
+
pseudoResources.isWorker = true;
|
|
472
|
+
|
|
473
|
+
const componentLoader = require('./componentLoader.ts').default || require('./componentLoader.ts');
|
|
474
|
+
const { trackScopeClose } = require('./scopeShutdown.ts');
|
|
475
|
+
let lastError;
|
|
476
|
+
const priorErrorReporter = componentLoader.getErrorReporter?.();
|
|
477
|
+
componentLoader.setErrorReporter((error) => (lastError = error));
|
|
478
|
+
emit('phase', { phase: 'load', status: 'start' });
|
|
479
|
+
// This load exists only to surface load-time errors early; the Scopes it creates are
|
|
480
|
+
// throwaway. They are collected (instead of registered for worker-shutdown auto-close) so we
|
|
481
|
+
// can close them here once validation completes — otherwise each deploy leaks the Scope's
|
|
482
|
+
// deploy-lifecycle listeners on this worker, eventually tripping MaxListenersExceededWarning
|
|
483
|
+
// (#1462).
|
|
484
|
+
const validationScopes = new Set();
|
|
485
|
+
// Process-wide `server.*` registrations (registerOperation, setMcpQuotaHandler) are not owned by
|
|
486
|
+
// a Scope, so a candidate's top-level registration during this throwaway load would otherwise
|
|
487
|
+
// outlive it and pollute the live worker on a failed/rolled-back deploy. The guard makes those
|
|
488
|
+
// registration methods no-op for the duration of the load.
|
|
489
|
+
const { runWithDeployValidationGuard } = require('../server/serverHelpers/deployValidationState.ts');
|
|
490
|
+
// The candidate loads under the REAL component's name, so a candidate that throws would mark the live
|
|
491
|
+
// component ERROR. Its status writes are diverted into the guard's throwaway sink instead — see
|
|
492
|
+
// `deployValidationState.ts` for why this is context-scoped rather than captured and reverted here.
|
|
493
|
+
const componentName = path.basename(candidateDirPath);
|
|
494
|
+
// Extension modules the candidate load pulls in are registered in the loader's module registry keyed by
|
|
495
|
+
// module, so forgetting only the candidate's realpath leaves those behind — one set per deploy. Their
|
|
496
|
+
// identities are collected by the load itself; diffing the global registry instead would delete a live
|
|
497
|
+
// module registered by an interleaving real load, since validations serialize only with each other.
|
|
498
|
+
const validationModules = new Set();
|
|
499
|
+
const validation = runWithDeployValidationGuard(async () => {
|
|
500
|
+
try {
|
|
501
|
+
await componentLoader.loadComponent(candidateDirPath, pseudoResources, undefined, {
|
|
502
|
+
collectScopes: validationScopes,
|
|
503
|
+
collectLoadedModules: validationModules,
|
|
504
|
+
});
|
|
505
|
+
} finally {
|
|
506
|
+
const closeResults = await Promise.allSettled(Array.from(validationScopes, (scope) => scope.close()));
|
|
507
|
+
const failedCloses = closeResults.filter((result) => result.status === 'rejected');
|
|
508
|
+
for (const result of failedCloses) {
|
|
509
|
+
log.warn('Failed to close a deploy-validation Scope', result.reason);
|
|
510
|
+
}
|
|
511
|
+
// A rejected close is a REJECTED VALIDATION, not a warning. `Scope.close()` stops at the
|
|
512
|
+
// throwing listener, so its remaining internal listener removal and subscription-hold release
|
|
513
|
+
// never run and the throwaway scope stays partially live — one leak per deploy, on the worker
|
|
514
|
+
// that serves the component.
|
|
515
|
+
if (failedCloses.length) {
|
|
516
|
+
throw new AggregateError(
|
|
517
|
+
failedCloses.map((result) => result.reason),
|
|
518
|
+
`Could not tear down deploy validation for ${componentName}: ${failedCloses.length} scope(s) failed to close`
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
// Track the load+close so a concurrent worker shutdown waits for these scopes to finish
|
|
524
|
+
// disposing — a plugin may start a native runtime in handleApplication — before realExit.
|
|
525
|
+
trackScopeClose(validation);
|
|
526
|
+
try {
|
|
527
|
+
await validation;
|
|
528
|
+
} finally {
|
|
529
|
+
componentLoader.setErrorReporter(priorErrorReporter);
|
|
530
|
+
// The candidate path is unique per deploy, so leaving it in the loader's realpath registry leaks
|
|
531
|
+
// one dead entry per deploy for the life of the process.
|
|
532
|
+
componentLoader.forgetLoadedPath?.(candidateDirPath);
|
|
533
|
+
componentLoader.forgetLoadedModules?.(validationModules);
|
|
534
|
+
}
|
|
535
|
+
emit('phase', { phase: 'load', status: 'done' });
|
|
536
|
+
|
|
537
|
+
if (lastError) throw lastError;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const BRANCH_STORAGE_RETAINED =
|
|
542
|
+
'. Any branched database storage this application owns was left in place; drop it again with restart: true to discard that data';
|
|
543
|
+
|
|
544
|
+
/** Report a restart outcome the operation's own success message cannot convey. */
|
|
545
|
+
function logRestartOutcome(restart, what) {
|
|
546
|
+
const { RESTART_IDLE_TIMEOUT_MS, RESTART_WAIT_CEILING_MS } = require('./awaitRestart.ts');
|
|
547
|
+
if (restart.replacementsNotStarted)
|
|
548
|
+
log.warn(
|
|
549
|
+
`${restart.replacementsNotStarted} replacement worker thread(s) did not report starting after ${what}; the pool is short until they are restarted`
|
|
550
|
+
);
|
|
551
|
+
if (restart.error) log.error(`Restart after ${what} failed`, restart.error);
|
|
552
|
+
else if (restart.workersKeptOnOldCode)
|
|
553
|
+
log.warn(
|
|
554
|
+
`${restart.workersKeptOnOldCode} worker thread(s) could not be replaced after ${what} and are still running the previous code`
|
|
555
|
+
);
|
|
556
|
+
else if (restart.declined) log.warn(`No restart was performed after ${what}: the process is already shutting down`);
|
|
557
|
+
else if (restart.handedOff)
|
|
558
|
+
log.debug?.(`The restart after ${what} was handed to the main thread, which reports its own completion`);
|
|
559
|
+
else if (restart.stalled)
|
|
560
|
+
log.warn(
|
|
561
|
+
`The restart after ${what} stopped making progress for ${RESTART_IDLE_TIMEOUT_MS}ms; worker threads may still be running the previous code`
|
|
562
|
+
);
|
|
563
|
+
else if (!restart.completed)
|
|
564
|
+
log.warn(
|
|
565
|
+
`The restart after ${what} was still running after ${RESTART_WAIT_CEILING_MS}ms; worker threads may still be running the previous code`
|
|
566
|
+
);
|
|
567
|
+
}
|
|
413
568
|
/**
|
|
414
569
|
* Can deploy a component in multiple ways. If a 'package' is provided all it will do is write that package to
|
|
415
570
|
* harperdb-config, when HDB is restarted the package will be installed in hdb/nodeModules. If a base64 encoded string is passed it
|
|
@@ -463,6 +618,12 @@ async function deployComponent(req) {
|
|
|
463
618
|
}
|
|
464
619
|
if (req.urlPath !== undefined) applicationConfig.urlPath = req.urlPath;
|
|
465
620
|
if (req.host !== undefined) applicationConfig.host = req.host;
|
|
621
|
+
// Same convention as host/urlPath above, and for the same reason: a package redeploy rebuilds
|
|
622
|
+
// this application's whole root-config entry from request fields, so a deployment-level key that
|
|
623
|
+
// isn't re-supplied here is silently dropped -- for branchedDatabases specifically, that means an
|
|
624
|
+
// application which believed it had a private fork resumes sharing the base after the next
|
|
625
|
+
// restart, with nothing in this operation to say so.
|
|
626
|
+
if (req.branchedDatabases !== undefined) applicationConfig.branchedDatabases = req.branchedDatabases;
|
|
466
627
|
// Persist credential references (never tokens) so every cold install of this component —
|
|
467
628
|
// reboot, new peer, rollback — re-resolves the credential from the store.
|
|
468
629
|
if (credentialReferences.length) applicationConfig.credentials = credentialReferences;
|
|
@@ -587,52 +748,19 @@ async function deployComponent(req) {
|
|
|
587
748
|
if (credentialReferences.length) req.credentials = credentialReferences;
|
|
588
749
|
else delete req.credentials;
|
|
589
750
|
|
|
751
|
+
// Validated INSIDE preparation, between build and swap, so a component that installs cleanly but
|
|
752
|
+
// throws at load never becomes live.
|
|
753
|
+
//
|
|
754
|
+
// Phase ORDER is unchanged for clients, but `prepare:done` means "candidate built", not "swap
|
|
755
|
+
// committed" — so a later failure arrives after both phases reported success. The operation's error
|
|
756
|
+
// is the authority on whether the deploy landed, not the phase stream.
|
|
590
757
|
emit('phase', { phase: 'prepare', status: 'start' });
|
|
591
|
-
await prepareApplication(application
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
const pseudoResources = new Resources();
|
|
598
|
-
pseudoResources.isWorker = true;
|
|
599
|
-
|
|
600
|
-
const componentLoader = require('./componentLoader.ts').default || require('./componentLoader.ts');
|
|
601
|
-
const { trackScopeClose } = require('./scopeShutdown.ts');
|
|
602
|
-
let lastError;
|
|
603
|
-
componentLoader.setErrorReporter((error) => (lastError = error));
|
|
604
|
-
emit('phase', { phase: 'load', status: 'start' });
|
|
605
|
-
// This load exists only to surface load-time errors early; the Scopes it creates are
|
|
606
|
-
// throwaway. They are collected (instead of registered for worker-shutdown auto-close) so we
|
|
607
|
-
// can close them here once validation completes — otherwise each deploy leaks the Scope's
|
|
608
|
-
// deploy-lifecycle listeners on this worker, eventually tripping MaxListenersExceededWarning
|
|
609
|
-
// (#1462).
|
|
610
|
-
const validationScopes = new Set();
|
|
611
|
-
// Process-wide `server.*` registrations (registerOperation, setMcpQuotaHandler) are not owned by
|
|
612
|
-
// a Scope, so a candidate's top-level registration during this throwaway load would otherwise
|
|
613
|
-
// outlive it and pollute the live worker on a failed/rolled-back deploy. The guard makes those
|
|
614
|
-
// registration methods no-op for the duration of the load.
|
|
615
|
-
const { runWithDeployValidationGuard } = require('../server/serverHelpers/deployValidationState.ts');
|
|
616
|
-
const validation = runWithDeployValidationGuard(async () => {
|
|
617
|
-
try {
|
|
618
|
-
await componentLoader.loadComponent(application.dirPath, pseudoResources, undefined, {
|
|
619
|
-
collectScopes: validationScopes,
|
|
620
|
-
});
|
|
621
|
-
} finally {
|
|
622
|
-
const closeResults = await Promise.allSettled(Array.from(validationScopes, (scope) => scope.close()));
|
|
623
|
-
for (const result of closeResults) {
|
|
624
|
-
if (result.status === 'rejected') log.warn('Failed to close a deploy-validation Scope', result.reason);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
// Track the load+close so a concurrent worker shutdown waits for these scopes to finish
|
|
629
|
-
// disposing — a plugin may start a native runtime in handleApplication — before realExit.
|
|
630
|
-
trackScopeClose(validation);
|
|
631
|
-
await validation;
|
|
632
|
-
emit('phase', { phase: 'load', status: 'done' });
|
|
633
|
-
|
|
634
|
-
if (lastError) throw lastError;
|
|
635
|
-
}
|
|
758
|
+
await prepareApplication(application, {
|
|
759
|
+
validateCandidate: async (candidateDirPath) => {
|
|
760
|
+
emit('phase', { phase: 'prepare', status: 'done' });
|
|
761
|
+
await validateComponentLoads(candidateDirPath, emit);
|
|
762
|
+
},
|
|
763
|
+
});
|
|
636
764
|
const rollingRestart = req.restart === 'rolling';
|
|
637
765
|
// if doing a rolling restart set restart to false so that other nodes don't also restart.
|
|
638
766
|
req.restart = rollingRestart ? false : req.restart;
|
|
@@ -677,8 +805,16 @@ async function deployComponent(req) {
|
|
|
677
805
|
}
|
|
678
806
|
if (req.restart === true) {
|
|
679
807
|
emit('phase', { phase: 'restart', status: 'start' });
|
|
680
|
-
|
|
808
|
+
// Workers not yet replaced keep serving the pre-deploy component set, and where the OS lets
|
|
809
|
+
// replacements share a port they keep accepting connections for the whole rolling restart, so
|
|
810
|
+
// a caller that reads success as "the component is live" can be served by a worker that has
|
|
811
|
+
// never heard of it.
|
|
812
|
+
const { awaitRestart } = require('./awaitRestart.ts');
|
|
813
|
+
const restart = await awaitRestart((onProgress) =>
|
|
814
|
+
manageThreads.restartWorkers('http', undefined, undefined, onProgress)
|
|
815
|
+
);
|
|
681
816
|
emit('phase', { phase: 'restart', status: 'done' });
|
|
817
|
+
logRestartOutcome(restart, `deploying ${application.name}`);
|
|
682
818
|
response.message = `Successfully deployed: ${application.name}, restarting Harper`;
|
|
683
819
|
} else if (rollingRestart) {
|
|
684
820
|
const serverUtilities = require('../server/serverHelpers/serverUtilities.ts');
|
|
@@ -869,9 +1005,13 @@ async function getComponents() {
|
|
|
869
1005
|
const list = await fs.readdir(dir, { withFileTypes: true });
|
|
870
1006
|
for (let item of list) {
|
|
871
1007
|
const itemName = item.name;
|
|
1008
|
+
// Deny-list, not a dot-prefix skip: component CONTENTS legitimately include dot-files
|
|
1009
|
+
// (`.aiignore`, `.env.example`) that callers expect to see, so only Harper's own
|
|
1010
|
+
// bookkeeping directories are excluded by name.
|
|
872
1011
|
if (
|
|
873
1012
|
itemName === 'node_modules' ||
|
|
874
1013
|
itemName === ASIDE_STAGING_DIR ||
|
|
1014
|
+
itemName === DEPLOY_STAGING_DIR ||
|
|
875
1015
|
itemName === COMPONENT_PREPARATION_LOCK_DIR
|
|
876
1016
|
)
|
|
877
1017
|
continue;
|
|
@@ -1168,33 +1308,85 @@ async function dropComponent(req) {
|
|
|
1168
1308
|
|
|
1169
1309
|
const { project, file } = req;
|
|
1170
1310
|
const projectPath = req.file ? path.join(project, file) : project;
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1311
|
+
const componentsRoot = configUtils.getConfigPath(hdbTerms.CONFIG_PARAMS.COMPONENTSROOT);
|
|
1312
|
+
const componentPath = path.join(componentsRoot, project);
|
|
1313
|
+
const pathToComponent = path.join(componentsRoot, projectPath);
|
|
1314
|
+
|
|
1315
|
+
let response;
|
|
1316
|
+
await withComponentPreparationLock(
|
|
1317
|
+
componentPath,
|
|
1318
|
+
async () => {
|
|
1319
|
+
const componentSymlink = path.join(env.get(hdbTerms.CONFIG_PARAMS.ROOTPATH), 'node_modules', project);
|
|
1320
|
+
if (await fs.pathExists(componentSymlink)) {
|
|
1321
|
+
await fs.unlink(componentSymlink);
|
|
1322
|
+
}
|
|
1177
1323
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1324
|
+
if (!file) {
|
|
1325
|
+
await dropComponentDirectory(componentPath, project, log);
|
|
1326
|
+
} else if (await fs.pathExists(pathToComponent)) {
|
|
1327
|
+
await fs.remove(pathToComponent);
|
|
1328
|
+
}
|
|
1181
1329
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}
|
|
1330
|
+
const packageJsonPath = path.join(env.get(hdbTerms.CONFIG_PARAMS.ROOTPATH), 'package.json');
|
|
1331
|
+
if (await fs.pathExists(packageJsonPath)) {
|
|
1332
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
|
|
1333
|
+
if (packageJson?.dependencies?.[project]) {
|
|
1334
|
+
delete packageJson.dependencies[project];
|
|
1335
|
+
}
|
|
1336
|
+
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
|
|
1337
|
+
}
|
|
1191
1338
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1339
|
+
configUtils.deleteConfigFromFile([project]);
|
|
1340
|
+
// The main thread's cached config still names the project; the restart below installs every
|
|
1341
|
+
// package application in that cache, and installing this one would take the lock held here.
|
|
1342
|
+
// (A worker's RESTART message refreshes main's config the same way.)
|
|
1343
|
+
if (isMainThread) env.initSync(true);
|
|
1344
|
+
response = await server.replication.replicateOperation(req);
|
|
1345
|
+
const { applicationHasBranchStorage, removeBranchesForApplication } = require('../resources/branchDatabase.ts');
|
|
1346
|
+
const branched = !file && applicationHasBranchStorage(project);
|
|
1347
|
+
if (req.restart !== true) {
|
|
1348
|
+
response.message = `Successfully dropped: ${projectPath}`;
|
|
1349
|
+
if (branched) response.message += BRANCH_STORAGE_RETAINED;
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
// The branches go after the restart, under this lock; a worker is one of the threads being
|
|
1353
|
+
// replaced, so it hands both to the main thread.
|
|
1354
|
+
response.message = `Successfully dropped: ${projectPath}, restarting Harper`;
|
|
1355
|
+
if (!isMainThread) {
|
|
1356
|
+
parentPort.postMessage({
|
|
1357
|
+
type: hdbTerms.ITC_EVENT_TYPES.RESTART,
|
|
1358
|
+
workerType: 'http',
|
|
1359
|
+
removeBranchesFor: file ? undefined : project,
|
|
1360
|
+
});
|
|
1361
|
+
if (branched) {
|
|
1362
|
+
response.message +=
|
|
1363
|
+
'; the main thread removes its branched database storage after the restart and logs the outcome';
|
|
1364
|
+
}
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
const { awaitRestart } = require('./awaitRestart.ts');
|
|
1368
|
+
const restart = await awaitRestart((onProgress) =>
|
|
1369
|
+
manageThreads.restartWorkers('http', undefined, undefined, onProgress)
|
|
1370
|
+
);
|
|
1371
|
+
logRestartOutcome(restart, `dropping ${projectPath}`);
|
|
1372
|
+
if (!branched) return;
|
|
1373
|
+
if (restart.completed && !restart.workersKeptOnOldCode) {
|
|
1374
|
+
try {
|
|
1375
|
+
await removeBranchesForApplication(project);
|
|
1376
|
+
} catch (error) {
|
|
1377
|
+
log.error(`Branched database storage of ${project} could not be removed`, error);
|
|
1378
|
+
throw new Error(
|
|
1379
|
+
`Successfully dropped: ${projectPath}, but its branched database storage could not be removed and ` +
|
|
1380
|
+
`was left in place: ${error.message}. Drop it again with restart: true to retry.`
|
|
1381
|
+
);
|
|
1382
|
+
}
|
|
1383
|
+
} else {
|
|
1384
|
+
log.warn(`Branched database storage of ${project} was left in place: the restart did not complete`);
|
|
1385
|
+
response.message += BRANCH_STORAGE_RETAINED;
|
|
1386
|
+
}
|
|
1387
|
+
},
|
|
1388
|
+
componentDropLockOptions(project)
|
|
1389
|
+
);
|
|
1198
1390
|
return response;
|
|
1199
1391
|
}
|
|
1200
1392
|
|