@harperfast/harper 5.3.0-alpha.1 → 5.3.0-beta.2
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/bin/cliOperations.ts +12 -0
- package/bin/restart.ts +66 -6
- package/components/Application.ts +1134 -112
- package/components/DESIGN.md +421 -0
- package/components/OptionsWatcher.ts +368 -102
- package/components/Scope.ts +20 -1
- package/components/componentLoader.ts +43 -4
- package/components/deploymentOperations.ts +4 -1
- package/components/deploymentRecorder.ts +9 -2
- package/components/mcp/DESIGN.md +109 -0
- package/components/mcp/audit.ts +21 -17
- package/components/operations.js +284 -52
- package/components/operationsValidation.js +49 -2
- package/components/packageComponent.ts +25 -1
- package/components/requestRestart.ts +11 -0
- package/config/DESIGN.md +306 -0
- package/config/RootConfigWatcher.ts +191 -37
- package/config/configReadRetry.ts +62 -0
- package/config/configUtils.ts +78 -26
- package/config/parseConfigFile.ts +34 -0
- package/config/readConfigFileSync.ts +44 -0
- package/config/watcherArming.ts +59 -0
- package/config-root.schema.json +4 -0
- package/dataLayer/DESIGN.md +179 -0
- package/dataLayer/harperBridge/ResourceBridge.ts +28 -2
- package/dataLayer/restoreMarker.ts +92 -25
- package/dist/bin/cliOperations.js +13 -0
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/restart.js +42 -6
- package/dist/bin/restart.js.map +1 -1
- package/dist/components/Application.d.ts +104 -9
- package/dist/components/Application.js +954 -102
- package/dist/components/Application.js.map +1 -1
- package/dist/components/OptionsWatcher.d.ts +4 -1
- package/dist/components/OptionsWatcher.js +378 -104
- package/dist/components/OptionsWatcher.js.map +1 -1
- package/dist/components/Scope.js +15 -1
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/componentLoader.js +35 -3
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/deploymentOperations.js +4 -1
- package/dist/components/deploymentOperations.js.map +1 -1
- package/dist/components/deploymentRecorder.d.ts +4 -2
- package/dist/components/deploymentRecorder.js +1 -0
- package/dist/components/deploymentRecorder.js.map +1 -1
- package/dist/components/mcp/audit.d.ts +2 -1
- package/dist/components/mcp/audit.js +21 -17
- package/dist/components/mcp/audit.js.map +1 -1
- package/dist/components/operations.d.ts +28 -0
- package/dist/components/operations.js +263 -54
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.js +48 -2
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/components/packageComponent.js +24 -0
- package/dist/components/packageComponent.js.map +1 -1
- package/dist/components/requestRestart.d.ts +1 -0
- package/dist/components/requestRestart.js +7 -0
- package/dist/components/requestRestart.js.map +1 -1
- package/dist/config/RootConfigWatcher.d.ts +2 -0
- package/dist/config/RootConfigWatcher.js +189 -35
- package/dist/config/RootConfigWatcher.js.map +1 -1
- package/dist/config/configReadRetry.d.ts +8 -0
- package/dist/config/configReadRetry.js +62 -0
- package/dist/config/configReadRetry.js.map +1 -0
- package/dist/config/configUtils.d.ts +10 -9
- package/dist/config/configUtils.js +63 -27
- package/dist/config/configUtils.js.map +1 -1
- package/dist/config/parseConfigFile.d.ts +4 -0
- package/dist/config/parseConfigFile.js +35 -0
- package/dist/config/parseConfigFile.js.map +1 -0
- package/dist/config/readConfigFileSync.d.ts +1 -0
- package/dist/config/readConfigFileSync.js +47 -0
- package/dist/config/readConfigFileSync.js.map +1 -0
- package/dist/config/watcherArming.d.ts +15 -0
- package/dist/config/watcherArming.js +59 -0
- package/dist/config/watcherArming.js.map +1 -0
- package/dist/dataLayer/harperBridge/ResourceBridge.js +21 -2
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/restoreMarker.d.ts +21 -8
- package/dist/dataLayer/restoreMarker.js +94 -27
- package/dist/dataLayer/restoreMarker.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +3 -0
- package/dist/resources/DatabaseTransaction.d.ts +25 -0
- package/dist/resources/DatabaseTransaction.js +224 -18
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +2 -1
- package/dist/resources/LMDBTransaction.js +22 -3
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/PrimaryRocksDatabase.js +22 -6
- package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
- package/dist/resources/RecordEncoder.d.ts +1 -1
- package/dist/resources/RecordEncoder.js +46 -10
- package/dist/resources/RecordEncoder.js.map +1 -1
- package/dist/resources/Resource.js +97 -13
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/ResourceInterface.d.ts +8 -0
- package/dist/resources/RocksIndexStore.js +2 -1
- package/dist/resources/RocksIndexStore.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +10 -0
- package/dist/resources/RocksTransactionLogStore.js +104 -33
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/Table.d.ts +58 -7
- package/dist/resources/Table.js +1143 -348
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/analytics/write.d.ts +3 -0
- package/dist/resources/analytics/write.js +49 -16
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/auditStore.d.ts +170 -0
- package/dist/resources/auditStore.js +457 -11
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/crdt.d.ts +10 -0
- package/dist/resources/crdt.js +22 -0
- package/dist/resources/crdt.js.map +1 -1
- package/dist/resources/dataLoader.js +3 -4
- package/dist/resources/dataLoader.js.map +1 -1
- package/dist/resources/databases.d.ts +16 -13
- package/dist/resources/databases.js +625 -177
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/derivedIndexRegistry.d.ts +5 -0
- package/dist/resources/derivedIndexRegistry.js +68 -0
- package/dist/resources/derivedIndexRegistry.js.map +1 -0
- package/dist/resources/derivedIndexRuntime.d.ts +215 -0
- package/dist/resources/derivedIndexRuntime.js +2027 -0
- package/dist/resources/derivedIndexRuntime.js.map +1 -0
- package/dist/resources/graphql.js +3 -2
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.d.ts +102 -9
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js +867 -39
- package/dist/resources/indexes/HierarchicalNavigableSmallWorld.js.map +1 -1
- package/dist/resources/indexes/fullTextDerivedIndex.d.ts +81 -0
- package/dist/resources/indexes/fullTextDerivedIndex.js +1004 -0
- package/dist/resources/indexes/fullTextDerivedIndex.js.map +1 -0
- package/dist/resources/indexes/fullTextNativeBinding.d.ts +78 -0
- package/dist/resources/indexes/fullTextNativeBinding.js +85 -0
- package/dist/resources/indexes/fullTextNativeBinding.js.map +1 -0
- package/dist/resources/indexes/hnswDerivedIndex.d.ts +67 -0
- package/dist/resources/indexes/hnswDerivedIndex.js +464 -0
- package/dist/resources/indexes/hnswDerivedIndex.js.map +1 -0
- package/dist/resources/indexes/hnswPlaneBinding.d.ts +65 -0
- package/dist/resources/indexes/hnswPlaneBinding.js +91 -0
- package/dist/resources/indexes/hnswPlaneBinding.js.map +1 -0
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.d.ts +24 -0
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js +149 -0
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js.map +1 -0
- package/dist/resources/nodeIdMapping.d.ts +5 -0
- package/dist/resources/nodeIdMapping.js +49 -0
- package/dist/resources/nodeIdMapping.js.map +1 -1
- package/dist/resources/recordLock.d.ts +47 -4
- package/dist/resources/recordLock.js +138 -7
- package/dist/resources/recordLock.js.map +1 -1
- package/dist/resources/recordLockCoordinator.d.ts +557 -0
- package/dist/resources/recordLockCoordinator.js +2597 -0
- package/dist/resources/recordLockCoordinator.js.map +1 -0
- package/dist/resources/replayLogs.js +5 -0
- package/dist/resources/replayLogs.js.map +1 -1
- package/dist/resources/replicatedApplyFailure.d.ts +16 -0
- package/dist/resources/replicatedApplyFailure.js +63 -0
- package/dist/resources/replicatedApplyFailure.js.map +1 -0
- package/dist/resources/scheduler/scheduler.js +3 -3
- package/dist/resources/scheduler/scheduler.js.map +1 -1
- package/dist/resources/search.d.ts +10 -4
- package/dist/resources/search.js +160 -40
- package/dist/resources/search.js.map +1 -1
- package/dist/resources/tracked.d.ts +5 -1
- package/dist/resources/tracked.js +74 -23
- package/dist/resources/tracked.js.map +1 -1
- package/dist/resources/transactionBroadcast.js +4 -6
- package/dist/resources/transactionBroadcast.js.map +1 -1
- package/dist/security/auth.js +59 -23
- package/dist/security/auth.js.map +1 -1
- package/dist/security/deferredAuthentication.d.ts +11 -0
- package/dist/security/deferredAuthentication.js +25 -3
- package/dist/security/deferredAuthentication.js.map +1 -1
- package/dist/security/jsLoader.js +9 -4
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/server/REST.js +39 -5
- package/dist/server/REST.js.map +1 -1
- package/dist/server/http.d.ts +5 -1
- package/dist/server/http.js +34 -2
- package/dist/server/http.js.map +1 -1
- package/dist/server/mqtt.js +5 -1
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/serverHelpers/Headers.d.ts +2 -0
- package/dist/server/serverHelpers/Headers.js +6 -0
- package/dist/server/serverHelpers/Headers.js.map +1 -1
- package/dist/server/serverHelpers/NodeAdapterResponse.d.ts +48 -0
- package/dist/server/serverHelpers/NodeAdapterResponse.js +220 -0
- package/dist/server/serverHelpers/NodeAdapterResponse.js.map +1 -0
- package/dist/server/serverHelpers/Request.d.ts +5 -10
- package/dist/server/serverHelpers/Request.js +38 -136
- package/dist/server/serverHelpers/Request.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.d.ts +2 -0
- package/dist/server/serverHelpers/contentTypes.js +189 -15
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/serverUtilities.d.ts +3 -3
- package/dist/server/serverHelpers/serverUtilities.js +110 -20
- package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
- package/dist/server/serverHelpers/uwsServer.js +4 -1
- package/dist/server/serverHelpers/uwsServer.js.map +1 -1
- package/dist/server/serverHelpers/webSocketCloseReason.d.ts +2 -0
- package/dist/server/serverHelpers/webSocketCloseReason.js +29 -0
- package/dist/server/serverHelpers/webSocketCloseReason.js.map +1 -0
- package/dist/server/storageReclamation.js +1 -1
- package/dist/server/storageReclamation.js.map +1 -1
- package/dist/server/threads/isolatedApplications.d.ts +47 -0
- package/dist/server/threads/isolatedApplications.js +171 -0
- package/dist/server/threads/isolatedApplications.js.map +1 -0
- package/dist/server/threads/logRotationTransport.d.ts +1 -0
- package/dist/server/threads/logRotationTransport.js +33 -0
- package/dist/server/threads/logRotationTransport.js.map +1 -0
- package/dist/server/threads/manageThreads.d.ts +64 -6
- package/dist/server/threads/manageThreads.js +261 -12
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/socketRouter.d.ts +1 -0
- package/dist/server/threads/socketRouter.js +196 -13
- package/dist/server/threads/socketRouter.js.map +1 -1
- package/dist/server/threads/threadServer.js +30 -7
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +24 -0
- package/dist/utility/errors/hdbError.js +58 -1
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +2 -0
- package/dist/utility/hdbTerms.js +2 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/logging/harper_logger.js +218 -38
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/logGenerationCoordinator.d.ts +35 -0
- package/dist/utility/logging/logGenerationCoordinator.js +184 -0
- package/dist/utility/logging/logGenerationCoordinator.js.map +1 -0
- package/dist/utility/logging/logRotation.d.ts +46 -0
- package/dist/utility/logging/logRotation.js +365 -0
- package/dist/utility/logging/logRotation.js.map +1 -0
- package/dist/utility/logging/logRotator.d.ts +1 -1
- package/dist/utility/logging/logRotator.js +172 -92
- package/dist/utility/logging/logRotator.js.map +1 -1
- package/dist/utility/npmUtilities.js +6 -4
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/utility/watcherFallback.d.ts +0 -45
- package/dist/utility/watcherFallback.js +1 -125
- package/dist/utility/watcherFallback.js.map +1 -1
- package/dist/validation/configValidator.js +6 -3
- package/dist/validation/configValidator.js.map +1 -1
- package/index.ts +9 -0
- package/json/systemSchema.json +3 -0
- package/npm-shrinkwrap.json +177 -87
- package/package.json +13 -5
- package/resources/DESIGN.md +689 -19
- package/resources/DatabaseTransaction.ts +230 -17
- package/resources/LMDBTransaction.ts +21 -3
- package/resources/PrimaryRocksDatabase.ts +20 -7
- package/resources/RecordEncoder.ts +52 -10
- package/resources/Resource.ts +97 -13
- package/resources/ResourceInterface.ts +8 -0
- package/resources/RocksIndexStore.ts +2 -1
- package/resources/RocksTransactionLogStore.ts +111 -31
- package/resources/Table.ts +1273 -396
- package/resources/analytics/DESIGN.md +38 -0
- package/resources/analytics/write.ts +50 -17
- package/resources/auditStore.ts +460 -11
- package/resources/crdt.ts +22 -0
- package/resources/dataLoader.ts +3 -4
- package/resources/databases.ts +611 -147
- package/resources/derivedIndexRegistry.ts +56 -0
- package/resources/derivedIndexRuntime.ts +2292 -0
- package/resources/graphql.ts +3 -2
- package/resources/indexes/DESIGN.md +833 -0
- package/resources/indexes/HierarchicalNavigableSmallWorld.ts +924 -46
- package/resources/indexes/fullTextDerivedIndex.ts +1165 -0
- package/resources/indexes/fullTextNativeBinding.ts +146 -0
- package/resources/indexes/hnswDerivedIndex.ts +531 -0
- package/resources/indexes/hnswPlaneBinding.ts +174 -0
- package/resources/indexes/nativeFullTextDerivedIndexLifecycle.ts +181 -0
- package/resources/nodeIdMapping.ts +50 -0
- package/resources/record-locks.md +1407 -0
- package/resources/recordLock.ts +173 -7
- package/resources/recordLockCoordinator.ts +3082 -0
- package/resources/replayLogs.ts +5 -0
- package/resources/replicatedApplyFailure.ts +77 -0
- package/resources/scheduler/DESIGN.md +40 -0
- package/resources/scheduler/scheduler.ts +4 -4
- package/resources/search.ts +169 -49
- package/resources/tracked.ts +73 -22
- package/resources/transactionBroadcast.ts +4 -4
- package/security/DESIGN.md +175 -0
- package/security/auth.ts +53 -24
- package/security/deferredAuthentication.ts +24 -2
- package/security/jsLoader.ts +9 -4
- package/server/DESIGN.md +275 -0
- package/server/REST.ts +42 -6
- package/server/http.ts +34 -2
- package/server/mqtt.ts +6 -4
- package/server/serverHelpers/Headers.ts +5 -1
- package/server/serverHelpers/NodeAdapterResponse.ts +221 -0
- package/server/serverHelpers/Request.ts +33 -131
- package/server/serverHelpers/contentTypes.ts +188 -15
- package/server/serverHelpers/serverUtilities.ts +157 -27
- package/server/serverHelpers/uwsServer.ts +4 -1
- package/server/serverHelpers/webSocketCloseReason.ts +25 -0
- package/server/storageReclamation.ts +2 -2
- package/server/threads/isolatedApplications.ts +157 -0
- package/server/threads/logRotationTransport.ts +40 -0
- package/server/threads/manageThreads.js +254 -12
- package/server/threads/socketRouter.ts +217 -11
- package/server/threads/threadServer.js +30 -7
- package/studio/web/assets/{Chat-BnCBegQz.js → Chat-DADFFGe_.js} +1 -1
- package/studio/web/assets/{FloatingChat-CoDW1ySS.js → FloatingChat-D_mI-rZ7.js} +3 -3
- package/studio/web/assets/{apiToken-Bwk5BLXW.js → apiToken-c2NiSDHa.js} +1 -1
- package/studio/web/assets/{applications-DHxGi7JH.js → applications-DktUqh7G.js} +1 -1
- package/studio/web/assets/{cssMode-s0cWI-_M.js → cssMode-Cs_75Xhw.js} +1 -1
- package/studio/web/assets/{editor-DNcRHK54.js → editor-19b-Y1IN.js} +1 -1
- package/studio/web/assets/{html-Bdssedlg.js → html-DiYEQMpB.js} +1 -1
- package/studio/web/assets/{htmlMode-CoDlJ3fw.js → htmlMode-CmR0y7P_.js} +1 -1
- package/studio/web/assets/{index-D6sxmFLR.js → index-Dm0rfkJ7.js} +5 -5
- package/studio/web/assets/{index.lazy-tmU5BS8s.js → index.lazy-7vqt2CC3.js} +1 -1
- package/studio/web/assets/{javascript-B8meVSTH.js → javascript-BWtCFuOt.js} +1 -1
- package/studio/web/assets/{jsonMode-DpIPd35T.js → jsonMode-Buzzbv9y.js} +1 -1
- package/studio/web/assets/{languageServices-C_5FMJzQ.js → languageServices-SqsFWfTM.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-BIzNBzPK.js → lspLanguageFeatures-EMV5cmjo.js} +1 -1
- package/studio/web/assets/{notifications-CvZivSbh.js → notifications-CAB-LZWT.js} +1 -1
- package/studio/web/assets/{notifications-CQf18QKb.js → notifications-DRzmSRxM.js} +1 -1
- package/studio/web/assets/{profile-DdOwtntb.js → profile-BNKAl79n.js} +1 -1
- package/studio/web/assets/{regions-n69fwagr.js → regions-CUow_Zw2.js} +1 -1
- package/studio/web/assets/{register-PfWTCXWB.js → register-Dkt3WUMp.js} +2 -2
- package/studio/web/assets/{setComponentFile-Bg6O7X0S.js → setComponentFile-BZRfMD0N.js} +1 -1
- package/studio/web/assets/{setup-CUx_aUDl.js → setup-D_yiEPO2.js} +2 -2
- package/studio/web/assets/{status-D7BVKqX9.js → status-DhHh1Ge-.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-DBSyXzMr.js → toggleHighContrast-D7L1PDtV.js} +1 -1
- package/studio/web/assets/{tsMode-BByKCjBS.js → tsMode-CCwLk1YS.js} +1 -1
- package/studio/web/assets/{typescript-DDLnLpw9.js → typescript-BP1j1mjn.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-31CHGaHk.js → useEntityRestURL-D7bnYxLw.js} +1 -1
- package/studio/web/assets/{workers-pR3jRY9D.js → workers-tOuCNT17.js} +1 -1
- package/studio/web/assets/{xml-2iRnMhQO.js → xml-BSG_3mQT.js} +1 -1
- package/studio/web/assets/{yaml-Bf92gJpd.js → yaml-DxiLprBB.js} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/DESIGN.md +55 -0
- package/utility/errors/hdbError.ts +54 -0
- package/utility/hdbTerms.ts +2 -0
- package/utility/logging/harper_logger.ts +210 -30
- package/utility/logging/logGenerationCoordinator.ts +196 -0
- package/utility/logging/logRotation.ts +367 -0
- package/utility/logging/logRotator.ts +196 -91
- package/utility/npmUtilities.ts +6 -4
- package/utility/watcherFallback.ts +0 -122
- package/validation/configValidator.ts +6 -3
|
@@ -30,6 +30,8 @@ interface ApplicationConfig {
|
|
|
30
30
|
* Per-application globals are a property of thread-level isolation, not of branching.
|
|
31
31
|
*/
|
|
32
32
|
branchedDatabases?: string[] | true;
|
|
33
|
+
/** Run in a worker thread of its own that loads no other application. */
|
|
34
|
+
isolated?: boolean;
|
|
33
35
|
[key: string]: unknown;
|
|
34
36
|
}
|
|
35
37
|
export declare class InvalidPackageIdentifierError extends TypeError {
|
|
@@ -54,6 +56,7 @@ export declare class InvalidCredentialEntryError extends TypeError {
|
|
|
54
56
|
constructor(applicationName: string);
|
|
55
57
|
}
|
|
56
58
|
export declare function assertApplicationConfig(applicationName: string, applicationConfig: Record<'package', unknown> & Record<string, unknown>): asserts applicationConfig is ApplicationConfig;
|
|
59
|
+
export declare function assertIsolationConfig(applicationName: string, isolated: unknown): void;
|
|
57
60
|
/**
|
|
58
61
|
* A branch that cannot be honoured fails the application's load: falling back would hand it the
|
|
59
62
|
* shared database it asked not to have, with no signal that it happened.
|
|
@@ -113,12 +116,56 @@ export declare function installedRuntimeChanged(previous: InstalledPackageMetada
|
|
|
113
116
|
* threads by the preparation lock below.
|
|
114
117
|
*/
|
|
115
118
|
export declare function extractApplication(application: Application, deferCommit?: boolean): Promise<ExtractionTransaction | undefined>;
|
|
119
|
+
/** `deployment_stagingRetention_maxCount`; 0 keeps none. Only a number or numeric string counts, so `true`/`[]`/blank cannot become "keep nothing". */
|
|
120
|
+
export declare function getStagingRetentionMaxCount(): number;
|
|
121
|
+
type DormantBuild = {
|
|
122
|
+
deploymentDirPath: string;
|
|
123
|
+
deploymentId: string;
|
|
124
|
+
completedAt: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Remove the oldest dormant builds beyond `maxCount`. The caller must hold the component's preparation lock;
|
|
128
|
+
* every catalogued build is re-derived under it before the kept set is chosen, so a catalog read unlocked
|
|
129
|
+
* cannot hold or miss a slot. Never throws: a failure must neither fail a component closed nor replace a
|
|
130
|
+
* deploy's own error.
|
|
131
|
+
*
|
|
132
|
+
* `pinnedDeploymentId` is never evicted. A delayed activation runs this preamble under the same lock it is
|
|
133
|
+
* about to activate under, so without the pin retention would delete the artifact the request named —
|
|
134
|
+
* immediately, when the knob is `0`. The pin is applied after the kept set is chosen, so a pinned build in
|
|
135
|
+
* the eviction tail leaves `maxCount + 1` on disk for the life of the request; the next preamble that does
|
|
136
|
+
* not pin it brings the count back down.
|
|
137
|
+
*/
|
|
138
|
+
export declare function pruneDormantBuilds(componentName: string, builds: DormantBuild[], maxCount: number, pinnedDeploymentId?: string): Promise<void>;
|
|
139
|
+
export type ArtifactDescriptor = {
|
|
140
|
+
v: number;
|
|
141
|
+
component: string;
|
|
142
|
+
/** The root-config entry to publish with the activation; `null` for a payload build, which owns none. */
|
|
143
|
+
rootConfig: Record<string, unknown> | null;
|
|
144
|
+
installationIsOpaque: boolean;
|
|
145
|
+
isolated: boolean;
|
|
146
|
+
};
|
|
116
147
|
/** Where a candidate build lives: `<root>/.deploy-staging/<deploymentId>/<component>`. */
|
|
117
148
|
export declare function candidateApplicationPath(componentDirPath: string, deploymentId: string): string;
|
|
118
149
|
export declare function makeRollbackPlaceholderMovable(applicationDirPath: string, placeholderIdentity: {
|
|
119
150
|
dev: bigint;
|
|
120
151
|
ino: bigint;
|
|
121
152
|
} | undefined): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Name the component that owns a deployment directory THIS CALL created, and take the directory back if that
|
|
155
|
+
* cannot be recorded.
|
|
156
|
+
*
|
|
157
|
+
* Ownership is published as part of the claim rather than at certification, because resolving and packing can
|
|
158
|
+
* take minutes and until a tree exists to infer an owner from, a directory answering to nobody is one another
|
|
159
|
+
* component will take for abandoned. Unattributed is a permanent refusal, though, so a failure here — a full
|
|
160
|
+
* disk, an EIO on the temp write or its sync — would burn this deployment id for good, every retry refused by
|
|
161
|
+
* its own wreckage. The removal is scoped to the directory this invocation made, and deliberately not
|
|
162
|
+
* broadened to one found by EEXIST: that directory may be another claimant's, and removing it is the race the
|
|
163
|
+
* refusal exists to prevent. Best-effort, because the claim failure is what the caller needs to see.
|
|
164
|
+
*
|
|
165
|
+
* `write` is a parameter so the failure is testable without a filesystem that can be made to fail on exactly
|
|
166
|
+
* this write and nothing else.
|
|
167
|
+
*/
|
|
168
|
+
export declare function publishClaimOwnership(deploymentDirPath: string, componentName: string, write?: (filePath: string, contents: string) => Promise<void>): Promise<void>;
|
|
122
169
|
/**
|
|
123
170
|
* The components a deployment's evidence implicates, when its journal and its ownership sidecar disagree
|
|
124
171
|
* about whose it is — or `undefined` when there is no disagreement to act on.
|
|
@@ -156,18 +203,32 @@ export declare function unsettleableComponentsFromDisk(componentsRootDirPath: st
|
|
|
156
203
|
*
|
|
157
204
|
*/
|
|
158
205
|
export declare function recoverInterruptedActivations(componentsRootDirPath: string): Promise<Map<string, Error>>;
|
|
206
|
+
/**
|
|
207
|
+
* Finish one owner's catalogued dormant builds after the scan. The catalog was read without the lock, so a
|
|
208
|
+
* deploy may have published a journal into one of these directories since — and if it then died mid-swap,
|
|
209
|
+
* only settlement brings the component back. So: settle any journal that appeared, then bound what is still
|
|
210
|
+
* dormant. The lock is taken only when there is something to do; a lock a live deploy holds is the same
|
|
211
|
+
* deferral the residue branch records.
|
|
212
|
+
*/
|
|
213
|
+
export declare function reconcileDormantBuilds(componentsRootDirPath: string, owner: string, builds: DormantBuild[], maxCount: number): Promise<Map<string, Error>>;
|
|
159
214
|
export declare function markCandidateComplete(componentDirPath: string, deploymentId: string, componentName: string): Promise<void>;
|
|
160
215
|
/**
|
|
161
216
|
* Make a built and validated candidate live, as one compensating transaction over two effects: the live tree
|
|
162
|
-
* moves aside, then the candidate takes its place. Root config is NOT one of them —
|
|
163
|
-
* before the build, unchanged, and making it transactional is tracked separately
|
|
217
|
+
* moves aside, then the candidate takes its place. Root config is NOT one of them — for an immediate deploy
|
|
218
|
+
* it is still published before the build, unchanged, and making it transactional is tracked separately
|
|
219
|
+
* (#2315). A delayed activation hands its artifact's recorded entry in as `afterJournal`, which publishes it
|
|
220
|
+
* from inside the window a crash rolls forward from — see that call site.
|
|
164
221
|
*
|
|
165
|
-
* The
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
222
|
+
* The candidate must ALREADY be certified: `markCandidateComplete` is the caller's, so a delayed activation
|
|
223
|
+
* does not re-walk and re-fsync a whole dependency tree it certified when it was built. The activation
|
|
224
|
+
* journal is still written and fsynced BEFORE the first rename, so a crash anywhere below is recoverable —
|
|
225
|
+
* see `settleInterruptedActivation` for the state matrix. The second rename is the COMMIT POINT: nothing
|
|
226
|
+
* after it may compensate, because the live path holds the candidate and renaming the aside back over it
|
|
227
|
+
* cannot succeed.
|
|
169
228
|
*/
|
|
170
|
-
export declare function activateCandidateApplication(application: Application, deploymentId: string
|
|
229
|
+
export declare function activateCandidateApplication(application: Application, deploymentId: string, options?: {
|
|
230
|
+
afterJournal?: () => Promise<(() => Promise<void>) | void>;
|
|
231
|
+
}): Promise<void>;
|
|
171
232
|
/**
|
|
172
233
|
* Build a deploy candidate at `.deploy-staging/<deploymentId>/<component>`, leaving the live tree
|
|
173
234
|
* completely untouched — this is what lets the previous version keep serving through the clone, the
|
|
@@ -176,7 +237,9 @@ export declare function activateCandidateApplication(application: Application, d
|
|
|
176
237
|
* Failure needs no compensation, which is the whole point: nothing about the live component was modified,
|
|
177
238
|
* so the abandoned candidate is simply removed and the error propagates.
|
|
178
239
|
*/
|
|
179
|
-
export declare function buildCandidateApplication(application: Application, deploymentId: string
|
|
240
|
+
export declare function buildCandidateApplication(application: Application, deploymentId: string, options?: {
|
|
241
|
+
rejectLinkSource?: boolean;
|
|
242
|
+
}): Promise<string>;
|
|
180
243
|
export declare function recoverInterruptedComponentExtractions(componentsRootDirPath: string): Promise<Map<string, Error>>;
|
|
181
244
|
export declare function recoverInterruptedComponentExtraction(componentsRootDirPath: string, componentName: string, waitForPreparation?: boolean, waitTimeoutMs?: number): Promise<void>;
|
|
182
245
|
export declare function retireComponentExtractionStaging(componentDirPath: string, componentName?: string, componentLogger?: Logger): Promise<void>;
|
|
@@ -267,6 +330,7 @@ export declare function shouldPackLocalDirectory(packageIdentifier: string | und
|
|
|
267
330
|
* @returns A promise that resolves when all preparation steps complete.
|
|
268
331
|
*/
|
|
269
332
|
export type PrepareApplicationOptions = {
|
|
333
|
+
beforePrepare?: () => Promise<void>;
|
|
270
334
|
/**
|
|
271
335
|
* Runs against the built candidate while the live version is still serving, and BEFORE the swap. A
|
|
272
336
|
* throw here means the candidate never goes live — which is the whole difference from the previous
|
|
@@ -274,6 +338,37 @@ export type PrepareApplicationOptions = {
|
|
|
274
338
|
* broken release.
|
|
275
339
|
*/
|
|
276
340
|
validateCandidate?: (candidateDirPath: string) => Promise<void>;
|
|
341
|
+
/**
|
|
342
|
+
* Names `.deploy-staging/<artifactId>`, and is not the deploy-lifecycle token: that token de-duplicates
|
|
343
|
+
* overlapping deploys of one component and is released by the first matching end, so two activations of
|
|
344
|
+
* one artifact sharing it would resume watchers while the second is still swapping. Defaults to the
|
|
345
|
+
* lifecycle token, which is unique per invocation.
|
|
346
|
+
*/
|
|
347
|
+
artifactId?: string;
|
|
348
|
+
/**
|
|
349
|
+
* `deploy` builds, certifies and activates. `stage` builds and certifies, then stops, leaving an
|
|
350
|
+
* artifact a later `activate` can address by `artifactId`. `activate` verifies an existing artifact
|
|
351
|
+
* and swaps it in, doing no resolution, no install and no network work at all.
|
|
352
|
+
*/
|
|
353
|
+
mode?: 'deploy' | 'stage' | 'activate';
|
|
354
|
+
/**
|
|
355
|
+
* `stage` only: the build's declared intent, recorded with the artifact for whoever activates it.
|
|
356
|
+
* A callback rather than a value because `beforePrepare` is what determines it, and that runs after
|
|
357
|
+
* these options have been constructed.
|
|
358
|
+
*/
|
|
359
|
+
describeArtifact?: () => {
|
|
360
|
+
rootConfig: Record<string, unknown> | null;
|
|
361
|
+
isolated: boolean;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* `activate` only: publish the artifact's recorded root-config entry, immediately before the swap. May
|
|
365
|
+
* return an undo, run if the activation then fails before it commits — otherwise a failed activation
|
|
366
|
+
* leaves config naming a release that is not live, which the next boot install would resolve and build
|
|
367
|
+
* from scratch over a component whose certified artifact is sitting beside it.
|
|
368
|
+
*/
|
|
369
|
+
publishRootConfig?: (entry: Record<string, unknown>) => Promise<(() => Promise<void>) | void>;
|
|
370
|
+
/** `activate` only: admit the artifact's isolation intent under the preparation lock, before the swap. */
|
|
371
|
+
admitIsolation?: (descriptor: ArtifactDescriptor) => Promise<void>;
|
|
277
372
|
};
|
|
278
373
|
export declare function prepareApplication(application: Application, options?: PrepareApplicationOptions): Promise<void>;
|
|
279
374
|
/**
|
|
@@ -355,7 +450,7 @@ export declare function buildNpmrcContent(registryCredentials: ResolvedRegistryC
|
|
|
355
450
|
* @param timeoutMs The timeout for the command in milliseconds. Defaults to DEFAULT_COMMAND_TIMEOUT_MS.
|
|
356
451
|
* @returns A promise that resolves when the command completes.
|
|
357
452
|
*/
|
|
358
|
-
export declare function nonInteractiveSpawn(applicationName: string, command: string, args: string[], cwd: string, timeoutMs?: number, onLine?: (stream: 'stdout' | 'stderr', line: string) => void, npmUserconfigPath?: string, gitCredentialEnv?: Record<string, string
|
|
453
|
+
export declare function nonInteractiveSpawn(applicationName: string, command: string, args: string[], cwd: string, timeoutMs?: number, onLine?: (stream: 'stdout' | 'stderr', line: string) => void, npmUserconfigPath?: string, gitCredentialEnv?: Record<string, string>, ignoreNpmScripts?: boolean): Promise<{
|
|
359
454
|
stdout: string;
|
|
360
455
|
stderr: string;
|
|
361
456
|
code: number;
|