@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
|
@@ -13,6 +13,52 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Two independent 32-bit multiplicative hashes of `value`, concatenated in
|
|
18
|
+
* base-36 to give a 64-bit comparison key.
|
|
19
|
+
*
|
|
20
|
+
* The low lane is FNV-1a (offset basis 0x811c9dc5, prime 0x01000193). The high
|
|
21
|
+
* lane uses the same xor-then-multiply shape with a different seed and a
|
|
22
|
+
* different odd multiplier (the murmur3 finalizer constant 0x85ebca6b) so the
|
|
23
|
+
* two lanes do not move together.
|
|
24
|
+
*
|
|
25
|
+
* This shrinks a content payload to a comparison key and is never a security
|
|
26
|
+
* boundary. A collision would additionally have to land on the same chronology
|
|
27
|
+
* `seq` before it could suppress anything.
|
|
28
|
+
*/
|
|
29
|
+
function fingerprint(value) {
|
|
30
|
+
let low = 0x811c9dc5;
|
|
31
|
+
let high = 0x01000193;
|
|
32
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
33
|
+
const code = value.charCodeAt(index);
|
|
34
|
+
low = Math.imul(low ^ code, 0x01000193);
|
|
35
|
+
high = Math.imul(high ^ code, 0x85ebca6b);
|
|
36
|
+
}
|
|
37
|
+
return `${(low >>> 0).toString(36)}.${(high >>> 0).toString(36)}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The identity of a content record for duplicate detection: its chronology
|
|
41
|
+
* `seq` paired with a fingerprint of the exact payload.
|
|
42
|
+
*
|
|
43
|
+
* Returns `null` when the content carries no chronology marker. Such content
|
|
44
|
+
* has no identity, so it is always recorded rather than risk suppressing
|
|
45
|
+
* something that was never written.
|
|
46
|
+
*
|
|
47
|
+
* `seq` alone is NOT sufficient. It is unique only within one `HistoryService`
|
|
48
|
+
* instance, `ChronologyStamper.inherit` deliberately gives a replacement entry
|
|
49
|
+
* the replaced entry's marker, and `merge` can import entries from a foreign
|
|
50
|
+
* chronology. Pairing it with the payload fingerprint means suppression can
|
|
51
|
+
* only ever discard content byte-identical to a record already written.
|
|
52
|
+
*
|
|
53
|
+
* @issue #3132
|
|
54
|
+
*/
|
|
55
|
+
function contentIdentity(content) {
|
|
56
|
+
const seq = content.metadata?.chronology?.seq;
|
|
57
|
+
if (typeof seq !== 'number') {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return `${seq}:${fingerprint(JSON.stringify(content))}`;
|
|
61
|
+
}
|
|
16
62
|
/**
|
|
17
63
|
* Bridges HistoryService events to SessionRecordingService.
|
|
18
64
|
*
|
|
@@ -24,9 +70,131 @@ export class RecordingIntegration {
|
|
|
24
70
|
recording;
|
|
25
71
|
historySubscription = null;
|
|
26
72
|
compressionInProgress = false;
|
|
73
|
+
/**
|
|
74
|
+
* Identities of the content records this recording already contains.
|
|
75
|
+
*
|
|
76
|
+
* Several production paths rebuild history wholesale by calling
|
|
77
|
+
* `HistoryService.clear()` and then re-`add()`ing the retained entries. Each
|
|
78
|
+
* re-`add()` emits `contentAdded`, so without this set the rebuild appends a
|
|
79
|
+
* byte-identical copy of every retained entry to the session file, and
|
|
80
|
+
* `ReplayEngine` replays those copies into doubled history on resume.
|
|
81
|
+
*
|
|
82
|
+
* Scoped to the one `SessionRecordingService` this integration wraps, so it
|
|
83
|
+
* is never reset while that file is open. Bounded by the number of distinct
|
|
84
|
+
* content records written to the session.
|
|
85
|
+
*
|
|
86
|
+
* @issue #3132
|
|
87
|
+
*/
|
|
88
|
+
recordedIdentities = new Set();
|
|
27
89
|
disposed = false;
|
|
28
|
-
|
|
90
|
+
persistence;
|
|
91
|
+
pendingPersistence = new Map();
|
|
92
|
+
persistenceFailures = new Map();
|
|
93
|
+
nextPersistenceGeneration = 0;
|
|
94
|
+
disposePromise;
|
|
95
|
+
constructor(recording, persistence) {
|
|
29
96
|
this.recording = recording;
|
|
97
|
+
this.persistence = persistence;
|
|
98
|
+
}
|
|
99
|
+
persist(historyService) {
|
|
100
|
+
if (this.persistence === undefined)
|
|
101
|
+
return;
|
|
102
|
+
const generation = ++this.nextPersistenceGeneration;
|
|
103
|
+
let save;
|
|
104
|
+
try {
|
|
105
|
+
save = this.persistence.save([...historyService.getAll()]);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
this.persistenceFailures.set(generation, error);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const settled = save.then(() => {
|
|
112
|
+
this.pendingPersistence.delete(generation);
|
|
113
|
+
}, (error) => {
|
|
114
|
+
this.persistenceFailures.set(generation, error);
|
|
115
|
+
this.pendingPersistence.delete(generation);
|
|
116
|
+
});
|
|
117
|
+
this.pendingPersistence.set(generation, settled);
|
|
118
|
+
}
|
|
119
|
+
async awaitPersistenceThrough(generation) {
|
|
120
|
+
const pending = [...this.pendingPersistence.entries()]
|
|
121
|
+
.filter(([pendingGeneration]) => pendingGeneration <= generation)
|
|
122
|
+
.map(([, operation]) => operation);
|
|
123
|
+
await Promise.all(pending);
|
|
124
|
+
}
|
|
125
|
+
takePersistenceFailuresThrough(generation) {
|
|
126
|
+
const failures = [];
|
|
127
|
+
for (const [failedGeneration, error] of [
|
|
128
|
+
...this.persistenceFailures.entries(),
|
|
129
|
+
].sort(([left], [right]) => left - right)) {
|
|
130
|
+
if (failedGeneration > generation)
|
|
131
|
+
continue;
|
|
132
|
+
this.persistenceFailures.delete(failedGeneration);
|
|
133
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
134
|
+
failures.push(new Error(`Session persistence generation ${failedGeneration} failed: ${detail}`, { cause: error }));
|
|
135
|
+
}
|
|
136
|
+
return failures;
|
|
137
|
+
}
|
|
138
|
+
throwFailures(failures, message) {
|
|
139
|
+
if (failures.length === 1)
|
|
140
|
+
throw failures[0];
|
|
141
|
+
if (failures.length > 1)
|
|
142
|
+
throw new AggregateError(failures, message);
|
|
143
|
+
}
|
|
144
|
+
async prepareBatch(publication) {
|
|
145
|
+
await this.recording.flush();
|
|
146
|
+
if (!this.recording.isActive()) {
|
|
147
|
+
throw new Error('Cannot publish history batch: recording is not active');
|
|
148
|
+
}
|
|
149
|
+
let persistence;
|
|
150
|
+
let recording;
|
|
151
|
+
try {
|
|
152
|
+
persistence = await this.persistence?.prepareSave(publication.nextHistory);
|
|
153
|
+
if (!this.compressionInProgress) {
|
|
154
|
+
recording = this.recording.prepareContentBatch(publication.contents);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (persistence === undefined)
|
|
159
|
+
throw error;
|
|
160
|
+
try {
|
|
161
|
+
await persistence.rollback();
|
|
162
|
+
}
|
|
163
|
+
catch (rollbackError) {
|
|
164
|
+
throw new AggregateError([error, rollbackError], 'History batch preparation and persistence rollback failed');
|
|
165
|
+
}
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
publish: async () => {
|
|
170
|
+
recording?.publish();
|
|
171
|
+
await persistence?.publish();
|
|
172
|
+
},
|
|
173
|
+
rollback: async () => {
|
|
174
|
+
const failures = [];
|
|
175
|
+
try {
|
|
176
|
+
recording?.rollback();
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
failures.push(error);
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
await persistence?.rollback();
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
failures.push(error);
|
|
186
|
+
}
|
|
187
|
+
if (failures.length === 1)
|
|
188
|
+
throw failures[0];
|
|
189
|
+
if (failures.length > 1) {
|
|
190
|
+
throw new AggregateError(failures, 'History batch rollback failed');
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
finalize: async () => {
|
|
194
|
+
await persistence?.finalize();
|
|
195
|
+
recording?.finalize();
|
|
196
|
+
},
|
|
197
|
+
};
|
|
30
198
|
}
|
|
31
199
|
/**
|
|
32
200
|
* @plan PLAN-20260211-SESSIONRECORDING.P14
|
|
@@ -38,11 +206,25 @@ export class RecordingIntegration {
|
|
|
38
206
|
if (this.disposed) {
|
|
39
207
|
return;
|
|
40
208
|
}
|
|
209
|
+
// Whatever is already in history at subscribe time is content this
|
|
210
|
+
// recording either already contains (resume and fork both attach to a
|
|
211
|
+
// seeded file) or has deliberately excluded, since content added before
|
|
212
|
+
// subscribing is never recorded. Either way a later rebuild must not
|
|
213
|
+
// append it (issue #3132).
|
|
214
|
+
this.rememberExistingHistory(historyService);
|
|
41
215
|
const onContentAdded = (content) => {
|
|
42
216
|
if (this.disposed || this.compressionInProgress) {
|
|
43
217
|
return;
|
|
44
218
|
}
|
|
219
|
+
const identity = contentIdentity(content);
|
|
220
|
+
if (identity !== null && this.recordedIdentities.has(identity)) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
45
223
|
this.recording.recordContent(content);
|
|
224
|
+
if (identity !== null) {
|
|
225
|
+
this.recordedIdentities.add(identity);
|
|
226
|
+
}
|
|
227
|
+
this.persist(historyService);
|
|
46
228
|
};
|
|
47
229
|
const onCompressionStarted = () => {
|
|
48
230
|
if (this.disposed) {
|
|
@@ -62,18 +244,35 @@ export class RecordingIntegration {
|
|
|
62
244
|
}
|
|
63
245
|
this.compressionInProgress = false;
|
|
64
246
|
this.recording.recordCompressed(summary, itemsCompressed);
|
|
247
|
+
this.persist(historyService);
|
|
65
248
|
};
|
|
249
|
+
const unregisterBatchParticipant = historyService.registerBatchParticipant((publication) => this.prepareBatch(publication));
|
|
66
250
|
historyService.on('contentAdded', onContentAdded);
|
|
67
251
|
historyService.on('compressionStarted', onCompressionStarted);
|
|
68
252
|
historyService.on('compressionLockReleased', onCompressionLockReleased);
|
|
69
253
|
historyService.on('compressionEnded', onCompressionEnded);
|
|
70
254
|
this.historySubscription = () => {
|
|
255
|
+
unregisterBatchParticipant();
|
|
71
256
|
historyService.off('contentAdded', onContentAdded);
|
|
72
257
|
historyService.off('compressionStarted', onCompressionStarted);
|
|
73
258
|
historyService.off('compressionLockReleased', onCompressionLockReleased);
|
|
74
259
|
historyService.off('compressionEnded', onCompressionEnded);
|
|
75
260
|
};
|
|
76
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Seed {@link recordedIdentities} from the history that is already present
|
|
264
|
+
* on the service being subscribed to.
|
|
265
|
+
*
|
|
266
|
+
* @issue #3132
|
|
267
|
+
*/
|
|
268
|
+
rememberExistingHistory(historyService) {
|
|
269
|
+
for (const content of historyService.getAll()) {
|
|
270
|
+
const identity = contentIdentity(content);
|
|
271
|
+
if (identity !== null) {
|
|
272
|
+
this.recordedIdentities.add(identity);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
77
276
|
/**
|
|
78
277
|
* @plan PLAN-20260211-SESSIONRECORDING.P14
|
|
79
278
|
* @requirement REQ-INT-001, REQ-INT-006
|
|
@@ -126,10 +325,16 @@ export class RecordingIntegration {
|
|
|
126
325
|
* @pseudocode recording-integration.md lines 92-94
|
|
127
326
|
*/
|
|
128
327
|
async flushAtTurnBoundary() {
|
|
129
|
-
if (this.disposed)
|
|
328
|
+
if (this.disposed)
|
|
130
329
|
return;
|
|
131
|
-
|
|
132
|
-
await
|
|
330
|
+
const generation = this.nextPersistenceGeneration;
|
|
331
|
+
const outcomes = await Promise.allSettled([
|
|
332
|
+
this.recording.flush(),
|
|
333
|
+
this.awaitPersistenceThrough(generation),
|
|
334
|
+
]);
|
|
335
|
+
const failures = outcomes.flatMap((outcome) => outcome.status === 'rejected' ? [outcome.reason] : []);
|
|
336
|
+
failures.push(...this.takePersistenceFailuresThrough(generation));
|
|
337
|
+
this.throwFailures(failures, 'Recording and persistence flush failed');
|
|
133
338
|
}
|
|
134
339
|
getRecordingService() {
|
|
135
340
|
return this.recording;
|
|
@@ -140,11 +345,23 @@ export class RecordingIntegration {
|
|
|
140
345
|
* @pseudocode recording-integration.md lines 96-98
|
|
141
346
|
*/
|
|
142
347
|
dispose() {
|
|
143
|
-
if (this.
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
348
|
+
if (this.disposePromise !== undefined)
|
|
349
|
+
return this.disposePromise;
|
|
146
350
|
this.disposed = true;
|
|
147
351
|
this.unsubscribeFromHistory();
|
|
352
|
+
const generation = this.nextPersistenceGeneration;
|
|
353
|
+
const operation = (async () => {
|
|
354
|
+
try {
|
|
355
|
+
await this.awaitPersistenceThrough(generation);
|
|
356
|
+
const failures = this.takePersistenceFailuresThrough(generation);
|
|
357
|
+
this.throwFailures(failures, 'Session persistence shutdown failed');
|
|
358
|
+
}
|
|
359
|
+
finally {
|
|
360
|
+
this.disposePromise = Promise.resolve();
|
|
361
|
+
}
|
|
362
|
+
})();
|
|
363
|
+
this.disposePromise = operation;
|
|
364
|
+
return operation;
|
|
148
365
|
}
|
|
149
366
|
/**
|
|
150
367
|
* @plan PLAN-20260211-SESSIONRECORDING.P14
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordingIntegration.js","sourceRoot":"","sources":["../../../src/recording/RecordingIntegration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"RecordingIntegration.js","sourceRoot":"","sources":["../../../src/recording/RecordingIntegration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH;;;;;;;;;;;;GAYG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,GAAG,GAAG,UAAU,CAAC;IACrB,IAAI,IAAI,GAAG,UAAU,CAAC;IACtB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAA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GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1C,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;QACL,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,wBAAwB,CAAC,iBAAiC;QACxD,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -13,14 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Each checkpoint is tracked by stable `checkpointId`. Created events set
|
|
20
|
-
* the name, watermark, and createdAt; renamed events update the name;
|
|
21
|
-
* deleted events set `deleted: true`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function foldCheckpointMetadata(events: readonly SessionRecordLine[]): CheckpointMetadataView[];
|
|
16
|
+
export { foldCheckpointMetadata } from './replayCheckpointMetadata.js';
|
|
17
|
+
import { type ReplayResult, type SessionStartPayload } from './types.js';
|
|
18
|
+
import type { LocalMediaStore } from '../storage/local-media-store.js';
|
|
24
19
|
/**
|
|
25
20
|
* @plan PLAN-20260211-SESSIONRECORDING.P08
|
|
26
21
|
* @requirement REQ-RPL-002, REQ-RPL-003, REQ-RPL-005, REQ-RPL-006, REQ-RPL-007, REQ-RPL-008
|
|
@@ -30,13 +25,16 @@ export declare function foldCheckpointMetadata(events: readonly SessionRecordLin
|
|
|
30
25
|
* @param expectedProjectHash - Must match the file's projectHash
|
|
31
26
|
* @returns ReplayResult discriminated union — ok: true with data, or ok: false with error
|
|
32
27
|
*/
|
|
33
|
-
export
|
|
28
|
+
export interface ReplaySessionOptions {
|
|
29
|
+
readonly mediaStore?: LocalMediaStore;
|
|
30
|
+
}
|
|
31
|
+
export declare function replaySession(filePath: string, expectedProjectHash: string, options?: ReplaySessionOptions): Promise<ReplayResult>;
|
|
34
32
|
/**
|
|
35
33
|
* Replay a session through an inclusive maximum sequence number.
|
|
36
34
|
* Processing stops at the first valid event whose `seq` exceeds maxSequence.
|
|
37
35
|
* Used for checkpoint fork creation: replay through the checkpoint watermark.
|
|
38
36
|
*/
|
|
39
|
-
export declare function replaySessionThroughSequence(filePath: string, expectedProjectHash: string, maxSequence: number): Promise<ReplayResult>;
|
|
37
|
+
export declare function replaySessionThroughSequence(filePath: string, expectedProjectHash: string, maxSequence: number, options?: ReplaySessionOptions): Promise<ReplayResult>;
|
|
40
38
|
/**
|
|
41
39
|
* Read only the session header (first line) from a JSONL file.
|
|
42
40
|
* Useful for listing sessions without replaying the entire file.
|