@moorline/core 0.0.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/dist/app/bootstrap/apiAdapterPackageLoader.d.ts +21 -0
- package/dist/app/bootstrap/apiAdapterPackageLoader.js +143 -0
- package/dist/app/bootstrap/apiAdapterPackageLoader.js.map +1 -0
- package/dist/app/bootstrap/officialCatalog.d.ts +1 -0
- package/dist/app/bootstrap/officialCatalog.js +2 -0
- package/dist/app/bootstrap/officialCatalog.js.map +1 -0
- package/dist/app/bootstrap/operatorPackageService.d.ts +79 -0
- package/dist/app/bootstrap/operatorPackageService.js +1025 -0
- package/dist/app/bootstrap/operatorPackageService.js.map +1 -0
- package/dist/app/bootstrap/providerPackageLoader.d.ts +12 -0
- package/dist/app/bootstrap/providerPackageLoader.js +139 -0
- package/dist/app/bootstrap/providerPackageLoader.js.map +1 -0
- package/dist/app/bootstrap/runtimeBootstrap.d.ts +12 -0
- package/dist/app/bootstrap/runtimeBootstrap.js +46 -0
- package/dist/app/bootstrap/runtimeBootstrap.js.map +1 -0
- package/dist/app/bootstrap/transportPackageLoader.d.ts +23 -0
- package/dist/app/bootstrap/transportPackageLoader.js +149 -0
- package/dist/app/bootstrap/transportPackageLoader.js.map +1 -0
- package/dist/app/control-api/services/actions.d.ts +140 -0
- package/dist/app/control-api/services/actions.js +312 -0
- package/dist/app/control-api/services/actions.js.map +1 -0
- package/dist/app/control-api/services/controlPlane.d.ts +245 -0
- package/dist/app/control-api/services/controlPlane.js +301 -0
- package/dist/app/control-api/services/controlPlane.js.map +1 -0
- package/dist/app/control-api/services/runtimeHost.d.ts +61 -0
- package/dist/app/control-api/services/runtimeHost.js +117 -0
- package/dist/app/control-api/services/runtimeHost.js.map +1 -0
- package/dist/app/control-api/services/state.d.ts +19 -0
- package/dist/app/control-api/services/state.js +177 -0
- package/dist/app/control-api/services/state.js.map +1 -0
- package/dist/core/domain/memory/operatorMemoryService.d.ts +36 -0
- package/dist/core/domain/memory/operatorMemoryService.js +81 -0
- package/dist/core/domain/memory/operatorMemoryService.js.map +1 -0
- package/dist/core/domain/memory/pathSafety.d.ts +2 -0
- package/dist/core/domain/memory/pathSafety.js +36 -0
- package/dist/core/domain/memory/pathSafety.js.map +1 -0
- package/dist/core/domain/memory/retrieval/fileWalker.d.ts +1 -0
- package/dist/core/domain/memory/retrieval/fileWalker.js +31 -0
- package/dist/core/domain/memory/retrieval/fileWalker.js.map +1 -0
- package/dist/core/domain/memory/retrieval/indexTargets.d.ts +3 -0
- package/dist/core/domain/memory/retrieval/indexTargets.js +43 -0
- package/dist/core/domain/memory/retrieval/indexTargets.js.map +1 -0
- package/dist/core/domain/memory/retrieval/markdownChunker.d.ts +3 -0
- package/dist/core/domain/memory/retrieval/markdownChunker.js +77 -0
- package/dist/core/domain/memory/retrieval/markdownChunker.js.map +1 -0
- package/dist/core/domain/memory/retrieval/parse.d.ts +2 -0
- package/dist/core/domain/memory/retrieval/parse.js +28 -0
- package/dist/core/domain/memory/retrieval/parse.js.map +1 -0
- package/dist/core/domain/memory/retrieval/ranking.d.ts +11 -0
- package/dist/core/domain/memory/retrieval/ranking.js +63 -0
- package/dist/core/domain/memory/retrieval/ranking.js.map +1 -0
- package/dist/core/domain/memory/retrieval/schema.d.ts +2 -0
- package/dist/core/domain/memory/retrieval/schema.js +105 -0
- package/dist/core/domain/memory/retrieval/schema.js.map +1 -0
- package/dist/core/domain/memory/retrieval/scope.d.ts +20 -0
- package/dist/core/domain/memory/retrieval/scope.js +38 -0
- package/dist/core/domain/memory/retrieval/scope.js.map +1 -0
- package/dist/core/domain/memory/retrieval/tokenEmbedding.d.ts +4 -0
- package/dist/core/domain/memory/retrieval/tokenEmbedding.js +44 -0
- package/dist/core/domain/memory/retrieval/tokenEmbedding.js.map +1 -0
- package/dist/core/domain/memory/retrieval/types.d.ts +88 -0
- package/dist/core/domain/memory/retrieval/types.js +7 -0
- package/dist/core/domain/memory/retrieval/types.js.map +1 -0
- package/dist/core/domain/memory/retrieval.d.ts +4 -0
- package/dist/core/domain/memory/retrieval.js +398 -0
- package/dist/core/domain/memory/retrieval.js.map +1 -0
- package/dist/core/domain/memory/store.d.ts +28 -0
- package/dist/core/domain/memory/store.js +52 -0
- package/dist/core/domain/memory/store.js.map +1 -0
- package/dist/core/domain/missions/missionDraftSetup.d.ts +12 -0
- package/dist/core/domain/missions/missionDraftSetup.js +92 -0
- package/dist/core/domain/missions/missionDraftSetup.js.map +1 -0
- package/dist/core/domain/missions/missionHookService.d.ts +41 -0
- package/dist/core/domain/missions/missionHookService.js +161 -0
- package/dist/core/domain/missions/missionHookService.js.map +1 -0
- package/dist/core/domain/missions/missionHookValidation.d.ts +8 -0
- package/dist/core/domain/missions/missionHookValidation.js +59 -0
- package/dist/core/domain/missions/missionHookValidation.js.map +1 -0
- package/dist/core/domain/missions/missionRegistry.d.ts +55 -0
- package/dist/core/domain/missions/missionRegistry.js +204 -0
- package/dist/core/domain/missions/missionRegistry.js.map +1 -0
- package/dist/core/domain/missions/missionSchedule.d.ts +24 -0
- package/dist/core/domain/missions/missionSchedule.js +441 -0
- package/dist/core/domain/missions/missionSchedule.js.map +1 -0
- package/dist/core/domain/sessions/lifecycleOrchestration.d.ts +23 -0
- package/dist/core/domain/sessions/lifecycleOrchestration.js +18 -0
- package/dist/core/domain/sessions/lifecycleOrchestration.js.map +1 -0
- package/dist/core/domain/sessions/managedWorkerSessions.d.ts +3 -0
- package/dist/core/domain/sessions/managedWorkerSessions.js +4 -0
- package/dist/core/domain/sessions/managedWorkerSessions.js.map +1 -0
- package/dist/core/domain/sessions/runtimeWorkManagementService.d.ts +129 -0
- package/dist/core/domain/sessions/runtimeWorkManagementService.js +627 -0
- package/dist/core/domain/sessions/runtimeWorkManagementService.js.map +1 -0
- package/dist/core/domain/sessions/sessionLifecycleService.d.ts +21 -0
- package/dist/core/domain/sessions/sessionLifecycleService.js +76 -0
- package/dist/core/domain/sessions/sessionLifecycleService.js.map +1 -0
- package/dist/core/domain/sessions/sessionState.d.ts +34 -0
- package/dist/core/domain/sessions/sessionState.js +154 -0
- package/dist/core/domain/sessions/sessionState.js.map +1 -0
- package/dist/core/domain/sessions/workManagement/managedSessionLimit.d.ts +3 -0
- package/dist/core/domain/sessions/workManagement/managedSessionLimit.js +15 -0
- package/dist/core/domain/sessions/workManagement/managedSessionLimit.js.map +1 -0
- package/dist/core/domain/sessions/workManagement/spaceNames.d.ts +2 -0
- package/dist/core/domain/sessions/workManagement/spaceNames.js +15 -0
- package/dist/core/domain/sessions/workManagement/spaceNames.js.map +1 -0
- package/dist/core/extension/capabilities/capabilities.d.ts +8 -0
- package/dist/core/extension/capabilities/capabilities.js +40 -0
- package/dist/core/extension/capabilities/capabilities.js.map +1 -0
- package/dist/core/extension/packages/archiveExtraction.d.ts +1 -0
- package/dist/core/extension/packages/archiveExtraction.js +194 -0
- package/dist/core/extension/packages/archiveExtraction.js.map +1 -0
- package/dist/core/extension/packages/npmRegistryClient.d.ts +24 -0
- package/dist/core/extension/packages/npmRegistryClient.js +261 -0
- package/dist/core/extension/packages/npmRegistryClient.js.map +1 -0
- package/dist/core/extension/packages/officialArchiveResolver.d.ts +2 -0
- package/dist/core/extension/packages/officialArchiveResolver.js +51 -0
- package/dist/core/extension/packages/officialArchiveResolver.js.map +1 -0
- package/dist/core/extension/packages/officialCatalog.d.ts +9 -0
- package/dist/core/extension/packages/officialCatalog.js +198 -0
- package/dist/core/extension/packages/officialCatalog.js.map +1 -0
- package/dist/core/extension/packages/packageActivation.d.ts +21 -0
- package/dist/core/extension/packages/packageActivation.js +81 -0
- package/dist/core/extension/packages/packageActivation.js.map +1 -0
- package/dist/core/extension/packages/packageApplyPlanner.d.ts +4 -0
- package/dist/core/extension/packages/packageApplyPlanner.js +79 -0
- package/dist/core/extension/packages/packageApplyPlanner.js.map +1 -0
- package/dist/core/extension/packages/packageBundleRoot.d.ts +1 -0
- package/dist/core/extension/packages/packageBundleRoot.js +34 -0
- package/dist/core/extension/packages/packageBundleRoot.js.map +1 -0
- package/dist/core/extension/packages/packageConfigSchema.d.ts +7 -0
- package/dist/core/extension/packages/packageConfigSchema.js +86 -0
- package/dist/core/extension/packages/packageConfigSchema.js.map +1 -0
- package/dist/core/extension/packages/packageDependencyResolver.d.ts +13 -0
- package/dist/core/extension/packages/packageDependencyResolver.js +128 -0
- package/dist/core/extension/packages/packageDependencyResolver.js.map +1 -0
- package/dist/core/extension/packages/packageDistroMetadata.d.ts +14 -0
- package/dist/core/extension/packages/packageDistroMetadata.js +153 -0
- package/dist/core/extension/packages/packageDistroMetadata.js.map +1 -0
- package/dist/core/extension/packages/packageInstaller.d.ts +27 -0
- package/dist/core/extension/packages/packageInstaller.js +269 -0
- package/dist/core/extension/packages/packageInstaller.js.map +1 -0
- package/dist/core/extension/packages/packageInventoryStore.d.ts +25 -0
- package/dist/core/extension/packages/packageInventoryStore.js +398 -0
- package/dist/core/extension/packages/packageInventoryStore.js.map +1 -0
- package/dist/core/extension/packages/packageManifest.d.ts +15 -0
- package/dist/core/extension/packages/packageManifest.js +65 -0
- package/dist/core/extension/packages/packageManifest.js.map +1 -0
- package/dist/core/extension/packages/packageRegistryBlocklist.d.ts +10 -0
- package/dist/core/extension/packages/packageRegistryBlocklist.js +13 -0
- package/dist/core/extension/packages/packageRegistryBlocklist.js.map +1 -0
- package/dist/core/extension/packages/packageRegistryService.d.ts +22 -0
- package/dist/core/extension/packages/packageRegistryService.js +123 -0
- package/dist/core/extension/packages/packageRegistryService.js.map +1 -0
- package/dist/core/extension/packages/packageRegistryTypes.d.ts +33 -0
- package/dist/core/extension/packages/packageRegistryTypes.js +2 -0
- package/dist/core/extension/packages/packageRegistryTypes.js.map +1 -0
- package/dist/core/extension/packages/packageSource.d.ts +8 -0
- package/dist/core/extension/packages/packageSource.js +116 -0
- package/dist/core/extension/packages/packageSource.js.map +1 -0
- package/dist/core/extension/packages/packageSourceLimits.d.ts +5 -0
- package/dist/core/extension/packages/packageSourceLimits.js +6 -0
- package/dist/core/extension/packages/packageSourceLimits.js.map +1 -0
- package/dist/core/extension/packages/packageValidation.d.ts +2 -0
- package/dist/core/extension/packages/packageValidation.js +67 -0
- package/dist/core/extension/packages/packageValidation.js.map +1 -0
- package/dist/core/extension/packages/packageVersionResolver.d.ts +28 -0
- package/dist/core/extension/packages/packageVersionResolver.js +78 -0
- package/dist/core/extension/packages/packageVersionResolver.js.map +1 -0
- package/dist/core/extension/packages/remoteArchiveDownloader.d.ts +10 -0
- package/dist/core/extension/packages/remoteArchiveDownloader.js +156 -0
- package/dist/core/extension/packages/remoteArchiveDownloader.js.map +1 -0
- package/dist/core/extension/packages/runtimeStartability.d.ts +16 -0
- package/dist/core/extension/packages/runtimeStartability.js +237 -0
- package/dist/core/extension/packages/runtimeStartability.js.map +1 -0
- package/dist/core/extension/plugins/pluginHost.d.ts +50 -0
- package/dist/core/extension/plugins/pluginHost.js +303 -0
- package/dist/core/extension/plugins/pluginHost.js.map +1 -0
- package/dist/core/extension/plugins/pluginId.d.ts +2 -0
- package/dist/core/extension/plugins/pluginId.js +8 -0
- package/dist/core/extension/plugins/pluginId.js.map +1 -0
- package/dist/core/extension/plugins/pluginManifest.d.ts +3 -0
- package/dist/core/extension/plugins/pluginManifest.js +17 -0
- package/dist/core/extension/plugins/pluginManifest.js.map +1 -0
- package/dist/core/extension/plugins/runtimePluginLoader.d.ts +7 -0
- package/dist/core/extension/plugins/runtimePluginLoader.js +160 -0
- package/dist/core/extension/plugins/runtimePluginLoader.js.map +1 -0
- package/dist/core/extension/skills/skillRegistry.d.ts +21 -0
- package/dist/core/extension/skills/skillRegistry.js +233 -0
- package/dist/core/extension/skills/skillRegistry.js.map +1 -0
- package/dist/core/extension/skills/skillWriter.d.ts +20 -0
- package/dist/core/extension/skills/skillWriter.js +150 -0
- package/dist/core/extension/skills/skillWriter.js.map +1 -0
- package/dist/core/runtime/execution/commandReactor.d.ts +31 -0
- package/dist/core/runtime/execution/commandReactor.js +38 -0
- package/dist/core/runtime/execution/commandReactor.js.map +1 -0
- package/dist/core/runtime/execution/defaultModelSelection.d.ts +4 -0
- package/dist/core/runtime/execution/defaultModelSelection.js +17 -0
- package/dist/core/runtime/execution/defaultModelSelection.js.map +1 -0
- package/dist/core/runtime/execution/drainableWorker.d.ts +27 -0
- package/dist/core/runtime/execution/drainableWorker.js +79 -0
- package/dist/core/runtime/execution/drainableWorker.js.map +1 -0
- package/dist/core/runtime/execution/orchestrationEngine.d.ts +16 -0
- package/dist/core/runtime/execution/orchestrationEngine.js +181 -0
- package/dist/core/runtime/execution/orchestrationEngine.js.map +1 -0
- package/dist/core/runtime/execution/orchestrationHealth.d.ts +45 -0
- package/dist/core/runtime/execution/orchestrationHealth.js +95 -0
- package/dist/core/runtime/execution/orchestrationHealth.js.map +1 -0
- package/dist/core/runtime/execution/pluginContext/defaultSessionOwner.d.ts +2 -0
- package/dist/core/runtime/execution/pluginContext/defaultSessionOwner.js +10 -0
- package/dist/core/runtime/execution/pluginContext/defaultSessionOwner.js.map +1 -0
- package/dist/core/runtime/execution/pluginContext/pluginCapabilities.d.ts +40 -0
- package/dist/core/runtime/execution/pluginContext/pluginCapabilities.js +73 -0
- package/dist/core/runtime/execution/pluginContext/pluginCapabilities.js.map +1 -0
- package/dist/core/runtime/execution/pluginContext/pluginContextFactory.d.ts +20 -0
- package/dist/core/runtime/execution/pluginContext/pluginContextFactory.js +18 -0
- package/dist/core/runtime/execution/pluginContext/pluginContextFactory.js.map +1 -0
- package/dist/core/runtime/execution/pluginContext/transportAuthor.d.ts +7 -0
- package/dist/core/runtime/execution/pluginContext/transportAuthor.js +15 -0
- package/dist/core/runtime/execution/pluginContext/transportAuthor.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerCompactionCoordinator.d.ts +7 -0
- package/dist/core/runtime/execution/providerCoordination/providerCompactionCoordinator.js +25 -0
- package/dist/core/runtime/execution/providerCoordination/providerCompactionCoordinator.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerPolicyTarget.d.ts +2 -0
- package/dist/core/runtime/execution/providerCoordination/providerPolicyTarget.js +5 -0
- package/dist/core/runtime/execution/providerCoordination/providerPolicyTarget.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerRecoveryService.d.ts +7 -0
- package/dist/core/runtime/execution/providerCoordination/providerRecoveryService.js +6 -0
- package/dist/core/runtime/execution/providerCoordination/providerRecoveryService.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerRequestAttributionService.d.ts +10 -0
- package/dist/core/runtime/execution/providerCoordination/providerRequestAttributionService.js +33 -0
- package/dist/core/runtime/execution/providerCoordination/providerRequestAttributionService.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerSessionCoordinator.d.ts +5 -0
- package/dist/core/runtime/execution/providerCoordination/providerSessionCoordinator.js +9 -0
- package/dist/core/runtime/execution/providerCoordination/providerSessionCoordinator.js.map +1 -0
- package/dist/core/runtime/execution/providerCoordination/providerTurnCoordinator.d.ts +3 -0
- package/dist/core/runtime/execution/providerCoordination/providerTurnCoordinator.js +6 -0
- package/dist/core/runtime/execution/providerCoordination/providerTurnCoordinator.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/ports.d.ts +47 -0
- package/dist/core/runtime/execution/providerOrchestration/ports.js +2 -0
- package/dist/core/runtime/execution/providerOrchestration/ports.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerAttachmentResolver.d.ts +13 -0
- package/dist/core/runtime/execution/providerOrchestration/providerAttachmentResolver.js +57 -0
- package/dist/core/runtime/execution/providerOrchestration/providerAttachmentResolver.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerCompactionPolicy.d.ts +19 -0
- package/dist/core/runtime/execution/providerOrchestration/providerCompactionPolicy.js +129 -0
- package/dist/core/runtime/execution/providerOrchestration/providerCompactionPolicy.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerEventPipeline.d.ts +32 -0
- package/dist/core/runtime/execution/providerOrchestration/providerEventPipeline.js +67 -0
- package/dist/core/runtime/execution/providerOrchestration/providerEventPipeline.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerMissionEventProjector.d.ts +12 -0
- package/dist/core/runtime/execution/providerOrchestration/providerMissionEventProjector.js +71 -0
- package/dist/core/runtime/execution/providerOrchestration/providerMissionEventProjector.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerOrchestrator.d.ts +37 -0
- package/dist/core/runtime/execution/providerOrchestration/providerOrchestrator.js +53 -0
- package/dist/core/runtime/execution/providerOrchestration/providerOrchestrator.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerRequestProjector.d.ts +15 -0
- package/dist/core/runtime/execution/providerOrchestration/providerRequestProjector.js +93 -0
- package/dist/core/runtime/execution/providerOrchestration/providerRequestProjector.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerSessionOrchestrator.d.ts +37 -0
- package/dist/core/runtime/execution/providerOrchestration/providerSessionOrchestrator.js +104 -0
- package/dist/core/runtime/execution/providerOrchestration/providerSessionOrchestrator.js.map +1 -0
- package/dist/core/runtime/execution/providerOrchestration/providerTurnBroker.d.ts +62 -0
- package/dist/core/runtime/execution/providerOrchestration/providerTurnBroker.js +349 -0
- package/dist/core/runtime/execution/providerOrchestration/providerTurnBroker.js.map +1 -0
- package/dist/core/runtime/execution/providerProjectionTypes.d.ts +25 -0
- package/dist/core/runtime/execution/providerProjectionTypes.js +18 -0
- package/dist/core/runtime/execution/providerProjectionTypes.js.map +1 -0
- package/dist/core/runtime/execution/providerSessionDirectory.d.ts +12 -0
- package/dist/core/runtime/execution/providerSessionDirectory.js +94 -0
- package/dist/core/runtime/execution/providerSessionDirectory.js.map +1 -0
- package/dist/core/runtime/execution/runtimeDomain.d.ts +116 -0
- package/dist/core/runtime/execution/runtimeDomain.js +262 -0
- package/dist/core/runtime/execution/runtimeDomain.js.map +1 -0
- package/dist/core/runtime/execution/runtimeIngestion.d.ts +17 -0
- package/dist/core/runtime/execution/runtimeIngestion.js +254 -0
- package/dist/core/runtime/execution/runtimeIngestion.js.map +1 -0
- package/dist/core/runtime/execution/runtimeInteractionService.d.ts +66 -0
- package/dist/core/runtime/execution/runtimeInteractionService.js +230 -0
- package/dist/core/runtime/execution/runtimeInteractionService.js.map +1 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequestService.d.ts +64 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequestService.js +366 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequestService.js.map +1 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequests.d.ts +111 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequests.js +464 -0
- package/dist/core/runtime/execution/runtimeOrchestrationRequests.js.map +1 -0
- package/dist/core/runtime/execution/runtimeOrchestrationResult.d.ts +4 -0
- package/dist/core/runtime/execution/runtimeOrchestrationResult.js +7 -0
- package/dist/core/runtime/execution/runtimeOrchestrationResult.js.map +1 -0
- package/dist/core/runtime/execution/runtimePendingRequestService.d.ts +69 -0
- package/dist/core/runtime/execution/runtimePendingRequestService.js +360 -0
- package/dist/core/runtime/execution/runtimePendingRequestService.js.map +1 -0
- package/dist/core/runtime/execution/runtimePluginContextService.d.ts +100 -0
- package/dist/core/runtime/execution/runtimePluginContextService.js +576 -0
- package/dist/core/runtime/execution/runtimePluginContextService.js.map +1 -0
- package/dist/core/runtime/execution/runtimeReceiptBus.d.ts +17 -0
- package/dist/core/runtime/execution/runtimeReceiptBus.js +50 -0
- package/dist/core/runtime/execution/runtimeReceiptBus.js.map +1 -0
- package/dist/core/runtime/execution/runtimeWorkerQueues.d.ts +33 -0
- package/dist/core/runtime/execution/runtimeWorkerQueues.js +55 -0
- package/dist/core/runtime/execution/runtimeWorkerQueues.js.map +1 -0
- package/dist/core/runtime/graph/runtimePaths.d.ts +2 -0
- package/dist/core/runtime/graph/runtimePaths.js +22 -0
- package/dist/core/runtime/graph/runtimePaths.js.map +1 -0
- package/dist/core/runtime/hosting/managedSpaceMetadata.d.ts +7 -0
- package/dist/core/runtime/hosting/managedSpaceMetadata.js +14 -0
- package/dist/core/runtime/hosting/managedSpaceMetadata.js.map +1 -0
- package/dist/core/runtime/hosting/runtimeHostingService.d.ts +32 -0
- package/dist/core/runtime/hosting/runtimeHostingService.js +123 -0
- package/dist/core/runtime/hosting/runtimeHostingService.js.map +1 -0
- package/dist/core/runtime/hosting/runtimeLayout.d.ts +5 -0
- package/dist/core/runtime/hosting/runtimeLayout.js +133 -0
- package/dist/core/runtime/hosting/runtimeLayout.js.map +1 -0
- package/dist/core/runtime/hosting/runtimeManagementPort.d.ts +60 -0
- package/dist/core/runtime/hosting/runtimeManagementPort.js +28 -0
- package/dist/core/runtime/hosting/runtimeManagementPort.js.map +1 -0
- package/dist/core/runtime/hosting/runtimeTransportSurfaceService.d.ts +20 -0
- package/dist/core/runtime/hosting/runtimeTransportSurfaceService.js +82 -0
- package/dist/core/runtime/hosting/runtimeTransportSurfaceService.js.map +1 -0
- package/dist/core/runtime/hosting/systemEmbeds.d.ts +22 -0
- package/dist/core/runtime/hosting/systemEmbeds.js +25 -0
- package/dist/core/runtime/hosting/systemEmbeds.js.map +1 -0
- package/dist/core/runtime/lifecycle/managedChannelLifecycleService.d.ts +37 -0
- package/dist/core/runtime/lifecycle/managedChannelLifecycleService.js +256 -0
- package/dist/core/runtime/lifecycle/managedChannelLifecycleService.js.map +1 -0
- package/dist/core/runtime/lifecycle/runtimeLifecycleService.d.ts +43 -0
- package/dist/core/runtime/lifecycle/runtimeLifecycleService.js +322 -0
- package/dist/core/runtime/lifecycle/runtimeLifecycleService.js.map +1 -0
- package/dist/core/runtime/moorlineRuntime.d.ts +100 -0
- package/dist/core/runtime/moorlineRuntime.js +573 -0
- package/dist/core/runtime/moorlineRuntime.js.map +1 -0
- package/dist/core/runtime/moorlineRuntimeBuilder.d.ts +180 -0
- package/dist/core/runtime/moorlineRuntimeBuilder.js +681 -0
- package/dist/core/runtime/moorlineRuntimeBuilder.js.map +1 -0
- package/dist/core/runtime/runtimeAudit.d.ts +7 -0
- package/dist/core/runtime/runtimeAudit.js +32 -0
- package/dist/core/runtime/runtimeAudit.js.map +1 -0
- package/dist/core/runtime/runtimeBootstrapRegistry.d.ts +5 -0
- package/dist/core/runtime/runtimeBootstrapRegistry.js +15 -0
- package/dist/core/runtime/runtimeBootstrapRegistry.js.map +1 -0
- package/dist/core/runtime/runtimeStatus.d.ts +14 -0
- package/dist/core/runtime/runtimeStatus.js +16 -0
- package/dist/core/runtime/runtimeStatus.js.map +1 -0
- package/dist/core/runtime/supervision/managedSidecar.d.ts +71 -0
- package/dist/core/runtime/supervision/managedSidecar.js +13 -0
- package/dist/core/runtime/supervision/managedSidecar.js.map +1 -0
- package/dist/core/runtime/supervision/runtimeControl.d.ts +45 -0
- package/dist/core/runtime/supervision/runtimeControl.js +2 -0
- package/dist/core/runtime/supervision/runtimeControl.js.map +1 -0
- package/dist/core/runtime/supervision/runtimeControlService.d.ts +56 -0
- package/dist/core/runtime/supervision/runtimeControlService.js +315 -0
- package/dist/core/runtime/supervision/runtimeControlService.js.map +1 -0
- package/dist/core/runtime/supervision/runtimeSupervisor.d.ts +106 -0
- package/dist/core/runtime/supervision/runtimeSupervisor.js +425 -0
- package/dist/core/runtime/supervision/runtimeSupervisor.js.map +1 -0
- package/dist/core/runtime/supervision/sidecarLaunchDefinition.d.ts +3 -0
- package/dist/core/runtime/supervision/sidecarLaunchDefinition.js +24 -0
- package/dist/core/runtime/supervision/sidecarLaunchDefinition.js.map +1 -0
- package/dist/core/runtime/supervision/sidecarManager.d.ts +40 -0
- package/dist/core/runtime/supervision/sidecarManager.js +409 -0
- package/dist/core/runtime/supervision/sidecarManager.js.map +1 -0
- package/dist/core/shared/fs/atomicWrite.d.ts +6 -0
- package/dist/core/shared/fs/atomicWrite.js +48 -0
- package/dist/core/shared/fs/atomicWrite.js.map +1 -0
- package/dist/core/shared/fs/canonicalPathContainment.d.ts +8 -0
- package/dist/core/shared/fs/canonicalPathContainment.js +31 -0
- package/dist/core/shared/fs/canonicalPathContainment.js.map +1 -0
- package/dist/core/shared/fs/runtimeOwnedPath.d.ts +6 -0
- package/dist/core/shared/fs/runtimeOwnedPath.js +23 -0
- package/dist/core/shared/fs/runtimeOwnedPath.js.map +1 -0
- package/dist/core/shared/utils/childProcessEnv.d.ts +4 -0
- package/dist/core/shared/utils/childProcessEnv.js +66 -0
- package/dist/core/shared/utils/childProcessEnv.js.map +1 -0
- package/dist/core/shared/utils/commandRunner.d.ts +18 -0
- package/dist/core/shared/utils/commandRunner.js +51 -0
- package/dist/core/shared/utils/commandRunner.js.map +1 -0
- package/dist/core/shared/utils/payloadRedaction.d.ts +13 -0
- package/dist/core/shared/utils/payloadRedaction.js +91 -0
- package/dist/core/shared/utils/payloadRedaction.js.map +1 -0
- package/dist/core/shared/utils/remoteNetworkPolicy.d.ts +11 -0
- package/dist/core/shared/utils/remoteNetworkPolicy.js +137 -0
- package/dist/core/shared/utils/remoteNetworkPolicy.js.map +1 -0
- package/dist/core/shared/utils/runtimeMessageUtils.d.ts +27 -0
- package/dist/core/shared/utils/runtimeMessageUtils.js +383 -0
- package/dist/core/shared/utils/runtimeMessageUtils.js.map +1 -0
- package/dist/core/system/audit/auditLogger.d.ts +15 -0
- package/dist/core/system/audit/auditLogger.js +22 -0
- package/dist/core/system/audit/auditLogger.js.map +1 -0
- package/dist/core/system/backup/runtimeBackupService.d.ts +28 -0
- package/dist/core/system/backup/runtimeBackupService.js +284 -0
- package/dist/core/system/backup/runtimeBackupService.js.map +1 -0
- package/dist/core/system/config/configStore.d.ts +38 -0
- package/dist/core/system/config/configStore.js +672 -0
- package/dist/core/system/config/configStore.js.map +1 -0
- package/dist/core/system/policy/actorRulePolicy.d.ts +13 -0
- package/dist/core/system/policy/actorRulePolicy.js +87 -0
- package/dist/core/system/policy/actorRulePolicy.js.map +1 -0
- package/dist/core/system/policy/networkPolicy.d.ts +6 -0
- package/dist/core/system/policy/networkPolicy.js +71 -0
- package/dist/core/system/policy/networkPolicy.js.map +1 -0
- package/dist/core/system/policy/policyEngine.d.ts +22 -0
- package/dist/core/system/policy/policyEngine.js +41 -0
- package/dist/core/system/policy/policyEngine.js.map +1 -0
- package/dist/core/system/policy/policyProfile.d.ts +16 -0
- package/dist/core/system/policy/policyProfile.js +78 -0
- package/dist/core/system/policy/policyProfile.js.map +1 -0
- package/dist/core/system/policy/runtimeActionGuard.d.ts +24 -0
- package/dist/core/system/policy/runtimeActionGuard.js +64 -0
- package/dist/core/system/policy/runtimeActionGuard.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/auditEvents.d.ts +9 -0
- package/dist/core/system/projection/managementReadModel/auditEvents.js +61 -0
- package/dist/core/system/projection/managementReadModel/auditEvents.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/deps.d.ts +35 -0
- package/dist/core/system/projection/managementReadModel/deps.js +2 -0
- package/dist/core/system/projection/managementReadModel/deps.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/objects/serviceObjects.d.ts +3 -0
- package/dist/core/system/projection/managementReadModel/objects/serviceObjects.js +129 -0
- package/dist/core/system/projection/managementReadModel/objects/serviceObjects.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/pluginDiskRecords.d.ts +10 -0
- package/dist/core/system/projection/managementReadModel/pluginDiskRecords.js +55 -0
- package/dist/core/system/projection/managementReadModel/pluginDiskRecords.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/providerAlignment.d.ts +7 -0
- package/dist/core/system/projection/managementReadModel/providerAlignment.js +48 -0
- package/dist/core/system/projection/managementReadModel/providerAlignment.js.map +1 -0
- package/dist/core/system/projection/managementReadModel/text.d.ts +1 -0
- package/dist/core/system/projection/managementReadModel/text.js +8 -0
- package/dist/core/system/projection/managementReadModel/text.js.map +1 -0
- package/dist/core/system/projection/managementReadModelService.d.ts +18 -0
- package/dist/core/system/projection/managementReadModelService.js +768 -0
- package/dist/core/system/projection/managementReadModelService.js.map +1 -0
- package/dist/core/system/projection/pendingRequestProjectionStore.d.ts +12 -0
- package/dist/core/system/projection/pendingRequestProjectionStore.js +113 -0
- package/dist/core/system/projection/pendingRequestProjectionStore.js.map +1 -0
- package/dist/core/system/projection/pendingRequestQuestions.d.ts +2 -0
- package/dist/core/system/projection/pendingRequestQuestions.js +51 -0
- package/dist/core/system/projection/pendingRequestQuestions.js.map +1 -0
- package/dist/core/system/projection/projectionStateStore.d.ts +17 -0
- package/dist/core/system/projection/projectionStateStore.js +60 -0
- package/dist/core/system/projection/projectionStateStore.js.map +1 -0
- package/dist/core/system/projection/runtimeActivityStore.d.ts +24 -0
- package/dist/core/system/projection/runtimeActivityStore.js +150 -0
- package/dist/core/system/projection/runtimeActivityStore.js.map +1 -0
- package/dist/core/system/projection/runtimeProjectionService.d.ts +41 -0
- package/dist/core/system/projection/runtimeProjectionService.js +209 -0
- package/dist/core/system/projection/runtimeProjectionService.js.map +1 -0
- package/dist/core/system/projection/runtimeReceiptStore.d.ts +11 -0
- package/dist/core/system/projection/runtimeReceiptStore.js +77 -0
- package/dist/core/system/projection/runtimeReceiptStore.js.map +1 -0
- package/dist/core/system/projection/runtimeReconciler.d.ts +25 -0
- package/dist/core/system/projection/runtimeReconciler.js +83 -0
- package/dist/core/system/projection/runtimeReconciler.js.map +1 -0
- package/dist/core/system/projection/runtimeSnapshotQuery.d.ts +46 -0
- package/dist/core/system/projection/runtimeSnapshotQuery.js +135 -0
- package/dist/core/system/projection/runtimeSnapshotQuery.js.map +1 -0
- package/dist/core/system/release/releaseArtifacts.d.ts +7 -0
- package/dist/core/system/release/releaseArtifacts.js +88 -0
- package/dist/core/system/release/releaseArtifacts.js.map +1 -0
- package/dist/core/system/release/runtimePackageLoadReport.d.ts +10 -0
- package/dist/core/system/release/runtimePackageLoadReport.js +31 -0
- package/dist/core/system/release/runtimePackageLoadReport.js.map +1 -0
- package/dist/core/system/state/canonicalEventLogStore.d.ts +16 -0
- package/dist/core/system/state/canonicalEventLogStore.js +156 -0
- package/dist/core/system/state/canonicalEventLogStore.js.map +1 -0
- package/dist/core/system/state/migrationRunner.d.ts +5 -0
- package/dist/core/system/state/migrationRunner.js +58 -0
- package/dist/core/system/state/migrationRunner.js.map +1 -0
- package/dist/core/system/state/safeJson.d.ts +8 -0
- package/dist/core/system/state/safeJson.js +36 -0
- package/dist/core/system/state/safeJson.js.map +1 -0
- package/dist/core/system/state/sqlite/connection.d.ts +2 -0
- package/dist/core/system/state/sqlite/connection.js +8 -0
- package/dist/core/system/state/sqlite/connection.js.map +1 -0
- package/dist/core/system/state/sqlite/domainEventLogRepository.d.ts +10 -0
- package/dist/core/system/state/sqlite/domainEventLogRepository.js +69 -0
- package/dist/core/system/state/sqlite/domainEventLogRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/eventIntegrity.d.ts +6 -0
- package/dist/core/system/state/sqlite/eventIntegrity.js +7 -0
- package/dist/core/system/state/sqlite/eventIntegrity.js.map +1 -0
- package/dist/core/system/state/sqlite/managedSidecarRepository.d.ts +10 -0
- package/dist/core/system/state/sqlite/managedSidecarRepository.js +62 -0
- package/dist/core/system/state/sqlite/managedSidecarRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/missionRepository.d.ts +24 -0
- package/dist/core/system/state/sqlite/missionRepository.js +252 -0
- package/dist/core/system/state/sqlite/missionRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/orchestrationRepository.d.ts +20 -0
- package/dist/core/system/state/sqlite/orchestrationRepository.js +158 -0
- package/dist/core/system/state/sqlite/orchestrationRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/pendingRequestRepository.d.ts +13 -0
- package/dist/core/system/state/sqlite/pendingRequestRepository.js +76 -0
- package/dist/core/system/state/sqlite/pendingRequestRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/providerBindingRepository.d.ts +10 -0
- package/dist/core/system/state/sqlite/providerBindingRepository.js +58 -0
- package/dist/core/system/state/sqlite/providerBindingRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/providerEventLogRepository.d.ts +10 -0
- package/dist/core/system/state/sqlite/providerEventLogRepository.js +77 -0
- package/dist/core/system/state/sqlite/providerEventLogRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/rowMappers.d.ts +2 -0
- package/dist/core/system/state/sqlite/rowMappers.js +7 -0
- package/dist/core/system/state/sqlite/rowMappers.js.map +1 -0
- package/dist/core/system/state/sqlite/runtimeHistoryPruningRepository.d.ts +23 -0
- package/dist/core/system/state/sqlite/runtimeHistoryPruningRepository.js +82 -0
- package/dist/core/system/state/sqlite/runtimeHistoryPruningRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/runtimeReceiptRepository.d.ts +9 -0
- package/dist/core/system/state/sqlite/runtimeReceiptRepository.js +47 -0
- package/dist/core/system/state/sqlite/runtimeReceiptRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/sessionMetadataRepository.d.ts +7 -0
- package/dist/core/system/state/sqlite/sessionMetadataRepository.js +25 -0
- package/dist/core/system/state/sqlite/sessionMetadataRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/sessionRepository.d.ts +12 -0
- package/dist/core/system/state/sqlite/sessionRepository.js +72 -0
- package/dist/core/system/state/sqlite/sessionRepository.js.map +1 -0
- package/dist/core/system/state/sqlite/types.d.ts +140 -0
- package/dist/core/system/state/sqlite/types.js +113 -0
- package/dist/core/system/state/sqlite/types.js.map +1 -0
- package/dist/core/system/state/sqliteSessionStore.d.ts +86 -0
- package/dist/core/system/state/sqliteSessionStore.js +210 -0
- package/dist/core/system/state/sqliteSessionStore.js.map +1 -0
- package/dist/core/system/state/sqliteSupport.d.ts +4 -0
- package/dist/core/system/state/sqliteSupport.js +32 -0
- package/dist/core/system/state/sqliteSupport.js.map +1 -0
- package/dist/core/system/vcs/gitCheckpointService.d.ts +11 -0
- package/dist/core/system/vcs/gitCheckpointService.js +32 -0
- package/dist/core/system/vcs/gitCheckpointService.js.map +1 -0
- package/dist/core/system/vcs/gitCommitParser.d.ts +3 -0
- package/dist/core/system/vcs/gitCommitParser.js +55 -0
- package/dist/core/system/vcs/gitCommitParser.js.map +1 -0
- package/dist/core/system/vcs/gitDiffFormatter.d.ts +1 -0
- package/dist/core/system/vcs/gitDiffFormatter.js +4 -0
- package/dist/core/system/vcs/gitDiffFormatter.js.map +1 -0
- package/dist/core/system/vcs/gitHistoryService.d.ts +46 -0
- package/dist/core/system/vcs/gitHistoryService.js +277 -0
- package/dist/core/system/vcs/gitHistoryService.js.map +1 -0
- package/dist/core/system/vcs/gitIgnoreTemplate.d.ts +1 -0
- package/dist/core/system/vcs/gitIgnoreTemplate.js +12 -0
- package/dist/core/system/vcs/gitIgnoreTemplate.js.map +1 -0
- package/dist/core/system/vcs/gitRepoStore.d.ts +12 -0
- package/dist/core/system/vcs/gitRepoStore.js +46 -0
- package/dist/core/system/vcs/gitRepoStore.js.map +1 -0
- package/dist/core/system/vcs/gitTrackedPaths.d.ts +6 -0
- package/dist/core/system/vcs/gitTrackedPaths.js +80 -0
- package/dist/core/system/vcs/gitTrackedPaths.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/types/app.d.ts +444 -0
- package/dist/types/app.js +2 -0
- package/dist/types/app.js.map +1 -0
- package/dist/types/config.d.ts +188 -0
- package/dist/types/config.js +422 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/distro.d.ts +1 -0
- package/dist/types/distro.js +2 -0
- package/dist/types/distro.js.map +1 -0
- package/dist/types/history.d.ts +43 -0
- package/dist/types/history.js +2 -0
- package/dist/types/history.js.map +1 -0
- package/dist/types/package.d.ts +61 -0
- package/dist/types/package.js +2 -0
- package/dist/types/package.js.map +1 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/plugin.js +2 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/provider.d.ts +2 -0
- package/dist/types/provider.js +2 -0
- package/dist/types/provider.js.map +1 -0
- package/dist/types/release.d.ts +24 -0
- package/dist/types/release.js +2 -0
- package/dist/types/release.js.map +1 -0
- package/dist/types/runtime.d.ts +2 -0
- package/dist/types/runtime.js +2 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/skill.d.ts +1 -0
- package/dist/types/skill.js +2 -0
- package/dist/types/skill.js.map +1 -0
- package/dist/types/transport.d.ts +2 -0
- package/dist/types/transport.js +2 -0
- package/dist/types/transport.js.map +1 -0
- package/package.json +62 -0
- package/resources/migrations/001_sessions.sql +59 -0
- package/resources/migrations/002_pending_request_metadata.sql +2 -0
- package/resources/migrations/003_provider_projections.sql +38 -0
- package/resources/migrations/004_runtime_projection_state.sql +22 -0
- package/resources/migrations/005_runtime_robustness.sql +3 -0
- package/resources/migrations/006_provider_autostart.sql +1 -0
- package/resources/migrations/007_missions.sql +41 -0
- package/resources/migrations/008_mission_schedule_anchor.sql +5 -0
- package/resources/migrations/009_session_orchestration.sql +26 -0
- package/resources/migrations/010_mission_archival.sql +1 -0
- package/resources/migrations/011_managed_sidecars.sql +29 -0
- package/resources/migrations/012_scope_space_terminology.sql +19 -0
- package/resources/migrations/013_orchestration_dedupe.sql +5 -0
- package/resources/migrations/014_orchestration_execution_claims.sql +13 -0
- package/resources/migrations/015_mission_schedule_meta.sql +9 -0
- package/resources/migrations/016_mission_hook_bindings.sql +16 -0
- package/resources/migrations/017_domain_event_provenance.sql +1 -0
- package/resources/migrations/018_provider_event_processing.sql +8 -0
- package/resources/official-catalog.json +444 -0
- package/resources/policies/default-secure.json +160 -0
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { defaultMainProcessConfig, homeRootForRuntime, usesProviderDefaultModel } from '../../types/config.js';
|
|
5
|
+
import { ensureRuntimePaths } from '../system/config/configStore.js';
|
|
6
|
+
import { PluginHost } from '../extension/plugins/pluginHost.js';
|
|
7
|
+
import { PackageInventoryStore } from '../extension/packages/packageInventoryStore.js';
|
|
8
|
+
import { appliedPackageRefs } from '../extension/packages/packageActivation.js';
|
|
9
|
+
import { OFFICIAL_CATALOG } from '../extension/packages/officialCatalog.js';
|
|
10
|
+
import { SessionLifecycleService } from '../domain/sessions/sessionLifecycleService.js';
|
|
11
|
+
import { MissionRegistry } from '../domain/missions/missionRegistry.js';
|
|
12
|
+
import { MissionHookService } from '../domain/missions/missionHookService.js';
|
|
13
|
+
import { SkillRegistry } from '../extension/skills/skillRegistry.js';
|
|
14
|
+
import { runMigrations } from '../system/state/migrationRunner.js';
|
|
15
|
+
import { SqliteSessionStore } from '../system/state/sqliteSessionStore.js';
|
|
16
|
+
import { JsonAuditLogger } from '../system/audit/auditLogger.js';
|
|
17
|
+
import { SessionRegistry } from '../domain/sessions/sessionState.js';
|
|
18
|
+
import { MemoryStore } from '../domain/memory/store.js';
|
|
19
|
+
import { RuntimeIngestion } from './execution/runtimeIngestion.js';
|
|
20
|
+
import { CommandReactor } from './execution/commandReactor.js';
|
|
21
|
+
import { RuntimeReceiptBus } from './execution/runtimeReceiptBus.js';
|
|
22
|
+
import { OrchestrationEngine } from './execution/orchestrationEngine.js';
|
|
23
|
+
import { RuntimeReceiptStore } from '../system/projection/runtimeReceiptStore.js';
|
|
24
|
+
import { RuntimeActivityStore } from '../system/projection/runtimeActivityStore.js';
|
|
25
|
+
import { ProjectionStateStore } from '../system/projection/projectionStateStore.js';
|
|
26
|
+
import { PendingRequestProjectionStore } from '../system/projection/pendingRequestProjectionStore.js';
|
|
27
|
+
import { RuntimeSnapshotQuery } from '../system/projection/runtimeSnapshotQuery.js';
|
|
28
|
+
import { RuntimeReconciler } from '../system/projection/runtimeReconciler.js';
|
|
29
|
+
import { ProviderSessionDirectory } from './execution/providerSessionDirectory.js';
|
|
30
|
+
import { CanonicalEventLogStore } from '../system/state/canonicalEventLogStore.js';
|
|
31
|
+
import { SidecarManager } from './supervision/sidecarManager.js';
|
|
32
|
+
import { ManagementReadModelService } from '../system/projection/managementReadModelService.js';
|
|
33
|
+
import { RuntimeControlService } from './supervision/runtimeControlService.js';
|
|
34
|
+
import { NoopRuntimeManagementSurface } from './hosting/runtimeManagementPort.js';
|
|
35
|
+
import { RuntimeWorkManagementService } from '../domain/sessions/runtimeWorkManagementService.js';
|
|
36
|
+
import { ManagedChannelLifecycleService } from './lifecycle/managedChannelLifecycleService.js';
|
|
37
|
+
import { RuntimeInteractionService } from './execution/runtimeInteractionService.js';
|
|
38
|
+
import { RuntimeTransportSurfaceService } from './hosting/runtimeTransportSurfaceService.js';
|
|
39
|
+
import { ProviderRequestAttributionService } from './execution/providerCoordination/providerRequestAttributionService.js';
|
|
40
|
+
import { ProviderAttachmentResolver } from './execution/providerOrchestration/providerAttachmentResolver.js';
|
|
41
|
+
import { ProviderCompactionPolicy } from './execution/providerOrchestration/providerCompactionPolicy.js';
|
|
42
|
+
import { ProviderEventPipeline } from './execution/providerOrchestration/providerEventPipeline.js';
|
|
43
|
+
import { ProviderMissionEventProjector } from './execution/providerOrchestration/providerMissionEventProjector.js';
|
|
44
|
+
import { ProviderOrchestrator } from './execution/providerOrchestration/providerOrchestrator.js';
|
|
45
|
+
import { ProviderRequestProjector } from './execution/providerOrchestration/providerRequestProjector.js';
|
|
46
|
+
import { ProviderSessionOrchestrator } from './execution/providerOrchestration/providerSessionOrchestrator.js';
|
|
47
|
+
import { ProviderTurnBroker } from './execution/providerOrchestration/providerTurnBroker.js';
|
|
48
|
+
import { providerPolicyTarget } from './execution/providerCoordination/providerPolicyTarget.js';
|
|
49
|
+
import { RuntimeProjectionService } from '../system/projection/runtimeProjectionService.js';
|
|
50
|
+
import { RuntimeOrchestrationRequestService } from './execution/runtimeOrchestrationRequestService.js';
|
|
51
|
+
import { RuntimeLifecycleService } from './lifecycle/runtimeLifecycleService.js';
|
|
52
|
+
import { RuntimePluginContextService, defaultSessionOwner } from './execution/runtimePluginContextService.js';
|
|
53
|
+
import { RuntimePendingRequestService } from './execution/runtimePendingRequestService.js';
|
|
54
|
+
import { RuntimeHostingService } from './hosting/runtimeHostingService.js';
|
|
55
|
+
import { resolveMoorlineAssetRoot } from './hosting/runtimeLayout.js';
|
|
56
|
+
import { getDefaultRuntimeEnvironmentVerifier, getDefaultRuntimeProviderFactory } from './runtimeBootstrapRegistry.js';
|
|
57
|
+
import { createRuntimeWorkerQueues } from './execution/runtimeWorkerQueues.js';
|
|
58
|
+
import { normalizeRuntimeReply, prepareProviderImages, pruneProviderInputImages, validateLocalRuntimeFiles } from '../shared/utils/runtimeMessageUtils.js';
|
|
59
|
+
import { prepareMoorlineRuntimeLayout, resolveRuntimeMigrationsDir } from './graph/runtimePaths.js';
|
|
60
|
+
function resolveDefaultRuntimePolicyPath(runtimeRoot, fromUrl) {
|
|
61
|
+
const runtimePolicyPath = join(runtimeRoot, 'policies', 'default-secure.json');
|
|
62
|
+
if (existsSync(runtimePolicyPath)) {
|
|
63
|
+
return runtimePolicyPath;
|
|
64
|
+
}
|
|
65
|
+
const assetRoot = resolveMoorlineAssetRoot(fromUrl);
|
|
66
|
+
const packagedPolicyPath = join(assetRoot, 'resources', 'policies', 'default-secure.json');
|
|
67
|
+
if (existsSync(packagedPolicyPath)) {
|
|
68
|
+
return packagedPolicyPath;
|
|
69
|
+
}
|
|
70
|
+
return join(assetRoot, 'policies', 'default-secure.json');
|
|
71
|
+
}
|
|
72
|
+
export function buildMoorlineRuntimeServiceGraph(deps, callbacks) {
|
|
73
|
+
const transport = deps.transport;
|
|
74
|
+
if (!transport) {
|
|
75
|
+
throw new Error('MoorlineRuntime requires a transport adapter');
|
|
76
|
+
}
|
|
77
|
+
if (!deps.config.transport || !deps.config.provider) {
|
|
78
|
+
throw new Error('MoorlineRuntime requires an applied transport and provider configuration');
|
|
79
|
+
}
|
|
80
|
+
const normalizedConfig = {
|
|
81
|
+
...deps.config,
|
|
82
|
+
transport: deps.config.transport,
|
|
83
|
+
provider: deps.config.provider,
|
|
84
|
+
main: deps.config.main ?? defaultMainProcessConfig(),
|
|
85
|
+
namespace: deps.config.surface
|
|
86
|
+
};
|
|
87
|
+
const normalizedDeps = { ...deps, transport, config: normalizedConfig };
|
|
88
|
+
const paths = ensureRuntimePaths(normalizedConfig.runtimeRoot);
|
|
89
|
+
const homeRoot = homeRootForRuntime(paths.runtimeRoot);
|
|
90
|
+
const providerPackageId = normalizedConfig.provider.packageId ?? normalizedConfig.provider.kind;
|
|
91
|
+
const RETENTION_POLICY = {
|
|
92
|
+
runtimeEventTtlMs: 14 * 24 * 60 * 60 * 1000,
|
|
93
|
+
domainEventTtlMs: 14 * 24 * 60 * 60 * 1000,
|
|
94
|
+
resolvedRequestTtlMs: 14 * 24 * 60 * 60 * 1000,
|
|
95
|
+
orchestrationTtlMs: 14 * 24 * 60 * 60 * 1000,
|
|
96
|
+
imageTtlMs: 24 * 60 * 60 * 1000
|
|
97
|
+
};
|
|
98
|
+
const MAINTENANCE_MIN_INTERVAL_MS = 15 * 60 * 1000;
|
|
99
|
+
let lastMaintenanceRunMs = 0;
|
|
100
|
+
const chatWorkspacePath = join(paths.runtimeRoot, 'chat');
|
|
101
|
+
const runtimePolicyPath = resolveDefaultRuntimePolicyPath(paths.runtimeRoot, import.meta.url);
|
|
102
|
+
runMigrations(paths.sqlitePath, resolveRuntimeMigrationsDir(import.meta.url));
|
|
103
|
+
const store = new SqliteSessionStore(paths.sqlitePath);
|
|
104
|
+
const sessionRegistry = new SessionRegistry(store, paths.workspacesDir, providerPackageId);
|
|
105
|
+
const missionRegistry = new MissionRegistry(store, join(paths.workspacesDir, 'missions'));
|
|
106
|
+
const sessionLifecycle = new SessionLifecycleService(store, {
|
|
107
|
+
cooldownMinutes: 120,
|
|
108
|
+
archiveAfterDays: 14
|
|
109
|
+
});
|
|
110
|
+
const pluginHostRef = { current: new PluginHost([]) };
|
|
111
|
+
const inventory = new PackageInventoryStore(paths.runtimeRoot).load();
|
|
112
|
+
const activatedPackages = appliedPackageRefs(inventory.applied);
|
|
113
|
+
const enabledSkillRoots = inventory.installed
|
|
114
|
+
.filter((entry) => entry.surface === 'skill' && activatedPackages.some((ref) => ref.surface === 'skill' && ref.packageId === entry.packageId))
|
|
115
|
+
.map((entry) => join(entry.installPath, 'skills'));
|
|
116
|
+
const skillRegistry = new SkillRegistry(enabledSkillRoots);
|
|
117
|
+
const memoryStore = new MemoryStore(paths.runtimeRoot);
|
|
118
|
+
const audit = new JsonAuditLogger(join(paths.logsDir, 'policy-audit.jsonl'));
|
|
119
|
+
const providerState = new ProviderSessionDirectory(store);
|
|
120
|
+
const providerService = deps.provider ??
|
|
121
|
+
deps.providerFactory?.({ providerPackageId }) ??
|
|
122
|
+
getDefaultRuntimeProviderFactory()?.({ providerPackageId });
|
|
123
|
+
if (!providerService) {
|
|
124
|
+
throw new Error('MoorlineRuntime requires a provider or providerFactory');
|
|
125
|
+
}
|
|
126
|
+
const ingestion = new RuntimeIngestion(store);
|
|
127
|
+
const reactor = new CommandReactor(sessionRegistry);
|
|
128
|
+
const sharedDb = store.database();
|
|
129
|
+
const receiptBus = new RuntimeReceiptBus(new RuntimeReceiptStore(sharedDb));
|
|
130
|
+
const activities = new RuntimeActivityStore(sharedDb);
|
|
131
|
+
const pendingRequests = new PendingRequestProjectionStore(sharedDb);
|
|
132
|
+
const projectionState = new ProjectionStateStore(sharedDb);
|
|
133
|
+
const orchestration = new OrchestrationEngine(activities, pendingRequests);
|
|
134
|
+
const providerDirectory = providerState;
|
|
135
|
+
const canonicalEvents = new CanonicalEventLogStore(sharedDb);
|
|
136
|
+
const sidecars = new SidecarManager({
|
|
137
|
+
runtimeRoot: paths.runtimeRoot,
|
|
138
|
+
store,
|
|
139
|
+
now: callbacks.now,
|
|
140
|
+
appendAuditEvent: callbacks.appendAuditEvent
|
|
141
|
+
});
|
|
142
|
+
const snapshots = new RuntimeSnapshotQuery(store, sharedDb);
|
|
143
|
+
const reconciler = new RuntimeReconciler(store, snapshots);
|
|
144
|
+
const { providerQueue, commandQueue, projectionQueue, transportQueue, enqueueWithDiagnostics } = createRuntimeWorkerQueues(normalizedDeps.queueLimits, callbacks);
|
|
145
|
+
let providerOrchestrator;
|
|
146
|
+
let pluginContexts;
|
|
147
|
+
let managementSurface;
|
|
148
|
+
const runtimeControl = new RuntimeControlService({
|
|
149
|
+
requestControl: normalizedDeps.requestControl,
|
|
150
|
+
authorize: async ({ actorId, target, reason, requestedBy }) => {
|
|
151
|
+
await callbacks.requireGuard().run({
|
|
152
|
+
action: 'runtime.control',
|
|
153
|
+
actor: actorId,
|
|
154
|
+
target,
|
|
155
|
+
payload: { reason, requestedBy },
|
|
156
|
+
execute: async () => undefined
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
160
|
+
now: callbacks.now,
|
|
161
|
+
setAcceptingNewWork: callbacks.setAcceptingNewWork,
|
|
162
|
+
setProviderAutoStartDefault: (enabled) => {
|
|
163
|
+
providerOrchestrator.setProviderAutoStartDefault(enabled);
|
|
164
|
+
},
|
|
165
|
+
getSessionByThreadId: (threadId) => sessionRegistry.getByThreadId(threadId),
|
|
166
|
+
listSessions: () => sessionRegistry.list(),
|
|
167
|
+
upsertSession: (session) => {
|
|
168
|
+
store.upsertSession(session);
|
|
169
|
+
},
|
|
170
|
+
updateSession: (session) => sessionRegistry.updateSession(session),
|
|
171
|
+
stopProviderSession: (threadId) => {
|
|
172
|
+
providerService.stopSession(threadId);
|
|
173
|
+
},
|
|
174
|
+
stopAllProviders: () => {
|
|
175
|
+
providerService.stopAll();
|
|
176
|
+
},
|
|
177
|
+
drainProviders: async () => await providerService.drain(),
|
|
178
|
+
ensureProviderSession: async (session, actorId) => await providerOrchestrator.ensureSession(session, actorId)
|
|
179
|
+
});
|
|
180
|
+
const workManagement = new RuntimeWorkManagementService({
|
|
181
|
+
config: normalizedConfig,
|
|
182
|
+
getTransport: () => transport,
|
|
183
|
+
getGuard: callbacks.requireGuard,
|
|
184
|
+
requireNamespaceState: callbacks.requireNamespaceState,
|
|
185
|
+
sessionRegistry,
|
|
186
|
+
missionRegistry,
|
|
187
|
+
snapshots,
|
|
188
|
+
reactor,
|
|
189
|
+
providerService,
|
|
190
|
+
providerDirectory,
|
|
191
|
+
getProviderAutoStartDefault: callbacks.getProviderAutoStartDefault,
|
|
192
|
+
defaultSessionOwner,
|
|
193
|
+
queue: async (key, work) => await enqueueWithDiagnostics(commandQueue, key, 'work-management', work),
|
|
194
|
+
now: callbacks.now,
|
|
195
|
+
postTransportMessage: async (actorId, spaceId, payload) => {
|
|
196
|
+
await callbacks.postTransportMessage(actorId, spaceId, payload);
|
|
197
|
+
},
|
|
198
|
+
sendStatusUpdate: async (payload) => await callbacks.sendStatusUpdate(payload),
|
|
199
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
200
|
+
runOrchestrationTurn: callbacks.runOrchestrationTurn,
|
|
201
|
+
rejectTurnWaitersForThread: callbacks.rejectTurnWaitersForThread,
|
|
202
|
+
cleanupScopedSidecars: callbacks.cleanupScopedSidecars
|
|
203
|
+
});
|
|
204
|
+
const managedChannelLifecycle = new ManagedChannelLifecycleService({
|
|
205
|
+
config: normalizedConfig,
|
|
206
|
+
getNamespaceState: callbacks.getNamespaceState,
|
|
207
|
+
sessionRegistry,
|
|
208
|
+
missionRegistry,
|
|
209
|
+
providerService,
|
|
210
|
+
providerDirectory,
|
|
211
|
+
workManagement,
|
|
212
|
+
getProviderAutoStartDefault: callbacks.getProviderAutoStartDefault,
|
|
213
|
+
queue: async (key, work) => await enqueueWithDiagnostics(commandQueue, key, 'managed-work-lifecycle', work),
|
|
214
|
+
now: callbacks.now,
|
|
215
|
+
postTransportMessage: async (actor, spaceId, payload) => {
|
|
216
|
+
await callbacks.postTransportMessage(actor, spaceId, payload);
|
|
217
|
+
},
|
|
218
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
219
|
+
recordRuntimeActivity: callbacks.recordRuntimeActivity,
|
|
220
|
+
rejectTurnWaitersForThread: callbacks.rejectTurnWaitersForThread,
|
|
221
|
+
cleanupScopedSidecars: callbacks.cleanupScopedSidecars
|
|
222
|
+
});
|
|
223
|
+
const interactions = new RuntimeInteractionService({
|
|
224
|
+
config: normalizedConfig,
|
|
225
|
+
sessionRegistry,
|
|
226
|
+
missionRegistry,
|
|
227
|
+
sessionLifecycle,
|
|
228
|
+
snapshots,
|
|
229
|
+
getPluginHost: () => pluginHostRef.current,
|
|
230
|
+
queue: async (key, work) => await enqueueWithDiagnostics(commandQueue, key, 'runtime-interactions', work),
|
|
231
|
+
now: callbacks.now,
|
|
232
|
+
getNamespaceReady: () => callbacks.getNamespaceState() !== null,
|
|
233
|
+
getAcceptingNewWork: () => callbacks.getRuntimeControlStatus().acceptingNewWork,
|
|
234
|
+
postTransportMessage: async (actor, spaceId, payload) => {
|
|
235
|
+
await callbacks.postTransportMessage(actor, spaceId, payload);
|
|
236
|
+
},
|
|
237
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
238
|
+
createPluginContext: callbacks.createPluginContext,
|
|
239
|
+
createMissionReply: async (event, mission) => {
|
|
240
|
+
const missionSession = lifecycleService.missionAsSession(mission);
|
|
241
|
+
return await callbacks.createPluginContext('runtime:mission/message').runAgent({
|
|
242
|
+
surface: 'mission',
|
|
243
|
+
spaceId: mission.spaceId,
|
|
244
|
+
actorId: event.actor.actorId,
|
|
245
|
+
actorLabel: event.actor.displayName ?? event.actor.actorId,
|
|
246
|
+
text: event.message.text,
|
|
247
|
+
attachments: event.message.attachments,
|
|
248
|
+
session: missionSession,
|
|
249
|
+
cwd: mission.workspacePath,
|
|
250
|
+
runtimeMode: mission.runtimeMode,
|
|
251
|
+
basePromptSections: await pluginContexts.loadMissionPromptSections(mission)
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
configureDraftMission: async (input) => await workManagement.configureDraftMission({
|
|
255
|
+
actorId: input.actorId,
|
|
256
|
+
spaceId: input.spaceId,
|
|
257
|
+
missionId: input.missionId,
|
|
258
|
+
goal: input.goal,
|
|
259
|
+
schedule: input.schedule,
|
|
260
|
+
...(input.startTime ? { startTime: input.startTime } : {}),
|
|
261
|
+
...(input.runtimeMode ? { runtimeMode: input.runtimeMode } : {})
|
|
262
|
+
}),
|
|
263
|
+
isAdminActor: callbacks.isAdminActor,
|
|
264
|
+
respondToProviderRequest: async (actorId, threadId, requestId, decision, deniedTitle, metadata) => await pendingRequestService.respondToProviderRequest(actorId, threadId, requestId, decision, deniedTitle, metadata),
|
|
265
|
+
resolvePendingRequest: async (input) => void (await pendingRequestService.resolvePendingRequest({
|
|
266
|
+
actorId: input.actorId,
|
|
267
|
+
requestId: input.requestId,
|
|
268
|
+
decision: input.decision,
|
|
269
|
+
deniedTitle: input.deniedTitle,
|
|
270
|
+
metadata: input.metadata,
|
|
271
|
+
requestActor: input.requestActor
|
|
272
|
+
}))
|
|
273
|
+
});
|
|
274
|
+
const transportSurface = new RuntimeTransportSurfaceService({
|
|
275
|
+
queue: async (key, work) => await enqueueWithDiagnostics(transportQueue, key, 'runtime-transport-surface', work),
|
|
276
|
+
guard: callbacks.requireGuard,
|
|
277
|
+
transport: () => transport,
|
|
278
|
+
getNamespaceState: callbacks.getNamespaceState
|
|
279
|
+
});
|
|
280
|
+
const providerAttribution = new ProviderRequestAttributionService();
|
|
281
|
+
const providerModelPorts = {
|
|
282
|
+
configuredProviderModel: () => usesProviderDefaultModel(normalizedConfig.defaults.model) ? undefined : normalizedConfig.defaults.model,
|
|
283
|
+
providerPolicyTarget: (threadId, suffix) => providerPolicyTarget(normalizedConfig, threadId, suffix)
|
|
284
|
+
};
|
|
285
|
+
const providerGuardPort = {
|
|
286
|
+
runGuardedProviderAction: callbacks.runGuardedAction
|
|
287
|
+
};
|
|
288
|
+
const providerAuditPort = {
|
|
289
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
290
|
+
recordRuntimeActivity: callbacks.recordRuntimeActivity
|
|
291
|
+
};
|
|
292
|
+
const providerSessionOrchestrator = new ProviderSessionOrchestrator({
|
|
293
|
+
config: normalizedConfig,
|
|
294
|
+
runtimeRoot: paths.runtimeRoot,
|
|
295
|
+
provider: providerService,
|
|
296
|
+
connections: providerDirectory,
|
|
297
|
+
sessions: sessionRegistry,
|
|
298
|
+
missions: missionRegistry,
|
|
299
|
+
now: callbacks.now,
|
|
300
|
+
upsertSession: (session) => store.upsertSession(session),
|
|
301
|
+
setProviderAutoStartDefault: (enabled) => {
|
|
302
|
+
callbacks.setProviderAutoStartDefault(enabled);
|
|
303
|
+
store.putMetadata('runtime.provider.auto_start.default', enabled, callbacks.now());
|
|
304
|
+
},
|
|
305
|
+
...providerModelPorts,
|
|
306
|
+
...providerGuardPort
|
|
307
|
+
});
|
|
308
|
+
const providerTurnBroker = new ProviderTurnBroker({
|
|
309
|
+
provider: providerService,
|
|
310
|
+
sessions: providerSessionOrchestrator,
|
|
311
|
+
typing: transportSurface,
|
|
312
|
+
attribution: providerAttribution,
|
|
313
|
+
now: callbacks.now,
|
|
314
|
+
turnWaitTimeoutMs: normalizedDeps.providerTurnWaitTimeoutMs,
|
|
315
|
+
...providerModelPorts,
|
|
316
|
+
...providerGuardPort,
|
|
317
|
+
...providerAuditPort
|
|
318
|
+
});
|
|
319
|
+
const providerRequestProjector = new ProviderRequestProjector({
|
|
320
|
+
pending: {
|
|
321
|
+
upsertPendingRequest: (request) => store.upsertPendingRequest(request),
|
|
322
|
+
getPendingRequest: (requestId) => snapshots.getOpenRequestById(requestId) ?? store.getPendingRequest(requestId)
|
|
323
|
+
},
|
|
324
|
+
attribution: providerAttribution,
|
|
325
|
+
postRuntimeRequestMessage: async (spaceId, request) => await pendingRequestService.postRuntimeRequestMessage(spaceId, request)
|
|
326
|
+
});
|
|
327
|
+
const providerAttachmentResolver = new ProviderAttachmentResolver({
|
|
328
|
+
runtimeRoot: paths.runtimeRoot,
|
|
329
|
+
now: callbacks.now,
|
|
330
|
+
getSessionByThreadId: (threadId) => sessionRegistry.getByThreadId(threadId),
|
|
331
|
+
getMissionByThreadId: (threadId) => missionRegistry.getByThreadId(threadId),
|
|
332
|
+
...providerAuditPort
|
|
333
|
+
});
|
|
334
|
+
const providerCompactionPolicy = new ProviderCompactionPolicy({
|
|
335
|
+
provider: providerService,
|
|
336
|
+
now: callbacks.now,
|
|
337
|
+
getSessionByThreadId: (threadId) => sessionRegistry.getByThreadId(threadId),
|
|
338
|
+
...providerModelPorts,
|
|
339
|
+
...providerGuardPort,
|
|
340
|
+
...providerAuditPort
|
|
341
|
+
});
|
|
342
|
+
const providerMissionEventProjector = new ProviderMissionEventProjector({
|
|
343
|
+
missions: missionRegistry,
|
|
344
|
+
upsertMissionRun: (run) => store.upsertMissionRun(run)
|
|
345
|
+
});
|
|
346
|
+
const providerEventPipeline = new ProviderEventPipeline({
|
|
347
|
+
canonicalEvents,
|
|
348
|
+
ingestion,
|
|
349
|
+
receiptBus,
|
|
350
|
+
compaction: providerCompactionPolicy,
|
|
351
|
+
requests: providerRequestProjector,
|
|
352
|
+
turns: providerTurnBroker,
|
|
353
|
+
attachments: providerAttachmentResolver,
|
|
354
|
+
missions: providerMissionEventProjector,
|
|
355
|
+
getPluginHost: () => pluginHostRef.current,
|
|
356
|
+
createPluginContext: callbacks.createPluginContext,
|
|
357
|
+
getSessionByThreadId: (threadId) => sessionRegistry.getByThreadId(threadId),
|
|
358
|
+
getMissionByThreadId: (threadId) => missionRegistry.getByThreadId(threadId),
|
|
359
|
+
handleDomainEvent: async (event) => await projectionService.handleDomainEvent(event)
|
|
360
|
+
});
|
|
361
|
+
providerOrchestrator = new ProviderOrchestrator({
|
|
362
|
+
provider: providerService,
|
|
363
|
+
connections: providerDirectory,
|
|
364
|
+
sessions: providerSessionOrchestrator,
|
|
365
|
+
turns: providerTurnBroker,
|
|
366
|
+
compaction: providerCompactionPolicy,
|
|
367
|
+
events: providerEventPipeline
|
|
368
|
+
});
|
|
369
|
+
const projectionService = new RuntimeProjectionService({
|
|
370
|
+
store,
|
|
371
|
+
snapshots,
|
|
372
|
+
ingestion,
|
|
373
|
+
receiptBus,
|
|
374
|
+
pendingRequests,
|
|
375
|
+
projectionState,
|
|
376
|
+
orchestration,
|
|
377
|
+
reconciler,
|
|
378
|
+
queue: async (key, work) => await enqueueWithDiagnostics(projectionQueue, key, 'runtime-projection', work),
|
|
379
|
+
now: callbacks.now,
|
|
380
|
+
getPluginHost: () => pluginHostRef.current,
|
|
381
|
+
createPluginContext: callbacks.createPluginContext,
|
|
382
|
+
sendStatusUpdate: async (payload) => await callbacks.sendStatusUpdate(payload),
|
|
383
|
+
postRuntimeRequestMessage: async (spaceId, request) => await pendingRequestService.postRuntimeRequestMessage(spaceId, request),
|
|
384
|
+
recordRuntimeActivity: callbacks.recordRuntimeActivity
|
|
385
|
+
});
|
|
386
|
+
const orchestrationRequests = new RuntimeOrchestrationRequestService({
|
|
387
|
+
store,
|
|
388
|
+
workManagement,
|
|
389
|
+
createPluginContext: callbacks.createPluginContext,
|
|
390
|
+
now: callbacks.now,
|
|
391
|
+
validateLocalFiles: (files, input) => {
|
|
392
|
+
const allowlistedRoots = [join(paths.runtimeRoot, 'chat')];
|
|
393
|
+
if (input.requestedByThreadId) {
|
|
394
|
+
const session = sessionRegistry.getByThreadId(input.requestedByThreadId);
|
|
395
|
+
const mission = missionRegistry.getByThreadId(input.requestedByThreadId);
|
|
396
|
+
const workspacePath = session?.workspacePath ?? mission?.workspacePath;
|
|
397
|
+
if (workspacePath) {
|
|
398
|
+
allowlistedRoots.push(workspacePath);
|
|
399
|
+
}
|
|
400
|
+
allowlistedRoots.push(join(paths.runtimeRoot, 'state', 'input-images', input.requestedByThreadId));
|
|
401
|
+
}
|
|
402
|
+
validateLocalRuntimeFiles(files, allowlistedRoots);
|
|
403
|
+
},
|
|
404
|
+
postTransportMessage: async (actor, spaceId, payload) => await callbacks.postTransportMessage(actor, spaceId, payload),
|
|
405
|
+
onForcedDrain: (signal) => {
|
|
406
|
+
callbacks.appendAuditEvent('runtime.orchestration.drain_forced', {
|
|
407
|
+
timeoutMs: signal.timeoutMs,
|
|
408
|
+
inFlightRequestIds: signal.inFlightRequestIds,
|
|
409
|
+
oldestInFlightAgeMs: signal.oldestInFlightAgeMs,
|
|
410
|
+
at: signal.at
|
|
411
|
+
});
|
|
412
|
+
callbacks.recordRuntimeActivity({
|
|
413
|
+
threadId: 'runtime:orchestration',
|
|
414
|
+
sessionId: null,
|
|
415
|
+
spaceId: null,
|
|
416
|
+
sourceEventId: randomUUID(),
|
|
417
|
+
kind: 'runtime.orchestration.forced_drain',
|
|
418
|
+
severity: 'warning',
|
|
419
|
+
title: 'Forced orchestration drain',
|
|
420
|
+
detail: `${signal.inFlightRequestIds.length} in-flight orchestration request(s) exceeded drain timeout ${signal.timeoutMs}ms.`,
|
|
421
|
+
createdAt: callbacks.now()
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
const lifecycleService = new RuntimeLifecycleService({
|
|
426
|
+
store,
|
|
427
|
+
transport,
|
|
428
|
+
transportScopeId: normalizedConfig.transport.scopeId,
|
|
429
|
+
providerPackageId,
|
|
430
|
+
sessionLifecycle,
|
|
431
|
+
sessionRegistry,
|
|
432
|
+
missionRegistry,
|
|
433
|
+
providerOrchestrator,
|
|
434
|
+
requireGuard: callbacks.requireGuard,
|
|
435
|
+
getNamespaceState: callbacks.getNamespaceState,
|
|
436
|
+
queue: async (key, work) => await enqueueWithDiagnostics(commandQueue, key, 'runtime-lifecycle', work),
|
|
437
|
+
now: callbacks.now,
|
|
438
|
+
postTransportMessage: async (actor, spaceId, payload) => {
|
|
439
|
+
await callbacks.postTransportMessage(actor, spaceId, payload);
|
|
440
|
+
},
|
|
441
|
+
sendStatusUpdate: async (payload) => await callbacks.sendStatusUpdate(payload),
|
|
442
|
+
normalizeReply: (text) => normalizeRuntimeReply(text),
|
|
443
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
444
|
+
runMaintenance: async () => {
|
|
445
|
+
const nowMs = Date.now();
|
|
446
|
+
if (nowMs - lastMaintenanceRunMs < MAINTENANCE_MIN_INTERVAL_MS) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
lastMaintenanceRunMs = nowMs;
|
|
450
|
+
const nowIso = callbacks.now();
|
|
451
|
+
const dbStats = store.pruneRuntimeHistory({
|
|
452
|
+
nowIso,
|
|
453
|
+
runtimeEventTtlMs: RETENTION_POLICY.runtimeEventTtlMs,
|
|
454
|
+
domainEventTtlMs: RETENTION_POLICY.domainEventTtlMs,
|
|
455
|
+
resolvedRequestTtlMs: RETENTION_POLICY.resolvedRequestTtlMs,
|
|
456
|
+
orchestrationTtlMs: RETENTION_POLICY.orchestrationTtlMs
|
|
457
|
+
});
|
|
458
|
+
const imageStats = pruneProviderInputImages({
|
|
459
|
+
runtimeRoot: paths.runtimeRoot,
|
|
460
|
+
nowMs,
|
|
461
|
+
ttlMs: RETENTION_POLICY.imageTtlMs
|
|
462
|
+
});
|
|
463
|
+
store.putMetadata('runtime.retention.last_prune', {
|
|
464
|
+
lastPrunedAt: nowIso,
|
|
465
|
+
policy: RETENTION_POLICY,
|
|
466
|
+
stats: {
|
|
467
|
+
...dbStats,
|
|
468
|
+
removedInputImageFiles: imageStats.removedFiles,
|
|
469
|
+
removedInputImageDirectories: imageStats.removedDirectories
|
|
470
|
+
}
|
|
471
|
+
}, nowIso);
|
|
472
|
+
if (dbStats.runtimeEventsDeleted > 0 ||
|
|
473
|
+
dbStats.domainEventsDeleted > 0 ||
|
|
474
|
+
dbStats.resolvedRequestsDeleted > 0 ||
|
|
475
|
+
dbStats.closedOrchestrationRequestsDeleted > 0 ||
|
|
476
|
+
imageStats.removedFiles > 0) {
|
|
477
|
+
callbacks.appendAuditEvent('runtime.retention.pruned', {
|
|
478
|
+
...dbStats,
|
|
479
|
+
removedInputImageFiles: imageStats.removedFiles,
|
|
480
|
+
removedInputImageDirectories: imageStats.removedDirectories,
|
|
481
|
+
scannedInputImageThreads: imageStats.scannedThreads
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
reportLifecycleFailure: (error) => {
|
|
486
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
487
|
+
callbacks.appendAuditEvent('runtime.lifecycle.tick.failed', {
|
|
488
|
+
error: message
|
|
489
|
+
});
|
|
490
|
+
try {
|
|
491
|
+
callbacks.recordRuntimeActivity({
|
|
492
|
+
threadId: 'runtime:lifecycle',
|
|
493
|
+
sessionId: null,
|
|
494
|
+
spaceId: null,
|
|
495
|
+
sourceEventId: randomUUID(),
|
|
496
|
+
kind: 'runtime.lifecycle.failed',
|
|
497
|
+
severity: 'error',
|
|
498
|
+
title: 'Lifecycle sweep failed',
|
|
499
|
+
detail: message,
|
|
500
|
+
createdAt: callbacks.now()
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
catch (activityError) {
|
|
504
|
+
callbacks.appendAuditEvent('runtime.lifecycle.tick.failure_record.failed', {
|
|
505
|
+
error: activityError instanceof Error ? activityError.message : String(activityError),
|
|
506
|
+
originalError: message
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
cleanupScopedSidecars: callbacks.cleanupScopedSidecars
|
|
511
|
+
});
|
|
512
|
+
const missionHooks = new MissionHookService({
|
|
513
|
+
store,
|
|
514
|
+
lifecycle: lifecycleService,
|
|
515
|
+
now: callbacks.now,
|
|
516
|
+
appendAuditEvent: callbacks.appendAuditEvent
|
|
517
|
+
});
|
|
518
|
+
const pendingRequestService = new RuntimePendingRequestService({
|
|
519
|
+
store,
|
|
520
|
+
snapshots,
|
|
521
|
+
providerService,
|
|
522
|
+
providerId: normalizedConfig.provider.packageId ?? normalizedConfig.provider.kind,
|
|
523
|
+
isAdminActor: callbacks.isAdminActor,
|
|
524
|
+
now: callbacks.now,
|
|
525
|
+
postTransportMessage: async (actor, spaceId, payload) => await callbacks.postTransportMessage(actor, spaceId, payload),
|
|
526
|
+
runGuardedAction: callbacks.runGuardedAction,
|
|
527
|
+
recordRuntimeActivity: callbacks.recordRuntimeActivity
|
|
528
|
+
});
|
|
529
|
+
pluginContexts = new RuntimePluginContextService({
|
|
530
|
+
config: normalizedConfig,
|
|
531
|
+
configPath: normalizedDeps.configPath,
|
|
532
|
+
runtimeRoot: paths.runtimeRoot,
|
|
533
|
+
homeRoot,
|
|
534
|
+
sqlitePath: paths.sqlitePath,
|
|
535
|
+
chatWorkspacePath,
|
|
536
|
+
store,
|
|
537
|
+
sessionRegistry,
|
|
538
|
+
missionRegistry,
|
|
539
|
+
missionHooks,
|
|
540
|
+
skillRegistry,
|
|
541
|
+
memoryStore,
|
|
542
|
+
activities,
|
|
543
|
+
projectionState,
|
|
544
|
+
snapshots,
|
|
545
|
+
providerService,
|
|
546
|
+
canonicalEvents,
|
|
547
|
+
workManagement,
|
|
548
|
+
lifecycleService,
|
|
549
|
+
runtimeControl,
|
|
550
|
+
sidecars,
|
|
551
|
+
providerOrchestrator,
|
|
552
|
+
getPluginHost: () => pluginHostRef.current,
|
|
553
|
+
getAdminConfig: callbacks.getEffectiveAdminConfig,
|
|
554
|
+
isAdminActor: callbacks.isAdminActor,
|
|
555
|
+
requireNamespaceState: callbacks.requireNamespaceState,
|
|
556
|
+
getNamespaceState: callbacks.getNamespaceState,
|
|
557
|
+
getRuntimeStatus: callbacks.getRuntimeStatus,
|
|
558
|
+
getRuntimeControlStatus: callbacks.getRuntimeControlStatus,
|
|
559
|
+
ensureChatSession: callbacks.ensureChatSession,
|
|
560
|
+
prepareProviderImages: async (threadId, attachments) => await prepareProviderImages({
|
|
561
|
+
runtimeRoot: paths.runtimeRoot,
|
|
562
|
+
threadId,
|
|
563
|
+
attachments
|
|
564
|
+
}),
|
|
565
|
+
normalizeReply: (text) => normalizeRuntimeReply(text),
|
|
566
|
+
postTransportMessage: async (actor, spaceId, payload) => {
|
|
567
|
+
await callbacks.postTransportMessage(actor, spaceId, payload);
|
|
568
|
+
},
|
|
569
|
+
appendAuditEvent: callbacks.appendAuditEvent,
|
|
570
|
+
now: callbacks.now,
|
|
571
|
+
runGuardedAction: callbacks.runGuardedAction,
|
|
572
|
+
resolvePendingRequest: async (input) => void (await pendingRequestService.resolvePendingRequest(input)),
|
|
573
|
+
answerPendingRequest: async (input) => void (await pendingRequestService.answerPendingRequest(input)),
|
|
574
|
+
drainRuntimeWork: async () => {
|
|
575
|
+
await providerQueue.drain();
|
|
576
|
+
await commandQueue.drain();
|
|
577
|
+
await projectionQueue.drain();
|
|
578
|
+
await transportQueue.drain();
|
|
579
|
+
await orchestrationRequests.drain();
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
const managementReadModel = new ManagementReadModelService({
|
|
583
|
+
homeRoot,
|
|
584
|
+
runtimeRoot: paths.runtimeRoot,
|
|
585
|
+
config: normalizedConfig,
|
|
586
|
+
snapshots,
|
|
587
|
+
missions: missionRegistry,
|
|
588
|
+
skills: skillRegistry,
|
|
589
|
+
provider: providerService,
|
|
590
|
+
sidecars,
|
|
591
|
+
now: callbacks.now,
|
|
592
|
+
getRuntimeControlStatus: callbacks.getRuntimeControlStatus,
|
|
593
|
+
getRuntimeStatus: callbacks.getRuntimeStatus,
|
|
594
|
+
getNamespaceState: callbacks.getNamespaceState,
|
|
595
|
+
getManagementSurface: () => managementSurface.getSurfaceState(),
|
|
596
|
+
getPluginHost: () => pluginHostRef.current,
|
|
597
|
+
createPluginContext: callbacks.createPluginContext,
|
|
598
|
+
getRuntimeWorkerQueues: () => [providerQueue.getStats(), commandQueue.getStats(), projectionQueue.getStats(), transportQueue.getStats()],
|
|
599
|
+
packageCatalog: OFFICIAL_CATALOG,
|
|
600
|
+
...(normalizedDeps.managementPresentation ? { presentation: normalizedDeps.managementPresentation } : {})
|
|
601
|
+
});
|
|
602
|
+
managementSurface = normalizedDeps.managementSurfaceFactory?.create({
|
|
603
|
+
config: normalizedConfig,
|
|
604
|
+
configPath: normalizedDeps.configPath,
|
|
605
|
+
managementReadModel,
|
|
606
|
+
createPluginContext: callbacks.createPluginContext,
|
|
607
|
+
requestSetRuntimeAcceptingNewWork: async (input) => await runtimeControl.requestSetRuntimeAcceptingNewWork(input),
|
|
608
|
+
requestRuntimeReload: async (input) => await runtimeControl.requestRuntimeReload(input),
|
|
609
|
+
requestStopProviderSessions: async (input) => await runtimeControl.requestStopProviderSessions(input),
|
|
610
|
+
requestStartProviderSessions: async (input) => await runtimeControl.requestStartProviderSessions(input)
|
|
611
|
+
}) ?? new NoopRuntimeManagementSurface();
|
|
612
|
+
const hostingService = new RuntimeHostingService({
|
|
613
|
+
config: normalizedConfig,
|
|
614
|
+
transport,
|
|
615
|
+
managementSurface,
|
|
616
|
+
installationPath: paths.installationPath,
|
|
617
|
+
now: callbacks.now,
|
|
618
|
+
verifyEnvironment: normalizedDeps.verifyEnvironment ?? getDefaultRuntimeEnvironmentVerifier() ?? undefined,
|
|
619
|
+
authorizeTransportSetup: async ({ target, execute }) => await callbacks.requireGuard().run({
|
|
620
|
+
action: 'transport.action.register',
|
|
621
|
+
actor: 'runtime:transport/register-commands',
|
|
622
|
+
target,
|
|
623
|
+
execute
|
|
624
|
+
})
|
|
625
|
+
});
|
|
626
|
+
receiptBus.on('quiesced', (receipt) => {
|
|
627
|
+
providerOrchestrator.flushThread(receipt.threadId);
|
|
628
|
+
});
|
|
629
|
+
mkdirSync(chatWorkspacePath, { recursive: true });
|
|
630
|
+
return {
|
|
631
|
+
deps: normalizedDeps,
|
|
632
|
+
paths,
|
|
633
|
+
chatWorkspacePath,
|
|
634
|
+
runtimePolicyPath,
|
|
635
|
+
store,
|
|
636
|
+
sessionRegistry,
|
|
637
|
+
missionRegistry,
|
|
638
|
+
sessionLifecycle,
|
|
639
|
+
pluginHostRef,
|
|
640
|
+
pluginHost: pluginHostRef.current,
|
|
641
|
+
skillRegistry,
|
|
642
|
+
memoryStore,
|
|
643
|
+
audit,
|
|
644
|
+
providerService,
|
|
645
|
+
ingestion,
|
|
646
|
+
reactor,
|
|
647
|
+
receiptBus,
|
|
648
|
+
activities,
|
|
649
|
+
pendingRequests,
|
|
650
|
+
projectionState,
|
|
651
|
+
orchestration,
|
|
652
|
+
snapshots,
|
|
653
|
+
reconciler,
|
|
654
|
+
providerDirectory,
|
|
655
|
+
canonicalEvents,
|
|
656
|
+
sidecars,
|
|
657
|
+
managementReadModel,
|
|
658
|
+
runtimeControl,
|
|
659
|
+
workManagement,
|
|
660
|
+
managedChannelLifecycle,
|
|
661
|
+
interactions,
|
|
662
|
+
transportSurface,
|
|
663
|
+
providerOrchestrator,
|
|
664
|
+
projectionService,
|
|
665
|
+
managementSurface,
|
|
666
|
+
hostingService,
|
|
667
|
+
orchestrationRequests,
|
|
668
|
+
lifecycleService,
|
|
669
|
+
pendingRequestService,
|
|
670
|
+
missionHooks,
|
|
671
|
+
pluginContexts,
|
|
672
|
+
providerQueue,
|
|
673
|
+
commandQueue,
|
|
674
|
+
projectionQueue,
|
|
675
|
+
transportQueue
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
export async function prepareRuntimeLayout(runtimeRoot) {
|
|
679
|
+
await prepareMoorlineRuntimeLayout(runtimeRoot, import.meta.url);
|
|
680
|
+
}
|
|
681
|
+
//# sourceMappingURL=moorlineRuntimeBuilder.js.map
|