@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
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { DEFAULT_GEMINI_FLASH_LITE_MODEL } from '../config/models.js';
|
|
7
|
-
import { partToString } from './partUtils.js';
|
|
8
6
|
import { getResponseTextFromBlocks } from './generateContentResponseUtilities.js';
|
|
9
7
|
import { debugLogger } from './debugLogger.js';
|
|
10
8
|
/**
|
|
@@ -29,13 +27,16 @@ Text to summarize:
|
|
|
29
27
|
|
|
30
28
|
Return the summary string which should first contain an overall summarization of text followed by the full stack trace of errors and warnings in the tool output.
|
|
31
29
|
`;
|
|
32
|
-
export
|
|
33
|
-
export async function summarizeToolOutput(textToSummarize, agentClient, abortSignal, maxOutputTokens = 2000) {
|
|
30
|
+
export async function summarizeToolOutput(textToSummarize, agentClient, abortSignal, maxOutputTokens = 2000, utilityModel) {
|
|
34
31
|
// There is going to be a slight difference here since we are comparing length of string with maxOutputTokens.
|
|
35
32
|
// This is meant to be a ballpark estimation of if we need to summarize the tool output.
|
|
36
33
|
if (!textToSummarize || textToSummarize.length < maxOutputTokens) {
|
|
37
34
|
return textToSummarize;
|
|
38
35
|
}
|
|
36
|
+
if (!utilityModel || utilityModel.trim() === '') {
|
|
37
|
+
debugLogger.log('summarizeToolOutput enabled but no utilityModel configured — skipping');
|
|
38
|
+
return textToSummarize;
|
|
39
|
+
}
|
|
39
40
|
const prompt = SUMMARIZE_TOOL_OUTPUT_PROMPT.replace('{maxOutputTokens}', String(maxOutputTokens)).replace('{textToSummarize}', textToSummarize);
|
|
40
41
|
const contents = [
|
|
41
42
|
{ speaker: 'human', blocks: [{ type: 'text', text: prompt }] },
|
|
@@ -44,7 +45,7 @@ export async function summarizeToolOutput(textToSummarize, agentClient, abortSig
|
|
|
44
45
|
maxOutputTokens,
|
|
45
46
|
};
|
|
46
47
|
try {
|
|
47
|
-
const parsedResponse = await agentClient.generateContent(contents, toolOutputSummarizerConfig, abortSignal,
|
|
48
|
+
const parsedResponse = await agentClient.generateContent(contents, toolOutputSummarizerConfig, abortSignal, utilityModel);
|
|
48
49
|
const responseText = getResponseTextFromBlocks(parsedResponse.content.blocks);
|
|
49
50
|
return responseText === undefined || responseText === ''
|
|
50
51
|
? textToSummarize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../../../src/utils/summarizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../../../src/utils/summarizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAc/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAe,CAC3C,MAAkB,EAClB,YAAiC,EACjC,YAAyB,EACzB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAExD,MAAM,4BAA4B,GAAG;;;;;;;;;;;;CAYpC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,eAAuB,EACvB,WAAgC,EAChC,WAAwB,EACxB,kBAA0B,IAAI,EAC9B,YAAqB;IAErB,8GAA8G;IAC9G,wFAAwF;IACxF,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;QACjE,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,WAAW,CAAC,GAAG,CACb,uEAAuE,CACxE,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,CACjD,mBAAmB,EACnB,MAAM,CAAC,eAAe,CAAC,CACxB,CAAC,OAAO,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAe;QAC3B,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE;KAC/D,CAAC;IACF,MAAM,0BAA0B,GAA8B;QAC5D,eAAe;KAChB,CAAC;IACF,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC,eAAe,CACtD,QAAQ,EACR,0BAA0B,EAC1B,WAAW,EACX,YAAY,CACb,CAAC;QACF,MAAM,YAAY,GAAG,yBAAyB,CAC5C,cAAc,CAAC,OAAO,CAAC,MAAM,CAC9B,CAAC;QACF,OAAO,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE;YACtD,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,YAAY,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,eAAe,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -55,7 +55,11 @@ function matchesToolPattern(pattern, toolNames, invocation, caseInsensitive = fa
|
|
|
55
55
|
if (!('command' in invocation.params)) {
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
const commandValue = invocation.params.command;
|
|
59
|
+
if (typeof commandValue !== 'string') {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
command = commandValue;
|
|
59
63
|
}
|
|
60
64
|
// PowerShell command resolution is case-insensitive; Bash is case-sensitive.
|
|
61
65
|
// Normalize both sides for comparison without mutating the original values.
|
|
@@ -93,6 +97,8 @@ export function isShellInvocationAllowlisted(invocation, allowedPatterns, shellT
|
|
|
93
97
|
if (hasShellWildcard) {
|
|
94
98
|
return true;
|
|
95
99
|
}
|
|
100
|
+
// AnyToolInvocation.params is an intentionally shape-less `object` boundary, so
|
|
101
|
+
// widen to unknown before structural checks.
|
|
96
102
|
const params = invocation.params;
|
|
97
103
|
if (typeof params !== 'object' || params === null || !('command' in params)) {
|
|
98
104
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-utils.js","sourceRoot":"","sources":["../../../src/utils/tool-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,yBAAyB,GAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CACrC,cAA2C,EAC3C,UAAsC,EACtC,QAAkB,EAClB,eAAe,GAAG,KAAK;IAEvB,IAAI,SAAmB,CAAC;IACxB,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAC3B,SAAS,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAA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CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,yBAAyB,cAAc,GAAG;QAC5C,CAAC,CAAC,iBAAiB,cAAc,GAAG,CAAC;AACzC,CAAC"}
|
package/index.ts
CHANGED
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
export * from './src/index.js';
|
|
8
8
|
export type { HistoryService } from './src/services/history/HistoryService.js';
|
|
9
9
|
export {
|
|
10
|
-
DEFAULT_GEMINI_MODEL,
|
|
11
|
-
DEFAULT_GEMINI_FLASH_MODEL,
|
|
12
|
-
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
13
|
-
DEFAULT_GEMINI_EMBEDDING_MODEL,
|
|
14
10
|
PLACEHOLDER_MODEL,
|
|
15
11
|
UNCONFIGURED_PROVIDER,
|
|
16
12
|
} from './src/config/models.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vybestack/llxprt-code-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-nightly.260910.2aac6841e",
|
|
4
4
|
"description": "LLxprt Code Core",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"bun": "./src/auth-factories.ts",
|
|
27
27
|
"import": "./dist/src/auth-factories.js"
|
|
28
28
|
},
|
|
29
|
-
"./code_assist/codeAssist.js": {
|
|
30
|
-
"bun": "./src/code_assist/codeAssist.ts",
|
|
31
|
-
"import": "./dist/src/code_assist/codeAssist.js"
|
|
32
|
-
},
|
|
33
29
|
"./config/config.js": {
|
|
34
30
|
"bun": "./src/config/config.ts",
|
|
35
31
|
"import": "./dist/src/config/config.js"
|
|
@@ -185,6 +181,15 @@
|
|
|
185
181
|
"bun": "./src/services/history/IContent.ts",
|
|
186
182
|
"import": "./dist/src/services/history/IContent.js"
|
|
187
183
|
},
|
|
184
|
+
"./services/history/semantic-media-purge.js": {
|
|
185
|
+
"bun": "./src/services/history/semantic-media-purge.ts",
|
|
186
|
+
"import": "./dist/src/services/history/semantic-media-purge.js"
|
|
187
|
+
},
|
|
188
|
+
"./services/history/historyCloneUtils.js": {
|
|
189
|
+
"types": "./dist/src/services/history/historyCloneUtils.d.ts",
|
|
190
|
+
"bun": "./src/services/history/historyCloneUtils.ts",
|
|
191
|
+
"import": "./dist/src/services/history/historyCloneUtils.js"
|
|
192
|
+
},
|
|
188
193
|
"./llm-types/index.js": {
|
|
189
194
|
"bun": "./src/llm-types/index.ts",
|
|
190
195
|
"import": "./dist/src/llm-types/index.js"
|
|
@@ -216,6 +221,21 @@
|
|
|
216
221
|
"bun": "./src/storage/sessionTypes.ts",
|
|
217
222
|
"import": "./dist/src/storage/sessionTypes.js"
|
|
218
223
|
},
|
|
224
|
+
"./storage/local-media-store.js": {
|
|
225
|
+
"types": "./dist/src/storage/local-media-store.d.ts",
|
|
226
|
+
"bun": "./src/storage/local-media-store.ts",
|
|
227
|
+
"import": "./dist/src/storage/local-media-store.js"
|
|
228
|
+
},
|
|
229
|
+
"./storage/media-admission-service.js": {
|
|
230
|
+
"types": "./dist/src/storage/media-admission-service.d.ts",
|
|
231
|
+
"bun": "./src/storage/media-admission-service.ts",
|
|
232
|
+
"import": "./dist/src/storage/media-admission-service.js"
|
|
233
|
+
},
|
|
234
|
+
"./storage/request-media-resolver.js": {
|
|
235
|
+
"types": "./dist/src/storage/request-media-resolver.d.ts",
|
|
236
|
+
"bun": "./src/storage/request-media-resolver.ts",
|
|
237
|
+
"import": "./dist/src/storage/request-media-resolver.js"
|
|
238
|
+
},
|
|
219
239
|
"./storage/secure-store.js": {
|
|
220
240
|
"types": "./dist/src/storage/secure-store.d.ts",
|
|
221
241
|
"bun": "./src/storage/secure-store.ts",
|
|
@@ -333,6 +353,10 @@
|
|
|
333
353
|
"bun": "./src/core/compression/continuationDirective.ts",
|
|
334
354
|
"import": "./dist/src/core/compression/continuationDirective.js"
|
|
335
355
|
},
|
|
356
|
+
"./core/compression/transcriptPathNotice.js": {
|
|
357
|
+
"bun": "./src/core/compression/transcriptPathNotice.ts",
|
|
358
|
+
"import": "./dist/src/core/compression/transcriptPathNotice.js"
|
|
359
|
+
},
|
|
336
360
|
"./core/compression/types.js": {
|
|
337
361
|
"bun": "./src/core/compression/types.ts",
|
|
338
362
|
"import": "./dist/src/core/compression/types.js"
|
|
@@ -369,10 +393,6 @@
|
|
|
369
393
|
"bun": "./src/scheduler/liveOutput.ts",
|
|
370
394
|
"import": "./dist/src/scheduler/liveOutput.js"
|
|
371
395
|
},
|
|
372
|
-
"./code_assist/types.js": {
|
|
373
|
-
"bun": "./src/code_assist/types.ts",
|
|
374
|
-
"import": "./dist/src/code_assist/types.js"
|
|
375
|
-
},
|
|
376
396
|
"./config/schedulerSingleton.js": {
|
|
377
397
|
"bun": "./src/config/schedulerSingleton.ts",
|
|
378
398
|
"import": "./dist/src/config/schedulerSingleton.js"
|
|
@@ -509,10 +529,6 @@
|
|
|
509
529
|
"bun": "./src/utils/generateContentResponseUtilities.ts",
|
|
510
530
|
"import": "./dist/src/utils/generateContentResponseUtilities.js"
|
|
511
531
|
},
|
|
512
|
-
"./utils/getFolderStructure.js": {
|
|
513
|
-
"bun": "./src/utils/getFolderStructure.ts",
|
|
514
|
-
"import": "./dist/src/utils/getFolderStructure.js"
|
|
515
|
-
},
|
|
516
532
|
"./utils/messageInspectors.js": {
|
|
517
533
|
"bun": "./src/utils/messageInspectors.ts",
|
|
518
534
|
"import": "./dist/src/utils/messageInspectors.js"
|
|
@@ -552,7 +568,7 @@
|
|
|
552
568
|
"format": "prettier --write .",
|
|
553
569
|
"test": "bun run-bun-tests.ts",
|
|
554
570
|
"test:ci": "bun run-bun-tests.ts",
|
|
555
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.runner.json"
|
|
571
|
+
"typecheck": "tsc --noEmit -p tsconfig.noemit.json && tsc -p tsconfig.runner.json"
|
|
556
572
|
},
|
|
557
573
|
"files": [
|
|
558
574
|
"index.ts",
|
|
@@ -566,15 +582,13 @@
|
|
|
566
582
|
"dist"
|
|
567
583
|
],
|
|
568
584
|
"dependencies": {
|
|
569
|
-
"@vybestack/llxprt-code-auth": "0.
|
|
570
|
-
"@vybestack/llxprt-code-ide-integration": "0.
|
|
571
|
-
"@vybestack/llxprt-code-storage": "0.
|
|
572
|
-
"@vybestack/llxprt-code-mcp": "0.
|
|
573
|
-
"@vybestack/llxprt-code-policy": "0.
|
|
574
|
-
"@vybestack/llxprt-code-settings": "0.
|
|
575
|
-
"@vybestack/llxprt-code-telemetry": "0.
|
|
576
|
-
"@ai-sdk/openai": "^2.0.74",
|
|
577
|
-
"@anthropic-ai/sdk": "^0.55.1",
|
|
585
|
+
"@vybestack/llxprt-code-auth": "0.12.0-nightly.260910.2aac6841e",
|
|
586
|
+
"@vybestack/llxprt-code-ide-integration": "0.12.0-nightly.260910.2aac6841e",
|
|
587
|
+
"@vybestack/llxprt-code-storage": "0.12.0-nightly.260910.2aac6841e",
|
|
588
|
+
"@vybestack/llxprt-code-mcp": "0.12.0-nightly.260910.2aac6841e",
|
|
589
|
+
"@vybestack/llxprt-code-policy": "0.12.0-nightly.260910.2aac6841e",
|
|
590
|
+
"@vybestack/llxprt-code-settings": "0.12.0-nightly.260910.2aac6841e",
|
|
591
|
+
"@vybestack/llxprt-code-telemetry": "0.12.0-nightly.260910.2aac6841e",
|
|
578
592
|
"@ast-grep/lang-c": "^0.0.5",
|
|
579
593
|
"@ast-grep/lang-cpp": "^0.0.5",
|
|
580
594
|
"@ast-grep/lang-csharp": "^0.0.5",
|
|
@@ -590,16 +604,13 @@
|
|
|
590
604
|
"@ast-grep/lang-swift": "^0.0.7",
|
|
591
605
|
"@ast-grep/napi": "^0.40.5",
|
|
592
606
|
"@dqbd/tiktoken": "1.0.22",
|
|
593
|
-
"@google/genai": "1.30.0",
|
|
594
607
|
"@iarna/toml": "^2.2.5",
|
|
595
608
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
596
|
-
"@vybestack/llxprt-code-tools": "0.
|
|
609
|
+
"@vybestack/llxprt-code-tools": "0.12.0-nightly.260910.2aac6841e",
|
|
597
610
|
"@xterm/headless": "5.5.0",
|
|
598
|
-
"ai": "^5.0.104",
|
|
599
611
|
"ajv": "^8.17.1",
|
|
600
612
|
"ajv-formats": "^3.0.0",
|
|
601
613
|
"chardet": "^2.1.0",
|
|
602
|
-
"cheerio": "^1.1.2",
|
|
603
614
|
"diff": "^8.0.3",
|
|
604
615
|
"execa": "^9.6.0",
|
|
605
616
|
"fast-glob": "^3.3.3",
|
|
@@ -607,7 +618,6 @@
|
|
|
607
618
|
"fdir": "^6.4.6",
|
|
608
619
|
"fzf": "^0.5.2",
|
|
609
620
|
"glob": "^12.0.0",
|
|
610
|
-
"google-auth-library": "^9.11.0",
|
|
611
621
|
"html-to-text": "^9.0.5",
|
|
612
622
|
"https-proxy-agent": "^7.0.6",
|
|
613
623
|
"ignore": "^7.0.0",
|
|
@@ -616,9 +626,7 @@
|
|
|
616
626
|
"micromatch": "^4.0.8",
|
|
617
627
|
"mime-types": "^3.0.1",
|
|
618
628
|
"mnemonist": "^0.40.3",
|
|
619
|
-
"node-fetch": "^3.3.2",
|
|
620
629
|
"open": "^10.1.2",
|
|
621
|
-
"openai": "^5.10.1",
|
|
622
630
|
"picomatch": "^4.0.4",
|
|
623
631
|
"read-package-up": "^11.0.0",
|
|
624
632
|
"shell-quote": "^1.10.0",
|
|
@@ -178,14 +178,14 @@ export function buildNewContentGeneratorConfig(
|
|
|
178
178
|
* Transfers existing history to the new agent client, stripping thought
|
|
179
179
|
* signatures when migrating from GenAI to Vertex.
|
|
180
180
|
*/
|
|
181
|
-
export function transferHistoryToNewClient(
|
|
181
|
+
export async function transferHistoryToNewClient(
|
|
182
182
|
logger: DebugLogger,
|
|
183
183
|
newAgentClient: AgentClientContract,
|
|
184
184
|
existingHistory: readonly IContent[],
|
|
185
185
|
existingHistoryService: ReturnType<AgentClientContract['getHistoryService']>,
|
|
186
186
|
newContentGeneratorConfig: ReturnType<typeof createContentGeneratorConfig>,
|
|
187
187
|
previousVertexai: boolean | undefined,
|
|
188
|
-
): void {
|
|
188
|
+
): Promise<void> {
|
|
189
189
|
const fromGenaiToVertex =
|
|
190
190
|
previousVertexai === false && newContentGeneratorConfig.vertexai === true;
|
|
191
191
|
if (existingHistoryService) {
|
|
@@ -205,30 +205,58 @@ export function transferHistoryToNewClient(
|
|
|
205
205
|
const historyToStore = fromGenaiToVertex
|
|
206
206
|
? stripThoughtSignatures(existingHistory)
|
|
207
207
|
: existingHistory;
|
|
208
|
-
newAgentClient.storeHistoryForLaterUse(historyToStore);
|
|
208
|
+
await newAgentClient.storeHistoryForLaterUse(historyToStore);
|
|
209
209
|
logger.debug('History stored in new client', {
|
|
210
210
|
storedHistoryLength: historyToStore.length,
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
* Disposes the previous agent client if it exists and has a dispose method.
|
|
216
|
-
*/
|
|
217
|
-
export function disposePreviousAgentClient(
|
|
214
|
+
export async function prepareAgentClientReplacement(
|
|
218
215
|
logger: DebugLogger,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
216
|
+
newAgentClient: AgentClientContract,
|
|
217
|
+
previousAgentClient: AgentClientContract | null | undefined,
|
|
218
|
+
existingHistory: readonly IContent[],
|
|
219
|
+
existingHistoryService: ReturnType<AgentClientContract['getHistoryService']>,
|
|
220
|
+
newContentGeneratorConfig: ReturnType<typeof createContentGeneratorConfig>,
|
|
221
|
+
previousVertexai: boolean | undefined,
|
|
222
|
+
): Promise<void> {
|
|
223
|
+
try {
|
|
224
|
+
await transferHistoryToNewClient(
|
|
225
|
+
logger,
|
|
226
|
+
newAgentClient,
|
|
227
|
+
existingHistory,
|
|
228
|
+
existingHistoryService,
|
|
229
|
+
newContentGeneratorConfig,
|
|
230
|
+
previousVertexai,
|
|
231
|
+
);
|
|
232
|
+
await newAgentClient.initialize(newContentGeneratorConfig);
|
|
233
|
+
await disposePreviousAgentClient(logger, previousAgentClient);
|
|
234
|
+
} catch (error: unknown) {
|
|
222
235
|
try {
|
|
223
|
-
|
|
224
|
-
} catch (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
error instanceof Error ? error.message : String(error)
|
|
229
|
-
}`,
|
|
236
|
+
await disposePreviousAgentClient(logger, newAgentClient);
|
|
237
|
+
} catch (cleanupError: unknown) {
|
|
238
|
+
throw new AggregateError(
|
|
239
|
+
[error, cleanupError],
|
|
240
|
+
'Agent client replacement failed and new client cleanup was incomplete',
|
|
230
241
|
);
|
|
231
242
|
}
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Disposes the previous agent client if it exists and has a dispose method.
|
|
249
|
+
*/
|
|
250
|
+
export async function disposePreviousAgentClient(
|
|
251
|
+
_logger: DebugLogger,
|
|
252
|
+
previousAgentClient: AgentClientContract | null | undefined,
|
|
253
|
+
): Promise<void> {
|
|
254
|
+
if (
|
|
255
|
+
previousAgentClient !== null &&
|
|
256
|
+
previousAgentClient !== undefined &&
|
|
257
|
+
hasCallableProperty(previousAgentClient, 'dispose')
|
|
258
|
+
) {
|
|
259
|
+
await previousAgentClient.dispose();
|
|
232
260
|
}
|
|
233
261
|
}
|
|
234
262
|
|
|
@@ -260,10 +288,10 @@ function createDetachedRuntimeId(baseRuntimeId: string | undefined): string {
|
|
|
260
288
|
* cleared. Used for one-shot operations such as subagent auto-prompt
|
|
261
289
|
* generation that need a clean, isolated runtime scope.
|
|
262
290
|
*/
|
|
263
|
-
export function createDetachedAgentClient(
|
|
291
|
+
export async function createDetachedAgentClient(
|
|
264
292
|
config: Config,
|
|
265
293
|
runtimeId?: string,
|
|
266
|
-
): AgentClientContract {
|
|
294
|
+
): Promise<AgentClientContract> {
|
|
267
295
|
const factory = requireAgentClientFactory(
|
|
268
296
|
config.getAgentClientFactory(),
|
|
269
297
|
'createDetachedAgentClient',
|
|
@@ -278,9 +306,12 @@ export function createDetachedAgentClient(
|
|
|
278
306
|
client.clearTools();
|
|
279
307
|
} catch (error) {
|
|
280
308
|
try {
|
|
281
|
-
client.dispose();
|
|
282
|
-
} catch {
|
|
283
|
-
|
|
309
|
+
await client.dispose();
|
|
310
|
+
} catch (cleanupError) {
|
|
311
|
+
throw new AggregateError(
|
|
312
|
+
[error, cleanupError],
|
|
313
|
+
'Detached agent client setup and cleanup failed',
|
|
314
|
+
);
|
|
284
315
|
}
|
|
285
316
|
throw error;
|
|
286
317
|
}
|
package/src/config/config.ts
CHANGED
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
loadServerHierarchicalMemory,
|
|
25
25
|
loadJitSubdirectoryMemory,
|
|
26
26
|
} from '../utils/memoryDiscovery.js';
|
|
27
|
-
import { DEFAULT_GEMINI_FLASH_MODEL } from './models.js';
|
|
28
27
|
import { IdeClient } from '@vybestack/llxprt-code-ide-integration';
|
|
29
28
|
import { ideContext } from '@vybestack/llxprt-code-ide-integration';
|
|
30
29
|
import {
|
|
@@ -38,10 +37,9 @@ import { ConfigBase } from './configBase.js';
|
|
|
38
37
|
import {
|
|
39
38
|
buildNewContentGeneratorConfig,
|
|
40
39
|
createDetachedAgentClient,
|
|
41
|
-
disposePreviousAgentClient,
|
|
42
40
|
extractExistingState,
|
|
41
|
+
prepareAgentClientReplacement,
|
|
43
42
|
requireAgentClientFactory,
|
|
44
|
-
transferHistoryToNewClient,
|
|
45
43
|
} from './agentClientLifecycle.js';
|
|
46
44
|
import { syncActivateMcpServerTool } from './mcp-lazy-tool-sync.js';
|
|
47
45
|
import { syncSkillActivationTool } from './skill-tool-sync.js';
|
|
@@ -81,7 +79,7 @@ export {
|
|
|
81
79
|
normalizeShellReplacement,
|
|
82
80
|
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
|
|
83
81
|
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
|
|
84
|
-
MCPServerConfig,
|
|
82
|
+
type MCPServerConfig,
|
|
85
83
|
AuthProviderType,
|
|
86
84
|
type SandboxConfig,
|
|
87
85
|
type ActiveExtension,
|
|
@@ -253,7 +251,7 @@ export class Config extends ConfigBase {
|
|
|
253
251
|
// @requirement REQ-INV-001
|
|
254
252
|
this.agentClient = clientFactory(this, this.runtimeState);
|
|
255
253
|
|
|
256
|
-
if (this.
|
|
254
|
+
if (this.isJitContextEnabled()) {
|
|
257
255
|
this.contextManager = new ContextManager(this);
|
|
258
256
|
await this.contextManager.refresh();
|
|
259
257
|
}
|
|
@@ -278,8 +276,8 @@ export class Config extends ConfigBase {
|
|
|
278
276
|
* from the session's primary agent client and with its tool set cleared.
|
|
279
277
|
* Used for one-shot operations such as subagent auto-prompt generation.
|
|
280
278
|
*/
|
|
281
|
-
createDetachedAgentClient(
|
|
282
|
-
return createDetachedAgentClient(this,
|
|
279
|
+
async createDetachedAgentClient(id?: string): Promise<AgentClientContract> {
|
|
280
|
+
return createDetachedAgentClient(this, id);
|
|
283
281
|
}
|
|
284
282
|
|
|
285
283
|
private registerSubagents(): void {
|
|
@@ -336,20 +334,18 @@ export class Config extends ConfigBase {
|
|
|
336
334
|
);
|
|
337
335
|
const newAgentClient = clientFactory(this, this.runtimeState);
|
|
338
336
|
|
|
339
|
-
|
|
337
|
+
await prepareAgentClientReplacement(
|
|
340
338
|
logger,
|
|
341
339
|
newAgentClient,
|
|
340
|
+
previousAgentClient,
|
|
342
341
|
existingHistory,
|
|
343
342
|
existingHistoryService,
|
|
344
343
|
newContentGeneratorConfig,
|
|
345
344
|
this.getContentGeneratorConfig()?.vertexai,
|
|
346
345
|
);
|
|
347
|
-
|
|
348
|
-
await newAgentClient.initialize(newContentGeneratorConfig);
|
|
349
346
|
logger.debug('New client initialized');
|
|
350
347
|
|
|
351
348
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
352
|
-
disposePreviousAgentClient(logger, previousAgentClient);
|
|
353
349
|
this.agentClient = newAgentClient;
|
|
354
350
|
|
|
355
351
|
const newHistory = await this.agentClient.getHistory();
|
|
@@ -517,7 +513,7 @@ export class Config extends ConfigBase {
|
|
|
517
513
|
}
|
|
518
514
|
|
|
519
515
|
getUserMemory(): string {
|
|
520
|
-
if (this.
|
|
516
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
521
517
|
return [
|
|
522
518
|
this.contextManager.getGlobalMemory(),
|
|
523
519
|
this.contextManager.getEnvironmentMemory(),
|
|
@@ -695,22 +691,13 @@ export class Config extends ConfigBase {
|
|
|
695
691
|
};
|
|
696
692
|
}
|
|
697
693
|
|
|
698
|
-
getJitContextEnabled(): boolean {
|
|
699
|
-
// Check settings service first, then fall back to instance value
|
|
700
|
-
const settingsValue = this.settingsService.get('jitContextEnabled');
|
|
701
|
-
if (settingsValue !== undefined) {
|
|
702
|
-
return settingsValue as boolean;
|
|
703
|
-
}
|
|
704
|
-
return this.jitContextEnabled ?? false;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
694
|
/**
|
|
708
695
|
* Lazily loads JIT subdirectory memory for a given path.
|
|
709
696
|
* Returns formatted memory content from LLXPRT.md files found between
|
|
710
697
|
* the target path and the trusted root, excluding already-loaded paths.
|
|
711
698
|
*/
|
|
712
699
|
async getJitMemoryForPath(targetPath: string): Promise<string> {
|
|
713
|
-
if (!this.
|
|
700
|
+
if (!this.isJitContextEnabled()) {
|
|
714
701
|
return '';
|
|
715
702
|
}
|
|
716
703
|
|
|
@@ -805,7 +792,7 @@ export class Config extends ConfigBase {
|
|
|
805
792
|
fileCount: number;
|
|
806
793
|
filePaths: string[];
|
|
807
794
|
}> {
|
|
808
|
-
if (this.
|
|
795
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
809
796
|
await this.contextManager.refresh();
|
|
810
797
|
const memoryContent = this.getUserMemory();
|
|
811
798
|
const fileCount = this.getLlxprtMdFileCount();
|
|
@@ -979,7 +966,7 @@ export class Config extends ConfigBase {
|
|
|
979
966
|
const client = this.agentClient as AgentClientContract | undefined;
|
|
980
967
|
if (client !== undefined) {
|
|
981
968
|
try {
|
|
982
|
-
client.dispose();
|
|
969
|
+
await client.dispose();
|
|
983
970
|
} catch (error) {
|
|
984
971
|
failures.push(error);
|
|
985
972
|
}
|
|
@@ -1026,5 +1013,3 @@ function throwFailures(failures: unknown[]): void {
|
|
|
1026
1013
|
|
|
1027
1014
|
// Re-export scheduler types for external use
|
|
1028
1015
|
export { type SchedulerCallbacks, type SchedulerOptions };
|
|
1029
|
-
// Export model constants for use in CLI
|
|
1030
|
-
export { DEFAULT_GEMINI_FLASH_MODEL };
|
package/src/config/configBase.ts
CHANGED
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
export abstract class ConfigBase extends ConfigBaseCore {
|
|
35
35
|
// Abstract methods implemented by Config subclass
|
|
36
36
|
abstract initializeContentGeneratorConfig: () => Promise<void>;
|
|
37
|
-
abstract getJitContextEnabled(): boolean;
|
|
38
37
|
abstract getExcludeTools(): string[] | undefined;
|
|
39
38
|
abstract getAsyncTaskManager(): AsyncTaskManager | undefined;
|
|
40
39
|
abstract getShellJobManager(): ShellJobManager | undefined;
|
|
@@ -100,42 +99,42 @@ export abstract class ConfigBase extends ConfigBaseCore {
|
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
getGlobalMemory(): string {
|
|
103
|
-
if (this.
|
|
102
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
104
103
|
return this.contextManager.getGlobalMemory();
|
|
105
104
|
}
|
|
106
105
|
return this.userMemory;
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
getEnvironmentMemory(): string {
|
|
110
|
-
if (this.
|
|
109
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
111
110
|
return this.contextManager.getEnvironmentMemory();
|
|
112
111
|
}
|
|
113
112
|
return '';
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
getCoreMemory(): string | undefined {
|
|
117
|
-
if (this.
|
|
116
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
118
117
|
return this.contextManager.getCoreMemory();
|
|
119
118
|
}
|
|
120
119
|
return undefined;
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
getLlxprtMdFileCount(): number {
|
|
124
|
-
if (this.
|
|
123
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
125
124
|
return this.contextManager.getContextFileCount();
|
|
126
125
|
}
|
|
127
126
|
return this.llxprtMdFileCount;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
getCoreMemoryFileCount(): number {
|
|
131
|
-
if (this.
|
|
130
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
132
131
|
return this.contextManager.getCoreMemoryFileCount();
|
|
133
132
|
}
|
|
134
133
|
return 0;
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
getLlxprtMdFilePaths(): string[] {
|
|
138
|
-
if (this.
|
|
137
|
+
if (this.isJitContextEnabled() && this.contextManager) {
|
|
139
138
|
return Array.from(this.contextManager.getLoadedPaths());
|
|
140
139
|
}
|
|
141
140
|
return this.llxprtMdFilePaths;
|
|
@@ -224,6 +223,46 @@ export abstract class ConfigBase extends ConfigBaseCore {
|
|
|
224
223
|
return rawValue;
|
|
225
224
|
}
|
|
226
225
|
|
|
226
|
+
private resolveByteLimit(key: string, defaultValue: number): number {
|
|
227
|
+
const value = this.getEphemeralSetting(key) ?? defaultValue;
|
|
228
|
+
if (
|
|
229
|
+
typeof value !== 'number' ||
|
|
230
|
+
!Number.isSafeInteger(value) ||
|
|
231
|
+
value < 0
|
|
232
|
+
) {
|
|
233
|
+
throw new Error(`${key} must be a non-negative safe integer`);
|
|
234
|
+
}
|
|
235
|
+
return value;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
override getImagePayloadBudgetBytes(): number {
|
|
239
|
+
return this.resolveByteLimit(
|
|
240
|
+
'image-payload-budget-bytes',
|
|
241
|
+
this.imagePayloadBudgetBytes,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
override getMediaStoreQuotaByteLimit(): number {
|
|
246
|
+
return this.resolveByteLimit(
|
|
247
|
+
'media-store-quota-bytes',
|
|
248
|
+
super.getMediaStoreQuotaByteLimit(),
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
override getSessionRecordingQueueByteLimit(): number {
|
|
253
|
+
return this.resolveByteLimit(
|
|
254
|
+
'session-recording-queue-max-bytes',
|
|
255
|
+
super.getSessionRecordingQueueByteLimit(),
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
override getSessionPersistenceQueueByteLimit(): number {
|
|
260
|
+
return this.resolveByteLimit(
|
|
261
|
+
'session-persistence-queue-max-bytes',
|
|
262
|
+
super.getSessionPersistenceQueueByteLimit(),
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
227
266
|
setEphemeralSetting(key: string, value: unknown): void {
|
|
228
267
|
let settingValue = value;
|
|
229
268
|
if (key === 'streaming') {
|