@vybestack/llxprt-code-core 0.11.0 → 0.12.0-nightly.260910.2aac6841e
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prompt-config/defaults/default-prompts.json +3 -3
- package/dist/src/config/agentClientLifecycle.d.ts +4 -3
- package/dist/src/config/agentClientLifecycle.js +27 -14
- package/dist/src/config/agentClientLifecycle.js.map +1 -1
- package/dist/src/config/config.d.ts +2 -5
- package/dist/src/config/config.js +10 -23
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/configBase.d.ts +5 -1
- package/dist/src/config/configBase.js +27 -6
- package/dist/src/config/configBase.js.map +1 -1
- package/dist/src/config/configBaseCore.d.ts +26 -8
- package/dist/src/config/configBaseCore.js +30 -26
- package/dist/src/config/configBaseCore.js.map +1 -1
- package/dist/src/config/configMcpRuntime.d.ts +16 -0
- package/dist/src/config/configMcpRuntime.js +31 -0
- package/dist/src/config/configMcpRuntime.js.map +1 -0
- package/dist/src/config/configMediaDefaults.d.ts +10 -0
- package/dist/src/config/configMediaDefaults.js +17 -0
- package/dist/src/config/configMediaDefaults.js.map +1 -0
- package/dist/src/config/configTestHarness.d.ts +4 -0
- package/dist/src/config/configTypes.d.ts +4 -54
- package/dist/src/config/configTypes.js +6 -82
- package/dist/src/config/configTypes.js.map +1 -1
- package/dist/src/config/index.d.ts +1 -2
- package/dist/src/config/index.js +1 -2
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/config/models.d.ts +0 -4
- package/dist/src/config/models.js +0 -4
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/toolRegistryFactory.d.ts +2 -2
- package/dist/src/core/clientContract.d.ts +4 -6
- package/dist/src/core/compression/transcriptPathNotice.d.ts +22 -0
- package/dist/src/core/compression/transcriptPathNotice.js +29 -0
- package/dist/src/core/compression/transcriptPathNotice.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +2 -5
- package/dist/src/core/contentGenerator.js +10 -24
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/logger.d.ts +66 -0
- package/dist/src/core/logger.js +345 -30
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/prompts.d.ts +0 -1
- package/dist/src/core/prompts.js +5 -79
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/turn.d.ts +3 -3
- package/dist/src/hooks/hookTranslator.js +5 -4
- package/dist/src/hooks/hookTranslator.js.map +1 -1
- package/dist/src/index.d.ts +8 -6
- package/dist/src/index.js +8 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/llm-types/index.d.ts +1 -1
- package/dist/src/llm-types/modelEnvelope.d.ts +2 -1
- package/dist/src/llm-types/modelEnvelope.js +17 -1
- package/dist/src/llm-types/modelEnvelope.js.map +1 -1
- package/dist/src/models/schema.d.ts +40 -40
- package/dist/src/policy/policies/read-only.toml +0 -5
- package/dist/src/prompt-config/TemplateEngine.js +0 -3
- package/dist/src/prompt-config/TemplateEngine.js.map +1 -1
- package/dist/src/prompt-config/defaults/providers/gemini/core.md +0 -2
- package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/core.md +0 -2
- package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/gemini-2-5-flash/core.md +0 -2
- package/dist/src/prompt-config/prompt-loader.d.ts +1 -1
- package/dist/src/prompt-config/prompt-loader.js +4 -4
- package/dist/src/prompt-config/prompt-loader.js.map +1 -1
- package/dist/src/prompt-config/types.d.ts +0 -1
- package/dist/src/recording/CheckpointService.d.ts +4 -0
- package/dist/src/recording/CheckpointService.js +67 -46
- package/dist/src/recording/CheckpointService.js.map +1 -1
- package/dist/src/recording/HistoryMutationService.d.ts +1 -1
- package/dist/src/recording/HistoryMutationService.js +27 -4
- package/dist/src/recording/HistoryMutationService.js.map +1 -1
- package/dist/src/recording/RecordingIntegration.d.ts +36 -2
- package/dist/src/recording/RecordingIntegration.js +224 -7
- package/dist/src/recording/RecordingIntegration.js.map +1 -1
- package/dist/src/recording/ReplayEngine.d.ts +8 -10
- package/dist/src/recording/ReplayEngine.js +161 -95
- package/dist/src/recording/ReplayEngine.js.map +1 -1
- package/dist/src/recording/SessionDiscovery.d.ts +4 -2
- package/dist/src/recording/SessionDiscovery.js +13 -5
- package/dist/src/recording/SessionDiscovery.js.map +1 -1
- package/dist/src/recording/SessionRecordingService.d.ts +23 -3
- package/dist/src/recording/SessionRecordingService.js +209 -51
- package/dist/src/recording/SessionRecordingService.js.map +1 -1
- package/dist/src/recording/SessionTransitionService.d.ts +7 -0
- package/dist/src/recording/SessionTransitionService.js +66 -13
- package/dist/src/recording/SessionTransitionService.js.map +1 -1
- package/dist/src/recording/index.d.ts +1 -0
- package/dist/src/recording/index.js +1 -0
- package/dist/src/recording/index.js.map +1 -1
- package/dist/src/recording/janitor/cleanupTypes.d.ts +3 -0
- package/dist/src/recording/janitor/cleanupTypes.js.map +1 -1
- package/dist/src/recording/janitor/mediaReclamation.d.ts +23 -0
- package/dist/src/recording/janitor/mediaReclamation.js +195 -0
- package/dist/src/recording/janitor/mediaReclamation.js.map +1 -0
- package/dist/src/recording/janitor/sessionJanitor.js +47 -1
- package/dist/src/recording/janitor/sessionJanitor.js.map +1 -1
- package/dist/src/recording/janitor/sessionScanner.d.ts +12 -9
- package/dist/src/recording/janitor/sessionScanner.js +248 -193
- package/dist/src/recording/janitor/sessionScanner.js.map +1 -1
- package/dist/src/recording/replay-test-helpers.d.ts +10 -1
- package/dist/src/recording/replay-test-helpers.js +24 -2
- package/dist/src/recording/replay-test-helpers.js.map +1 -1
- package/dist/src/recording/replayCheckpointMetadata.d.ts +28 -0
- package/dist/src/recording/replayCheckpointMetadata.js +96 -0
- package/dist/src/recording/replayCheckpointMetadata.js.map +1 -0
- package/dist/src/recording/replayErrorFormatting.d.ts +6 -0
- package/dist/src/recording/replayErrorFormatting.js +38 -0
- package/dist/src/recording/replayErrorFormatting.js.map +1 -0
- package/dist/src/recording/resumeSession.d.ts +3 -0
- package/dist/src/recording/resumeSession.js +7 -1
- package/dist/src/recording/resumeSession.js.map +1 -1
- package/dist/src/recording/semanticMediaPurgeReplayValidation.d.ts +14 -0
- package/dist/src/recording/semanticMediaPurgeReplayValidation.js +24 -0
- package/dist/src/recording/semanticMediaPurgeReplayValidation.js.map +1 -0
- package/dist/src/recording/session-media-package-blobs.d.ts +8 -0
- package/dist/src/recording/session-media-package-blobs.js +72 -0
- package/dist/src/recording/session-media-package-blobs.js.map +1 -0
- package/dist/src/recording/session-media-package-import.d.ts +26 -0
- package/dist/src/recording/session-media-package-import.js +124 -0
- package/dist/src/recording/session-media-package-import.js.map +1 -0
- package/dist/src/recording/session-media-package-state.d.ts +19 -0
- package/dist/src/recording/session-media-package-state.js +56 -0
- package/dist/src/recording/session-media-package-state.js.map +1 -0
- package/dist/src/recording/session-media-package-validation.d.ts +59 -0
- package/dist/src/recording/session-media-package-validation.js +286 -0
- package/dist/src/recording/session-media-package-validation.js.map +1 -0
- package/dist/src/recording/session-media-package-writer.d.ts +18 -0
- package/dist/src/recording/session-media-package-writer.js +70 -0
- package/dist/src/recording/session-media-package-writer.js.map +1 -0
- package/dist/src/recording/session-media-package.d.ts +27 -0
- package/dist/src/recording/session-media-package.js +366 -0
- package/dist/src/recording/session-media-package.js.map +1 -0
- package/dist/src/recording/types.d.ts +34 -2
- package/dist/src/recording/types.js.map +1 -1
- package/dist/src/runtime/AgentRuntimeContext.d.ts +22 -5
- package/dist/src/runtime/AgentRuntimeLoader.d.ts +6 -0
- package/dist/src/runtime/AgentRuntimeLoader.js +25 -6
- package/dist/src/runtime/AgentRuntimeLoader.js.map +1 -1
- package/dist/src/runtime/contracts/PromptEstimation.d.ts +1 -0
- package/dist/src/runtime/contracts/PromptEstimation.js.map +1 -1
- package/dist/src/runtime/contracts/RuntimeProvider.d.ts +3 -2
- package/dist/src/runtime/contracts/RuntimeProviderManager.d.ts +0 -2
- package/dist/src/runtime/createAgentRuntimeContext.js +28 -1
- package/dist/src/runtime/createAgentRuntimeContext.js.map +1 -1
- package/dist/src/runtime/providerRuntimeContext.d.ts +12 -0
- package/dist/src/runtime/providerRuntimeContext.js +3 -0
- package/dist/src/runtime/providerRuntimeContext.js.map +1 -1
- package/dist/src/runtime/runtimeAdapters.js +2 -2
- package/dist/src/runtime/runtimeAdapters.js.map +1 -1
- package/dist/src/services/history/ContentConverters.d.ts +11 -7
- package/dist/src/services/history/ContentConverters.js +11 -7
- package/dist/src/services/history/ContentConverters.js.map +1 -1
- package/dist/src/services/history/HistoryService.d.ts +18 -180
- package/dist/src/services/history/HistoryService.js +53 -523
- package/dist/src/services/history/HistoryService.js.map +1 -1
- package/dist/src/services/history/HistoryServiceCore.d.ts +278 -0
- package/dist/src/services/history/HistoryServiceCore.js +727 -0
- package/dist/src/services/history/HistoryServiceCore.js.map +1 -0
- package/dist/src/services/history/IContent.d.ts +118 -16
- package/dist/src/services/history/IContent.js +284 -4
- package/dist/src/services/history/IContent.js.map +1 -1
- package/dist/src/services/history/contentSize.js +22 -2
- package/dist/src/services/history/contentSize.js.map +1 -1
- package/dist/src/services/history/historyChronology.d.ts +7 -0
- package/dist/src/services/history/historyChronology.js +35 -3
- package/dist/src/services/history/historyChronology.js.map +1 -1
- package/dist/src/services/history/historyCloneUtils.d.ts +5 -4
- package/dist/src/services/history/historyCloneUtils.js +23 -16
- package/dist/src/services/history/historyCloneUtils.js.map +1 -1
- package/dist/src/services/history/historyCompressionQueue.d.ts +33 -0
- package/dist/src/services/history/historyCompressionQueue.js +81 -0
- package/dist/src/services/history/historyCompressionQueue.js.map +1 -0
- package/dist/src/services/history/historyEventTypes.d.ts +3 -0
- package/dist/src/services/history/historyMutationFailure.d.ts +15 -0
- package/dist/src/services/history/historyMutationFailure.js +22 -0
- package/dist/src/services/history/historyMutationFailure.js.map +1 -1
- package/dist/src/services/history/historyProviderPipeline.d.ts +1 -1
- package/dist/src/services/history/historyProviderPipeline.js +15 -5
- package/dist/src/services/history/historyProviderPipeline.js.map +1 -1
- package/dist/src/services/history/historyTokenEstimation.js +10 -6
- package/dist/src/services/history/historyTokenEstimation.js.map +1 -1
- package/dist/src/services/history/historyToolNormalization.d.ts +2 -0
- package/dist/src/services/history/historyToolNormalization.js +26 -9
- package/dist/src/services/history/historyToolNormalization.js.map +1 -1
- package/dist/src/services/history/provider-file-binding.d.ts +11 -0
- package/dist/src/services/history/provider-file-binding.js +70 -0
- package/dist/src/services/history/provider-file-binding.js.map +1 -0
- package/dist/src/services/history/semantic-media-purge.d.ts +66 -0
- package/dist/src/services/history/semantic-media-purge.js +404 -0
- package/dist/src/services/history/semantic-media-purge.js.map +1 -0
- package/dist/src/storage/SessionPersistenceService.d.ts +53 -2
- package/dist/src/storage/SessionPersistenceService.js +435 -23
- package/dist/src/storage/SessionPersistenceService.js.map +1 -1
- package/dist/src/storage/history-media-ownership.d.ts +38 -0
- package/dist/src/storage/history-media-ownership.js +136 -0
- package/dist/src/storage/history-media-ownership.js.map +1 -0
- package/dist/src/storage/local-media-store-child.d.ts +6 -0
- package/dist/src/storage/local-media-store-child.js +140 -0
- package/dist/src/storage/local-media-store-child.js.map +1 -0
- package/dist/src/storage/local-media-store-files.d.ts +44 -0
- package/dist/src/storage/local-media-store-files.js +460 -0
- package/dist/src/storage/local-media-store-files.js.map +1 -0
- package/dist/src/storage/local-media-store-lock-recovery.d.ts +15 -0
- package/dist/src/storage/local-media-store-lock-recovery.js +112 -0
- package/dist/src/storage/local-media-store-lock-recovery.js.map +1 -0
- package/dist/src/storage/local-media-store-persistence.d.ts +48 -0
- package/dist/src/storage/local-media-store-persistence.js +443 -0
- package/dist/src/storage/local-media-store-persistence.js.map +1 -0
- package/dist/src/storage/local-media-store-quota.d.ts +6 -0
- package/dist/src/storage/local-media-store-quota.js +66 -0
- package/dist/src/storage/local-media-store-quota.js.map +1 -0
- package/dist/src/storage/local-media-store-reservations.d.ts +55 -0
- package/dist/src/storage/local-media-store-reservations.js +377 -0
- package/dist/src/storage/local-media-store-reservations.js.map +1 -0
- package/dist/src/storage/local-media-store-types.d.ts +110 -0
- package/dist/src/storage/local-media-store-types.js +35 -0
- package/dist/src/storage/local-media-store-types.js.map +1 -0
- package/dist/src/storage/local-media-store-validation.d.ts +34 -0
- package/dist/src/storage/local-media-store-validation.js +449 -0
- package/dist/src/storage/local-media-store-validation.js.map +1 -0
- package/dist/src/storage/local-media-store.d.ts +47 -0
- package/dist/src/storage/local-media-store.js +353 -0
- package/dist/src/storage/local-media-store.js.map +1 -0
- package/dist/src/storage/media-admission-service.d.ts +49 -0
- package/dist/src/storage/media-admission-service.js +333 -0
- package/dist/src/storage/media-admission-service.js.map +1 -0
- package/dist/src/storage/media-lifecycle-metrics.d.ts +75 -0
- package/dist/src/storage/media-lifecycle-metrics.js +105 -0
- package/dist/src/storage/media-lifecycle-metrics.js.map +1 -0
- package/dist/src/storage/media-reference-lifecycle.d.ts +16 -0
- package/dist/src/storage/media-reference-lifecycle.js +84 -0
- package/dist/src/storage/media-reference-lifecycle.js.map +1 -0
- package/dist/src/storage/request-media-resolver.d.ts +67 -0
- package/dist/src/storage/request-media-resolver.js +325 -0
- package/dist/src/storage/request-media-resolver.js.map +1 -0
- package/dist/src/storage/session-media-service-factories.d.ts +19 -0
- package/dist/src/storage/session-media-service-factories.js +34 -0
- package/dist/src/storage/session-media-service-factories.js.map +1 -0
- package/dist/src/storage/session-persistence-helpers.d.ts +10 -0
- package/dist/src/storage/session-persistence-helpers.js +46 -0
- package/dist/src/storage/session-persistence-helpers.js.map +1 -0
- package/dist/src/test-utils/config.d.ts +2 -0
- package/dist/src/test-utils/config.js +5 -5
- package/dist/src/test-utils/config.js.map +1 -1
- package/dist/src/test-utils/runtime.d.ts +2 -0
- package/dist/src/test-utils/runtime.js +1 -2
- package/dist/src/test-utils/runtime.js.map +1 -1
- package/dist/src/tools-adapters/CoreShellToolHostAdapter.js +1 -9
- package/dist/src/tools-adapters/CoreShellToolHostAdapter.js.map +1 -1
- package/dist/src/tools-adapters/CoreSkillServiceAdapter.d.ts +0 -2
- package/dist/src/tools-adapters/CoreSkillServiceAdapter.js +0 -17
- package/dist/src/tools-adapters/CoreSkillServiceAdapter.js.map +1 -1
- package/dist/src/tools-adapters/CoreToolHostAdapter.d.ts +0 -21
- package/dist/src/tools-adapters/CoreToolHostAdapter.js +0 -8
- package/dist/src/tools-adapters/CoreToolHostAdapter.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +8 -9
- package/dist/src/utils/environmentContext.js +11 -22
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/errorParsing.d.ts +1 -2
- package/dist/src/utils/errorParsing.js +22 -41
- package/dist/src/utils/errorParsing.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.js +12 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
- package/dist/src/utils/summarizer.d.ts +1 -2
- package/dist/src/utils/summarizer.js +6 -5
- package/dist/src/utils/summarizer.js.map +1 -1
- package/dist/src/utils/tool-utils.js +7 -1
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/index.ts +0 -4
- package/package.json +38 -30
- package/src/config/agentClientLifecycle.ts +53 -22
- package/src/config/config.ts +11 -26
- package/src/config/configBase.ts +46 -7
- package/src/config/configBaseCore.ts +38 -36
- package/src/config/configMcpRuntime.ts +46 -0
- package/src/config/configMediaDefaults.ts +19 -0
- package/src/config/configTypes.ts +13 -53
- package/src/config/index.ts +1 -4
- package/src/config/models.ts +0 -6
- package/src/config/toolRegistryFactory.ts +2 -2
- package/src/core/clientContract.ts +4 -6
- package/src/core/compression/transcriptPathNotice.ts +31 -0
- package/src/core/contentGenerator.ts +15 -39
- package/src/core/logger.ts +370 -39
- package/src/core/prompts.ts +4 -114
- package/src/core/turn.ts +3 -3
- package/src/hooks/hookTranslator.ts +6 -4
- package/src/index.ts +7 -7
- package/src/llm-types/index.ts +5 -0
- package/src/llm-types/modelEnvelope.ts +26 -2
- package/src/policy/policies/read-only.toml +0 -5
- package/src/prompt-config/TemplateEngine.ts +0 -3
- package/src/prompt-config/defaults/providers/gemini/core.md +0 -2
- package/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/core.md +0 -2
- package/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/gemini-2-5-flash/core.md +0 -2
- package/src/prompt-config/prompt-loader.ts +7 -8
- package/src/prompt-config/types.ts +0 -1
- package/src/recording/CheckpointService.ts +110 -45
- package/src/recording/HistoryMutationService.ts +28 -3
- package/src/recording/RecordingIntegration.ts +258 -11
- package/src/recording/ReplayEngine.ts +220 -110
- package/src/recording/SessionDiscovery.ts +30 -4
- package/src/recording/SessionRecordingService.ts +253 -55
- package/src/recording/SessionTransitionService.ts +75 -12
- package/src/recording/index.ts +7 -0
- package/src/recording/janitor/cleanupTypes.ts +4 -0
- package/src/recording/janitor/mediaReclamation.ts +295 -0
- package/src/recording/janitor/sessionJanitor.ts +54 -1
- package/src/recording/janitor/sessionScanner.ts +319 -227
- package/src/recording/replay-test-helpers.ts +33 -2
- package/src/recording/replayCheckpointMetadata.ts +115 -0
- package/src/recording/replayErrorFormatting.ts +43 -0
- package/src/recording/resumeSession.ts +10 -0
- package/src/recording/semanticMediaPurgeReplayValidation.ts +35 -0
- package/src/recording/session-media-package-blobs.ts +116 -0
- package/src/recording/session-media-package-import.ts +189 -0
- package/src/recording/session-media-package-state.ts +120 -0
- package/src/recording/session-media-package-validation.ts +400 -0
- package/src/recording/session-media-package-writer.ts +117 -0
- package/src/recording/session-media-package.ts +692 -0
- package/src/recording/types.ts +37 -2
- package/src/runtime/AgentRuntimeContext.ts +28 -5
- package/src/runtime/AgentRuntimeLoader.ts +32 -7
- package/src/runtime/contracts/PromptEstimation.ts +1 -0
- package/src/runtime/contracts/RuntimeProvider.ts +3 -8
- package/src/runtime/contracts/RuntimeProviderManager.ts +0 -2
- package/src/runtime/createAgentRuntimeContext.ts +43 -1
- package/src/runtime/providerRuntimeContext.ts +22 -0
- package/src/runtime/runtimeAdapters.ts +2 -2
- package/src/services/history/ContentConverters.ts +11 -7
- package/src/services/history/HistoryService.ts +71 -696
- package/src/services/history/HistoryServiceCore.ts +1055 -0
- package/src/services/history/IContent.ts +460 -20
- package/src/services/history/contentSize.ts +22 -2
- package/src/services/history/historyChronology.ts +53 -3
- package/src/services/history/historyCloneUtils.ts +26 -22
- package/src/services/history/historyCompressionQueue.ts +102 -0
- package/src/services/history/historyEventTypes.ts +9 -0
- package/src/services/history/historyMutationFailure.ts +33 -0
- package/src/services/history/historyProviderPipeline.ts +19 -5
- package/src/services/history/historyTokenEstimation.ts +9 -5
- package/src/services/history/historyToolNormalization.ts +43 -11
- package/src/services/history/provider-file-binding.ts +115 -0
- package/src/services/history/semantic-media-purge.ts +593 -0
- package/src/storage/SessionPersistenceService.ts +667 -30
- package/src/storage/history-media-ownership.ts +185 -0
- package/src/storage/local-media-store-child.ts +163 -0
- package/src/storage/local-media-store-files.ts +643 -0
- package/src/storage/local-media-store-lock-recovery.ts +159 -0
- package/src/storage/local-media-store-persistence.ts +737 -0
- package/src/storage/local-media-store-quota.ts +111 -0
- package/src/storage/local-media-store-reservations.ts +485 -0
- package/src/storage/local-media-store-types.ts +161 -0
- package/src/storage/local-media-store-validation.ts +643 -0
- package/src/storage/local-media-store.ts +696 -0
- package/src/storage/media-admission-service.ts +512 -0
- package/src/storage/media-lifecycle-metrics.ts +228 -0
- package/src/storage/media-reference-lifecycle.ts +164 -0
- package/src/storage/request-media-resolver.ts +491 -0
- package/src/storage/session-media-service-factories.ts +48 -0
- package/src/storage/session-persistence-helpers.ts +85 -0
- package/src/test-utils/config.ts +7 -5
- package/src/test-utils/runtime.ts +3 -2
- package/src/tools-adapters/CoreShellToolHostAdapter.ts +1 -11
- package/src/tools-adapters/CoreSkillServiceAdapter.ts +0 -23
- package/src/tools-adapters/CoreToolHostAdapter.ts +0 -36
- package/src/utils/environmentContext.ts +11 -30
- package/src/utils/errorParsing.ts +19 -69
- package/src/utils/generateContentResponseUtilities.ts +28 -1
- package/src/utils/summarizer.ts +8 -10
- package/src/utils/tool-utils.ts +7 -1
- package/dist/src/code_assist/codeAssist.d.ts +0 -19
- package/dist/src/code_assist/codeAssist.js +0 -41
- package/dist/src/code_assist/codeAssist.js.map +0 -1
- package/dist/src/code_assist/contentGeneratorAdapters.d.ts +0 -49
- package/dist/src/code_assist/contentGeneratorAdapters.js +0 -197
- package/dist/src/code_assist/contentGeneratorAdapters.js.map +0 -1
- package/dist/src/code_assist/converter.d.ts +0 -74
- package/dist/src/code_assist/converter.js +0 -158
- package/dist/src/code_assist/converter.js.map +0 -1
- package/dist/src/code_assist/googleGenAIWrapper.d.ts +0 -27
- package/dist/src/code_assist/googleGenAIWrapper.js +0 -46
- package/dist/src/code_assist/googleGenAIWrapper.js.map +0 -1
- package/dist/src/code_assist/oauth-credential-storage.d.ts +0 -30
- package/dist/src/code_assist/oauth-credential-storage.js +0 -135
- package/dist/src/code_assist/oauth-credential-storage.js.map +0 -1
- package/dist/src/code_assist/server.d.ts +0 -44
- package/dist/src/code_assist/server.js +0 -154
- package/dist/src/code_assist/server.js.map +0 -1
- package/dist/src/code_assist/setup.d.ts +0 -20
- package/dist/src/code_assist/setup.js +0 -126
- package/dist/src/code_assist/setup.js.map +0 -1
- package/dist/src/code_assist/types.d.ts +0 -161
- package/dist/src/code_assist/types.js +0 -46
- package/dist/src/code_assist/types.js.map +0 -1
- package/dist/src/utils/getFolderStructure.d.ts +0 -31
- package/dist/src/utils/getFolderStructure.js +0 -240
- package/dist/src/utils/getFolderStructure.js.map +0 -1
- package/dist/src/utils/installationManager.d.ts +0 -16
- package/dist/src/utils/installationManager.js +0 -51
- package/dist/src/utils/installationManager.js.map +0 -1
- package/dist/src/utils/llm-edit-fixer.d.ts +0 -25
- package/dist/src/utils/llm-edit-fixer.js +0 -120
- package/dist/src/utils/llm-edit-fixer.js.map +0 -1
- package/src/code_assist/codeAssist.ts +0 -59
- package/src/code_assist/contentGeneratorAdapters.ts +0 -275
- package/src/code_assist/converter.ts +0 -288
- package/src/code_assist/googleGenAIWrapper.ts +0 -90
- package/src/code_assist/oauth-credential-storage.ts +0 -171
- package/src/code_assist/server.ts +0 -263
- package/src/code_assist/setup.ts +0 -189
- package/src/code_assist/types.ts +0 -201
- package/src/utils/getFolderStructure.ts +0 -382
- package/src/utils/installationManager.ts +0 -59
- package/src/utils/llm-edit-fixer.ts +0 -157
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import type { IContent } from '../../services/history/IContent.js';
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* Shared types for the session-recording janitor.
|
|
19
21
|
*
|
|
@@ -65,6 +67,8 @@ export interface SessionCleanupParams {
|
|
|
65
67
|
readonly currentSessionId?: string;
|
|
66
68
|
/** Fully resolved retention configuration. */
|
|
67
69
|
readonly config: ResolvedRetentionConfig;
|
|
70
|
+
/** In-memory history owned by the current process, when available. */
|
|
71
|
+
readonly activeHistory?: readonly IContent[];
|
|
68
72
|
/** When true, suppress debug logging. */
|
|
69
73
|
readonly quiet?: boolean;
|
|
70
74
|
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Dirent } from 'node:fs';
|
|
8
|
+
import { createReadStream } from 'node:fs';
|
|
9
|
+
import { lstat, opendir } from 'node:fs/promises';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
12
|
+
import { createGunzip } from 'node:zlib';
|
|
13
|
+
import type { IContent } from '../../services/history/IContent.js';
|
|
14
|
+
import { LocalMediaStore } from '../../storage/local-media-store.js';
|
|
15
|
+
import { collectMediaReferences } from '../../storage/media-reference-lifecycle.js';
|
|
16
|
+
|
|
17
|
+
const PROJECT_HASH_PATTERN = /^[0-9a-f]{64}$/;
|
|
18
|
+
const CONTENT_ID_PATTERN = /"contentId"\s*:\s*"(sha256:[0-9a-f]{64})"/g;
|
|
19
|
+
const STALE_MEDIA_TEMP_AGE_MS = 60 * 1000;
|
|
20
|
+
const SCAN_CHUNK_BYTES = 64 * 1024;
|
|
21
|
+
const MAX_PENDING_MATCH_CHARACTERS = 256;
|
|
22
|
+
|
|
23
|
+
export interface MediaReclamationLimits {
|
|
24
|
+
readonly maxProjects: number;
|
|
25
|
+
readonly maxFilesPerProject: number;
|
|
26
|
+
readonly maxDirectoriesPerProject: number;
|
|
27
|
+
readonly maxBytesPerFile: number;
|
|
28
|
+
readonly maxBytesPerProject: number;
|
|
29
|
+
readonly maxDecompressedBytesPerFile: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const DEFAULT_LIMITS: MediaReclamationLimits = {
|
|
33
|
+
maxProjects: 4096,
|
|
34
|
+
maxFilesPerProject: 100_000,
|
|
35
|
+
maxDirectoriesPerProject: 10_000,
|
|
36
|
+
maxBytesPerFile: 256 * 1024 * 1024,
|
|
37
|
+
maxBytesPerProject: 2 * 1024 * 1024 * 1024,
|
|
38
|
+
maxDecompressedBytesPerFile: 256 * 1024 * 1024,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
interface ProjectScanBudget {
|
|
42
|
+
files: number;
|
|
43
|
+
directories: number;
|
|
44
|
+
bytes: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function hasErrnoCode(error: unknown, code: string): boolean {
|
|
48
|
+
return (
|
|
49
|
+
typeof error === 'object' &&
|
|
50
|
+
error !== null &&
|
|
51
|
+
Reflect.get(error, 'code') === code
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function positiveLimit(value: number, name: string): number {
|
|
56
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
57
|
+
throw new Error(`Invalid media reclamation limit ${name}`);
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function resolveLimits(
|
|
63
|
+
overrides: Partial<MediaReclamationLimits>,
|
|
64
|
+
): MediaReclamationLimits {
|
|
65
|
+
const limits = { ...DEFAULT_LIMITS, ...overrides };
|
|
66
|
+
return {
|
|
67
|
+
maxProjects: positiveLimit(limits.maxProjects, 'maxProjects'),
|
|
68
|
+
maxFilesPerProject: positiveLimit(
|
|
69
|
+
limits.maxFilesPerProject,
|
|
70
|
+
'maxFilesPerProject',
|
|
71
|
+
),
|
|
72
|
+
maxDirectoriesPerProject: positiveLimit(
|
|
73
|
+
limits.maxDirectoriesPerProject,
|
|
74
|
+
'maxDirectoriesPerProject',
|
|
75
|
+
),
|
|
76
|
+
maxBytesPerFile: positiveLimit(limits.maxBytesPerFile, 'maxBytesPerFile'),
|
|
77
|
+
maxBytesPerProject: positiveLimit(
|
|
78
|
+
limits.maxBytesPerProject,
|
|
79
|
+
'maxBytesPerProject',
|
|
80
|
+
),
|
|
81
|
+
maxDecompressedBytesPerFile: positiveLimit(
|
|
82
|
+
limits.maxDecompressedBytesPerFile,
|
|
83
|
+
'maxDecompressedBytesPerFile',
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function collectSerializedContentIds(
|
|
89
|
+
serialized: string,
|
|
90
|
+
contentIds: Set<string>,
|
|
91
|
+
): void {
|
|
92
|
+
for (const match of serialized.matchAll(CONTENT_ID_PATTERN)) {
|
|
93
|
+
contentIds.add(match[1]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function scanTextStream(
|
|
98
|
+
stream: NodeJS.ReadableStream & AsyncIterable<Buffer | string>,
|
|
99
|
+
contentIds: Set<string>,
|
|
100
|
+
maxBytes: number,
|
|
101
|
+
): Promise<void> {
|
|
102
|
+
const decoder = new StringDecoder('utf8');
|
|
103
|
+
let tail = '';
|
|
104
|
+
let bytes = 0;
|
|
105
|
+
for await (const chunk of stream) {
|
|
106
|
+
const buffer = typeof chunk === 'string' ? Buffer.from(chunk) : chunk;
|
|
107
|
+
bytes += buffer.byteLength;
|
|
108
|
+
if (bytes > maxBytes)
|
|
109
|
+
throw new Error('Decompressed ownership data exceeds limit');
|
|
110
|
+
const text = tail + decoder.write(buffer);
|
|
111
|
+
collectSerializedContentIds(text, contentIds);
|
|
112
|
+
tail = text.slice(-MAX_PENDING_MATCH_CHARACTERS);
|
|
113
|
+
}
|
|
114
|
+
collectSerializedContentIds(tail + decoder.end(), contentIds);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function collectFileContentIds(
|
|
118
|
+
filePath: string,
|
|
119
|
+
contentIds: Set<string>,
|
|
120
|
+
limits: MediaReclamationLimits,
|
|
121
|
+
budget: ProjectScanBudget,
|
|
122
|
+
): Promise<void> {
|
|
123
|
+
if (
|
|
124
|
+
!filePath.endsWith('.json') &&
|
|
125
|
+
!filePath.endsWith('.jsonl') &&
|
|
126
|
+
!filePath.endsWith('.gz')
|
|
127
|
+
) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const fileStat = await lstat(filePath);
|
|
131
|
+
if (!fileStat.isFile() || fileStat.isSymbolicLink()) return;
|
|
132
|
+
if (
|
|
133
|
+
budget.files >= limits.maxFilesPerProject ||
|
|
134
|
+
fileStat.size > limits.maxBytesPerFile ||
|
|
135
|
+
fileStat.size > limits.maxBytesPerProject - budget.bytes
|
|
136
|
+
) {
|
|
137
|
+
throw new Error('Ownership data exceeds media reclamation scan limits');
|
|
138
|
+
}
|
|
139
|
+
budget.files += 1;
|
|
140
|
+
budget.bytes += fileStat.size;
|
|
141
|
+
const source = createReadStream(filePath, {
|
|
142
|
+
highWaterMark: SCAN_CHUNK_BYTES,
|
|
143
|
+
});
|
|
144
|
+
if (filePath.endsWith('.gz')) {
|
|
145
|
+
await scanTextStream(
|
|
146
|
+
source.pipe(createGunzip({ chunkSize: SCAN_CHUNK_BYTES })),
|
|
147
|
+
contentIds,
|
|
148
|
+
limits.maxDecompressedBytesPerFile,
|
|
149
|
+
);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
await scanTextStream(source, contentIds, limits.maxBytesPerFile);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function collectOwnedContentIds(
|
|
156
|
+
directory: string,
|
|
157
|
+
mediaDirectory: string,
|
|
158
|
+
contentIds: Set<string>,
|
|
159
|
+
limits: MediaReclamationLimits,
|
|
160
|
+
budget: ProjectScanBudget,
|
|
161
|
+
): Promise<void> {
|
|
162
|
+
if (budget.directories >= limits.maxDirectoriesPerProject) {
|
|
163
|
+
throw new Error('Ownership directory count exceeds scan limit');
|
|
164
|
+
}
|
|
165
|
+
budget.directories += 1;
|
|
166
|
+
let entries: Awaited<ReturnType<typeof opendir>>;
|
|
167
|
+
try {
|
|
168
|
+
entries = await opendir(directory);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (hasErrnoCode(error, 'ENOENT')) return;
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
for await (const entry of entries) {
|
|
174
|
+
const entryPath = join(directory, entry.name);
|
|
175
|
+
if (entryPath === mediaDirectory) continue;
|
|
176
|
+
if (entry.isDirectory()) {
|
|
177
|
+
await collectOwnedContentIds(
|
|
178
|
+
entryPath,
|
|
179
|
+
mediaDirectory,
|
|
180
|
+
contentIds,
|
|
181
|
+
limits,
|
|
182
|
+
budget,
|
|
183
|
+
);
|
|
184
|
+
} else if (entry.isFile()) {
|
|
185
|
+
await collectFileContentIds(entryPath, contentIds, limits, budget);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function mediaDirectoryExists(mediaDirectory: string): Promise<boolean> {
|
|
191
|
+
try {
|
|
192
|
+
const mediaStat = await lstat(mediaDirectory);
|
|
193
|
+
return mediaStat.isDirectory() && !mediaStat.isSymbolicLink();
|
|
194
|
+
} catch (error) {
|
|
195
|
+
if (hasErrnoCode(error, 'ENOENT')) return false;
|
|
196
|
+
throw error;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function reclaimProjectMedia(
|
|
201
|
+
globalTempDirectory: string,
|
|
202
|
+
entry: Dirent,
|
|
203
|
+
activeContentIds: ReadonlySet<string>,
|
|
204
|
+
limits: MediaReclamationLimits,
|
|
205
|
+
): Promise<void> {
|
|
206
|
+
if (!entry.isDirectory() || !PROJECT_HASH_PATTERN.test(entry.name)) return;
|
|
207
|
+
const projectDirectory = join(globalTempDirectory, entry.name);
|
|
208
|
+
const mediaDirectory = join(projectDirectory, 'media');
|
|
209
|
+
if (!(await mediaDirectoryExists(mediaDirectory))) return;
|
|
210
|
+
const contentIds = new Set(activeContentIds);
|
|
211
|
+
await collectOwnedContentIds(
|
|
212
|
+
projectDirectory,
|
|
213
|
+
mediaDirectory,
|
|
214
|
+
contentIds,
|
|
215
|
+
limits,
|
|
216
|
+
{ files: 0, directories: 0, bytes: 0 },
|
|
217
|
+
);
|
|
218
|
+
const store = new LocalMediaStore({
|
|
219
|
+
rootDirectory: mediaDirectory,
|
|
220
|
+
quotaBytes: Number.MAX_SAFE_INTEGER,
|
|
221
|
+
});
|
|
222
|
+
await store.reclaimUnreferenced(
|
|
223
|
+
contentIds,
|
|
224
|
+
Date.now() - STALE_MEDIA_TEMP_AGE_MS,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async function reclaimProjectEntry(
|
|
229
|
+
globalTempDirectory: string,
|
|
230
|
+
entry: Dirent,
|
|
231
|
+
activeContentIds: ReadonlySet<string>,
|
|
232
|
+
limits: MediaReclamationLimits,
|
|
233
|
+
): Promise<boolean> {
|
|
234
|
+
try {
|
|
235
|
+
await reclaimProjectMedia(
|
|
236
|
+
globalTempDirectory,
|
|
237
|
+
entry,
|
|
238
|
+
activeContentIds,
|
|
239
|
+
limits,
|
|
240
|
+
);
|
|
241
|
+
return true;
|
|
242
|
+
} catch {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Reclaim unreferenced project media after bounded sequential ownership scans.
|
|
249
|
+
*
|
|
250
|
+
* @param globalTempDirectory - Root containing project-hash directories.
|
|
251
|
+
* @param activeHistory - In-memory history whose media remains protected.
|
|
252
|
+
* @param limitOverrides - Optional finite scan limits.
|
|
253
|
+
* @returns Number of skipped or corrupt projects.
|
|
254
|
+
*/
|
|
255
|
+
export async function reclaimSessionMedia(
|
|
256
|
+
globalTempDirectory: string,
|
|
257
|
+
activeHistory: readonly IContent[] | undefined,
|
|
258
|
+
limitOverrides: Partial<MediaReclamationLimits> = {},
|
|
259
|
+
): Promise<number> {
|
|
260
|
+
const limits = resolveLimits(limitOverrides);
|
|
261
|
+
const activeContentIds = new Set(
|
|
262
|
+
activeHistory === undefined
|
|
263
|
+
? []
|
|
264
|
+
: collectMediaReferences(activeHistory).flatMap((reference) => [
|
|
265
|
+
reference.originalContentId,
|
|
266
|
+
reference.selectedContentId,
|
|
267
|
+
]),
|
|
268
|
+
);
|
|
269
|
+
let entries: Awaited<ReturnType<typeof opendir>>;
|
|
270
|
+
try {
|
|
271
|
+
entries = await opendir(globalTempDirectory);
|
|
272
|
+
} catch (error) {
|
|
273
|
+
if (hasErrnoCode(error, 'ENOENT')) return 0;
|
|
274
|
+
throw error;
|
|
275
|
+
}
|
|
276
|
+
let projects = 0;
|
|
277
|
+
let errors = 0;
|
|
278
|
+
for await (const entry of entries) {
|
|
279
|
+
if (PROJECT_HASH_PATTERN.test(entry.name)) {
|
|
280
|
+
if (projects >= limits.maxProjects) {
|
|
281
|
+
errors += 1;
|
|
282
|
+
} else {
|
|
283
|
+
projects += 1;
|
|
284
|
+
const reclaimed = await reclaimProjectEntry(
|
|
285
|
+
globalTempDirectory,
|
|
286
|
+
entry,
|
|
287
|
+
activeContentIds,
|
|
288
|
+
limits,
|
|
289
|
+
);
|
|
290
|
+
errors += reclaimed ? 0 : 1;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return errors;
|
|
295
|
+
}
|
|
@@ -47,9 +47,13 @@ import { resolveRetentionConfig } from './retentionPolicy.js';
|
|
|
47
47
|
import { runReclamation } from './reclamationEngine.js';
|
|
48
48
|
import { SessionLockManager } from '../SessionLockManager.js';
|
|
49
49
|
import { debugLogger } from '../../utils/debugLogger.js';
|
|
50
|
+
import { reclaimSessionMedia } from './mediaReclamation.js';
|
|
50
51
|
|
|
51
52
|
/** Age threshold for recognizing stale temporary archive artifacts. */
|
|
52
53
|
const STALE_TEMP_ARCHIVE_AGE_MS = 60 * 1000;
|
|
54
|
+
const PORTABLE_REPLAY_TEMP_GRAMMAR =
|
|
55
|
+
/^session-.+\.jsonl\.[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.portable\.tmp$/;
|
|
56
|
+
const STALE_PORTABLE_REPLAY_AGE_MS = 60 * 1000;
|
|
53
57
|
|
|
54
58
|
// ---------------------------------------------------------------------------
|
|
55
59
|
// Narrow fault seam for testing platform-only rmdir failures (Item 4)
|
|
@@ -189,6 +193,16 @@ async function performSweep(
|
|
|
189
193
|
currentSessionId,
|
|
190
194
|
);
|
|
191
195
|
|
|
196
|
+
let mediaCleanupErrors = 0;
|
|
197
|
+
try {
|
|
198
|
+
mediaCleanupErrors = await reclaimSessionMedia(
|
|
199
|
+
globalTempDir,
|
|
200
|
+
params.activeHistory,
|
|
201
|
+
);
|
|
202
|
+
} catch (error: unknown) {
|
|
203
|
+
mediaCleanupErrors = 1;
|
|
204
|
+
debugLogger.error('[SessionJanitor] Media reclamation failed', error);
|
|
205
|
+
}
|
|
192
206
|
const cleanupErrors = await cleanupTempAndEmptyDirs(chatsDirs);
|
|
193
207
|
|
|
194
208
|
return buildFinalResult(
|
|
@@ -201,7 +215,7 @@ async function performSweep(
|
|
|
201
215
|
metrics.archiveDeleted,
|
|
202
216
|
staleLocksRemoved,
|
|
203
217
|
metrics.skipped,
|
|
204
|
-
metrics.failed + cleanupErrors + scanErrorCount,
|
|
218
|
+
metrics.failed + mediaCleanupErrors + cleanupErrors + scanErrorCount,
|
|
205
219
|
metrics.ageCountShortfall,
|
|
206
220
|
bytesBefore,
|
|
207
221
|
);
|
|
@@ -227,6 +241,44 @@ async function runStaleLockCleanup(
|
|
|
227
241
|
// Temp/empty-dir cleanup + result assembly
|
|
228
242
|
// ---------------------------------------------------------------------------
|
|
229
243
|
|
|
244
|
+
async function cleanupStalePortableReplayFiles(
|
|
245
|
+
chatsDir: string,
|
|
246
|
+
): Promise<number> {
|
|
247
|
+
let files: string[];
|
|
248
|
+
try {
|
|
249
|
+
files = await fs.readdir(chatsDir);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
return hasErrorCode(error, 'ENOENT') ? 0 : 1;
|
|
252
|
+
}
|
|
253
|
+
let errors = 0;
|
|
254
|
+
const staleBefore = Date.now() - STALE_PORTABLE_REPLAY_AGE_MS;
|
|
255
|
+
for (const file of files) {
|
|
256
|
+
if (!PORTABLE_REPLAY_TEMP_GRAMMAR.test(file)) continue;
|
|
257
|
+
const filePath = path.join(chatsDir, file);
|
|
258
|
+
try {
|
|
259
|
+
const metadata = await fs.lstat(filePath);
|
|
260
|
+
if (
|
|
261
|
+
!metadata.isSymbolicLink() &&
|
|
262
|
+
metadata.isFile() &&
|
|
263
|
+
metadata.mtimeMs < staleBefore
|
|
264
|
+
) {
|
|
265
|
+
await fs.unlink(filePath);
|
|
266
|
+
}
|
|
267
|
+
} catch (error) {
|
|
268
|
+
if (!hasErrorCode(error, 'ENOENT')) errors += 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return errors;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function hasErrorCode(error: unknown, code: string): boolean {
|
|
275
|
+
return (
|
|
276
|
+
typeof error === 'object' &&
|
|
277
|
+
error !== null &&
|
|
278
|
+
Reflect.get(error, 'code') === code
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
230
282
|
/** Clean stale temp archives and remove genuinely empty directories (AC-10).
|
|
231
283
|
* Returns the count of non-benign per-directory failures. */
|
|
232
284
|
async function cleanupTempAndEmptyDirs(
|
|
@@ -234,6 +286,7 @@ async function cleanupTempAndEmptyDirs(
|
|
|
234
286
|
): Promise<number> {
|
|
235
287
|
let errors = 0;
|
|
236
288
|
for (const chatsDir of chatsDirs) {
|
|
289
|
+
errors += await cleanupStalePortableReplayFiles(chatsDir);
|
|
237
290
|
const archiveDir = path.join(chatsDir, ARCHIVE_DIR_NAME);
|
|
238
291
|
try {
|
|
239
292
|
await cleanupStaleTempArchives(archiveDir, STALE_TEMP_ARCHIVE_AGE_MS);
|