@mcoda/mswarm 0.1.135-codali.4 → 0.1.135-codali.40
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 +5 -0
- package/dist/codali-executor.d.ts +19 -0
- package/dist/codali-executor.d.ts.map +1 -1
- package/dist/codali-executor.js +54 -2
- package/dist/codali-executor.js.map +1 -1
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +36 -7
- package/dist/runtime.js.map +1 -1
- package/dist/vendor/codali/cli/TerminalArtifacts.d.ts +5 -0
- package/dist/vendor/codali/cli/TerminalArtifacts.d.ts.map +1 -0
- package/dist/vendor/codali/cli/TerminalArtifacts.js +26 -0
- package/dist/vendor/codali/cli/TerminalCommand.d.ts +2 -1
- package/dist/vendor/codali/cli/TerminalCommand.d.ts.map +1 -1
- package/dist/vendor/codali/cli/TerminalCommand.js +436 -100
- package/dist/vendor/codali/cli/TerminalInput.d.ts +13 -0
- package/dist/vendor/codali/cli/TerminalInput.d.ts.map +1 -1
- package/dist/vendor/codali/cli/TerminalInput.js +55 -7
- package/dist/vendor/codali/cli/TerminalModels.d.ts +6 -0
- package/dist/vendor/codali/cli/TerminalModels.d.ts.map +1 -0
- package/dist/vendor/codali/cli/TerminalModels.js +45 -0
- package/dist/vendor/codali/cli/TerminalPlan.d.ts +40 -0
- package/dist/vendor/codali/cli/TerminalPlan.d.ts.map +1 -0
- package/dist/vendor/codali/cli/TerminalPlan.js +37 -0
- package/dist/vendor/codali/cli/ToolsCommand.d.ts.map +1 -1
- package/dist/vendor/codali/cli/ToolsCommand.js +8 -1
- package/dist/vendor/codali/cli/tui/TerminalCells.d.ts +6 -0
- package/dist/vendor/codali/cli/tui/TerminalCells.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalCells.js +47 -0
- package/dist/vendor/codali/cli/tui/TerminalEditor.d.ts +22 -0
- package/dist/vendor/codali/cli/tui/TerminalEditor.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalEditor.js +88 -0
- package/dist/vendor/codali/cli/tui/TerminalLogo.d.ts +6 -0
- package/dist/vendor/codali/cli/tui/TerminalLogo.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalLogo.js +26 -0
- package/dist/vendor/codali/cli/tui/TerminalMarkdown.d.ts +5 -0
- package/dist/vendor/codali/cli/tui/TerminalMarkdown.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalMarkdown.js +118 -0
- package/dist/vendor/codali/cli/tui/TerminalPresentation.d.ts +6 -0
- package/dist/vendor/codali/cli/tui/TerminalPresentation.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalPresentation.js +152 -0
- package/dist/vendor/codali/cli/tui/TerminalScreen.d.ts +50 -0
- package/dist/vendor/codali/cli/tui/TerminalScreen.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalScreen.js +137 -0
- package/dist/vendor/codali/cli/tui/TerminalSelection.d.ts +15 -0
- package/dist/vendor/codali/cli/tui/TerminalSelection.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalSelection.js +38 -0
- package/dist/vendor/codali/cli/tui/TerminalTui.d.ts +82 -0
- package/dist/vendor/codali/cli/tui/TerminalTui.d.ts.map +1 -0
- package/dist/vendor/codali/cli/tui/TerminalTui.js +564 -0
- package/dist/vendor/codali/cli.d.ts.map +1 -1
- package/dist/vendor/codali/cli.js +5 -3
- package/dist/vendor/codali/config/OrchestrationConfig.d.ts +40 -0
- package/dist/vendor/codali/config/OrchestrationConfig.d.ts.map +1 -1
- package/dist/vendor/codali/config/OrchestrationConfig.js +74 -3
- package/dist/vendor/codali/connectors/media/MediaJobStore.d.ts +2 -1
- package/dist/vendor/codali/connectors/media/MediaJobStore.d.ts.map +1 -1
- package/dist/vendor/codali/connectors/media/MediaJobStore.js +11 -3
- package/dist/vendor/codali/docdex/DocdexCatalog.d.ts +12 -0
- package/dist/vendor/codali/docdex/DocdexCatalog.d.ts.map +1 -0
- package/dist/vendor/codali/docdex/DocdexCatalog.js +30 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts +15 -2
- package/dist/vendor/codali/docdex/DocdexClient.d.ts.map +1 -1
- package/dist/vendor/codali/docdex/DocdexClient.js +119 -12
- package/dist/vendor/codali/docdex/ManagedDocdex.d.ts +4 -0
- package/dist/vendor/codali/docdex/ManagedDocdex.d.ts.map +1 -1
- package/dist/vendor/codali/docdex/ManagedDocdex.js +42 -5
- package/dist/vendor/codali/eval/EvaluationProcess.d.ts.map +1 -1
- package/dist/vendor/codali/eval/EvaluationProcess.js +4 -0
- package/dist/vendor/codali/eval/TerminalWorkflowCorpus.d.ts +1 -1
- package/dist/vendor/codali/eval/TerminalWorkflowCorpus.d.ts.map +1 -1
- package/dist/vendor/codali/eval/TerminalWorkflowCorpus.js +9 -6
- package/dist/vendor/codali/eval/TrustBenchmark.d.ts +94 -0
- package/dist/vendor/codali/eval/TrustBenchmark.d.ts.map +1 -0
- package/dist/vendor/codali/eval/TrustBenchmark.js +199 -0
- package/dist/vendor/codali/eval/fixtures/ContractReviewProvider.d.ts +4 -0
- package/dist/vendor/codali/eval/fixtures/ContractReviewProvider.d.ts.map +1 -0
- package/dist/vendor/codali/eval/fixtures/ContractReviewProvider.js +10 -0
- package/dist/vendor/codali/eval/fixtures/MixedMediaRecoveryJourney.d.ts +6 -0
- package/dist/vendor/codali/eval/fixtures/MixedMediaRecoveryJourney.d.ts.map +1 -0
- package/dist/vendor/codali/eval/fixtures/MixedMediaRecoveryJourney.js +145 -0
- package/dist/vendor/codali/eval/fixtures/TerminalRecoveryJourney.d.ts.map +1 -1
- package/dist/vendor/codali/eval/fixtures/TerminalRecoveryJourney.js +14 -1
- package/dist/vendor/codali/gateway/GroundingMode.d.ts.map +1 -1
- package/dist/vendor/codali/gateway/GroundingMode.js +23 -3
- package/dist/vendor/codali/index.d.ts +1 -0
- package/dist/vendor/codali/index.d.ts.map +1 -1
- package/dist/vendor/codali/index.js +1 -0
- package/dist/vendor/codali/permissions/PermissionGate.d.ts +4 -1
- package/dist/vendor/codali/permissions/PermissionGate.d.ts.map +1 -1
- package/dist/vendor/codali/permissions/PermissionGate.js +50 -5
- package/dist/vendor/codali/permissions/WorkspacePermissions.d.ts +11 -0
- package/dist/vendor/codali/permissions/WorkspacePermissions.d.ts.map +1 -0
- package/dist/vendor/codali/permissions/WorkspacePermissions.js +42 -0
- package/dist/vendor/codali/providers/ConfiguredModelScope.d.ts +1 -0
- package/dist/vendor/codali/providers/ConfiguredModelScope.d.ts.map +1 -1
- package/dist/vendor/codali/providers/ConfiguredModelScope.js +19 -2
- package/dist/vendor/codali/providers/ConfiguredProvider.d.ts +10 -1
- package/dist/vendor/codali/providers/ConfiguredProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/ConfiguredProvider.js +104 -37
- package/dist/vendor/codali/providers/ModelCapacityWait.d.ts +21 -0
- package/dist/vendor/codali/providers/ModelCapacityWait.d.ts.map +1 -0
- package/dist/vendor/codali/providers/ModelCapacityWait.js +40 -0
- package/dist/vendor/codali/providers/ModelServiceError.d.ts +16 -2
- package/dist/vendor/codali/providers/ModelServiceError.d.ts.map +1 -1
- package/dist/vendor/codali/providers/ModelServiceError.js +37 -5
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts.map +1 -1
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.js +38 -3
- package/dist/vendor/codali/providers/ProviderTypes.d.ts +9 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts.map +1 -1
- package/dist/vendor/codali/providers/RequestSize.d.ts +5 -0
- package/dist/vendor/codali/providers/RequestSize.d.ts.map +1 -0
- package/dist/vendor/codali/providers/RequestSize.js +10 -0
- package/dist/vendor/codali/providers/RequestUsage.d.ts +11 -0
- package/dist/vendor/codali/providers/RequestUsage.d.ts.map +1 -0
- package/dist/vendor/codali/providers/RequestUsage.js +33 -0
- package/dist/vendor/codali/runtime/AnswerVerification.d.ts +17 -0
- package/dist/vendor/codali/runtime/AnswerVerification.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/AnswerVerification.js +39 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts +1 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/CodaliRuntime.js +1 -0
- package/dist/vendor/codali/runtime/CompletionReport.d.ts +8 -0
- package/dist/vendor/codali/runtime/CompletionReport.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/CompletionReport.js +25 -0
- package/dist/vendor/codali/runtime/ComputedAnswer.d.ts +13 -0
- package/dist/vendor/codali/runtime/ComputedAnswer.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/ComputedAnswer.js +75 -0
- package/dist/vendor/codali/runtime/ContextCompression.d.ts +41 -0
- package/dist/vendor/codali/runtime/ContextCompression.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/ContextCompression.js +292 -0
- package/dist/vendor/codali/runtime/GatewayRequest.d.ts +5 -0
- package/dist/vendor/codali/runtime/GatewayRequest.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/GatewayRequest.js +19 -0
- package/dist/vendor/codali/runtime/InspectionBudget.d.ts +11 -0
- package/dist/vendor/codali/runtime/InspectionBudget.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/InspectionBudget.js +23 -0
- package/dist/vendor/codali/runtime/InspectionConvergence.d.ts +24 -0
- package/dist/vendor/codali/runtime/InspectionConvergence.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/InspectionConvergence.js +67 -0
- package/dist/vendor/codali/runtime/InteractionContract.d.ts +44 -0
- package/dist/vendor/codali/runtime/InteractionContract.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/InteractionContract.js +64 -0
- package/dist/vendor/codali/runtime/InteractionRouter.d.ts +73 -0
- package/dist/vendor/codali/runtime/InteractionRouter.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/InteractionRouter.js +139 -0
- package/dist/vendor/codali/runtime/OutageWait.d.ts +14 -0
- package/dist/vendor/codali/runtime/OutageWait.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/OutageWait.js +33 -0
- package/dist/vendor/codali/runtime/PlanCoverage.d.ts +9 -0
- package/dist/vendor/codali/runtime/PlanCoverage.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/PlanCoverage.js +12 -0
- package/dist/vendor/codali/runtime/PreparedDocdex.d.ts +4 -0
- package/dist/vendor/codali/runtime/PreparedDocdex.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/PreparedDocdex.js +55 -0
- package/dist/vendor/codali/runtime/PreparedMemory.d.ts +3 -0
- package/dist/vendor/codali/runtime/PreparedMemory.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/PreparedMemory.js +30 -0
- package/dist/vendor/codali/runtime/ProgressTracker.d.ts +1 -0
- package/dist/vendor/codali/runtime/ProgressTracker.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/ProgressTracker.js +25 -5
- package/dist/vendor/codali/runtime/ResearchEvidence.d.ts +19 -0
- package/dist/vendor/codali/runtime/ResearchEvidence.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/ResearchEvidence.js +55 -0
- package/dist/vendor/codali/runtime/ReviewContract.d.ts +35 -0
- package/dist/vendor/codali/runtime/ReviewContract.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/ReviewContract.js +132 -0
- package/dist/vendor/codali/runtime/ReviewCoordinator.d.ts +43 -0
- package/dist/vendor/codali/runtime/ReviewCoordinator.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/ReviewCoordinator.js +134 -0
- package/dist/vendor/codali/runtime/ReviewSource.d.ts +3 -0
- package/dist/vendor/codali/runtime/ReviewSource.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/ReviewSource.js +17 -1
- package/dist/vendor/codali/runtime/Runner.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/Runner.js +6 -1
- package/dist/vendor/codali/runtime/SessionController.d.ts +142 -6
- package/dist/vendor/codali/runtime/SessionController.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/SessionController.js +2296 -228
- package/dist/vendor/codali/runtime/SpecialistTools.d.ts +8 -0
- package/dist/vendor/codali/runtime/SpecialistTools.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/SpecialistTools.js +85 -0
- package/dist/vendor/codali/runtime/StructuralEvidence.d.ts +4 -2
- package/dist/vendor/codali/runtime/StructuralEvidence.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/StructuralEvidence.js +22 -5
- package/dist/vendor/codali/runtime/TaskReview.d.ts +25 -0
- package/dist/vendor/codali/runtime/TaskReview.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/TaskReview.js +109 -0
- package/dist/vendor/codali/runtime/TaskReviewContext.d.ts +37 -0
- package/dist/vendor/codali/runtime/TaskReviewContext.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/TaskReviewContext.js +18 -2
- package/dist/vendor/codali/runtime/UsageReconciliation.d.ts +28 -0
- package/dist/vendor/codali/runtime/UsageReconciliation.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/UsageReconciliation.js +68 -0
- package/dist/vendor/codali/runtime/VerificationReceiptSelection.d.ts +15 -0
- package/dist/vendor/codali/runtime/VerificationReceiptSelection.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/VerificationReceiptSelection.js +30 -0
- package/dist/vendor/codali/runtime/WorkspaceLedger.d.ts +2 -0
- package/dist/vendor/codali/runtime/WorkspaceLedger.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/WorkspaceLedger.js +44 -20
- package/dist/vendor/codali/runtime/WorkspaceLock.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/WorkspaceLock.js +9 -1
- package/dist/vendor/codali/runtime/WorkspaceSnapshot.d.ts.map +1 -1
- package/dist/vendor/codali/runtime/WorkspaceSnapshot.js +3 -2
- package/dist/vendor/codali/runtime/WriteSyntaxCheck.d.ts +10 -0
- package/dist/vendor/codali/runtime/WriteSyntaxCheck.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/WriteSyntaxCheck.js +34 -0
- package/dist/vendor/codali/session/InstructionLoader.d.ts +5 -1
- package/dist/vendor/codali/session/InstructionLoader.d.ts.map +1 -1
- package/dist/vendor/codali/session/InstructionLoader.js +65 -19
- package/dist/vendor/codali/session/SessionStoragePath.d.ts.map +1 -1
- package/dist/vendor/codali/session/SessionStoragePath.js +34 -17
- package/dist/vendor/codali/session/SessionStore.d.ts +6 -1
- package/dist/vendor/codali/session/SessionStore.d.ts.map +1 -1
- package/dist/vendor/codali/session/SessionStore.js +108 -43
- package/dist/vendor/codali/session/SkillCatalog.d.ts +33 -0
- package/dist/vendor/codali/session/SkillCatalog.d.ts.map +1 -0
- package/dist/vendor/codali/session/SkillCatalog.js +197 -0
- package/dist/vendor/codali/session/WorkState.d.ts +16 -2
- package/dist/vendor/codali/session/WorkState.d.ts.map +1 -1
- package/dist/vendor/codali/session/WorkState.js +55 -5
- package/dist/vendor/codali/session/WorkTypes.d.ts +8 -0
- package/dist/vendor/codali/session/WorkTypes.d.ts.map +1 -1
- package/dist/vendor/codali/session/WorkspaceScope.d.ts +3 -0
- package/dist/vendor/codali/session/WorkspaceScope.d.ts.map +1 -0
- package/dist/vendor/codali/session/WorkspaceScope.js +19 -0
- package/dist/vendor/codali/tools/SemanticToolRetrieval.d.ts +19 -0
- package/dist/vendor/codali/tools/SemanticToolRetrieval.d.ts.map +1 -0
- package/dist/vendor/codali/tools/SemanticToolRetrieval.js +52 -0
- package/dist/vendor/codali/tools/ToolRetrieval.d.ts +7 -0
- package/dist/vendor/codali/tools/ToolRetrieval.d.ts.map +1 -0
- package/dist/vendor/codali/tools/ToolRetrieval.js +25 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts +5 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts.map +1 -1
- package/dist/vendor/codali/tools/browser/BrowserSessionTool.d.ts +16 -0
- package/dist/vendor/codali/tools/browser/BrowserSessionTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/browser/BrowserSessionTool.js +326 -0
- package/dist/vendor/codali/tools/browser/BrowserTool.d.ts +17 -0
- package/dist/vendor/codali/tools/browser/BrowserTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/browser/BrowserTool.js +291 -0
- package/dist/vendor/codali/tools/browser/BrowserWorker.d.ts +2 -0
- package/dist/vendor/codali/tools/browser/BrowserWorker.d.ts.map +1 -0
- package/dist/vendor/codali/tools/browser/BrowserWorker.js +121 -0
- package/dist/vendor/codali/tools/calculation/CalculatorTool.d.ts +5 -0
- package/dist/vendor/codali/tools/calculation/CalculatorTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/calculation/CalculatorTool.js +191 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicRuntime.d.ts +39 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicRuntime.d.ts.map +1 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicRuntime.js +98 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicTools.d.ts +8 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/deterministic/DeterministicTools.js +100 -0
- package/dist/vendor/codali/tools/deterministic/node-worker.cjs +38 -0
- package/dist/vendor/codali/tools/deterministic/python-worker.py +237 -0
- package/dist/vendor/codali/tools/docdex/DocdexCatalogTools.d.ts +4 -0
- package/dist/vendor/codali/tools/docdex/DocdexCatalogTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/docdex/DocdexCatalogTools.js +59 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts +2 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts.map +1 -1
- package/dist/vendor/codali/tools/docdex/DocdexTools.js +81 -106
- package/dist/vendor/codali/tools/documents/DocumentRuntime.d.ts +12 -0
- package/dist/vendor/codali/tools/documents/DocumentRuntime.d.ts.map +1 -0
- package/dist/vendor/codali/tools/documents/DocumentRuntime.js +59 -0
- package/dist/vendor/codali/tools/documents/DocumentTools.d.ts +19 -0
- package/dist/vendor/codali/tools/documents/DocumentTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/documents/DocumentTools.js +150 -0
- package/dist/vendor/codali/tools/documents/worker.py +267 -0
- package/dist/vendor/codali/tools/entities/AdesTool.d.ts +7 -0
- package/dist/vendor/codali/tools/entities/AdesTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/entities/AdesTool.js +59 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts.map +1 -1
- package/dist/vendor/codali/tools/filesystem/FileTools.js +62 -11
- package/dist/vendor/codali/tools/research/TnlTool.d.ts +22 -0
- package/dist/vendor/codali/tools/research/TnlTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/research/TnlTool.js +246 -0
- package/dist/vendor/codali/tools/shell/AsyncProcess.d.ts +4 -0
- package/dist/vendor/codali/tools/shell/AsyncProcess.d.ts.map +1 -1
- package/dist/vendor/codali/tools/shell/AsyncProcess.js +9 -3
- package/dist/vendor/codali/tools/shell/HostToolchain.d.ts +7 -0
- package/dist/vendor/codali/tools/shell/HostToolchain.d.ts.map +1 -1
- package/dist/vendor/codali/tools/shell/HostToolchain.js +65 -4
- package/dist/vendor/codali/tools/shell/IsolatedExecutor.d.ts +5 -2
- package/dist/vendor/codali/tools/shell/IsolatedExecutor.d.ts.map +1 -1
- package/dist/vendor/codali/tools/shell/IsolatedExecutor.js +148 -29
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts +2 -0
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts.map +1 -1
- package/dist/vendor/codali/tools/shell/ShellTool.js +19 -4
- package/dist/vendor/codali/tools/system/CalendarTool.d.ts +15 -0
- package/dist/vendor/codali/tools/system/CalendarTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/system/CalendarTool.js +44 -0
- package/dist/vendor/codali/tools/system/TextTool.d.ts +4 -0
- package/dist/vendor/codali/tools/system/TextTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/system/TextTool.js +39 -0
- package/dist/vendor/codali/tools/system/TimeTool.d.ts +4 -0
- package/dist/vendor/codali/tools/system/TimeTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/system/TimeTool.js +22 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationTool.d.ts +47 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationTool.js +71 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationWorker.d.ts +2 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationWorker.d.ts.map +1 -0
- package/dist/vendor/codali/tools/verification/JavaScriptVerificationWorker.js +91 -0
- package/dist/vendor/codali/tools/verification/VitestTool.d.ts +6 -0
- package/dist/vendor/codali/tools/verification/VitestTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/verification/VitestTool.js +184 -0
- package/dist/vendor/config/AGENTS.md +17 -0
- package/dist/vendor/config/deterministic/install-python.mjs +16 -0
- package/dist/vendor/config/deterministic/node-worker.mjs +77 -0
- package/dist/vendor/config/deterministic/python-worker.py +237 -0
- package/dist/vendor/config/deterministic/requirements.txt +6 -0
- package/dist/vendor/config/docdex-runtime.json +21 -0
- package/dist/vendor/config/docdex-tools-0.2.99.json +3977 -0
- package/dist/vendor/config/documents/install-python.mjs +16 -0
- package/dist/vendor/config/documents/requirements.txt +10 -0
- package/dist/vendor/config/documents/worker.py +267 -0
- package/dist/vendor/config/skills/architecture-design/SKILL.md +14 -0
- package/dist/vendor/config/skills/browser-session/SKILL.md +16 -0
- package/dist/vendor/config/skills/browser-use/SKILL.md +14 -0
- package/dist/vendor/config/skills/code-implementation/SKILL.md +18 -0
- package/dist/vendor/config/skills/code-review/SKILL.md +14 -0
- package/dist/vendor/config/skills/docdex-research/SKILL.md +18 -0
- package/dist/vendor/config/skills/docdex-research/references/catalog.md +111 -0
- package/dist/vendor/config/skills/docdex-research/references/memory.md +22 -0
- package/dist/vendor/config/skills/docdex-research/references/operations.md +19 -0
- package/dist/vendor/config/skills/docdex-research/references/retrieval.md +13 -0
- package/dist/vendor/config/skills/planning/SKILL.md +14 -0
- package/dist/vendor/config/skills/system-diagnostics/SKILL.md +14 -0
- package/dist/vendor/config/skills/system-services/SKILL.md +17 -0
- package/dist/vendor/config/skills/system-services/references/docker.md +11 -0
- package/dist/vendor/config/skills/system-services/references/linux.md +9 -0
- package/dist/vendor/config/skills/system-services/references/macos.md +9 -0
- package/dist/vendor/config/skills/systematic-debugging/SKILL.md +14 -0
- package/dist/vendor/config/skills/testing-and-verification/SKILL.md +16 -0
- package/dist/vendor/config/skills/tool-selection/SKILL.md +16 -0
- package/dist/vendor/config/skills/ui-ux-design/SKILL.md +16 -0
- package/dist/vendor/config/skills/ui-ux-design/references/validation.md +13 -0
- package/dist/vendor/config/skills/webapp-testing/SKILL.md +12 -0
- package/package.json +15 -5
- package/scripts/media_gpu_lock.py +2 -2
- package/scripts/native_load_guard.py +257 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrchestrationConfig.d.ts","sourceRoot":"","sources":["../../src/config/OrchestrationConfig.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,YAAY,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AACnI,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,C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EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClG;AACD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,sBAAsB,GAAI,UAAU,2BAA2B,KAAG,2BAI9E,CAAC;AA4BF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,mBAAmB,KAAG,MAAsF,CAAC;AAEvJ,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,mBAyI5D,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,GAAI,QAAQ,mBAAmB,EAAE,gBAAqB;;iBAzO9D,MAAM;oBAAkB,MAAM;mBAAiB,MAAM,GAAG,IAAI;aAAW,MAAM;;;;CA6PzG,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,mBAAmB,EAAE,MAAM,MAAM,EAAE,YAAY,cAAc,KAAG,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAerJ,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAU,aAAuG,KAAG,OAAO,CAAC,2BAA2B,CAI1L,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,QAAQ,mBAAmB,EAAE,OAAO,WAAW,KAAG,YAAyE,CAAC"}
|
|
@@ -49,7 +49,7 @@ const canonical = (v) => Array.isArray(v) ? v.map(canonical) : isRecord(v)
|
|
|
49
49
|
export const orchestrationHash = (config) => createHash("sha256").update(JSON.stringify(canonical(config))).digest("hex");
|
|
50
50
|
export const validateOrchestrationConfig = (input) => {
|
|
51
51
|
const root = object(input, "orchestration");
|
|
52
|
-
fields(root, ["schemaVersion", "profile", "providers", "models", "bindings", "routing", "effort", "taskControl", "docdex"], "orchestration");
|
|
52
|
+
fields(root, ["schemaVersion", "profile", "providers", "models", "bindings", "routing", "effort", "taskControl", "docdex", "interaction", "skills"], "orchestration");
|
|
53
53
|
if (root.schemaVersion !== 1)
|
|
54
54
|
throw new Error("Unsupported orchestration schemaVersion");
|
|
55
55
|
nonempty(root.profile, "profile");
|
|
@@ -164,7 +164,15 @@ export const validateOrchestrationConfig = (input) => {
|
|
|
164
164
|
}
|
|
165
165
|
if (root.taskControl !== undefined) {
|
|
166
166
|
const t = object(root.taskControl, "taskControl");
|
|
167
|
-
fields(t, ["maxWritingTasksPerWorktree", "maxConcurrentHelpers", "helpers", "repeatedFailureThreshold", "repairAttemptsBeforeReplan", "checkpointOn", "reviewPolicy"], "taskControl");
|
|
167
|
+
fields(t, ["requirePlan", "initialTools", "immutableInputs", "maxWritingTasksPerWorktree", "maxConcurrentHelpers", "helpers", "repeatedFailureThreshold", "repairAttemptsBeforeReplan", "checkpointOn", "reviewPolicy"], "taskControl");
|
|
168
|
+
if (t.requirePlan !== undefined && typeof t.requirePlan !== "boolean")
|
|
169
|
+
throw new Error("taskControl.requirePlan: expected boolean");
|
|
170
|
+
if (t.initialTools !== undefined && (!Array.isArray(t.initialTools) || t.initialTools.length > 64
|
|
171
|
+
|| t.initialTools.some(name => typeof name !== "string" || !/^[a-z][a-z0-9_]{0,79}$/.test(name))
|
|
172
|
+
|| new Set(t.initialTools).size !== t.initialTools.length))
|
|
173
|
+
throw new Error("taskControl.initialTools: expected unique tool names");
|
|
174
|
+
if (t.immutableInputs !== undefined && (!Array.isArray(t.immutableInputs) || t.immutableInputs.length > 64 || t.immutableInputs.some(v => typeof v !== "string" || !v || v.length > 1024 || v.startsWith("/") || v.includes("\\") || v.split("/").some(part => !part || part === "." || part === "..") || /[:\x00-\x1f]/u.test(v))))
|
|
175
|
+
throw new Error("taskControl.immutableInputs: expected confined workspace-relative input paths");
|
|
168
176
|
if (t.maxWritingTasksPerWorktree !== 1 || t.helpers !== "read-only-or-draft" || t.reviewPolicy !== "risk-and-evidence")
|
|
169
177
|
throw new Error("Invalid task-control safety policy");
|
|
170
178
|
for (const key of ["maxConcurrentHelpers", "repeatedFailureThreshold", "repairAttemptsBeforeReplan"])
|
|
@@ -172,9 +180,72 @@ export const validateOrchestrationConfig = (input) => {
|
|
|
172
180
|
if (!Array.isArray(t.checkpointOn) || t.checkpointOn.some(v => !["task-transition", "before-compaction", "before-exit"].includes(String(v))))
|
|
173
181
|
throw new Error("Invalid checkpointOn policy");
|
|
174
182
|
}
|
|
183
|
+
if (root.interaction !== undefined) {
|
|
184
|
+
const value = object(root.interaction, "interaction");
|
|
185
|
+
fields(value, ["strategy", "toolExposure", "toolSelection", "initialTools", "routerBinding", "answerBinding", "promptVersion", "routerPrompt", "answerPrompt", "maxInputChars", "historyChars", "maxOutputTokens", "maxTotalTokens", "maxModelCalls", "maxInspectionSteps", "timeoutMs", "answerReview", "routerResponseFormat", "calculator"], "interaction");
|
|
186
|
+
if (value.toolExposure !== undefined && (typeof value.toolExposure !== "string" || !["gateway", "native"].includes(value.toolExposure)))
|
|
187
|
+
throw new Error("interaction.toolExposure: expected gateway or native");
|
|
188
|
+
if (value.toolSelection !== undefined && (typeof value.toolSelection !== "string" || !["fixed", "progressive", "lexical", "semantic"].includes(value.toolSelection)))
|
|
189
|
+
throw new Error("interaction.toolSelection: expected fixed, progressive, lexical or semantic");
|
|
190
|
+
if (value.initialTools !== undefined) {
|
|
191
|
+
if (!["gateway", "adaptive"].includes(String(value.strategy)) || value.toolSelection !== "progressive")
|
|
192
|
+
throw new Error("interaction.initialTools: requires gateway or adaptive strategy with progressive tools");
|
|
193
|
+
if (!Array.isArray(value.initialTools) || value.initialTools.length > 16 || value.initialTools.some(name => typeof name !== "string" || !/^[a-z][a-z0-9_]{0,79}$/u.test(name)) || new Set(value.initialTools).size !== value.initialTools.length)
|
|
194
|
+
throw new Error("interaction.initialTools: expected up to 16 distinct tool names");
|
|
195
|
+
}
|
|
196
|
+
if (value.strategy !== undefined && (typeof value.strategy !== "string" || !["routed", "direct", "native", "cascade", "gateway", "adaptive"].includes(value.strategy)))
|
|
197
|
+
throw new Error("interaction.strategy: expected routed, direct, native, cascade, gateway or adaptive");
|
|
198
|
+
if (value.calculator !== undefined && typeof value.calculator !== "boolean")
|
|
199
|
+
throw new Error("interaction.calculator: expected boolean");
|
|
200
|
+
for (const key of ["routerBinding", "answerBinding"])
|
|
201
|
+
if (value[key] !== undefined) {
|
|
202
|
+
nonempty(value[key], `interaction.${key}`);
|
|
203
|
+
if (!hasOwn(bindings, String(value[key])) || object(bindings[String(value[key])], key).enabled === false)
|
|
204
|
+
throw new Error(`interaction.${key}: unavailable binding`);
|
|
205
|
+
}
|
|
206
|
+
if (value.promptVersion !== undefined)
|
|
207
|
+
nonempty(value.promptVersion, "interaction.promptVersion");
|
|
208
|
+
if (value.routerResponseFormat !== undefined && !["json", "json_schema"].includes(String(value.routerResponseFormat)))
|
|
209
|
+
throw new Error("interaction.routerResponseFormat: expected json or json_schema");
|
|
210
|
+
for (const key of ["routerPrompt", "answerPrompt"])
|
|
211
|
+
if (value[key] !== undefined && (typeof value[key] !== "string" || !String(value[key]).trim() || String(value[key]).length > 16000))
|
|
212
|
+
throw new Error(`interaction.${key}: expected bounded nonempty prompt`);
|
|
213
|
+
for (const key of ["maxInputChars", "historyChars", "maxOutputTokens", "maxTotalTokens", "maxModelCalls", "maxInspectionSteps", "timeoutMs"])
|
|
214
|
+
if (value[key] !== undefined)
|
|
215
|
+
positive(value[key], `interaction.${key}`);
|
|
216
|
+
if (value.answerReview !== undefined) {
|
|
217
|
+
const review = object(value.answerReview, "interaction.answerReview");
|
|
218
|
+
fields(review, ["enabled", "binding", "maxOutputTokens"], "interaction.answerReview");
|
|
219
|
+
if (typeof review.enabled !== "boolean")
|
|
220
|
+
throw new Error("interaction.answerReview.enabled: expected boolean");
|
|
221
|
+
if (review.binding !== undefined) {
|
|
222
|
+
nonempty(review.binding, "interaction.answerReview.binding");
|
|
223
|
+
if (!hasOwn(bindings, String(review.binding)) || object(bindings[String(review.binding)], "review binding").enabled === false)
|
|
224
|
+
throw new Error("interaction.answerReview.binding: unavailable binding");
|
|
225
|
+
}
|
|
226
|
+
if (review.maxOutputTokens !== undefined) {
|
|
227
|
+
positive(review.maxOutputTokens, "interaction.answerReview.maxOutputTokens");
|
|
228
|
+
if (Number(review.maxOutputTokens) > 4096)
|
|
229
|
+
throw new Error("interaction.answerReview.maxOutputTokens: exceeds 4096");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (root.skills !== undefined) {
|
|
234
|
+
const skills = object(root.skills, "skills");
|
|
235
|
+
fields(skills, ["enabled", "directories"], "skills");
|
|
236
|
+
if (skills.enabled !== undefined && typeof skills.enabled !== "boolean")
|
|
237
|
+
throw new Error("skills.enabled: expected boolean");
|
|
238
|
+
if (skills.directories !== undefined && (!Array.isArray(skills.directories) || skills.directories.length > 16 || skills.directories.some(value => typeof value !== "string" || !value.trim() || value.length > 4096 || value.includes("\0"))))
|
|
239
|
+
throw new Error("skills.directories: expected at most 16 directory paths");
|
|
240
|
+
}
|
|
175
241
|
if (root.docdex !== undefined) {
|
|
176
242
|
const d = object(root.docdex, "docdex");
|
|
177
|
-
fields(d, ["binary", "binarySha256", "startupTimeoutMs"], "docdex");
|
|
243
|
+
fields(d, ["baseUrl", "binary", "binarySha256", "startupTimeoutMs"], "docdex");
|
|
244
|
+
if (d.baseUrl !== undefined) {
|
|
245
|
+
const url = new URL(nonempty(d.baseUrl, "docdex.baseUrl"));
|
|
246
|
+
if (!["http:", "https:"].includes(url.protocol))
|
|
247
|
+
throw new Error("docdex.baseUrl must use HTTP(S)");
|
|
248
|
+
}
|
|
178
249
|
if (d.binary !== undefined)
|
|
179
250
|
nonempty(d.binary, "docdex.binary");
|
|
180
251
|
if (d.binarySha256 !== undefined && (typeof d.binarySha256 !== "string" || !/^[a-f0-9]{64}$/.test(d.binarySha256) || d.binary === undefined))
|
|
@@ -62,7 +62,8 @@ export declare class MediaJobStore {
|
|
|
62
62
|
/** Trusted user/host action, deliberately unavailable as an agent tool. */
|
|
63
63
|
reconcileFailure(id: string, note: string): Promise<MediaJob>;
|
|
64
64
|
reconcileProcess(id: string, signal?: AbortSignal): Promise<MediaJob>;
|
|
65
|
-
|
|
65
|
+
verifiedArtifact(id: string): Promise<MediaArtifact>;
|
|
66
|
+
exportArtifact(id: string, workspaceRoot: string, destination: string, checkPath?: (resolvedPath: string) => Promise<void>, signal?: AbortSignal): Promise<MediaArtifact>;
|
|
66
67
|
}
|
|
67
68
|
export declare const validateMediaRequest: (request: Record<string, unknown>, descriptor: Record<string, unknown>, operation: ModelOperation) => Record<string, unknown>;
|
|
68
69
|
//# sourceMappingURL=MediaJobStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaJobStore.d.ts","sourceRoot":"","sources":["../../../src/connectors/media/MediaJobStore.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAKpI,MAAM,WAAW,aAAa;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAAE;AAClL,MAAM,WAAW,QAAQ;IACvB,aAAa,EAAE,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;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CAAC;IAsBrE,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOpD,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAgBhL;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,cAAc,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAuB7J,CAAC"}
|
|
@@ -136,11 +136,18 @@ export class MediaJobStore {
|
|
|
136
136
|
});
|
|
137
137
|
return recovery.acquired ? recovery.value : job;
|
|
138
138
|
}
|
|
139
|
-
async
|
|
139
|
+
async verifiedArtifact(id) {
|
|
140
140
|
const job = await this.read(id);
|
|
141
|
-
|
|
142
|
-
if (job.status !== "succeeded" || !artifact)
|
|
141
|
+
if (job.status !== "succeeded" || !job.artifact)
|
|
143
142
|
throw new Error("Media artifact is not ready");
|
|
143
|
+
const artifact = await recoverMediaArtifact(path.dirname(this.file(id)), job);
|
|
144
|
+
if (!artifact || Object.entries(artifact).some(([key, value]) => job.artifact[key] !== value))
|
|
145
|
+
throw new Error("Media artifact does not match its durable receipt");
|
|
146
|
+
return artifact;
|
|
147
|
+
}
|
|
148
|
+
async exportArtifact(id, workspaceRoot, destination, checkPath, signal) {
|
|
149
|
+
signal?.throwIfAborted();
|
|
150
|
+
const artifact = await this.verifiedArtifact(id);
|
|
144
151
|
const target = path.resolve(workspaceRoot, destination);
|
|
145
152
|
const root = await fs.realpath(workspaceRoot);
|
|
146
153
|
const parent = await fs.realpath(path.dirname(target));
|
|
@@ -153,6 +160,7 @@ export class MediaJobStore {
|
|
|
153
160
|
const bytes = await fs.readFile(artifact.path);
|
|
154
161
|
if (createHash("sha256").update(bytes).digest("hex") !== artifact.sha256)
|
|
155
162
|
throw new Error("Artifact checksum mismatch");
|
|
163
|
+
signal?.throwIfAborted();
|
|
156
164
|
await fs.writeFile(canonicalTarget, bytes, { flag: "wx", mode: 0o600 });
|
|
157
165
|
return { ...artifact, path: canonicalTarget };
|
|
158
166
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolInputSchema } from "../tools/ToolTypes.js";
|
|
2
|
+
export interface DocdexCatalogEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: ToolInputSchema;
|
|
6
|
+
}
|
|
7
|
+
export declare const docdexCatalog: DocdexCatalogEntry[];
|
|
8
|
+
export type DocdexCatalogKind = "read" | "memory" | "web" | "external" | "delegate";
|
|
9
|
+
export declare const docdexCatalogKind: (name: string) => DocdexCatalogKind | undefined;
|
|
10
|
+
export declare const docdexCatalogNames: Set<string>;
|
|
11
|
+
export declare const docdexCatalogOperation: (name: string) => string | undefined;
|
|
12
|
+
//# sourceMappingURL=DocdexCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocdexCatalog.d.ts","sourceRoot":"","sources":["../../src/docdex/DocdexCatalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,eAAe,CAAC;CAAE;AAGxG,eAAO,MAAM,aAAa,sBAAiJ,CAAC;AAY5K,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AACpF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,iBAAiB,GAAG,SAOpE,CAAC;AACF,eAAO,MAAM,kBAAkB,aAAgD,CAAC;AAChF,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,SAA+G,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
// Versioned protocol snapshot enables lazy startup and zero catalog tokens on
|
|
3
|
+
// ordinary chat. A server's advertised schema is checked before first use.
|
|
4
|
+
export const docdexCatalog = JSON.parse(readFileSync(new URL("../../config/docdex-tools-0.2.99.json", import.meta.url), "utf8")).tools;
|
|
5
|
+
const readNames = new Set(`search capabilities rerank batch_search files open tree stats repo_inspect symbols ast impact_diagnostics impact_graph dag_export
|
|
6
|
+
memory_recall conversation_search conversation_list conversation_read conversation_export diary_read wakeup kg_query kg_search_nodes kg_search_edges kg_timeline kg_search_episodes kg_neighborhood kg_entity_links kg_episode
|
|
7
|
+
llm_diagnostics personal_preferences_status personal_preferences_categories personal_preferences_retention_policies personal_preferences_list personal_preferences_read personal_preferences_search personal_preferences_reviews personal_preferences_export personal_preferences_claims personal_preferences_claim_read personal_preferences_operator_events personal_preferences_snapshots personal_preferences_snapshot_read personal_preferences_routines personal_preferences_routine_read personal_preferences_routine_explain personal_preferences_mind_map personal_preferences_playbooks
|
|
8
|
+
ai_terminal_integrations ai_terminal_detect ai_terminal_status ai_terminal_events personal_preferences_generated_skills personal_preferences_generated_skill personal_preferences_generated_skill_events personal_preferences_generated_skills_preview personal_preferences_generated_skills_render
|
|
9
|
+
clone_context clone_directive clone_explain clone_replay_dataset clone_replay_suite memory_layers memory_route get_profile`.split(/\s+/).map(name => `docdex_${name}`));
|
|
10
|
+
const memoryNames = new Set(`index memory_save memory_store conversation_import diary_write conversation_hook save_preference
|
|
11
|
+
personal_preferences_feedback personal_preferences_operator_event_record personal_preferences_generated_skill_validate`.split(/\s+/).map(name => `docdex_${name}`));
|
|
12
|
+
const externalNames = new Set(`conversation_delete conversation_redact conversation_prune kg_delete_edge kg_delete_episode kg_rebuild kg_clear
|
|
13
|
+
personal_preferences_review personal_preferences_process personal_preferences_scan personal_preferences_redact personal_preferences_delete personal_preferences_prune personal_preferences_purge personal_preferences_claim_review personal_preferences_claim_override personal_preferences_claim_forget
|
|
14
|
+
personal_preferences_operator_events_scan_artifacts personal_preferences_snapshots_rebuild personal_preferences_routines_rebuild ai_terminal_integrations_bootstrap ai_terminal_capture ai_terminal_sync_skills
|
|
15
|
+
personal_preferences_generated_skills_sync personal_preferences_generated_skills_autopilot personal_preferences_generated_skill_install personal_preferences_generated_skill_disable personal_preferences_generated_skill_rollback clone_evaluate clone_replay_evaluate`.split(/\s+/).map(name => `docdex_${name}`));
|
|
16
|
+
export const docdexCatalogKind = (name) => {
|
|
17
|
+
if (readNames.has(name))
|
|
18
|
+
return "read";
|
|
19
|
+
if (memoryNames.has(name))
|
|
20
|
+
return "memory";
|
|
21
|
+
if (externalNames.has(name))
|
|
22
|
+
return "external";
|
|
23
|
+
if (name === "docdex_web_research")
|
|
24
|
+
return "web";
|
|
25
|
+
if (name === "docdex_local_completion")
|
|
26
|
+
return "delegate";
|
|
27
|
+
return undefined; // Unknown operations never inherit a read permission.
|
|
28
|
+
};
|
|
29
|
+
export const docdexCatalogNames = new Set(docdexCatalog.map(tool => tool.name));
|
|
30
|
+
export const docdexCatalogOperation = (name) => docdexCatalogNames.has(name) && docdexCatalogKind(name) ? name.replace(/^docdex_/, "") : undefined;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { DocdexCapabilitySnapshot } from "../cognitive/Types.js";
|
|
2
|
+
import { type DocdexCatalogEntry } from "./DocdexCatalog.js";
|
|
2
3
|
export interface DocdexClientOptions {
|
|
3
4
|
/** Trusted host accounting hook; each retrieval HTTP attempt reserves before dispatch. */
|
|
4
5
|
beforeRequest?: (url: string) => void | Promise<void>;
|
|
5
6
|
signal?: () => AbortSignal | undefined;
|
|
6
7
|
timeoutMs?: number;
|
|
8
|
+
webTimeoutMs?: number;
|
|
7
9
|
localSearchOnly?: boolean;
|
|
8
10
|
baseUrl: string;
|
|
9
11
|
repoRoot?: string;
|
|
10
12
|
repoId?: string;
|
|
11
13
|
authToken?: string;
|
|
14
|
+
requireMcpSession?: boolean;
|
|
12
15
|
apiKey?: string;
|
|
13
16
|
clientIdentity?: string;
|
|
14
17
|
clientProduct?: string;
|
|
@@ -20,7 +23,7 @@ export interface DocdexClientOptions {
|
|
|
20
23
|
dagSessionId?: string;
|
|
21
24
|
}
|
|
22
25
|
export type DocdexRuntimeErrorCode = "missing_credentials" | "repo_access_denied" | "scope_denied" | "encrypted_operation_disabled" | "docdex_context_missing" | "docdex_api_key_missing" | "docdex_operation_not_allowed" | "docdex_auth_failed" | "docdex_repo_access_denied" | "docdex_unavailable";
|
|
23
|
-
export type DocdexRuntimeOperation = "health" | "initialize" | "search" | "snippet" | "open" | "symbols" | "ast" | "impact_graph" | "impact_diagnostics" | "dag_export" | "tree" | "memory_save" | "memory_recall" | "wakeup" | "diary_read" | "diary_write" | "conversation_read" | "conversation_search" | "kg_query" | "profile_read" | "profile_write" | "web_research" | "chat_context" | "rerank" | "batch_search" | "capabilities" | "stats" | "files" | "repo_inspect" | "index_rebuild" | "index_ingest" | "delegate" | "hooks_validate";
|
|
26
|
+
export type DocdexRuntimeOperation = `catalog:${string}` | "health" | "initialize" | "search" | "snippet" | "open" | "symbols" | "ast" | "impact_graph" | "impact_diagnostics" | "dag_export" | "tree" | "memory_save" | "memory_recall" | "wakeup" | "diary_read" | "diary_write" | "conversation_read" | "conversation_search" | "kg_query" | "profile_read" | "profile_write" | "web_research" | "chat_context" | "rerank" | "batch_search" | "capabilities" | "stats" | "files" | "repo_inspect" | "index_rebuild" | "index_ingest" | "delegate" | "hooks_validate";
|
|
24
27
|
export interface DocdexRuntimeErrorOptions {
|
|
25
28
|
status?: number;
|
|
26
29
|
retryable?: boolean;
|
|
@@ -123,6 +126,12 @@ export declare class DocdexClient {
|
|
|
123
126
|
private mcpInitialize?;
|
|
124
127
|
constructor(options: DocdexClientOptions);
|
|
125
128
|
private fetch;
|
|
129
|
+
private repoRecovery?;
|
|
130
|
+
/** The daemon unmounts a repository it has not served for a while. A long
|
|
131
|
+
* build that had not used Docdex for an hour then got unknown_repo on every
|
|
132
|
+
* structural lookup for the rest of the run. Mount it again, once per
|
|
133
|
+
* failure however many requests are waiting, and let the caller resend. */
|
|
134
|
+
private recoverRepo;
|
|
126
135
|
setRepoId(repoId: string): void;
|
|
127
136
|
getRepoId(): string | undefined;
|
|
128
137
|
getRepoRoot(): string | undefined;
|
|
@@ -173,7 +182,11 @@ export declare class DocdexClient {
|
|
|
173
182
|
chatContext(messages: DocdexChatMessage[], options?: DocdexChatContextOptions): Promise<unknown>;
|
|
174
183
|
dagExport(sessionId: string, options?: DocdexDagOptions): Promise<unknown>;
|
|
175
184
|
private ensureMcpSession;
|
|
176
|
-
callMcp<T>(method: string, params: Record<string, unknown
|
|
185
|
+
callMcp<T>(method: string, params: Record<string, unknown>, timeoutMs?: number, recovered?: boolean): Promise<T>;
|
|
186
|
+
private catalogRequest?;
|
|
187
|
+
listCatalog(): Promise<DocdexCatalogEntry[]>;
|
|
188
|
+
callCatalog<T>(name: string, arguments_: Record<string, unknown>): Promise<T>;
|
|
189
|
+
private catalogRpc;
|
|
177
190
|
private normalizeMcpResult;
|
|
178
191
|
private tryParseJson;
|
|
179
192
|
private buildProjectParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocdexClient.d.ts","sourceRoot":"","sources":["../../src/docdex/DocdexClient.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,wBAAwB,EAEzB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DocdexClient.d.ts","sourceRoot":"","sources":["../../src/docdex/DocdexClient.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,wBAAwB,EAEzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAyC,KAAK,kBAAkB,EAAE,M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f,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,OAAO,CAAC,OAAO,CAAC;IASnB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,OAAO,CAAC;YAwBtE,eAAe;IA4C7B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAWxE,WAAW,CACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GACtD,OAAO,CAAC,OAAO,CAAC;IAgCb,eAAe,CAAC,YAAY,UAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAmC/E"}
|
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { setTimeout as delay } from "node:timers/promises";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { mswarmClientProductHeaders } from "@mcoda/shared";
|
|
6
|
+
import { docdexCatalog, docdexCatalogOperation } from "./DocdexCatalog.js";
|
|
6
7
|
export class DocdexRuntimeError extends Error {
|
|
7
8
|
constructor(code, message, options = {}) {
|
|
8
9
|
super(message);
|
|
@@ -116,6 +117,9 @@ export const normalizeDocdexRuntimeOperation = (value) => {
|
|
|
116
117
|
const aliased = aliases[normalized];
|
|
117
118
|
if (aliased)
|
|
118
119
|
return aliased;
|
|
120
|
+
const catalogName = normalized.replace(/^catalog:/, "").replace(/^docdex_/, "");
|
|
121
|
+
if (docdexCatalogOperation(`docdex_${catalogName}`) && !DOCDEX_RUNTIME_OPERATIONS.has(catalogName))
|
|
122
|
+
return `catalog:${catalogName}`;
|
|
119
123
|
return DOCDEX_RUNTIME_OPERATIONS.has(normalized)
|
|
120
124
|
? normalized
|
|
121
125
|
: undefined;
|
|
@@ -160,13 +164,43 @@ export class DocdexClient {
|
|
|
160
164
|
this.repoId = options.repoId;
|
|
161
165
|
this.dagSessionId = options.dagSessionId;
|
|
162
166
|
}
|
|
163
|
-
async fetch(input, init = {}) {
|
|
164
|
-
const signals = [init.signal, this.options.signal?.(), AbortSignal.timeout(
|
|
167
|
+
async fetch(input, init = {}, timeoutMs = this.options.timeoutMs ?? 60000) {
|
|
168
|
+
const signals = [init.signal, this.options.signal?.(), AbortSignal.timeout(timeoutMs)].filter((signal) => !!signal);
|
|
165
169
|
const signal = AbortSignal.any(signals);
|
|
166
170
|
signal.throwIfAborted();
|
|
167
171
|
await this.options.beforeRequest?.(input);
|
|
168
172
|
signal.throwIfAborted();
|
|
169
|
-
|
|
173
|
+
const response = await globalThis.fetch(input, { ...init, signal, redirect: "error" });
|
|
174
|
+
if (response.status !== 404 || input.endsWith("/v1/initialize"))
|
|
175
|
+
return response;
|
|
176
|
+
const body = typeof response.clone === "function" ? await response.clone().text().catch(() => "") : "";
|
|
177
|
+
if (!/unknown_repo/.test(body))
|
|
178
|
+
return response;
|
|
179
|
+
const previous = this.repoId;
|
|
180
|
+
if (!(await this.recoverRepo()))
|
|
181
|
+
return response;
|
|
182
|
+
const headers = new Headers(init.headers);
|
|
183
|
+
if (this.repoId && headers.has("x-docdex-repo-id"))
|
|
184
|
+
headers.set("x-docdex-repo-id", this.repoId);
|
|
185
|
+
const url = previous && this.repoId && previous !== this.repoId ? input.replace(`repo_id=${encodeURIComponent(previous)}`, `repo_id=${encodeURIComponent(this.repoId)}`) : input;
|
|
186
|
+
signal.throwIfAborted();
|
|
187
|
+
return globalThis.fetch(url, { ...init, headers, signal, redirect: "error" });
|
|
188
|
+
}
|
|
189
|
+
/** The daemon unmounts a repository it has not served for a while. A long
|
|
190
|
+
* build that had not used Docdex for an hour then got unknown_repo on every
|
|
191
|
+
* structural lookup for the rest of the run. Mount it again, once per
|
|
192
|
+
* failure however many requests are waiting, and let the caller resend. */
|
|
193
|
+
recoverRepo() {
|
|
194
|
+
if (!this.options.repoRoot || this.isImmutableRuntimeContext())
|
|
195
|
+
return Promise.resolve(false);
|
|
196
|
+
if (!this.repoRecovery) {
|
|
197
|
+
const previous = this.repoId;
|
|
198
|
+
this.repoId = undefined;
|
|
199
|
+
this.repoRecovery = this.initializeRepo(pathToFileURL(path.resolve(this.options.repoRoot)).toString())
|
|
200
|
+
.then(() => true, () => false)
|
|
201
|
+
.finally(() => { this.repoId ?? (this.repoId = previous); this.repoRecovery = undefined; });
|
|
202
|
+
}
|
|
203
|
+
return this.repoRecovery;
|
|
170
204
|
}
|
|
171
205
|
setRepoId(repoId) {
|
|
172
206
|
this.repoId = repoId;
|
|
@@ -555,6 +589,23 @@ export class DocdexClient {
|
|
|
555
589
|
await this.ensureHealth();
|
|
556
590
|
await this.ensureRepoInitialized();
|
|
557
591
|
const dagSessionId = options.dagSessionId ?? this.dagSessionId;
|
|
592
|
+
if (this.options.localSearchOnly && !this.isEncryptedSearchGateway()) {
|
|
593
|
+
// /search's repo_only flag does not disable its web waterfall on all
|
|
594
|
+
// supported daemons. The batch endpoint performs index retrieval only:
|
|
595
|
+
// no surprise web requests, classifier calls or embedding-memory lookups.
|
|
596
|
+
const response = await this.fetch(`${this.resolveBaseUrl()}/v1/search/batch`, {
|
|
597
|
+
method: "POST", headers: this.buildHeaders(dagSessionId),
|
|
598
|
+
body: JSON.stringify({ queries: [query], limit: options.limit ?? 8, include_libs: false, repo_id: this.repoId }),
|
|
599
|
+
});
|
|
600
|
+
if (!response.ok)
|
|
601
|
+
await this.throwResponseError(response, "local search");
|
|
602
|
+
const payload = await response.json();
|
|
603
|
+
const result = payload.results?.[0];
|
|
604
|
+
if (payload.results?.length !== 1 || result?.query !== query.trim() || payload.truncated || !Array.isArray(result.response?.hits)) {
|
|
605
|
+
throw new Error("Docdex local search returned an invalid or unavailable result; no web fallback was attempted");
|
|
606
|
+
}
|
|
607
|
+
return this.attachResponseMetadata(result.response, response, "search");
|
|
608
|
+
}
|
|
558
609
|
const executeSearch = (searchQuery) => {
|
|
559
610
|
if (this.isEncryptedSearchGateway()) {
|
|
560
611
|
return this.fetch(`${this.resolveBaseUrl()}/search`, {
|
|
@@ -810,8 +861,8 @@ export class DocdexClient {
|
|
|
810
861
|
}
|
|
811
862
|
return body;
|
|
812
863
|
}
|
|
813
|
-
async ensureMcpSession() {
|
|
814
|
-
if (!this.options.authToken || this.options.apiKey || this.mcpSessionId)
|
|
864
|
+
async ensureMcpSession(force = false) {
|
|
865
|
+
if ((!force && !this.options.requireMcpSession && (!this.options.authToken || this.options.apiKey)) || this.mcpSessionId)
|
|
815
866
|
return;
|
|
816
867
|
if (!this.mcpInitialize) {
|
|
817
868
|
this.mcpInitialize = (async () => {
|
|
@@ -841,24 +892,29 @@ export class DocdexClient {
|
|
|
841
892
|
this.mcpInitialize = undefined;
|
|
842
893
|
}
|
|
843
894
|
}
|
|
844
|
-
async callMcp(method, params) {
|
|
895
|
+
async callMcp(method, params, timeoutMs, recovered = false) {
|
|
845
896
|
const operation = MCP_OPERATION_BY_METHOD[method];
|
|
846
897
|
if (operation) {
|
|
847
898
|
this.assertOperationAllowed(operation);
|
|
848
899
|
}
|
|
900
|
+
else
|
|
901
|
+
throw this.runtimeError("docdex_operation_not_allowed", `Unknown Docdex operation: ${method}`, { retryable: false });
|
|
849
902
|
await this.ensureHealth();
|
|
850
903
|
await this.ensureMcpSession();
|
|
904
|
+
// The daemon recognizes the web-specific deadline only on standard MCP
|
|
905
|
+
// tools/call envelopes; a legacy direct method gets the generic 30s limit.
|
|
906
|
+
const standardToolCall = method === "docdex_web_research";
|
|
851
907
|
const payload = {
|
|
852
908
|
jsonrpc: "2.0",
|
|
853
909
|
id: randomUUID(),
|
|
854
|
-
method,
|
|
855
|
-
params,
|
|
910
|
+
method: standardToolCall ? "tools/call" : method,
|
|
911
|
+
params: standardToolCall ? { name: method, arguments: params } : params,
|
|
856
912
|
};
|
|
857
913
|
const response = await this.fetch(`${this.resolveBaseUrl()}/v1/mcp`, {
|
|
858
914
|
method: "POST",
|
|
859
915
|
headers: { ...this.buildHeaders(), ...(this.mcpSessionId ? { "mcp-session-id": this.mcpSessionId } : {}) },
|
|
860
916
|
body: JSON.stringify(payload),
|
|
861
|
-
});
|
|
917
|
+
}, timeoutMs);
|
|
862
918
|
if (!response.ok) {
|
|
863
919
|
if (response.status === 404)
|
|
864
920
|
this.mcpSessionId = undefined;
|
|
@@ -867,14 +923,58 @@ export class DocdexClient {
|
|
|
867
923
|
const raw = (await response.json());
|
|
868
924
|
if (raw.error) {
|
|
869
925
|
const body = JSON.stringify(raw.error);
|
|
926
|
+
if (!recovered && /unknown_repo/.test(body) && await this.recoverRepo())
|
|
927
|
+
return this.callMcp(method, params, timeoutMs, true);
|
|
870
928
|
const code = this.mapResponseErrorCode(500, body);
|
|
871
929
|
throw this.runtimeError(code, raw.error.message ?? "Docdex MCP error", {
|
|
872
930
|
retryable: code === "docdex_unavailable",
|
|
873
|
-
details: { method },
|
|
931
|
+
details: { method, rpcCode: raw.error.code },
|
|
874
932
|
});
|
|
875
933
|
}
|
|
876
934
|
return this.attachResponseMetadata(this.normalizeMcpResult(raw.result), response, operation ?? method);
|
|
877
935
|
}
|
|
936
|
+
async listCatalog() {
|
|
937
|
+
this.assertOperationAllowed("capabilities");
|
|
938
|
+
return this.catalogRequest ?? (this.catalogRequest = this.catalogRpc("tools/list", {}).then(result => {
|
|
939
|
+
if (!Array.isArray(result.tools))
|
|
940
|
+
throw this.runtimeError("docdex_unavailable", "Invalid Docdex tool catalog");
|
|
941
|
+
return result.tools;
|
|
942
|
+
}).catch(error => { this.catalogRequest = undefined; throw error; }));
|
|
943
|
+
}
|
|
944
|
+
async callCatalog(name, arguments_) {
|
|
945
|
+
const operation = MCP_OPERATION_BY_METHOD[name] ?? normalizeDocdexRuntimeOperation(name);
|
|
946
|
+
if (!operation || !docdexCatalogOperation(name))
|
|
947
|
+
throw this.runtimeError("docdex_operation_not_allowed", `Unclassified Docdex catalog tool: ${name}`, { retryable: false });
|
|
948
|
+
this.assertOperationAllowed(operation);
|
|
949
|
+
// Discover only after operation authorization, never to bypass job scopes.
|
|
950
|
+
const catalog = await this.listCatalog();
|
|
951
|
+
const advertised = catalog.find(tool => tool.name === name), bundled = docdexCatalog.find(tool => tool.name === name);
|
|
952
|
+
if (!advertised)
|
|
953
|
+
throw this.runtimeError("docdex_unavailable", `This Docdex runtime does not advertise ${name}`, { retryable: false });
|
|
954
|
+
const canonical = (value) => Array.isArray(value) ? value.map(canonical) : value && typeof value === "object"
|
|
955
|
+
? Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)])) : value;
|
|
956
|
+
if (JSON.stringify(canonical(advertised.inputSchema)) !== JSON.stringify(canonical(bundled.inputSchema)))
|
|
957
|
+
throw this.runtimeError("docdex_unavailable", `Docdex schema changed for ${name}; refresh the versioned catalog before executing`, { retryable: false });
|
|
958
|
+
return this.catalogRpc("tools/call", { name, arguments: arguments_ });
|
|
959
|
+
}
|
|
960
|
+
async catalogRpc(method, params) {
|
|
961
|
+
await this.ensureHealth();
|
|
962
|
+
await this.ensureMcpSession(true);
|
|
963
|
+
const response = await this.fetch(`${this.resolveBaseUrl()}/v1/mcp`, { method: "POST",
|
|
964
|
+
headers: { ...this.buildHeaders(), "mcp-session-id": this.mcpSessionId },
|
|
965
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: randomUUID(), method, params }) });
|
|
966
|
+
if (!response.ok) {
|
|
967
|
+
if (response.status === 404) {
|
|
968
|
+
this.mcpSessionId = undefined;
|
|
969
|
+
this.catalogRequest = undefined;
|
|
970
|
+
}
|
|
971
|
+
await this.throwResponseError(response, "MCP catalog");
|
|
972
|
+
}
|
|
973
|
+
const body = await response.json();
|
|
974
|
+
if (body.error)
|
|
975
|
+
throw this.runtimeError("docdex_unavailable", body.error.message ?? "Docdex catalog operation failed", { retryable: false });
|
|
976
|
+
return this.attachResponseMetadata(this.normalizeMcpResult(body.result), response, method);
|
|
977
|
+
}
|
|
878
978
|
normalizeMcpResult(payload) {
|
|
879
979
|
if (!payload || typeof payload !== "object")
|
|
880
980
|
return payload;
|
|
@@ -1068,7 +1168,14 @@ export class DocdexClient {
|
|
|
1068
1168
|
skip_local_search: options.skipLocalSearch,
|
|
1069
1169
|
web_limit: options.webLimit,
|
|
1070
1170
|
no_cache: options.noCache,
|
|
1071
|
-
})).catch(
|
|
1171
|
+
}), this.options.webTimeoutMs ?? 90000).catch(error => {
|
|
1172
|
+
// Only a confirmed missing transport can use the compatibility endpoint.
|
|
1173
|
+
// A timeout may still be fetching pages or using the metered helper.
|
|
1174
|
+
if (error instanceof DocdexRuntimeError && ([404, 405].includes(error.status ?? 0) || error.details?.rpcCode === -32601)) {
|
|
1175
|
+
return this.webResearchHttp(query, options);
|
|
1176
|
+
}
|
|
1177
|
+
throw error;
|
|
1178
|
+
});
|
|
1072
1179
|
}
|
|
1073
1180
|
async webResearchHttp(query, options = {}) {
|
|
1074
1181
|
this.assertOperationAllowed("web_research");
|
|
@@ -1103,7 +1210,7 @@ export class DocdexClient {
|
|
|
1103
1210
|
this.withRepoId(params);
|
|
1104
1211
|
const response = await this.fetch(`${this.resolveBaseUrl()}/search?${params.toString()}`, {
|
|
1105
1212
|
headers: this.buildHeaders(this.dagSessionId),
|
|
1106
|
-
});
|
|
1213
|
+
}, this.options.webTimeoutMs ?? 90000);
|
|
1107
1214
|
if (!response.ok) {
|
|
1108
1215
|
await this.throwResponseError(response, "web research");
|
|
1109
1216
|
}
|
|
@@ -10,6 +10,7 @@ export declare class ManagedDocdex {
|
|
|
10
10
|
private abort?;
|
|
11
11
|
private diagnostic;
|
|
12
12
|
private activeRequests;
|
|
13
|
+
private recovery?;
|
|
13
14
|
private readonly lifetime;
|
|
14
15
|
constructor(options: {
|
|
15
16
|
workspaceRoot: string;
|
|
@@ -21,9 +22,12 @@ export declare class ManagedDocdex {
|
|
|
21
22
|
signal?: AbortSignal;
|
|
22
23
|
allowWeb?: boolean;
|
|
23
24
|
startupTimeoutMs?: number;
|
|
25
|
+
webSearch?: (query: string, signal: AbortSignal) => Promise<unknown>;
|
|
24
26
|
onStatus?: (status: string) => void;
|
|
27
|
+
isolatedIndex?: boolean;
|
|
25
28
|
});
|
|
26
29
|
start(): Promise<DocdexClient>;
|
|
30
|
+
private startOnce;
|
|
27
31
|
close(): Promise<void>;
|
|
28
32
|
}
|
|
29
33
|
//# sourceMappingURL=ManagedDocdex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedDocdex.d.ts","sourceRoot":"","sources":["../../src/docdex/ManagedDocdex.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAajD,wFAAwF;AACxF,qBAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"ManagedDocdex.d.ts","sourceRoot":"","sources":["../../src/docdex/ManagedDocdex.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAajD,wFAAwF;AACxF,qBAAa,aAAa;IASZ,OAAO,CAAC,QAAQ,CAAC,OAAO;IARpC,OAAO,CAAC,KAAK,CAAC,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,KAAK,CAAC,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,C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