@framers/agentos 0.1.112 → 0.1.114
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/README.md +39 -5
- package/dist/api/AgentOS.d.ts +45 -12
- package/dist/api/AgentOS.d.ts.map +1 -1
- package/dist/api/AgentOS.js +225 -78
- package/dist/api/AgentOS.js.map +1 -1
- package/dist/api/AgentOSOrchestrator.d.ts +8 -0
- package/dist/api/AgentOSOrchestrator.d.ts.map +1 -1
- package/dist/api/AgentOSOrchestrator.js +350 -59
- package/dist/api/AgentOSOrchestrator.js.map +1 -1
- package/dist/api/StreamChunkEmitter.d.ts.map +1 -1
- package/dist/api/StreamChunkEmitter.js +2 -0
- package/dist/api/StreamChunkEmitter.js.map +1 -1
- package/dist/api/agency.d.ts.map +1 -1
- package/dist/api/agency.js +47 -1
- package/dist/api/agency.js.map +1 -1
- package/dist/api/agent.d.ts +18 -5
- package/dist/api/agent.d.ts.map +1 -1
- package/dist/api/agent.js +48 -9
- package/dist/api/agent.js.map +1 -1
- package/dist/api/agentExport.d.ts +202 -0
- package/dist/api/agentExport.d.ts.map +1 -0
- package/dist/api/agentExport.js +323 -0
- package/dist/api/agentExport.js.map +1 -0
- package/dist/api/editImage.d.ts +119 -0
- package/dist/api/editImage.d.ts.map +1 -0
- package/dist/api/editImage.js +150 -0
- package/dist/api/editImage.js.map +1 -0
- package/dist/api/embedText.d.ts +137 -0
- package/dist/api/embedText.d.ts.map +1 -0
- package/dist/api/embedText.js +229 -0
- package/dist/api/embedText.js.map +1 -0
- package/dist/api/externalToolRegistry.d.ts +44 -0
- package/dist/api/externalToolRegistry.d.ts.map +1 -0
- package/dist/api/externalToolRegistry.js +245 -0
- package/dist/api/externalToolRegistry.js.map +1 -0
- package/dist/api/generateImage.d.ts +1 -1
- package/dist/api/generateImage.d.ts.map +1 -1
- package/dist/api/generateImage.js +17 -13
- package/dist/api/generateImage.js.map +1 -1
- package/dist/api/generateObject.d.ts +185 -0
- package/dist/api/generateObject.d.ts.map +1 -0
- package/dist/api/generateObject.js +249 -0
- package/dist/api/generateObject.js.map +1 -0
- package/dist/api/generateText.d.ts +13 -3
- package/dist/api/generateText.d.ts.map +1 -1
- package/dist/api/generateText.js +20 -5
- package/dist/api/generateText.js.map +1 -1
- package/dist/api/interfaces/IAgentOS.d.ts +29 -1
- package/dist/api/interfaces/IAgentOS.d.ts.map +1 -1
- package/dist/api/model.d.ts +7 -7
- package/dist/api/model.d.ts.map +1 -1
- package/dist/api/model.js +22 -16
- package/dist/api/model.js.map +1 -1
- package/dist/api/processRequestWithExternalTools.d.ts +26 -0
- package/dist/api/processRequestWithExternalTools.d.ts.map +1 -0
- package/dist/api/processRequestWithExternalTools.js +52 -0
- package/dist/api/processRequestWithExternalTools.js.map +1 -0
- package/dist/api/processRequestWithRegisteredTools.d.ts +56 -0
- package/dist/api/processRequestWithRegisteredTools.d.ts.map +1 -0
- package/dist/api/processRequestWithRegisteredTools.js +125 -0
- package/dist/api/processRequestWithRegisteredTools.js.map +1 -0
- package/dist/api/provider-defaults.d.ts.map +1 -1
- package/dist/api/provider-defaults.js +28 -0
- package/dist/api/provider-defaults.js.map +1 -1
- package/dist/api/resumeExternalToolRequestWithRegisteredTools.d.ts +71 -0
- package/dist/api/resumeExternalToolRequestWithRegisteredTools.d.ts.map +1 -0
- package/dist/api/resumeExternalToolRequestWithRegisteredTools.js +159 -0
- package/dist/api/resumeExternalToolRequestWithRegisteredTools.js.map +1 -0
- package/dist/api/strategies/agentGraphBuilder.d.ts +170 -0
- package/dist/api/strategies/agentGraphBuilder.d.ts.map +1 -0
- package/dist/api/strategies/agentGraphBuilder.js +299 -0
- package/dist/api/strategies/agentGraphBuilder.js.map +1 -0
- package/dist/api/strategies/debate.d.ts +12 -1
- package/dist/api/strategies/debate.d.ts.map +1 -1
- package/dist/api/strategies/debate.js +41 -5
- package/dist/api/strategies/debate.js.map +1 -1
- package/dist/api/strategies/graphCompiler.d.ts +84 -0
- package/dist/api/strategies/graphCompiler.d.ts.map +1 -0
- package/dist/api/strategies/graphCompiler.js +617 -0
- package/dist/api/strategies/graphCompiler.js.map +1 -0
- package/dist/api/strategies/hierarchical.d.ts +15 -1
- package/dist/api/strategies/hierarchical.d.ts.map +1 -1
- package/dist/api/strategies/hierarchical.js +53 -8
- package/dist/api/strategies/hierarchical.js.map +1 -1
- package/dist/api/strategies/index.d.ts +29 -4
- package/dist/api/strategies/index.d.ts.map +1 -1
- package/dist/api/strategies/index.js +28 -4
- package/dist/api/strategies/index.js.map +1 -1
- package/dist/api/strategies/parallel.d.ts +15 -4
- package/dist/api/strategies/parallel.d.ts.map +1 -1
- package/dist/api/strategies/parallel.js +53 -16
- package/dist/api/strategies/parallel.js.map +1 -1
- package/dist/api/strategies/review-loop.d.ts +15 -1
- package/dist/api/strategies/review-loop.d.ts.map +1 -1
- package/dist/api/strategies/review-loop.js +36 -10
- package/dist/api/strategies/review-loop.js.map +1 -1
- package/dist/api/strategies/sequential.d.ts +11 -1
- package/dist/api/strategies/sequential.d.ts.map +1 -1
- package/dist/api/strategies/sequential.js +39 -8
- package/dist/api/strategies/sequential.js.map +1 -1
- package/dist/api/strategies/shared.d.ts +72 -8
- package/dist/api/strategies/shared.d.ts.map +1 -1
- package/dist/api/strategies/shared.js +92 -12
- package/dist/api/strategies/shared.js.map +1 -1
- package/dist/api/streamObject.d.ts +166 -0
- package/dist/api/streamObject.d.ts.map +1 -0
- package/dist/api/streamObject.js +268 -0
- package/dist/api/streamObject.js.map +1 -0
- package/dist/api/streamText.d.ts +1 -1
- package/dist/api/streamText.d.ts.map +1 -1
- package/dist/api/streamText.js +26 -8
- package/dist/api/streamText.js.map +1 -1
- package/dist/api/toolAdapter.d.ts +44 -8
- package/dist/api/toolAdapter.d.ts.map +1 -1
- package/dist/api/toolAdapter.js +224 -45
- package/dist/api/toolAdapter.js.map +1 -1
- package/dist/api/types/AgentOSExternalToolRequest.d.ts +35 -0
- package/dist/api/types/AgentOSExternalToolRequest.d.ts.map +1 -0
- package/dist/api/types/AgentOSExternalToolRequest.js +2 -0
- package/dist/api/types/AgentOSExternalToolRequest.js.map +1 -0
- package/dist/api/types/AgentOSResponse.d.ts +25 -0
- package/dist/api/types/AgentOSResponse.d.ts.map +1 -1
- package/dist/api/types/AgentOSResponse.js +20 -0
- package/dist/api/types/AgentOSResponse.js.map +1 -1
- package/dist/api/types/AgentOSToolResult.d.ts +11 -0
- package/dist/api/types/AgentOSToolResult.d.ts.map +1 -0
- package/dist/api/types/AgentOSToolResult.js +2 -0
- package/dist/api/types/AgentOSToolResult.js.map +1 -0
- package/dist/api/types.d.ts +81 -4
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/api/upscaleImage.d.ts +92 -0
- package/dist/api/upscaleImage.d.ts.map +1 -0
- package/dist/api/upscaleImage.js +133 -0
- package/dist/api/upscaleImage.js.map +1 -0
- package/dist/api/variateImage.d.ts +102 -0
- package/dist/api/variateImage.d.ts.map +1 -0
- package/dist/api/variateImage.js +154 -0
- package/dist/api/variateImage.js.map +1 -0
- package/dist/cognitive_substrate/GMI.d.ts +16 -2
- package/dist/cognitive_substrate/GMI.d.ts.map +1 -1
- package/dist/cognitive_substrate/GMI.js +188 -56
- package/dist/cognitive_substrate/GMI.js.map +1 -1
- package/dist/cognitive_substrate/IGMI.d.ts +10 -0
- package/dist/cognitive_substrate/IGMI.d.ts.map +1 -1
- package/dist/cognitive_substrate/IGMI.js.map +1 -1
- package/dist/config/AgentOSConfig.d.ts +19 -2
- package/dist/config/AgentOSConfig.d.ts.map +1 -1
- package/dist/config/AgentOSConfig.js +46 -29
- package/dist/config/AgentOSConfig.js.map +1 -1
- package/dist/core/guardrails/IGuardrailService.d.ts +1 -1
- package/dist/core/images/IImageProvider.d.ts +93 -0
- package/dist/core/images/IImageProvider.d.ts.map +1 -1
- package/dist/core/images/IImageProvider.js.map +1 -1
- package/dist/core/images/ImageOperationError.d.ts +52 -0
- package/dist/core/images/ImageOperationError.d.ts.map +1 -0
- package/dist/core/images/ImageOperationError.js +58 -0
- package/dist/core/images/ImageOperationError.js.map +1 -0
- package/dist/core/images/imageToBuffer.d.ts +41 -0
- package/dist/core/images/imageToBuffer.d.ts.map +1 -0
- package/dist/core/images/imageToBuffer.js +95 -0
- package/dist/core/images/imageToBuffer.js.map +1 -0
- package/dist/core/images/index.d.ts +4 -0
- package/dist/core/images/index.d.ts.map +1 -1
- package/dist/core/images/index.js +8 -0
- package/dist/core/images/index.js.map +1 -1
- package/dist/core/images/providers/FalImageProvider.d.ts +208 -0
- package/dist/core/images/providers/FalImageProvider.d.ts.map +1 -0
- package/dist/core/images/providers/FalImageProvider.js +301 -0
- package/dist/core/images/providers/FalImageProvider.js.map +1 -0
- package/dist/core/images/providers/FluxImageProvider.d.ts +197 -0
- package/dist/core/images/providers/FluxImageProvider.d.ts.map +1 -0
- package/dist/core/images/providers/FluxImageProvider.js +271 -0
- package/dist/core/images/providers/FluxImageProvider.js.map +1 -0
- package/dist/core/images/providers/OpenAIImageProvider.d.ts +33 -1
- package/dist/core/images/providers/OpenAIImageProvider.d.ts.map +1 -1
- package/dist/core/images/providers/OpenAIImageProvider.js +125 -0
- package/dist/core/images/providers/OpenAIImageProvider.js.map +1 -1
- package/dist/core/images/providers/ReplicateImageProvider.d.ts +26 -1
- package/dist/core/images/providers/ReplicateImageProvider.d.ts.map +1 -1
- package/dist/core/images/providers/ReplicateImageProvider.js +118 -0
- package/dist/core/images/providers/ReplicateImageProvider.js.map +1 -1
- package/dist/core/images/providers/StabilityImageProvider.d.ts +41 -1
- package/dist/core/images/providers/StabilityImageProvider.d.ts.map +1 -1
- package/dist/core/images/providers/StabilityImageProvider.js +180 -7
- package/dist/core/images/providers/StabilityImageProvider.js.map +1 -1
- package/dist/core/images/providers/StableDiffusionLocalProvider.d.ts +29 -1
- package/dist/core/images/providers/StableDiffusionLocalProvider.d.ts.map +1 -1
- package/dist/core/images/providers/StableDiffusionLocalProvider.js +124 -0
- package/dist/core/images/providers/StableDiffusionLocalProvider.js.map +1 -1
- package/dist/core/llm/IPromptEngine.d.ts +2 -2
- package/dist/core/llm/IPromptEngine.d.ts.map +1 -1
- package/dist/core/llm/IPromptEngine.js +2 -2
- package/dist/core/llm/IPromptEngine.js.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.d.ts +7 -1
- package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.js +24 -0
- package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
- package/dist/core/llm/providers/errors/AnthropicProviderError.d.ts +42 -0
- package/dist/core/llm/providers/errors/AnthropicProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/AnthropicProviderError.js +45 -0
- package/dist/core/llm/providers/errors/AnthropicProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/GeminiProviderError.d.ts +45 -0
- package/dist/core/llm/providers/errors/GeminiProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/GeminiProviderError.js +46 -0
- package/dist/core/llm/providers/errors/GeminiProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/OllamaProviderError.d.ts +1 -1
- package/dist/core/llm/providers/errors/OllamaProviderError.d.ts.map +1 -1
- package/dist/core/llm/providers/errors/OllamaProviderError.js +1 -1
- package/dist/core/llm/providers/errors/OllamaProviderError.js.map +1 -1
- package/dist/core/llm/providers/errors/OpenAIProviderError.d.ts +1 -1
- package/dist/core/llm/providers/errors/OpenAIProviderError.js +1 -1
- package/dist/core/llm/providers/errors/OpenRouterProviderError.d.ts +1 -1
- package/dist/core/llm/providers/errors/OpenRouterProviderError.js +1 -1
- package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts +340 -0
- package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/AnthropicProvider.js +959 -0
- package/dist/core/llm/providers/implementations/AnthropicProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiProvider.d.ts +339 -0
- package/dist/core/llm/providers/implementations/GeminiProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/GeminiProvider.js +1004 -0
- package/dist/core/llm/providers/implementations/GeminiProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/GroqProvider.d.ts +105 -0
- package/dist/core/llm/providers/implementations/GroqProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/GroqProvider.js +134 -0
- package/dist/core/llm/providers/implementations/GroqProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/MistralProvider.d.ts +105 -0
- package/dist/core/llm/providers/implementations/MistralProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/MistralProvider.js +146 -0
- package/dist/core/llm/providers/implementations/MistralProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/TogetherProvider.d.ts +107 -0
- package/dist/core/llm/providers/implementations/TogetherProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/TogetherProvider.js +138 -0
- package/dist/core/llm/providers/implementations/TogetherProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/XAIProvider.d.ts +102 -0
- package/dist/core/llm/providers/implementations/XAIProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/XAIProvider.js +123 -0
- package/dist/core/llm/providers/implementations/XAIProvider.js.map +1 -0
- package/dist/core/orchestration/AgentOrchestrator.d.ts.map +1 -1
- package/dist/core/orchestration/AgentOrchestrator.js +26 -5
- package/dist/core/orchestration/AgentOrchestrator.js.map +1 -1
- package/dist/core/tools/IToolOrchestrator.d.ts +2 -2
- package/dist/core/tools/IToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolExecutor.d.ts +3 -0
- package/dist/core/tools/ToolExecutor.d.ts.map +1 -1
- package/dist/core/tools/ToolExecutor.js +2 -1
- package/dist/core/tools/ToolExecutor.js.map +1 -1
- package/dist/core/tools/ToolOrchestrator.d.ts +7 -7
- package/dist/core/tools/ToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolOrchestrator.js +135 -36
- package/dist/core/tools/ToolOrchestrator.js.map +1 -1
- package/dist/core/tools/permissions/ToolPermissionManager.d.ts +6 -5
- package/dist/core/tools/permissions/ToolPermissionManager.d.ts.map +1 -1
- package/dist/core/tools/permissions/ToolPermissionManager.js +47 -21
- package/dist/core/tools/permissions/ToolPermissionManager.js.map +1 -1
- package/dist/core/vision/VisionPipeline.d.ts +437 -0
- package/dist/core/vision/VisionPipeline.d.ts.map +1 -0
- package/dist/core/vision/VisionPipeline.js +1113 -0
- package/dist/core/vision/VisionPipeline.js.map +1 -0
- package/dist/core/vision/index.d.ts +97 -0
- package/dist/core/vision/index.d.ts.map +1 -0
- package/dist/core/vision/index.js +182 -0
- package/dist/core/vision/index.js.map +1 -0
- package/dist/core/vision/providers/LLMVisionProvider.d.ts +135 -0
- package/dist/core/vision/providers/LLMVisionProvider.d.ts.map +1 -0
- package/dist/core/vision/providers/LLMVisionProvider.js +136 -0
- package/dist/core/vision/providers/LLMVisionProvider.js.map +1 -0
- package/dist/core/vision/providers/PipelineVisionProvider.d.ts +154 -0
- package/dist/core/vision/providers/PipelineVisionProvider.d.ts.map +1 -0
- package/dist/core/vision/providers/PipelineVisionProvider.js +160 -0
- package/dist/core/vision/providers/PipelineVisionProvider.js.map +1 -0
- package/dist/core/vision/types.d.ts +286 -0
- package/dist/core/vision/types.d.ts.map +1 -0
- package/dist/core/vision/types.js +24 -0
- package/dist/core/vision/types.js.map +1 -0
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.js +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
- package/dist/emergent/ComposableToolBuilder.d.ts +15 -4
- package/dist/emergent/ComposableToolBuilder.d.ts.map +1 -1
- package/dist/emergent/ComposableToolBuilder.js +29 -14
- package/dist/emergent/ComposableToolBuilder.js.map +1 -1
- package/dist/emergent/EmergentCapabilityEngine.d.ts +3 -3
- package/dist/emergent/EmergentCapabilityEngine.d.ts.map +1 -1
- package/dist/emergent/EmergentCapabilityEngine.js +15 -12
- package/dist/emergent/EmergentCapabilityEngine.js.map +1 -1
- package/dist/emergent/EmergentJudge.d.ts +20 -0
- package/dist/emergent/EmergentJudge.d.ts.map +1 -1
- package/dist/emergent/EmergentJudge.js +121 -26
- package/dist/emergent/EmergentJudge.js.map +1 -1
- package/dist/emergent/EmergentToolRegistry.d.ts +17 -0
- package/dist/emergent/EmergentToolRegistry.d.ts.map +1 -1
- package/dist/emergent/EmergentToolRegistry.js +26 -0
- package/dist/emergent/EmergentToolRegistry.js.map +1 -1
- package/dist/emergent/ForgeToolMetaTool.d.ts +1 -1
- package/dist/emergent/ForgeToolMetaTool.d.ts.map +1 -1
- package/dist/emergent/ForgeToolMetaTool.js +15 -2
- package/dist/emergent/ForgeToolMetaTool.js.map +1 -1
- package/dist/emergent/SandboxedToolForge.d.ts +2 -2
- package/dist/emergent/SandboxedToolForge.d.ts.map +1 -1
- package/dist/emergent/SandboxedToolForge.js +13 -23
- package/dist/emergent/SandboxedToolForge.js.map +1 -1
- package/dist/emergent/SkillExporter.d.ts +119 -0
- package/dist/emergent/SkillExporter.d.ts.map +1 -0
- package/dist/emergent/SkillExporter.js +344 -0
- package/dist/emergent/SkillExporter.js.map +1 -0
- package/dist/emergent/index.d.ts +1 -0
- package/dist/emergent/index.d.ts.map +1 -1
- package/dist/emergent/index.js +1 -0
- package/dist/emergent/index.js.map +1 -1
- package/dist/emergent/types.d.ts +4 -4
- package/dist/index.d.ts +30 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/memory/facade/Memory.d.ts.map +1 -1
- package/dist/memory/facade/Memory.js +8 -0
- package/dist/memory/facade/Memory.js.map +1 -1
- package/dist/memory/facade/types.d.ts +10 -0
- package/dist/memory/facade/types.d.ts.map +1 -1
- package/dist/memory/index.d.ts +15 -7
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +7 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/ingestion/DoclingLoader.d.ts +3 -3
- package/dist/memory/ingestion/DoclingLoader.d.ts.map +1 -1
- package/dist/memory/ingestion/DoclingLoader.js +12 -8
- package/dist/memory/ingestion/DoclingLoader.js.map +1 -1
- package/dist/memory/ingestion/FolderScanner.d.ts +7 -7
- package/dist/memory/ingestion/FolderScanner.d.ts.map +1 -1
- package/dist/memory/ingestion/FolderScanner.js +6 -6
- package/dist/memory/ingestion/FolderScanner.js.map +1 -1
- package/dist/memory/ingestion/LoaderRegistry.d.ts +8 -8
- package/dist/memory/ingestion/LoaderRegistry.d.ts.map +1 -1
- package/dist/memory/ingestion/LoaderRegistry.js +9 -11
- package/dist/memory/ingestion/LoaderRegistry.js.map +1 -1
- package/dist/memory/ingestion/MultimodalAggregator.d.ts +1 -1
- package/dist/memory/ingestion/MultimodalAggregator.js +1 -1
- package/dist/memory/ingestion/OcrPdfLoader.d.ts +2 -2
- package/dist/memory/ingestion/OcrPdfLoader.d.ts.map +1 -1
- package/dist/memory/ingestion/OcrPdfLoader.js +12 -8
- package/dist/memory/ingestion/OcrPdfLoader.js.map +1 -1
- package/dist/memory/ingestion/PdfLoader.d.ts +8 -8
- package/dist/memory/ingestion/PdfLoader.d.ts.map +1 -1
- package/dist/memory/ingestion/PdfLoader.js +13 -10
- package/dist/memory/ingestion/PdfLoader.js.map +1 -1
- package/dist/memory/io/MarkdownExporter.d.ts +1 -1
- package/dist/memory/io/MarkdownExporter.d.ts.map +1 -1
- package/dist/memory/io/MarkdownExporter.js +1 -1
- package/dist/memory/io/MarkdownExporter.js.map +1 -1
- package/dist/memory/observation/MemoryObserver.d.ts +63 -1
- package/dist/memory/observation/MemoryObserver.d.ts.map +1 -1
- package/dist/memory/observation/MemoryObserver.js +115 -4
- package/dist/memory/observation/MemoryObserver.js.map +1 -1
- package/dist/memory/observation/ObservationCompressor.d.ts +88 -0
- package/dist/memory/observation/ObservationCompressor.d.ts.map +1 -0
- package/dist/memory/observation/ObservationCompressor.js +207 -0
- package/dist/memory/observation/ObservationCompressor.js.map +1 -0
- package/dist/memory/observation/ObservationReflector.d.ts +82 -0
- package/dist/memory/observation/ObservationReflector.d.ts.map +1 -0
- package/dist/memory/observation/ObservationReflector.js +212 -0
- package/dist/memory/observation/ObservationReflector.js.map +1 -0
- package/dist/memory/observation/temporal.d.ts +54 -0
- package/dist/memory/observation/temporal.d.ts.map +1 -0
- package/dist/memory/observation/temporal.js +115 -0
- package/dist/memory/observation/temporal.js.map +1 -0
- package/dist/memory/tools/MemoryAddTool.d.ts +2 -2
- package/dist/memory/tools/MemoryAddTool.d.ts.map +1 -1
- package/dist/memory/tools/MemoryAddTool.js +8 -3
- package/dist/memory/tools/MemoryAddTool.js.map +1 -1
- package/dist/memory/tools/MemorySearchTool.d.ts +3 -3
- package/dist/memory/tools/MemorySearchTool.d.ts.map +1 -1
- package/dist/memory/tools/MemorySearchTool.js +11 -9
- package/dist/memory/tools/MemorySearchTool.js.map +1 -1
- package/dist/memory/tools/scopeContext.d.ts +11 -0
- package/dist/memory/tools/scopeContext.d.ts.map +1 -0
- package/dist/memory/tools/scopeContext.js +46 -0
- package/dist/memory/tools/scopeContext.js.map +1 -0
- package/dist/orchestration/builders/AgentGraph.d.ts +12 -11
- package/dist/orchestration/builders/AgentGraph.d.ts.map +1 -1
- package/dist/orchestration/builders/AgentGraph.js +12 -11
- package/dist/orchestration/builders/AgentGraph.js.map +1 -1
- package/dist/orchestration/builders/VoiceNodeBuilder.d.ts +82 -25
- package/dist/orchestration/builders/VoiceNodeBuilder.d.ts.map +1 -1
- package/dist/orchestration/builders/VoiceNodeBuilder.js +86 -26
- package/dist/orchestration/builders/VoiceNodeBuilder.js.map +1 -1
- package/dist/orchestration/builders/WorkflowBuilder.d.ts +1 -1
- package/dist/orchestration/builders/WorkflowBuilder.d.ts.map +1 -1
- package/dist/orchestration/builders/WorkflowBuilder.js +1 -1
- package/dist/orchestration/builders/WorkflowBuilder.js.map +1 -1
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts +7 -54
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts.map +1 -1
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js +8 -56
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js.map +1 -1
- package/dist/orchestration/events/GraphEvent.d.ts +67 -5
- package/dist/orchestration/events/GraphEvent.d.ts.map +1 -1
- package/dist/orchestration/events/GraphEvent.js.map +1 -1
- package/dist/orchestration/runtime/GraphRuntime.d.ts.map +1 -1
- package/dist/orchestration/runtime/GraphRuntime.js +151 -1
- package/dist/orchestration/runtime/GraphRuntime.js.map +1 -1
- package/dist/orchestration/runtime/LoopController.d.ts +3 -3
- package/dist/orchestration/runtime/LoopController.d.ts.map +1 -1
- package/dist/orchestration/runtime/LoopController.js.map +1 -1
- package/dist/orchestration/runtime/StateManager.d.ts +3 -3
- package/dist/orchestration/runtime/StateManager.js +3 -3
- package/dist/orchestration/runtime/VoiceNodeExecutor.d.ts +103 -26
- package/dist/orchestration/runtime/VoiceNodeExecutor.d.ts.map +1 -1
- package/dist/orchestration/runtime/VoiceNodeExecutor.js +155 -43
- package/dist/orchestration/runtime/VoiceNodeExecutor.js.map +1 -1
- package/dist/orchestration/runtime/VoiceTransportAdapter.d.ts +95 -33
- package/dist/orchestration/runtime/VoiceTransportAdapter.d.ts.map +1 -1
- package/dist/orchestration/runtime/VoiceTransportAdapter.js +83 -29
- package/dist/orchestration/runtime/VoiceTransportAdapter.js.map +1 -1
- package/dist/orchestration/runtime/VoiceTurnCollector.d.ts +73 -20
- package/dist/orchestration/runtime/VoiceTurnCollector.d.ts.map +1 -1
- package/dist/orchestration/runtime/VoiceTurnCollector.js +84 -23
- package/dist/orchestration/runtime/VoiceTurnCollector.js.map +1 -1
- package/dist/query-router/KeywordFallback.d.ts +70 -0
- package/dist/query-router/KeywordFallback.d.ts.map +1 -0
- package/dist/query-router/KeywordFallback.js +132 -0
- package/dist/query-router/KeywordFallback.js.map +1 -0
- package/dist/query-router/QueryClassifier.d.ts +140 -0
- package/dist/query-router/QueryClassifier.d.ts.map +1 -0
- package/dist/query-router/QueryClassifier.js +223 -0
- package/dist/query-router/QueryClassifier.js.map +1 -0
- package/dist/query-router/QueryDispatcher.d.ts +139 -0
- package/dist/query-router/QueryDispatcher.d.ts.map +1 -0
- package/dist/query-router/QueryDispatcher.js +297 -0
- package/dist/query-router/QueryDispatcher.js.map +1 -0
- package/dist/query-router/QueryGenerator.d.ts +184 -0
- package/dist/query-router/QueryGenerator.d.ts.map +1 -0
- package/dist/query-router/QueryGenerator.js +241 -0
- package/dist/query-router/QueryGenerator.js.map +1 -0
- package/dist/query-router/QueryRouter.d.ts +292 -0
- package/dist/query-router/QueryRouter.d.ts.map +1 -0
- package/dist/query-router/QueryRouter.js +803 -0
- package/dist/query-router/QueryRouter.js.map +1 -0
- package/dist/query-router/TopicExtractor.d.ts +73 -0
- package/dist/query-router/TopicExtractor.d.ts.map +1 -0
- package/dist/query-router/TopicExtractor.js +95 -0
- package/dist/query-router/TopicExtractor.js.map +1 -0
- package/dist/query-router/index.d.ts +40 -0
- package/dist/query-router/index.d.ts.map +1 -0
- package/dist/query-router/index.js +46 -0
- package/dist/query-router/index.js.map +1 -0
- package/dist/query-router/types.d.ts +508 -0
- package/dist/query-router/types.d.ts.map +1 -0
- package/dist/query-router/types.js +39 -0
- package/dist/query-router/types.js.map +1 -0
- package/dist/rag/index.d.ts +5 -0
- package/dist/rag/index.d.ts.map +1 -1
- package/dist/rag/index.js +7 -0
- package/dist/rag/index.js.map +1 -1
- package/dist/rag/multimodal/LLMVisionAdapter.d.ts +43 -0
- package/dist/rag/multimodal/LLMVisionAdapter.d.ts.map +1 -0
- package/dist/rag/multimodal/LLMVisionAdapter.js +46 -0
- package/dist/rag/multimodal/LLMVisionAdapter.js.map +1 -0
- package/dist/rag/multimodal/MultimodalIndexer.d.ts +244 -0
- package/dist/rag/multimodal/MultimodalIndexer.d.ts.map +1 -0
- package/dist/rag/multimodal/MultimodalIndexer.js +411 -0
- package/dist/rag/multimodal/MultimodalIndexer.js.map +1 -0
- package/dist/rag/multimodal/MultimodalMemoryBridge.d.ts +448 -0
- package/dist/rag/multimodal/MultimodalMemoryBridge.d.ts.map +1 -0
- package/dist/rag/multimodal/MultimodalMemoryBridge.js +941 -0
- package/dist/rag/multimodal/MultimodalMemoryBridge.js.map +1 -0
- package/dist/rag/multimodal/SpeechProviderAdapter.d.ts +139 -0
- package/dist/rag/multimodal/SpeechProviderAdapter.d.ts.map +1 -0
- package/dist/rag/multimodal/SpeechProviderAdapter.js +143 -0
- package/dist/rag/multimodal/SpeechProviderAdapter.js.map +1 -0
- package/dist/rag/multimodal/createMultimodalIndexerFromResolver.d.ts +172 -0
- package/dist/rag/multimodal/createMultimodalIndexerFromResolver.d.ts.map +1 -0
- package/dist/rag/multimodal/createMultimodalIndexerFromResolver.js +152 -0
- package/dist/rag/multimodal/createMultimodalIndexerFromResolver.js.map +1 -0
- package/dist/rag/multimodal/index.d.ts +44 -0
- package/dist/rag/multimodal/index.d.ts.map +1 -0
- package/dist/rag/multimodal/index.js +42 -0
- package/dist/rag/multimodal/index.js.map +1 -0
- package/dist/rag/multimodal/types.d.ts +276 -0
- package/dist/rag/multimodal/types.d.ts.map +1 -0
- package/dist/rag/multimodal/types.js +26 -0
- package/dist/rag/multimodal/types.js.map +1 -0
- package/dist/social-posting/SocialPostManager.d.ts +3 -3
- package/dist/social-posting/SocialPostManager.d.ts.map +1 -1
- package/dist/social-posting/SocialPostManager.js +3 -5
- package/dist/social-posting/SocialPostManager.js.map +1 -1
- package/dist/speech/FallbackProxy.d.ts +6 -6
- package/dist/speech/FallbackProxy.d.ts.map +1 -1
- package/dist/speech/FallbackProxy.js +3 -3
- package/dist/speech/FallbackProxy.js.map +1 -1
- package/dist/speech/SpeechProviderResolver.d.ts +8 -8
- package/dist/speech/SpeechProviderResolver.d.ts.map +1 -1
- package/dist/speech/SpeechProviderResolver.js +22 -11
- package/dist/speech/SpeechProviderResolver.js.map +1 -1
- package/dist/speech/SpeechRuntime.d.ts +1 -5
- package/dist/speech/SpeechRuntime.d.ts.map +1 -1
- package/dist/speech/SpeechRuntime.js +17 -9
- package/dist/speech/SpeechRuntime.js.map +1 -1
- package/dist/speech/providers/AssemblyAISTTProvider.d.ts +4 -4
- package/dist/speech/providers/AssemblyAISTTProvider.js +4 -4
- package/dist/speech/providers/AzureSpeechTTSProvider.d.ts +3 -3
- package/dist/speech/providers/AzureSpeechTTSProvider.js +2 -2
- package/dist/speech/providers/AzureSpeechTTSProvider.js.map +1 -1
- package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts +9 -9
- package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts.map +1 -1
- package/dist/speech/providers/BuiltInAdaptiveVadProvider.js +5 -5
- package/dist/speech/providers/BuiltInAdaptiveVadProvider.js.map +1 -1
- package/dist/speech/providers/DeepgramBatchSTTProvider.d.ts +2 -2
- package/dist/speech/providers/DeepgramBatchSTTProvider.js +2 -2
- package/dist/speech/providers/OpenAITextToSpeechProvider.d.ts +3 -3
- package/dist/speech/providers/OpenAITextToSpeechProvider.js +2 -2
- package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.d.ts +1 -1
- package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.d.ts.map +1 -1
- package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.js +1 -1
- package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.js.map +1 -1
- package/dist/voice/TelephonyStreamTransport.d.ts +6 -6
- package/dist/voice/TelephonyStreamTransport.d.ts.map +1 -1
- package/dist/voice/TelephonyStreamTransport.js +5 -5
- package/dist/voice/TelephonyStreamTransport.js.map +1 -1
- package/dist/voice-pipeline/AcousticEndpointDetector.d.ts +4 -4
- package/dist/voice-pipeline/AcousticEndpointDetector.d.ts.map +1 -1
- package/dist/voice-pipeline/AcousticEndpointDetector.js +4 -4
- package/dist/voice-pipeline/AcousticEndpointDetector.js.map +1 -1
- package/dist/voice-pipeline/HardCutBargeinHandler.d.ts +3 -3
- package/dist/voice-pipeline/HardCutBargeinHandler.js +3 -3
- package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts +3 -3
- package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts.map +1 -1
- package/dist/voice-pipeline/HeuristicEndpointDetector.js +3 -3
- package/dist/voice-pipeline/HeuristicEndpointDetector.js.map +1 -1
- package/dist/voice-pipeline/SoftFadeBargeinHandler.d.ts +5 -5
- package/dist/voice-pipeline/SoftFadeBargeinHandler.js +1 -1
- package/dist/voice-pipeline/VoiceInterruptError.d.ts +6 -6
- package/dist/voice-pipeline/VoiceInterruptError.d.ts.map +1 -1
- package/dist/voice-pipeline/VoiceInterruptError.js +4 -4
- package/dist/voice-pipeline/VoiceInterruptError.js.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts +9 -9
- package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts.map +1 -1
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js +8 -8
- package/dist/voice-pipeline/VoicePipelineOrchestrator.js.map +1 -1
- package/dist/voice-pipeline/WebRTCStreamTransport.d.ts +421 -0
- package/dist/voice-pipeline/WebRTCStreamTransport.d.ts.map +1 -0
- package/dist/voice-pipeline/WebRTCStreamTransport.js +573 -0
- package/dist/voice-pipeline/WebRTCStreamTransport.js.map +1 -0
- package/dist/voice-pipeline/WebSocketStreamTransport.d.ts +8 -8
- package/dist/voice-pipeline/WebSocketStreamTransport.js +5 -5
- package/dist/voice-pipeline/index.d.ts +1 -0
- package/dist/voice-pipeline/index.d.ts.map +1 -1
- package/dist/voice-pipeline/index.js +2 -0
- package/dist/voice-pipeline/index.js.map +1 -1
- package/dist/voice-pipeline/types.d.ts +43 -43
- package/dist/voice-pipeline/types.d.ts.map +1 -1
- package/package.json +19 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/vision/providers/PipelineVisionProvider
|
|
3
|
+
*
|
|
4
|
+
* Wraps the full {@link VisionPipeline} as an {@link IVisionProvider}
|
|
5
|
+
* for seamless integration with the {@link MultimodalIndexer}.
|
|
6
|
+
*
|
|
7
|
+
* Unlike the simpler {@link LLMVisionProvider} which only calls a cloud
|
|
8
|
+
* LLM, this provider runs the complete multi-tier pipeline — local OCR,
|
|
9
|
+
* handwriting recognition, document understanding, and cloud fallback —
|
|
10
|
+
* before returning the best text description.
|
|
11
|
+
*
|
|
12
|
+
* This is the recommended provider when you want the multimodal indexer
|
|
13
|
+
* to benefit from the full progressive enhancement pipeline.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link VisionPipeline} for the underlying pipeline engine.
|
|
16
|
+
* @see {@link LLMVisionProvider} for the cloud-only alternative.
|
|
17
|
+
* @see {@link IVisionProvider} for the interface contract.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { VisionPipeline, PipelineVisionProvider } from '../../../core/vision';
|
|
22
|
+
* import { MultimodalIndexer } from '../../../rag/multimodal';
|
|
23
|
+
*
|
|
24
|
+
* const pipeline = new VisionPipeline({
|
|
25
|
+
* strategy: 'progressive',
|
|
26
|
+
* ocr: 'paddle',
|
|
27
|
+
* cloudProvider: 'openai',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const indexer = new MultimodalIndexer({
|
|
31
|
+
* embeddingManager,
|
|
32
|
+
* vectorStore,
|
|
33
|
+
* visionProvider: new PipelineVisionProvider(pipeline),
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
import type { IVisionProvider } from '../../../rag/multimodal/types.js';
|
|
38
|
+
import type { VisionPipeline } from '../VisionPipeline.js';
|
|
39
|
+
import type { VisionResult } from '../types.js';
|
|
40
|
+
/**
|
|
41
|
+
* Adapts the full {@link VisionPipeline} to the narrow
|
|
42
|
+
* {@link IVisionProvider} interface used by the multimodal indexer.
|
|
43
|
+
*
|
|
44
|
+
* The pipeline's `process()` method runs all configured tiers and returns
|
|
45
|
+
* a rich {@link VisionResult}. This adapter extracts just the text field
|
|
46
|
+
* that the indexer needs for embedding generation.
|
|
47
|
+
*
|
|
48
|
+
* For callers that need the full pipeline result (embeddings, layout,
|
|
49
|
+
* confidence, regions), use `processWithFullResult()` instead.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const provider = new PipelineVisionProvider(pipeline);
|
|
54
|
+
*
|
|
55
|
+
* // Simple: just the description text
|
|
56
|
+
* const text = await provider.describeImage(imageUrl);
|
|
57
|
+
*
|
|
58
|
+
* // Advanced: full pipeline result
|
|
59
|
+
* const result = await provider.processWithFullResult(imageBuffer);
|
|
60
|
+
* console.log(result.embedding); // CLIP vector
|
|
61
|
+
* console.log(result.layout); // Florence-2 layout
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare class PipelineVisionProvider implements IVisionProvider {
|
|
65
|
+
/**
|
|
66
|
+
* Reference to the underlying vision pipeline.
|
|
67
|
+
* Held as a readonly reference — the caller is responsible for
|
|
68
|
+
* disposing the pipeline when they're done with it.
|
|
69
|
+
*/
|
|
70
|
+
private readonly _pipeline;
|
|
71
|
+
/**
|
|
72
|
+
* Create a new pipeline vision provider.
|
|
73
|
+
*
|
|
74
|
+
* @param pipeline - An initialized {@link VisionPipeline} instance.
|
|
75
|
+
* The caller retains ownership and is responsible for calling
|
|
76
|
+
* `pipeline.dispose()` when done.
|
|
77
|
+
*
|
|
78
|
+
* @throws {Error} If pipeline is null or undefined.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const pipeline = new VisionPipeline({ strategy: 'progressive' });
|
|
83
|
+
* const provider = new PipelineVisionProvider(pipeline);
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
constructor(pipeline: VisionPipeline);
|
|
87
|
+
/**
|
|
88
|
+
* Generate a text description of the provided image by running it
|
|
89
|
+
* through the full vision pipeline.
|
|
90
|
+
*
|
|
91
|
+
* This satisfies the {@link IVisionProvider} contract. The image passes
|
|
92
|
+
* through all configured tiers (OCR, handwriting, document-ai, cloud)
|
|
93
|
+
* and the best extracted text is returned.
|
|
94
|
+
*
|
|
95
|
+
* @param image - Image as a URL string (https://... or data:image/...).
|
|
96
|
+
* @returns Text description or extracted content from the image.
|
|
97
|
+
*
|
|
98
|
+
* @throws {Error} If all pipeline tiers fail to produce output.
|
|
99
|
+
* @throws {Error} If the pipeline has been disposed.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const description = await provider.describeImage(imageUrl);
|
|
104
|
+
* console.log(description);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
describeImage(image: string): Promise<string>;
|
|
108
|
+
/**
|
|
109
|
+
* Process an image through the full pipeline and return the complete
|
|
110
|
+
* {@link VisionResult} — including embeddings, layout, confidence
|
|
111
|
+
* scores, and per-tier breakdowns.
|
|
112
|
+
*
|
|
113
|
+
* Use this when you need more than just the text description (e.g.
|
|
114
|
+
* to store the CLIP embedding alongside the text embedding in the
|
|
115
|
+
* vector store).
|
|
116
|
+
*
|
|
117
|
+
* @param image - Image data as a Buffer or URL string.
|
|
118
|
+
* @returns Full vision pipeline result.
|
|
119
|
+
*
|
|
120
|
+
* @throws {Error} If all pipeline tiers fail.
|
|
121
|
+
* @throws {Error} If the pipeline has been disposed.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const result = await provider.processWithFullResult(imageBuffer);
|
|
126
|
+
*
|
|
127
|
+
* // Use both text embedding (via indexer) and image embedding (via CLIP)
|
|
128
|
+
* if (result.embedding) {
|
|
129
|
+
* await imageVectorStore.upsert('images', [{
|
|
130
|
+
* id: docId,
|
|
131
|
+
* embedding: result.embedding,
|
|
132
|
+
* metadata: { text: result.text },
|
|
133
|
+
* }]);
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
processWithFullResult(image: Buffer | string): Promise<VisionResult>;
|
|
138
|
+
/**
|
|
139
|
+
* Get a reference to the underlying pipeline for direct access.
|
|
140
|
+
*
|
|
141
|
+
* Useful when the caller needs to invoke pipeline-specific methods
|
|
142
|
+
* like `extractText()`, `embed()`, or `analyzeLayout()` that aren't
|
|
143
|
+
* exposed through the {@link IVisionProvider} interface.
|
|
144
|
+
*
|
|
145
|
+
* @returns The underlying VisionPipeline instance.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const layout = await provider.getPipeline().analyzeLayout(image);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
getPipeline(): VisionPipeline;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=PipelineVisionProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineVisionProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/vision/providers/PipelineVisionProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAE3C;;;;;;;;;;;;;;OAcG;gBACS,QAAQ,EAAE,cAAc;IASpC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1E;;;;;;;;;;;;;OAaG;IACH,WAAW,IAAI,cAAc;CAG9B"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/vision/providers/PipelineVisionProvider
|
|
3
|
+
*
|
|
4
|
+
* Wraps the full {@link VisionPipeline} as an {@link IVisionProvider}
|
|
5
|
+
* for seamless integration with the {@link MultimodalIndexer}.
|
|
6
|
+
*
|
|
7
|
+
* Unlike the simpler {@link LLMVisionProvider} which only calls a cloud
|
|
8
|
+
* LLM, this provider runs the complete multi-tier pipeline — local OCR,
|
|
9
|
+
* handwriting recognition, document understanding, and cloud fallback —
|
|
10
|
+
* before returning the best text description.
|
|
11
|
+
*
|
|
12
|
+
* This is the recommended provider when you want the multimodal indexer
|
|
13
|
+
* to benefit from the full progressive enhancement pipeline.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link VisionPipeline} for the underlying pipeline engine.
|
|
16
|
+
* @see {@link LLMVisionProvider} for the cloud-only alternative.
|
|
17
|
+
* @see {@link IVisionProvider} for the interface contract.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { VisionPipeline, PipelineVisionProvider } from '../../../core/vision/index.js';
|
|
22
|
+
* import { MultimodalIndexer } from '../../../rag/multimodal/index.js';
|
|
23
|
+
*
|
|
24
|
+
* const pipeline = new VisionPipeline({
|
|
25
|
+
* strategy: 'progressive',
|
|
26
|
+
* ocr: 'paddle',
|
|
27
|
+
* cloudProvider: 'openai',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const indexer = new MultimodalIndexer({
|
|
31
|
+
* embeddingManager,
|
|
32
|
+
* vectorStore,
|
|
33
|
+
* visionProvider: new PipelineVisionProvider(pipeline),
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Implementation
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
/**
|
|
41
|
+
* Adapts the full {@link VisionPipeline} to the narrow
|
|
42
|
+
* {@link IVisionProvider} interface used by the multimodal indexer.
|
|
43
|
+
*
|
|
44
|
+
* The pipeline's `process()` method runs all configured tiers and returns
|
|
45
|
+
* a rich {@link VisionResult}. This adapter extracts just the text field
|
|
46
|
+
* that the indexer needs for embedding generation.
|
|
47
|
+
*
|
|
48
|
+
* For callers that need the full pipeline result (embeddings, layout,
|
|
49
|
+
* confidence, regions), use `processWithFullResult()` instead.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const provider = new PipelineVisionProvider(pipeline);
|
|
54
|
+
*
|
|
55
|
+
* // Simple: just the description text
|
|
56
|
+
* const text = await provider.describeImage(imageUrl);
|
|
57
|
+
*
|
|
58
|
+
* // Advanced: full pipeline result
|
|
59
|
+
* const result = await provider.processWithFullResult(imageBuffer);
|
|
60
|
+
* console.log(result.embedding); // CLIP vector
|
|
61
|
+
* console.log(result.layout); // Florence-2 layout
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export class PipelineVisionProvider {
|
|
65
|
+
/**
|
|
66
|
+
* Create a new pipeline vision provider.
|
|
67
|
+
*
|
|
68
|
+
* @param pipeline - An initialized {@link VisionPipeline} instance.
|
|
69
|
+
* The caller retains ownership and is responsible for calling
|
|
70
|
+
* `pipeline.dispose()` when done.
|
|
71
|
+
*
|
|
72
|
+
* @throws {Error} If pipeline is null or undefined.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const pipeline = new VisionPipeline({ strategy: 'progressive' });
|
|
77
|
+
* const provider = new PipelineVisionProvider(pipeline);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
constructor(pipeline) {
|
|
81
|
+
if (!pipeline) {
|
|
82
|
+
throw new Error('PipelineVisionProvider: pipeline instance is required.');
|
|
83
|
+
}
|
|
84
|
+
this._pipeline = pipeline;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generate a text description of the provided image by running it
|
|
88
|
+
* through the full vision pipeline.
|
|
89
|
+
*
|
|
90
|
+
* This satisfies the {@link IVisionProvider} contract. The image passes
|
|
91
|
+
* through all configured tiers (OCR, handwriting, document-ai, cloud)
|
|
92
|
+
* and the best extracted text is returned.
|
|
93
|
+
*
|
|
94
|
+
* @param image - Image as a URL string (https://... or data:image/...).
|
|
95
|
+
* @returns Text description or extracted content from the image.
|
|
96
|
+
*
|
|
97
|
+
* @throws {Error} If all pipeline tiers fail to produce output.
|
|
98
|
+
* @throws {Error} If the pipeline has been disposed.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const description = await provider.describeImage(imageUrl);
|
|
103
|
+
* console.log(description);
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
async describeImage(image) {
|
|
107
|
+
const result = await this._pipeline.process(image);
|
|
108
|
+
return result.text;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Process an image through the full pipeline and return the complete
|
|
112
|
+
* {@link VisionResult} — including embeddings, layout, confidence
|
|
113
|
+
* scores, and per-tier breakdowns.
|
|
114
|
+
*
|
|
115
|
+
* Use this when you need more than just the text description (e.g.
|
|
116
|
+
* to store the CLIP embedding alongside the text embedding in the
|
|
117
|
+
* vector store).
|
|
118
|
+
*
|
|
119
|
+
* @param image - Image data as a Buffer or URL string.
|
|
120
|
+
* @returns Full vision pipeline result.
|
|
121
|
+
*
|
|
122
|
+
* @throws {Error} If all pipeline tiers fail.
|
|
123
|
+
* @throws {Error} If the pipeline has been disposed.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const result = await provider.processWithFullResult(imageBuffer);
|
|
128
|
+
*
|
|
129
|
+
* // Use both text embedding (via indexer) and image embedding (via CLIP)
|
|
130
|
+
* if (result.embedding) {
|
|
131
|
+
* await imageVectorStore.upsert('images', [{
|
|
132
|
+
* id: docId,
|
|
133
|
+
* embedding: result.embedding,
|
|
134
|
+
* metadata: { text: result.text },
|
|
135
|
+
* }]);
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
async processWithFullResult(image) {
|
|
140
|
+
return this._pipeline.process(image);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get a reference to the underlying pipeline for direct access.
|
|
144
|
+
*
|
|
145
|
+
* Useful when the caller needs to invoke pipeline-specific methods
|
|
146
|
+
* like `extractText()`, `embed()`, or `analyzeLayout()` that aren't
|
|
147
|
+
* exposed through the {@link IVisionProvider} interface.
|
|
148
|
+
*
|
|
149
|
+
* @returns The underlying VisionPipeline instance.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const layout = await provider.getPipeline().analyzeLayout(image);
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
getPipeline() {
|
|
157
|
+
return this._pipeline;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=PipelineVisionProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineVisionProvider.js","sourceRoot":"","sources":["../../../../src/core/vision/providers/PipelineVisionProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,sBAAsB;IAQjC;;;;;;;;;;;;;;OAcG;IACH,YAAY,QAAwB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,wDAAwD,CACzD,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,qBAAqB,CAAC,KAAsB;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/vision/types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the unified vision pipeline.
|
|
5
|
+
*
|
|
6
|
+
* The vision pipeline processes images through configurable tiers — from fast,
|
|
7
|
+
* free, offline OCR (PaddleOCR / Tesseract.js) through local vision models
|
|
8
|
+
* (TrOCR, Florence-2, CLIP via HuggingFace Transformers) to cloud vision LLMs
|
|
9
|
+
* (GPT-4o, Claude, Gemini). Each tier adds progressively richer understanding
|
|
10
|
+
* at increasing cost and latency.
|
|
11
|
+
*
|
|
12
|
+
* ## Tier overview
|
|
13
|
+
*
|
|
14
|
+
* | Tier | Provider | Capability | Cost |
|
|
15
|
+
* |------|----------|-----------|------|
|
|
16
|
+
* | 1 — OCR | PaddleOCR / Tesseract.js | Printed text extraction | Free/offline |
|
|
17
|
+
* | 2 — Local Vision | TrOCR / Florence-2 / CLIP | Handwriting, layout, embeddings | Free/offline |
|
|
18
|
+
* | 3 — Cloud Vision | GPT-4o / Claude / Gemini | Scene understanding, complex docs | API cost |
|
|
19
|
+
*
|
|
20
|
+
* @see {@link VisionPipeline} for the orchestration engine.
|
|
21
|
+
* @see {@link VisionStrategy} for how tiers are combined.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Strategy for how vision tiers are combined during processing.
|
|
25
|
+
*
|
|
26
|
+
* - `'progressive'` — Try local OCR first, enhance with local vision models,
|
|
27
|
+
* upgrade with cloud only when confidence is below threshold. Best balance
|
|
28
|
+
* of cost and quality.
|
|
29
|
+
* - `'local-only'` — Tiers 1 + 2 only, never call cloud APIs. For air-gapped
|
|
30
|
+
* or privacy-sensitive environments.
|
|
31
|
+
* - `'cloud-only'` — Skip local processing entirely, send directly to cloud
|
|
32
|
+
* vision LLM. Highest quality but highest cost.
|
|
33
|
+
* - `'parallel'` — Run local and cloud simultaneously, merge the best results.
|
|
34
|
+
* Lowest latency for high-quality output when cost is not a concern.
|
|
35
|
+
*/
|
|
36
|
+
export type VisionStrategy = 'progressive' | 'local-only' | 'cloud-only' | 'parallel';
|
|
37
|
+
/**
|
|
38
|
+
* What kind of visual content the pipeline detected or was told to expect.
|
|
39
|
+
*
|
|
40
|
+
* Used to route images to the most appropriate processing tier — e.g.
|
|
41
|
+
* handwritten content triggers TrOCR, complex layouts trigger Florence-2.
|
|
42
|
+
*/
|
|
43
|
+
export type ContentCategory = 'printed-text' | 'handwritten' | 'document-layout' | 'photograph' | 'diagram' | 'screenshot' | 'mixed';
|
|
44
|
+
/**
|
|
45
|
+
* Identifies which processing tier produced a result.
|
|
46
|
+
*
|
|
47
|
+
* - `'ocr'` — Tier 1: PaddleOCR or Tesseract.js text extraction
|
|
48
|
+
* - `'handwriting'` — Tier 2a: TrOCR handwriting recognition
|
|
49
|
+
* - `'document-ai'` — Tier 2b: Florence-2 document understanding
|
|
50
|
+
* - `'embedding'` — Tier 2c: CLIP image embedding generation
|
|
51
|
+
* - `'cloud-vision'` — Tier 3: Cloud vision LLM (GPT-4o, Claude, etc.)
|
|
52
|
+
*/
|
|
53
|
+
export type VisionTier = 'ocr' | 'handwriting' | 'document-ai' | 'embedding' | 'cloud-vision';
|
|
54
|
+
/**
|
|
55
|
+
* Result from a single processing tier.
|
|
56
|
+
*
|
|
57
|
+
* Each tier that runs produces one of these, regardless of whether the
|
|
58
|
+
* pipeline ultimately uses its output or prefers a higher-confidence
|
|
59
|
+
* alternative from another tier.
|
|
60
|
+
*/
|
|
61
|
+
export interface TierResult {
|
|
62
|
+
/** Which tier produced this result. */
|
|
63
|
+
tier: VisionTier;
|
|
64
|
+
/** Provider name within the tier (e.g. 'paddle', 'tesseract', 'openai'). */
|
|
65
|
+
provider: string;
|
|
66
|
+
/** Extracted or generated text content. */
|
|
67
|
+
text: string;
|
|
68
|
+
/** Confidence score from 0 (no confidence) to 1 (certain). */
|
|
69
|
+
confidence: number;
|
|
70
|
+
/** Wall-clock processing time in milliseconds. */
|
|
71
|
+
durationMs: number;
|
|
72
|
+
/** Bounding boxes for detected text regions, when available. */
|
|
73
|
+
regions?: TextRegion[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A detected text region within an image, with spatial coordinates
|
|
77
|
+
* and per-region confidence.
|
|
78
|
+
*/
|
|
79
|
+
export interface TextRegion {
|
|
80
|
+
/** The text content within this region. */
|
|
81
|
+
text: string;
|
|
82
|
+
/** Confidence score for this specific region (0–1). */
|
|
83
|
+
confidence: number;
|
|
84
|
+
/**
|
|
85
|
+
* Bounding box in image coordinates (pixels).
|
|
86
|
+
* Origin is top-left corner of the image.
|
|
87
|
+
*/
|
|
88
|
+
bbox: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Structured document layout produced by Florence-2 or similar
|
|
97
|
+
* document understanding models.
|
|
98
|
+
*
|
|
99
|
+
* Captures the spatial arrangement of text, tables, figures, headings,
|
|
100
|
+
* and other semantic blocks within a multi-page document.
|
|
101
|
+
*/
|
|
102
|
+
export interface DocumentLayout {
|
|
103
|
+
/** Pages in document order. */
|
|
104
|
+
pages: DocumentPage[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A single page within a structured document layout.
|
|
108
|
+
*/
|
|
109
|
+
export interface DocumentPage {
|
|
110
|
+
/** 1-based page number. */
|
|
111
|
+
pageNumber: number;
|
|
112
|
+
/** Page width in pixels. */
|
|
113
|
+
width: number;
|
|
114
|
+
/** Page height in pixels. */
|
|
115
|
+
height: number;
|
|
116
|
+
/** Semantic blocks detected on this page. */
|
|
117
|
+
blocks: LayoutBlock[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A semantic block within a document page — a paragraph, table, figure,
|
|
121
|
+
* heading, list, or code snippet.
|
|
122
|
+
*/
|
|
123
|
+
export interface LayoutBlock {
|
|
124
|
+
/** Semantic type of the block. */
|
|
125
|
+
type: 'text' | 'table' | 'figure' | 'heading' | 'list' | 'code';
|
|
126
|
+
/** Text content extracted from the block. */
|
|
127
|
+
content: string;
|
|
128
|
+
/**
|
|
129
|
+
* Bounding box in page coordinates (pixels).
|
|
130
|
+
* Origin is top-left corner of the page.
|
|
131
|
+
*/
|
|
132
|
+
bbox: {
|
|
133
|
+
x: number;
|
|
134
|
+
y: number;
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
};
|
|
138
|
+
/** Confidence score for this block detection (0–1). */
|
|
139
|
+
confidence: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Aggregated result from the vision pipeline after all configured tiers
|
|
143
|
+
* have run. Contains the best extracted text, content classification,
|
|
144
|
+
* optional embeddings, and detailed per-tier breakdowns.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const result = await pipeline.process(imageBuffer);
|
|
149
|
+
*
|
|
150
|
+
* // Best extracted text across all tiers
|
|
151
|
+
* console.log(result.text);
|
|
152
|
+
*
|
|
153
|
+
* // What kind of content was detected
|
|
154
|
+
* console.log(result.category); // 'printed-text' | 'handwritten' | ...
|
|
155
|
+
*
|
|
156
|
+
* // CLIP embedding for similarity search
|
|
157
|
+
* if (result.embedding) {
|
|
158
|
+
* await vectorStore.upsert('images', [{ embedding: result.embedding }]);
|
|
159
|
+
* }
|
|
160
|
+
*
|
|
161
|
+
* // Inspect individual tier contributions
|
|
162
|
+
* for (const tr of result.tierResults) {
|
|
163
|
+
* console.log(`${tr.tier} (${tr.provider}): ${tr.confidence}`);
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export interface VisionResult {
|
|
168
|
+
/** Best extracted text (from OCR, handwriting, or vision description). */
|
|
169
|
+
text: string;
|
|
170
|
+
/** Overall confidence score 0–1, taken from the winning tier. */
|
|
171
|
+
confidence: number;
|
|
172
|
+
/** What kind of content was detected. */
|
|
173
|
+
category: ContentCategory;
|
|
174
|
+
/** Which tier(s) contributed to the final result. */
|
|
175
|
+
tiers: VisionTier[];
|
|
176
|
+
/** Detailed results from each tier that ran, ordered by execution. */
|
|
177
|
+
tierResults: TierResult[];
|
|
178
|
+
/** CLIP image embedding vector, when embedding tier is enabled. */
|
|
179
|
+
embedding?: number[];
|
|
180
|
+
/** Structured document layout, when Florence-2 ran. */
|
|
181
|
+
layout?: DocumentLayout;
|
|
182
|
+
/** Bounding boxes for detected text regions from the winning tier. */
|
|
183
|
+
regions?: TextRegion[];
|
|
184
|
+
/** Total wall-clock processing time in milliseconds. */
|
|
185
|
+
durationMs: number;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Preprocessing options applied to images before they enter the
|
|
189
|
+
* vision pipeline tiers. Uses `sharp` under the hood.
|
|
190
|
+
*/
|
|
191
|
+
export interface VisionPreprocessingConfig {
|
|
192
|
+
/** Convert to grayscale before OCR (improves contrast for printed text). */
|
|
193
|
+
grayscale?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Resize constraints. The image is scaled down proportionally
|
|
196
|
+
* so that neither dimension exceeds the specified maximum.
|
|
197
|
+
* No upscaling is performed.
|
|
198
|
+
*/
|
|
199
|
+
resize?: {
|
|
200
|
+
maxWidth?: number;
|
|
201
|
+
maxHeight?: number;
|
|
202
|
+
};
|
|
203
|
+
/** Apply unsharp-mask sharpening (helps blurry scans). */
|
|
204
|
+
sharpen?: boolean;
|
|
205
|
+
/** Normalize brightness/contrast (histogram stretching). */
|
|
206
|
+
normalize?: boolean;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Configuration for the {@link VisionPipeline}.
|
|
210
|
+
*
|
|
211
|
+
* All fields are optional — the factory function {@link createVisionPipeline}
|
|
212
|
+
* auto-detects available providers and fills in sensible defaults.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const config: VisionPipelineConfig = {
|
|
217
|
+
* strategy: 'progressive',
|
|
218
|
+
* ocr: 'paddle',
|
|
219
|
+
* handwriting: true,
|
|
220
|
+
* documentAI: true,
|
|
221
|
+
* embedding: true,
|
|
222
|
+
* cloudProvider: 'openai',
|
|
223
|
+
* cloudModel: 'gpt-4o',
|
|
224
|
+
* confidenceThreshold: 0.8,
|
|
225
|
+
* preprocessing: { grayscale: true, sharpen: true },
|
|
226
|
+
* };
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
export interface VisionPipelineConfig {
|
|
230
|
+
/**
|
|
231
|
+
* How to combine tiers.
|
|
232
|
+
* @default 'progressive'
|
|
233
|
+
*/
|
|
234
|
+
strategy: VisionStrategy;
|
|
235
|
+
/**
|
|
236
|
+
* OCR engine for Tier 1 text extraction.
|
|
237
|
+
* - `'paddle'` — PaddleOCR (via `ppu-paddle-ocr`). Best accuracy for most scripts.
|
|
238
|
+
* - `'tesseract'` — Tesseract.js. Wider language support, slightly lower accuracy.
|
|
239
|
+
* - `'none'` — Skip OCR entirely (useful for photo-only pipelines).
|
|
240
|
+
* @default 'paddle' (if installed), else 'tesseract' (if installed), else 'none'
|
|
241
|
+
*/
|
|
242
|
+
ocr?: 'paddle' | 'tesseract' | 'none';
|
|
243
|
+
/**
|
|
244
|
+
* Enable handwriting recognition via TrOCR (`@huggingface/transformers`).
|
|
245
|
+
* Only triggered when OCR confidence is low and content appears handwritten.
|
|
246
|
+
* @default false
|
|
247
|
+
*/
|
|
248
|
+
handwriting?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Enable document understanding via Florence-2 (`@huggingface/transformers`).
|
|
251
|
+
* Produces structured {@link DocumentLayout} with semantic block detection.
|
|
252
|
+
* @default false
|
|
253
|
+
*/
|
|
254
|
+
documentAI?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Enable CLIP image embeddings (`@huggingface/transformers`).
|
|
257
|
+
* Runs in parallel with other tiers — does not affect text extraction.
|
|
258
|
+
* @default false
|
|
259
|
+
*/
|
|
260
|
+
embedding?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Cloud vision LLM provider name for Tier 3 fallback.
|
|
263
|
+
* Must match a provider known to `generateText()` (e.g. 'openai', 'anthropic', 'google').
|
|
264
|
+
* When unset, cloud vision is disabled.
|
|
265
|
+
*/
|
|
266
|
+
cloudProvider?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Cloud model override. When unset, the provider's default vision model is used.
|
|
269
|
+
* @example 'gpt-4o', 'claude-sonnet-4-20250514', 'gemini-2.0-flash'
|
|
270
|
+
*/
|
|
271
|
+
cloudModel?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Minimum confidence to accept an OCR result without escalating to cloud.
|
|
274
|
+
* Only applies to `'progressive'` strategy — if OCR confidence is below
|
|
275
|
+
* this threshold, the pipeline escalates to the next tier.
|
|
276
|
+
* @default 0.7
|
|
277
|
+
*/
|
|
278
|
+
confidenceThreshold?: number;
|
|
279
|
+
/**
|
|
280
|
+
* Image preprocessing options applied before any tier runs.
|
|
281
|
+
* Uses `sharp` for resizing, grayscale conversion, sharpening,
|
|
282
|
+
* and normalization.
|
|
283
|
+
*/
|
|
284
|
+
preprocessing?: VisionPreprocessingConfig;
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/vision/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,UAAU,CAAC;AAMf;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,OAAO,CAAC;AAMZ;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CAAC;AAM9F;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,IAAI,EAAE,UAAU,CAAC;IAEjB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IAEjB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IAEb,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IAEnB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IAEnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IAEb,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE;QACJ,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,6CAA6C;IAC7C,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAEhE,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE;QACJ,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IAEb,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IAEnB,yCAAyC;IACzC,QAAQ,EAAE,eAAe,CAAC;IAE1B,qDAAqD;IACrD,KAAK,EAAE,UAAU,EAAE,CAAC;IAEpB,sEAAsE;IACtE,WAAW,EAAE,UAAU,EAAE,CAAC;IAE1B,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB,uDAAuD;IACvD,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,sEAAsE;IACtE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IAEvB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,cAAc,CAAC;IAEzB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;IAEtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC3C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/vision/types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the unified vision pipeline.
|
|
5
|
+
*
|
|
6
|
+
* The vision pipeline processes images through configurable tiers — from fast,
|
|
7
|
+
* free, offline OCR (PaddleOCR / Tesseract.js) through local vision models
|
|
8
|
+
* (TrOCR, Florence-2, CLIP via HuggingFace Transformers) to cloud vision LLMs
|
|
9
|
+
* (GPT-4o, Claude, Gemini). Each tier adds progressively richer understanding
|
|
10
|
+
* at increasing cost and latency.
|
|
11
|
+
*
|
|
12
|
+
* ## Tier overview
|
|
13
|
+
*
|
|
14
|
+
* | Tier | Provider | Capability | Cost |
|
|
15
|
+
* |------|----------|-----------|------|
|
|
16
|
+
* | 1 — OCR | PaddleOCR / Tesseract.js | Printed text extraction | Free/offline |
|
|
17
|
+
* | 2 — Local Vision | TrOCR / Florence-2 / CLIP | Handwriting, layout, embeddings | Free/offline |
|
|
18
|
+
* | 3 — Cloud Vision | GPT-4o / Claude / Gemini | Scene understanding, complex docs | API cost |
|
|
19
|
+
*
|
|
20
|
+
* @see {@link VisionPipeline} for the orchestration engine.
|
|
21
|
+
* @see {@link VisionStrategy} for how tiers are combined.
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/vision/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
|
@@ -56,7 +56,7 @@ export declare class CapabilityDiscoveryEngine implements ICapabilityDiscoveryEn
|
|
|
56
56
|
/**
|
|
57
57
|
* Index emergent tools into the capability discovery system.
|
|
58
58
|
*
|
|
59
|
-
* Converts
|
|
59
|
+
* Converts `EmergentTool` objects to `CapabilityDescriptor` records and
|
|
60
60
|
* upserts them into the vector index and relationship graph. Session-tier tools
|
|
61
61
|
* are skipped because they are too ephemeral to warrant indexing overhead.
|
|
62
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityDiscoveryEngine.d.ts","sourceRoot":"","sources":["../../src/discovery/CapabilityDiscoveryEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAUzD,qBAAa,yBAA0B,YAAW,0BAA0B;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,WAAW,CAAS;gBAG1B,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAiB7C;;;;;OAKG;IACG,UAAU,CACd,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC;IAgBhB;;;;;;;;;OASG;IACG,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CapabilityDiscoveryEngine.d.ts","sourceRoot":"","sources":["../../src/discovery/CapabilityDiscoveryEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAUzD,qBAAa,yBAA0B,YAAW,0BAA0B;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,WAAW,CAAS;gBAG1B,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAiB7C;;;;;OAKG;IACG,UAAU,CACd,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC;IAgBhB;;;;;;;;;OASG;IACG,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAyDrC;;OAEG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAQjE;;;OAGG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B5E;;;;;;;;;;;;;;;;OAgBG;IACG,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAwChE;;;;;OAKG;IACG,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBjE,aAAa,IAAI,OAAO;IAIxB,iBAAiB,IAAI,MAAM,EAAE;IAI7B;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,yBAAyB,CAAC;IAIhD;;OAEG;IACH,QAAQ,IAAI;QACV,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB;IASD;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM;IAQ1D,OAAO,CAAC,WAAW;CAoBpB"}
|
|
@@ -144,7 +144,7 @@ export class CapabilityDiscoveryEngine {
|
|
|
144
144
|
/**
|
|
145
145
|
* Index emergent tools into the capability discovery system.
|
|
146
146
|
*
|
|
147
|
-
* Converts
|
|
147
|
+
* Converts `EmergentTool` objects to `CapabilityDescriptor` records and
|
|
148
148
|
* upserts them into the vector index and relationship graph. Session-tier tools
|
|
149
149
|
* are skipped because they are too ephemeral to warrant indexing overhead.
|
|
150
150
|
*
|