@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
package/src/recording/types.ts
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { type IContent } from '../services/history/IContent.js';
|
|
27
|
+
import type { LocalMediaStore } from '../storage/local-media-store.js';
|
|
27
28
|
|
|
28
29
|
export const SESSION_TITLE_MAX_LENGTH = 120;
|
|
29
30
|
|
|
@@ -52,7 +53,8 @@ export type SessionEventType =
|
|
|
52
53
|
| 'checkpoint_renamed'
|
|
53
54
|
| 'checkpoint_deleted'
|
|
54
55
|
| 'session_forked'
|
|
55
|
-
| 'session_named'
|
|
56
|
+
| 'session_named'
|
|
57
|
+
| 'semantic_media_purge';
|
|
56
58
|
|
|
57
59
|
// ---------------------------------------------------------------------------
|
|
58
60
|
// Event envelope
|
|
@@ -113,11 +115,28 @@ export interface CompressedPayload {
|
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
|
-
* Payload for the `rewind` event — removes the
|
|
118
|
+
* Payload for the `rewind` event — removes the tail of history from the cut
|
|
119
|
+
* point onwards.
|
|
117
120
|
*/
|
|
118
121
|
export interface RewindPayload {
|
|
119
122
|
/** Positive integer — number of items removed from the end of history. */
|
|
120
123
|
itemsRemoved: number;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Chronology `seq` of the FIRST removed item, when that item carried a
|
|
127
|
+
* chronology marker (#1721). Replay cuts at the item whose marker `seq`
|
|
128
|
+
* EQUALS this value, which stays correct even when live history and the
|
|
129
|
+
* journal have diverged — density optimization removes items from live
|
|
130
|
+
* history without journalling anything, so `itemsRemoved` alone removes the
|
|
131
|
+
* wrong amount on replay.
|
|
132
|
+
*
|
|
133
|
+
* Absent on legacy events and whenever the cut item has no marker. Replay
|
|
134
|
+
* falls back to `itemsRemoved` whenever it is absent, unreadable, or names
|
|
135
|
+
* an item that is not in the replayed history.
|
|
136
|
+
*
|
|
137
|
+
* @issue #2934
|
|
138
|
+
*/
|
|
139
|
+
cutSeq?: number;
|
|
121
140
|
}
|
|
122
141
|
|
|
123
142
|
/**
|
|
@@ -157,6 +176,14 @@ export interface DirectoriesChangedPayload {
|
|
|
157
176
|
directories: string[];
|
|
158
177
|
}
|
|
159
178
|
|
|
179
|
+
export interface SemanticMediaPurgePayload {
|
|
180
|
+
readonly history: readonly IContent[];
|
|
181
|
+
readonly frontier: {
|
|
182
|
+
readonly contentIndex: number;
|
|
183
|
+
readonly blockIndex: number;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
160
187
|
// ---------------------------------------------------------------------------
|
|
161
188
|
// Checkpoint and session-branching metadata event payloads.
|
|
162
189
|
//
|
|
@@ -243,6 +270,10 @@ export interface SessionRecordingServiceConfig {
|
|
|
243
270
|
cwd?: string;
|
|
244
271
|
provider: string;
|
|
245
272
|
model: string;
|
|
273
|
+
/** Hard bound for serialized records waiting for durable write. */
|
|
274
|
+
maxQueueBytes?: number;
|
|
275
|
+
/** Project-owned store used to verify referenced media during lifecycle replay. */
|
|
276
|
+
mediaStore?: LocalMediaStore;
|
|
246
277
|
}
|
|
247
278
|
|
|
248
279
|
// ---------------------------------------------------------------------------
|
|
@@ -294,6 +325,10 @@ export type ReplayResult =
|
|
|
294
325
|
sessionName?: string | null;
|
|
295
326
|
/** Self-contained child ancestry from the `session_forked` event. */
|
|
296
327
|
ancestry?: SessionForkedPayload;
|
|
328
|
+
readonly semanticMediaPurgeFrontier?: {
|
|
329
|
+
readonly contentIndex: number;
|
|
330
|
+
readonly blockIndex: number;
|
|
331
|
+
};
|
|
297
332
|
}
|
|
298
333
|
| {
|
|
299
334
|
ok: false;
|
|
@@ -77,6 +77,7 @@ export interface ReadonlySettingsSnapshot {
|
|
|
77
77
|
* to catch omissions in the summary. Defaults to false.
|
|
78
78
|
*/
|
|
79
79
|
compressionVerification?: boolean;
|
|
80
|
+
'media.semantic-purge'?: 'off' | 'remove' | 'summary';
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
/**
|
|
@@ -228,6 +229,7 @@ export interface AgentRuntimeContext {
|
|
|
228
229
|
* to catch omissions in the summary. Defaults to false.
|
|
229
230
|
*/
|
|
230
231
|
compressionVerification(): boolean;
|
|
232
|
+
semanticMediaPurge(): 'off' | 'remove' | 'summary';
|
|
231
233
|
/**
|
|
232
234
|
* @plan PLAN-20251202-THINKING.P03b
|
|
233
235
|
* @requirement REQ-THINK-006
|
|
@@ -263,6 +265,15 @@ export interface AgentRuntimeContext {
|
|
|
263
265
|
|
|
264
266
|
/** Provider runtime snapshot for downstream provider calls */
|
|
265
267
|
readonly providerRuntime: ProviderRuntimeContext;
|
|
268
|
+
|
|
269
|
+
/** Project-owned local media store shared with session lifecycle services. */
|
|
270
|
+
readonly mediaStore?: LocalMediaStore;
|
|
271
|
+
|
|
272
|
+
/** Async boundary that replaces newly created local image bytes before use. */
|
|
273
|
+
readonly mediaAdmission?: MediaAdmissionService;
|
|
274
|
+
|
|
275
|
+
/** Provider-neutral late materialization boundary for physical requests. */
|
|
276
|
+
readonly mediaResolver?: RequestMediaResolver;
|
|
266
277
|
}
|
|
267
278
|
|
|
268
279
|
/**
|
|
@@ -294,11 +305,23 @@ export interface AgentRuntimeContextFactoryOptions {
|
|
|
294
305
|
|
|
295
306
|
/** Required: provider runtime context */
|
|
296
307
|
providerRuntime: ProviderRuntimeContext;
|
|
308
|
+
|
|
309
|
+
/** Optional project-owned local media store. */
|
|
310
|
+
mediaStore?: LocalMediaStore;
|
|
311
|
+
|
|
312
|
+
/** Optional async local-media admission boundary. */
|
|
313
|
+
mediaAdmission?: MediaAdmissionService;
|
|
314
|
+
|
|
315
|
+
/** Optional provider-neutral request media resolver. */
|
|
316
|
+
mediaResolver?: RequestMediaResolver;
|
|
297
317
|
}
|
|
298
318
|
|
|
299
319
|
// Type imports (these will be resolved from existing modules)
|
|
300
320
|
import type { AgentRuntimeState } from './AgentRuntimeState.js';
|
|
301
321
|
import type { HistoryService } from '../services/history/HistoryService.js';
|
|
322
|
+
import type { MediaAdmissionService } from '../storage/media-admission-service.js';
|
|
323
|
+
import type { LocalMediaStore } from '../storage/local-media-store.js';
|
|
324
|
+
import type { RequestMediaResolver } from '../storage/request-media-resolver.js';
|
|
302
325
|
import type { RuntimeProvider as IProvider } from './contracts/RuntimeProvider.js';
|
|
303
326
|
import type { ProviderRuntimeContext } from './providerRuntimeContext.js';
|
|
304
327
|
|
|
@@ -309,12 +332,12 @@ import type { ProviderRuntimeContext } from './providerRuntimeContext.js';
|
|
|
309
332
|
* compatible objects.
|
|
310
333
|
*/
|
|
311
334
|
export interface RuntimeUsageMetadata {
|
|
312
|
-
|
|
313
|
-
|
|
335
|
+
inputTokenCount?: number;
|
|
336
|
+
outputTokenCount?: number;
|
|
314
337
|
totalTokenCount?: number;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
338
|
+
cachedTokenCount?: number;
|
|
339
|
+
thinkingTokenCount?: number;
|
|
340
|
+
toolUseInputTokenCount?: number;
|
|
318
341
|
[key: string]: unknown;
|
|
319
342
|
}
|
|
320
343
|
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { HistoryService } from '../services/history/HistoryService.js';
|
|
8
|
+
import { createHistoryProviderFileBindingStore } from '../services/history/provider-file-binding.js';
|
|
8
9
|
import type { Config } from '../config/config.js';
|
|
10
|
+
import type { LocalMediaStore } from '../storage/local-media-store.js';
|
|
11
|
+
import { MediaAdmissionService } from '../storage/media-admission-service.js';
|
|
12
|
+
import { RequestMediaResolver } from '../storage/request-media-resolver.js';
|
|
9
13
|
import {
|
|
10
14
|
hasToolSchema,
|
|
11
15
|
resolveToolDescription,
|
|
@@ -48,6 +52,9 @@ export interface AgentRuntimeLoaderOverrides {
|
|
|
48
52
|
telemetryAdapter?: AgentRuntimeTelemetryAdapter;
|
|
49
53
|
toolsView?: ToolRegistryView;
|
|
50
54
|
historyService?: HistoryService;
|
|
55
|
+
mediaStore?: LocalMediaStore;
|
|
56
|
+
mediaAdmission?: MediaAdmissionService;
|
|
57
|
+
mediaResolver?: RequestMediaResolver;
|
|
51
58
|
contentGenerator?: ContentGenerator;
|
|
52
59
|
contentGeneratorFactory?: ContentGeneratorFactory;
|
|
53
60
|
}
|
|
@@ -196,16 +203,18 @@ function createFilteredToolRegistryView(
|
|
|
196
203
|
};
|
|
197
204
|
}
|
|
198
205
|
|
|
206
|
+
function throwIfAborted(signal: AbortSignal | undefined): void {
|
|
207
|
+
if (signal?.aborted !== true) return;
|
|
208
|
+
const error = new Error('Runtime load aborted');
|
|
209
|
+
error.name = 'AbortError';
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
|
|
199
213
|
export async function loadAgentRuntime(
|
|
200
214
|
options: AgentRuntimeLoaderOptions,
|
|
201
215
|
): Promise<AgentRuntimeLoaderResult> {
|
|
202
216
|
const { profile, overrides = {}, signal } = options;
|
|
203
|
-
|
|
204
|
-
if (signal?.aborted === true) {
|
|
205
|
-
const error = new Error('Runtime load aborted');
|
|
206
|
-
error.name = 'AbortError';
|
|
207
|
-
throw error;
|
|
208
|
-
}
|
|
217
|
+
throwIfAborted(signal);
|
|
209
218
|
|
|
210
219
|
const history = overrides.historyService ?? new HistoryService();
|
|
211
220
|
|
|
@@ -226,6 +235,13 @@ export async function loadAgentRuntime(
|
|
|
226
235
|
profile.toolRegistry ?? profile.config.getToolRegistry(),
|
|
227
236
|
governance,
|
|
228
237
|
);
|
|
238
|
+
const mediaStore =
|
|
239
|
+
overrides.mediaStore ?? profile.config.getLocalMediaStore();
|
|
240
|
+
const mediaAdmission =
|
|
241
|
+
overrides.mediaAdmission ?? new MediaAdmissionService(mediaStore);
|
|
242
|
+
const mediaResolver =
|
|
243
|
+
overrides.mediaResolver ?? new RequestMediaResolver(mediaStore);
|
|
244
|
+
const requestMediaBudgetBytes = profile.config.getImagePayloadBudgetBytes();
|
|
229
245
|
|
|
230
246
|
const runtimeContext = createAgentRuntimeContext({
|
|
231
247
|
state: profile.state,
|
|
@@ -234,9 +250,18 @@ export async function loadAgentRuntime(
|
|
|
234
250
|
telemetry: telemetryAdapter,
|
|
235
251
|
tools: toolsView,
|
|
236
252
|
history,
|
|
237
|
-
providerRuntime:
|
|
253
|
+
providerRuntime: {
|
|
254
|
+
...profile.providerRuntime,
|
|
255
|
+
mediaResolver,
|
|
256
|
+
requestMediaBudgetBytes,
|
|
257
|
+
providerFileBindings: createHistoryProviderFileBindingStore(history),
|
|
258
|
+
},
|
|
259
|
+
mediaStore,
|
|
260
|
+
mediaAdmission,
|
|
261
|
+
mediaResolver,
|
|
238
262
|
});
|
|
239
263
|
|
|
264
|
+
await history.settleMediaOwnership();
|
|
240
265
|
let contentGenerator: ContentGenerator;
|
|
241
266
|
if (overrides.contentGenerator) {
|
|
242
267
|
contentGenerator = overrides.contentGenerator;
|
|
@@ -47,6 +47,7 @@ export interface PromptEnvelopeProjection {
|
|
|
47
47
|
readonly finalizedProjection: unknown;
|
|
48
48
|
readonly legacyEstimate: () => Promise<number>;
|
|
49
49
|
readonly accounting?: PromptEnvelopeAccountingProjection;
|
|
50
|
+
readonly releaseIfUnsent?: () => Promise<void>;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export interface PromptEnvelopeEstimate {
|
|
@@ -66,6 +66,9 @@ export interface RuntimeProvider {
|
|
|
66
66
|
isPaidMode?(): boolean;
|
|
67
67
|
getModelParams?(): Record<string, unknown> | undefined;
|
|
68
68
|
getContextLimit?(): number | undefined;
|
|
69
|
+
getMediaTransportCapabilities?(): {
|
|
70
|
+
readonly explicitCacheBreakpoints: boolean;
|
|
71
|
+
};
|
|
69
72
|
clearAuthCache?(): void;
|
|
70
73
|
clearAuth?(): void;
|
|
71
74
|
|
|
@@ -78,14 +81,6 @@ export interface RuntimeProvider {
|
|
|
78
81
|
| null,
|
|
79
82
|
): void;
|
|
80
83
|
|
|
81
|
-
getServerTools(): string[];
|
|
82
|
-
invokeServerTool(
|
|
83
|
-
toolName: string,
|
|
84
|
-
params: unknown,
|
|
85
|
-
config?: unknown,
|
|
86
|
-
signal?: AbortSignal,
|
|
87
|
-
): Promise<unknown>;
|
|
88
|
-
|
|
89
84
|
generateChatCompletion(
|
|
90
85
|
options: RuntimeGenerateChatOptions,
|
|
91
86
|
): AsyncIterableIterator<IContent>;
|
|
@@ -60,8 +60,6 @@ export interface RuntimeProviderManager {
|
|
|
60
60
|
prepareStatelessProviderInvocation?(runtimeContext?: unknown): unknown;
|
|
61
61
|
getProviderMetrics(): RuntimeProviderMetrics;
|
|
62
62
|
getSessionTokenUsage(): RuntimeSessionTokenUsage;
|
|
63
|
-
getServerToolsProvider(): RuntimeProvider | null | undefined;
|
|
64
|
-
setServerToolsProvider(provider: RuntimeProvider | null): void;
|
|
65
63
|
setConfig(config: Config): void;
|
|
66
64
|
setRuntimeContext(runtimeContext: ProviderRuntimeContext): void;
|
|
67
65
|
hasActiveProvider(): boolean;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { HistoryService } from '../services/history/HistoryService.js';
|
|
16
|
+
import { HistoryMediaOwnership } from '../storage/history-media-ownership.js';
|
|
16
17
|
import type {
|
|
17
18
|
AgentRuntimeContext,
|
|
18
19
|
AgentRuntimeContextFactoryOptions,
|
|
@@ -25,7 +26,10 @@ import {
|
|
|
25
26
|
resolveProviderReportedLimit,
|
|
26
27
|
} from '../core/tokenLimits.js';
|
|
27
28
|
/** @plan PLAN-20260211-COMPRESSION.P12 */
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
getSettingSpec,
|
|
31
|
+
validateSetting,
|
|
32
|
+
} from '@vybestack/llxprt-code-settings';
|
|
29
33
|
|
|
30
34
|
const EPHEMERAL_DEFAULTS = {
|
|
31
35
|
compressionThreshold: 0.85,
|
|
@@ -123,6 +127,30 @@ function resolveProviderContextLimit(
|
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
129
|
|
|
130
|
+
function resolveSemanticMediaPurgeSetting(
|
|
131
|
+
getLiveSetting: ReturnType<typeof createGetLiveSetting>,
|
|
132
|
+
options: AgentRuntimeContextFactoryOptions,
|
|
133
|
+
): 'off' | 'remove' | 'summary' {
|
|
134
|
+
const value = getLiveSetting<unknown>(
|
|
135
|
+
'media.semantic-purge',
|
|
136
|
+
options.settings['media.semantic-purge'],
|
|
137
|
+
);
|
|
138
|
+
const validation = validateSetting('media.semantic-purge', value ?? 'off');
|
|
139
|
+
if (!validation.success) {
|
|
140
|
+
throw new Error(
|
|
141
|
+
"Invalid media.semantic-purge setting: expected 'off', 'remove', or 'summary'",
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
if (
|
|
145
|
+
validation.value === 'off' ||
|
|
146
|
+
validation.value === 'remove' ||
|
|
147
|
+
validation.value === 'summary'
|
|
148
|
+
) {
|
|
149
|
+
return validation.value;
|
|
150
|
+
}
|
|
151
|
+
throw new Error('Semantic media purge validator returned an invalid value');
|
|
152
|
+
}
|
|
153
|
+
|
|
126
154
|
/**
|
|
127
155
|
* Build compression-related ephemeral accessors.
|
|
128
156
|
*/
|
|
@@ -188,6 +216,8 @@ function buildCompressionEphemerals(
|
|
|
188
216
|
);
|
|
189
217
|
return typeof value === 'boolean' ? value : false;
|
|
190
218
|
},
|
|
219
|
+
semanticMediaPurge: (): 'off' | 'remove' | 'summary' =>
|
|
220
|
+
resolveSemanticMediaPurgeSetting(getLiveSetting, options),
|
|
191
221
|
};
|
|
192
222
|
}
|
|
193
223
|
|
|
@@ -328,6 +358,9 @@ export function createAgentRuntimeContext(
|
|
|
328
358
|
validateRequiredOptions(options);
|
|
329
359
|
|
|
330
360
|
const history = options.history ?? new HistoryService();
|
|
361
|
+
if (options.mediaStore !== undefined) {
|
|
362
|
+
history.registerMediaOwner(new HistoryMediaOwnership(options.mediaStore));
|
|
363
|
+
}
|
|
331
364
|
|
|
332
365
|
const getLiveSetting = createGetLiveSetting(options);
|
|
333
366
|
|
|
@@ -351,6 +384,15 @@ export function createAgentRuntimeContext(
|
|
|
351
384
|
provider: options.provider,
|
|
352
385
|
tools: options.tools,
|
|
353
386
|
providerRuntime,
|
|
387
|
+
...(options.mediaStore === undefined
|
|
388
|
+
? {}
|
|
389
|
+
: { mediaStore: options.mediaStore }),
|
|
390
|
+
...(options.mediaAdmission === undefined
|
|
391
|
+
? {}
|
|
392
|
+
: { mediaAdmission: options.mediaAdmission }),
|
|
393
|
+
...(options.mediaResolver === undefined
|
|
394
|
+
? {}
|
|
395
|
+
: { mediaResolver: options.mediaResolver }),
|
|
354
396
|
};
|
|
355
397
|
|
|
356
398
|
return Object.freeze(context);
|
|
@@ -20,6 +20,19 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import type { Config } from '../config/config.js';
|
|
22
22
|
import { MissingRuntimeProviderError } from './errors/MissingRuntimeProviderError.js';
|
|
23
|
+
import type { RequestMediaResolutionService } from '../storage/request-media-resolver.js';
|
|
24
|
+
import type { ProviderFileReferenceMetadata } from '../services/history/IContent.js';
|
|
25
|
+
|
|
26
|
+
export interface ProviderFileBindingStore {
|
|
27
|
+
bind(
|
|
28
|
+
contentId: string,
|
|
29
|
+
reference: ProviderFileReferenceMetadata,
|
|
30
|
+
): Promise<void>;
|
|
31
|
+
unbind(
|
|
32
|
+
contentId: string,
|
|
33
|
+
reference: ProviderFileReferenceMetadata,
|
|
34
|
+
): Promise<void>;
|
|
35
|
+
}
|
|
23
36
|
|
|
24
37
|
export interface RuntimeSettingsState {
|
|
25
38
|
get(key: string): unknown;
|
|
@@ -48,6 +61,9 @@ export interface ProviderRuntimeContext {
|
|
|
48
61
|
config?: Config;
|
|
49
62
|
runtimeId?: string;
|
|
50
63
|
metadata?: Record<string, unknown>;
|
|
64
|
+
mediaResolver?: RequestMediaResolutionService;
|
|
65
|
+
requestMediaBudgetBytes?: number;
|
|
66
|
+
providerFileBindings?: ProviderFileBindingStore;
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
let activeContext: ProviderRuntimeContext | null = null;
|
|
@@ -63,6 +79,9 @@ export interface ProviderRuntimeContextInit {
|
|
|
63
79
|
config?: Config;
|
|
64
80
|
runtimeId?: string;
|
|
65
81
|
metadata?: Record<string, unknown>;
|
|
82
|
+
mediaResolver?: RequestMediaResolutionService;
|
|
83
|
+
requestMediaBudgetBytes?: number;
|
|
84
|
+
providerFileBindings?: ProviderFileBindingStore;
|
|
66
85
|
}
|
|
67
86
|
|
|
68
87
|
/**
|
|
@@ -112,6 +131,9 @@ export function createProviderRuntimeContext(
|
|
|
112
131
|
config: init.config,
|
|
113
132
|
runtimeId: init.runtimeId,
|
|
114
133
|
metadata: init.metadata,
|
|
134
|
+
mediaResolver: init.mediaResolver,
|
|
135
|
+
requestMediaBudgetBytes: init.requestMediaBudgetBytes,
|
|
136
|
+
providerFileBindings: init.providerFileBindings,
|
|
115
137
|
};
|
|
116
138
|
}
|
|
117
139
|
|
|
@@ -91,8 +91,8 @@ export function createTelemetryAdapterFromConfig(
|
|
|
91
91
|
event.usageMetadata ??
|
|
92
92
|
(event.usage !== undefined
|
|
93
93
|
? {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
inputTokenCount: event.usage.inputTokens,
|
|
95
|
+
outputTokenCount: event.usage.outputTokens,
|
|
96
96
|
totalTokenCount: event.usage.totalTokens,
|
|
97
97
|
}
|
|
98
98
|
: undefined);
|
|
@@ -114,14 +114,18 @@ export class ContentConverters {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Gemini-shaped encoding of a failed tool response (issue #3076).
|
|
118
118
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
119
|
+
* ContentConverters is the hook-wire converter: hook responses arrive as
|
|
120
|
+
* Gemini-shaped parts and are decoded to IContent via toIContent, while
|
|
121
|
+
* history writes encode symmetrically back. This outbound encoding turns a
|
|
122
|
+
* `tool_response` into that Gemini `functionResponse` shape so an
|
|
123
|
+
* IContent → Gemini → IContent round trip restores the failure verbatim. The
|
|
124
|
+
* matching inbound decoder (decodeFailureEnvelope) exists so the Gemini-shaped
|
|
125
|
+
* representation stays symmetric and lossless as #3076 requires. The part
|
|
126
|
+
* carries the `llxprtToolFailure` flag so a successful tool whose result
|
|
127
|
+
* merely happens to be shaped like `{ status: 'error', ... }` is never
|
|
128
|
+
* misdecoded.
|
|
125
129
|
*
|
|
126
130
|
* The legacy representation carries `callId`, `toolName`, `result` and the
|
|
127
131
|
* `error` marker and nothing else: `isComplete` and `providerMetadata` are
|