@intrect/openswarm 0.2.0
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 +21 -0
- package/README.md +544 -0
- package/config.example.yaml +107 -0
- package/dist/adapters/base.d.ts +8 -0
- package/dist/adapters/base.d.ts.map +1 -0
- package/dist/adapters/base.js +104 -0
- package/dist/adapters/base.js.map +1 -0
- package/dist/adapters/claude.d.ts +13 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +318 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/codex.d.ts +14 -0
- package/dist/adapters/codex.d.ts.map +1 -0
- package/dist/adapters/codex.js +366 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/adapters/cryptoQuantAdapter.d.ts +85 -0
- package/dist/adapters/cryptoQuantAdapter.d.ts.map +1 -0
- package/dist/adapters/cryptoQuantAdapter.js +238 -0
- package/dist/adapters/cryptoQuantAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +17 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +47 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/processRegistry.d.ts +38 -0
- package/dist/adapters/processRegistry.d.ts.map +1 -0
- package/dist/adapters/processRegistry.js +147 -0
- package/dist/adapters/processRegistry.js.map +1 -0
- package/dist/adapters/streamBuffer.d.ts +59 -0
- package/dist/adapters/streamBuffer.d.ts.map +1 -0
- package/dist/adapters/streamBuffer.js +123 -0
- package/dist/adapters/streamBuffer.js.map +1 -0
- package/dist/adapters/types.d.ts +65 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +6 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/agents/agentBus.d.ts +160 -0
- package/dist/agents/agentBus.d.ts.map +1 -0
- package/dist/agents/agentBus.js +350 -0
- package/dist/agents/agentBus.js.map +1 -0
- package/dist/agents/agentPair.d.ts +210 -0
- package/dist/agents/agentPair.d.ts.map +1 -0
- package/dist/agents/agentPair.js +420 -0
- package/dist/agents/agentPair.js.map +1 -0
- package/dist/agents/auditor.d.ts +27 -0
- package/dist/agents/auditor.d.ts.map +1 -0
- package/dist/agents/auditor.js +237 -0
- package/dist/agents/auditor.js.map +1 -0
- package/dist/agents/cliStreamParser.d.ts +18 -0
- package/dist/agents/cliStreamParser.d.ts.map +1 -0
- package/dist/agents/cliStreamParser.js +156 -0
- package/dist/agents/cliStreamParser.js.map +1 -0
- package/dist/agents/documenter.d.ts +31 -0
- package/dist/agents/documenter.d.ts.map +1 -0
- package/dist/agents/documenter.js +285 -0
- package/dist/agents/documenter.js.map +1 -0
- package/dist/agents/index.d.ts +10 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +10 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/pairMetrics.d.ts +63 -0
- package/dist/agents/pairMetrics.d.ts.map +1 -0
- package/dist/agents/pairMetrics.js +231 -0
- package/dist/agents/pairMetrics.js.map +1 -0
- package/dist/agents/pairPipeline.d.ts +155 -0
- package/dist/agents/pairPipeline.d.ts.map +1 -0
- package/dist/agents/pairPipeline.js +793 -0
- package/dist/agents/pairPipeline.js.map +1 -0
- package/dist/agents/pairWebhook.d.ts +59 -0
- package/dist/agents/pairWebhook.d.ts.map +1 -0
- package/dist/agents/pairWebhook.js +242 -0
- package/dist/agents/pairWebhook.js.map +1 -0
- package/dist/agents/pipelineFormat.d.ts +11 -0
- package/dist/agents/pipelineFormat.d.ts.map +1 -0
- package/dist/agents/pipelineFormat.js +164 -0
- package/dist/agents/pipelineFormat.js.map +1 -0
- package/dist/agents/pipelineGuards.d.ts +23 -0
- package/dist/agents/pipelineGuards.d.ts.map +1 -0
- package/dist/agents/pipelineGuards.js +175 -0
- package/dist/agents/pipelineGuards.js.map +1 -0
- package/dist/agents/reviewer.d.ts +37 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/reviewer.js +213 -0
- package/dist/agents/reviewer.js.map +1 -0
- package/dist/agents/skillDocumenter.d.ts +23 -0
- package/dist/agents/skillDocumenter.d.ts.map +1 -0
- package/dist/agents/skillDocumenter.js +218 -0
- package/dist/agents/skillDocumenter.js.map +1 -0
- package/dist/agents/tester.d.ts +37 -0
- package/dist/agents/tester.d.ts.map +1 -0
- package/dist/agents/tester.js +308 -0
- package/dist/agents/tester.js.map +1 -0
- package/dist/agents/worker.d.ts +30 -0
- package/dist/agents/worker.d.ts.map +1 -0
- package/dist/agents/worker.js +128 -0
- package/dist/agents/worker.js.map +1 -0
- package/dist/automation/autonomousRunner.d.ts +123 -0
- package/dist/automation/autonomousRunner.d.ts.map +1 -0
- package/dist/automation/autonomousRunner.js +1082 -0
- package/dist/automation/autonomousRunner.js.map +1 -0
- package/dist/automation/ciWorker.d.ts +51 -0
- package/dist/automation/ciWorker.d.ts.map +1 -0
- package/dist/automation/ciWorker.js +282 -0
- package/dist/automation/ciWorker.js.map +1 -0
- package/dist/automation/conflictResolver.d.ts +29 -0
- package/dist/automation/conflictResolver.d.ts.map +1 -0
- package/dist/automation/conflictResolver.js +261 -0
- package/dist/automation/conflictResolver.js.map +1 -0
- package/dist/automation/dailyReporter.d.ts +26 -0
- package/dist/automation/dailyReporter.d.ts.map +1 -0
- package/dist/automation/dailyReporter.js +132 -0
- package/dist/automation/dailyReporter.js.map +1 -0
- package/dist/automation/index.d.ts +7 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +7 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/longRunningMonitor.d.ts +26 -0
- package/dist/automation/longRunningMonitor.d.ts.map +1 -0
- package/dist/automation/longRunningMonitor.js +231 -0
- package/dist/automation/longRunningMonitor.js.map +1 -0
- package/dist/automation/prOwnership.d.ts +18 -0
- package/dist/automation/prOwnership.d.ts.map +1 -0
- package/dist/automation/prOwnership.js +61 -0
- package/dist/automation/prOwnership.js.map +1 -0
- package/dist/automation/prProcessor.d.ts +62 -0
- package/dist/automation/prProcessor.d.ts.map +1 -0
- package/dist/automation/prProcessor.js +700 -0
- package/dist/automation/prProcessor.js.map +1 -0
- package/dist/automation/runnerExecution.d.ts +49 -0
- package/dist/automation/runnerExecution.d.ts.map +1 -0
- package/dist/automation/runnerExecution.js +663 -0
- package/dist/automation/runnerExecution.js.map +1 -0
- package/dist/automation/runnerState.d.ts +170 -0
- package/dist/automation/runnerState.d.ts.map +1 -0
- package/dist/automation/runnerState.js +495 -0
- package/dist/automation/runnerState.js.map +1 -0
- package/dist/automation/runnerTypes.d.ts +46 -0
- package/dist/automation/runnerTypes.d.ts.map +1 -0
- package/dist/automation/runnerTypes.js +5 -0
- package/dist/automation/runnerTypes.js.map +1 -0
- package/dist/automation/scheduler.d.ts +75 -0
- package/dist/automation/scheduler.d.ts.map +1 -0
- package/dist/automation/scheduler.js +394 -0
- package/dist/automation/scheduler.js.map +1 -0
- package/dist/cli/promptHandler.d.ts +13 -0
- package/dist/cli/promptHandler.d.ts.map +1 -0
- package/dist/cli/promptHandler.js +189 -0
- package/dist/cli/promptHandler.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +138 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/config.d.ts +308 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +529 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/eventHub.d.ts +194 -0
- package/dist/core/eventHub.d.ts.map +1 -0
- package/dist/core/eventHub.js +136 -0
- package/dist/core/eventHub.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/service.d.ts +27 -0
- package/dist/core/service.d.ts.map +1 -0
- package/dist/core/service.js +438 -0
- package/dist/core/service.js.map +1 -0
- package/dist/core/traceCollector.d.ts +105 -0
- package/dist/core/traceCollector.d.ts.map +1 -0
- package/dist/core/traceCollector.js +141 -0
- package/dist/core/traceCollector.js.map +1 -0
- package/dist/core/types.d.ts +413 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/discord/discordCore.d.ts +104 -0
- package/dist/discord/discordCore.d.ts.map +1 -0
- package/dist/discord/discordCore.js +698 -0
- package/dist/discord/discordCore.js.map +1 -0
- package/dist/discord/discordHandlers.d.ts +86 -0
- package/dist/discord/discordHandlers.d.ts.map +1 -0
- package/dist/discord/discordHandlers.js +849 -0
- package/dist/discord/discordHandlers.js.map +1 -0
- package/dist/discord/discordPair.d.ts +6 -0
- package/dist/discord/discordPair.d.ts.map +1 -0
- package/dist/discord/discordPair.js +567 -0
- package/dist/discord/discordPair.js.map +1 -0
- package/dist/discord/index.d.ts +4 -0
- package/dist/discord/index.d.ts.map +1 -0
- package/dist/discord/index.js +11 -0
- package/dist/discord/index.js.map +1 -0
- package/dist/github/github.d.ts +236 -0
- package/dist/github/github.d.ts.map +1 -0
- package/dist/github/github.js +535 -0
- package/dist/github/github.js.map +1 -0
- package/dist/github/index.d.ts +2 -0
- package/dist/github/index.d.ts.map +1 -0
- package/dist/github/index.js +2 -0
- package/dist/github/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/analyzer.d.ts +36 -0
- package/dist/knowledge/analyzer.d.ts.map +1 -0
- package/dist/knowledge/analyzer.js +170 -0
- package/dist/knowledge/analyzer.js.map +1 -0
- package/dist/knowledge/gitInfo.d.ts +10 -0
- package/dist/knowledge/gitInfo.d.ts.map +1 -0
- package/dist/knowledge/gitInfo.js +134 -0
- package/dist/knowledge/gitInfo.js.map +1 -0
- package/dist/knowledge/graph.d.ts +45 -0
- package/dist/knowledge/graph.d.ts.map +1 -0
- package/dist/knowledge/graph.js +262 -0
- package/dist/knowledge/graph.js.map +1 -0
- package/dist/knowledge/graphqlExporter.d.ts +64 -0
- package/dist/knowledge/graphqlExporter.d.ts.map +1 -0
- package/dist/knowledge/graphqlExporter.js +333 -0
- package/dist/knowledge/graphqlExporter.js.map +1 -0
- package/dist/knowledge/index.d.ts +58 -0
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +212 -0
- package/dist/knowledge/index.js.map +1 -0
- package/dist/knowledge/repository.d.ts +64 -0
- package/dist/knowledge/repository.d.ts.map +1 -0
- package/dist/knowledge/repository.js +250 -0
- package/dist/knowledge/repository.js.map +1 -0
- package/dist/knowledge/riskOnAnalyzer.d.ts +79 -0
- package/dist/knowledge/riskOnAnalyzer.d.ts.map +1 -0
- package/dist/knowledge/riskOnAnalyzer.js +243 -0
- package/dist/knowledge/riskOnAnalyzer.js.map +1 -0
- package/dist/knowledge/scanner.d.ts +14 -0
- package/dist/knowledge/scanner.d.ts.map +1 -0
- package/dist/knowledge/scanner.js +350 -0
- package/dist/knowledge/scanner.js.map +1 -0
- package/dist/knowledge/store.d.ts +23 -0
- package/dist/knowledge/store.d.ts.map +1 -0
- package/dist/knowledge/store.js +86 -0
- package/dist/knowledge/store.js.map +1 -0
- package/dist/knowledge/types.d.ts +288 -0
- package/dist/knowledge/types.d.ts.map +1 -0
- package/dist/knowledge/types.js +111 -0
- package/dist/knowledge/types.js.map +1 -0
- package/dist/linear/index.d.ts +3 -0
- package/dist/linear/index.d.ts.map +1 -0
- package/dist/linear/index.js +3 -0
- package/dist/linear/index.js.map +1 -0
- package/dist/linear/linear.d.ts +160 -0
- package/dist/linear/linear.d.ts.map +1 -0
- package/dist/linear/linear.js +983 -0
- package/dist/linear/linear.js.map +1 -0
- package/dist/linear/projectUpdater.d.ts +23 -0
- package/dist/linear/projectUpdater.d.ts.map +1 -0
- package/dist/linear/projectUpdater.js +347 -0
- package/dist/linear/projectUpdater.js.map +1 -0
- package/dist/locale/en.d.ts +3 -0
- package/dist/locale/en.d.ts.map +1 -0
- package/dist/locale/en.js +436 -0
- package/dist/locale/en.js.map +1 -0
- package/dist/locale/index.d.ts +28 -0
- package/dist/locale/index.d.ts.map +1 -0
- package/dist/locale/index.js +89 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/locale/ko.d.ts +3 -0
- package/dist/locale/ko.d.ts.map +1 -0
- package/dist/locale/ko.js +436 -0
- package/dist/locale/ko.js.map +1 -0
- package/dist/locale/prompts/en.d.ts +3 -0
- package/dist/locale/prompts/en.d.ts.map +1 -0
- package/dist/locale/prompts/en.js +278 -0
- package/dist/locale/prompts/en.js.map +1 -0
- package/dist/locale/prompts/ko.d.ts +3 -0
- package/dist/locale/prompts/ko.d.ts.map +1 -0
- package/dist/locale/prompts/ko.js +279 -0
- package/dist/locale/prompts/ko.js.map +1 -0
- package/dist/locale/types.d.ts +407 -0
- package/dist/locale/types.d.ts.map +1 -0
- package/dist/locale/types.js +5 -0
- package/dist/locale/types.js.map +1 -0
- package/dist/memory/codex.d.ts +93 -0
- package/dist/memory/codex.d.ts.map +1 -0
- package/dist/memory/codex.js +366 -0
- package/dist/memory/codex.js.map +1 -0
- package/dist/memory/compaction.d.ts +21 -0
- package/dist/memory/compaction.d.ts.map +1 -0
- package/dist/memory/compaction.js +205 -0
- package/dist/memory/compaction.js.map +1 -0
- package/dist/memory/index.d.ts +13 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +13 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memoryCore.d.ts +178 -0
- package/dist/memory/memoryCore.d.ts.map +1 -0
- package/dist/memory/memoryCore.js +623 -0
- package/dist/memory/memoryCore.js.map +1 -0
- package/dist/memory/memoryOps.d.ts +90 -0
- package/dist/memory/memoryOps.d.ts.map +1 -0
- package/dist/memory/memoryOps.js +606 -0
- package/dist/memory/memoryOps.js.map +1 -0
- package/dist/orchestration/conflictDetector.d.ts +15 -0
- package/dist/orchestration/conflictDetector.d.ts.map +1 -0
- package/dist/orchestration/conflictDetector.js +130 -0
- package/dist/orchestration/conflictDetector.js.map +1 -0
- package/dist/orchestration/decisionEngine.d.ts +177 -0
- package/dist/orchestration/decisionEngine.d.ts.map +1 -0
- package/dist/orchestration/decisionEngine.js +496 -0
- package/dist/orchestration/decisionEngine.js.map +1 -0
- package/dist/orchestration/index.d.ts +5 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +5 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/taskParser.d.ts +67 -0
- package/dist/orchestration/taskParser.d.ts.map +1 -0
- package/dist/orchestration/taskParser.js +542 -0
- package/dist/orchestration/taskParser.js.map +1 -0
- package/dist/orchestration/taskScheduler.d.ts +141 -0
- package/dist/orchestration/taskScheduler.d.ts.map +1 -0
- package/dist/orchestration/taskScheduler.js +317 -0
- package/dist/orchestration/taskScheduler.js.map +1 -0
- package/dist/orchestration/workflow.d.ts +145 -0
- package/dist/orchestration/workflow.d.ts.map +1 -0
- package/dist/orchestration/workflow.js +301 -0
- package/dist/orchestration/workflow.js.map +1 -0
- package/dist/runners/cliRunner.d.ts +11 -0
- package/dist/runners/cliRunner.d.ts.map +1 -0
- package/dist/runners/cliRunner.js +194 -0
- package/dist/runners/cliRunner.js.map +1 -0
- package/dist/support/apiCache.d.ts +85 -0
- package/dist/support/apiCache.d.ts.map +1 -0
- package/dist/support/apiCache.js +163 -0
- package/dist/support/apiCache.js.map +1 -0
- package/dist/support/chat.d.ts +3 -0
- package/dist/support/chat.d.ts.map +1 -0
- package/dist/support/chat.js +304 -0
- package/dist/support/chat.js.map +1 -0
- package/dist/support/chatBackend.d.ts +25 -0
- package/dist/support/chatBackend.d.ts.map +1 -0
- package/dist/support/chatBackend.js +235 -0
- package/dist/support/chatBackend.js.map +1 -0
- package/dist/support/chatMemory.d.ts +71 -0
- package/dist/support/chatMemory.d.ts.map +1 -0
- package/dist/support/chatMemory.js +119 -0
- package/dist/support/chatMemory.js.map +1 -0
- package/dist/support/chatTui.d.ts +3 -0
- package/dist/support/chatTui.d.ts.map +1 -0
- package/dist/support/chatTui.js +998 -0
- package/dist/support/chatTui.js.map +1 -0
- package/dist/support/costTracker.d.ts +29 -0
- package/dist/support/costTracker.d.ts.map +1 -0
- package/dist/support/costTracker.js +113 -0
- package/dist/support/costTracker.js.map +1 -0
- package/dist/support/dashboardHtml.d.ts +3 -0
- package/dist/support/dashboardHtml.d.ts.map +1 -0
- package/dist/support/dashboardHtml.js +2070 -0
- package/dist/support/dashboardHtml.js.map +1 -0
- package/dist/support/delete-beliefs.d.ts +2 -0
- package/dist/support/delete-beliefs.d.ts.map +1 -0
- package/dist/support/delete-beliefs.js +34 -0
- package/dist/support/delete-beliefs.js.map +1 -0
- package/dist/support/dev.d.ts +55 -0
- package/dist/support/dev.d.ts.map +1 -0
- package/dist/support/dev.js +298 -0
- package/dist/support/dev.js.map +1 -0
- package/dist/support/editParser.d.ts +37 -0
- package/dist/support/editParser.d.ts.map +1 -0
- package/dist/support/editParser.js +365 -0
- package/dist/support/editParser.js.map +1 -0
- package/dist/support/gitStatus.d.ts +21 -0
- package/dist/support/gitStatus.d.ts.map +1 -0
- package/dist/support/gitStatus.js +108 -0
- package/dist/support/gitStatus.js.map +1 -0
- package/dist/support/gitTracker.d.ts +30 -0
- package/dist/support/gitTracker.d.ts.map +1 -0
- package/dist/support/gitTracker.js +143 -0
- package/dist/support/gitTracker.js.map +1 -0
- package/dist/support/index.d.ts +13 -0
- package/dist/support/index.d.ts.map +1 -0
- package/dist/support/index.js +13 -0
- package/dist/support/index.js.map +1 -0
- package/dist/support/planner.d.ts +58 -0
- package/dist/support/planner.d.ts.map +1 -0
- package/dist/support/planner.js +395 -0
- package/dist/support/planner.js.map +1 -0
- package/dist/support/projectMapper.d.ts +46 -0
- package/dist/support/projectMapper.d.ts.map +1 -0
- package/dist/support/projectMapper.js +259 -0
- package/dist/support/projectMapper.js.map +1 -0
- package/dist/support/quotaTracker.d.ts +29 -0
- package/dist/support/quotaTracker.d.ts.map +1 -0
- package/dist/support/quotaTracker.js +89 -0
- package/dist/support/quotaTracker.js.map +1 -0
- package/dist/support/rateLimiter.d.ts +101 -0
- package/dist/support/rateLimiter.d.ts.map +1 -0
- package/dist/support/rateLimiter.js +219 -0
- package/dist/support/rateLimiter.js.map +1 -0
- package/dist/support/rollback.d.ts +61 -0
- package/dist/support/rollback.d.ts.map +1 -0
- package/dist/support/rollback.js +328 -0
- package/dist/support/rollback.js.map +1 -0
- package/dist/support/stuckDetector.d.ts +68 -0
- package/dist/support/stuckDetector.d.ts.map +1 -0
- package/dist/support/stuckDetector.js +174 -0
- package/dist/support/stuckDetector.js.map +1 -0
- package/dist/support/timeWindow.d.ts +60 -0
- package/dist/support/timeWindow.d.ts.map +1 -0
- package/dist/support/timeWindow.js +236 -0
- package/dist/support/timeWindow.js.map +1 -0
- package/dist/support/web.d.ts +11 -0
- package/dist/support/web.d.ts.map +1 -0
- package/dist/support/web.js +938 -0
- package/dist/support/web.js.map +1 -0
- package/dist/support/workflowLinear.d.ts +99 -0
- package/dist/support/workflowLinear.d.ts.map +1 -0
- package/dist/support/workflowLinear.js +257 -0
- package/dist/support/workflowLinear.js.map +1 -0
- package/dist/support/worktreeManager.d.ts +20 -0
- package/dist/support/worktreeManager.d.ts.map +1 -0
- package/dist/support/worktreeManager.js +144 -0
- package/dist/support/worktreeManager.js.map +1 -0
- package/dist/taskState/store.d.ts +101 -0
- package/dist/taskState/store.d.ts.map +1 -0
- package/dist/taskState/store.js +346 -0
- package/dist/taskState/store.js.map +1 -0
- package/package.json +70 -0
- package/templates/AGENTS.md +432 -0
- package/templates/BOOT.md +25 -0
- package/templates/BOOTSTRAP.md +50 -0
- package/templates/CHANGELOG_AUDIT.md +74 -0
- package/templates/HEARTBEAT.md +86 -0
- package/templates/IDENTITY.md +27 -0
- package/templates/ISSUE_ANALYSIS.md +31 -0
- package/templates/PR_LAND.md +75 -0
- package/templates/PR_REVIEW.md +97 -0
- package/templates/SOUL.dev.md +52 -0
- package/templates/SOUL.md +81 -0
- package/templates/TOOLS.md +52 -0
- package/templates/USER.md +22 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// OpenSwarm - Auditor Agent
|
|
3
|
+
// /audit skill-based BS detection agent
|
|
4
|
+
// ============================================
|
|
5
|
+
import { getAdapter, spawnCli } from '../adapters/index.js';
|
|
6
|
+
import { extractCostFromStreamJson, formatCost } from '../support/costTracker.js';
|
|
7
|
+
import { expandPath } from '../core/config.js';
|
|
8
|
+
// Prompts
|
|
9
|
+
function buildAuditorPrompt(options) {
|
|
10
|
+
const workerReport = `
|
|
11
|
+
- **Success:** ${options.workerResult.success}
|
|
12
|
+
- **Summary:** ${options.workerResult.summary}
|
|
13
|
+
- **Files Changed:** ${options.workerResult.filesChanged.join(', ') || '(none)'}
|
|
14
|
+
- **Commands:** ${options.workerResult.commands.join(', ') || '(none)'}
|
|
15
|
+
`;
|
|
16
|
+
return `/audit
|
|
17
|
+
|
|
18
|
+
## Task Context
|
|
19
|
+
- **Task:** ${options.taskTitle}
|
|
20
|
+
- **Description:** ${options.taskDescription.slice(0, 200)}${options.taskDescription.length > 200 ? '...' : ''}
|
|
21
|
+
|
|
22
|
+
## Worker's Changes
|
|
23
|
+
${workerReport}
|
|
24
|
+
|
|
25
|
+
Perform an audit focusing on the files changed in the above task.
|
|
26
|
+
After the audit is complete, output the result in the following JSON format:
|
|
27
|
+
|
|
28
|
+
\`\`\`json
|
|
29
|
+
{
|
|
30
|
+
"success": true,
|
|
31
|
+
"bsScore": 2.1,
|
|
32
|
+
"criticalCount": 0,
|
|
33
|
+
"warningCount": 3,
|
|
34
|
+
"minorCount": 5,
|
|
35
|
+
"issues": ["src/foo.ts:42 - unused import"],
|
|
36
|
+
"summary": "BS score 2.1/5.0, no CRITICAL issues"
|
|
37
|
+
}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
On failure:
|
|
41
|
+
\`\`\`json
|
|
42
|
+
{
|
|
43
|
+
"success": false,
|
|
44
|
+
"bsScore": 7.5,
|
|
45
|
+
"criticalCount": 3,
|
|
46
|
+
"warningCount": 5,
|
|
47
|
+
"minorCount": 2,
|
|
48
|
+
"issues": ["CRITICAL: src/bar.ts:10 - hardcoded secret"],
|
|
49
|
+
"summary": "BS score 7.5/5.0 - CRITICAL issues found"
|
|
50
|
+
}
|
|
51
|
+
\`\`\`
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
// Auditor Execution
|
|
55
|
+
export async function runAuditor(options) {
|
|
56
|
+
const prompt = buildAuditorPrompt(options);
|
|
57
|
+
const cwd = expandPath(options.projectPath);
|
|
58
|
+
const adapter = getAdapter(options.adapterName);
|
|
59
|
+
try {
|
|
60
|
+
const raw = await spawnCli(adapter, {
|
|
61
|
+
prompt,
|
|
62
|
+
cwd,
|
|
63
|
+
timeoutMs: options.timeoutMs,
|
|
64
|
+
model: options.model,
|
|
65
|
+
maxTurns: options.maxTurns,
|
|
66
|
+
});
|
|
67
|
+
return parseAuditorOutput(raw.stdout);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
criticalCount: 0,
|
|
73
|
+
warningCount: 0,
|
|
74
|
+
minorCount: 0,
|
|
75
|
+
issues: [],
|
|
76
|
+
summary: 'Auditor execution failed',
|
|
77
|
+
error: error instanceof Error ? error.message : String(error),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Output Parsing
|
|
82
|
+
function parseAuditorOutput(output) {
|
|
83
|
+
try {
|
|
84
|
+
const costInfo = extractCostFromStreamJson(output);
|
|
85
|
+
if (costInfo) {
|
|
86
|
+
console.log(`[Auditor] Cost: ${formatCost(costInfo)}`);
|
|
87
|
+
}
|
|
88
|
+
// Extract result entry from NDJSON
|
|
89
|
+
let resultText = '';
|
|
90
|
+
for (const line of output.split('\n')) {
|
|
91
|
+
try {
|
|
92
|
+
const event = JSON.parse(line.trim());
|
|
93
|
+
if (event.type === 'result' && event.result) {
|
|
94
|
+
resultText = event.result;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
if (event.type === 'item.completed' && event.item?.type === 'agent_message' && event.item.text) {
|
|
98
|
+
resultText = event.item.text;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch { /* skip non-JSON lines */ }
|
|
102
|
+
}
|
|
103
|
+
if (!resultText) {
|
|
104
|
+
const result = extractFromText(output);
|
|
105
|
+
result.costInfo = costInfo;
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
const result = extractResultJson(resultText) || extractFromText(resultText);
|
|
109
|
+
result.costInfo = costInfo;
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('[Auditor] Parse error:', error);
|
|
114
|
+
return extractFromText(output);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function extractResultJson(text) {
|
|
118
|
+
const jsonMatch = text.match(/```json\s*([\s\S]*?)\s*```/);
|
|
119
|
+
if (!jsonMatch) {
|
|
120
|
+
const objMatch = text.match(/\{\s*"success"\s*:/);
|
|
121
|
+
if (!objMatch)
|
|
122
|
+
return null;
|
|
123
|
+
const startIdx = objMatch.index;
|
|
124
|
+
let depth = 0;
|
|
125
|
+
let endIdx = startIdx;
|
|
126
|
+
for (let i = startIdx; i < text.length; i++) {
|
|
127
|
+
if (text[i] === '{')
|
|
128
|
+
depth++;
|
|
129
|
+
if (text[i] === '}') {
|
|
130
|
+
depth--;
|
|
131
|
+
if (depth === 0) {
|
|
132
|
+
endIdx = i + 1;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
const parsed = JSON.parse(text.slice(startIdx, endIdx));
|
|
139
|
+
return normalizeResult(parsed);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const parsed = JSON.parse(jsonMatch[1]);
|
|
147
|
+
return normalizeResult(parsed);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function normalizeResult(parsed) {
|
|
154
|
+
const bsScore = typeof parsed.bsScore === 'number' ? parsed.bsScore : undefined;
|
|
155
|
+
return {
|
|
156
|
+
success: bsScore !== undefined ? bsScore < 5.0 : Boolean(parsed.success),
|
|
157
|
+
bsScore,
|
|
158
|
+
criticalCount: typeof parsed.criticalCount === 'number' ? parsed.criticalCount : 0,
|
|
159
|
+
warningCount: typeof parsed.warningCount === 'number' ? parsed.warningCount : 0,
|
|
160
|
+
minorCount: typeof parsed.minorCount === 'number' ? parsed.minorCount : 0,
|
|
161
|
+
issues: Array.isArray(parsed.issues) ? parsed.issues : [],
|
|
162
|
+
summary: parsed.summary || '(no summary)',
|
|
163
|
+
error: parsed.error,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function extractFromText(text) {
|
|
167
|
+
const hasError = /error|fail|exception|critical/i.test(text);
|
|
168
|
+
const hasSuccess = /success|pass|clean|no issues/i.test(text);
|
|
169
|
+
// Extract BS score
|
|
170
|
+
let bsScore;
|
|
171
|
+
const bsMatch = text.match(/(?:bs|bullshit)\s*(?:score|index)[:\s]*(\d+(?:\.\d+)?)/i);
|
|
172
|
+
if (bsMatch) {
|
|
173
|
+
bsScore = parseFloat(bsMatch[1]);
|
|
174
|
+
}
|
|
175
|
+
// Extract issues
|
|
176
|
+
const issues = [];
|
|
177
|
+
const issuePattern = /(?:CRITICAL|WARNING|MINOR|issue)[:\s]+([^\n]+)/gi;
|
|
178
|
+
const issueMatches = text.matchAll(issuePattern);
|
|
179
|
+
for (const m of issueMatches) {
|
|
180
|
+
if (!issues.includes(m[1].trim())) {
|
|
181
|
+
issues.push(m[1].trim());
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
success: !hasError || hasSuccess,
|
|
186
|
+
bsScore,
|
|
187
|
+
criticalCount: 0,
|
|
188
|
+
warningCount: 0,
|
|
189
|
+
minorCount: 0,
|
|
190
|
+
issues: issues.slice(0, 20),
|
|
191
|
+
summary: extractSummary(text),
|
|
192
|
+
error: hasError ? extractErrorMessage(text) : undefined,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function extractSummary(text) {
|
|
196
|
+
const lines = text.split('\n').filter((l) => l.trim().length > 10);
|
|
197
|
+
if (lines.length === 0)
|
|
198
|
+
return '(no summary)';
|
|
199
|
+
const summary = lines[0].trim();
|
|
200
|
+
return summary.length > 200 ? summary.slice(0, 200) + '...' : summary;
|
|
201
|
+
}
|
|
202
|
+
function extractErrorMessage(text) {
|
|
203
|
+
const errorMatch = text.match(/(?:error|exception|failed?):\s*(.+)/i);
|
|
204
|
+
if (errorMatch)
|
|
205
|
+
return errorMatch[1].slice(0, 200);
|
|
206
|
+
const lines = text.split('\n').filter((l) => /error|fail/i.test(l));
|
|
207
|
+
if (lines.length > 0)
|
|
208
|
+
return lines[0].slice(0, 200);
|
|
209
|
+
return 'Unknown error';
|
|
210
|
+
}
|
|
211
|
+
// Formatting
|
|
212
|
+
export function formatAuditReport(result) {
|
|
213
|
+
const statusEmoji = result.success ? '🔍' : '🚨';
|
|
214
|
+
const lines = [];
|
|
215
|
+
lines.push(`${statusEmoji} **Auditor Result: ${result.success ? 'PASS' : 'FAIL'}**`);
|
|
216
|
+
lines.push('');
|
|
217
|
+
if (result.bsScore !== undefined) {
|
|
218
|
+
lines.push(`**BS Score:** ${result.bsScore.toFixed(1)}/5.0`);
|
|
219
|
+
}
|
|
220
|
+
lines.push(`**Critical:** ${result.criticalCount} | **Warning:** ${result.warningCount} | **Minor:** ${result.minorCount}`);
|
|
221
|
+
lines.push(`**Summary:** ${result.summary}`);
|
|
222
|
+
if (result.issues.length > 0) {
|
|
223
|
+
lines.push('');
|
|
224
|
+
lines.push('**Issues Found:**');
|
|
225
|
+
for (const issue of result.issues.slice(0, 5)) {
|
|
226
|
+
lines.push(` - ${issue}`);
|
|
227
|
+
}
|
|
228
|
+
if (result.issues.length > 5) {
|
|
229
|
+
lines.push(` - ... +${result.issues.length - 5} more`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (result.error) {
|
|
233
|
+
lines.push(`**Error:** ${result.error}`);
|
|
234
|
+
}
|
|
235
|
+
return lines.join('\n');
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=auditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditor.js","sourceRoot":"","sources":["../../src/agents/auditor.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,4BAA4B;AAC5B,wCAAwC;AACxC,+CAA+C;AAI/C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAiB,yBAAyB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA2B/C,UAAU;AAEV,SAAS,kBAAkB,CAAC,OAAuB;IACjD,MAAM,YAAY,GAAG;iBACN,OAAO,CAAC,YAAY,CAAC,OAAO;iBAC5B,OAAO,CAAC,YAAY,CAAC,OAAO;uBACtB,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;kBAC7D,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;CACrE,CAAC;IAEA,OAAO;;;cAGK,OAAO,CAAC,SAAS;qBACV,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;;;EAG5G,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Bb,CAAC;AACF,CAAC;A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CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract assistant text from Claude CLI --output-format stream-json stdout and invoke onLog.
|
|
3
|
+
* stream-json is streamed as NDJSON (line-delimited JSON objects).
|
|
4
|
+
*
|
|
5
|
+
* Since chunk boundaries may split a line in the middle, the incomplete last line
|
|
6
|
+
* is returned so it can be prepended to the next chunk.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseCliStreamChunk(text: string, onLog: (line: string) => void, buffer?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Extract result text from the result entry in full NDJSON stdout (for final parsing).
|
|
11
|
+
* Used by parseWorkerOutput and similar functions.
|
|
12
|
+
*/
|
|
13
|
+
export declare function extractResultFromStreamJson(stdout: string): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Backward compatible: parseCliOutput (simple version without buffer)
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseCliOutput(text: string, onLog: (line: string) => void): void;
|
|
18
|
+
//# sourceMappingURL=cliStreamParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliStreamParser.d.ts","sourceRoot":"","sources":["../../src/agents/cliStreamParser.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC7B,MAAM,GAAE,MAAW,GAClB,MAAM,CAaR;AA8GD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAezE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAEhF"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// OpenSwarm - CLI Stream Parser
|
|
3
|
+
// Claude CLI --output-format stream-json parsing utility
|
|
4
|
+
// ============================================
|
|
5
|
+
/**
|
|
6
|
+
* Extract assistant text from Claude CLI --output-format stream-json stdout and invoke onLog.
|
|
7
|
+
* stream-json is streamed as NDJSON (line-delimited JSON objects).
|
|
8
|
+
*
|
|
9
|
+
* Since chunk boundaries may split a line in the middle, the incomplete last line
|
|
10
|
+
* is returned so it can be prepended to the next chunk.
|
|
11
|
+
*/
|
|
12
|
+
export function parseCliStreamChunk(text, onLog, buffer = '') {
|
|
13
|
+
const combined = buffer + text;
|
|
14
|
+
const lines = combined.split('\n');
|
|
15
|
+
// Preserve the last line as it may be incomplete
|
|
16
|
+
const remainder = lines.pop() ?? '';
|
|
17
|
+
for (const line of lines) {
|
|
18
|
+
const trimmed = line.trim();
|
|
19
|
+
if (!trimmed)
|
|
20
|
+
continue;
|
|
21
|
+
processNdjsonLine(trimmed, onLog);
|
|
22
|
+
}
|
|
23
|
+
return remainder;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parse a single NDJSON line and extract assistant text.
|
|
27
|
+
* Inserts empty lines (spacers) and paragraph markers for line separation.
|
|
28
|
+
*/
|
|
29
|
+
function processNdjsonLine(line, onLog) {
|
|
30
|
+
try {
|
|
31
|
+
const event = JSON.parse(line);
|
|
32
|
+
// Extract text blocks from assistant message
|
|
33
|
+
if (event.type === 'assistant' && event.message?.content) {
|
|
34
|
+
// New assistant turn start — separator
|
|
35
|
+
onLog('───');
|
|
36
|
+
for (const block of event.message.content) {
|
|
37
|
+
if (block.type === 'text' && block.text?.trim()) {
|
|
38
|
+
emitFormattedText(block.text, onLog);
|
|
39
|
+
}
|
|
40
|
+
// Show tool_use blocks briefly
|
|
41
|
+
if (block.type === 'tool_use' && block.name) {
|
|
42
|
+
const input = summarizeToolInput(block.name, block.input);
|
|
43
|
+
onLog(`▸ ${block.name}${input ? ' ' + input : ''}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Invalid JSON (partial chunk) — ignore
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Format assistant text for readability and pass to onLog.
|
|
54
|
+
* - Empty lines are converted to spacers (paragraph breaks)
|
|
55
|
+
* - Markdown headers (##) get emphasis markers
|
|
56
|
+
* - Code blocks (```) are marked with start/end indicators
|
|
57
|
+
* - Long lines are truncated at 300 characters
|
|
58
|
+
*/
|
|
59
|
+
function emitFormattedText(text, onLog) {
|
|
60
|
+
const lines = text.split('\n');
|
|
61
|
+
let inCodeBlock = false;
|
|
62
|
+
let prevWasEmpty = false;
|
|
63
|
+
for (const raw of lines) {
|
|
64
|
+
const trimmed = raw.trim();
|
|
65
|
+
// Code block toggle
|
|
66
|
+
if (trimmed.startsWith('```')) {
|
|
67
|
+
inCodeBlock = !inCodeBlock;
|
|
68
|
+
onLog(inCodeBlock ? '┌─ code ─' : '└────────');
|
|
69
|
+
prevWasEmpty = false;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
// Empty line → paragraph break (prevent consecutive empty lines)
|
|
73
|
+
if (!trimmed) {
|
|
74
|
+
if (!prevWasEmpty) {
|
|
75
|
+
onLog('');
|
|
76
|
+
prevWasEmpty = true;
|
|
77
|
+
}
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
prevWasEmpty = false;
|
|
81
|
+
// Inside code block — pass through as-is
|
|
82
|
+
if (inCodeBlock) {
|
|
83
|
+
onLog('│ ' + truncate(raw, 300));
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// Markdown header
|
|
87
|
+
const headerMatch = trimmed.match(/^(#{1,4})\s+(.+)/);
|
|
88
|
+
if (headerMatch) {
|
|
89
|
+
onLog('');
|
|
90
|
+
onLog('■ ' + headerMatch[2]);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
// List item (-, *, 1.)
|
|
94
|
+
if (/^[-*]\s/.test(trimmed) || /^\d+\.\s/.test(trimmed)) {
|
|
95
|
+
onLog(' ' + truncate(trimmed, 300));
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
// Plain text
|
|
99
|
+
onLog(truncate(trimmed, 300));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Summarize tool_use input
|
|
104
|
+
*/
|
|
105
|
+
function summarizeToolInput(name, input) {
|
|
106
|
+
if (!input)
|
|
107
|
+
return '';
|
|
108
|
+
// File-related tools: show path only
|
|
109
|
+
if (input.file_path)
|
|
110
|
+
return input.file_path;
|
|
111
|
+
if (input.path)
|
|
112
|
+
return input.path;
|
|
113
|
+
if (input.command)
|
|
114
|
+
return truncate(input.command, 80);
|
|
115
|
+
if (input.pattern)
|
|
116
|
+
return `"${truncate(input.pattern, 60)}"`;
|
|
117
|
+
if (input.query)
|
|
118
|
+
return `"${truncate(input.query, 60)}"`;
|
|
119
|
+
// Other tools: show keys only
|
|
120
|
+
const keys = Object.keys(input);
|
|
121
|
+
if (keys.length <= 3)
|
|
122
|
+
return keys.join(', ');
|
|
123
|
+
return keys.slice(0, 3).join(', ') + '...';
|
|
124
|
+
}
|
|
125
|
+
function truncate(s, max) {
|
|
126
|
+
return s.length > max ? s.slice(0, max) + '...' : s;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Extract result text from the result entry in full NDJSON stdout (for final parsing).
|
|
130
|
+
* Used by parseWorkerOutput and similar functions.
|
|
131
|
+
*/
|
|
132
|
+
export function extractResultFromStreamJson(stdout) {
|
|
133
|
+
const lines = stdout.split('\n');
|
|
134
|
+
for (const line of lines) {
|
|
135
|
+
const trimmed = line.trim();
|
|
136
|
+
if (!trimmed)
|
|
137
|
+
continue;
|
|
138
|
+
try {
|
|
139
|
+
const event = JSON.parse(trimmed);
|
|
140
|
+
if (event.type === 'result' && event.result) {
|
|
141
|
+
return event.result;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// skip
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Backward compatible: parseCliOutput (simple version without buffer)
|
|
152
|
+
*/
|
|
153
|
+
export function parseCliOutput(text, onLog) {
|
|
154
|
+
parseCliStreamChunk(text, onLog);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=cliStreamParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliStreamParser.js","sourceRoot":"","sources":["../../src/agents/cliStreamParser.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,gCAAgC;AAChC,yDAAyD;AACzD,+CAA+C;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,KAA6B,EAC7B,SAAiB,EAAE;IAEnB,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI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AAC7C,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,GAAW;IACtC,OAAO,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAc;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC5C,OAAO,KAAK,CAAC,MAAM,CAAC;YACtB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAA6B;IACxE,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { WorkerResult } from './agentPair.js';
|
|
2
|
+
import type { AdapterName } from '../adapters/types.js';
|
|
3
|
+
import { type CostInfo } from '../support/costTracker.js';
|
|
4
|
+
export interface DocumenterOptions {
|
|
5
|
+
taskTitle: string;
|
|
6
|
+
taskDescription: string;
|
|
7
|
+
workerResult: WorkerResult;
|
|
8
|
+
projectPath: string;
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
model?: string;
|
|
11
|
+
maxTurns?: number;
|
|
12
|
+
adapterName?: AdapterName;
|
|
13
|
+
}
|
|
14
|
+
export interface DocumenterResult {
|
|
15
|
+
success: boolean;
|
|
16
|
+
updatedFiles: string[];
|
|
17
|
+
changelogEntry?: string;
|
|
18
|
+
apiDocsUpdated: boolean;
|
|
19
|
+
summary: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
costInfo?: CostInfo;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run Documenter agent
|
|
25
|
+
*/
|
|
26
|
+
export declare function runDocumenter(options: DocumenterOptions): Promise<DocumenterResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Format Documenter result as Discord message
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatDocReport(result: DocumenterResult): string;
|
|
31
|
+
//# sourceMappingURL=documenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documenter.d.ts","sourceRoot":"","sources":["../../src/agents/documenter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,KAAK,QAAQ,EAAyC,MAAM,2BAA2B,CAAC;AAKjG,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AA2ED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAwBzF;AA2KD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA2BhE"}
|