@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
|
@@ -15,8 +15,67 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { type IContent } from '../services/history/IContent.js';
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
type HistoryBatchPublication,
|
|
20
|
+
type HistoryService,
|
|
21
|
+
type PreparedHistoryBatchEffect,
|
|
22
|
+
} from '../services/history/HistoryService.js';
|
|
23
|
+
import {
|
|
24
|
+
type PreparedContentBatch,
|
|
25
|
+
type SessionRecordingService,
|
|
26
|
+
} from './SessionRecordingService.js';
|
|
27
|
+
import type {
|
|
28
|
+
PreparedPersistenceSave,
|
|
29
|
+
SessionPersistenceService,
|
|
30
|
+
} from '../storage/SessionPersistenceService.js';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Two independent 32-bit multiplicative hashes of `value`, concatenated in
|
|
34
|
+
* base-36 to give a 64-bit comparison key.
|
|
35
|
+
*
|
|
36
|
+
* The low lane is FNV-1a (offset basis 0x811c9dc5, prime 0x01000193). The high
|
|
37
|
+
* lane uses the same xor-then-multiply shape with a different seed and a
|
|
38
|
+
* different odd multiplier (the murmur3 finalizer constant 0x85ebca6b) so the
|
|
39
|
+
* two lanes do not move together.
|
|
40
|
+
*
|
|
41
|
+
* This shrinks a content payload to a comparison key and is never a security
|
|
42
|
+
* boundary. A collision would additionally have to land on the same chronology
|
|
43
|
+
* `seq` before it could suppress anything.
|
|
44
|
+
*/
|
|
45
|
+
function fingerprint(value: string): string {
|
|
46
|
+
let low = 0x811c9dc5;
|
|
47
|
+
let high = 0x01000193;
|
|
48
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
49
|
+
const code = value.charCodeAt(index);
|
|
50
|
+
low = Math.imul(low ^ code, 0x01000193);
|
|
51
|
+
high = Math.imul(high ^ code, 0x85ebca6b);
|
|
52
|
+
}
|
|
53
|
+
return `${(low >>> 0).toString(36)}.${(high >>> 0).toString(36)}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The identity of a content record for duplicate detection: its chronology
|
|
58
|
+
* `seq` paired with a fingerprint of the exact payload.
|
|
59
|
+
*
|
|
60
|
+
* Returns `null` when the content carries no chronology marker. Such content
|
|
61
|
+
* has no identity, so it is always recorded rather than risk suppressing
|
|
62
|
+
* something that was never written.
|
|
63
|
+
*
|
|
64
|
+
* `seq` alone is NOT sufficient. It is unique only within one `HistoryService`
|
|
65
|
+
* instance, `ChronologyStamper.inherit` deliberately gives a replacement entry
|
|
66
|
+
* the replaced entry's marker, and `merge` can import entries from a foreign
|
|
67
|
+
* chronology. Pairing it with the payload fingerprint means suppression can
|
|
68
|
+
* only ever discard content byte-identical to a record already written.
|
|
69
|
+
*
|
|
70
|
+
* @issue #3132
|
|
71
|
+
*/
|
|
72
|
+
function contentIdentity(content: IContent): string | null {
|
|
73
|
+
const seq = content.metadata?.chronology?.seq;
|
|
74
|
+
if (typeof seq !== 'number') {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return `${seq}:${fingerprint(JSON.stringify(content))}`;
|
|
78
|
+
}
|
|
20
79
|
|
|
21
80
|
/**
|
|
22
81
|
* Bridges HistoryService events to SessionRecordingService.
|
|
@@ -29,10 +88,146 @@ export class RecordingIntegration {
|
|
|
29
88
|
private readonly recording: SessionRecordingService;
|
|
30
89
|
private historySubscription: (() => void) | null = null;
|
|
31
90
|
private compressionInProgress = false;
|
|
91
|
+
/**
|
|
92
|
+
* Identities of the content records this recording already contains.
|
|
93
|
+
*
|
|
94
|
+
* Several production paths rebuild history wholesale by calling
|
|
95
|
+
* `HistoryService.clear()` and then re-`add()`ing the retained entries. Each
|
|
96
|
+
* re-`add()` emits `contentAdded`, so without this set the rebuild appends a
|
|
97
|
+
* byte-identical copy of every retained entry to the session file, and
|
|
98
|
+
* `ReplayEngine` replays those copies into doubled history on resume.
|
|
99
|
+
*
|
|
100
|
+
* Scoped to the one `SessionRecordingService` this integration wraps, so it
|
|
101
|
+
* is never reset while that file is open. Bounded by the number of distinct
|
|
102
|
+
* content records written to the session.
|
|
103
|
+
*
|
|
104
|
+
* @issue #3132
|
|
105
|
+
*/
|
|
106
|
+
private readonly recordedIdentities = new Set<string>();
|
|
32
107
|
private disposed = false;
|
|
108
|
+
private readonly persistence: SessionPersistenceService | undefined;
|
|
109
|
+
private readonly pendingPersistence = new Map<number, Promise<void>>();
|
|
110
|
+
private readonly persistenceFailures = new Map<number, unknown>();
|
|
111
|
+
private nextPersistenceGeneration = 0;
|
|
112
|
+
private disposePromise: Promise<void> | undefined;
|
|
33
113
|
|
|
34
|
-
constructor(
|
|
114
|
+
constructor(
|
|
115
|
+
recording: SessionRecordingService,
|
|
116
|
+
persistence?: SessionPersistenceService,
|
|
117
|
+
) {
|
|
35
118
|
this.recording = recording;
|
|
119
|
+
this.persistence = persistence;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private persist(historyService: HistoryService): void {
|
|
123
|
+
if (this.persistence === undefined) return;
|
|
124
|
+
const generation = ++this.nextPersistenceGeneration;
|
|
125
|
+
let save: Promise<void>;
|
|
126
|
+
try {
|
|
127
|
+
save = this.persistence.save([...historyService.getAll()]);
|
|
128
|
+
} catch (error: unknown) {
|
|
129
|
+
this.persistenceFailures.set(generation, error);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const settled = save.then(
|
|
133
|
+
() => {
|
|
134
|
+
this.pendingPersistence.delete(generation);
|
|
135
|
+
},
|
|
136
|
+
(error: unknown) => {
|
|
137
|
+
this.persistenceFailures.set(generation, error);
|
|
138
|
+
this.pendingPersistence.delete(generation);
|
|
139
|
+
},
|
|
140
|
+
);
|
|
141
|
+
this.pendingPersistence.set(generation, settled);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private async awaitPersistenceThrough(generation: number): Promise<void> {
|
|
145
|
+
const pending = [...this.pendingPersistence.entries()]
|
|
146
|
+
.filter(([pendingGeneration]) => pendingGeneration <= generation)
|
|
147
|
+
.map(([, operation]) => operation);
|
|
148
|
+
await Promise.all(pending);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private takePersistenceFailuresThrough(generation: number): unknown[] {
|
|
152
|
+
const failures: unknown[] = [];
|
|
153
|
+
for (const [failedGeneration, error] of [
|
|
154
|
+
...this.persistenceFailures.entries(),
|
|
155
|
+
].sort(([left], [right]) => left - right)) {
|
|
156
|
+
if (failedGeneration > generation) continue;
|
|
157
|
+
this.persistenceFailures.delete(failedGeneration);
|
|
158
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
159
|
+
failures.push(
|
|
160
|
+
new Error(
|
|
161
|
+
`Session persistence generation ${failedGeneration} failed: ${detail}`,
|
|
162
|
+
{ cause: error },
|
|
163
|
+
),
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
return failures;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
private throwFailures(failures: readonly unknown[], message: string): void {
|
|
170
|
+
if (failures.length === 1) throw failures[0];
|
|
171
|
+
if (failures.length > 1) throw new AggregateError(failures, message);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
private async prepareBatch(
|
|
175
|
+
publication: HistoryBatchPublication,
|
|
176
|
+
): Promise<PreparedHistoryBatchEffect> {
|
|
177
|
+
await this.recording.flush();
|
|
178
|
+
if (!this.recording.isActive()) {
|
|
179
|
+
throw new Error('Cannot publish history batch: recording is not active');
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
let persistence: PreparedPersistenceSave | undefined;
|
|
183
|
+
let recording: PreparedContentBatch | undefined;
|
|
184
|
+
try {
|
|
185
|
+
persistence = await this.persistence?.prepareSave(
|
|
186
|
+
publication.nextHistory,
|
|
187
|
+
);
|
|
188
|
+
if (!this.compressionInProgress) {
|
|
189
|
+
recording = this.recording.prepareContentBatch(publication.contents);
|
|
190
|
+
}
|
|
191
|
+
} catch (error: unknown) {
|
|
192
|
+
if (persistence === undefined) throw error;
|
|
193
|
+
try {
|
|
194
|
+
await persistence.rollback();
|
|
195
|
+
} catch (rollbackError: unknown) {
|
|
196
|
+
throw new AggregateError(
|
|
197
|
+
[error, rollbackError],
|
|
198
|
+
'History batch preparation and persistence rollback failed',
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
throw error;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
publish: async () => {
|
|
206
|
+
recording?.publish();
|
|
207
|
+
await persistence?.publish();
|
|
208
|
+
},
|
|
209
|
+
rollback: async () => {
|
|
210
|
+
const failures: unknown[] = [];
|
|
211
|
+
try {
|
|
212
|
+
recording?.rollback();
|
|
213
|
+
} catch (error: unknown) {
|
|
214
|
+
failures.push(error);
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
await persistence?.rollback();
|
|
218
|
+
} catch (error: unknown) {
|
|
219
|
+
failures.push(error);
|
|
220
|
+
}
|
|
221
|
+
if (failures.length === 1) throw failures[0];
|
|
222
|
+
if (failures.length > 1) {
|
|
223
|
+
throw new AggregateError(failures, 'History batch rollback failed');
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
finalize: async () => {
|
|
227
|
+
await persistence?.finalize();
|
|
228
|
+
recording?.finalize();
|
|
229
|
+
},
|
|
230
|
+
};
|
|
36
231
|
}
|
|
37
232
|
|
|
38
233
|
/**
|
|
@@ -46,11 +241,26 @@ export class RecordingIntegration {
|
|
|
46
241
|
return;
|
|
47
242
|
}
|
|
48
243
|
|
|
244
|
+
// Whatever is already in history at subscribe time is content this
|
|
245
|
+
// recording either already contains (resume and fork both attach to a
|
|
246
|
+
// seeded file) or has deliberately excluded, since content added before
|
|
247
|
+
// subscribing is never recorded. Either way a later rebuild must not
|
|
248
|
+
// append it (issue #3132).
|
|
249
|
+
this.rememberExistingHistory(historyService);
|
|
250
|
+
|
|
49
251
|
const onContentAdded = (content: IContent) => {
|
|
50
252
|
if (this.disposed || this.compressionInProgress) {
|
|
51
253
|
return;
|
|
52
254
|
}
|
|
255
|
+
const identity = contentIdentity(content);
|
|
256
|
+
if (identity !== null && this.recordedIdentities.has(identity)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
53
259
|
this.recording.recordContent(content);
|
|
260
|
+
if (identity !== null) {
|
|
261
|
+
this.recordedIdentities.add(identity);
|
|
262
|
+
}
|
|
263
|
+
this.persist(historyService);
|
|
54
264
|
};
|
|
55
265
|
|
|
56
266
|
const onCompressionStarted = () => {
|
|
@@ -73,14 +283,19 @@ export class RecordingIntegration {
|
|
|
73
283
|
}
|
|
74
284
|
this.compressionInProgress = false;
|
|
75
285
|
this.recording.recordCompressed(summary, itemsCompressed);
|
|
286
|
+
this.persist(historyService);
|
|
76
287
|
};
|
|
77
288
|
|
|
289
|
+
const unregisterBatchParticipant = historyService.registerBatchParticipant(
|
|
290
|
+
(publication) => this.prepareBatch(publication),
|
|
291
|
+
);
|
|
78
292
|
historyService.on('contentAdded', onContentAdded);
|
|
79
293
|
historyService.on('compressionStarted', onCompressionStarted);
|
|
80
294
|
historyService.on('compressionLockReleased', onCompressionLockReleased);
|
|
81
295
|
historyService.on('compressionEnded', onCompressionEnded);
|
|
82
296
|
|
|
83
297
|
this.historySubscription = () => {
|
|
298
|
+
unregisterBatchParticipant();
|
|
84
299
|
historyService.off('contentAdded', onContentAdded);
|
|
85
300
|
historyService.off('compressionStarted', onCompressionStarted);
|
|
86
301
|
historyService.off('compressionLockReleased', onCompressionLockReleased);
|
|
@@ -88,6 +303,21 @@ export class RecordingIntegration {
|
|
|
88
303
|
};
|
|
89
304
|
}
|
|
90
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Seed {@link recordedIdentities} from the history that is already present
|
|
308
|
+
* on the service being subscribed to.
|
|
309
|
+
*
|
|
310
|
+
* @issue #3132
|
|
311
|
+
*/
|
|
312
|
+
private rememberExistingHistory(historyService: HistoryService): void {
|
|
313
|
+
for (const content of historyService.getAll()) {
|
|
314
|
+
const identity = contentIdentity(content);
|
|
315
|
+
if (identity !== null) {
|
|
316
|
+
this.recordedIdentities.add(identity);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
91
321
|
/**
|
|
92
322
|
* @plan PLAN-20260211-SESSIONRECORDING.P14
|
|
93
323
|
* @requirement REQ-INT-001, REQ-INT-006
|
|
@@ -148,10 +378,17 @@ export class RecordingIntegration {
|
|
|
148
378
|
* @pseudocode recording-integration.md lines 92-94
|
|
149
379
|
*/
|
|
150
380
|
async flushAtTurnBoundary(): Promise<void> {
|
|
151
|
-
if (this.disposed)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
381
|
+
if (this.disposed) return;
|
|
382
|
+
const generation = this.nextPersistenceGeneration;
|
|
383
|
+
const outcomes = await Promise.allSettled([
|
|
384
|
+
this.recording.flush(),
|
|
385
|
+
this.awaitPersistenceThrough(generation),
|
|
386
|
+
]);
|
|
387
|
+
const failures = outcomes.flatMap((outcome) =>
|
|
388
|
+
outcome.status === 'rejected' ? [outcome.reason] : [],
|
|
389
|
+
);
|
|
390
|
+
failures.push(...this.takePersistenceFailuresThrough(generation));
|
|
391
|
+
this.throwFailures(failures, 'Recording and persistence flush failed');
|
|
155
392
|
}
|
|
156
393
|
|
|
157
394
|
getRecordingService(): SessionRecordingService {
|
|
@@ -163,12 +400,22 @@ export class RecordingIntegration {
|
|
|
163
400
|
* @requirement REQ-INT-006
|
|
164
401
|
* @pseudocode recording-integration.md lines 96-98
|
|
165
402
|
*/
|
|
166
|
-
dispose(): void {
|
|
167
|
-
if (this.
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
403
|
+
dispose(): Promise<void> {
|
|
404
|
+
if (this.disposePromise !== undefined) return this.disposePromise;
|
|
170
405
|
this.disposed = true;
|
|
171
406
|
this.unsubscribeFromHistory();
|
|
407
|
+
const generation = this.nextPersistenceGeneration;
|
|
408
|
+
const operation = (async (): Promise<void> => {
|
|
409
|
+
try {
|
|
410
|
+
await this.awaitPersistenceThrough(generation);
|
|
411
|
+
const failures = this.takePersistenceFailuresThrough(generation);
|
|
412
|
+
this.throwFailures(failures, 'Session persistence shutdown failed');
|
|
413
|
+
} finally {
|
|
414
|
+
this.disposePromise = Promise.resolve();
|
|
415
|
+
}
|
|
416
|
+
})();
|
|
417
|
+
this.disposePromise = operation;
|
|
418
|
+
return operation;
|
|
172
419
|
}
|
|
173
420
|
|
|
174
421
|
/**
|