@harperfast/harper-pro 5.0.25 → 5.1.0-beta.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/analytics/profile.ts +4 -0
- package/core/AGENTS.md +92 -6
- package/core/DESIGN.md +24 -0
- package/core/README.md +11 -10
- package/core/agent/agent.ts +203 -0
- package/core/agent/loop.ts +205 -0
- package/core/agent/operations.ts +148 -0
- package/core/agent/session.ts +187 -0
- package/core/agent/tools/fsTools.ts +276 -0
- package/core/agent/tools/httpFetchTool.ts +112 -0
- package/core/agent/tools/scheduleTool.ts +68 -0
- package/core/agent/toolset.ts +43 -0
- package/core/agent/types.ts +85 -0
- package/core/benchmarks/hnsw-search.js +157 -0
- package/core/benchmarks/ycsb/README.md +144 -0
- package/core/benchmarks/ycsb/analyze-profile.mts +120 -0
- package/core/benchmarks/ycsb/app/config.yaml +3 -0
- package/core/benchmarks/ycsb/app/schema.graphql +17 -0
- package/core/benchmarks/ycsb/harness.mts +328 -0
- package/core/benchmarks/ycsb/restClient.mts +120 -0
- package/core/benchmarks/ycsb/run-single-node.mts +97 -0
- package/core/benchmarks/ycsb/to-benchmark-json.mts +58 -0
- package/core/benchmarks/ycsb/workload.mts +499 -0
- package/core/benchmarks/ycsb/workload.test.mts +174 -0
- package/core/bin/{BinObjects.js → BinObjects.ts} +4 -5
- package/core/bin/cliCredentials.ts +133 -0
- package/core/bin/cliOperations.ts +339 -0
- package/core/bin/copyDb.ts +10 -10
- package/core/bin/deployRenderer.ts +196 -0
- package/core/bin/{harper.js → harper.ts} +48 -24
- package/core/bin/{install.js → install.ts} +3 -3
- package/core/bin/lite.ts +2 -0
- package/core/bin/login.ts +168 -0
- package/core/bin/logout.ts +11 -0
- package/core/bin/mcp/client.ts +407 -0
- package/core/bin/mcp/doctor.ts +189 -0
- package/core/bin/mcp/index.ts +80 -0
- package/core/bin/mcp/options.ts +122 -0
- package/core/bin/mcp/printConfig.ts +89 -0
- package/core/bin/multipartBuilder.ts +74 -0
- package/core/bin/{restart.js → restart.ts} +31 -32
- package/core/bin/{run.js → run.ts} +57 -46
- package/core/bin/sseConsumer.ts +126 -0
- package/core/bin/{status.js → status.ts} +10 -10
- package/core/bin/stop.ts +21 -0
- package/core/bin/upgrade.js +6 -6
- package/core/components/Application.ts +144 -18
- package/core/components/ApplicationScope.ts +2 -2
- package/core/components/ComponentV1.ts +2 -2
- package/core/components/EntryHandler.ts +159 -9
- package/core/components/OptionsWatcher.ts +75 -11
- package/core/components/Scope.ts +125 -15
- package/core/components/anthropic/index.ts +547 -0
- package/core/components/bedrock/index.ts +823 -0
- package/core/components/componentLoader.ts +63 -32
- package/core/components/deployLifecycle.ts +161 -0
- package/core/components/deploymentOperations.ts +173 -0
- package/core/components/deploymentRecorder.ts +402 -0
- package/core/components/deriveURLPath.ts +4 -4
- package/core/components/mcp/adapters/fastify.ts +87 -0
- package/core/components/mcp/adapters/harperHttp.ts +103 -0
- package/core/components/mcp/audit.ts +75 -0
- package/core/components/mcp/index.ts +134 -0
- package/core/components/mcp/jsonrpc.ts +134 -0
- package/core/components/mcp/lifecycle.ts +105 -0
- package/core/components/mcp/listChanged.ts +270 -0
- package/core/components/mcp/rateLimit.ts +217 -0
- package/core/components/mcp/resources.ts +593 -0
- package/core/components/mcp/session.ts +151 -0
- package/core/components/mcp/sessionRegistry.ts +140 -0
- package/core/components/mcp/toolRegistry.ts +292 -0
- package/core/components/mcp/tools/application.ts +603 -0
- package/core/components/mcp/tools/operations.ts +283 -0
- package/core/components/mcp/tools/schemas/derive.ts +256 -0
- package/core/components/mcp/tools/schemas/operations.ts +245 -0
- package/core/components/mcp/transport.ts +517 -0
- package/core/components/ollama/index.ts +316 -0
- package/core/components/openai/index.ts +563 -0
- package/core/components/operations.js +211 -60
- package/core/components/operationsValidation.js +3 -3
- package/core/components/packageComponent.ts +97 -29
- package/core/components/requestRestart.ts +17 -2
- package/core/components/status/crossThread.ts +14 -5
- package/core/components/status/errors.ts +1 -1
- package/core/config/RootConfigWatcher.ts +56 -2
- package/core/config/configUtils.js +29 -8
- package/core/config/harperConfigEnvVars.ts +1 -1
- package/core/dataLayer/{CreateAttributeObject.js → CreateAttributeObject.ts} +4 -3
- package/core/dataLayer/{CreateTableObject.js → CreateTableObject.ts} +2 -1
- package/core/dataLayer/{DataLayerObjects.js → DataLayerObjects.ts} +17 -9
- package/core/dataLayer/{DeleteBeforeObject.js → DeleteBeforeObject.ts} +2 -1
- package/core/dataLayer/{DeleteObject.js → DeleteObject.ts} +3 -2
- package/core/dataLayer/{DropAttributeObject.js → DropAttributeObject.ts} +2 -1
- package/core/dataLayer/{GetBackupObject.js → GetBackupObject.ts} +3 -2
- package/core/dataLayer/{InsertObject.js → InsertObject.ts} +3 -2
- package/core/dataLayer/{ReadAuditLogObject.js → ReadAuditLogObject.ts} +3 -2
- package/core/dataLayer/{SQLSearch.js → SQLSearch.ts} +97 -43
- package/core/dataLayer/{SearchByConditionsObject.js → SearchByConditionsObject.ts} +5 -6
- package/core/dataLayer/{SearchByHashObject.js → SearchByHashObject.ts} +2 -1
- package/core/dataLayer/{SearchObject.js → SearchObject.ts} +2 -1
- package/core/dataLayer/{SqlSearchObject.js → SqlSearchObject.ts} +2 -1
- package/core/dataLayer/{UpdateObject.js → UpdateObject.ts} +3 -2
- package/core/dataLayer/{UpsertObject.js → UpsertObject.ts} +3 -2
- package/core/dataLayer/{bulkLoad.js → bulkLoad.ts} +40 -49
- package/core/dataLayer/{delete.js → delete.ts} +21 -26
- package/core/dataLayer/{export.js → export.ts} +22 -26
- package/core/dataLayer/{getBackup.js → getBackup.ts} +7 -9
- package/core/dataLayer/harperBridge/BridgeMethods.ts +102 -0
- package/core/dataLayer/harperBridge/ResourceBridge.ts +27 -26
- package/core/dataLayer/harperBridge/TableSizeObject.ts +1 -0
- package/core/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/core/dataLayer/harperBridge/{harperBridge.js → harperBridge.ts} +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +8 -6
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +6 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +6 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +3 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +10 -8
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +4 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +6 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +2 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +3 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +5 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +6 -3
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.ts +1 -1
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/core/dataLayer/{hdbInfoController.js → hdbInfoController.ts} +20 -26
- package/core/dataLayer/{insert.js → insert.ts} +24 -24
- package/core/dataLayer/{readAuditLog.js → readAuditLog.ts} +8 -10
- package/core/dataLayer/{schema.js → schema.ts} +32 -44
- package/core/dataLayer/{schemaDescribe.js → schemaDescribe.ts} +23 -26
- package/core/dataLayer/{search.js → search.ts} +9 -15
- package/core/dataLayer/{transaction.js → transaction.ts} +2 -5
- package/core/dataLayer/{update.js → update.ts} +19 -22
- package/core/index.ts +5 -0
- package/core/json/systemSchema.json +65 -0
- package/core/launchServiceScripts/utility/checkNodeVersion.js +2 -0
- package/core/package-lock.json +9051 -4318
- package/core/resources/DESIGN.md +98 -0
- package/core/resources/DatabaseTransaction.ts +58 -30
- package/core/resources/ErrorResource.ts +2 -1
- package/core/resources/LMDBTransaction.ts +38 -29
- package/core/resources/RecordEncoder.ts +12 -4
- package/core/resources/RequestTarget.ts +2 -0
- package/core/resources/Resource.ts +89 -56
- package/core/resources/ResourceInterface.ts +44 -21
- package/core/resources/Resources.ts +8 -8
- package/core/resources/RocksIndexStore.ts +3 -0
- package/core/resources/RocksTransactionLogStore.ts +47 -28
- package/core/resources/Table.ts +386 -214
- package/core/resources/analytics/metadata.ts +1 -0
- package/core/resources/analytics/read.ts +24 -6
- package/core/resources/analytics/write.ts +240 -17
- package/core/resources/auditStore.ts +28 -19
- package/core/resources/blob.ts +53 -53
- package/core/resources/dataLoader.ts +4 -4
- package/core/resources/databases.ts +190 -71
- package/core/resources/graphql.ts +227 -164
- package/core/resources/indexes/HierarchicalNavigableSmallWorld.ts +294 -65
- package/core/resources/indexes/vector.ts +17 -0
- package/core/resources/loadEnv.ts +21 -17
- package/core/resources/login.ts +5 -3
- package/core/resources/models/Models.ts +304 -0
- package/core/resources/models/TestBackend.ts +83 -0
- package/core/resources/models/agentLoop.ts +895 -0
- package/core/resources/models/analyticsTable.ts +199 -0
- package/core/resources/models/backendHelpers.ts +116 -0
- package/core/resources/models/backendRegistry.ts +66 -0
- package/core/resources/models/bootstrap.ts +135 -0
- package/core/resources/models/embedHook.ts +138 -0
- package/core/resources/models/types.ts +296 -0
- package/core/resources/replayLogs.ts +15 -7
- package/core/resources/roles.ts +62 -67
- package/core/resources/search.ts +355 -135
- package/core/resources/tracked.ts +8 -8
- package/core/resources/transaction.ts +8 -8
- package/core/resources/transactionBroadcast.ts +3 -3
- package/core/security/auth.ts +35 -26
- package/core/security/certificateVerification/crlVerification.ts +11 -4
- package/core/security/{cryptoHash.js → cryptoHash.ts} +3 -8
- package/core/security/data_objects/{PermissionAttributeResponseObject.js → PermissionAttributeResponseObject.ts} +4 -4
- package/core/security/data_objects/{PermissionResponseObject.js → PermissionResponseObject.ts} +12 -11
- package/core/security/data_objects/{PermissionTableResponseObject.js → PermissionTableResponseObject.ts} +6 -4
- package/core/security/{fastifyAuth.js → fastifyAuth.ts} +93 -20
- package/core/security/impersonation.ts +3 -3
- package/core/security/jsLoader.ts +22 -8
- package/core/security/{keys.js → keys.ts} +113 -121
- package/core/security/permissionsTranslator.js +2 -2
- package/core/security/{role.js → role.ts} +26 -33
- package/core/security/tokenAuthentication.ts +34 -7
- package/core/security/user.ts +26 -22
- package/core/server/DESIGN.md +139 -0
- package/core/server/DurableSubscriptionsSession.ts +67 -50
- package/core/server/REST.ts +120 -107
- package/core/server/Server.ts +31 -12
- package/core/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/core/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/core/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/core/server/fastifyRoutes.ts +37 -33
- package/core/server/graphqlQuerying.ts +6 -5
- package/core/server/http.ts +517 -26
- package/core/server/itc/serverHandlers.js +75 -14
- package/core/server/jobs/{JobObject.js → JobObject.ts} +13 -6
- package/core/server/jobs/{jobProcess.js → jobProcess.ts} +20 -16
- package/core/server/jobs/{jobRunner.js → jobRunner.ts} +20 -21
- package/core/server/jobs/{jobs.js → jobs.ts} +41 -44
- package/core/server/loadRootComponents.js +1 -1
- package/core/server/middlewareChain.ts +270 -0
- package/core/server/mqtt.ts +35 -26
- package/core/server/nodeName.ts +2 -1
- package/core/server/operationsServer.ts +85 -10
- package/core/server/serverHelpers/Headers.ts +10 -8
- package/core/server/serverHelpers/JSONStream.ts +15 -5
- package/core/server/serverHelpers/Request.ts +370 -13
- package/core/server/serverHelpers/contentTypes.ts +42 -11
- package/core/server/serverHelpers/multipartParser.ts +152 -0
- package/core/server/serverHelpers/progressEmitter.ts +110 -0
- package/core/server/serverHelpers/serverHandlers.js +43 -7
- package/core/server/serverHelpers/serverUtilities.ts +40 -30
- package/core/server/static.ts +9 -6
- package/core/server/status/index.ts +2 -2
- package/core/server/storageReclamation.ts +39 -2
- package/core/server/threads/itc.js +7 -4
- package/core/server/threads/manageThreads.js +100 -26
- package/core/server/threads/socketRouter.ts +12 -275
- package/core/server/threads/threadServer.js +345 -105
- package/core/server/threads/workerProcessGuard.ts +93 -0
- package/core/server/throttle.ts +18 -0
- package/core/sqlTranslator/{SelectValidator.js → SelectValidator.ts} +41 -49
- package/core/sqlTranslator/{alasqlFunctionImporter.js → alasqlFunctionImporter.ts} +5 -5
- package/core/sqlTranslator/{deleteTranslator.js → deleteTranslator.ts} +13 -18
- package/core/sqlTranslator/{index.js → index.ts} +30 -33
- package/core/sqlTranslator/{sql_statement_bucket.js → sql_statement_bucket.ts} +49 -20
- package/core/static/README.md +10 -9
- package/core/system/000004.log +0 -0
- package/core/system/CURRENT +1 -0
- package/core/system/IDENTITY +1 -0
- package/core/system/LOCK +0 -0
- package/core/system/LOG +1351 -0
- package/core/system/MANIFEST-000005 +0 -0
- package/core/system/OPTIONS-000013 +607 -0
- package/core/system/OPTIONS-000015 +734 -0
- package/core/upgrade/{UpgradeObjects.js → UpgradeObjects.ts} +3 -6
- package/core/upgrade/directives/5-2-0.ts +49 -0
- package/core/upgrade/directives/{directivesController.js → directivesController.ts} +16 -16
- package/core/upgrade/{directivesManager.js → directivesManager.ts} +7 -11
- package/core/upgrade/{upgradePrompt.js → upgradePrompt.ts} +8 -14
- package/core/upgrade/{upgradeUtilities.js → upgradeUtilities.ts} +3 -7
- package/core/utility/{OperationFunctionCaller.js → OperationFunctionCaller.ts} +7 -7
- package/core/utility/{assignCmdEnvVariables.js → assignCmdEnvVariables.ts} +6 -8
- package/core/utility/{common_utils.js → common_utils.ts} +113 -139
- package/core/utility/environment/{environmentManager.js → environmentManager.ts} +34 -33
- package/core/utility/environment/systemInformation.ts +18 -4
- package/core/utility/errors/{commonErrors.js → commonErrors.ts} +9 -9
- package/core/utility/errors/{hdbError.js → hdbError.ts} +39 -45
- package/core/utility/expandEnvVar.ts +110 -0
- package/core/utility/functions/geo.js +2 -2
- package/core/utility/functions/sql/alaSQLExtension.js +1 -1
- package/core/utility/globalSchema.ts +30 -0
- package/core/utility/hdbTerms.ts +56 -0
- package/core/utility/install/checkJWTTokensExist.js +1 -1
- package/core/utility/install/{installer.js → installer.ts} +58 -59
- package/core/utility/installation.ts +2 -2
- package/core/utility/lmdb/{DBIDefinition.js → DBIDefinition.ts} +4 -1
- package/core/utility/lmdb/{DeleteRecordsResponseObject.js → DeleteRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{InsertRecordsResponseObject.js → InsertRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/OpenDBIObject.ts +43 -0
- package/core/utility/lmdb/{OpenEnvironmentObject.js → OpenEnvironmentObject.ts} +19 -6
- package/core/utility/lmdb/{UpdateRecordsResponseObject.js → UpdateRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{UpsertRecordsResponseObject.js → UpsertRecordsResponseObject.ts} +2 -1
- package/core/utility/lmdb/{cleanLMDBMap.js → cleanLMDBMap.ts} +5 -5
- package/core/utility/lmdb/{commonUtility.js → commonUtility.ts} +13 -21
- package/core/utility/lmdb/{deleteUtility.js → deleteUtility.ts} +8 -12
- package/core/utility/lmdb/{environmentUtility.js → environmentUtility.ts} +43 -52
- package/core/utility/lmdb/{searchCursorFunctions.js → searchCursorFunctions.ts} +12 -26
- package/core/utility/lmdb/{searchUtility.js → searchUtility.ts} +75 -64
- package/core/utility/lmdb/{terms.js → terms.ts} +10 -23
- package/core/utility/lmdb/{writeUtility.js → writeUtility.ts} +37 -22
- package/core/utility/logging/{harper_logger.js → harper_logger.ts} +136 -89
- package/core/utility/logging/{logRotator.js → logRotator.ts} +13 -13
- package/core/utility/logging/logger.ts +1 -1
- package/core/utility/logging/{readLog.js → readLog.ts} +19 -19
- package/core/utility/logging/{transactionLog.js → transactionLog.ts} +10 -14
- package/core/utility/{mount_hdb.js → mount_hdb.ts} +15 -16
- package/core/utility/{npmUtilities.js → npmUtilities.ts} +14 -17
- package/core/utility/{operation_authorization.js → operation_authorization.ts} +173 -124
- package/core/utility/packageUtils.js +7 -16
- package/core/utility/password.ts +1 -1
- package/core/utility/processManagement/processManagement.js +2 -2
- package/core/utility/processManagement/servicesConfig.js +1 -1
- package/core/utility/{signalling.js → signalling.ts} +6 -11
- package/core/utility/watcherFallback.ts +74 -0
- package/core/validation/analyticsValidator.ts +43 -0
- package/core/validation/{bulkDeleteValidator.js → bulkDeleteValidator.ts} +5 -5
- package/core/validation/{check_permissions.js → check_permissions.ts} +3 -3
- package/core/validation/{common_validators.js → common_validators.ts} +12 -24
- package/core/validation/{configValidator.js → configValidator.ts} +114 -18
- package/core/validation/{deleteValidator.js → deleteValidator.ts} +5 -5
- package/core/validation/{fileLoadValidator.js → fileLoadValidator.ts} +12 -19
- package/core/validation/{insertValidator.js → insertValidator.ts} +5 -5
- package/core/validation/{installValidator.js → installValidator.ts} +8 -8
- package/core/validation/{readLogValidator.js → readLogValidator.ts} +10 -10
- package/core/validation/{role_validation.js → role_validation.ts} +26 -32
- package/core/validation/{schemaMetadataValidator.js → schemaMetadataValidator.ts} +5 -11
- package/core/validation/{searchValidator.js → searchValidator.ts} +12 -11
- package/core/validation/statusValidator.ts +1 -1
- package/core/validation/{transactionLogValidator.js → transactionLogValidator.ts} +4 -9
- package/core/validation/{user_validation.js → user_validation.ts} +4 -10
- package/core/validation/{validationWrapper.js → validationWrapper.ts} +3 -9
- package/dist/analytics/profile.js +4 -0
- package/dist/analytics/profile.js.map +1 -1
- package/dist/cloneNode/cloneNode.js +224 -12
- package/dist/cloneNode/cloneNode.js.map +1 -1
- package/dist/core/agent/agent.js +175 -0
- package/dist/core/agent/agent.js.map +1 -0
- package/dist/core/agent/loop.js +176 -0
- package/dist/core/agent/loop.js.map +1 -0
- package/dist/core/agent/operations.js +137 -0
- package/dist/core/agent/operations.js.map +1 -0
- package/dist/core/agent/session.js +182 -0
- package/dist/core/agent/session.js.map +1 -0
- package/dist/core/agent/tools/fsTools.js +286 -0
- package/dist/core/agent/tools/fsTools.js.map +1 -0
- package/dist/core/agent/tools/httpFetchTool.js +116 -0
- package/dist/core/agent/tools/httpFetchTool.js.map +1 -0
- package/dist/core/agent/tools/scheduleTool.js +54 -0
- package/dist/core/agent/tools/scheduleTool.js.map +1 -0
- package/dist/core/agent/toolset.js +33 -0
- package/dist/core/agent/toolset.js.map +1 -0
- package/dist/core/agent/types.js +10 -0
- package/dist/core/agent/types.js.map +1 -0
- package/dist/core/bin/BinObjects.js +6 -3
- package/dist/core/bin/BinObjects.js.map +1 -1
- package/dist/core/bin/cliCredentials.js +130 -0
- package/dist/core/bin/cliCredentials.js.map +1 -0
- package/dist/core/bin/cliOperations.js +254 -40
- package/dist/core/bin/cliOperations.js.map +1 -1
- package/dist/core/bin/copyDb.js +16 -16
- package/dist/core/bin/copyDb.js.map +1 -1
- package/dist/core/bin/deployRenderer.js +185 -0
- package/dist/core/bin/deployRenderer.js.map +1 -0
- package/dist/core/bin/harper.js +92 -31
- package/dist/core/bin/harper.js.map +1 -1
- package/dist/core/bin/install.js +41 -4
- package/dist/core/bin/install.js.map +1 -1
- package/dist/core/bin/lite.js +3 -4
- package/dist/core/bin/lite.js.map +1 -1
- package/dist/core/bin/login.js +158 -0
- package/dist/core/bin/login.js.map +1 -0
- package/dist/core/bin/logout.js +16 -0
- package/dist/core/bin/logout.js.map +1 -0
- package/dist/core/bin/mcp/client.js +395 -0
- package/dist/core/bin/mcp/client.js.map +1 -0
- package/dist/core/bin/mcp/doctor.js +193 -0
- package/dist/core/bin/mcp/doctor.js.map +1 -0
- package/dist/core/bin/mcp/index.js +81 -0
- package/dist/core/bin/mcp/index.js.map +1 -0
- package/dist/core/bin/mcp/options.js +113 -0
- package/dist/core/bin/mcp/options.js.map +1 -0
- package/dist/core/bin/mcp/printConfig.js +85 -0
- package/dist/core/bin/mcp/printConfig.js.map +1 -0
- package/dist/core/bin/multipartBuilder.js +55 -0
- package/dist/core/bin/multipartBuilder.js.map +1 -0
- package/dist/core/bin/restart.js +85 -48
- package/dist/core/bin/restart.js.map +1 -1
- package/dist/core/bin/run.js +123 -77
- package/dist/core/bin/run.js.map +1 -1
- package/dist/core/bin/sseConsumer.js +127 -0
- package/dist/core/bin/sseConsumer.js.map +1 -0
- package/dist/core/bin/status.js +48 -11
- package/dist/core/bin/status.js.map +1 -1
- package/dist/core/bin/stop.js +44 -7
- package/dist/core/bin/stop.js.map +1 -1
- package/dist/core/bin/upgrade.js +6 -6
- package/dist/core/components/Application.js +134 -28
- package/dist/core/components/Application.js.map +1 -1
- package/dist/core/components/ApplicationScope.js +2 -2
- package/dist/core/components/ComponentV1.js +5 -5
- package/dist/core/components/ComponentV1.js.map +1 -1
- package/dist/core/components/EntryHandler.js +153 -13
- package/dist/core/components/EntryHandler.js.map +1 -1
- package/dist/core/components/OptionsWatcher.js +72 -10
- package/dist/core/components/OptionsWatcher.js.map +1 -1
- package/dist/core/components/Scope.js +105 -9
- package/dist/core/components/Scope.js.map +1 -1
- package/dist/core/components/anthropic/index.js +428 -0
- package/dist/core/components/anthropic/index.js.map +1 -0
- package/dist/core/components/bedrock/index.js +734 -0
- package/dist/core/components/bedrock/index.js.map +1 -0
- package/dist/core/components/componentLoader.js +63 -38
- package/dist/core/components/componentLoader.js.map +1 -1
- package/dist/core/components/deployLifecycle.js +156 -0
- package/dist/core/components/deployLifecycle.js.map +1 -0
- package/dist/core/components/deploymentOperations.js +185 -0
- package/dist/core/components/deploymentOperations.js.map +1 -0
- package/dist/core/components/deploymentRecorder.js +401 -0
- package/dist/core/components/deploymentRecorder.js.map +1 -0
- package/dist/core/components/deriveURLPath.js +2 -2
- package/dist/core/components/deriveURLPath.js.map +1 -1
- package/dist/core/components/mcp/adapters/fastify.js +66 -0
- package/dist/core/components/mcp/adapters/fastify.js.map +1 -0
- package/dist/core/components/mcp/adapters/harperHttp.js +78 -0
- package/dist/core/components/mcp/adapters/harperHttp.js.map +1 -0
- package/dist/core/components/mcp/audit.js +73 -0
- package/dist/core/components/mcp/audit.js.map +1 -0
- package/dist/core/components/mcp/index.js +109 -0
- package/dist/core/components/mcp/index.js.map +1 -0
- package/dist/core/components/mcp/jsonrpc.js +93 -0
- package/dist/core/components/mcp/jsonrpc.js.map +1 -0
- package/dist/core/components/mcp/lifecycle.js +79 -0
- package/dist/core/components/mcp/lifecycle.js.map +1 -0
- package/dist/core/components/mcp/listChanged.js +257 -0
- package/dist/core/components/mcp/listChanged.js.map +1 -0
- package/dist/core/components/mcp/rateLimit.js +226 -0
- package/dist/core/components/mcp/rateLimit.js.map +1 -0
- package/dist/core/components/mcp/resources.js +515 -0
- package/dist/core/components/mcp/resources.js.map +1 -0
- package/dist/core/components/mcp/session.js +170 -0
- package/dist/core/components/mcp/session.js.map +1 -0
- package/dist/core/components/mcp/sessionRegistry.js +124 -0
- package/dist/core/components/mcp/sessionRegistry.js.map +1 -0
- package/dist/core/components/mcp/toolRegistry.js +176 -0
- package/dist/core/components/mcp/toolRegistry.js.map +1 -0
- package/dist/core/components/mcp/tools/application.js +549 -0
- package/dist/core/components/mcp/tools/application.js.map +1 -0
- package/dist/core/components/mcp/tools/operations.js +303 -0
- package/dist/core/components/mcp/tools/operations.js.map +1 -0
- package/dist/core/components/mcp/tools/schemas/derive.js +216 -0
- package/dist/core/components/mcp/tools/schemas/derive.js.map +1 -0
- package/dist/core/components/mcp/tools/schemas/operations.js +243 -0
- package/dist/core/components/mcp/tools/schemas/operations.js.map +1 -0
- package/dist/core/components/mcp/transport.js +467 -0
- package/dist/core/components/mcp/transport.js.map +1 -0
- package/dist/core/components/ollama/index.js +239 -0
- package/dist/core/components/ollama/index.js.map +1 -0
- package/dist/core/components/openai/index.js +475 -0
- package/dist/core/components/openai/index.js.map +1 -0
- package/dist/core/components/operations.js +198 -52
- package/dist/core/components/operations.js.map +1 -1
- package/dist/core/components/operationsValidation.js +3 -3
- package/dist/core/components/packageComponent.js +87 -26
- package/dist/core/components/packageComponent.js.map +1 -1
- package/dist/core/components/requestRestart.js +12 -1
- package/dist/core/components/requestRestart.js.map +1 -1
- package/dist/core/components/status/crossThread.js +12 -5
- package/dist/core/components/status/crossThread.js.map +1 -1
- package/dist/core/components/status/errors.js +7 -7
- package/dist/core/config/RootConfigWatcher.js +52 -1
- package/dist/core/config/RootConfigWatcher.js.map +1 -1
- package/dist/core/config/configUtils.js +31 -8
- package/dist/core/config/configUtils.js.map +1 -1
- package/dist/core/config/harperConfigEnvVars.js +1 -1
- package/dist/core/config/harperConfigEnvVars.js.map +1 -1
- package/dist/core/dataLayer/CreateAttributeObject.js +4 -3
- package/dist/core/dataLayer/CreateAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/CreateTableObject.js +2 -1
- package/dist/core/dataLayer/CreateTableObject.js.map +1 -1
- package/dist/core/dataLayer/DataLayerObjects.js +19 -5
- package/dist/core/dataLayer/DataLayerObjects.js.map +1 -1
- package/dist/core/dataLayer/DeleteBeforeObject.js +2 -1
- package/dist/core/dataLayer/DeleteBeforeObject.js.map +1 -1
- package/dist/core/dataLayer/DeleteObject.js +4 -3
- package/dist/core/dataLayer/DeleteObject.js.map +1 -1
- package/dist/core/dataLayer/DropAttributeObject.js +2 -1
- package/dist/core/dataLayer/DropAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/GetBackupObject.js +4 -3
- package/dist/core/dataLayer/GetBackupObject.js.map +1 -1
- package/dist/core/dataLayer/InsertObject.js +4 -3
- package/dist/core/dataLayer/InsertObject.js.map +1 -1
- package/dist/core/dataLayer/ReadAuditLogObject.js +4 -3
- package/dist/core/dataLayer/ReadAuditLogObject.js.map +1 -1
- package/dist/core/dataLayer/SQLSearch.js +140 -78
- package/dist/core/dataLayer/SQLSearch.js.map +1 -1
- package/dist/core/dataLayer/SearchByConditionsObject.js +5 -7
- package/dist/core/dataLayer/SearchByConditionsObject.js.map +1 -1
- package/dist/core/dataLayer/SearchByHashObject.js +2 -1
- package/dist/core/dataLayer/SearchByHashObject.js.map +1 -1
- package/dist/core/dataLayer/SearchObject.js +2 -1
- package/dist/core/dataLayer/SearchObject.js.map +1 -1
- package/dist/core/dataLayer/SqlSearchObject.js +2 -1
- package/dist/core/dataLayer/SqlSearchObject.js.map +1 -1
- package/dist/core/dataLayer/UpdateObject.js +4 -3
- package/dist/core/dataLayer/UpdateObject.js.map +1 -1
- package/dist/core/dataLayer/UpsertObject.js +4 -3
- package/dist/core/dataLayer/UpsertObject.js.map +1 -1
- package/dist/core/dataLayer/bulkLoad.js +122 -88
- package/dist/core/dataLayer/bulkLoad.js.map +1 -1
- package/dist/core/dataLayer/delete.js +74 -39
- package/dist/core/dataLayer/delete.js.map +1 -1
- package/dist/core/dataLayer/export.js +90 -55
- package/dist/core/dataLayer/export.js.map +1 -1
- package/dist/core/dataLayer/getBackup.js +43 -11
- package/dist/core/dataLayer/getBackup.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/BridgeMethods.js +41 -20
- package/dist/core/dataLayer/harperBridge/BridgeMethods.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/ResourceBridge.js +26 -25
- package/dist/core/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/TableSizeObject.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/bridgeUtility/insertUpdateValidate.js +4 -4
- package/dist/core/dataLayer/harperBridge/harperBridge.js +38 -4
- package/dist/core/dataLayer/harperBridge/harperBridge.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js +7 -6
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateAttribute.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateRecords.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateSchema.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js +5 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbCreateTable.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteAuditLogsBefore.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDeleteRecords.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropAttribute.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropSchema.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbDropTable.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbFlush.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetBackup.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByHash.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbGetDataByValue.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbReadAuditLog.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js +8 -8
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByConditions.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByHash.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbSearchByValue.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpdateRecords.js +3 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbMethods/lmdbUpsertRecords.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/LMDBCreateAttributeObject.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializeHashSearch.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCheckForNewAttributes.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js +5 -3
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbCreateTransactionsAuditEnvironment.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbGetTableSize.js +2 -2
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js +4 -4
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbProcessRows.js.map +1 -1
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbSearch.js +5 -5
- package/dist/core/dataLayer/harperBridge/lmdbBridge/lmdbUtility/lmdbWriteTransaction.js +4 -4
- package/dist/core/dataLayer/hdbInfoController.js +66 -31
- package/dist/core/dataLayer/hdbInfoController.js.map +1 -1
- package/dist/core/dataLayer/insert.js +63 -28
- package/dist/core/dataLayer/insert.js.map +1 -1
- package/dist/core/dataLayer/readAuditLog.js +45 -13
- package/dist/core/dataLayer/readAuditLog.js.map +1 -1
- package/dist/core/dataLayer/schema.js +124 -89
- package/dist/core/dataLayer/schema.js.map +1 -1
- package/dist/core/dataLayer/schemaDescribe.js +78 -41
- package/dist/core/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/core/dataLayer/search.js +12 -13
- package/dist/core/dataLayer/search.js.map +1 -1
- package/dist/core/dataLayer/transaction.js +3 -4
- package/dist/core/dataLayer/transaction.js.map +1 -1
- package/dist/core/dataLayer/update.js +53 -18
- package/dist/core/dataLayer/update.js.map +1 -1
- package/dist/core/globals.js +1 -0
- package/dist/core/globals.js.map +1 -1
- package/dist/core/index.js +4 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/json/systemSchema.json +65 -0
- package/dist/core/launchServiceScripts/utility/checkNodeVersion.js +3 -0
- package/dist/core/launchServiceScripts/utility/checkNodeVersion.js.map +1 -1
- package/dist/core/resources/DatabaseTransaction.js +39 -15
- package/dist/core/resources/DatabaseTransaction.js.map +1 -1
- package/dist/core/resources/ErrorResource.js +3 -1
- package/dist/core/resources/ErrorResource.js.map +1 -1
- package/dist/core/resources/LMDBTransaction.js +18 -7
- package/dist/core/resources/LMDBTransaction.js.map +1 -1
- package/dist/core/resources/RecordEncoder.js +5 -2
- package/dist/core/resources/RecordEncoder.js.map +1 -1
- package/dist/core/resources/RequestTarget.js.map +1 -1
- package/dist/core/resources/Resource.js +37 -10
- package/dist/core/resources/Resource.js.map +1 -1
- package/dist/core/resources/ResourceInterface.js +20 -0
- package/dist/core/resources/ResourceInterface.js.map +1 -1
- package/dist/core/resources/Resources.js +7 -6
- package/dist/core/resources/Resources.js.map +1 -1
- package/dist/core/resources/RocksIndexStore.js +3 -0
- package/dist/core/resources/RocksIndexStore.js.map +1 -1
- package/dist/core/resources/RocksTransactionLogStore.js +46 -27
- package/dist/core/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/core/resources/Table.js +267 -107
- package/dist/core/resources/Table.js.map +1 -1
- package/dist/core/resources/analytics/metadata.js +1 -0
- package/dist/core/resources/analytics/metadata.js.map +1 -1
- package/dist/core/resources/analytics/read.js +16 -5
- package/dist/core/resources/analytics/read.js.map +1 -1
- package/dist/core/resources/analytics/write.js +232 -20
- package/dist/core/resources/analytics/write.js.map +1 -1
- package/dist/core/resources/auditStore.js +13 -8
- package/dist/core/resources/auditStore.js.map +1 -1
- package/dist/core/resources/blob.js +8 -8
- package/dist/core/resources/blob.js.map +1 -1
- package/dist/core/resources/dataLoader.js +13 -13
- package/dist/core/resources/databases.js +160 -52
- package/dist/core/resources/databases.js.map +1 -1
- package/dist/core/resources/graphql.js +224 -174
- package/dist/core/resources/graphql.js.map +1 -1
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js +308 -59
- package/dist/core/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/core/resources/indexes/vector.js +14 -0
- package/dist/core/resources/indexes/vector.js.map +1 -1
- package/dist/core/resources/loadEnv.js +21 -18
- package/dist/core/resources/loadEnv.js.map +1 -1
- package/dist/core/resources/login.js +5 -4
- package/dist/core/resources/login.js.map +1 -1
- package/dist/core/resources/models/Models.js +265 -0
- package/dist/core/resources/models/Models.js.map +1 -0
- package/dist/core/resources/models/TestBackend.js +71 -0
- package/dist/core/resources/models/TestBackend.js.map +1 -0
- package/dist/core/resources/models/agentLoop.js +746 -0
- package/dist/core/resources/models/agentLoop.js.map +1 -0
- package/dist/core/resources/models/analyticsTable.js +166 -0
- package/dist/core/resources/models/analyticsTable.js.map +1 -0
- package/dist/core/resources/models/backendHelpers.js +109 -0
- package/dist/core/resources/models/backendHelpers.js.map +1 -0
- package/dist/core/resources/models/backendRegistry.js +54 -0
- package/dist/core/resources/models/backendRegistry.js.map +1 -0
- package/dist/core/resources/models/bootstrap.js +112 -0
- package/dist/core/resources/models/bootstrap.js.map +1 -0
- package/dist/core/resources/models/embedHook.js +127 -0
- package/dist/core/resources/models/embedHook.js.map +1 -0
- package/dist/core/resources/models/types.js +11 -0
- package/dist/core/resources/models/types.js.map +1 -0
- package/dist/core/resources/replayLogs.js +7 -1
- package/dist/core/resources/replayLogs.js.map +1 -1
- package/dist/core/resources/roles.js +67 -71
- package/dist/core/resources/roles.js.map +1 -1
- package/dist/core/resources/search.js +349 -140
- package/dist/core/resources/search.js.map +1 -1
- package/dist/core/resources/tracked.js +14 -14
- package/dist/core/resources/tracked.js.map +1 -1
- package/dist/core/resources/transaction.js +1 -1
- package/dist/core/resources/transaction.js.map +1 -1
- package/dist/core/resources/transactionBroadcast.js.map +1 -1
- package/dist/core/security/auth.js +34 -25
- package/dist/core/security/auth.js.map +1 -1
- package/dist/core/security/certificateVerification/crlVerification.js +7 -1
- package/dist/core/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/core/security/cryptoHash.js +37 -5
- package/dist/core/security/cryptoHash.js.map +1 -1
- package/dist/core/security/data_objects/PermissionAttributeResponseObject.js +4 -1
- package/dist/core/security/data_objects/PermissionAttributeResponseObject.js.map +1 -1
- package/dist/core/security/data_objects/PermissionResponseObject.js +15 -8
- package/dist/core/security/data_objects/PermissionResponseObject.js.map +1 -1
- package/dist/core/security/data_objects/PermissionTableResponseObject.js +6 -1
- package/dist/core/security/data_objects/PermissionTableResponseObject.js.map +1 -1
- package/dist/core/security/fastifyAuth.js +131 -22
- package/dist/core/security/fastifyAuth.js.map +1 -1
- package/dist/core/security/impersonation.js +15 -15
- package/dist/core/security/jsLoader.js +18 -5
- package/dist/core/security/jsLoader.js.map +1 -1
- package/dist/core/security/keys.js +160 -114
- package/dist/core/security/keys.js.map +1 -1
- package/dist/core/security/permissionsTranslator.js +2 -2
- package/dist/core/security/role.js +70 -35
- package/dist/core/security/role.js.map +1 -1
- package/dist/core/security/tokenAuthentication.js +57 -27
- package/dist/core/security/tokenAuthentication.js.map +1 -1
- package/dist/core/security/user.js +74 -38
- package/dist/core/security/user.js.map +1 -1
- package/dist/core/server/DurableSubscriptionsSession.js +71 -55
- package/dist/core/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/core/server/REST.js +17 -16
- package/dist/core/server/REST.js.map +1 -1
- package/dist/core/server/Server.js +1 -1
- package/dist/core/server/Server.js.map +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getCORSOptions.js +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getHeaderTimeoutConfig.js +1 -1
- package/dist/core/server/fastifyRoutes/helpers/getServerOptions.js +1 -1
- package/dist/core/server/fastifyRoutes.js +34 -30
- package/dist/core/server/fastifyRoutes.js.map +1 -1
- package/dist/core/server/graphqlQuerying.js +8 -7
- package/dist/core/server/graphqlQuerying.js.map +1 -1
- package/dist/core/server/http.js +523 -47
- package/dist/core/server/http.js.map +1 -1
- package/dist/core/server/itc/serverHandlers.js +66 -15
- package/dist/core/server/itc/serverHandlers.js.map +1 -1
- package/dist/core/server/jobs/JobObject.js +53 -7
- package/dist/core/server/jobs/JobObject.js.map +1 -1
- package/dist/core/server/jobs/jobProcess.js +64 -24
- package/dist/core/server/jobs/jobProcess.js.map +1 -1
- package/dist/core/server/jobs/jobRunner.js +68 -30
- package/dist/core/server/jobs/jobRunner.js.map +1 -1
- package/dist/core/server/jobs/jobs.js +93 -61
- package/dist/core/server/jobs/jobs.js.map +1 -1
- package/dist/core/server/loadRootComponents.js +1 -1
- package/dist/core/server/middlewareChain.js +252 -0
- package/dist/core/server/middlewareChain.js.map +1 -0
- package/dist/core/server/mqtt.js +22 -17
- package/dist/core/server/mqtt.js.map +1 -1
- package/dist/core/server/nodeName.js +44 -13
- package/dist/core/server/nodeName.js.map +1 -1
- package/dist/core/server/operationsServer.js +106 -33
- package/dist/core/server/operationsServer.js.map +1 -1
- package/dist/core/server/serverHelpers/Headers.js +2 -0
- package/dist/core/server/serverHelpers/Headers.js.map +1 -1
- package/dist/core/server/serverHelpers/JSONStream.js +12 -3
- package/dist/core/server/serverHelpers/JSONStream.js.map +1 -1
- package/dist/core/server/serverHelpers/Request.js +370 -9
- package/dist/core/server/serverHelpers/Request.js.map +1 -1
- package/dist/core/server/serverHelpers/contentTypes.js +36 -7
- package/dist/core/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/core/server/serverHelpers/multipartParser.js +142 -0
- package/dist/core/server/serverHelpers/multipartParser.js.map +1 -0
- package/dist/core/server/serverHelpers/progressEmitter.js +103 -0
- package/dist/core/server/serverHelpers/progressEmitter.js.map +1 -0
- package/dist/core/server/serverHelpers/serverHandlers.js +38 -7
- package/dist/core/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/core/server/serverHelpers/serverUtilities.js +97 -93
- package/dist/core/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/core/server/static.js +8 -5
- package/dist/core/server/static.js.map +1 -1
- package/dist/core/server/status/index.js +3 -3
- package/dist/core/server/storageReclamation.js +68 -9
- package/dist/core/server/storageReclamation.js.map +1 -1
- package/dist/core/server/threads/itc.js +7 -4
- package/dist/core/server/threads/itc.js.map +1 -1
- package/dist/core/server/threads/manageThreads.js +110 -26
- package/dist/core/server/threads/manageThreads.js.map +1 -1
- package/dist/core/server/threads/socketRouter.js +8 -271
- package/dist/core/server/threads/socketRouter.js.map +1 -1
- package/dist/core/server/threads/threadServer.js +360 -118
- package/dist/core/server/threads/threadServer.js.map +1 -1
- package/dist/core/server/threads/workerProcessGuard.js +114 -0
- package/dist/core/server/threads/workerProcessGuard.js.map +1 -0
- package/dist/core/server/throttle.js +17 -0
- package/dist/core/server/throttle.js.map +1 -1
- package/dist/core/sqlTranslator/SelectValidator.js +86 -47
- package/dist/core/sqlTranslator/SelectValidator.js.map +1 -1
- package/dist/core/sqlTranslator/alasqlFunctionImporter.js +40 -3
- package/dist/core/sqlTranslator/alasqlFunctionImporter.js.map +1 -1
- package/dist/core/sqlTranslator/deleteTranslator.js +48 -14
- package/dist/core/sqlTranslator/deleteTranslator.js.map +1 -1
- package/dist/core/sqlTranslator/index.js +69 -30
- package/dist/core/sqlTranslator/index.js.map +1 -1
- package/dist/core/sqlTranslator/sql_statement_bucket.js +55 -13
- package/dist/core/sqlTranslator/sql_statement_bucket.js.map +1 -1
- package/dist/core/upgrade/UpgradeObjects.js +37 -4
- package/dist/core/upgrade/UpgradeObjects.js.map +1 -1
- package/dist/core/upgrade/directives/5-2-0.js +77 -0
- package/dist/core/upgrade/directives/5-2-0.js.map +1 -0
- package/dist/core/upgrade/directives/directivesController.js +52 -11
- package/dist/core/upgrade/directives/directivesController.js.map +1 -1
- package/dist/core/upgrade/directivesManager.js +53 -18
- package/dist/core/upgrade/directivesManager.js.map +1 -1
- package/dist/core/upgrade/upgradePrompt.js +65 -30
- package/dist/core/upgrade/upgradePrompt.js.map +1 -1
- package/dist/core/upgrade/upgradeUtilities.js +37 -5
- package/dist/core/upgrade/upgradeUtilities.js.map +1 -1
- package/dist/core/utility/OperationFunctionCaller.js +45 -10
- package/dist/core/utility/OperationFunctionCaller.js.map +1 -1
- package/dist/core/utility/assignCmdEnvVariables.js +8 -4
- package/dist/core/utility/assignCmdEnvVariables.js.map +1 -1
- package/dist/core/utility/common_utils.js +140 -79
- package/dist/core/utility/common_utils.js.map +1 -1
- package/dist/core/utility/environment/environmentManager.js +75 -29
- package/dist/core/utility/environment/environmentManager.js.map +1 -1
- package/dist/core/utility/environment/systemInformation.js +27 -16
- package/dist/core/utility/environment/systemInformation.js.map +1 -1
- package/dist/core/utility/errors/commonErrors.js +49 -18
- package/dist/core/utility/errors/commonErrors.js.map +1 -1
- package/dist/core/utility/errors/hdbError.js +65 -26
- package/dist/core/utility/errors/hdbError.js.map +1 -1
- package/dist/core/utility/expandEnvVar.js +113 -0
- package/dist/core/utility/expandEnvVar.js.map +1 -0
- package/dist/core/utility/functions/geo.js +2 -2
- package/dist/core/utility/functions/sql/alaSQLExtension.js +1 -1
- package/dist/core/utility/globalSchema.js +14 -11
- package/dist/core/utility/globalSchema.js.map +1 -1
- package/dist/core/utility/hdbTerms.js +56 -0
- package/dist/core/utility/hdbTerms.js.map +1 -1
- package/dist/core/utility/install/checkJWTTokensExist.js +1 -1
- package/dist/core/utility/install/installer.js +106 -70
- package/dist/core/utility/install/installer.js.map +1 -1
- package/dist/core/utility/installation.js +3 -3
- package/dist/core/utility/lmdb/DBIDefinition.js +5 -1
- package/dist/core/utility/lmdb/DBIDefinition.js.map +1 -1
- package/dist/core/utility/lmdb/DeleteRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/DeleteRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/InsertRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/InsertRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/OpenDBIObject.js +54 -6
- package/dist/core/utility/lmdb/OpenDBIObject.js.map +1 -1
- package/dist/core/utility/lmdb/OpenEnvironmentObject.js +52 -4
- package/dist/core/utility/lmdb/OpenEnvironmentObject.js.map +1 -1
- package/dist/core/utility/lmdb/UpdateRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/UpdateRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/UpsertRecordsResponseObject.js +2 -1
- package/dist/core/utility/lmdb/UpsertRecordsResponseObject.js.map +1 -1
- package/dist/core/utility/lmdb/cleanLMDBMap.js +44 -7
- package/dist/core/utility/lmdb/cleanLMDBMap.js.map +1 -1
- package/dist/core/utility/lmdb/commonUtility.js +46 -17
- package/dist/core/utility/lmdb/commonUtility.js.map +1 -1
- package/dist/core/utility/lmdb/deleteUtility.js +51 -16
- package/dist/core/utility/lmdb/deleteUtility.js.map +1 -1
- package/dist/core/utility/lmdb/environmentUtility.js +91 -51
- package/dist/core/utility/lmdb/environmentUtility.js.map +1 -1
- package/dist/core/utility/lmdb/searchCursorFunctions.js +46 -14
- package/dist/core/utility/lmdb/searchCursorFunctions.js.map +1 -1
- package/dist/core/utility/lmdb/searchUtility.js +91 -55
- package/dist/core/utility/lmdb/searchUtility.js.map +1 -1
- package/dist/core/utility/lmdb/terms.js +12 -22
- package/dist/core/utility/lmdb/terms.js.map +1 -1
- package/dist/core/utility/lmdb/writeUtility.js +61 -28
- package/dist/core/utility/lmdb/writeUtility.js.map +1 -1
- package/dist/core/utility/logging/harper_logger.js +176 -81
- package/dist/core/utility/logging/harper_logger.js.map +1 -1
- package/dist/core/utility/logging/logRotator.js +65 -28
- package/dist/core/utility/logging/logRotator.js.map +1 -1
- package/dist/core/utility/logging/logger.js +4 -4
- package/dist/core/utility/logging/readLog.js +54 -17
- package/dist/core/utility/logging/readLog.js.map +1 -1
- package/dist/core/utility/logging/transactionLog.js +51 -16
- package/dist/core/utility/logging/transactionLog.js.map +1 -1
- package/dist/core/utility/mount_hdb.js +54 -17
- package/dist/core/utility/mount_hdb.js.map +1 -1
- package/dist/core/utility/npmUtilities.js +54 -19
- package/dist/core/utility/npmUtilities.js.map +1 -1
- package/dist/core/utility/operation_authorization.js +135 -86
- package/dist/core/utility/operation_authorization.js.map +1 -1
- package/dist/core/utility/packageUtils.js +7 -17
- package/dist/core/utility/packageUtils.js.map +1 -1
- package/dist/core/utility/password.js +2 -2
- package/dist/core/utility/processManagement/processManagement.js +2 -2
- package/dist/core/utility/processManagement/servicesConfig.js +1 -1
- package/dist/core/utility/signalling.js +51 -16
- package/dist/core/utility/signalling.js.map +1 -1
- package/dist/core/utility/watcherFallback.js +73 -0
- package/dist/core/utility/watcherFallback.js.map +1 -0
- package/dist/core/validation/analyticsValidator.js +79 -0
- package/dist/core/validation/analyticsValidator.js.map +1 -0
- package/dist/core/validation/bulkDeleteValidator.js +49 -11
- package/dist/core/validation/bulkDeleteValidator.js.map +1 -1
- package/dist/core/validation/check_permissions.js +38 -3
- package/dist/core/validation/check_permissions.js.map +1 -1
- package/dist/core/validation/common_validators.js +62 -31
- package/dist/core/validation/common_validators.js.map +1 -1
- package/dist/core/validation/configValidator.js +189 -54
- package/dist/core/validation/configValidator.js.map +1 -1
- package/dist/core/validation/deleteValidator.js +49 -11
- package/dist/core/validation/deleteValidator.js.map +1 -1
- package/dist/core/validation/fileLoadValidator.js +67 -32
- package/dist/core/validation/fileLoadValidator.js.map +1 -1
- package/dist/core/validation/insertValidator.js +48 -10
- package/dist/core/validation/insertValidator.js.map +1 -1
- package/dist/core/validation/installValidator.js +47 -10
- package/dist/core/validation/installValidator.js.map +1 -1
- package/dist/core/validation/readLogValidator.js +60 -22
- package/dist/core/validation/readLogValidator.js.map +1 -1
- package/dist/core/validation/role_validation.js +55 -19
- package/dist/core/validation/role_validation.js.map +1 -1
- package/dist/core/validation/schemaMetadataValidator.js +11 -12
- package/dist/core/validation/schemaMetadataValidator.js.map +1 -1
- package/dist/core/validation/searchValidator.js +82 -43
- package/dist/core/validation/searchValidator.js.map +1 -1
- package/dist/core/validation/transactionLogValidator.js +52 -17
- package/dist/core/validation/transactionLogValidator.js.map +1 -1
- package/dist/core/validation/user_validation.js +38 -6
- package/dist/core/validation/user_validation.js.map +1 -1
- package/dist/core/validation/validationWrapper.js +4 -5
- package/dist/core/validation/validationWrapper.js.map +1 -1
- package/dist/licensing/usageLicensing.js +30 -21
- package/dist/licensing/usageLicensing.js.map +1 -1
- package/dist/replication/knownNodes.js +173 -39
- package/dist/replication/knownNodes.js.map +1 -1
- package/dist/replication/replicationConnection.js +441 -85
- package/dist/replication/replicationConnection.js.map +1 -1
- package/dist/replication/replicator.js +44 -26
- package/dist/replication/replicator.js.map +1 -1
- package/dist/replication/setNode.js +22 -2
- package/dist/replication/setNode.js.map +1 -1
- package/dist/replication/subscriptionManager.js +121 -9
- package/dist/replication/subscriptionManager.js.map +1 -1
- package/dist/security/certificate.js +41 -6
- package/dist/security/certificate.js.map +1 -1
- package/dist/security/sshKeyOperations.js +35 -2
- package/dist/security/sshKeyOperations.js.map +1 -1
- package/licensing/usageLicensing.ts +32 -37
- package/npm-shrinkwrap.json +8994 -4305
- package/package.json +16 -11
- package/replication/DESIGN.md +139 -0
- package/replication/knownNodes.ts +166 -43
- package/replication/replicationConnection.ts +475 -92
- package/replication/replicator.ts +42 -25
- package/replication/setNode.ts +28 -9
- package/replication/subscriptionManager.ts +138 -14
- package/security/certificate.ts +8 -4
- package/security/sshKeyOperations.ts +1 -1
- package/static/defaultConfig.yaml +1 -0
- package/studio/web/assets/{index-CmtPP0YO.js → index-COfIkCT-.js} +5 -5
- package/studio/web/assets/index-COfIkCT-.js.map +1 -0
- package/studio/web/assets/{index.lazy-C8jvGtlu.js → index.lazy-CIvl7Fj9.js} +2 -2
- package/studio/web/assets/{index.lazy-C8jvGtlu.js.map → index.lazy-CIvl7Fj9.js.map} +1 -1
- package/studio/web/assets/{profile-O0DYlJUv.js → profile-B2ZVB--r.js} +2 -2
- package/studio/web/assets/{profile-O0DYlJUv.js.map → profile-B2ZVB--r.js.map} +1 -1
- package/studio/web/assets/{status-BIlJkJby.js → status-Db6WBmhf.js} +2 -2
- package/studio/web/assets/{status-BIlJkJby.js.map → status-Db6WBmhf.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/core/bin/cliOperations.js +0 -159
- package/core/bin/lite.js +0 -5
- package/core/bin/stop.js +0 -21
- package/core/dataLayer/harperBridge/BridgeMethods.js +0 -85
- package/core/utility/globalSchema.js +0 -35
- package/core/utility/lmdb/OpenDBIObject.js +0 -31
- package/studio/web/assets/index-CmtPP0YO.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
2
|
+
import type { Readable } from 'node:stream';
|
|
3
|
+
|
|
4
|
+
export interface SSEMessage {
|
|
5
|
+
event: string;
|
|
6
|
+
data: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
retry?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Parse a Readable carrying Server-Sent Events into structured messages.
|
|
13
|
+
*
|
|
14
|
+
* Yields one `SSEMessage` per blank-line-terminated record. Handles split data: lines,
|
|
15
|
+
* CRLF or LF line endings, and arbitrary chunk boundaries — the underlying Node http
|
|
16
|
+
* Readable does not guarantee chunks align with SSE record boundaries.
|
|
17
|
+
*/
|
|
18
|
+
export async function* parseSSE(stream: Readable): AsyncGenerator<SSEMessage> {
|
|
19
|
+
const decoder = new StringDecoder('utf8');
|
|
20
|
+
let buffer = '';
|
|
21
|
+
for await (const chunk of stream) {
|
|
22
|
+
buffer += typeof chunk === 'string' ? chunk : decoder.write(chunk);
|
|
23
|
+
while (true) {
|
|
24
|
+
const recordEnd = buffer.indexOf('\n\n');
|
|
25
|
+
const crlfEnd = buffer.indexOf('\r\n\r\n');
|
|
26
|
+
let endIdx = -1;
|
|
27
|
+
let delimLen = 0;
|
|
28
|
+
if (recordEnd !== -1 && (crlfEnd === -1 || recordEnd < crlfEnd)) {
|
|
29
|
+
endIdx = recordEnd;
|
|
30
|
+
delimLen = 2;
|
|
31
|
+
} else if (crlfEnd !== -1) {
|
|
32
|
+
endIdx = crlfEnd;
|
|
33
|
+
delimLen = 4;
|
|
34
|
+
}
|
|
35
|
+
if (endIdx === -1) break;
|
|
36
|
+
const record = buffer.slice(0, endIdx);
|
|
37
|
+
buffer = buffer.slice(endIdx + delimLen);
|
|
38
|
+
const msg = parseRecord(record);
|
|
39
|
+
if (msg) yield msg;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
buffer += decoder.end();
|
|
43
|
+
// Any trailing record without a terminating blank line is treated as a final message,
|
|
44
|
+
// matching the looser behavior browsers exhibit on connection close.
|
|
45
|
+
if (buffer.trim()) {
|
|
46
|
+
const msg = parseRecord(buffer);
|
|
47
|
+
if (msg) yield msg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function parseRecord(record: string): SSEMessage | null {
|
|
52
|
+
const lines = record.split(/\r?\n/);
|
|
53
|
+
let event = 'message';
|
|
54
|
+
let id: string | undefined;
|
|
55
|
+
let retry: number | undefined;
|
|
56
|
+
const dataLines: string[] = [];
|
|
57
|
+
for (const line of lines) {
|
|
58
|
+
if (line === '' || line.startsWith(':')) continue;
|
|
59
|
+
const colon = line.indexOf(':');
|
|
60
|
+
const field = colon === -1 ? line : line.slice(0, colon);
|
|
61
|
+
// Per spec, a leading space after the colon is stripped.
|
|
62
|
+
let value = colon === -1 ? '' : line.slice(colon + 1);
|
|
63
|
+
if (value.startsWith(' ')) value = value.slice(1);
|
|
64
|
+
switch (field) {
|
|
65
|
+
case 'event':
|
|
66
|
+
event = value;
|
|
67
|
+
break;
|
|
68
|
+
case 'data':
|
|
69
|
+
dataLines.push(value);
|
|
70
|
+
break;
|
|
71
|
+
case 'id':
|
|
72
|
+
id = value;
|
|
73
|
+
break;
|
|
74
|
+
case 'retry': {
|
|
75
|
+
const n = Number(value);
|
|
76
|
+
if (Number.isFinite(n)) retry = n;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (dataLines.length === 0 && event === 'message') return null;
|
|
82
|
+
return { event, data: dataLines.join('\n'), id, retry };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface RenderState {
|
|
86
|
+
currentPhase?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Render SSE deploy events as terse, line-oriented progress to stderr (so stdout stays
|
|
91
|
+
* reserved for the final JSON/YAML response document). Phase transitions print once.
|
|
92
|
+
*/
|
|
93
|
+
export function renderDeployProgress(message: SSEMessage, state: RenderState, output: NodeJS.WritableStream): void {
|
|
94
|
+
let parsed: unknown;
|
|
95
|
+
try {
|
|
96
|
+
parsed = JSON.parse(message.data);
|
|
97
|
+
} catch {
|
|
98
|
+
parsed = message.data;
|
|
99
|
+
}
|
|
100
|
+
switch (message.event) {
|
|
101
|
+
case 'phase': {
|
|
102
|
+
const p = parsed as { phase?: string; status?: string; rolling?: boolean };
|
|
103
|
+
const label = p.phase ?? '?';
|
|
104
|
+
if (p.status === 'start') {
|
|
105
|
+
if (state.currentPhase !== label) {
|
|
106
|
+
output.write(`${label}…\n`);
|
|
107
|
+
state.currentPhase = label;
|
|
108
|
+
}
|
|
109
|
+
} else if (p.status === 'done') {
|
|
110
|
+
output.write(`${label} done\n`);
|
|
111
|
+
} else if (p.status === 'error') {
|
|
112
|
+
const msg = (parsed as { message?: string }).message ?? 'failed';
|
|
113
|
+
output.write(`${label} ERROR: ${msg}\n`);
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case 'error': {
|
|
118
|
+
const e = parsed as { message?: string; code?: string | number };
|
|
119
|
+
output.write(`error: ${e.message ?? message.data}${e.code ? ` (${e.code})` : ''}\n`);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case 'done':
|
|
123
|
+
// Caller picks up the final result via the SSE iterator; nothing to render here.
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as fs from 'fs-extra';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import * as YAML from 'yaml';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import * as hdbTerms from '../utility/hdbTerms.ts';
|
|
8
|
+
import hdbLog from '../utility/logging/harper_logger.ts';
|
|
9
|
+
import * as systemInformation from '../utility/environment/systemInformation.ts';
|
|
10
|
+
import * as envMgr from '../utility/environment/environmentManager.ts';
|
|
11
|
+
import * as installation from '../utility/installation.ts';
|
|
12
12
|
envMgr.initSync();
|
|
13
13
|
|
|
14
14
|
const STATUSES = {
|
|
@@ -20,10 +20,10 @@ const STATUSES = {
|
|
|
20
20
|
|
|
21
21
|
let hdbRoot;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
export default status;
|
|
24
24
|
|
|
25
25
|
async function status() {
|
|
26
|
-
let status = {
|
|
26
|
+
let status: any = {
|
|
27
27
|
harperdb: {
|
|
28
28
|
status: STATUSES.STOPPED,
|
|
29
29
|
},
|
package/core/bin/stop.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import hdbLogger from '../utility/logging/harper_logger.ts';
|
|
4
|
+
import * as util from 'util';
|
|
5
|
+
import * as childProcess from 'child_process';
|
|
6
|
+
const exec = util.promisify(childProcess.exec);
|
|
7
|
+
import * as systemInformation from '../utility/environment/systemInformation.ts';
|
|
8
|
+
|
|
9
|
+
const STOP_MSG = 'Stopping Harper.';
|
|
10
|
+
|
|
11
|
+
export default stop;
|
|
12
|
+
|
|
13
|
+
async function stop() {
|
|
14
|
+
console.log(STOP_MSG);
|
|
15
|
+
hdbLogger.notify(STOP_MSG);
|
|
16
|
+
|
|
17
|
+
const processes = await systemInformation.getHDBProcessInfo();
|
|
18
|
+
for (const { pid } of processes.core) {
|
|
19
|
+
exec(`kill ${pid}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
package/core/bin/upgrade.js
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
* config file, a data model change requires a re-indexing script is run, etc.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const env = require('../utility/environment/environmentManager.
|
|
9
|
+
const env = require('../utility/environment/environmentManager.ts');
|
|
10
10
|
env.initSync();
|
|
11
11
|
|
|
12
12
|
const chalk = require('chalk');
|
|
13
|
-
const hdbLogger = require('../utility/logging/harper_logger.
|
|
13
|
+
const hdbLogger = require('../utility/logging/harper_logger.ts');
|
|
14
14
|
const hdbTerms = require('../utility/hdbTerms.ts');
|
|
15
|
-
const directivesManager = require('../upgrade/directivesManager.
|
|
15
|
+
const directivesManager = require('../upgrade/directivesManager.ts');
|
|
16
16
|
const installation = require('../utility/installation.ts');
|
|
17
|
-
const hdbInfoController = require('../dataLayer/hdbInfoController.
|
|
18
|
-
const upgradePrompt = require('../upgrade/upgradePrompt.
|
|
19
|
-
const globalSchema = require('../utility/globalSchema.
|
|
17
|
+
const hdbInfoController = require('../dataLayer/hdbInfoController.ts');
|
|
18
|
+
const upgradePrompt = require('../upgrade/upgradePrompt.ts');
|
|
19
|
+
const globalSchema = require('../utility/globalSchema.ts');
|
|
20
20
|
const { packageJson } = require('../utility/packageUtils.js');
|
|
21
21
|
const promisify = require('util').promisify;
|
|
22
22
|
const pSchemaToGlobal = promisify(globalSchema.setSchemaDataToGlobal);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Logger } from '../utility/logging/logger.ts';
|
|
2
2
|
import { getConfigObj, getConfigValue, getConfigPath } from '../config/configUtils.js';
|
|
3
|
-
import { CONFIG_PARAMS } from '../utility/hdbTerms.
|
|
4
|
-
import logger from '../utility/logging/harper_logger.
|
|
3
|
+
import { CONFIG_PARAMS } from '../utility/hdbTerms.ts';
|
|
4
|
+
import logger from '../utility/logging/harper_logger.ts';
|
|
5
|
+
import { broadcastDeployStart, broadcastDeployEnd } from './deployLifecycle.ts';
|
|
5
6
|
|
|
6
7
|
import { dirname, extname, join } from 'node:path';
|
|
7
8
|
import {
|
|
@@ -21,6 +22,7 @@ import { spawn } from 'node:child_process';
|
|
|
21
22
|
import { createReadStream, existsSync, readdirSync } from 'node:fs';
|
|
22
23
|
import { Readable } from 'node:stream';
|
|
23
24
|
import { pipeline } from 'node:stream/promises';
|
|
25
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
24
26
|
|
|
25
27
|
import { extract } from 'tar-fs';
|
|
26
28
|
import gunzip from 'gunzip-maybe';
|
|
@@ -108,6 +110,21 @@ export function assertApplicationConfig(
|
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Returns true when npm/git stderr indicates an SSH authentication failure —
|
|
115
|
+
* git exits 128 with the standard "could not read" message, or the SSH layer
|
|
116
|
+
* reports a missing uid (no SSH daemon user), explicit publickey denial, or
|
|
117
|
+
* an unverified host key.
|
|
118
|
+
*/
|
|
119
|
+
export function isSSHAuthFailure(stderr: string): boolean {
|
|
120
|
+
return (
|
|
121
|
+
stderr.includes('Could not read from remote repository') ||
|
|
122
|
+
stderr.includes('Permission denied (publickey)') ||
|
|
123
|
+
stderr.includes('No user exists for uid') ||
|
|
124
|
+
stderr.includes('Host key verification failed')
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
/**
|
|
112
129
|
* Extract an application given payload (content of the application) or package (npm-compatible identifier to the application).
|
|
113
130
|
*
|
|
@@ -131,11 +148,20 @@ export async function extractApplication(application: Application) {
|
|
|
131
148
|
// Resolve the tarball from the input
|
|
132
149
|
let tarballPath: string;
|
|
133
150
|
let tarball: Readable;
|
|
151
|
+
let shouldDeleteTarball = false;
|
|
152
|
+
|
|
134
153
|
if (application.payload) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
const payload = application.payload;
|
|
155
|
+
if (payload instanceof Readable) {
|
|
156
|
+
// Stream payloads (e.g. multipart file part from the operations API) are piped
|
|
157
|
+
// straight into extraction so multi-GB components don't have to materialize as a Buffer.
|
|
158
|
+
tarball = payload;
|
|
159
|
+
} else if (typeof payload === 'string') {
|
|
160
|
+
// base64 string payload
|
|
161
|
+
tarball = Readable.from(Buffer.from(payload, 'base64'));
|
|
162
|
+
} else {
|
|
163
|
+
tarball = Readable.from(payload as Buffer);
|
|
164
|
+
}
|
|
139
165
|
} else {
|
|
140
166
|
// Given a package, there are a a couple options
|
|
141
167
|
const parentDirPath = dirname(application.dirPath);
|
|
@@ -180,6 +206,12 @@ export async function extractApplication(application: Application) {
|
|
|
180
206
|
parentDirPath
|
|
181
207
|
);
|
|
182
208
|
if (code !== 0) {
|
|
209
|
+
if (isSSHAuthFailure(stderr)) {
|
|
210
|
+
throw new Error(
|
|
211
|
+
`Failed to deploy private repository ${application.packageIdentifier}: SSH access failed. Verify the repository URL, configure an SSH key on this Harper instance, ensure the key has access to the target repository, and confirm the host is present in the ssh/known_hosts file.`,
|
|
212
|
+
{ cause: new Error(stderr) }
|
|
213
|
+
);
|
|
214
|
+
}
|
|
183
215
|
throw new Error(`Failed to download package ${application.packageIdentifier}: ${stderr}`);
|
|
184
216
|
}
|
|
185
217
|
|
|
@@ -196,6 +228,7 @@ export async function extractApplication(application: Application) {
|
|
|
196
228
|
}
|
|
197
229
|
|
|
198
230
|
tarballPath = join(parentDirPath, packResult[0].filename);
|
|
231
|
+
shouldDeleteTarball = true;
|
|
199
232
|
tarball = createReadStream(tarballPath);
|
|
200
233
|
}
|
|
201
234
|
}
|
|
@@ -237,7 +270,7 @@ export async function extractApplication(application: Application) {
|
|
|
237
270
|
}
|
|
238
271
|
|
|
239
272
|
// Clean up the original tarball
|
|
240
|
-
if (tarballPath) {
|
|
273
|
+
if (shouldDeleteTarball && tarballPath) {
|
|
241
274
|
await rm(tarballPath, { force: true });
|
|
242
275
|
}
|
|
243
276
|
}
|
|
@@ -275,12 +308,16 @@ export async function installApplication(application: Application) {
|
|
|
275
308
|
// If custom install command is specified, run it
|
|
276
309
|
if (application.install?.command) {
|
|
277
310
|
const [command, ...args] = application.install.command.split(' ');
|
|
311
|
+
const customOnLine = application.onInstallLine
|
|
312
|
+
? (stream: 'stdout' | 'stderr', line: string) => application.onInstallLine!(command, stream, line)
|
|
313
|
+
: undefined;
|
|
278
314
|
const { stdout, stderr, code } = await nonInteractiveSpawn(
|
|
279
315
|
application.name,
|
|
280
316
|
command,
|
|
281
317
|
args,
|
|
282
318
|
application.dirPath,
|
|
283
|
-
application.install?.timeout
|
|
319
|
+
application.install?.timeout,
|
|
320
|
+
customOnLine
|
|
284
321
|
);
|
|
285
322
|
// if it succeeds, return
|
|
286
323
|
if (code === 0) {
|
|
@@ -331,12 +368,16 @@ export async function installApplication(application: Application) {
|
|
|
331
368
|
// Would result in `pnpm@7` being used as the executable.
|
|
332
369
|
// Important note: an `npm` version should not be specifiable; the only valid npm version is the one installed alongside Node.js
|
|
333
370
|
|
|
371
|
+
const pmOnLine = application.onInstallLine
|
|
372
|
+
? (stream: 'stdout' | 'stderr', line: string) => application.onInstallLine!(packageManager.name, stream, line)
|
|
373
|
+
: undefined;
|
|
334
374
|
const { stdout, stderr, code } = await nonInteractiveSpawn(
|
|
335
375
|
application.name,
|
|
336
376
|
(application.packageManagerPrefix ? application.packageManagerPrefix + ' ' : '') + packageManager.name,
|
|
337
377
|
application.install?.allowInstallScripts ? ['install'] : ['install', '--ignore-scripts'], // All of `npm`, `yarn`, and `pnpm` support the `install` command. If we need to configure options here we may have to use some other defaults though
|
|
338
378
|
application.dirPath,
|
|
339
|
-
application.install?.timeout
|
|
379
|
+
application.install?.timeout,
|
|
380
|
+
pmOnLine
|
|
340
381
|
);
|
|
341
382
|
|
|
342
383
|
// if it succeeds, return
|
|
@@ -383,12 +424,16 @@ export async function installApplication(application: Application) {
|
|
|
383
424
|
const npmInstallArgs = application.install?.allowInstallScripts
|
|
384
425
|
? ['install', '--force']
|
|
385
426
|
: ['install', '--force', '--ignore-scripts'];
|
|
427
|
+
const npmOnLine = application.onInstallLine
|
|
428
|
+
? (stream: 'stdout' | 'stderr', line: string) => application.onInstallLine!('npm', stream, line)
|
|
429
|
+
: undefined;
|
|
386
430
|
const { stdout, stderr, code } = await nonInteractiveSpawn(
|
|
387
431
|
application.name,
|
|
388
432
|
(application.packageManagerPrefix ? application.packageManagerPrefix + ' ' : '') + 'npm',
|
|
389
433
|
npmInstallArgs,
|
|
390
434
|
application.dirPath,
|
|
391
|
-
application.install?.timeout
|
|
435
|
+
application.install?.timeout,
|
|
436
|
+
npmOnLine
|
|
392
437
|
);
|
|
393
438
|
|
|
394
439
|
// if it succeeds, return
|
|
@@ -409,27 +454,39 @@ export async function installApplication(application: Application) {
|
|
|
409
454
|
throw new Error(`Failed to install dependencies for ${application.name} using npm default. Exit code: ${code}`);
|
|
410
455
|
}
|
|
411
456
|
|
|
457
|
+
/**
|
|
458
|
+
* Callback invoked once per complete line of install stdout/stderr from
|
|
459
|
+
* `nonInteractiveSpawn`. Threaded through `installApplication` to the underlying spawn
|
|
460
|
+
* so a deploy can stream `npm install` output back to the caller as an SSE `install`
|
|
461
|
+
* event in real time, rather than waiting for the process to exit. Line-buffered so a
|
|
462
|
+
* chunk that splits mid-line never fires a partial line.
|
|
463
|
+
*/
|
|
464
|
+
export type OnInstallLine = (manager: string, stream: 'stdout' | 'stderr', line: string) => void;
|
|
465
|
+
|
|
412
466
|
interface ApplicationOptions {
|
|
413
467
|
name: string;
|
|
414
|
-
payload?: Buffer | string;
|
|
468
|
+
payload?: Buffer | string | Readable;
|
|
415
469
|
packageIdentifier?: string;
|
|
416
470
|
install?: { command?: string; timeout?: number; allowInstallScripts?: boolean };
|
|
471
|
+
onInstallLine?: OnInstallLine;
|
|
417
472
|
}
|
|
418
473
|
|
|
419
474
|
export class Application {
|
|
420
475
|
name: string;
|
|
421
|
-
payload?: Buffer | string;
|
|
476
|
+
payload?: Buffer | string | Readable;
|
|
422
477
|
packageIdentifier?: string;
|
|
423
478
|
install?: { command?: string; timeout?: number; allowInstallScripts?: boolean };
|
|
479
|
+
onInstallLine?: OnInstallLine;
|
|
424
480
|
dirPath: string;
|
|
425
481
|
logger: Logger;
|
|
426
482
|
packageManagerPrefix: string; // can be used to configure a package manager prefix, specifically "sfw".
|
|
427
483
|
|
|
428
|
-
constructor({ name, payload, packageIdentifier, install }: ApplicationOptions) {
|
|
484
|
+
constructor({ name, payload, packageIdentifier, install, onInstallLine }: ApplicationOptions) {
|
|
429
485
|
this.name = name;
|
|
430
486
|
this.payload = payload;
|
|
431
487
|
this.packageIdentifier = packageIdentifier && derivePackageIdentifier(packageIdentifier);
|
|
432
488
|
this.install = install;
|
|
489
|
+
this.onInstallLine = onInstallLine;
|
|
433
490
|
const componentsRoot = getConfigPath(CONFIG_PARAMS.COMPONENTSROOT);
|
|
434
491
|
if (!componentsRoot) throw new Error('componentsRoot is not configured');
|
|
435
492
|
this.dirPath = join(componentsRoot, name);
|
|
@@ -462,11 +519,24 @@ export function derivePackageIdentifier(packageIdentifier: string) {
|
|
|
462
519
|
*
|
|
463
520
|
* This method should only be called from the main thread
|
|
464
521
|
*
|
|
522
|
+
* Bracketed with `deploy:start`/`deploy:end` lifecycle broadcasts so every
|
|
523
|
+
* Harper thread's file watchers can suppress restart-on-change events while
|
|
524
|
+
* the component directory is being rewritten — see harper#488 and
|
|
525
|
+
* `components/deployLifecycle.ts`. The broadcast is best-effort: if it fails
|
|
526
|
+
* (e.g. workers haven't started yet during initial install), the deploy still
|
|
527
|
+
* proceeds.
|
|
528
|
+
*
|
|
465
529
|
* @param application The application to prepare.
|
|
466
530
|
* @returns A promise that resolves when all preparation steps complete.
|
|
467
531
|
*/
|
|
468
|
-
export function prepareApplication(application: Application) {
|
|
469
|
-
|
|
532
|
+
export async function prepareApplication(application: Application) {
|
|
533
|
+
await broadcastDeployStart(application.name);
|
|
534
|
+
try {
|
|
535
|
+
await extractApplication(application);
|
|
536
|
+
await installApplication(application);
|
|
537
|
+
} finally {
|
|
538
|
+
broadcastDeployEnd(application.name);
|
|
539
|
+
}
|
|
470
540
|
}
|
|
471
541
|
|
|
472
542
|
/**
|
|
@@ -581,12 +651,53 @@ function getGitSSHCommand() {
|
|
|
581
651
|
* @param timeoutMs The timeout for the command in milliseconds. Defaults to 5 minutes.
|
|
582
652
|
* @returns A promise that resolves when the command completes.
|
|
583
653
|
*/
|
|
654
|
+
/**
|
|
655
|
+
* Line-buffered split that emits complete `\n`-terminated lines as they
|
|
656
|
+
* arrive, holding any partial trailing fragment until the next chunk or `flush()`.
|
|
657
|
+
* Required because `child_process` stdout/stderr `'data'` events fire per OS-level
|
|
658
|
+
* chunk, with no guarantee a chunk ends on a newline — without buffering, a long
|
|
659
|
+
* `npm install` line could be reported to the caller as two halves.
|
|
660
|
+
*
|
|
661
|
+
* Uses StringDecoder so a multi-byte UTF-8 character (e.g. the ✔ emoji npm prints
|
|
662
|
+
* for resolved packages) split across two chunks is reassembled into a single code
|
|
663
|
+
* point rather than each half being decoded as replacement characters.
|
|
664
|
+
*/
|
|
665
|
+
function createLineSplitter(onLine: (line: string) => void): {
|
|
666
|
+
push: (chunk: Buffer | string) => void;
|
|
667
|
+
flush: () => void;
|
|
668
|
+
} {
|
|
669
|
+
const decoder = new StringDecoder('utf8');
|
|
670
|
+
let pending = '';
|
|
671
|
+
return {
|
|
672
|
+
push(chunk) {
|
|
673
|
+
pending += typeof chunk === 'string' ? chunk : decoder.write(chunk);
|
|
674
|
+
let nl: number;
|
|
675
|
+
while ((nl = pending.indexOf('\n')) !== -1) {
|
|
676
|
+
const line = pending.slice(0, nl).replace(/\r$/, '');
|
|
677
|
+
pending = pending.slice(nl + 1);
|
|
678
|
+
onLine(line);
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
flush() {
|
|
682
|
+
// Drain any bytes the decoder is still holding (e.g. a multi-byte char that
|
|
683
|
+
// straddled the final chunk boundary).
|
|
684
|
+
const remaining = decoder.end();
|
|
685
|
+
if (remaining) pending += remaining;
|
|
686
|
+
if (pending.length > 0) {
|
|
687
|
+
onLine(pending);
|
|
688
|
+
pending = '';
|
|
689
|
+
}
|
|
690
|
+
},
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
|
|
584
694
|
export function nonInteractiveSpawn(
|
|
585
695
|
applicationName: string,
|
|
586
696
|
command: string,
|
|
587
697
|
args: string[],
|
|
588
698
|
cwd: string,
|
|
589
|
-
timeoutMs: number = 60 * 60 * 1000
|
|
699
|
+
timeoutMs: number = 60 * 60 * 1000,
|
|
700
|
+
onLine?: (stream: 'stdout' | 'stderr', line: string) => void
|
|
590
701
|
): Promise<{ stdout: string; stderr: string; code: number }> {
|
|
591
702
|
return new Promise((resolve, reject) => {
|
|
592
703
|
logger
|
|
@@ -600,6 +711,10 @@ export function nonInteractiveSpawn(
|
|
|
600
711
|
env.GIT_SSH_COMMAND = gitSSHCommand;
|
|
601
712
|
}
|
|
602
713
|
|
|
714
|
+
if (process.platform === 'win32' && command === 'npm') {
|
|
715
|
+
command = 'npm.cmd';
|
|
716
|
+
}
|
|
717
|
+
|
|
603
718
|
const childProcess = spawn(command, args, {
|
|
604
719
|
shell: true,
|
|
605
720
|
cwd,
|
|
@@ -612,24 +727,31 @@ export function nonInteractiveSpawn(
|
|
|
612
727
|
reject(new Error(`Command\`${command} ${args.join(' ')}\` timed out after ${timeoutMs}ms`));
|
|
613
728
|
}, timeoutMs);
|
|
614
729
|
|
|
730
|
+
// If a caller passed onLine, line-buffer stdout/stderr alongside the existing
|
|
731
|
+
// string accumulation so we never report a half-line.
|
|
732
|
+
const stdoutSplitter = onLine ? createLineSplitter((line) => onLine('stdout', line)) : null;
|
|
733
|
+
const stderrSplitter = onLine ? createLineSplitter((line) => onLine('stderr', line)) : null;
|
|
734
|
+
|
|
615
735
|
let stdout = '';
|
|
616
736
|
childProcess.stdout.on('data', (chunk) => {
|
|
617
737
|
// buffer stdout for later resolve
|
|
618
738
|
stdout += chunk.toString();
|
|
619
739
|
// log stdout lines immediately
|
|
620
|
-
// TODO: Technically nothing guarantees that a chunk will be a complete line so need to implement
|
|
621
|
-
// something here to buffer until a newline character, then log the complete line
|
|
622
740
|
logger.loggerWithTag(`${applicationName}:spawn:${command}:stdout`).debug?.(chunk.toString());
|
|
741
|
+
stdoutSplitter?.push(chunk);
|
|
623
742
|
});
|
|
624
743
|
|
|
625
744
|
// buffer stderr
|
|
626
745
|
let stderr = '';
|
|
627
746
|
childProcess.stderr.on('data', (chunk) => {
|
|
628
747
|
stderr += chunk.toString();
|
|
748
|
+
stderrSplitter?.push(chunk);
|
|
629
749
|
});
|
|
630
750
|
|
|
631
751
|
childProcess.on('error', (error) => {
|
|
632
752
|
clearTimeout(timeout);
|
|
753
|
+
stdoutSplitter?.flush();
|
|
754
|
+
stderrSplitter?.flush();
|
|
633
755
|
// Print out stderr before rejecting
|
|
634
756
|
if (stderr) {
|
|
635
757
|
printStd(applicationName, command, stderr, 'stderr');
|
|
@@ -639,6 +761,10 @@ export function nonInteractiveSpawn(
|
|
|
639
761
|
|
|
640
762
|
childProcess.on('close', (code) => {
|
|
641
763
|
clearTimeout(timeout);
|
|
764
|
+
// Flush any trailing partial lines so the caller sees process output that didn't
|
|
765
|
+
// end on a newline (some package managers do this on their final progress line).
|
|
766
|
+
stdoutSplitter?.flush();
|
|
767
|
+
stderrSplitter?.flush();
|
|
642
768
|
if (stderr) {
|
|
643
769
|
printStd(applicationName, command, stderr, 'stderr');
|
|
644
770
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Resources } from '../resources/Resources.ts';
|
|
2
2
|
import { type Server } from '../server/Server.ts';
|
|
3
|
-
import { forComponent } from '../utility/logging/harper_logger.
|
|
3
|
+
import { forComponent } from '../utility/logging/harper_logger.ts';
|
|
4
4
|
import { scopedImport } from '../security/jsLoader.ts';
|
|
5
|
-
import * as env from '../utility/environment/environmentManager.
|
|
5
|
+
import * as env from '../utility/environment/environmentManager.ts';
|
|
6
6
|
import { CONFIG_PARAMS } from '../utility/hdbTerms.ts';
|
|
7
7
|
|
|
8
8
|
export class MissingDefaultFilesOptionError extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isMainThread } from 'node:worker_threads';
|
|
2
2
|
import fg from 'fast-glob';
|
|
3
3
|
import { Resources } from '../resources/Resources.ts';
|
|
4
|
-
import harperLogger from '../utility/logging/harper_logger.
|
|
4
|
+
import harperLogger from '../utility/logging/harper_logger.ts';
|
|
5
5
|
import { resolveBaseURLPath } from './resolveBaseURLPath.ts';
|
|
6
6
|
import { deriveGlobOptions, FastGlobOptions, FilesOption } from './deriveGlobOptions.ts';
|
|
7
7
|
import { basename, join } from 'node:path';
|
|
@@ -33,7 +33,7 @@ interface ComponentV1Details {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export class ComponentV1 {
|
|
36
|
-
readonly config:
|
|
36
|
+
readonly config: ComponentV1Config;
|
|
37
37
|
readonly name: string;
|
|
38
38
|
readonly directory: string;
|
|
39
39
|
readonly module: Readonly<ComponentV1Module>;
|