@probelabs/visor 0.1.186 → 0.1.187
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/defaults/assistant.yaml +31 -0
- package/defaults/code-talk.yaml +32 -0
- package/defaults/skills/code-explorer.yaml +6 -0
- package/dist/action-cli-bridge.d.ts.map +1 -1
- package/dist/agent-protocol/a2a-frontend.d.ts.map +1 -1
- package/dist/agent-protocol/index.d.ts.map +1 -1
- package/dist/agent-protocol/push-notification-manager.d.ts.map +1 -1
- package/dist/agent-protocol/state-transitions.d.ts.map +1 -1
- package/dist/agent-protocol/task-evaluator.d.ts.map +1 -1
- package/dist/agent-protocol/task-live-update-slack.d.ts +10 -0
- package/dist/agent-protocol/task-live-update-slack.d.ts.map +1 -1
- package/dist/agent-protocol/task-live-update-teams.d.ts.map +1 -1
- package/dist/agent-protocol/task-live-update-telegram.d.ts.map +1 -1
- package/dist/agent-protocol/task-live-updates.d.ts +10 -0
- package/dist/agent-protocol/task-live-updates.d.ts.map +1 -1
- package/dist/agent-protocol/task-progress-tool.d.ts.map +1 -1
- package/dist/agent-protocol/task-queue.d.ts.map +1 -1
- package/dist/agent-protocol/task-store.d.ts.map +1 -1
- package/dist/agent-protocol/task-stream-manager.d.ts.map +1 -1
- package/dist/agent-protocol/task-trace-resolution.d.ts.map +1 -1
- package/dist/agent-protocol/tasks-cli-handler.d.ts.map +1 -1
- package/dist/agent-protocol/tasks-tui.d.ts.map +1 -1
- package/dist/agent-protocol/trace-serializer.d.ts +43 -1
- package/dist/agent-protocol/trace-serializer.d.ts.map +1 -1
- package/dist/agent-protocol/track-execution.d.ts.map +1 -1
- package/dist/agent-protocol/types.d.ts.map +1 -1
- package/dist/ai-review-service.d.ts +22 -1
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts +1 -0
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/config/cli-handler.d.ts.map +1 -1
- package/dist/config/config-reloader.d.ts.map +1 -1
- package/dist/config/config-snapshot-store.d.ts.map +1 -1
- package/dist/config/config-watcher.d.ts.map +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/cron-scheduler.d.ts.map +1 -1
- package/dist/debug-visualizer/debug-span-exporter.d.ts.map +1 -1
- package/dist/debug-visualizer/trace-reader.d.ts.map +1 -1
- package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
- package/dist/defaults/assistant.yaml +31 -0
- package/dist/defaults/code-talk.yaml +32 -0
- package/dist/defaults/skills/code-explorer.yaml +6 -0
- package/dist/dependency-resolver.d.ts.map +1 -1
- package/dist/docs/telemetry-setup.md +18 -2
- package/dist/email/adapter.d.ts.map +1 -1
- package/dist/email/client.d.ts.map +1 -1
- package/dist/email/markdown.d.ts.map +1 -1
- package/dist/email/polling-runner.d.ts +1 -0
- package/dist/email/polling-runner.d.ts.map +1 -1
- package/dist/engine/on-finish/orchestrator.d.ts.map +1 -1
- package/dist/engine/on-finish/utils.d.ts.map +1 -1
- package/dist/event-bus/event-bus.d.ts.map +1 -1
- package/dist/event-bus/types.d.ts.map +1 -1
- package/dist/event-mapper.d.ts.map +1 -1
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/footer.d.ts.map +1 -1
- package/dist/frontends/email-frontend.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts.map +1 -1
- package/dist/frontends/host.d.ts.map +1 -1
- package/dist/frontends/ndjson-sink.d.ts.map +1 -1
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/frontends/teams-frontend.d.ts.map +1 -1
- package/dist/frontends/telegram-frontend.d.ts.map +1 -1
- package/dist/frontends/whatsapp-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +16 -8
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/git-repository-analyzer.d.ts.map +1 -1
- package/dist/github-auth.d.ts.map +1 -1
- package/dist/github-check-service.d.ts.map +1 -1
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/github-reactions.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7656 -1458
- package/dist/issue-filter.d.ts.map +1 -1
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/mcp-job-manager.d.ts.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/memory-store.d.ts.map +1 -1
- package/dist/output/traces/{run-2026-05-05T12-31-47-571Z.ndjson → run-2026-08-20T13-50-06-218Z.ndjson} +2699 -2699
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/policy/default-engine.d.ts.map +1 -1
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/policy-check-command.d.ts.map +1 -1
- package/dist/policy/types.d.ts.map +1 -1
- package/dist/pr-analyzer.d.ts.map +1 -1
- package/dist/pr-detector.d.ts.map +1 -1
- package/dist/providers/a2a-check-provider.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/api-tool-executor.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
- package/dist/providers/claude-code-types.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/custom-tool-executor.d.ts.map +1 -1
- package/dist/providers/git-checkout-provider.d.ts.map +1 -1
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-check-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/http-input-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts.map +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
- package/dist/providers/mcp-tools.d.ts.map +1 -1
- package/dist/providers/memory-check-provider.d.ts.map +1 -1
- package/dist/providers/noop-check-provider.d.ts.map +1 -1
- package/dist/providers/script-check-provider.d.ts.map +1 -1
- package/dist/providers/utcp-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-tool-executor.d.ts.map +1 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/runners/config-reload-runtime.d.ts.map +1 -1
- package/dist/runners/graceful-restart.d.ts.map +1 -1
- package/dist/runners/mcp-server-runner.d.ts.map +1 -1
- package/dist/runners/process-cli-handler.d.ts.map +1 -1
- package/dist/runners/process-discovery.d.ts.map +1 -1
- package/dist/runners/runner-factory.d.ts.map +1 -1
- package/dist/runners/runner-host.d.ts.map +1 -1
- package/dist/runners/runner.d.ts.map +1 -1
- package/dist/runners/telemetry-init.d.ts.map +1 -1
- package/dist/sandbox/bubblewrap-sandbox.d.ts.map +1 -1
- package/dist/sandbox/cache-volume-manager.d.ts.map +1 -1
- package/dist/sandbox/check-runner.d.ts.map +1 -1
- package/dist/sandbox/compose-generator.d.ts.map +1 -1
- package/dist/sandbox/docker-compose-sandbox.d.ts.map +1 -1
- package/dist/sandbox/docker-image-sandbox.d.ts.map +1 -1
- package/dist/sandbox/env-filter.d.ts.map +1 -1
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/sandbox-manager.d.ts.map +1 -1
- package/dist/sandbox/sandbox-telemetry.d.ts.map +1 -1
- package/dist/sandbox/seatbelt-sandbox.d.ts.map +1 -1
- package/dist/sandbox/trace-ingester.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/scheduler/cli-handler.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/message-trigger.d.ts.map +1 -1
- package/dist/scheduler/schedule-parser.d.ts.map +1 -1
- package/dist/scheduler/schedule-store.d.ts.map +1 -1
- package/dist/scheduler/schedule-tool.d.ts.map +1 -1
- package/dist/scheduler/scheduler.d.ts.map +1 -1
- package/dist/scheduler/store/index.d.ts.map +1 -1
- package/dist/scheduler/store/json-migrator.d.ts.map +1 -1
- package/dist/scheduler/store/sqlite-store.d.ts.map +1 -1
- package/dist/scheduler/store/types.d.ts.map +1 -1
- package/dist/sdk/{a2a-frontend-L3TQ7QQ6.mjs → a2a-frontend-XCQ4CQUF.mjs} +3 -3
- package/dist/sdk/{check-provider-registry-RQYIEQLJ.mjs → check-provider-registry-2D3MCWP3.mjs} +14 -11
- package/dist/sdk/{chunk-WZQMTD7W.mjs → chunk-2LLKENYD.mjs} +3 -3
- package/dist/sdk/{chunk-WZQMTD7W.mjs.map → chunk-2LLKENYD.mjs.map} +1 -1
- package/dist/sdk/{chunk-XXAEN5KU.mjs → chunk-77AKSSW2.mjs} +43 -65
- package/dist/sdk/chunk-77AKSSW2.mjs.map +1 -0
- package/dist/sdk/chunk-7QI6F66G.mjs +145 -0
- package/dist/sdk/chunk-7QI6F66G.mjs.map +1 -0
- package/dist/sdk/{chunk-NEZY2MXM.mjs → chunk-B2LQT6QU.mjs} +4 -4
- package/dist/sdk/{chunk-NEZY2MXM.mjs.map → chunk-B2LQT6QU.mjs.map} +1 -1
- package/dist/sdk/{chunk-IY5PQ5EN.mjs → chunk-BVEATT5V.mjs} +822 -51
- package/dist/sdk/chunk-BVEATT5V.mjs.map +1 -0
- package/dist/sdk/{chunk-TSX3YS3F.mjs → chunk-HW4MPCOW.mjs} +5 -139
- package/dist/sdk/chunk-HW4MPCOW.mjs.map +1 -0
- package/dist/sdk/chunk-PGBV3VZB.mjs +122 -0
- package/dist/sdk/chunk-PGBV3VZB.mjs.map +1 -0
- package/dist/sdk/{chunk-PDQTEBOJ.mjs → chunk-QT766ZLD.mjs} +5 -1
- package/dist/sdk/chunk-QT766ZLD.mjs.map +1 -0
- package/dist/sdk/{chunk-5TXIAPRA.mjs → chunk-S3GSZRYC.mjs} +2 -2
- package/dist/sdk/{chunk-NPOVLLKH.mjs → chunk-TGQBEM3Y.mjs} +570 -259
- package/dist/sdk/chunk-TGQBEM3Y.mjs.map +1 -0
- package/dist/sdk/chunk-TL3ZTYFY.mjs +141 -0
- package/dist/sdk/chunk-TL3ZTYFY.mjs.map +1 -0
- package/dist/sdk/{chunk-4UMDSYC7.mjs → chunk-VS3JE2DL.mjs} +3 -3
- package/dist/sdk/{chunk-A4WHMRK2.mjs → chunk-YETG675X.mjs} +2 -2
- package/dist/sdk/{chunk-XX6WT332.mjs → chunk-YTG5DN72.mjs} +17 -9
- package/dist/sdk/chunk-YTG5DN72.mjs.map +1 -0
- package/dist/sdk/{chunk-SRU5TFNY.mjs → chunk-YU3VR5SZ.mjs} +145 -16
- package/dist/sdk/chunk-YU3VR5SZ.mjs.map +1 -0
- package/dist/sdk/{config-BCYAVJ5S.mjs → config-H5IOLBFA.mjs} +2 -2
- package/dist/sdk/{email-frontend-P7QE4UUJ.mjs → email-frontend-AE5TYWNC.mjs} +18 -3
- package/dist/sdk/{email-frontend-P7QE4UUJ.mjs.map → email-frontend-AE5TYWNC.mjs.map} +1 -1
- package/dist/sdk/{failure-condition-evaluator-ZBOSD574.mjs → failure-condition-evaluator-66PWLV3D.mjs} +4 -4
- package/dist/sdk/{github-frontend-4WHT5JEU.mjs → github-frontend-BBFKCY4M.mjs} +4 -4
- package/dist/sdk/{host-FKR7H26C.mjs → host-UQRZDLT7.mjs} +8 -8
- package/dist/sdk/oauth2-token-cache-OS7WHLDI.mjs +13 -0
- package/dist/sdk/{routing-IB2PXYFC.mjs → routing-Q647KUMO.mjs} +5 -5
- package/dist/sdk/{schedule-tool-LB33KL2W.mjs → schedule-tool-WMGSM6IT.mjs} +14 -11
- package/dist/sdk/{schedule-tool-handler-KYWZHKSS.mjs → schedule-tool-handler-JMDHCGZ2.mjs} +14 -11
- package/dist/sdk/sdk.d.mts +14 -2
- package/dist/sdk/sdk.d.ts +14 -2
- package/dist/sdk/sdk.js +1927 -643
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +13 -10
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-CENXWIFR.mjs +12 -0
- package/dist/sdk/{slack-frontend-K3TPGERM.mjs → slack-frontend-JMX5MUVZ.mjs} +42 -12
- package/dist/sdk/slack-frontend-JMX5MUVZ.mjs.map +1 -0
- package/dist/sdk/{task-evaluator-H3BXC7SE.mjs → task-evaluator-4QG4CYQA.mjs} +7 -6
- package/dist/sdk/task-evaluator-4QG4CYQA.mjs.map +1 -0
- package/dist/sdk/{teams-frontend-6RRW533K.mjs → teams-frontend-6MDAN7OR.mjs} +17 -4
- package/dist/sdk/teams-frontend-6MDAN7OR.mjs.map +1 -0
- package/dist/sdk/{telegram-frontend-5UA77YAT.mjs → telegram-frontend-NLX2ZHS4.mjs} +17 -4
- package/dist/sdk/telegram-frontend-NLX2ZHS4.mjs.map +1 -0
- package/dist/sdk/{trace-helpers-AMZ2524G.mjs → trace-helpers-AIUGQLK5.mjs} +3 -3
- package/dist/sdk/{trace-serializer-EBHTHZYT.mjs → trace-serializer-4TOIAVQL.mjs} +10 -2
- package/dist/sdk/{track-execution-VW6P3OYO.mjs → track-execution-CFRZXMEC.mjs} +91 -20
- package/dist/sdk/track-execution-CFRZXMEC.mjs.map +1 -0
- package/dist/sdk/{utcp-check-provider-Q4PD5EP2.mjs → utcp-check-provider-WDTSQ7DZ.mjs} +3 -2
- package/dist/sdk/{whatsapp-frontend-72XEIUIR.mjs → whatsapp-frontend-3EMMNC7R.mjs} +15 -2
- package/dist/sdk/whatsapp-frontend-3EMMNC7R.mjs.map +1 -0
- package/dist/sdk/{workflow-check-provider-N6KSDPWU.mjs → workflow-check-provider-G7A67EPP.mjs} +14 -11
- package/dist/sdk/workflow-check-provider-G7A67EPP.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/session-registry.d.ts +2 -7
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/slack/adapter.d.ts.map +1 -1
- package/dist/slack/cache-prewarmer.d.ts.map +1 -1
- package/dist/slack/client.d.ts +8 -0
- package/dist/slack/client.d.ts.map +1 -1
- package/dist/slack/markdown.d.ts.map +1 -1
- package/dist/slack/prompt-state.d.ts.map +1 -1
- package/dist/slack/rate-limiter.d.ts.map +1 -1
- package/dist/slack/schedule-tool-handler.d.ts.map +1 -1
- package/dist/slack/signature.d.ts.map +1 -1
- package/dist/slack/slack-output-adapter.d.ts.map +1 -1
- package/dist/slack/socket-runner.d.ts +1 -0
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/slack/thread-cache.d.ts.map +1 -1
- package/dist/snapshot-store.d.ts.map +1 -1
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -1
- package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -1
- package/dist/state-machine/dispatch/debounce-manager.d.ts +44 -0
- package/dist/state-machine/dispatch/debounce-manager.d.ts.map +1 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -1
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -1
- package/dist/state-machine/dispatch/on-init-handlers.d.ts.map +1 -1
- package/dist/state-machine/dispatch/policy-gate.d.ts.map +1 -1
- package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -1
- package/dist/state-machine/dispatch/sandbox-routing.d.ts.map +1 -1
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
- package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -1
- package/dist/state-machine/execution/summary.d.ts.map +1 -1
- package/dist/state-machine/runner.d.ts.map +1 -1
- package/dist/state-machine/states/check-running.d.ts.map +1 -1
- package/dist/state-machine/states/completed.d.ts.map +1 -1
- package/dist/state-machine/states/error.d.ts.map +1 -1
- package/dist/state-machine/states/init.d.ts.map +1 -1
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine/states/plan-ready.d.ts.map +1 -1
- package/dist/state-machine/states/routing.d.ts.map +1 -1
- package/dist/state-machine/states/wave-planning.d.ts.map +1 -1
- package/dist/state-machine/workflow-projection.d.ts.map +1 -1
- package/dist/state-machine-execution-engine.d.ts +1 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -1
- package/dist/teams/adapter.d.ts.map +1 -1
- package/dist/teams/client.d.ts.map +1 -1
- package/dist/teams/markdown.d.ts.map +1 -1
- package/dist/teams/webhook-runner.d.ts +1 -0
- package/dist/teams/webhook-runner.d.ts.map +1 -1
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/client.d.ts.map +1 -1
- package/dist/telegram/markdown.d.ts.map +1 -1
- package/dist/telegram/polling-runner.d.ts +1 -0
- package/dist/telegram/polling-runner.d.ts.map +1 -1
- package/dist/telemetry/fallback-ndjson.d.ts.map +1 -1
- package/dist/telemetry/file-span-exporter.d.ts.map +1 -1
- package/dist/telemetry/lazy-otel.d.ts.map +1 -1
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/telemetry/state-capture.d.ts.map +1 -1
- package/dist/telemetry/trace-helpers.d.ts.map +1 -1
- package/dist/telemetry/trace-report-exporter.d.ts.map +1 -1
- package/dist/test-runner/assertions.d.ts.map +1 -1
- package/dist/test-runner/conversation-sugar.d.ts.map +1 -1
- package/dist/test-runner/core/environment.d.ts.map +1 -1
- package/dist/test-runner/core/fixture.d.ts.map +1 -1
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -1
- package/dist/test-runner/core/mocks.d.ts.map +1 -1
- package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -1
- package/dist/test-runner/evaluators.d.ts.map +1 -1
- package/dist/test-runner/fixture-loader.d.ts.map +1 -1
- package/dist/test-runner/index.d.ts.map +1 -1
- package/dist/test-runner/llm-judge.d.ts.map +1 -1
- package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -1
- package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -1
- package/dist/test-runner/recorders/slack-recorder.d.ts.map +1 -1
- package/dist/test-runner/utils/selectors.d.ts.map +1 -1
- package/dist/test-runner/validator.d.ts.map +1 -1
- package/dist/traces/{run-2026-05-05T12-31-47-571Z.ndjson → run-2026-08-20T13-50-06-218Z.ndjson} +2699 -2699
- package/dist/tui/chat-runner.d.ts.map +1 -1
- package/dist/tui/chat-state.d.ts.map +1 -1
- package/dist/tui/chat-tui.d.ts.map +1 -1
- package/dist/tui/components/chat-box.d.ts.map +1 -1
- package/dist/tui/components/input-bar.d.ts.map +1 -1
- package/dist/tui/components/status-bar.d.ts.map +1 -1
- package/dist/tui/components/trace-viewer.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/tui-frontend.d.ts.map +1 -1
- package/dist/types/bot.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +14 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts.map +1 -1
- package/dist/types/execution.d.ts.map +1 -1
- package/dist/types/git-checkout.d.ts.map +1 -1
- package/dist/types/github.d.ts.map +1 -1
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/utils/author-permissions.d.ts.map +1 -1
- package/dist/utils/child-process-error-handler.d.ts +19 -0
- package/dist/utils/child-process-error-handler.d.ts.map +1 -0
- package/dist/utils/command-executor.d.ts.map +1 -1
- package/dist/utils/comment-metadata.d.ts.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-merger.d.ts.map +1 -1
- package/dist/utils/diff-processor.d.ts.map +1 -1
- package/dist/utils/env-exposure.d.ts.map +1 -1
- package/dist/utils/env-resolver.d.ts.map +1 -1
- package/dist/utils/fair-concurrency-limiter.d.ts.map +1 -1
- package/dist/utils/file-exclusion.d.ts.map +1 -1
- package/dist/utils/head-sha.d.ts.map +1 -1
- package/dist/utils/human-id.d.ts.map +1 -1
- package/dist/utils/instance-id.d.ts.map +1 -1
- package/dist/utils/interactive-prompt.d.ts.map +1 -1
- package/dist/utils/issue-normalizer.d.ts.map +1 -1
- package/dist/utils/json-text-extractor.d.ts.map +1 -1
- package/dist/utils/mermaid-telemetry.d.ts.map +1 -1
- package/dist/utils/oauth2-token-cache.d.ts.map +1 -1
- package/dist/utils/rate-limiter.d.ts.map +1 -1
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/script-memory-ops.d.ts.map +1 -1
- package/dist/utils/script-tool-environment.d.ts.map +1 -1
- package/dist/utils/stdin-reader.d.ts.map +1 -1
- package/dist/utils/template-context.d.ts.map +1 -1
- package/dist/utils/tool-resolver.d.ts.map +1 -1
- package/dist/utils/toolkit-expander.d.ts.map +1 -1
- package/dist/utils/tracer-init.d.ts.map +1 -1
- package/dist/utils/ui-helpers.d.ts.map +1 -1
- package/dist/utils/user-facing-error.d.ts +4 -0
- package/dist/utils/user-facing-error.d.ts.map +1 -0
- package/dist/utils/workspace-manager.d.ts +5 -0
- package/dist/utils/workspace-manager.d.ts.map +1 -1
- package/dist/utils/worktree-cleanup.d.ts +28 -0
- package/dist/utils/worktree-cleanup.d.ts.map +1 -1
- package/dist/utils/worktree-manager.d.ts +6 -0
- package/dist/utils/worktree-manager.d.ts.map +1 -1
- package/dist/webhook-server.d.ts.map +1 -1
- package/dist/whatsapp/adapter.d.ts.map +1 -1
- package/dist/whatsapp/client.d.ts.map +1 -1
- package/dist/whatsapp/markdown.d.ts.map +1 -1
- package/dist/whatsapp/webhook-runner.d.ts +1 -0
- package/dist/whatsapp/webhook-runner.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts +7 -0
- package/dist/workflow-executor.d.ts.map +1 -1
- package/dist/workflow-registry.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/output/traces/run-2026-05-05T12-31-09-587Z.ndjson +0 -252
- package/dist/sdk/chunk-IY5PQ5EN.mjs.map +0 -1
- package/dist/sdk/chunk-NPOVLLKH.mjs.map +0 -1
- package/dist/sdk/chunk-PDQTEBOJ.mjs.map +0 -1
- package/dist/sdk/chunk-SRU5TFNY.mjs.map +0 -1
- package/dist/sdk/chunk-TSX3YS3F.mjs.map +0 -1
- package/dist/sdk/chunk-XX6WT332.mjs.map +0 -1
- package/dist/sdk/chunk-XXAEN5KU.mjs.map +0 -1
- package/dist/sdk/session-registry-6PV6SGEJ.mjs +0 -10
- package/dist/sdk/slack-frontend-K3TPGERM.mjs.map +0 -1
- package/dist/sdk/task-evaluator-H3BXC7SE.mjs.map +0 -1
- package/dist/sdk/teams-frontend-6RRW533K.mjs.map +0 -1
- package/dist/sdk/telegram-frontend-5UA77YAT.mjs.map +0 -1
- package/dist/sdk/trace-reader-OVE4DL2D.mjs +0 -270
- package/dist/sdk/trace-reader-OVE4DL2D.mjs.map +0 -1
- package/dist/sdk/track-execution-VW6P3OYO.mjs.map +0 -1
- package/dist/sdk/whatsapp-frontend-72XEIUIR.mjs.map +0 -1
- package/dist/traces/run-2026-05-05T12-31-09-587Z.ndjson +0 -252
- /package/dist/sdk/{a2a-frontend-L3TQ7QQ6.mjs.map → a2a-frontend-XCQ4CQUF.mjs.map} +0 -0
- /package/dist/sdk/{check-provider-registry-RQYIEQLJ.mjs.map → check-provider-registry-2D3MCWP3.mjs.map} +0 -0
- /package/dist/sdk/{chunk-5TXIAPRA.mjs.map → chunk-S3GSZRYC.mjs.map} +0 -0
- /package/dist/sdk/{chunk-4UMDSYC7.mjs.map → chunk-VS3JE2DL.mjs.map} +0 -0
- /package/dist/sdk/{chunk-A4WHMRK2.mjs.map → chunk-YETG675X.mjs.map} +0 -0
- /package/dist/sdk/{config-BCYAVJ5S.mjs.map → config-H5IOLBFA.mjs.map} +0 -0
- /package/dist/sdk/{failure-condition-evaluator-ZBOSD574.mjs.map → failure-condition-evaluator-66PWLV3D.mjs.map} +0 -0
- /package/dist/sdk/{github-frontend-4WHT5JEU.mjs.map → github-frontend-BBFKCY4M.mjs.map} +0 -0
- /package/dist/sdk/{host-FKR7H26C.mjs.map → host-UQRZDLT7.mjs.map} +0 -0
- /package/dist/sdk/{routing-IB2PXYFC.mjs.map → oauth2-token-cache-OS7WHLDI.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-LB33KL2W.mjs.map → routing-Q647KUMO.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-handler-KYWZHKSS.mjs.map → schedule-tool-WMGSM6IT.mjs.map} +0 -0
- /package/dist/sdk/{session-registry-6PV6SGEJ.mjs.map → schedule-tool-handler-JMDHCGZ2.mjs.map} +0 -0
- /package/dist/sdk/{trace-helpers-AMZ2524G.mjs.map → session-registry-CENXWIFR.mjs.map} +0 -0
- /package/dist/sdk/{trace-serializer-EBHTHZYT.mjs.map → trace-helpers-AIUGQLK5.mjs.map} +0 -0
- /package/dist/sdk/{utcp-check-provider-Q4PD5EP2.mjs.map → trace-serializer-4TOIAVQL.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-N6KSDPWU.mjs.map → utcp-check-provider-WDTSQ7DZ.mjs.map} +0 -0
|
@@ -18,7 +18,8 @@ function resolveBackendConfig(overrides) {
|
|
|
18
18
|
grafanaDatasourceId: overrides?.grafanaDatasourceId || process.env.GRAFANA_TEMPO_DATASOURCE_ID,
|
|
19
19
|
jaegerUrl: overrides?.jaegerUrl || process.env.JAEGER_URL,
|
|
20
20
|
traceDir: overrides?.traceDir || process.env.VISOR_TRACE_DIR || "output/traces",
|
|
21
|
-
authToken: overrides?.authToken || process.env.GRAFANA_TOKEN
|
|
21
|
+
authToken: overrides?.authToken || process.env.GRAFANA_TOKEN,
|
|
22
|
+
targetTraceId: overrides?.targetTraceId
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
function getAutoBackendOrder() {
|
|
@@ -179,6 +180,60 @@ async function fetchTraceSpans(traceRef, config) {
|
|
|
179
180
|
}
|
|
180
181
|
return [];
|
|
181
182
|
}
|
|
183
|
+
async function resolveTraceSpans(traceIdOrPath, backendConfig, fallbackTraceId) {
|
|
184
|
+
const cfg = resolveBackendConfig(backendConfig);
|
|
185
|
+
const backendOrder = getBackendOrder(cfg);
|
|
186
|
+
const isFilePath = isTraceFilePath(traceIdOrPath);
|
|
187
|
+
const localTracePath = isFilePath ? traceIdOrPath : void 0;
|
|
188
|
+
const remoteTraceId = fallbackTraceId || (!isFilePath ? traceIdOrPath : await readTraceIdFromFile(traceIdOrPath) || void 0);
|
|
189
|
+
const preferLocalFirst = backendOrder[0] === "file";
|
|
190
|
+
logger.debug(
|
|
191
|
+
`[TraceSerializer] serializeTraceForPrompt ref=${traceIdOrPath} remoteTraceId=${remoteTraceId || "-"} backendOrder=${backendOrder.join(">")}`
|
|
192
|
+
);
|
|
193
|
+
if (preferLocalFirst && localTracePath) {
|
|
194
|
+
logger.debug(`[TraceSerializer] Trying local trace file first: ${localTracePath}`);
|
|
195
|
+
const spans = await fetchTraceSpans(localTracePath, {
|
|
196
|
+
...cfg,
|
|
197
|
+
type: "file",
|
|
198
|
+
targetTraceId: remoteTraceId
|
|
199
|
+
});
|
|
200
|
+
if (spans.length > 0) {
|
|
201
|
+
return { spans, source: "file", remoteTraceId, localTracePath };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (remoteTraceId) {
|
|
205
|
+
logger.debug(`[TraceSerializer] Trying remote trace backends for trace_id=${remoteTraceId}`);
|
|
206
|
+
const remoteCfg = resolveBackendConfig(backendConfig);
|
|
207
|
+
const remoteOrder = getBackendOrder(remoteCfg).filter((kind) => kind !== "file");
|
|
208
|
+
for (const backend of remoteOrder) {
|
|
209
|
+
if (backend === "grafana") {
|
|
210
|
+
const spans = await fetchFromGrafanaTempo(remoteTraceId, remoteCfg);
|
|
211
|
+
if (spans && spans.length > 0) {
|
|
212
|
+
return { spans, source: "grafana", remoteTraceId, localTracePath };
|
|
213
|
+
}
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (backend === "jaeger") {
|
|
217
|
+
const spans = await fetchFromJaeger(remoteTraceId, remoteCfg);
|
|
218
|
+
if (spans && spans.length > 0) {
|
|
219
|
+
return { spans, source: "jaeger", remoteTraceId, localTracePath };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (localTracePath) {
|
|
225
|
+
logger.debug(`[TraceSerializer] Falling back to local trace file: ${localTracePath}`);
|
|
226
|
+
const spans = await fetchTraceSpans(localTracePath, {
|
|
227
|
+
...cfg,
|
|
228
|
+
type: "file",
|
|
229
|
+
targetTraceId: remoteTraceId
|
|
230
|
+
});
|
|
231
|
+
if (spans.length > 0) {
|
|
232
|
+
return { spans, source: "file", remoteTraceId, localTracePath };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return { spans: [], source: null, remoteTraceId, localTracePath };
|
|
236
|
+
}
|
|
182
237
|
async function fetchFromGrafanaTempo(traceId, cfg) {
|
|
183
238
|
let grafanaUrl = cfg.grafanaUrl;
|
|
184
239
|
if (!grafanaUrl) {
|
|
@@ -254,9 +309,29 @@ async function fetchFromLocalFiles(traceRef, cfg) {
|
|
|
254
309
|
const traceFile = isTraceFilePath(traceRef) ? traceRef : await findTraceFile(traceRef, cfg.traceDir);
|
|
255
310
|
if (!traceFile) return null;
|
|
256
311
|
try {
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
|
|
312
|
+
const targetTraceId = cfg.targetTraceId || (!isTraceFilePath(traceRef) ? traceRef : await readTraceIdFromFile(traceFile) || void 0);
|
|
313
|
+
const rawSpans = [];
|
|
314
|
+
const rl = readline.createInterface({
|
|
315
|
+
input: fs.createReadStream(traceFile, { encoding: "utf8" }),
|
|
316
|
+
crlfDelay: Infinity
|
|
317
|
+
});
|
|
318
|
+
try {
|
|
319
|
+
for await (const line of rl) {
|
|
320
|
+
const trimmed = line.trim();
|
|
321
|
+
if (!trimmed) continue;
|
|
322
|
+
try {
|
|
323
|
+
const parsed = JSON.parse(trimmed);
|
|
324
|
+
if (!targetTraceId || parsed.traceId === targetTraceId) {
|
|
325
|
+
rawSpans.push(parsed);
|
|
326
|
+
}
|
|
327
|
+
} catch {
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
} finally {
|
|
331
|
+
rl.close();
|
|
332
|
+
}
|
|
333
|
+
if (rawSpans.length === 0) return [];
|
|
334
|
+
return parseLocalNDJSONSpans(rawSpans);
|
|
260
335
|
} catch (err) {
|
|
261
336
|
logger.debug(`[TraceSerializer] Local file parse failed: ${err}`);
|
|
262
337
|
return null;
|
|
@@ -286,10 +361,22 @@ async function findTraceFile(traceId, traceDir) {
|
|
|
286
361
|
for (const file of files) {
|
|
287
362
|
const filePath = path.join(dir, file);
|
|
288
363
|
try {
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
364
|
+
const rl = readline.createInterface({
|
|
365
|
+
input: fs.createReadStream(filePath, { encoding: "utf8" }),
|
|
366
|
+
crlfDelay: Infinity
|
|
367
|
+
});
|
|
368
|
+
try {
|
|
369
|
+
for await (const line of rl) {
|
|
370
|
+
if (!line.trim()) continue;
|
|
371
|
+
const parsed = JSON.parse(line);
|
|
372
|
+
if (parsed.traceId === traceId) {
|
|
373
|
+
rl.close();
|
|
374
|
+
return filePath;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} finally {
|
|
378
|
+
rl.close();
|
|
379
|
+
}
|
|
293
380
|
} catch {
|
|
294
381
|
}
|
|
295
382
|
}
|
|
@@ -318,25 +405,6 @@ async function readTraceIdFromFile(traceFile) {
|
|
|
318
405
|
}
|
|
319
406
|
return null;
|
|
320
407
|
}
|
|
321
|
-
async function readFirstLine(filePath) {
|
|
322
|
-
return new Promise((resolve, reject) => {
|
|
323
|
-
const stream = fs.createReadStream(filePath, { encoding: "utf-8" });
|
|
324
|
-
const rl = readline.createInterface({ input: stream, crlfDelay: Infinity });
|
|
325
|
-
let resolved = false;
|
|
326
|
-
rl.on("line", (line) => {
|
|
327
|
-
if (!resolved) {
|
|
328
|
-
resolved = true;
|
|
329
|
-
rl.close();
|
|
330
|
-
stream.destroy();
|
|
331
|
-
resolve(line.trim() || null);
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
rl.on("close", () => {
|
|
335
|
-
if (!resolved) resolve(null);
|
|
336
|
-
});
|
|
337
|
-
rl.on("error", reject);
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
408
|
function isNoiseSpan(span) {
|
|
341
409
|
return NOISE_SPAN_NAMES.has(span.name);
|
|
342
410
|
}
|
|
@@ -494,6 +562,454 @@ function getLifecycleSpanInfo(name) {
|
|
|
494
562
|
}
|
|
495
563
|
return null;
|
|
496
564
|
}
|
|
565
|
+
function parseTaskStatusSnapshot(raw) {
|
|
566
|
+
if (!raw || !raw.includes("<task_status>")) return [];
|
|
567
|
+
const items = [];
|
|
568
|
+
const taskRegex = /<task\s+id="([^"]+)"\s+status="([^"]+)"(?:\s+priority="[^"]*")?>([\s\S]*?)<\/task>/g;
|
|
569
|
+
let match;
|
|
570
|
+
while ((match = taskRegex.exec(raw)) !== null) {
|
|
571
|
+
items.push({
|
|
572
|
+
id: match[1],
|
|
573
|
+
status: match[2],
|
|
574
|
+
title: match[3].replace(/\s+/g, " ").trim()
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
return items;
|
|
578
|
+
}
|
|
579
|
+
function parseTaskIds(value) {
|
|
580
|
+
if (!value) return [];
|
|
581
|
+
return String(value).split(",").map((part) => part.trim()).filter(Boolean);
|
|
582
|
+
}
|
|
583
|
+
function parseBatchItemsJson(value) {
|
|
584
|
+
if (!value) return [];
|
|
585
|
+
try {
|
|
586
|
+
const parsed = JSON.parse(String(value));
|
|
587
|
+
if (!Array.isArray(parsed)) return [];
|
|
588
|
+
return parsed.filter((item) => item && typeof item.id === "string");
|
|
589
|
+
} catch {
|
|
590
|
+
return [];
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function isTaskTelemetrySpan(span) {
|
|
594
|
+
const toolName = span.attributes["tool.name"] || span.attributes["visor.tool.name"];
|
|
595
|
+
if (toolName === "task") return true;
|
|
596
|
+
return /(?:^probe\.event\.)?task\.[a-z_]+$/.test(normalizeSpanName(span.name));
|
|
597
|
+
}
|
|
598
|
+
function summarizeTaskTelemetrySpans(spans) {
|
|
599
|
+
const ordered = [...spans].sort((a, b) => {
|
|
600
|
+
if (a.startTimeMs !== b.startTimeMs) return a.startTimeMs - b.startTimeMs;
|
|
601
|
+
if (a.endTimeMs !== b.endTimeMs) return a.endTimeMs - b.endTimeMs;
|
|
602
|
+
return a.spanId.localeCompare(b.spanId);
|
|
603
|
+
});
|
|
604
|
+
const tasks = /* @__PURE__ */ new Map();
|
|
605
|
+
let tasksEnabled = false;
|
|
606
|
+
let snapshotCount = 0;
|
|
607
|
+
let eventCount = 0;
|
|
608
|
+
let sawSnapshot = false;
|
|
609
|
+
const upsertTask = (id, patch) => {
|
|
610
|
+
const existing = tasks.get(id) || { id, title: "", status: "pending" };
|
|
611
|
+
const next = {
|
|
612
|
+
id,
|
|
613
|
+
title: patch.title ?? existing.title,
|
|
614
|
+
status: patch.status ?? existing.status
|
|
615
|
+
};
|
|
616
|
+
tasks.set(id, next);
|
|
617
|
+
};
|
|
618
|
+
for (const span of ordered) {
|
|
619
|
+
const name = normalizeSpanName(span.name);
|
|
620
|
+
const attrs = span.attributes;
|
|
621
|
+
const toolName = attrs["tool.name"] || attrs["visor.tool.name"];
|
|
622
|
+
if (toolName === "task") {
|
|
623
|
+
const snapshot = parseTaskStatusSnapshot(String(attrs["tool.result"] || ""));
|
|
624
|
+
if (snapshot.length > 0) {
|
|
625
|
+
tasksEnabled = true;
|
|
626
|
+
snapshotCount += 1;
|
|
627
|
+
sawSnapshot = true;
|
|
628
|
+
tasks.clear();
|
|
629
|
+
for (const task of snapshot) {
|
|
630
|
+
tasks.set(task.id, {
|
|
631
|
+
id: task.id,
|
|
632
|
+
title: task.title,
|
|
633
|
+
status: task.status
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const taskEventMatch = name.match(/(?:^probe\.event\.)?task\.([a-z_]+)$/);
|
|
639
|
+
if (!taskEventMatch) continue;
|
|
640
|
+
tasksEnabled = true;
|
|
641
|
+
eventCount += 1;
|
|
642
|
+
const eventType = taskEventMatch[1];
|
|
643
|
+
const taskId = attrs["task.id"] ? String(attrs["task.id"]) : "";
|
|
644
|
+
const taskTitle = attrs["task.title"] ? String(attrs["task.title"]).trim() : "";
|
|
645
|
+
const newStatus = attrs["task.new_status"] ? String(attrs["task.new_status"]) : "";
|
|
646
|
+
const taskIds = parseTaskIds(attrs["task.ids"]);
|
|
647
|
+
switch (eventType) {
|
|
648
|
+
case "created":
|
|
649
|
+
if (taskId) upsertTask(taskId, { title: taskTitle, status: "pending" });
|
|
650
|
+
break;
|
|
651
|
+
case "updated":
|
|
652
|
+
if (taskId) {
|
|
653
|
+
upsertTask(taskId, {
|
|
654
|
+
title: taskTitle || void 0,
|
|
655
|
+
status: newStatus && newStatus !== "unchanged" ? newStatus : void 0
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
break;
|
|
659
|
+
case "completed":
|
|
660
|
+
if (taskId) upsertTask(taskId, { title: taskTitle || void 0, status: "completed" });
|
|
661
|
+
break;
|
|
662
|
+
case "deleted":
|
|
663
|
+
if (taskId) upsertTask(taskId, { title: taskTitle || void 0, status: "deleted" });
|
|
664
|
+
break;
|
|
665
|
+
case "batch_created": {
|
|
666
|
+
const items = parseBatchItemsJson(attrs["task.items_json"]);
|
|
667
|
+
if (items.length > 0) {
|
|
668
|
+
for (const item of items)
|
|
669
|
+
upsertTask(item.id, { title: item.title || "", status: item.status || "pending" });
|
|
670
|
+
} else {
|
|
671
|
+
for (const id of taskIds) upsertTask(id, { status: "pending" });
|
|
672
|
+
}
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
case "batch_updated": {
|
|
676
|
+
const items = parseBatchItemsJson(attrs["task.items_json"]);
|
|
677
|
+
if (items.length > 0) {
|
|
678
|
+
for (const item of items)
|
|
679
|
+
upsertTask(item.id, {
|
|
680
|
+
title: item.title || void 0,
|
|
681
|
+
status: item.status || void 0
|
|
682
|
+
});
|
|
683
|
+
} else {
|
|
684
|
+
for (const id of taskIds) {
|
|
685
|
+
upsertTask(id, {
|
|
686
|
+
status: newStatus && newStatus !== "unchanged" ? newStatus : void 0
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
case "batch_completed": {
|
|
693
|
+
const items = parseBatchItemsJson(attrs["task.items_json"]);
|
|
694
|
+
if (items.length > 0) {
|
|
695
|
+
for (const item of items)
|
|
696
|
+
upsertTask(item.id, { title: item.title || void 0, status: "completed" });
|
|
697
|
+
} else {
|
|
698
|
+
for (const id of taskIds) upsertTask(id, { status: "completed" });
|
|
699
|
+
}
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
case "batch_deleted": {
|
|
703
|
+
const items = parseBatchItemsJson(attrs["task.items_json"]);
|
|
704
|
+
if (items.length > 0) {
|
|
705
|
+
for (const item of items)
|
|
706
|
+
upsertTask(item.id, { title: item.title || void 0, status: "deleted" });
|
|
707
|
+
} else {
|
|
708
|
+
for (const id of taskIds) upsertTask(id, { status: "deleted" });
|
|
709
|
+
}
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
default:
|
|
713
|
+
break;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
if (!tasksEnabled) return null;
|
|
717
|
+
return {
|
|
718
|
+
tasksEnabled,
|
|
719
|
+
source: sawSnapshot ? "snapshot" : "events",
|
|
720
|
+
eventCount,
|
|
721
|
+
snapshotCount,
|
|
722
|
+
tasks: [...tasks.values()].sort((a, b) => a.id.localeCompare(b.id)),
|
|
723
|
+
scopes: []
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
function titleCaseWords(raw) {
|
|
727
|
+
return raw.split(/[\s_-]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
728
|
+
}
|
|
729
|
+
function getTaskScopeCheckId(span) {
|
|
730
|
+
const concreteName = getConcreteCheckName(span);
|
|
731
|
+
if (!concreteName) return null;
|
|
732
|
+
return concreteName.replace(/^visor\.check\./, "");
|
|
733
|
+
}
|
|
734
|
+
function isTaskScopeNode(span) {
|
|
735
|
+
const checkId = getTaskScopeCheckId(span);
|
|
736
|
+
if (checkId) return !TASK_SCOPE_EXCLUDED_CHECKS.has(checkId);
|
|
737
|
+
const normalized = normalizeSpanName(span.name);
|
|
738
|
+
return normalized === "search.delegate" || normalized.startsWith("engineer.");
|
|
739
|
+
}
|
|
740
|
+
function getTaskScopeLabel(span) {
|
|
741
|
+
if (!span) return ROOT_TASK_SCOPE_LABEL;
|
|
742
|
+
const checkId = getTaskScopeCheckId(span);
|
|
743
|
+
if (checkId) {
|
|
744
|
+
if (checkId === "explore-code") return "Code Explorer";
|
|
745
|
+
return titleCaseWords(checkId);
|
|
746
|
+
}
|
|
747
|
+
const normalized = normalizeSpanName(span.name);
|
|
748
|
+
if (normalized === "search.delegate") return "Search Delegate";
|
|
749
|
+
if (normalized.startsWith("engineer.")) {
|
|
750
|
+
return `Engineer ${titleCaseWords(normalized.slice("engineer.".length))}`;
|
|
751
|
+
}
|
|
752
|
+
return titleCaseWords(normalized);
|
|
753
|
+
}
|
|
754
|
+
function collectTaskSpansForScope(node, stopAtNestedScopes) {
|
|
755
|
+
const spans = [];
|
|
756
|
+
const visit = (current, isRoot) => {
|
|
757
|
+
if (!isRoot && stopAtNestedScopes && isTaskScopeNode(current.span)) return;
|
|
758
|
+
if (isTaskTelemetrySpan(current.span)) spans.push(current.span);
|
|
759
|
+
for (const child of current.children) visit(child, false);
|
|
760
|
+
};
|
|
761
|
+
visit(node, true);
|
|
762
|
+
return spans;
|
|
763
|
+
}
|
|
764
|
+
function findImmediateNestedTaskScopeNodes(node) {
|
|
765
|
+
const scopes = [];
|
|
766
|
+
const visit = (current, isRoot) => {
|
|
767
|
+
if (!isRoot && isTaskScopeNode(current.span)) {
|
|
768
|
+
scopes.push(current);
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
for (const child of current.children) visit(child, false);
|
|
772
|
+
};
|
|
773
|
+
visit(node, true);
|
|
774
|
+
return scopes;
|
|
775
|
+
}
|
|
776
|
+
function isSubAgentScope(span) {
|
|
777
|
+
const checkId = getTaskScopeCheckId(span);
|
|
778
|
+
if (checkId && SUB_AGENT_SCOPE_CHECKS.has(checkId)) return true;
|
|
779
|
+
const normalized = normalizeSpanName(span.name);
|
|
780
|
+
return normalized.startsWith("engineer.") || normalized === "search.delegate";
|
|
781
|
+
}
|
|
782
|
+
function getSubAgentStatus(node) {
|
|
783
|
+
const normalized = normalizeSpanName(node.span.name);
|
|
784
|
+
if (normalized.endsWith(".completed")) return "completed";
|
|
785
|
+
if (normalized.endsWith(".started") || normalized.endsWith(".progress")) return "in_progress";
|
|
786
|
+
let hasCompleted = false;
|
|
787
|
+
let hasProgress = false;
|
|
788
|
+
const visit = (current) => {
|
|
789
|
+
const n = normalizeSpanName(current.span.name);
|
|
790
|
+
if (n.endsWith(".completed")) hasCompleted = true;
|
|
791
|
+
if (n.endsWith(".progress")) hasProgress = true;
|
|
792
|
+
for (const child of current.children) visit(child);
|
|
793
|
+
};
|
|
794
|
+
visit(node);
|
|
795
|
+
if (hasCompleted) return "completed";
|
|
796
|
+
if (hasProgress) return "in_progress";
|
|
797
|
+
return "pending";
|
|
798
|
+
}
|
|
799
|
+
function buildProbeTaskScopeSummary(node, label, isRootScope = false, allSpans) {
|
|
800
|
+
const nestedScopeNodes = findImmediateNestedTaskScopeNodes(node);
|
|
801
|
+
if (!isRootScope && isSubAgentScope(node.span)) {
|
|
802
|
+
const localTasks = summarizeTaskTelemetrySpans(collectTaskSpansForScope(node, true));
|
|
803
|
+
const hasMeaningfulTitles = localTasks && localTasks.tasks.some(
|
|
804
|
+
(t) => t.title && t.title.length > 3 && !/^(task|engineer|code.?explorer)\s*/i.test(t.title)
|
|
805
|
+
);
|
|
806
|
+
if (hasMeaningfulTitles) {
|
|
807
|
+
return {
|
|
808
|
+
label: isRootScope ? ROOT_TASK_SCOPE_LABEL : label,
|
|
809
|
+
source: localTasks.source,
|
|
810
|
+
eventCount: localTasks.eventCount,
|
|
811
|
+
snapshotCount: localTasks.snapshotCount,
|
|
812
|
+
tasks: localTasks.tasks,
|
|
813
|
+
children: []
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
const status = getSubAgentStatus(node);
|
|
817
|
+
const scopeLabel = getTaskScopeLabel(node.span);
|
|
818
|
+
return {
|
|
819
|
+
label: isRootScope ? ROOT_TASK_SCOPE_LABEL : label,
|
|
820
|
+
source: "events",
|
|
821
|
+
eventCount: 0,
|
|
822
|
+
snapshotCount: 0,
|
|
823
|
+
tasks: [{ id: `__scope_${node.span.spanId}`, title: scopeLabel, status, synthetic: true }],
|
|
824
|
+
children: []
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
const local = summarizeTaskTelemetrySpans(collectTaskSpansForScope(node, true));
|
|
828
|
+
const children = [];
|
|
829
|
+
const subAgentGroups = /* @__PURE__ */ new Map();
|
|
830
|
+
const nonSubAgentNodes = [];
|
|
831
|
+
for (const child of nestedScopeNodes) {
|
|
832
|
+
if (isSubAgentScope(child.span)) {
|
|
833
|
+
const checkId = getTaskScopeCheckId(child.span) || normalizeSpanName(child.span.name);
|
|
834
|
+
const group = subAgentGroups.get(checkId) || [];
|
|
835
|
+
group.push(child);
|
|
836
|
+
subAgentGroups.set(checkId, group);
|
|
837
|
+
} else {
|
|
838
|
+
nonSubAgentNodes.push(child);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
for (const child of nonSubAgentNodes) {
|
|
842
|
+
const childScope = buildProbeTaskScopeSummary(
|
|
843
|
+
child,
|
|
844
|
+
getTaskScopeLabel(child.span),
|
|
845
|
+
false,
|
|
846
|
+
allSpans
|
|
847
|
+
);
|
|
848
|
+
if (childScope) children.push(childScope);
|
|
849
|
+
}
|
|
850
|
+
for (const [checkId, nodes] of subAgentGroups) {
|
|
851
|
+
const scopeLabel = checkId === "engineer-task" ? "Engineer" : checkId === "explore-code" ? "Code Explorer" : titleCaseWords(checkId);
|
|
852
|
+
const tasks = [];
|
|
853
|
+
for (const n of nodes) {
|
|
854
|
+
const iterScope = buildProbeTaskScopeSummary(n, scopeLabel, false, allSpans);
|
|
855
|
+
if (iterScope && iterScope.tasks.length > 0) {
|
|
856
|
+
tasks.push(...iterScope.tasks);
|
|
857
|
+
} else {
|
|
858
|
+
const status = getSubAgentStatus(n);
|
|
859
|
+
tasks.push({
|
|
860
|
+
id: `__scope_${n.span.spanId}`,
|
|
861
|
+
title: scopeLabel,
|
|
862
|
+
status,
|
|
863
|
+
synthetic: true
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const dedupedTasks = [];
|
|
868
|
+
for (const task of tasks) {
|
|
869
|
+
const prev = dedupedTasks[dedupedTasks.length - 1];
|
|
870
|
+
if (prev && prev.title === task.title && prev.status === task.status) continue;
|
|
871
|
+
dedupedTasks.push(task);
|
|
872
|
+
}
|
|
873
|
+
children.push({
|
|
874
|
+
label: scopeLabel,
|
|
875
|
+
source: "events",
|
|
876
|
+
eventCount: nodes.length,
|
|
877
|
+
snapshotCount: 0,
|
|
878
|
+
tasks: dedupedTasks,
|
|
879
|
+
children: []
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
if (!local && children.length === 0) return null;
|
|
883
|
+
return {
|
|
884
|
+
label: isRootScope ? ROOT_TASK_SCOPE_LABEL : label,
|
|
885
|
+
source: local?.source ?? "events",
|
|
886
|
+
eventCount: local?.eventCount ?? 0,
|
|
887
|
+
snapshotCount: local?.snapshotCount ?? 0,
|
|
888
|
+
tasks: local?.tasks ?? [],
|
|
889
|
+
children
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function buildTaskSummaryRoot(spans) {
|
|
893
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
894
|
+
for (const span of spans) {
|
|
895
|
+
nodeMap.set(span.spanId, { span, children: [] });
|
|
896
|
+
}
|
|
897
|
+
const roots = [];
|
|
898
|
+
for (const span of spans) {
|
|
899
|
+
const node = nodeMap.get(span.spanId);
|
|
900
|
+
if (span.parentSpanId && nodeMap.has(span.parentSpanId)) {
|
|
901
|
+
nodeMap.get(span.parentSpanId).children.push(node);
|
|
902
|
+
} else {
|
|
903
|
+
roots.push(node);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
const sortChildren = (node) => {
|
|
907
|
+
node.children.sort((a, b) => a.span.startTimeMs - b.span.startTimeMs);
|
|
908
|
+
node.children.forEach(sortChildren);
|
|
909
|
+
};
|
|
910
|
+
roots.forEach(sortChildren);
|
|
911
|
+
return {
|
|
912
|
+
span: {
|
|
913
|
+
traceId: spans[0]?.traceId || "",
|
|
914
|
+
spanId: "__task-root__",
|
|
915
|
+
name: "__task_root__",
|
|
916
|
+
startTimeMs: roots[0]?.span.startTimeMs || 0,
|
|
917
|
+
endTimeMs: roots[roots.length - 1]?.span.endTimeMs || 0,
|
|
918
|
+
durationMs: 0,
|
|
919
|
+
attributes: {},
|
|
920
|
+
events: [],
|
|
921
|
+
status: "ok"
|
|
922
|
+
},
|
|
923
|
+
children: roots
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
function flattenTaskScopes(scopes) {
|
|
927
|
+
const seen = /* @__PURE__ */ new Set();
|
|
928
|
+
const items = [];
|
|
929
|
+
const visit = (scope) => {
|
|
930
|
+
for (const task of scope.tasks) {
|
|
931
|
+
if (task.synthetic) continue;
|
|
932
|
+
if (seen.has(task.id)) continue;
|
|
933
|
+
seen.add(task.id);
|
|
934
|
+
items.push(task);
|
|
935
|
+
}
|
|
936
|
+
for (const child of scope.children) visit(child);
|
|
937
|
+
};
|
|
938
|
+
for (const scope of scopes) visit(scope);
|
|
939
|
+
return items;
|
|
940
|
+
}
|
|
941
|
+
function buildTemporalTaskScopes(spans) {
|
|
942
|
+
const ordered = [...spans].sort((a, b) => {
|
|
943
|
+
if (a.startTimeMs !== b.startTimeMs) return a.startTimeMs - b.startTimeMs;
|
|
944
|
+
if (a.endTimeMs !== b.endTimeMs) return a.endTimeMs - b.endTimeMs;
|
|
945
|
+
return a.spanId.localeCompare(b.spanId);
|
|
946
|
+
});
|
|
947
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
948
|
+
const scopeOrder = [];
|
|
949
|
+
const ensureGroup = (label) => {
|
|
950
|
+
if (!grouped.has(label)) {
|
|
951
|
+
grouped.set(label, []);
|
|
952
|
+
scopeOrder.push(label);
|
|
953
|
+
}
|
|
954
|
+
return grouped.get(label);
|
|
955
|
+
};
|
|
956
|
+
for (let i = 0; i < ordered.length; i += 1) {
|
|
957
|
+
const span = ordered[i];
|
|
958
|
+
if (!isTaskTelemetrySpan(span)) continue;
|
|
959
|
+
let label = ROOT_TASK_SCOPE_LABEL;
|
|
960
|
+
for (let j = i - 1; j >= 0; j -= 1) {
|
|
961
|
+
if (isTaskScopeNode(ordered[j])) {
|
|
962
|
+
label = getTaskScopeLabel(ordered[j]);
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
ensureGroup(label).push(span);
|
|
967
|
+
}
|
|
968
|
+
if (grouped.size === 0) return [];
|
|
969
|
+
const rootSummary = summarizeTaskTelemetrySpans(grouped.get(ROOT_TASK_SCOPE_LABEL) || []);
|
|
970
|
+
const children = [];
|
|
971
|
+
for (const label of scopeOrder) {
|
|
972
|
+
if (label === ROOT_TASK_SCOPE_LABEL) continue;
|
|
973
|
+
const summary = summarizeTaskTelemetrySpans(grouped.get(label) || []);
|
|
974
|
+
if (!summary) continue;
|
|
975
|
+
children.push({
|
|
976
|
+
label,
|
|
977
|
+
source: summary.source,
|
|
978
|
+
eventCount: summary.eventCount,
|
|
979
|
+
snapshotCount: summary.snapshotCount,
|
|
980
|
+
tasks: summary.tasks,
|
|
981
|
+
children: []
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
return [
|
|
985
|
+
{
|
|
986
|
+
label: ROOT_TASK_SCOPE_LABEL,
|
|
987
|
+
source: rootSummary?.source ?? "events",
|
|
988
|
+
eventCount: rootSummary?.eventCount ?? 0,
|
|
989
|
+
snapshotCount: rootSummary?.snapshotCount ?? 0,
|
|
990
|
+
tasks: rootSummary?.tasks ?? [],
|
|
991
|
+
children
|
|
992
|
+
}
|
|
993
|
+
];
|
|
994
|
+
}
|
|
995
|
+
function formatTaskStatusMarker(status) {
|
|
996
|
+
switch (status) {
|
|
997
|
+
case "completed":
|
|
998
|
+
return "[x]";
|
|
999
|
+
case "in_progress":
|
|
1000
|
+
return "[~]";
|
|
1001
|
+
case "blocked":
|
|
1002
|
+
case "failed":
|
|
1003
|
+
case "error":
|
|
1004
|
+
return "[!]";
|
|
1005
|
+
case "cancelled":
|
|
1006
|
+
case "canceled":
|
|
1007
|
+
case "deleted":
|
|
1008
|
+
return "[-]";
|
|
1009
|
+
default:
|
|
1010
|
+
return "[ ]";
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
497
1013
|
function buildRenderContext(allSpans) {
|
|
498
1014
|
const realSpanNames = /* @__PURE__ */ new Set();
|
|
499
1015
|
let hasChildWorkSpans = false;
|
|
@@ -520,28 +1036,7 @@ function shouldSkipLifecycleSpan(span, renderContext) {
|
|
|
520
1036
|
return renderContext.realSpanNames.has(lifecycle.baseName);
|
|
521
1037
|
}
|
|
522
1038
|
async function serializeTraceForPrompt(traceIdOrPath, maxChars, backendConfig, taskResponse, fallbackTraceId) {
|
|
523
|
-
|
|
524
|
-
const cfg = resolveBackendConfig(backendConfig);
|
|
525
|
-
const backendOrder = getBackendOrder(cfg);
|
|
526
|
-
const isFilePath = isTraceFilePath(traceIdOrPath);
|
|
527
|
-
const localTracePath = isFilePath ? traceIdOrPath : void 0;
|
|
528
|
-
const remoteTraceId = fallbackTraceId || (!isFilePath ? traceIdOrPath : await readTraceIdFromFile(traceIdOrPath) || void 0);
|
|
529
|
-
const preferLocalFirst = backendOrder[0] === "file";
|
|
530
|
-
logger.debug(
|
|
531
|
-
`[TraceSerializer] serializeTraceForPrompt ref=${traceIdOrPath} remoteTraceId=${remoteTraceId || "-"} backendOrder=${backendOrder.join(">")}`
|
|
532
|
-
);
|
|
533
|
-
if (preferLocalFirst && localTracePath) {
|
|
534
|
-
logger.debug(`[TraceSerializer] Trying local trace file first: ${localTracePath}`);
|
|
535
|
-
spans = await fetchTraceSpans(localTracePath, { ...cfg, type: "file" });
|
|
536
|
-
}
|
|
537
|
-
if (spans.length === 0 && remoteTraceId) {
|
|
538
|
-
logger.debug(`[TraceSerializer] Trying remote trace backends for trace_id=${remoteTraceId}`);
|
|
539
|
-
spans = await fetchTraceSpans(remoteTraceId, cfg);
|
|
540
|
-
}
|
|
541
|
-
if (spans.length === 0 && localTracePath) {
|
|
542
|
-
logger.debug(`[TraceSerializer] Falling back to local trace file: ${localTracePath}`);
|
|
543
|
-
spans = await fetchTraceSpans(localTracePath, { ...cfg, type: "file" });
|
|
544
|
-
}
|
|
1039
|
+
const { spans } = await resolveTraceSpans(traceIdOrPath, backendConfig, fallbackTraceId);
|
|
545
1040
|
if (spans.length === 0) {
|
|
546
1041
|
return "(no trace data available)";
|
|
547
1042
|
}
|
|
@@ -555,6 +1050,101 @@ async function serializeTraceForPrompt(traceIdOrPath, maxChars, backendConfig, t
|
|
|
555
1050
|
taskResponse
|
|
556
1051
|
});
|
|
557
1052
|
}
|
|
1053
|
+
function renderTraceTreeFromSpans(spans, maxChars, taskResponse) {
|
|
1054
|
+
const tree = buildSpanTree(spans);
|
|
1055
|
+
const routeIntentTopic = extractRouteIntentTopic(spans);
|
|
1056
|
+
const fullOutput = (maxChars ?? 4e3) > 1e5;
|
|
1057
|
+
return renderSpanYaml(tree, spans, {
|
|
1058
|
+
maxChars: maxChars ?? 4e3,
|
|
1059
|
+
fallbackIntent: routeIntentTopic,
|
|
1060
|
+
fullOutput,
|
|
1061
|
+
taskResponse
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
function formatTaskStatus(status) {
|
|
1065
|
+
return status === "completed" ? "[x]" : status === "in_progress" ? "[~]" : status === "blocked" || status === "failed" || status === "error" ? "[!]" : status === "deleted" || status === "cancelled" || status === "canceled" ? "[-]" : "[ ]";
|
|
1066
|
+
}
|
|
1067
|
+
function formatTaskLabel(task) {
|
|
1068
|
+
const title = String(task.title || "").trim();
|
|
1069
|
+
return title || task.id || task.status;
|
|
1070
|
+
}
|
|
1071
|
+
function scopeHasRenderableTasks(scope) {
|
|
1072
|
+
if (scope.tasks.some((task) => !task.synthetic)) return true;
|
|
1073
|
+
return scope.children.some((child) => scopeHasRenderableTasks(child));
|
|
1074
|
+
}
|
|
1075
|
+
function appendTaskScopeLines(lines, scope, depth = 0) {
|
|
1076
|
+
if (!scopeHasRenderableTasks(scope)) return;
|
|
1077
|
+
const prefix = " ".repeat(depth);
|
|
1078
|
+
if (depth > 0 || scope.label !== ROOT_TASK_SCOPE_LABEL) {
|
|
1079
|
+
lines.push(`${prefix}${scope.label}`);
|
|
1080
|
+
}
|
|
1081
|
+
for (const task of scope.tasks.filter((task2) => !task2.synthetic)) {
|
|
1082
|
+
lines.push(`${prefix} ${formatTaskStatus(task.status)} ${formatTaskLabel(task)}`);
|
|
1083
|
+
}
|
|
1084
|
+
for (const child of scope.children) {
|
|
1085
|
+
appendTaskScopeLines(lines, child, depth + 1);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
function buildTraceHeaderLines(traceData, taskSummary) {
|
|
1089
|
+
const lines = [`Trace source: ${traceData.source || "unknown"}`];
|
|
1090
|
+
if (!taskSummary || taskSummary.tasks.length === 0) {
|
|
1091
|
+
lines.push("Tasks: no task telemetry found in this trace");
|
|
1092
|
+
return lines;
|
|
1093
|
+
}
|
|
1094
|
+
const eventsSuffix = taskSummary.snapshotCount > 0 ? `, ${taskSummary.eventCount} task events, ${taskSummary.snapshotCount} snapshots` : `, ${taskSummary.eventCount} task events`;
|
|
1095
|
+
lines.push(`Tasks: ${taskSummary.tasks.length} tracked (${taskSummary.source}${eventsSuffix})`);
|
|
1096
|
+
if (taskSummary.scopes.length > 0) {
|
|
1097
|
+
for (const scope of taskSummary.scopes) {
|
|
1098
|
+
appendTaskScopeLines(lines, scope);
|
|
1099
|
+
}
|
|
1100
|
+
} else {
|
|
1101
|
+
for (const task of taskSummary.tasks) {
|
|
1102
|
+
lines.push(` ${formatTaskStatus(task.status)} ${formatTaskLabel(task)}`);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
return lines;
|
|
1106
|
+
}
|
|
1107
|
+
async function buildTraceReport(traceIdOrPath, maxChars, backendConfig, taskResponse, fallbackTraceId) {
|
|
1108
|
+
const traceData = await resolveTraceSpans(traceIdOrPath, backendConfig, fallbackTraceId);
|
|
1109
|
+
if (traceData.spans.length === 0) {
|
|
1110
|
+
return null;
|
|
1111
|
+
}
|
|
1112
|
+
const taskSummary = extractProbeTaskSummary(traceData.spans);
|
|
1113
|
+
const headerLines = buildTraceHeaderLines(traceData, taskSummary);
|
|
1114
|
+
const headerText = headerLines.join("\n");
|
|
1115
|
+
const tree = renderTraceTreeFromSpans(traceData.spans, maxChars, taskResponse);
|
|
1116
|
+
return {
|
|
1117
|
+
traceData,
|
|
1118
|
+
tree,
|
|
1119
|
+
taskSummary,
|
|
1120
|
+
headerText,
|
|
1121
|
+
text: `${headerText}
|
|
1122
|
+
|
|
1123
|
+
${tree}`
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
function extractProbeTaskSummary(spans) {
|
|
1127
|
+
const overall = summarizeTaskTelemetrySpans(spans);
|
|
1128
|
+
if (!overall) return null;
|
|
1129
|
+
const rootScope = buildProbeTaskScopeSummary(
|
|
1130
|
+
buildTaskSummaryRoot(spans),
|
|
1131
|
+
ROOT_TASK_SCOPE_LABEL,
|
|
1132
|
+
true,
|
|
1133
|
+
spans
|
|
1134
|
+
);
|
|
1135
|
+
let scopes = rootScope ? [rootScope] : [];
|
|
1136
|
+
if (scopes.length === 0 || scopes[0].children.length === 0) {
|
|
1137
|
+
const temporalScopes = buildTemporalTaskScopes(spans);
|
|
1138
|
+
if (temporalScopes.length > 0 && temporalScopes[0].children.length > 0) {
|
|
1139
|
+
scopes = temporalScopes;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return {
|
|
1143
|
+
...overall,
|
|
1144
|
+
tasks: scopes.length > 0 ? flattenTaskScopes(scopes) : overall.tasks,
|
|
1145
|
+
scopes
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
558
1148
|
function renderSpanTree(tree, opts) {
|
|
559
1149
|
const maxChars = opts?.maxChars ?? 4e3;
|
|
560
1150
|
const maxDepth = opts?.maxDepth ?? 20;
|
|
@@ -682,6 +1272,19 @@ function renderYamlNode(node, indent, lines, dedup, renderContext, fallbackInten
|
|
|
682
1272
|
const toolInput = extractToolInput(String(toolName), attrs);
|
|
683
1273
|
const toolResultLen = attrs["tool.result.length"] || attrs["tool.result.count"];
|
|
684
1274
|
const tn = String(toolName);
|
|
1275
|
+
const taskSnapshot = tn === "task" ? parseTaskStatusSnapshot(String(attrs["tool.result"] || "")) : [];
|
|
1276
|
+
if (tn === "task" && taskSnapshot.length > 0) {
|
|
1277
|
+
lines.push(`${pad}tasks snapshot${childSuffix}:`);
|
|
1278
|
+
for (const task of taskSnapshot) {
|
|
1279
|
+
lines.push(
|
|
1280
|
+
`${pad} ${formatTaskStatusMarker(task.status)} ${task.id}: ${truncate(task.title, 100)}`
|
|
1281
|
+
);
|
|
1282
|
+
}
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
if (tn === "task") {
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
685
1288
|
const isSearchTool = tn === "search" || tn === "searchCode" || tn === "search_code";
|
|
686
1289
|
const numLen = toolResultLen ? Number(toolResultLen) : -1;
|
|
687
1290
|
const noResults = isSearchTool && numLen >= 0 && numLen < 500;
|
|
@@ -695,10 +1298,12 @@ function renderYamlNode(node, indent, lines, dedup, renderContext, fallbackInten
|
|
|
695
1298
|
const action = attrs["dedup.action"] || "?";
|
|
696
1299
|
const reason = attrs["dedup.reason"] || "";
|
|
697
1300
|
const rewritten = attrs["dedup.rewritten"] || "";
|
|
1301
|
+
const error = attrs["dedup.error"] || "";
|
|
698
1302
|
const prevCount = attrs["dedup.previous_count"] || "0";
|
|
699
1303
|
let detail = `${action}`;
|
|
700
1304
|
if (rewritten) detail += ` \u2192 "${truncate(String(rewritten), 60)}"`;
|
|
701
1305
|
if (reason) detail += ` (${truncate(String(reason), 80)})`;
|
|
1306
|
+
if (error) detail += ` [error: ${truncate(String(error), 120)}]`;
|
|
702
1307
|
lines.push(
|
|
703
1308
|
`${pad}dedup("${truncate(String(query), 60)}") [${prevCount} prior]: ${detail} \u2014 ${duration}`
|
|
704
1309
|
);
|
|
@@ -892,6 +1497,86 @@ function renderYamlNode(node, indent, lines, dedup, renderContext, fallbackInten
|
|
|
892
1497
|
}
|
|
893
1498
|
return;
|
|
894
1499
|
}
|
|
1500
|
+
const taskEventMatch = name.match(/(?:^probe\.event\.)?task\.([a-z_]+)$/);
|
|
1501
|
+
if (taskEventMatch) {
|
|
1502
|
+
const eventType = taskEventMatch[1];
|
|
1503
|
+
const taskId = attrs["task.id"] ? String(attrs["task.id"]) : "";
|
|
1504
|
+
const taskTitle = attrs["task.title"] ? truncate(String(attrs["task.title"]), 80) : "";
|
|
1505
|
+
const taskIds = attrs["task.ids"] ? truncate(String(attrs["task.ids"]), 120) : "";
|
|
1506
|
+
const count = attrs["task.count"] ? Number(attrs["task.count"]) : void 0;
|
|
1507
|
+
const totalCount = attrs["task.total_count"] ? Number(attrs["task.total_count"]) : void 0;
|
|
1508
|
+
const incompleteCount = attrs["task.incomplete_count"] ? Number(attrs["task.incomplete_count"]) : void 0;
|
|
1509
|
+
const completedCount = attrs["task.completed_count"] ? Number(attrs["task.completed_count"]) : void 0;
|
|
1510
|
+
const remaining = attrs["task.incomplete_remaining"] ? Number(attrs["task.incomplete_remaining"]) : void 0;
|
|
1511
|
+
const newStatus = attrs["task.new_status"] ? String(attrs["task.new_status"]) : "";
|
|
1512
|
+
const fieldsUpdated = attrs["task.fields_updated"] ? truncate(String(attrs["task.fields_updated"]), 80) : "";
|
|
1513
|
+
const error = attrs["task.error"] ? truncate(String(attrs["task.error"]), 100) : "";
|
|
1514
|
+
const action = attrs["task.action"] ? String(attrs["task.action"]) : "";
|
|
1515
|
+
switch (eventType) {
|
|
1516
|
+
case "session_started":
|
|
1517
|
+
lines.push(`${pad}tasks enabled \u2014 ${duration}`);
|
|
1518
|
+
return;
|
|
1519
|
+
case "created":
|
|
1520
|
+
lines.push(`${pad}[ ] ${taskId}${taskTitle ? `: ${taskTitle}` : ""} \u2014 ${duration}`);
|
|
1521
|
+
return;
|
|
1522
|
+
case "batch_created": {
|
|
1523
|
+
const totalSuffix = totalCount !== void 0 ? `, total ${totalCount}` : "";
|
|
1524
|
+
lines.push(
|
|
1525
|
+
`${pad}tasks created (${count ?? "?"}${totalSuffix}): ${taskIds || "unknown"} \u2014 ${duration}`
|
|
1526
|
+
);
|
|
1527
|
+
return;
|
|
1528
|
+
}
|
|
1529
|
+
case "updated": {
|
|
1530
|
+
const statusSuffix = newStatus && newStatus !== "unchanged" ? ` -> ${newStatus}` : "";
|
|
1531
|
+
const fieldSuffix = fieldsUpdated ? ` [${fieldsUpdated}]` : "";
|
|
1532
|
+
lines.push(`${pad}task updated: ${taskId}${statusSuffix}${fieldSuffix} \u2014 ${duration}`);
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
case "batch_updated":
|
|
1536
|
+
lines.push(`${pad}tasks updated (${count ?? "?"}): ${taskIds || "unknown"} \u2014 ${duration}`);
|
|
1537
|
+
return;
|
|
1538
|
+
case "completed": {
|
|
1539
|
+
const remainingSuffix = remaining !== void 0 ? ` (${remaining} remaining)` : "";
|
|
1540
|
+
lines.push(
|
|
1541
|
+
`${pad}[x] ${taskId}${taskTitle ? `: ${taskTitle}` : ""}${remainingSuffix} \u2014 ${duration}`
|
|
1542
|
+
);
|
|
1543
|
+
return;
|
|
1544
|
+
}
|
|
1545
|
+
case "batch_completed": {
|
|
1546
|
+
const remainingSuffix = remaining !== void 0 ? `, ${remaining} remaining` : "";
|
|
1547
|
+
lines.push(
|
|
1548
|
+
`${pad}tasks completed (${count ?? "?"}${remainingSuffix}): ${taskIds || "unknown"} \u2014 ${duration}`
|
|
1549
|
+
);
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
case "deleted":
|
|
1553
|
+
lines.push(`${pad}task deleted: ${taskId} \u2014 ${duration}`);
|
|
1554
|
+
return;
|
|
1555
|
+
case "batch_deleted":
|
|
1556
|
+
lines.push(`${pad}tasks deleted (${count ?? "?"}): ${taskIds || "unknown"} \u2014 ${duration}`);
|
|
1557
|
+
return;
|
|
1558
|
+
case "listed": {
|
|
1559
|
+
const stats = [];
|
|
1560
|
+
if (totalCount !== void 0) stats.push(`${totalCount} total`);
|
|
1561
|
+
if (incompleteCount !== void 0) stats.push(`${incompleteCount} incomplete`);
|
|
1562
|
+
if (completedCount !== void 0) stats.push(`${completedCount} completed`);
|
|
1563
|
+
lines.push(
|
|
1564
|
+
`${pad}tasks listed${stats.length > 0 ? ` (${stats.join(", ")})` : ""} \u2014 ${duration}`
|
|
1565
|
+
);
|
|
1566
|
+
return;
|
|
1567
|
+
}
|
|
1568
|
+
case "validation_error":
|
|
1569
|
+
case "error":
|
|
1570
|
+
lines.push(`${pad}task.${eventType}: ${error || "unknown error"} \u2014 ${duration}`);
|
|
1571
|
+
return;
|
|
1572
|
+
case "unknown_action":
|
|
1573
|
+
lines.push(`${pad}task.unknown_action: ${action || "unknown"} \u2014 ${duration}`);
|
|
1574
|
+
return;
|
|
1575
|
+
default:
|
|
1576
|
+
lines.push(`${pad}task.${eventType}${taskId ? `: ${taskId}` : ""} \u2014 ${duration}`);
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
895
1580
|
const errMark = node.span.status === "error" ? " \u2717" : "";
|
|
896
1581
|
const hasChildren = node.children.length > 0;
|
|
897
1582
|
lines.push(`${pad}${name}${childSuffix} \u2014 ${duration}${errMark}${hasChildren ? ":" : ""}`);
|
|
@@ -1171,9 +1856,11 @@ function formatSpanLine(span, parentSpan, fallbackIntent, fullOutput, dedup, has
|
|
|
1171
1856
|
const action = attrs["dedup.action"] || "?";
|
|
1172
1857
|
const reason = attrs["dedup.reason"] || "";
|
|
1173
1858
|
const rewritten = attrs["dedup.rewritten"] || "";
|
|
1859
|
+
const error = attrs["dedup.error"] || "";
|
|
1174
1860
|
let detail = `${action}`;
|
|
1175
1861
|
if (rewritten) detail += ` \u2192 "${truncate(String(rewritten), 50)}"`;
|
|
1176
1862
|
if (reason) detail += ` \u2014 ${truncate(String(reason), 60)}`;
|
|
1863
|
+
if (error) detail += ` [error: ${truncate(String(error), 80)}]`;
|
|
1177
1864
|
return { line: `dedup("${truncate(String(query), 50)}") ${detail} (${duration})` };
|
|
1178
1865
|
}
|
|
1179
1866
|
if (name === "search.delegate") {
|
|
@@ -1358,6 +2045,72 @@ function formatSpanLine(span, parentSpan, fallbackIntent, fullOutput, dedup, has
|
|
|
1358
2045
|
const reasonStr = reason ? `: ${truncate(String(reason), 80)}` : "";
|
|
1359
2046
|
return { line: `graceful_stop${reasonStr} (${duration})` };
|
|
1360
2047
|
}
|
|
2048
|
+
const taskEventMatch = name.match(/(?:^probe\.event\.)?task\.([a-z_]+)$/);
|
|
2049
|
+
if (taskEventMatch) {
|
|
2050
|
+
const eventType = taskEventMatch[1];
|
|
2051
|
+
const taskId = attrs["task.id"] ? String(attrs["task.id"]) : "";
|
|
2052
|
+
const taskTitle = attrs["task.title"] ? truncate(String(attrs["task.title"]), 80) : "";
|
|
2053
|
+
const taskIds = attrs["task.ids"] ? truncate(String(attrs["task.ids"]), 120) : "";
|
|
2054
|
+
const count = attrs["task.count"] ? Number(attrs["task.count"]) : void 0;
|
|
2055
|
+
const totalCount = attrs["task.total_count"] ? Number(attrs["task.total_count"]) : void 0;
|
|
2056
|
+
const incompleteCount = attrs["task.incomplete_count"] ? Number(attrs["task.incomplete_count"]) : void 0;
|
|
2057
|
+
const completedCount = attrs["task.completed_count"] ? Number(attrs["task.completed_count"]) : void 0;
|
|
2058
|
+
const remaining = attrs["task.incomplete_remaining"] ? Number(attrs["task.incomplete_remaining"]) : void 0;
|
|
2059
|
+
const newStatus = attrs["task.new_status"] ? String(attrs["task.new_status"]) : "";
|
|
2060
|
+
const fieldsUpdated = attrs["task.fields_updated"] ? truncate(String(attrs["task.fields_updated"]), 80) : "";
|
|
2061
|
+
const error = attrs["task.error"] ? truncate(String(attrs["task.error"]), 100) : "";
|
|
2062
|
+
const action = attrs["task.action"] ? String(attrs["task.action"]) : "";
|
|
2063
|
+
const tail = ` (${duration})`;
|
|
2064
|
+
switch (eventType) {
|
|
2065
|
+
case "session_started":
|
|
2066
|
+
return { line: `tasks enabled${tail}` };
|
|
2067
|
+
case "created":
|
|
2068
|
+
return { line: `[ ] ${taskId}${taskTitle ? `: ${taskTitle}` : ""}${tail}` };
|
|
2069
|
+
case "batch_created": {
|
|
2070
|
+
const totalSuffix = totalCount !== void 0 ? `, total ${totalCount}` : "";
|
|
2071
|
+
return {
|
|
2072
|
+
line: `tasks created (${count ?? "?"}${totalSuffix}): ${taskIds || "unknown"}${tail}`
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
case "updated": {
|
|
2076
|
+
const statusSuffix = newStatus && newStatus !== "unchanged" ? ` -> ${newStatus}` : "";
|
|
2077
|
+
const fieldSuffix = fieldsUpdated ? ` [${fieldsUpdated}]` : "";
|
|
2078
|
+
return { line: `task updated: ${taskId}${statusSuffix}${fieldSuffix}${tail}` };
|
|
2079
|
+
}
|
|
2080
|
+
case "batch_updated":
|
|
2081
|
+
return { line: `tasks updated (${count ?? "?"}): ${taskIds || "unknown"}${tail}` };
|
|
2082
|
+
case "completed": {
|
|
2083
|
+
const remainingSuffix = remaining !== void 0 ? ` (${remaining} remaining)` : "";
|
|
2084
|
+
return {
|
|
2085
|
+
line: `[x] ${taskId}${taskTitle ? `: ${taskTitle}` : ""}${remainingSuffix}${tail}`
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
case "batch_completed": {
|
|
2089
|
+
const remainingSuffix = remaining !== void 0 ? `, ${remaining} remaining` : "";
|
|
2090
|
+
return {
|
|
2091
|
+
line: `tasks completed (${count ?? "?"}${remainingSuffix}): ${taskIds || "unknown"}${tail}`
|
|
2092
|
+
};
|
|
2093
|
+
}
|
|
2094
|
+
case "deleted":
|
|
2095
|
+
return { line: `task deleted: ${taskId}${tail}` };
|
|
2096
|
+
case "batch_deleted":
|
|
2097
|
+
return { line: `tasks deleted (${count ?? "?"}): ${taskIds || "unknown"}${tail}` };
|
|
2098
|
+
case "listed": {
|
|
2099
|
+
const stats = [];
|
|
2100
|
+
if (totalCount !== void 0) stats.push(`${totalCount} total`);
|
|
2101
|
+
if (incompleteCount !== void 0) stats.push(`${incompleteCount} incomplete`);
|
|
2102
|
+
if (completedCount !== void 0) stats.push(`${completedCount} completed`);
|
|
2103
|
+
return { line: `tasks listed${stats.length > 0 ? ` (${stats.join(", ")})` : ""}${tail}` };
|
|
2104
|
+
}
|
|
2105
|
+
case "validation_error":
|
|
2106
|
+
case "error":
|
|
2107
|
+
return { line: `task.${eventType}: ${error || "unknown error"}${tail}` };
|
|
2108
|
+
case "unknown_action":
|
|
2109
|
+
return { line: `task.unknown_action: ${action || "unknown"}${tail}` };
|
|
2110
|
+
default:
|
|
2111
|
+
return { line: `task.${eventType}${taskId ? `: ${taskId}` : ""}${tail}` };
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
1361
2114
|
return { line: `${name} (${duration})${span.status === "error" ? " \u2717" : ""}` };
|
|
1362
2115
|
}
|
|
1363
2116
|
function parseWorkspacePath(fullPath) {
|
|
@@ -1693,7 +2446,7 @@ function truncate(str, max) {
|
|
|
1693
2446
|
if (head < 10) return str.slice(0, max - 3) + "...";
|
|
1694
2447
|
return str.slice(0, head) + " ...[truncated]... " + str.slice(-tail);
|
|
1695
2448
|
}
|
|
1696
|
-
var NOISE_SPAN_NAMES, WRAPPER_SPAN_NAMES;
|
|
2449
|
+
var NOISE_SPAN_NAMES, WRAPPER_SPAN_NAMES, ROOT_TASK_SCOPE_LABEL, TASK_SCOPE_EXCLUDED_CHECKS, SUB_AGENT_SCOPE_CHECKS;
|
|
1697
2450
|
var init_trace_serializer = __esm({
|
|
1698
2451
|
"src/agent-protocol/trace-serializer.ts"() {
|
|
1699
2452
|
init_logger();
|
|
@@ -1708,17 +2461,35 @@ var init_trace_serializer = __esm({
|
|
|
1708
2461
|
"visor.ai_check",
|
|
1709
2462
|
"probe.delegation"
|
|
1710
2463
|
]);
|
|
2464
|
+
ROOT_TASK_SCOPE_LABEL = "Main Agent";
|
|
2465
|
+
TASK_SCOPE_EXCLUDED_CHECKS = /* @__PURE__ */ new Set([
|
|
2466
|
+
"chat",
|
|
2467
|
+
"route-intent",
|
|
2468
|
+
"classify",
|
|
2469
|
+
"build-config",
|
|
2470
|
+
"generate-response",
|
|
2471
|
+
"setup-projects",
|
|
2472
|
+
"checkout-docs",
|
|
2473
|
+
"route-projects",
|
|
2474
|
+
"project-items",
|
|
2475
|
+
"checkout-projects"
|
|
2476
|
+
]);
|
|
2477
|
+
SUB_AGENT_SCOPE_CHECKS = /* @__PURE__ */ new Set(["engineer-task", "explore-code"]);
|
|
1711
2478
|
}
|
|
1712
2479
|
});
|
|
1713
2480
|
|
|
1714
2481
|
export {
|
|
1715
2482
|
fetchTraceSpans,
|
|
2483
|
+
resolveTraceSpans,
|
|
1716
2484
|
findTraceFile,
|
|
1717
2485
|
readTraceIdFromFile,
|
|
1718
2486
|
serializeTraceForPrompt,
|
|
2487
|
+
buildTraceHeaderLines,
|
|
2488
|
+
buildTraceReport,
|
|
2489
|
+
extractProbeTaskSummary,
|
|
1719
2490
|
renderSpanTree,
|
|
1720
2491
|
renderTraceTree,
|
|
1721
2492
|
renderSpanYaml,
|
|
1722
2493
|
init_trace_serializer
|
|
1723
2494
|
};
|
|
1724
|
-
//# sourceMappingURL=chunk-
|
|
2495
|
+
//# sourceMappingURL=chunk-BVEATT5V.mjs.map
|