@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,4 @@
|
|
|
1
|
+
export declare function setSessionValue(target: Record<string, unknown>, key: string, value: unknown): void;
|
|
2
|
+
export declare function getSessionValue<T>(source: Record<string, unknown> | undefined, key: string): T | undefined;
|
|
3
|
+
export declare function cloneSessionData(source: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
4
|
+
//# sourceMappingURL=sessionData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionData.d.ts","sourceRoot":"","sources":["../../src/runtime/sessionData.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAWlG;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAc1G;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CASjH"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setSessionValue = setSessionValue;
|
|
4
|
+
exports.getSessionValue = getSessionValue;
|
|
5
|
+
exports.cloneSessionData = cloneSessionData;
|
|
6
|
+
function setSessionValue(target, key, value) {
|
|
7
|
+
const parts = key.split('.');
|
|
8
|
+
let cursor = target;
|
|
9
|
+
for (let i = 0; i < parts.length - 1; i += 1) {
|
|
10
|
+
const part = parts[i];
|
|
11
|
+
if (!(part in cursor) || typeof cursor[part] !== 'object' || cursor[part] === null) {
|
|
12
|
+
cursor[part] = {};
|
|
13
|
+
}
|
|
14
|
+
cursor = cursor[part];
|
|
15
|
+
}
|
|
16
|
+
cursor[parts[parts.length - 1]] = value;
|
|
17
|
+
}
|
|
18
|
+
function getSessionValue(source, key) {
|
|
19
|
+
if (!source) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const parts = key.split('.');
|
|
23
|
+
let value = source;
|
|
24
|
+
for (const part of parts) {
|
|
25
|
+
if (value && typeof value === 'object' && part in value) {
|
|
26
|
+
value = value[part];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
function cloneSessionData(source) {
|
|
35
|
+
if (!source) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
return JSON.parse(JSON.stringify(source));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=sessionData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionData.js","sourceRoot":"","sources":["../../src/runtime/sessionData.ts"],"names":[],"mappings":";;AAAA,0CAWC;AAED,0CAcC;AAED,4CASC;AAtCD,SAAgB,eAAe,CAAC,MAA+B,EAAE,GAAW,EAAE,KAAc;IAC1F,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACnF,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;QACD,MAAM,GAAG,MAAM,CAAC,IAAI,CAA4B,CAAC;IACnD,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAC1C,CAAC;AAED,SAAgB,eAAe,CAAI,MAA2C,EAAE,GAAW;IACzF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK,GAAY,MAAM,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,IAAK,KAAiC,EAAE,CAAC;YACrF,KAAK,GAAI,KAAiC,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,KAAU,CAAC;AACpB,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAA2C;IAC1E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { InferredGoal } from '../internalTypes';
|
|
2
|
+
import type { AgentReport, Plan } from '../internalTypes';
|
|
3
|
+
import type { AgentGoalOptions, AgentSession, AgentConfiguration } from '../internalTypes';
|
|
4
|
+
import type { PlanPreparer } from './planPreparation';
|
|
5
|
+
interface GoalRunnerLike {
|
|
6
|
+
executePlan(input: {
|
|
7
|
+
plan: Plan;
|
|
8
|
+
goal: string;
|
|
9
|
+
runOptions: AgentGoalOptions;
|
|
10
|
+
agentConfig: AgentConfiguration;
|
|
11
|
+
}): Promise<AgentReport>;
|
|
12
|
+
}
|
|
13
|
+
export interface SessionRuntimeDeps {
|
|
14
|
+
getWorkspaceRoot(): string;
|
|
15
|
+
getPlanPreparer(): PlanPreparer | undefined;
|
|
16
|
+
getGoalRunner(): GoalRunnerLike | undefined;
|
|
17
|
+
getAgentConfiguration(): AgentConfiguration;
|
|
18
|
+
}
|
|
19
|
+
export interface SessionRuntime {
|
|
20
|
+
getSessionGoal(): string | undefined;
|
|
21
|
+
getSessionWorkspaceRoot(): string | undefined;
|
|
22
|
+
getLastWorkspaceRoot(): string | undefined;
|
|
23
|
+
getLastPlan(): Plan | undefined;
|
|
24
|
+
getLastGoal(): string | undefined;
|
|
25
|
+
getCurrentGoalInsight(): InferredGoal | undefined;
|
|
26
|
+
getRunOptions(): AgentGoalOptions;
|
|
27
|
+
isPreviewOnly(): boolean;
|
|
28
|
+
runGoalInference(prompt: string, workspaceIndex: string[]): Promise<InferredGoal | undefined>;
|
|
29
|
+
preparePlan(goal: string, options?: AgentGoalOptions): Promise<Plan>;
|
|
30
|
+
executePlan(plan: Plan, goal: string, options?: AgentGoalOptions): Promise<AgentReport>;
|
|
31
|
+
startGoal(goal: string, options?: AgentGoalOptions): Promise<AgentReport>;
|
|
32
|
+
cancel(): void;
|
|
33
|
+
resetCancellation(): void;
|
|
34
|
+
isCancelled(): boolean;
|
|
35
|
+
ensureSession(): AgentSession;
|
|
36
|
+
setContextValue(key: string, value: unknown): void;
|
|
37
|
+
getContextValue<T>(key: string): T | undefined;
|
|
38
|
+
cloneSessionData(): Record<string, unknown> | undefined;
|
|
39
|
+
cloneActiveSessionData(): Record<string, unknown> | undefined;
|
|
40
|
+
getLastSessionSnapshot(goal: string): Record<string, unknown>;
|
|
41
|
+
setLastSessionData(data: Record<string, unknown> | undefined): void;
|
|
42
|
+
initializeSession(goal: string, workspaceRoot: string, data: Record<string, unknown>): void;
|
|
43
|
+
clearSession(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare function createSessionRuntime(deps: SessionRuntimeDeps): SessionRuntime;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=sessionRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/sessionRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KA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AE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACxF,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,MAAM,IAAI,IAAI,CAAC;IACf,iBAAiB,IAAI,IAAI,CAAC;IAC1B,WAAW,IAAI,OAAO,CAAC;IACvB,aAAa,IAAI,YAAY,CAAC;IAC9B,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACnD,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAC/C,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACxD,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC9D,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9D,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACpE,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5F,YAAY,IAAI,IAAI,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAwI7E"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSessionRuntime = createSessionRuntime;
|
|
4
|
+
const goalInference_1 = require("../goalInference");
|
|
5
|
+
const sessionData_1 = require("./sessionData");
|
|
6
|
+
function createSessionRuntime(deps) {
|
|
7
|
+
const state = {
|
|
8
|
+
runOptions: {},
|
|
9
|
+
cancelled: false
|
|
10
|
+
};
|
|
11
|
+
function ensurePlanPreparer() {
|
|
12
|
+
const planPreparer = deps.getPlanPreparer();
|
|
13
|
+
if (!planPreparer) {
|
|
14
|
+
throw new Error('Plan preparer not initialised.');
|
|
15
|
+
}
|
|
16
|
+
return planPreparer;
|
|
17
|
+
}
|
|
18
|
+
function ensureGoalRunner() {
|
|
19
|
+
const goalRunner = deps.getGoalRunner();
|
|
20
|
+
if (!goalRunner) {
|
|
21
|
+
throw new Error('Goal runner not initialised.');
|
|
22
|
+
}
|
|
23
|
+
return goalRunner;
|
|
24
|
+
}
|
|
25
|
+
function ensureSession() {
|
|
26
|
+
if (!state.session) {
|
|
27
|
+
throw new Error('Agent session not initialised.');
|
|
28
|
+
}
|
|
29
|
+
return state.session;
|
|
30
|
+
}
|
|
31
|
+
async function runGoalInference(prompt, workspaceIndex) {
|
|
32
|
+
const normalized = prompt.trim();
|
|
33
|
+
if (!normalized) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return await (0, goalInference_1.inferGoal)({ prompt: normalized, workspaceIndex });
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.warn('Goal inference failed', error);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function preparePlan(goal, options) {
|
|
45
|
+
state.cancelled = false;
|
|
46
|
+
const workspaceRoot = deps.getWorkspaceRoot();
|
|
47
|
+
const runOptions = {
|
|
48
|
+
lightweight: options?.lightweight === true,
|
|
49
|
+
previewOnly: options?.previewOnly === true,
|
|
50
|
+
modelTier: options?.modelTier
|
|
51
|
+
};
|
|
52
|
+
state.runOptions = { ...runOptions };
|
|
53
|
+
state.session = { goal, workspaceRoot, data: { goal, workspace: { root: workspaceRoot } } };
|
|
54
|
+
state.lastWorkspaceRoot = workspaceRoot;
|
|
55
|
+
if (options?.contextBlock) {
|
|
56
|
+
(0, sessionData_1.setSessionValue)(state.session.data, 'semantic.context', options.contextBlock);
|
|
57
|
+
}
|
|
58
|
+
const planPreparer = ensurePlanPreparer();
|
|
59
|
+
const { plan, insight } = await planPreparer.run({ goal, workspaceRoot, runOptions });
|
|
60
|
+
state.currentGoalInsight = insight;
|
|
61
|
+
state.lastPlan = plan;
|
|
62
|
+
state.lastGoal = goal;
|
|
63
|
+
return plan;
|
|
64
|
+
}
|
|
65
|
+
async function executePlan(plan, goal, options) {
|
|
66
|
+
const runOptions = {
|
|
67
|
+
...state.runOptions,
|
|
68
|
+
...options
|
|
69
|
+
};
|
|
70
|
+
state.runOptions = runOptions;
|
|
71
|
+
const goalRunner = ensureGoalRunner();
|
|
72
|
+
try {
|
|
73
|
+
return await goalRunner.executePlan({
|
|
74
|
+
plan,
|
|
75
|
+
goal,
|
|
76
|
+
runOptions,
|
|
77
|
+
agentConfig: deps.getAgentConfiguration()
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
state.runOptions = {};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
getSessionGoal: () => state.session?.goal,
|
|
86
|
+
getSessionWorkspaceRoot: () => state.session?.workspaceRoot,
|
|
87
|
+
getLastWorkspaceRoot: () => state.lastWorkspaceRoot,
|
|
88
|
+
getLastPlan: () => state.lastPlan,
|
|
89
|
+
getLastGoal: () => state.lastGoal,
|
|
90
|
+
getCurrentGoalInsight: () => state.currentGoalInsight,
|
|
91
|
+
getRunOptions: () => ({ ...state.runOptions }),
|
|
92
|
+
isPreviewOnly: () => state.runOptions.previewOnly === true,
|
|
93
|
+
runGoalInference,
|
|
94
|
+
preparePlan,
|
|
95
|
+
executePlan,
|
|
96
|
+
startGoal: async (goal, options) => {
|
|
97
|
+
const plan = await preparePlan(goal, options);
|
|
98
|
+
return executePlan(plan, goal, options);
|
|
99
|
+
},
|
|
100
|
+
cancel: () => {
|
|
101
|
+
state.cancelled = true;
|
|
102
|
+
},
|
|
103
|
+
resetCancellation: () => {
|
|
104
|
+
state.cancelled = false;
|
|
105
|
+
},
|
|
106
|
+
isCancelled: () => state.cancelled,
|
|
107
|
+
ensureSession,
|
|
108
|
+
setContextValue: (key, value) => {
|
|
109
|
+
const session = ensureSession();
|
|
110
|
+
(0, sessionData_1.setSessionValue)(session.data, key, value);
|
|
111
|
+
},
|
|
112
|
+
getContextValue: (key) => (0, sessionData_1.getSessionValue)(state.session?.data, key),
|
|
113
|
+
cloneSessionData: () => (0, sessionData_1.cloneSessionData)(state.session?.data),
|
|
114
|
+
cloneActiveSessionData: () => (0, sessionData_1.cloneSessionData)(state.session?.data),
|
|
115
|
+
getLastSessionSnapshot: (goal) => state.lastSessionData ? JSON.parse(JSON.stringify(state.lastSessionData)) : { goal },
|
|
116
|
+
setLastSessionData: (data) => {
|
|
117
|
+
state.lastSessionData = data;
|
|
118
|
+
},
|
|
119
|
+
initializeSession: (goal, workspaceRoot, data) => {
|
|
120
|
+
state.session = { goal, workspaceRoot, data };
|
|
121
|
+
state.lastWorkspaceRoot = workspaceRoot;
|
|
122
|
+
},
|
|
123
|
+
clearSession: () => {
|
|
124
|
+
state.session = undefined;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=sessionRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionRuntime.js","sourceRoot":"","sources":["../../src/runtime/sessionRuntime.ts"],"names":[],"mappings":";;AAkDA,oDAwIC;AA1LD,oDAA6C;AAK7C,+CAAgG;AA6ChG,SAAgB,oBAAoB,CAAC,IAAwB;IAC3D,MAAM,KAAK,GASP;QACF,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,KAAK;KACjB,CAAC;IAEF,SAAS,kBAAkB;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;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AAK,CAAC,CAAC;QAC5C,CAAC;QACD,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,6BAAe,EAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC;QACnE,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAA,8BAAS,EAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;QACtD,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,8BAAS,EAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;QAC5D,sBAAsB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC/B,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE;QACtF,kBAAkB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;QAC/B,CAAC;QACD,iBAAiB,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE;YAC/C,KAAK,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;YAC9C,KAAK,CAAC,iBAAiB,GAAG,aAAa,CAAC;QAC1C,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACjB,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentReport, Plan } from '../types';
|
|
2
|
+
import type { AgentGoalOptions } from './types';
|
|
3
|
+
import type { IUndoManager } from '../internalTypes';
|
|
4
|
+
export interface StealthRuntime {
|
|
5
|
+
preparePlan(goal: string, options?: AgentGoalOptions): Promise<Plan>;
|
|
6
|
+
executePlan(plan: Plan, goal: string, options?: AgentGoalOptions): Promise<AgentReport>;
|
|
7
|
+
startGoal(goal: string, options?: AgentGoalOptions): Promise<AgentReport>;
|
|
8
|
+
replayStep(stepId: string, mode?: 'replay' | 'refine'): Promise<void>;
|
|
9
|
+
cancel(): void;
|
|
10
|
+
getUndoManager(): IUndoManager;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=stealthRuntimeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stealthRuntimeTypes.d.ts","sourceRoot":"","sources":["../../src/runtime/stealthRuntimeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACxF,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,IAAI,IAAI,CAAC;IACf,cAAc,IAAI,YAAY,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stealthRuntimeTypes.js","sourceRoot":"","sources":["../../src/runtime/stealthRuntimeTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PlanStep, ExecutionResult, PythonRunCommandAction, PythonScanProjectAction, PythonReadFileAction, PythonWriteFileAction, InternalIdentifyHomepageAction, InternalLocateFilesAction, InternalExtractRelevantSectionAction, InternalRunProjectScriptsAction, InternalEmitMessageAction, InternalReviewDiffAction, LlmRewriteAction } from '../internalTypes';
|
|
2
|
+
import type { IStepExecutor, StepOutcome } from '../internalTypes';
|
|
3
|
+
type PythonAction = PythonRunCommandAction | PythonScanProjectAction | PythonReadFileAction | PythonWriteFileAction;
|
|
4
|
+
type InternalAction = InternalIdentifyHomepageAction | InternalLocateFilesAction | InternalExtractRelevantSectionAction | InternalRunProjectScriptsAction | InternalEmitMessageAction | InternalReviewDiffAction;
|
|
5
|
+
interface ValidationResult {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
output?: string;
|
|
9
|
+
data?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface StepExecutorDeps {
|
|
12
|
+
preflight(step: PlanStep): Promise<ExecutionResult | undefined>;
|
|
13
|
+
primeStep(step: PlanStep): void;
|
|
14
|
+
executePython(action: PythonAction, stepId: string, step: PlanStep): Promise<StepOutcome>;
|
|
15
|
+
executeInternal(step: PlanStep, action: InternalAction): Promise<StepOutcome>;
|
|
16
|
+
executeRewrite(step: PlanStep, action: LlmRewriteAction, goal: string): Promise<StepOutcome>;
|
|
17
|
+
validate(step: PlanStep, goal: string): Promise<ValidationResult>;
|
|
18
|
+
buildResult(stepId: string, outcome: StepOutcome, startedAt: number): ExecutionResult;
|
|
19
|
+
}
|
|
20
|
+
export declare function createStepExecutor(deps: StepExecutorDeps): IStepExecutor;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=stepExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepExecutor.d.ts","sourceRoot":"","sources":["../../src/runtime/stepExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,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G,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;CACvF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CA2FxE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStepExecutor = createStepExecutor;
|
|
4
|
+
function createStepExecutor(deps) {
|
|
5
|
+
const queue = [];
|
|
6
|
+
let processing = false;
|
|
7
|
+
async function processQueue() {
|
|
8
|
+
if (processing) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
processing = true;
|
|
12
|
+
while (queue.length > 0) {
|
|
13
|
+
const next = queue.shift();
|
|
14
|
+
if (!next) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const result = await runStep(next.step, next.goal);
|
|
19
|
+
next.resolve(result);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
next.reject(error);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
processing = false;
|
|
26
|
+
}
|
|
27
|
+
async function runStep(step, goal) {
|
|
28
|
+
const gateFailure = await deps.preflight(step);
|
|
29
|
+
if (gateFailure) {
|
|
30
|
+
return gateFailure;
|
|
31
|
+
}
|
|
32
|
+
const startedAt = Date.now();
|
|
33
|
+
let outcome = { ok: false };
|
|
34
|
+
deps.primeStep(step);
|
|
35
|
+
try {
|
|
36
|
+
const action = step.action;
|
|
37
|
+
switch (action.type) {
|
|
38
|
+
case 'python':
|
|
39
|
+
outcome = await deps.executePython(action, step.id, step);
|
|
40
|
+
break;
|
|
41
|
+
case 'internal':
|
|
42
|
+
outcome = await deps.executeInternal(step, action);
|
|
43
|
+
break;
|
|
44
|
+
case 'llmRewrite':
|
|
45
|
+
outcome = await deps.executeRewrite(step, action, goal);
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
outcome = { ok: false, error: `Unsupported step action: ${action.type}` };
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
outcome = { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
54
|
+
}
|
|
55
|
+
if (outcome.ok) {
|
|
56
|
+
const validation = await deps.validate(step, goal);
|
|
57
|
+
if (!validation.ok) {
|
|
58
|
+
outcome = {
|
|
59
|
+
ok: false,
|
|
60
|
+
error: validation.error ?? 'Validation failed.',
|
|
61
|
+
output: validation.output,
|
|
62
|
+
data: {
|
|
63
|
+
...(outcome.data ?? {}),
|
|
64
|
+
validation
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return deps.buildResult(step.id, outcome, startedAt);
|
|
70
|
+
}
|
|
71
|
+
function enqueue(step, goal) {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
queue.push({ step, goal, resolve, reject });
|
|
74
|
+
void processQueue();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
execute(step, goal) {
|
|
79
|
+
return enqueue(step, goal);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=stepExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepExecutor.js","sourceRoot":"","sources":["../../src/runtime/stepExecutor.ts"],"names":[],"mappings":";;AAgDA,gDA2FC;AA3FD,SAAgB,kBAAkB,CAAC,IAAsB;IAQvD,MAAM,KAAK,GAAuB,EAAE,CAAC;IACrC,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,KAAK,UAAU,YAAY;QACzB,IAAI,UAAU,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QACD,UAAU,GAAG,IAAI,CAAC;QAClB,OA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L,CAAC;IAED,OAAO;QACL,OAAO,CAAC,IAAc,EAAE,IAAY;YAClC,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PlanStep, ExecutionResult, LlmRewriteAction } from '../internalTypes';
|
|
2
|
+
import type { IHelperManager, ITelemetry, RewriteHydrationContext, StepOutcome } from '../internalTypes';
|
|
3
|
+
import { parseHelperStepMetadata } from './stepMetadata';
|
|
4
|
+
import type { StatusPayload } from '../internalTypes';
|
|
5
|
+
export interface StepLifecycleDeps {
|
|
6
|
+
helperManager: IHelperManager;
|
|
7
|
+
rewriteHydrationManager: {
|
|
8
|
+
buildContext(step: PlanStep, relativePath: string): Promise<RewriteHydrationContext | undefined>;
|
|
9
|
+
};
|
|
10
|
+
getHydrationCache(stepId: string): RewriteHydrationContext | undefined;
|
|
11
|
+
setHydrationCache(stepId: string, context: RewriteHydrationContext | undefined): void;
|
|
12
|
+
getContextValue<T>(key: string): T | undefined;
|
|
13
|
+
setContextValue(key: string, value: unknown): void;
|
|
14
|
+
ensureSession(): void;
|
|
15
|
+
isPreviewOnly(): boolean;
|
|
16
|
+
isDryRunEnabled(): boolean;
|
|
17
|
+
telemetry: ITelemetry;
|
|
18
|
+
buildExecutionResult(stepId: string, outcome: StepOutcome, startedAt: number): ExecutionResult;
|
|
19
|
+
}
|
|
20
|
+
export declare function createStepLifecycle(deps: StepLifecycleDeps): {
|
|
21
|
+
primeStepContext: (step: PlanStep) => void;
|
|
22
|
+
preflightStep: (step: PlanStep) => Promise<ExecutionResult | undefined>;
|
|
23
|
+
prepareStep: (step: PlanStep) => Promise<void>;
|
|
24
|
+
finalizeStep: (step: PlanStep) => void;
|
|
25
|
+
getStatusIconForStep: (step: PlanStep) => StatusPayload["icon"];
|
|
26
|
+
getResultStatusIcon: (ok: boolean) => StatusPayload["icon"];
|
|
27
|
+
resolveRewriteTargetPath: (action: LlmRewriteAction, helperMeta?: ReturnType<typeof parseHelperStepMetadata>) => string | undefined;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=stepLifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepLifecycle.d.ts","sourceRoot":"","sources":["../../src/runtime/stepLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAc,MAAM,kBAAkB,CAAC;AAChG,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAqD,MAAM,gBAAgB,CAAC;AAC5G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,cAAc,CAAC;IAC9B,uBAAuB,EAAE;QACvB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;KAClG,CAAC;IACF,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAAC;IACvE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,SAAS,GAAG,IAAI,CAAC;IACtF,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;IACnD,aAAa,IAAI,IAAI,CAAC;IACtB,aAAa,IAAI,OAAO,CAAC;IACzB,eAAe,IAAI,OAAO,CAAC;IAC3B,SAAS,EAAE,UAAU,CAAC;IACtB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;CAChG;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;6BACzB,QAAQ,KAAG,IAAI;0BAWZ,QAAQ,KAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;wBAcjD,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC;yBA4B7B,QAAQ,KAAG,IAAI;iCAsDP,QAAQ,KAAG,aAAa,CAAC,MAAM,CAAC;8BAInC,OAAO,KAAG,aAAa,CAAC,MAAM,CAAC;uCAnDtD,gBAAgB,eACX,UAAU,CAAC,OAAO,uBAAuB,CAAC,KACtD,MAAM,GAAG,SAAS;EA8DtB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStepLifecycle = createStepLifecycle;
|
|
4
|
+
const stepMetadata_1 = require("./stepMetadata");
|
|
5
|
+
function createStepLifecycle(deps) {
|
|
6
|
+
function primeStepContext(step) {
|
|
7
|
+
const helperMeta = (0, stepMetadata_1.parseHelperStepMetadata)(step);
|
|
8
|
+
if (helperMeta?.pathRef && helperMeta.helperPath) {
|
|
9
|
+
deps.setContextValue(helperMeta.pathRef, helperMeta.helperPath);
|
|
10
|
+
}
|
|
11
|
+
const relatedMeta = (0, stepMetadata_1.parseRelatedStepMetadata)(step);
|
|
12
|
+
if (relatedMeta?.pathRef && relatedMeta.targetPath) {
|
|
13
|
+
deps.setContextValue(relatedMeta.pathRef, relatedMeta.targetPath);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function preflightStep(step) {
|
|
17
|
+
const callerMeta = (0, stepMetadata_1.parseCallerStepMetadata)(step);
|
|
18
|
+
const callerGateNeeded = !deps.isPreviewOnly() && !deps.isDryRunEnabled();
|
|
19
|
+
if (!callerGateNeeded || callerMeta?.role !== 'rewrite') {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const start = Date.now();
|
|
23
|
+
const preflight = await deps.helperManager.ensureChainReady(callerMeta);
|
|
24
|
+
if (preflight.ok) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return deps.buildExecutionResult(step.id, preflight, start);
|
|
28
|
+
}
|
|
29
|
+
async function prepareStep(step) {
|
|
30
|
+
if (step.action.type !== 'llmRewrite') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
deps.ensureSession();
|
|
35
|
+
const helperMeta = (0, stepMetadata_1.parseHelperStepMetadata)(step);
|
|
36
|
+
const action = step.action;
|
|
37
|
+
const relativePath = resolveRewriteTargetPath(action, helperMeta);
|
|
38
|
+
if (!relativePath) {
|
|
39
|
+
deps.setHydrationCache(step.id, undefined);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const hydration = await deps.rewriteHydrationManager.buildContext(step, relativePath);
|
|
43
|
+
if (hydration) {
|
|
44
|
+
deps.setHydrationCache(step.id, hydration);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
deps.setHydrationCache(step.id, undefined);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
await deps.telemetry.log({
|
|
52
|
+
message: `Failed to prepare rewrite context for ${step.title}: ${error instanceof Error ? error.message : String(error)}`,
|
|
53
|
+
stepId: step.id,
|
|
54
|
+
level: 'warn'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function finalizeStep(step) {
|
|
59
|
+
if (step.action.type === 'llmRewrite') {
|
|
60
|
+
deps.setHydrationCache(step.id, undefined);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function resolveRewriteTargetPath(action, helperMeta) {
|
|
64
|
+
if (helperMeta?.helperPath) {
|
|
65
|
+
return helperMeta.helperPath;
|
|
66
|
+
}
|
|
67
|
+
if (typeof action.pathRef === 'string') {
|
|
68
|
+
return deps.getContextValue(action.pathRef);
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
function getStatusIconForAction(action) {
|
|
73
|
+
switch (action.type) {
|
|
74
|
+
case 'python':
|
|
75
|
+
switch (action.name) {
|
|
76
|
+
case 'scanProject':
|
|
77
|
+
case 'readFile':
|
|
78
|
+
return 'search';
|
|
79
|
+
case 'writeFile':
|
|
80
|
+
return 'code';
|
|
81
|
+
case 'runCommand':
|
|
82
|
+
return 'terminal';
|
|
83
|
+
default:
|
|
84
|
+
return 'info';
|
|
85
|
+
}
|
|
86
|
+
case 'internal':
|
|
87
|
+
switch (action.name) {
|
|
88
|
+
case 'identifyHomepage':
|
|
89
|
+
case 'locateFiles':
|
|
90
|
+
return 'search';
|
|
91
|
+
case 'runProjectScripts':
|
|
92
|
+
return 'terminal';
|
|
93
|
+
case 'reviewDiff':
|
|
94
|
+
return 'review';
|
|
95
|
+
case 'emitMessage':
|
|
96
|
+
return 'info';
|
|
97
|
+
default:
|
|
98
|
+
return 'plan';
|
|
99
|
+
}
|
|
100
|
+
case 'llmRewrite':
|
|
101
|
+
return 'code';
|
|
102
|
+
default:
|
|
103
|
+
return 'info';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function getStatusIconForStep(step) {
|
|
107
|
+
return getStatusIconForAction(step.action);
|
|
108
|
+
}
|
|
109
|
+
function getResultStatusIcon(ok) {
|
|
110
|
+
return ok ? 'success' : 'warn';
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
primeStepContext,
|
|
114
|
+
preflightStep,
|
|
115
|
+
prepareStep,
|
|
116
|
+
finalizeStep,
|
|
117
|
+
getStatusIconForStep,
|
|
118
|
+
getResultStatusIcon,
|
|
119
|
+
resolveRewriteTargetPath
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=stepLifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepLifecycle.js","sourceRoot":"","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AAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,SAAS,mBAAmB,CAAC,EAAW;QACtC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,OAAO;QACL,gBAAgB;QAChB,aAAa;QACb,WAAW;QACX,YAAY;QACZ,oBAAoB;QACpB,mBAAmB;QACnB,wBAAwB;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlanStep } from '../internalTypes';
|
|
2
|
+
import type { HelperStepMetadata, CallerStepMetadata, RelatedStepMetadata } from '../internalTypes';
|
|
3
|
+
export declare function parseHelperStepMetadata(step: PlanStep): HelperStepMetadata | undefined;
|
|
4
|
+
export declare function parseCallerStepMetadata(step: PlanStep): CallerStepMetadata | undefined;
|
|
5
|
+
export declare function parseRelatedStepMetadata(step: PlanStep): RelatedStepMetadata | undefined;
|
|
6
|
+
//# sourceMappingURL=stepMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepMetadata.d.ts","sourceRoot":"","sources":["../../src/runtime/stepMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AAkC1B,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAmBtF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAetF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAgBxF"}
|