@burtson-labs/stealth-core-runtime 1.4.7
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/LICENSE +201 -0
- package/README.md +46 -0
- package/dist/banditEngineProvider.d.ts +48 -0
- package/dist/banditEngineProvider.d.ts.map +1 -0
- package/dist/banditEngineProvider.js +1021 -0
- package/dist/banditEngineProvider.js.map +1 -0
- package/dist/embeddingCache.d.ts +23 -0
- package/dist/embeddingCache.d.ts.map +1 -0
- package/dist/embeddingCache.js +196 -0
- package/dist/embeddingCache.js.map +1 -0
- package/dist/embeddingClient.d.ts +35 -0
- package/dist/embeddingClient.d.ts.map +1 -0
- package/dist/embeddingClient.js +162 -0
- package/dist/embeddingClient.js.map +1 -0
- package/dist/executorAgent.d.ts +7 -0
- package/dist/executorAgent.d.ts.map +1 -0
- package/dist/executorAgent.js +95 -0
- package/dist/executorAgent.js.map +1 -0
- package/dist/extensionSystemPrompt.d.ts +80 -0
- package/dist/extensionSystemPrompt.d.ts.map +1 -0
- package/dist/extensionSystemPrompt.js +208 -0
- package/dist/extensionSystemPrompt.js.map +1 -0
- package/dist/gatewaySearchAdapter.d.ts +69 -0
- package/dist/gatewaySearchAdapter.d.ts.map +1 -0
- package/dist/gatewaySearchAdapter.js +131 -0
- package/dist/gatewaySearchAdapter.js.map +1 -0
- package/dist/goalInference.d.ts +26 -0
- package/dist/goalInference.d.ts.map +1 -0
- package/dist/goalInference.js +605 -0
- package/dist/goalInference.js.map +1 -0
- package/dist/hostTypes.d.ts +86 -0
- package/dist/hostTypes.d.ts.map +1 -0
- package/dist/hostTypes.js +3 -0
- package/dist/hostTypes.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/internalTypes.d.ts +16 -0
- package/dist/internalTypes.d.ts.map +1 -0
- package/dist/internalTypes.js +20 -0
- package/dist/internalTypes.js.map +1 -0
- package/dist/ollamaEmbeddingClient.d.ts +45 -0
- package/dist/ollamaEmbeddingClient.d.ts.map +1 -0
- package/dist/ollamaEmbeddingClient.js +143 -0
- package/dist/ollamaEmbeddingClient.js.map +1 -0
- package/dist/pdfjsShim.d.ts +2 -0
- package/dist/pdfjsShim.d.ts.map +1 -0
- package/dist/pdfjsShim.js +80 -0
- package/dist/pdfjsShim.js.map +1 -0
- package/dist/runtime/actionRuntime.d.ts +13 -0
- package/dist/runtime/actionRuntime.d.ts.map +1 -0
- package/dist/runtime/actionRuntime.js +15 -0
- package/dist/runtime/actionRuntime.js.map +1 -0
- package/dist/runtime/actionServices.d.ts +72 -0
- package/dist/runtime/actionServices.d.ts.map +1 -0
- package/dist/runtime/actionServices.js +53 -0
- package/dist/runtime/actionServices.js.map +1 -0
- package/dist/runtime/adapters/connectorBus.d.ts +9 -0
- package/dist/runtime/adapters/connectorBus.d.ts.map +1 -0
- package/dist/runtime/adapters/connectorBus.js +20 -0
- package/dist/runtime/adapters/connectorBus.js.map +1 -0
- package/dist/runtime/adapters/fsAdapter.d.ts +6 -0
- package/dist/runtime/adapters/fsAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/fsAdapter.js +144 -0
- package/dist/runtime/adapters/fsAdapter.js.map +1 -0
- package/dist/runtime/adapters/llmAdapter.d.ts +4 -0
- package/dist/runtime/adapters/llmAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/llmAdapter.js +12 -0
- package/dist/runtime/adapters/llmAdapter.js.map +1 -0
- package/dist/runtime/adapters/shellAdapter.d.ts +6 -0
- package/dist/runtime/adapters/shellAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/shellAdapter.js +118 -0
- package/dist/runtime/adapters/shellAdapter.js.map +1 -0
- package/dist/runtime/additionalWrites.d.ts +22 -0
- package/dist/runtime/additionalWrites.d.ts.map +1 -0
- package/dist/runtime/additionalWrites.js +148 -0
- package/dist/runtime/additionalWrites.js.map +1 -0
- package/dist/runtime/artifactManager.d.ts +32 -0
- package/dist/runtime/artifactManager.d.ts.map +1 -0
- package/dist/runtime/artifactManager.js +154 -0
- package/dist/runtime/artifactManager.js.map +1 -0
- package/dist/runtime/autoHealer.d.ts +27 -0
- package/dist/runtime/autoHealer.d.ts.map +1 -0
- package/dist/runtime/autoHealer.js +583 -0
- package/dist/runtime/autoHealer.js.map +1 -0
- package/dist/runtime/changeTracker.d.ts +20 -0
- package/dist/runtime/changeTracker.d.ts.map +1 -0
- package/dist/runtime/changeTracker.js +147 -0
- package/dist/runtime/changeTracker.js.map +1 -0
- package/dist/runtime/contextBuilder.d.ts +85 -0
- package/dist/runtime/contextBuilder.d.ts.map +1 -0
- package/dist/runtime/contextBuilder.js +159 -0
- package/dist/runtime/contextBuilder.js.map +1 -0
- package/dist/runtime/coreRuntime.d.ts +7 -0
- package/dist/runtime/coreRuntime.d.ts.map +1 -0
- package/dist/runtime/coreRuntime.js +173 -0
- package/dist/runtime/coreRuntime.js.map +1 -0
- package/dist/runtime/createStealthRuntime.d.ts +4 -0
- package/dist/runtime/createStealthRuntime.d.ts.map +1 -0
- package/dist/runtime/createStealthRuntime.js +514 -0
- package/dist/runtime/createStealthRuntime.js.map +1 -0
- package/dist/runtime/diagnostics.d.ts +53 -0
- package/dist/runtime/diagnostics.d.ts.map +1 -0
- package/dist/runtime/diagnostics.js +396 -0
- package/dist/runtime/diagnostics.js.map +1 -0
- package/dist/runtime/diagnosticsServices.d.ts +51 -0
- package/dist/runtime/diagnosticsServices.d.ts.map +1 -0
- package/dist/runtime/diagnosticsServices.js +46 -0
- package/dist/runtime/diagnosticsServices.js.map +1 -0
- package/dist/runtime/diffManager.d.ts +20 -0
- package/dist/runtime/diffManager.d.ts.map +1 -0
- package/dist/runtime/diffManager.js +172 -0
- package/dist/runtime/diffManager.js.map +1 -0
- package/dist/runtime/diffPresenter.d.ts +8 -0
- package/dist/runtime/diffPresenter.d.ts.map +1 -0
- package/dist/runtime/diffPresenter.js +57 -0
- package/dist/runtime/diffPresenter.js.map +1 -0
- package/dist/runtime/embeddingClientResolver.d.ts +14 -0
- package/dist/runtime/embeddingClientResolver.d.ts.map +1 -0
- package/dist/runtime/embeddingClientResolver.js +54 -0
- package/dist/runtime/embeddingClientResolver.js.map +1 -0
- package/dist/runtime/embeddingManager.d.ts +22 -0
- package/dist/runtime/embeddingManager.d.ts.map +1 -0
- package/dist/runtime/embeddingManager.js +224 -0
- package/dist/runtime/embeddingManager.js.map +1 -0
- package/dist/runtime/eventBus.d.ts +7 -0
- package/dist/runtime/eventBus.d.ts.map +1 -0
- package/dist/runtime/eventBus.js +28 -0
- package/dist/runtime/eventBus.js.map +1 -0
- package/dist/runtime/executorServices.d.ts +46 -0
- package/dist/runtime/executorServices.d.ts.map +1 -0
- package/dist/runtime/executorServices.js +47 -0
- package/dist/runtime/executorServices.js.map +1 -0
- package/dist/runtime/extractionService.d.ts +11 -0
- package/dist/runtime/extractionService.d.ts.map +1 -0
- package/dist/runtime/extractionService.js +282 -0
- package/dist/runtime/extractionService.js.map +1 -0
- package/dist/runtime/feedbackService.d.ts +12 -0
- package/dist/runtime/feedbackService.d.ts.map +1 -0
- package/dist/runtime/feedbackService.js +111 -0
- package/dist/runtime/feedbackService.js.map +1 -0
- package/dist/runtime/goalEngine.d.ts +10 -0
- package/dist/runtime/goalEngine.d.ts.map +1 -0
- package/dist/runtime/goalEngine.js +429 -0
- package/dist/runtime/goalEngine.js.map +1 -0
- package/dist/runtime/goalFlowServices.d.ts +49 -0
- package/dist/runtime/goalFlowServices.d.ts.map +1 -0
- package/dist/runtime/goalFlowServices.js +45 -0
- package/dist/runtime/goalFlowServices.js.map +1 -0
- package/dist/runtime/goalReplay.d.ts +33 -0
- package/dist/runtime/goalReplay.d.ts.map +1 -0
- package/dist/runtime/goalReplay.js +58 -0
- package/dist/runtime/goalReplay.js.map +1 -0
- package/dist/runtime/goalRunner.d.ts +35 -0
- package/dist/runtime/goalRunner.d.ts.map +1 -0
- package/dist/runtime/goalRunner.js +42 -0
- package/dist/runtime/goalRunner.js.map +1 -0
- package/dist/runtime/healingEngine.d.ts +72 -0
- package/dist/runtime/healingEngine.d.ts.map +1 -0
- package/dist/runtime/healingEngine.js +969 -0
- package/dist/runtime/healingEngine.js.map +1 -0
- package/dist/runtime/healingServices.d.ts +62 -0
- package/dist/runtime/healingServices.d.ts.map +1 -0
- package/dist/runtime/healingServices.js +45 -0
- package/dist/runtime/healingServices.js.map +1 -0
- package/dist/runtime/helpers.d.ts +22 -0
- package/dist/runtime/helpers.d.ts.map +1 -0
- package/dist/runtime/helpers.js +694 -0
- package/dist/runtime/helpers.js.map +1 -0
- package/dist/runtime/hosts/actionHost.d.ts +82 -0
- package/dist/runtime/hosts/actionHost.d.ts.map +1 -0
- package/dist/runtime/hosts/actionHost.js +61 -0
- package/dist/runtime/hosts/actionHost.js.map +1 -0
- package/dist/runtime/hosts/baseServices.d.ts +51 -0
- package/dist/runtime/hosts/baseServices.d.ts.map +1 -0
- package/dist/runtime/hosts/baseServices.js +73 -0
- package/dist/runtime/hosts/baseServices.js.map +1 -0
- package/dist/runtime/hosts/embeddingServices.d.ts +25 -0
- package/dist/runtime/hosts/embeddingServices.d.ts.map +1 -0
- package/dist/runtime/hosts/embeddingServices.js +34 -0
- package/dist/runtime/hosts/embeddingServices.js.map +1 -0
- package/dist/runtime/hosts/goalFlowHost.d.ts +34 -0
- package/dist/runtime/hosts/goalFlowHost.d.ts.map +1 -0
- package/dist/runtime/hosts/goalFlowHost.js +35 -0
- package/dist/runtime/hosts/goalFlowHost.js.map +1 -0
- package/dist/runtime/hosts/goalFlowRuntime.d.ts +41 -0
- package/dist/runtime/hosts/goalFlowRuntime.d.ts.map +1 -0
- package/dist/runtime/hosts/goalFlowRuntime.js +31 -0
- package/dist/runtime/hosts/goalFlowRuntime.js.map +1 -0
- package/dist/runtime/hosts/providerHost.d.ts +19 -0
- package/dist/runtime/hosts/providerHost.d.ts.map +1 -0
- package/dist/runtime/hosts/providerHost.js +18 -0
- package/dist/runtime/hosts/providerHost.js.map +1 -0
- package/dist/runtime/hosts/rewriteHost.d.ts +84 -0
- package/dist/runtime/hosts/rewriteHost.d.ts.map +1 -0
- package/dist/runtime/hosts/rewriteHost.js +64 -0
- package/dist/runtime/hosts/rewriteHost.js.map +1 -0
- package/dist/runtime/hosts/workspaceHost.d.ts +113 -0
- package/dist/runtime/hosts/workspaceHost.d.ts.map +1 -0
- package/dist/runtime/hosts/workspaceHost.js +76 -0
- package/dist/runtime/hosts/workspaceHost.js.map +1 -0
- package/dist/runtime/index.d.ts +78 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +95 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/insight.d.ts +16 -0
- package/dist/runtime/insight.d.ts.map +1 -0
- package/dist/runtime/insight.js +11 -0
- package/dist/runtime/insight.js.map +1 -0
- package/dist/runtime/internalActions.d.ts +16 -0
- package/dist/runtime/internalActions.d.ts.map +1 -0
- package/dist/runtime/internalActions.js +302 -0
- package/dist/runtime/internalActions.js.map +1 -0
- package/dist/runtime/modelBehavior.d.ts +69 -0
- package/dist/runtime/modelBehavior.d.ts.map +1 -0
- package/dist/runtime/modelBehavior.js +514 -0
- package/dist/runtime/modelBehavior.js.map +1 -0
- package/dist/runtime/modelCapabilities.d.ts +139 -0
- package/dist/runtime/modelCapabilities.d.ts.map +1 -0
- package/dist/runtime/modelCapabilities.js +458 -0
- package/dist/runtime/modelCapabilities.js.map +1 -0
- package/dist/runtime/modelsDevCatalog.d.ts +34 -0
- package/dist/runtime/modelsDevCatalog.d.ts.map +1 -0
- package/dist/runtime/modelsDevCatalog.js +263 -0
- package/dist/runtime/modelsDevCatalog.js.map +1 -0
- package/dist/runtime/pendingInference.d.ts +18 -0
- package/dist/runtime/pendingInference.d.ts.map +1 -0
- package/dist/runtime/pendingInference.js +121 -0
- package/dist/runtime/pendingInference.js.map +1 -0
- package/dist/runtime/persistence.d.ts +21 -0
- package/dist/runtime/persistence.d.ts.map +1 -0
- package/dist/runtime/persistence.js +73 -0
- package/dist/runtime/persistence.js.map +1 -0
- package/dist/runtime/planContext.d.ts +42 -0
- package/dist/runtime/planContext.d.ts.map +1 -0
- package/dist/runtime/planContext.js +246 -0
- package/dist/runtime/planContext.js.map +1 -0
- package/dist/runtime/planGenerator.d.ts +21 -0
- package/dist/runtime/planGenerator.d.ts.map +1 -0
- package/dist/runtime/planGenerator.js +89 -0
- package/dist/runtime/planGenerator.js.map +1 -0
- package/dist/runtime/planPreparation.d.ts +64 -0
- package/dist/runtime/planPreparation.d.ts.map +1 -0
- package/dist/runtime/planPreparation.js +173 -0
- package/dist/runtime/planPreparation.js.map +1 -0
- package/dist/runtime/projectSummary.d.ts +3 -0
- package/dist/runtime/projectSummary.d.ts.map +1 -0
- package/dist/runtime/projectSummary.js +42 -0
- package/dist/runtime/projectSummary.js.map +1 -0
- package/dist/runtime/providerSettings.d.ts +28 -0
- package/dist/runtime/providerSettings.d.ts.map +1 -0
- package/dist/runtime/providerSettings.js +93 -0
- package/dist/runtime/providerSettings.js.map +1 -0
- package/dist/runtime/pythonActions.d.ts +78 -0
- package/dist/runtime/pythonActions.d.ts.map +1 -0
- package/dist/runtime/pythonActions.js +392 -0
- package/dist/runtime/pythonActions.js.map +1 -0
- package/dist/runtime/pythonBridge.d.ts +13 -0
- package/dist/runtime/pythonBridge.d.ts.map +1 -0
- package/dist/runtime/pythonBridge.js +117 -0
- package/dist/runtime/pythonBridge.js.map +1 -0
- package/dist/runtime/rewriteEngine.d.ts +46 -0
- package/dist/runtime/rewriteEngine.d.ts.map +1 -0
- package/dist/runtime/rewriteEngine.js +259 -0
- package/dist/runtime/rewriteEngine.js.map +1 -0
- package/dist/runtime/rewriteGenerator.d.ts +29 -0
- package/dist/runtime/rewriteGenerator.d.ts.map +1 -0
- package/dist/runtime/rewriteGenerator.js +1527 -0
- package/dist/runtime/rewriteGenerator.js.map +1 -0
- package/dist/runtime/rewriteHydration.d.ts +22 -0
- package/dist/runtime/rewriteHydration.d.ts.map +1 -0
- package/dist/runtime/rewriteHydration.js +265 -0
- package/dist/runtime/rewriteHydration.js.map +1 -0
- package/dist/runtime/rewriteOrchestration.d.ts +105 -0
- package/dist/runtime/rewriteOrchestration.d.ts.map +1 -0
- package/dist/runtime/rewriteOrchestration.js +130 -0
- package/dist/runtime/rewriteOrchestration.js.map +1 -0
- package/dist/runtime/rewritePayload.d.ts +18 -0
- package/dist/runtime/rewritePayload.d.ts.map +1 -0
- package/dist/runtime/rewritePayload.js +166 -0
- package/dist/runtime/rewritePayload.js.map +1 -0
- package/dist/runtime/rewriteRuntime.d.ts +13 -0
- package/dist/runtime/rewriteRuntime.d.ts.map +1 -0
- package/dist/runtime/rewriteRuntime.js +21 -0
- package/dist/runtime/rewriteRuntime.js.map +1 -0
- package/dist/runtime/rewriteServices.d.ts +70 -0
- package/dist/runtime/rewriteServices.d.ts.map +1 -0
- package/dist/runtime/rewriteServices.js +50 -0
- package/dist/runtime/rewriteServices.js.map +1 -0
- package/dist/runtime/runtimeHelpers.d.ts +9 -0
- package/dist/runtime/runtimeHelpers.d.ts.map +1 -0
- package/dist/runtime/runtimeHelpers.js +86 -0
- package/dist/runtime/runtimeHelpers.js.map +1 -0
- package/dist/runtime/sessionData.d.ts +4 -0
- package/dist/runtime/sessionData.d.ts.map +1 -0
- package/dist/runtime/sessionData.js +45 -0
- package/dist/runtime/sessionData.js.map +1 -0
- package/dist/runtime/sessionRuntime.d.ts +47 -0
- package/dist/runtime/sessionRuntime.d.ts.map +1 -0
- package/dist/runtime/sessionRuntime.js +128 -0
- package/dist/runtime/sessionRuntime.js.map +1 -0
- package/dist/runtime/stealthRuntimeTypes.d.ts +12 -0
- package/dist/runtime/stealthRuntimeTypes.d.ts.map +1 -0
- package/dist/runtime/stealthRuntimeTypes.js +3 -0
- package/dist/runtime/stealthRuntimeTypes.js.map +1 -0
- package/dist/runtime/stepExecutor.d.ts +22 -0
- package/dist/runtime/stepExecutor.d.ts.map +1 -0
- package/dist/runtime/stepExecutor.js +83 -0
- package/dist/runtime/stepExecutor.js.map +1 -0
- package/dist/runtime/stepLifecycle.d.ts +29 -0
- package/dist/runtime/stepLifecycle.d.ts.map +1 -0
- package/dist/runtime/stepLifecycle.js +122 -0
- package/dist/runtime/stepLifecycle.js.map +1 -0
- package/dist/runtime/stepMetadata.d.ts +6 -0
- package/dist/runtime/stepMetadata.d.ts.map +1 -0
- package/dist/runtime/stepMetadata.js +87 -0
- package/dist/runtime/stepMetadata.js.map +1 -0
- package/dist/runtime/taskQueue.d.ts +16 -0
- package/dist/runtime/taskQueue.d.ts.map +1 -0
- package/dist/runtime/taskQueue.js +103 -0
- package/dist/runtime/taskQueue.js.map +1 -0
- package/dist/runtime/telemetry.d.ts +6 -0
- package/dist/runtime/telemetry.d.ts.map +1 -0
- package/dist/runtime/telemetry.js +42 -0
- package/dist/runtime/telemetry.js.map +1 -0
- package/dist/runtime/telemetryHub.d.ts +61 -0
- package/dist/runtime/telemetryHub.d.ts.map +1 -0
- package/dist/runtime/telemetryHub.js +190 -0
- package/dist/runtime/telemetryHub.js.map +1 -0
- package/dist/runtime/textSanitizer.d.ts +4 -0
- package/dist/runtime/textSanitizer.d.ts.map +1 -0
- package/dist/runtime/textSanitizer.js +86 -0
- package/dist/runtime/textSanitizer.js.map +1 -0
- package/dist/runtime/typeCheckRunner.d.ts +33 -0
- package/dist/runtime/typeCheckRunner.d.ts.map +1 -0
- package/dist/runtime/typeCheckRunner.js +357 -0
- package/dist/runtime/typeCheckRunner.js.map +1 -0
- package/dist/runtime/types.d.ts +334 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +3 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/typescriptValidator.d.ts +18 -0
- package/dist/runtime/typescriptValidator.d.ts.map +1 -0
- package/dist/runtime/typescriptValidator.js +363 -0
- package/dist/runtime/typescriptValidator.js.map +1 -0
- package/dist/runtime/undoManager.d.ts +7 -0
- package/dist/runtime/undoManager.d.ts.map +1 -0
- package/dist/runtime/undoManager.js +56 -0
- package/dist/runtime/undoManager.js.map +1 -0
- package/dist/runtime/validationController.d.ts +11 -0
- package/dist/runtime/validationController.d.ts.map +1 -0
- package/dist/runtime/validationController.js +29 -0
- package/dist/runtime/validationController.js.map +1 -0
- package/dist/runtime/validationUtils.d.ts +17 -0
- package/dist/runtime/validationUtils.d.ts.map +1 -0
- package/dist/runtime/validationUtils.js +121 -0
- package/dist/runtime/validationUtils.js.map +1 -0
- package/dist/runtime/workspaceAssertions.d.ts +21 -0
- package/dist/runtime/workspaceAssertions.d.ts.map +1 -0
- package/dist/runtime/workspaceAssertions.js +183 -0
- package/dist/runtime/workspaceAssertions.js.map +1 -0
- package/dist/runtime/workspaceIndexService.d.ts +24 -0
- package/dist/runtime/workspaceIndexService.d.ts.map +1 -0
- package/dist/runtime/workspaceIndexService.js +133 -0
- package/dist/runtime/workspaceIndexService.js.map +1 -0
- package/dist/runtime/workspaceIndexer.d.ts +21 -0
- package/dist/runtime/workspaceIndexer.d.ts.map +1 -0
- package/dist/runtime/workspaceIndexer.js +95 -0
- package/dist/runtime/workspaceIndexer.js.map +1 -0
- package/dist/runtime/workspacePackages.d.ts +22 -0
- package/dist/runtime/workspacePackages.d.ts.map +1 -0
- package/dist/runtime/workspacePackages.js +198 -0
- package/dist/runtime/workspacePackages.js.map +1 -0
- package/dist/runtime/workspaceRuntime.d.ts +58 -0
- package/dist/runtime/workspaceRuntime.d.ts.map +1 -0
- package/dist/runtime/workspaceRuntime.js +86 -0
- package/dist/runtime/workspaceRuntime.js.map +1 -0
- package/dist/runtime/workspaceService.d.ts +14 -0
- package/dist/runtime/workspaceService.d.ts.map +1 -0
- package/dist/runtime/workspaceService.js +88 -0
- package/dist/runtime/workspaceService.js.map +1 -0
- package/dist/runtime/workspaceServices.d.ts +114 -0
- package/dist/runtime/workspaceServices.d.ts.map +1 -0
- package/dist/runtime/workspaceServices.js +114 -0
- package/dist/runtime/workspaceServices.js.map +1 -0
- package/dist/runtime/writeServices.d.ts +34 -0
- package/dist/runtime/writeServices.d.ts.map +1 -0
- package/dist/runtime/writeServices.js +32 -0
- package/dist/runtime/writeServices.js.map +1 -0
- package/dist/sharedPromptSections.d.ts +58 -0
- package/dist/sharedPromptSections.d.ts.map +1 -0
- package/dist/sharedPromptSections.js +94 -0
- package/dist/sharedPromptSections.js.map +1 -0
- package/dist/statusTypes.d.ts +13 -0
- package/dist/statusTypes.d.ts.map +1 -0
- package/dist/statusTypes.js +3 -0
- package/dist/statusTypes.js.map +1 -0
- package/dist/streamIdleTimeout.d.ts +38 -0
- package/dist/streamIdleTimeout.d.ts.map +1 -0
- package/dist/streamIdleTimeout.js +44 -0
- package/dist/streamIdleTimeout.js.map +1 -0
- package/dist/types/bandit.d.ts +113 -0
- package/dist/types/bandit.d.ts.map +1 -0
- package/dist/types/bandit.js +3 -0
- package/dist/types/bandit.js.map +1 -0
- package/dist/types.d.ts +152 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/workspaceIndex.d.ts +44 -0
- package/dist/workspaceIndex.d.ts.map +1 -0
- package/dist/workspaceIndex.js +258 -0
- package/dist/workspaceIndex.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createWorkspaceServices = createWorkspaceServices;
|
|
4
|
+
const diffPresenter_1 = require("./diffPresenter");
|
|
5
|
+
const helpers_1 = require("./helpers");
|
|
6
|
+
const diffManager_1 = require("./diffManager");
|
|
7
|
+
const undoManager_1 = require("./undoManager");
|
|
8
|
+
const artifactManager_1 = require("./artifactManager");
|
|
9
|
+
const workspacePackages_1 = require("./workspacePackages");
|
|
10
|
+
const workspaceIndexService_1 = require("./workspaceIndexService");
|
|
11
|
+
const typescriptValidator_1 = require("./typescriptValidator");
|
|
12
|
+
const planPreparation_1 = require("./planPreparation");
|
|
13
|
+
function createWorkspaceServices(deps) {
|
|
14
|
+
const workspaceRoot = () => deps.getLastWorkspaceRoot() ?? deps.getWorkspaceRoot();
|
|
15
|
+
const diffManager = (0, diffManager_1.createDiffManager)({
|
|
16
|
+
postSnapshot: async ({ path, diff, summary, confidence }) => {
|
|
17
|
+
const snapshotDiff = typeof diff === 'string' ? (0, diffPresenter_1.clampDiffPreview)(diff, 200) : '';
|
|
18
|
+
await deps.telemetryHub.postDiffSnapshot({
|
|
19
|
+
path,
|
|
20
|
+
diff: snapshotDiff,
|
|
21
|
+
summary,
|
|
22
|
+
confidence
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
postStream: (update) => deps.telemetryHub.postDiffStream(update),
|
|
26
|
+
computeDiff: (before, after, relativePath) => deps.computeDiff(before, after, relativePath),
|
|
27
|
+
summarizeDiff: (diff) => (0, diffPresenter_1.summarizeDiff)(diff)
|
|
28
|
+
});
|
|
29
|
+
const undoManager = (0, undoManager_1.createUndoManager)({
|
|
30
|
+
diffManager,
|
|
31
|
+
fs: deps.fs
|
|
32
|
+
});
|
|
33
|
+
const artifactManager = (0, artifactManager_1.createArtifactManager)({
|
|
34
|
+
fs: deps.fs,
|
|
35
|
+
resolvePlanRunDirectory: (root) => deps.resolvePlanRunDirectory(root),
|
|
36
|
+
getRunContext: () => deps.getRunContext(),
|
|
37
|
+
writeWorkspaceFile: (target, content) => deps.workspace.writeFile(target, content, 'utf8'),
|
|
38
|
+
readWorkspaceFile: (target) => deps.workspace.readFile(target)
|
|
39
|
+
});
|
|
40
|
+
const workspacePackageManager = (0, workspacePackages_1.createWorkspacePackageManager)({
|
|
41
|
+
readWorkspaceFile: (target) => deps.workspace.readFile(target),
|
|
42
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
43
|
+
spawnValidationProcess: (command, args, cwd) => deps.validationUtils.spawnValidationProcess(command, args, cwd),
|
|
44
|
+
getCommandName: (base) => deps.validationUtils.getCommandName(base)
|
|
45
|
+
});
|
|
46
|
+
const workspaceIndex = (0, workspaceIndexService_1.createWorkspaceIndexService)({
|
|
47
|
+
getWorkspaceRoot: () => workspaceRoot(),
|
|
48
|
+
getArtifactRoot: (root) => artifactManager.getArtifactRootOrDefault(root),
|
|
49
|
+
setWorkspaceIndexContext: (summary) => deps.setContextValue('workspace.index', summary),
|
|
50
|
+
postStatus: (snapshot) => deps.telemetryHub.postWorkspaceIndexStatus(snapshot),
|
|
51
|
+
updateWorkspacePackages: (snapshot) => workspacePackageManager.updateFromSnapshot(snapshot),
|
|
52
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value)
|
|
53
|
+
});
|
|
54
|
+
const helperManager = (0, helpers_1.createHelperManager)({
|
|
55
|
+
fs: deps.fs,
|
|
56
|
+
getWorkspaceRoot: () => workspaceRoot(),
|
|
57
|
+
getContextValue: (key) => deps.getContextValue(key),
|
|
58
|
+
setContextValue: (key, value) => deps.setContextValue(key, value),
|
|
59
|
+
runTypeCheck: (options) => deps.runTypeCheck(options),
|
|
60
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
61
|
+
resolveWorkspaceImportTarget: (relativePath) => workspaceIndex.resolveImportTarget(relativePath, deps.helperImportExtensions),
|
|
62
|
+
ensureWorkspaceIndex: () => deps.loadWorkspaceIndex().then(() => undefined),
|
|
63
|
+
conversationMarkerPatterns: deps.conversationMarkerPatterns,
|
|
64
|
+
clampSnippet: (content, limit) => deps.clampSnippet(content, limit)
|
|
65
|
+
});
|
|
66
|
+
const typescriptValidator = (0, typescriptValidator_1.createTypeScriptValidator)({
|
|
67
|
+
telemetry: deps.telemetry,
|
|
68
|
+
shouldSkipValidations: () => deps.validationController.shouldSkipValidations(),
|
|
69
|
+
getWorkspaceRoot: () => workspaceRoot(),
|
|
70
|
+
findTsConfigFile: () => deps.validationUtils.findTsConfigFile(),
|
|
71
|
+
buildValidationCommands: (args) => deps.validationUtils.buildTypeScriptValidationCommands(args),
|
|
72
|
+
spawnValidationProcess: (command, args, cwd) => deps.validationUtils.spawnValidationProcess(command, args, cwd),
|
|
73
|
+
isValidationThrottled: (kind) => deps.validationController.isThrottled(kind),
|
|
74
|
+
markValidationRun: (kind) => deps.validationController.markRun(kind),
|
|
75
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
76
|
+
mapDiagnosticsToWorkspace: (diagnostics) => workspaceIndex.mapDiagnosticsToWorkspace(diagnostics)
|
|
77
|
+
});
|
|
78
|
+
const planPreparer = (0, planPreparation_1.createPlanPreparer)({
|
|
79
|
+
diffManager,
|
|
80
|
+
artifactManager,
|
|
81
|
+
planContext: deps.planContext,
|
|
82
|
+
telemetry: deps.telemetry,
|
|
83
|
+
telemetryHooks: {
|
|
84
|
+
postPlan: (candidate) => deps.telemetryHub.postPlan(candidate),
|
|
85
|
+
emitGoal: (goalCandidate, insight) => deps.telemetryHub.emitGoal(goalCandidate, insight),
|
|
86
|
+
emitTask: (progress) => deps.telemetryHub.emitTask(progress)
|
|
87
|
+
},
|
|
88
|
+
goalContext: {
|
|
89
|
+
loadWorkspaceIndex: () => deps.loadWorkspaceIndex(),
|
|
90
|
+
searchEmbeddingCandidates: (targetGoal) => deps.searchEmbeddingCandidates(targetGoal),
|
|
91
|
+
runGoalInference: (targetGoal, index) => deps.runGoalInference(targetGoal, index),
|
|
92
|
+
mergeInsightWithEmbeddings: (insight, hits) => deps.mergeInsightWithEmbeddings(insight, hits)
|
|
93
|
+
},
|
|
94
|
+
embeddingCache: deps.embeddingCache,
|
|
95
|
+
typescriptValidator,
|
|
96
|
+
goalEngine: deps.goalEngine,
|
|
97
|
+
createAgentPlan: (targetGoal, planOptions) => deps.plannerAgent.createPlan(targetGoal, planOptions),
|
|
98
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
99
|
+
getWorkspaceIndexSnapshot: () => workspaceIndex.getSnapshot(),
|
|
100
|
+
getConfiguration: () => deps.getConfiguration(),
|
|
101
|
+
getArtifactPaths: () => deps.getArtifactPaths()
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
helperManager,
|
|
105
|
+
diffManager,
|
|
106
|
+
undoManager,
|
|
107
|
+
artifactManager,
|
|
108
|
+
workspacePackageManager,
|
|
109
|
+
workspaceIndex,
|
|
110
|
+
typescriptValidator,
|
|
111
|
+
planPreparer
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=workspaceServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceServices.js","sourceRoot":"","sources":["../../src/runtime/workspaceServices.ts"],"names":[],"mappings":";;AAkGA,0DA8GC;AA/MD,mDAAkE;AAClE,uCAAgD;AAChD,+CAAkD;AAClD,+CAAkD;AAClD,uDAA0D;AAC1D,2DAAkG;AAClG,mEAAsE;AACtE,+DAAkE;AAClE,uDAAuD;AAyFvD,SAAgB,uBAAuB,CAAC,IAA2B;IACjE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAEnF,MAAM,WAAW,GAAG,IAAA,+BAAiB,EAAC;QACpC,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;YAC1D,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAA,gCAAgB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjF,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC;gBACvC,IAAI;gBACJ,IAAI,EAAE,YAAY;gBAClB,OAAO;gBACP,UAAU;aACX,CAAC,CAAC;QACL,CAAC;QACD,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;QAChE,WAAW,EAAE,CAAC,MAAM,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IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,KAAK,CAAC;QAC7E,yBAAyB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,EAAE;QAC7D,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC/C,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;KAChD,CAAC,CAAC;IAEH,OAAO;QACL,aAAa;QACb,WAAW;QACX,WAAW;QACX,eAAe;QACf,uBAAuB;QACvB,cAAc;QACd,mBAAmB;QACnB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ITelemetry, IDiffManager } from '../internalTypes';
|
|
2
|
+
import type { EmbeddingManager } from './embeddingManager';
|
|
3
|
+
import type { InferredGoal } from '../internalTypes';
|
|
4
|
+
export interface WriteServicesDeps {
|
|
5
|
+
telemetry: ITelemetry;
|
|
6
|
+
diffManager: IDiffManager;
|
|
7
|
+
workspace: {
|
|
8
|
+
readFile(target: string, encoding?: BufferEncoding): Promise<string>;
|
|
9
|
+
writeFile(target: string, content: string, encoding?: BufferEncoding): Promise<void>;
|
|
10
|
+
normalizeRelativePath(value: string): string | undefined;
|
|
11
|
+
isPathInside(base: string, target: string): boolean;
|
|
12
|
+
fileExists(path: string): Promise<boolean>;
|
|
13
|
+
};
|
|
14
|
+
undoManager: {
|
|
15
|
+
recordSnapshot(snapshot: unknown): void;
|
|
16
|
+
};
|
|
17
|
+
embeddingManager: EmbeddingManager;
|
|
18
|
+
getSessionWorkspaceRoot(): string | undefined;
|
|
19
|
+
getCurrentInsight(): InferredGoal | undefined;
|
|
20
|
+
getWorkspaceFileIndex(): string[];
|
|
21
|
+
getContextValue<T>(key: string): T | undefined;
|
|
22
|
+
setContextValue(key: string, value: unknown): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createWriteServices(deps: WriteServicesDeps): {
|
|
25
|
+
additionalWriteManager: {
|
|
26
|
+
applyAdditionalWrites: (options: import("./additionalWrites").ApplyAdditionalWritesOptions) => Promise<Array<Record<string, unknown>>>;
|
|
27
|
+
};
|
|
28
|
+
pendingInferenceTracker: {
|
|
29
|
+
flagMissingFiles: (relativePath: string, writes: import("./types").AdditionalWrite[]) => Promise<void>;
|
|
30
|
+
computeMissingFiles: (relativePath: string, writes: import("./types").AdditionalWrite[]) => Promise<string[]>;
|
|
31
|
+
resolvePendingFiles: () => Promise<string[]>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=writeServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeServices.d.ts","sourceRoot":"","sources":["../../src/runtime/writeServices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,YAAY,CAAC;IAC1B,SAAS,EAAE;QACT,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACrE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACrF,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QACzD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QACpD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAC5C,CAAC;IACF,WAAW,EAAE;QAAE,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAAC;IAC9C,iBAAiB,IAAI,YAAY,GAAG,SAAS,CAAC;IAC9C,qBAAqB,IAAI,MAAM,EAAE,CAAC;IAClC,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAC/C,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACpD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;EA2B1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createWriteServices = createWriteServices;
|
|
4
|
+
const additionalWrites_1 = require("./additionalWrites");
|
|
5
|
+
const pendingInference_1 = require("./pendingInference");
|
|
6
|
+
function createWriteServices(deps) {
|
|
7
|
+
const additionalWriteManager = (0, additionalWrites_1.createAdditionalWriteManager)({
|
|
8
|
+
telemetry: deps.telemetry,
|
|
9
|
+
diffManager: deps.diffManager,
|
|
10
|
+
readWorkspaceFile: (target, encoding) => deps.workspace.readFile(target, encoding),
|
|
11
|
+
writeWorkspaceFile: (target, content, encoding) => deps.workspace.writeFile(target, content, encoding),
|
|
12
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
13
|
+
isPathInside: (base, target) => deps.workspace.isPathInside(base, target),
|
|
14
|
+
undoManager: deps.undoManager,
|
|
15
|
+
scheduleEmbeddingUpsert: (relativePath, content) => deps.embeddingManager.scheduleEmbeddingUpsert(relativePath, content)
|
|
16
|
+
});
|
|
17
|
+
const pendingInferenceTracker = (0, pendingInference_1.createPendingInferenceTracker)({
|
|
18
|
+
getCurrentInsight: () => deps.getCurrentInsight(),
|
|
19
|
+
getWorkspaceRoot: () => deps.getSessionWorkspaceRoot(),
|
|
20
|
+
getWorkspaceFileIndex: () => deps.getWorkspaceFileIndex(),
|
|
21
|
+
normalizeRelativePath: (value) => deps.workspace.normalizeRelativePath(value),
|
|
22
|
+
workspaceFileExists: (absPath) => deps.workspace.fileExists(absPath),
|
|
23
|
+
getPendingFiles: () => deps.getContextValue('focus.primary.expectedAdditionalFiles') ?? [],
|
|
24
|
+
setPendingFiles: (files) => deps.setContextValue('focus.primary.expectedAdditionalFiles', files),
|
|
25
|
+
logWarning: (message) => deps.telemetry.log({ message, level: 'warn' })
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
additionalWriteManager,
|
|
29
|
+
pendingInferenceTracker
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=writeServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeServices.js","sourceRoot":"","sources":["../../src/runtime/writeServices.ts"],"names":[],"mappings":";;AAyBA,kDA2BC;AApDD,yDAAkE;AAClE,yDAAmE;AAwBnE,SAAgB,mBAAmB,CAAC,IAAuB;IACzD,MAAM,sBAAsB,GAAG,IAAA,+CAA4B,EAAC;QAC1D,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,iBAAiB,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;QAClF,kBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;QACtG,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,K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byte-identical content used by BOTH
|
|
3
|
+
* the VS Code extension prompt builder (`extensionSystemPrompt.ts`) and
|
|
4
|
+
* the CLI prompt builder (`apps/bandit-cli/src/systemPrompt.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Why this exists: pre-v1.7.348, both surfaces inlined the same
|
|
7
|
+
* `## Git Authorship` block verbatim. Drift between them was a question
|
|
8
|
+
* of WHEN, not IF — one surface gets an edit, the other doesn't, and
|
|
9
|
+
* the next time someone tries to add an authorship rule (e.g. a new
|
|
10
|
+
* trailer or a per-repo override) the diff diverges silently.
|
|
11
|
+
*
|
|
12
|
+
* What lives here: ONLY sections that are byte-identical between the two
|
|
13
|
+
* surfaces today. Sections that have intentionally drifted
|
|
14
|
+
* (`WORKING_STYLE` — CLI runs small/medium Ollama models locally and
|
|
15
|
+
* needs more compensation bullets than the extension; `SKILL_AUTHORING`
|
|
16
|
+
* — CLI has a verbose GitHub example, extension uses a tighter Karpathy
|
|
17
|
+
* shape; identity strings — different surfaces, different framing) stay
|
|
18
|
+
* in their per-surface files until a deliberate reconciliation pass
|
|
19
|
+
* brings them together with proper behavior tests on each side.
|
|
20
|
+
*
|
|
21
|
+
* If you add a new shared section here, also:
|
|
22
|
+
* 1. Add an export below.
|
|
23
|
+
* 2. Re-export from `./index.ts` so both builders can import it.
|
|
24
|
+
* 3. Update both builders to use the shared constant instead of
|
|
25
|
+
* duplicating the text.
|
|
26
|
+
* 4. Add a brief drift-detection assertion in
|
|
27
|
+
* `test/sharedPromptSections.test.ts` so the next "while I'm here"
|
|
28
|
+
* edit to either surface trips the gate.
|
|
29
|
+
*/
|
|
30
|
+
export declare const SHARED_GIT_AUTHORSHIP_HEADING = "## Git Authorship";
|
|
31
|
+
export declare const SHARED_GIT_AUTHORSHIP_ENABLED_BODY: string;
|
|
32
|
+
export declare const SHARED_GIT_AUTHORSHIP_DISABLED_BODY: string;
|
|
33
|
+
/**
|
|
34
|
+
* Composed extension-style block:
|
|
35
|
+
*
|
|
36
|
+
* ## Git Authorship
|
|
37
|
+
* <body>
|
|
38
|
+
*
|
|
39
|
+
* Used by the extension prompt builder where each section is a complete
|
|
40
|
+
* mini-document. The CLI uses the body alone in a bulleted list and
|
|
41
|
+
* builds its own heading-less variant via the helper below.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildGitAuthorshipBlock(coauthor: boolean): string;
|
|
44
|
+
/**
|
|
45
|
+
* Bulleted variant for the CLI's `## How to work` list, where each rule
|
|
46
|
+
* is rendered as a single bullet. The CLI uses a bold-prefix convention
|
|
47
|
+
* (`- **Git commits on the user's behalf get a Bandit co-author trailer.**
|
|
48
|
+
* <body>`) rather than the extension's heading-per-rule layout, so we
|
|
49
|
+
* synthesize that here rather than re-stating the body in each surface.
|
|
50
|
+
*
|
|
51
|
+
* `surfaceHint` is an optional CLI-specific suffix — the CLI passes
|
|
52
|
+
* `' The user can disable this with \`/coauthor off\` or \`BANDIT_NO_COAUTHOR=1\`.'`
|
|
53
|
+
* to keep the disable-discovery line that the extension doesn't need
|
|
54
|
+
* (the extension has its own /coauthor command surface). When omitted
|
|
55
|
+
* the bullet matches what the extension would produce verbatim.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildGitAuthorshipBullet(coauthor: boolean, surfaceHint?: string): string;
|
|
58
|
+
//# sourceMappingURL=sharedPromptSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedPromptSections.d.ts","sourceRoot":"","sources":["../src/sharedPromptSections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAcH,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAEjE,eAAO,MAAM,kCAAkC,QAUF,CAAC;AAE9C,eAAO,MAAM,mCAAmC,QAEa,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAKjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,SAAK,GAAG,MAAM,CAKpF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared prompt sections — the truly-byte-identical content used by BOTH
|
|
4
|
+
* the VS Code extension prompt builder (`extensionSystemPrompt.ts`) and
|
|
5
|
+
* the CLI prompt builder (`apps/bandit-cli/src/systemPrompt.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Why this exists: pre-v1.7.348, both surfaces inlined the same
|
|
8
|
+
* `## Git Authorship` block verbatim. Drift between them was a question
|
|
9
|
+
* of WHEN, not IF — one surface gets an edit, the other doesn't, and
|
|
10
|
+
* the next time someone tries to add an authorship rule (e.g. a new
|
|
11
|
+
* trailer or a per-repo override) the diff diverges silently.
|
|
12
|
+
*
|
|
13
|
+
* What lives here: ONLY sections that are byte-identical between the two
|
|
14
|
+
* surfaces today. Sections that have intentionally drifted
|
|
15
|
+
* (`WORKING_STYLE` — CLI runs small/medium Ollama models locally and
|
|
16
|
+
* needs more compensation bullets than the extension; `SKILL_AUTHORING`
|
|
17
|
+
* — CLI has a verbose GitHub example, extension uses a tighter Karpathy
|
|
18
|
+
* shape; identity strings — different surfaces, different framing) stay
|
|
19
|
+
* in their per-surface files until a deliberate reconciliation pass
|
|
20
|
+
* brings them together with proper behavior tests on each side.
|
|
21
|
+
*
|
|
22
|
+
* If you add a new shared section here, also:
|
|
23
|
+
* 1. Add an export below.
|
|
24
|
+
* 2. Re-export from `./index.ts` so both builders can import it.
|
|
25
|
+
* 3. Update both builders to use the shared constant instead of
|
|
26
|
+
* duplicating the text.
|
|
27
|
+
* 4. Add a brief drift-detection assertion in
|
|
28
|
+
* `test/sharedPromptSections.test.ts` so the next "while I'm here"
|
|
29
|
+
* edit to either surface trips the gate.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.SHARED_GIT_AUTHORSHIP_DISABLED_BODY = exports.SHARED_GIT_AUTHORSHIP_ENABLED_BODY = exports.SHARED_GIT_AUTHORSHIP_HEADING = void 0;
|
|
33
|
+
exports.buildGitAuthorshipBlock = buildGitAuthorshipBlock;
|
|
34
|
+
exports.buildGitAuthorshipBullet = buildGitAuthorshipBullet;
|
|
35
|
+
// ─── Git authorship ─────────────────────────────────────────────────────────
|
|
36
|
+
//
|
|
37
|
+
// Trailer text is byte-identical between the extension and CLI builders.
|
|
38
|
+
// Pre-v1.7.348 each surface declared its own copy; v1.7.348 collapsed them
|
|
39
|
+
// to a single source of truth.
|
|
40
|
+
//
|
|
41
|
+
// Why the trailer matters: GitHub resolves the contributor avatar from the
|
|
42
|
+
// trailer email when the angle brackets are unescaped ASCII. The dedicated
|
|
43
|
+
// `bandit-stealth` GitHub user owns `bandit@burtson.ai`; even before that
|
|
44
|
+
// account exists the trailer is harmless — GitHub backfills the avatar
|
|
45
|
+
// retroactively once the user is created.
|
|
46
|
+
exports.SHARED_GIT_AUTHORSHIP_HEADING = '## Git Authorship';
|
|
47
|
+
exports.SHARED_GIT_AUTHORSHIP_ENABLED_BODY = 'When you issue `git commit` (or `git_commit`) on the user\'s behalf, append a ' +
|
|
48
|
+
'`Co-authored-by: Bandit <bandit@burtson.ai>` trailer to the commit message. ' +
|
|
49
|
+
'Place it after one blank line at the end of the message body, exactly as GitHub ' +
|
|
50
|
+
'expects. **Use LITERAL `<` and `>` characters around the email — NEVER escape ' +
|
|
51
|
+
'them as `\\u003c` / `\\u003e` or `<` / `>`. GitHub\'s trailer parser only ' +
|
|
52
|
+
'resolves the avatar when the angle brackets are unescaped ASCII.** Single trailer ' +
|
|
53
|
+
'per commit — do not duplicate it across multiple lines or add extra Bandit ' +
|
|
54
|
+
'attributions in the subject. If the commit message already contains a ' +
|
|
55
|
+
'`Co-authored-by: Bandit` trailer (e.g. from amending a prior Bandit commit), ' +
|
|
56
|
+
'leave it alone — do NOT add a second one.';
|
|
57
|
+
exports.SHARED_GIT_AUTHORSHIP_DISABLED_BODY = 'Do NOT append a `Co-authored-by: Bandit` trailer to commit messages. The user ' +
|
|
58
|
+
'has explicitly opted out of Bandit co-author attribution.';
|
|
59
|
+
/**
|
|
60
|
+
* Composed extension-style block:
|
|
61
|
+
*
|
|
62
|
+
* ## Git Authorship
|
|
63
|
+
* <body>
|
|
64
|
+
*
|
|
65
|
+
* Used by the extension prompt builder where each section is a complete
|
|
66
|
+
* mini-document. The CLI uses the body alone in a bulleted list and
|
|
67
|
+
* builds its own heading-less variant via the helper below.
|
|
68
|
+
*/
|
|
69
|
+
function buildGitAuthorshipBlock(coauthor) {
|
|
70
|
+
const body = coauthor
|
|
71
|
+
? exports.SHARED_GIT_AUTHORSHIP_ENABLED_BODY
|
|
72
|
+
: exports.SHARED_GIT_AUTHORSHIP_DISABLED_BODY;
|
|
73
|
+
return `${exports.SHARED_GIT_AUTHORSHIP_HEADING}\n${body}`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Bulleted variant for the CLI's `## How to work` list, where each rule
|
|
77
|
+
* is rendered as a single bullet. The CLI uses a bold-prefix convention
|
|
78
|
+
* (`- **Git commits on the user's behalf get a Bandit co-author trailer.**
|
|
79
|
+
* <body>`) rather than the extension's heading-per-rule layout, so we
|
|
80
|
+
* synthesize that here rather than re-stating the body in each surface.
|
|
81
|
+
*
|
|
82
|
+
* `surfaceHint` is an optional CLI-specific suffix — the CLI passes
|
|
83
|
+
* `' The user can disable this with \`/coauthor off\` or \`BANDIT_NO_COAUTHOR=1\`.'`
|
|
84
|
+
* to keep the disable-discovery line that the extension doesn't need
|
|
85
|
+
* (the extension has its own /coauthor command surface). When omitted
|
|
86
|
+
* the bullet matches what the extension would produce verbatim.
|
|
87
|
+
*/
|
|
88
|
+
function buildGitAuthorshipBullet(coauthor, surfaceHint = '') {
|
|
89
|
+
if (coauthor) {
|
|
90
|
+
return `- **Git commits on the user's behalf get a Bandit co-author trailer.** ${exports.SHARED_GIT_AUTHORSHIP_ENABLED_BODY}${surfaceHint}`;
|
|
91
|
+
}
|
|
92
|
+
return `- **Do NOT append a \`Co-authored-by: Bandit\` trailer to commit messages.** The user has explicitly opted out via \`/coauthor off\` or \`BANDIT_NO_COAUTHOR=1\`.`;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=sharedPromptSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedPromptSections.js","sourceRoot":"","sources":["../src/sharedPromptSections.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AA0CH,0DAKC;AAeD,4DAKC;AAjED,+EAA+E;AAC/E,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,+BAA+B;AAC/B,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,0CAA0C;AAE7B,QAAA,6BAA6B,GAAG,mBAAmB,CAAC;AAEpD,QAAA,kCAAkC,GAC7C,gFAAgF;IAChF,8EAA8E;IAC9E,kFAAkF;IAClF,gFAAgF;IAChF,kFAAkF;IAClF,oFAAoF;IACpF,6EAA6E;IAC7E,wEAAwE;IACxE,+EAA+E;IAC/E,2CAA2C,CAAC;AAEjC,QAAA,mCAAmC,GAC9C,gFAAgF;IAChF,2DAA2D,CAAC;AAE9D;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,QAAiB;IACvD,MAAM,IAAI,GAAG,QAAQ;QACnB,CAAC,CAAC,0CAAkC;QACpC,CAAC,CAAC,2CAAmC,CAAC;IACxC,OAAO,GAAG,qCAA6B,KAAK,IAAI,EAAE,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,wBAAwB,CAAC,QAAiB,EAAE,WAAW,GAAG,EAAE;IAC1E,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,0EAA0E,0CAAkC,GAAG,WAAW,EAAE,CAAC;IACtI,CAAC;IACD,OAAO,mKAAmK,CAAC;AAC7K,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface StatusPayload {
|
|
2
|
+
text: string;
|
|
3
|
+
stepId?: string;
|
|
4
|
+
phase?: 'start' | 'progress' | 'complete' | 'error';
|
|
5
|
+
detail?: string;
|
|
6
|
+
icon?: 'plan' | 'search' | 'code' | 'terminal' | 'review' | 'success' | 'warn' | 'info';
|
|
7
|
+
}
|
|
8
|
+
export interface LogPayload {
|
|
9
|
+
message: string;
|
|
10
|
+
stepId?: string;
|
|
11
|
+
level?: 'info' | 'warn' | 'error';
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=statusTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusTypes.d.ts","sourceRoot":"","sources":["../src/statusTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;CACzF;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusTypes.js","sourceRoot":"","sources":["../src/statusTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads from a `ReadableStreamDefaultReader` with an idle-byte timeout.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `reader.read()` so we can recover when an LLM stream stalls mid-
|
|
5
|
+
* response (gateway hairpin drop, upstream Ollama hang post-headers, etc.).
|
|
6
|
+
* Node's underlying fetch has a multi-minute default before it errors a
|
|
7
|
+
* stalled body, which leaves the agent loop suspended on `for await` with
|
|
8
|
+
* no events firing. This helper trips at a tighter threshold (default 90 s)
|
|
9
|
+
* and throws, which the tool-use-loop's existing try/catch converts into a
|
|
10
|
+
* normal `tool_loop:llm_retry` recovery — same path that handles 5xx and
|
|
11
|
+
* network blips.
|
|
12
|
+
*
|
|
13
|
+
* The timer resets on every successful read, so legitimate slow generation
|
|
14
|
+
* (model thinking, large chunks) doesn't fire. Even a single byte (SSE
|
|
15
|
+
* keep-alive newline, partial JSON token) keeps the stream alive.
|
|
16
|
+
*
|
|
17
|
+
* A `warnAfterMs` callback fires once before the abort threshold so hosts
|
|
18
|
+
* can surface "stream went quiet — still waiting…" status in the UI without
|
|
19
|
+
* waiting the full idle window. The warning is observational only; it does
|
|
20
|
+
* not cancel the read.
|
|
21
|
+
*/
|
|
22
|
+
export interface IdleTimeoutOptions {
|
|
23
|
+
/** Abort after this many ms of no data. Default 90_000. */
|
|
24
|
+
idleMs?: number;
|
|
25
|
+
/** Fire `onWarn` once after this many ms of silence. Skipped if undefined or >= idleMs. */
|
|
26
|
+
warnAfterMs?: number;
|
|
27
|
+
/** Callback invoked once at `warnAfterMs`. Errors thrown here are swallowed. */
|
|
28
|
+
onWarn?: (elapsedMs: number) => void;
|
|
29
|
+
/** Label embedded in the thrown error message for log clarity. */
|
|
30
|
+
abortLabel?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const DEFAULT_STREAM_IDLE_MS = 90000;
|
|
33
|
+
export declare const DEFAULT_STREAM_WARN_MS = 30000;
|
|
34
|
+
export declare function readWithIdleTimeout<T>(reader: {
|
|
35
|
+
read(): Promise<ReadableStreamReadResult<T>>;
|
|
36
|
+
cancel?: () => Promise<void> | void;
|
|
37
|
+
}, opts?: IdleTimeoutOptions): Promise<ReadableStreamReadResult<T>>;
|
|
38
|
+
//# sourceMappingURL=streamIdleTimeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamIdleTimeout.d.ts","sourceRoot":"","sources":["../src/streamIdleTimeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,MAAM,EAAE;IAAE,IAAI,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAAE,EAC7F,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CA6BtC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_STREAM_WARN_MS = exports.DEFAULT_STREAM_IDLE_MS = void 0;
|
|
4
|
+
exports.readWithIdleTimeout = readWithIdleTimeout;
|
|
5
|
+
exports.DEFAULT_STREAM_IDLE_MS = 90000;
|
|
6
|
+
exports.DEFAULT_STREAM_WARN_MS = 30000;
|
|
7
|
+
async function readWithIdleTimeout(reader, opts = {}) {
|
|
8
|
+
const idleMs = opts.idleMs ?? exports.DEFAULT_STREAM_IDLE_MS;
|
|
9
|
+
const warnAfterMs = opts.warnAfterMs;
|
|
10
|
+
const onWarn = opts.onWarn;
|
|
11
|
+
const abortLabel = opts.abortLabel ?? 'LLM stream';
|
|
12
|
+
let warnTimer;
|
|
13
|
+
let abortTimer;
|
|
14
|
+
const cleanup = () => {
|
|
15
|
+
if (warnTimer)
|
|
16
|
+
clearTimeout(warnTimer);
|
|
17
|
+
if (abortTimer)
|
|
18
|
+
clearTimeout(abortTimer);
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
return await new Promise((resolve, reject) => {
|
|
22
|
+
if (typeof warnAfterMs === 'number' && warnAfterMs > 0 && warnAfterMs < idleMs && onWarn) {
|
|
23
|
+
warnTimer = setTimeout(() => {
|
|
24
|
+
try {
|
|
25
|
+
onWarn(warnAfterMs);
|
|
26
|
+
}
|
|
27
|
+
catch { /* observability only */ }
|
|
28
|
+
}, warnAfterMs);
|
|
29
|
+
}
|
|
30
|
+
abortTimer = setTimeout(() => {
|
|
31
|
+
try {
|
|
32
|
+
void reader.cancel?.();
|
|
33
|
+
}
|
|
34
|
+
catch { /* best effort */ }
|
|
35
|
+
reject(new Error(`${abortLabel} stalled — no data for ${idleMs}ms`));
|
|
36
|
+
}, idleMs);
|
|
37
|
+
reader.read().then(resolve, reject);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
cleanup();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=streamIdleTimeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamIdleTimeout.js","sourceRoot":"","sources":["../src/streamIdleTimeout.ts"],"names":[],"mappings":";;;AAmCA,kDAgCC;AAnCY,QAAA,sBAAsB,GAAG,KAAM,CAAC;AAChC,QAAA,sBAAsB,GAAG,KAAM,CAAC;AAEtC,KAAK,UAAU,mBAAmB,CACvC,MAA6F,EAC7F,OAA2B,EAAE;IAE7B,MAAM,MAAM,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C;YAAS,CAAC;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type ProviderBackend = 'bandit' | 'openai' | 'azure-openai' | 'anthropic' | 'ollama' | 'xai';
|
|
2
|
+
export type ProviderType = ProviderBackend | 'gateway';
|
|
3
|
+
export interface AIMessageImageURL {
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
export type AIMessageContentPart = {
|
|
7
|
+
type: 'text';
|
|
8
|
+
text: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'image_url';
|
|
11
|
+
image_url: AIMessageImageURL;
|
|
12
|
+
};
|
|
13
|
+
export type AIMessageContent = string | AIMessageContentPart[];
|
|
14
|
+
export interface AIMessage {
|
|
15
|
+
role: 'system' | 'user' | 'assistant';
|
|
16
|
+
content: AIMessageContent;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Ollama native tool schema — passed via the `tools` field of
|
|
20
|
+
* /api/chat on models that advertise `supportsToolCalling: true`.
|
|
21
|
+
* Shape matches Ollama's OpenAPI contract (itself a subset of
|
|
22
|
+
* OpenAI's function-calling schema).
|
|
23
|
+
*/
|
|
24
|
+
export interface OllamaToolSchema {
|
|
25
|
+
type: 'function';
|
|
26
|
+
function: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
parameters: {
|
|
30
|
+
type: 'object';
|
|
31
|
+
properties: Record<string, {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
}>;
|
|
35
|
+
required?: string[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface AIChatRequest {
|
|
40
|
+
model: string;
|
|
41
|
+
messages: AIMessage[];
|
|
42
|
+
stream?: boolean;
|
|
43
|
+
temperature?: number;
|
|
44
|
+
maxTokens?: number;
|
|
45
|
+
options?: Record<string, unknown>;
|
|
46
|
+
images?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* When populated AND the target model supports native tool calling,
|
|
49
|
+
* Ollama will surface tool-call intents in a structured `tool_calls`
|
|
50
|
+
* field on the response instead of free-text. The provider layer
|
|
51
|
+
* translates those back into inline `<tool_call>{...}</tool_call>`
|
|
52
|
+
* markup so the downstream ToolUseLoop parses them identically to
|
|
53
|
+
* the text-based path. Saves ~1500-3000 tokens per turn because the
|
|
54
|
+
* schemas no longer have to live in the system prompt.
|
|
55
|
+
*/
|
|
56
|
+
tools?: OllamaToolSchema[];
|
|
57
|
+
/**
|
|
58
|
+
* Per-request chain-of-thought override for reasoning-capable models
|
|
59
|
+
* (Qwen 3.x, DeepSeek R1). Ollama accepts `think` as a top-level
|
|
60
|
+
* field (NOT nested under `options`). Precedence:
|
|
61
|
+
* - `true` → force thinking ON for this request
|
|
62
|
+
* - `false` → force thinking OFF
|
|
63
|
+
* - `undefined` → fall back to the runtime default (off for
|
|
64
|
+
* reasoning models, not sent for non-reasoning)
|
|
65
|
+
* Hosts surface this via UI controls — the CLI `/think on|off|auto`
|
|
66
|
+
* slash command or the extension's `banditStealth.thinkingMode`
|
|
67
|
+
* setting. Most agent turns leave it undefined.
|
|
68
|
+
*/
|
|
69
|
+
think?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface AIChatResponse {
|
|
72
|
+
message: {
|
|
73
|
+
content: string;
|
|
74
|
+
role: 'assistant';
|
|
75
|
+
/**
|
|
76
|
+
* Chain-of-thought reasoning emitted by models with thinking mode
|
|
77
|
+
* on (Qwen 3.x, DeepSeek R1). Arrives as a separate field from
|
|
78
|
+
* Ollama — kept out of `content` so the reasoning doesn't land in
|
|
79
|
+
* the visible assistant transcript by default. Hosts render it in
|
|
80
|
+
* a collapsed disclosure block or dimmed prefix line.
|
|
81
|
+
*/
|
|
82
|
+
thinking?: string;
|
|
83
|
+
};
|
|
84
|
+
done?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface AIGenerateRequest {
|
|
87
|
+
model: string;
|
|
88
|
+
prompt: string;
|
|
89
|
+
stream?: boolean;
|
|
90
|
+
options?: Record<string, unknown>;
|
|
91
|
+
}
|
|
92
|
+
export interface AIGenerateResponse {
|
|
93
|
+
response: string;
|
|
94
|
+
done?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface AIModel {
|
|
97
|
+
name: string;
|
|
98
|
+
size?: number;
|
|
99
|
+
details?: Record<string, unknown>;
|
|
100
|
+
digest?: string;
|
|
101
|
+
modified_at?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface AIProviderConfig {
|
|
104
|
+
type: ProviderType;
|
|
105
|
+
baseUrl?: string;
|
|
106
|
+
apiKey?: string;
|
|
107
|
+
apiVersion?: string;
|
|
108
|
+
deploymentName?: string;
|
|
109
|
+
gatewayUrl?: string;
|
|
110
|
+
provider?: ProviderBackend;
|
|
111
|
+
tokenFactory?: () => string | null;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=bandit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bandit.d.ts","sourceRoot":"","sources":["../../src/types/bandit.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAC;AACpG,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CA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