@opensearch-project/agent-health 0.3.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -6
- package/cli/dist/index.js +10072 -4502
- package/deployment/cloudformation/agent-health-observability.yaml +762 -0
- package/dist/assets/index-CCQRDlO0.js +243 -0
- package/dist/assets/index-CNHQVbcj.css +1 -0
- package/dist/index.html +2 -2
- package/docs/ARCHITECTURE.md +450 -0
- package/docs/BACKEND_JOB_QUEUE.md +405 -0
- package/docs/CLAUDE_CODE_TELEMETRY.md +283 -0
- package/docs/CLI.md +431 -0
- package/docs/CODING_AGENT_ANALYTICS.md +298 -0
- package/docs/CONFIGURATION.md +388 -0
- package/docs/CONNECTORS.md +536 -0
- package/docs/INSTRUMENT_WITH_OTEL.md +390 -0
- package/docs/ML-COMMONS-SETUP.md +289 -0
- package/docs/NPX_PACKAGING.md +195 -0
- package/docs/PERFORMANCE-MONITORING.md +200 -0
- package/docs/PERFORMANCE.md +390 -0
- package/docs/PI_PROFILING.md +169 -0
- package/docs/PLAN-non-agui-agent-support.md +525 -0
- package/docs/SDK.md +577 -0
- package/docs/SKILLS.md +264 -0
- package/docs/blogs/2026-02-28-opensearch-agent-health.md +200 -0
- package/docs/blogs/getting-started-blog.md +608 -0
- package/docs/diagrams/Agent-health.excalidraw +5656 -0
- package/docs/diagrams/architecture.png +0 -0
- package/docs/plans/field-redesign.md +468 -0
- package/docs/rfcs/001-coding-agent-analytics.md +374 -0
- package/docs/rfcs/002-enterprise-leaderboard.md +267 -0
- package/docs/rfcs/003-remote-aggregation.md +146 -0
- package/docs/rfcs/004-test-sdk-v2.md +599 -0
- package/docs/skills/AGENT_HEALTH.md +598 -0
- package/docs/skills/AGENT_PROFILE.md +191 -0
- package/docs/skills/add-connector/SKILL.md +68 -0
- package/docs/skills/agent-health-profile/SKILL.md +40 -0
- package/docs/skills/config-auth/SKILL.md +194 -0
- package/docs/skills/config-auth/evals/evals.json +35 -0
- package/docs/skills/create-pr/SKILL.md +73 -0
- package/docs/skills/instrument-otel/SKILL.md +84 -0
- package/docs/skills/write-test/SKILL.md +124 -0
- package/docs/ui prd.md +376 -0
- package/examples/README.md +53 -0
- package/examples/config/agent-health.config.example.ts +155 -0
- package/examples/connectors/echo-connector.ts +131 -0
- package/examples/eval-files/demo.eval.js +128 -0
- package/examples/eval-files/sdk-hooks-demo.eval.js +99 -0
- package/examples/pi-profiling/README.md +77 -0
- package/examples/pi-profiling/agent-health-profile.ts +417 -0
- package/lib/dist/lib/agentUtils.d.ts +29 -0
- package/lib/dist/lib/agentUtils.d.ts.map +1 -0
- package/lib/dist/lib/agentUtils.js +43 -0
- package/lib/dist/lib/agentUtils.js.map +1 -0
- package/lib/dist/lib/benchmarkExport.d.ts +14 -0
- package/lib/dist/lib/benchmarkExport.d.ts.map +1 -0
- package/lib/dist/lib/benchmarkExport.js +41 -0
- package/lib/dist/lib/benchmarkExport.js.map +1 -0
- package/lib/dist/lib/benchmarkVersionUtils.d.ts +37 -0
- package/lib/dist/lib/benchmarkVersionUtils.d.ts.map +1 -0
- package/lib/dist/lib/benchmarkVersionUtils.js +68 -0
- package/lib/dist/lib/benchmarkVersionUtils.js.map +1 -0
- package/lib/dist/lib/config/defineConfig.d.ts +27 -0
- package/lib/dist/lib/config/defineConfig.d.ts.map +1 -0
- package/lib/dist/lib/config/defineConfig.js +28 -0
- package/lib/dist/lib/config/defineConfig.js.map +1 -0
- package/lib/dist/lib/config/index.d.ts +9 -0
- package/lib/dist/lib/config/index.d.ts.map +1 -0
- package/lib/dist/lib/config/index.js +8 -0
- package/lib/dist/lib/config/index.js.map +1 -0
- package/lib/dist/lib/config/loader.d.ts +39 -0
- package/lib/dist/lib/config/loader.d.ts.map +1 -0
- package/lib/dist/lib/config/loader.js +258 -0
- package/lib/dist/lib/config/loader.js.map +1 -0
- package/lib/dist/lib/config/statePaths.d.ts +61 -0
- package/lib/dist/lib/config/statePaths.d.ts.map +1 -0
- package/lib/dist/lib/config/statePaths.js +188 -0
- package/lib/dist/lib/config/statePaths.js.map +1 -0
- package/lib/dist/lib/config/types.d.ts +231 -0
- package/lib/dist/lib/config/types.d.ts.map +1 -0
- package/lib/dist/lib/config/types.js +6 -0
- package/lib/dist/lib/config/types.js.map +1 -0
- package/lib/dist/lib/config.d.ts +39 -0
- package/lib/dist/lib/config.d.ts.map +1 -0
- package/lib/dist/lib/config.js +118 -0
- package/lib/dist/lib/config.js.map +1 -0
- package/lib/dist/lib/constants.d.ts +70 -0
- package/lib/dist/lib/constants.d.ts.map +1 -0
- package/lib/dist/lib/constants.js +365 -0
- package/lib/dist/lib/constants.js.map +1 -0
- package/lib/dist/lib/contextUtilization.d.ts +23 -0
- package/lib/dist/lib/contextUtilization.d.ts.map +1 -0
- package/lib/dist/lib/contextUtilization.js +72 -0
- package/lib/dist/lib/contextUtilization.js.map +1 -0
- package/lib/dist/lib/dashboardMetrics.d.ts +87 -0
- package/lib/dist/lib/dashboardMetrics.d.ts.map +1 -0
- package/lib/dist/lib/dashboardMetrics.js +242 -0
- package/lib/dist/lib/dashboardMetrics.js.map +1 -0
- package/lib/dist/lib/dataSourceConfig.d.ts +108 -0
- package/lib/dist/lib/dataSourceConfig.d.ts.map +1 -0
- package/lib/dist/lib/dataSourceConfig.js +166 -0
- package/lib/dist/lib/dataSourceConfig.js.map +1 -0
- package/lib/dist/lib/debug.d.ts +26 -0
- package/lib/dist/lib/debug.d.ts.map +1 -0
- package/lib/dist/lib/debug.js +132 -0
- package/lib/dist/lib/debug.js.map +1 -0
- package/lib/dist/lib/diagnostics.d.ts +28 -0
- package/lib/dist/lib/diagnostics.d.ts.map +1 -0
- package/lib/dist/lib/diagnostics.js +65 -0
- package/lib/dist/lib/diagnostics.js.map +1 -0
- package/lib/dist/lib/envCompat.d.ts +27 -0
- package/lib/dist/lib/envCompat.d.ts.map +1 -0
- package/lib/dist/lib/envCompat.js +73 -0
- package/lib/dist/lib/envCompat.js.map +1 -0
- package/lib/dist/lib/findPackageRoot.d.ts +7 -0
- package/lib/dist/lib/findPackageRoot.d.ts.map +1 -0
- package/lib/dist/lib/findPackageRoot.js +57 -0
- package/lib/dist/lib/findPackageRoot.js.map +1 -0
- package/lib/dist/lib/hooks.d.ts +36 -0
- package/lib/dist/lib/hooks.d.ts.map +1 -0
- package/lib/dist/lib/hooks.js +112 -0
- package/lib/dist/lib/hooks.js.map +1 -0
- package/lib/dist/lib/index.d.ts +47 -0
- package/lib/dist/lib/index.d.ts.map +1 -0
- package/lib/dist/lib/index.js +62 -0
- package/lib/dist/lib/index.js.map +1 -0
- package/lib/dist/lib/labels.d.ts +90 -0
- package/lib/dist/lib/labels.d.ts.map +1 -0
- package/lib/dist/lib/labels.js +158 -0
- package/lib/dist/lib/labels.js.map +1 -0
- package/lib/dist/lib/markdown.d.ts +16 -0
- package/lib/dist/lib/markdown.d.ts.map +1 -0
- package/lib/dist/lib/markdown.js +42 -0
- package/lib/dist/lib/markdown.js.map +1 -0
- package/lib/dist/lib/matchers/expect.d.ts +3 -0
- package/lib/dist/lib/matchers/expect.d.ts.map +1 -0
- package/lib/dist/lib/matchers/expect.js +225 -0
- package/lib/dist/lib/matchers/expect.js.map +1 -0
- package/lib/dist/lib/matchers/index.d.ts +8 -0
- package/lib/dist/lib/matchers/index.d.ts.map +1 -0
- package/lib/dist/lib/matchers/index.js +9 -0
- package/lib/dist/lib/matchers/index.js.map +1 -0
- package/lib/dist/lib/matchers/judgeAccessor.d.ts +113 -0
- package/lib/dist/lib/matchers/judgeAccessor.d.ts.map +1 -0
- package/lib/dist/lib/matchers/judgeAccessor.js +183 -0
- package/lib/dist/lib/matchers/judgeAccessor.js.map +1 -0
- package/lib/dist/lib/matchers/session.d.ts +39 -0
- package/lib/dist/lib/matchers/session.d.ts.map +1 -0
- package/lib/dist/lib/matchers/session.js +116 -0
- package/lib/dist/lib/matchers/session.js.map +1 -0
- package/lib/dist/lib/matchers/traces.d.ts +55 -0
- package/lib/dist/lib/matchers/traces.d.ts.map +1 -0
- package/lib/dist/lib/matchers/traces.js +116 -0
- package/lib/dist/lib/matchers/traces.js.map +1 -0
- package/lib/dist/lib/matchers/types.d.ts +75 -0
- package/lib/dist/lib/matchers/types.d.ts.map +1 -0
- package/lib/dist/lib/matchers/types.js +6 -0
- package/lib/dist/lib/matchers/types.js.map +1 -0
- package/lib/dist/lib/packagePaths.d.ts +29 -0
- package/lib/dist/lib/packagePaths.d.ts.map +1 -0
- package/lib/dist/lib/packagePaths.js +63 -0
- package/lib/dist/lib/packagePaths.js.map +1 -0
- package/lib/dist/lib/performance.d.ts +51 -0
- package/lib/dist/lib/performance.d.ts.map +1 -0
- package/lib/dist/lib/performance.js +159 -0
- package/lib/dist/lib/performance.js.map +1 -0
- package/lib/dist/lib/portConfig.d.ts +29 -0
- package/lib/dist/lib/portConfig.d.ts.map +1 -0
- package/lib/dist/lib/portConfig.js +64 -0
- package/lib/dist/lib/portConfig.js.map +1 -0
- package/lib/dist/lib/preferences.d.ts +63 -0
- package/lib/dist/lib/preferences.d.ts.map +1 -0
- package/lib/dist/lib/preferences.js +117 -0
- package/lib/dist/lib/preferences.js.map +1 -0
- package/lib/dist/lib/resolveAgentModel.d.ts +22 -0
- package/lib/dist/lib/resolveAgentModel.d.ts.map +1 -0
- package/lib/dist/lib/resolveAgentModel.js +37 -0
- package/lib/dist/lib/resolveAgentModel.js.map +1 -0
- package/lib/dist/lib/runStats.d.ts +92 -0
- package/lib/dist/lib/runStats.d.ts.map +1 -0
- package/lib/dist/lib/runStats.js +160 -0
- package/lib/dist/lib/runStats.js.map +1 -0
- package/lib/dist/lib/telemetry/constants.d.ts +60 -0
- package/lib/dist/lib/telemetry/constants.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/constants.js +87 -0
- package/lib/dist/lib/telemetry/constants.js.map +1 -0
- package/lib/dist/lib/telemetry/evalSpans.d.ts +61 -0
- package/lib/dist/lib/telemetry/evalSpans.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/evalSpans.js +254 -0
- package/lib/dist/lib/telemetry/evalSpans.js.map +1 -0
- package/lib/dist/lib/telemetry/index.d.ts +11 -0
- package/lib/dist/lib/telemetry/index.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/index.js +15 -0
- package/lib/dist/lib/telemetry/index.js.map +1 -0
- package/lib/dist/lib/telemetry/opensearchExporter.d.ts +43 -0
- package/lib/dist/lib/telemetry/opensearchExporter.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/opensearchExporter.js +217 -0
- package/lib/dist/lib/telemetry/opensearchExporter.js.map +1 -0
- package/lib/dist/lib/telemetry/provider.d.ts +55 -0
- package/lib/dist/lib/telemetry/provider.d.ts.map +1 -0
- package/lib/dist/lib/telemetry/provider.js +140 -0
- package/lib/dist/lib/telemetry/provider.js.map +1 -0
- package/lib/dist/lib/testCaseLabels.d.ts +34 -0
- package/lib/dist/lib/testCaseLabels.d.ts.map +1 -0
- package/lib/dist/lib/testCaseLabels.js +88 -0
- package/lib/dist/lib/testCaseLabels.js.map +1 -0
- package/lib/dist/lib/testCaseValidation.d.ts +140 -0
- package/lib/dist/lib/testCaseValidation.d.ts.map +1 -0
- package/lib/dist/lib/testCaseValidation.js +162 -0
- package/lib/dist/lib/testCaseValidation.js.map +1 -0
- package/lib/dist/lib/testCases/agentFixture.d.ts +80 -0
- package/lib/dist/lib/testCases/agentFixture.d.ts.map +1 -0
- package/lib/dist/lib/testCases/agentFixture.js +43 -0
- package/lib/dist/lib/testCases/agentFixture.js.map +1 -0
- package/lib/dist/lib/testCases/authoringSurface.d.ts +10 -0
- package/lib/dist/lib/testCases/authoringSurface.d.ts.map +1 -0
- package/lib/dist/lib/testCases/authoringSurface.js +54 -0
- package/lib/dist/lib/testCases/authoringSurface.js.map +1 -0
- package/lib/dist/lib/testCases/codemod.d.ts +13 -0
- package/lib/dist/lib/testCases/codemod.d.ts.map +1 -0
- package/lib/dist/lib/testCases/codemod.js +169 -0
- package/lib/dist/lib/testCases/codemod.js.map +1 -0
- package/lib/dist/lib/testCases/define.d.ts +114 -0
- package/lib/dist/lib/testCases/define.d.ts.map +1 -0
- package/lib/dist/lib/testCases/define.js +253 -0
- package/lib/dist/lib/testCases/define.js.map +1 -0
- package/lib/dist/lib/testCases/evaluators.d.ts +80 -0
- package/lib/dist/lib/testCases/evaluators.d.ts.map +1 -0
- package/lib/dist/lib/testCases/evaluators.js +105 -0
- package/lib/dist/lib/testCases/evaluators.js.map +1 -0
- package/lib/dist/lib/testCases/index.d.ts +14 -0
- package/lib/dist/lib/testCases/index.d.ts.map +1 -0
- package/lib/dist/lib/testCases/index.js +12 -0
- package/lib/dist/lib/testCases/index.js.map +1 -0
- package/lib/dist/lib/testCases/judge.d.ts +165 -0
- package/lib/dist/lib/testCases/judge.d.ts.map +1 -0
- package/lib/dist/lib/testCases/judge.js +359 -0
- package/lib/dist/lib/testCases/judge.js.map +1 -0
- package/lib/dist/lib/testCases/loader.d.ts +26 -0
- package/lib/dist/lib/testCases/loader.d.ts.map +1 -0
- package/lib/dist/lib/testCases/loader.js +149 -0
- package/lib/dist/lib/testCases/loader.js.map +1 -0
- package/lib/dist/lib/testCases/types.d.ts +242 -0
- package/lib/dist/lib/testCases/types.d.ts.map +1 -0
- package/lib/dist/lib/testCases/types.js +6 -0
- package/lib/dist/lib/testCases/types.js.map +1 -0
- package/lib/dist/lib/theme.d.ts +6 -0
- package/lib/dist/lib/theme.d.ts.map +1 -0
- package/lib/dist/lib/theme.js +36 -0
- package/lib/dist/lib/theme.js.map +1 -0
- package/lib/dist/lib/uiTelemetry.d.ts +7 -0
- package/lib/dist/lib/uiTelemetry.d.ts.map +1 -0
- package/lib/dist/lib/uiTelemetry.js +25 -0
- package/lib/dist/lib/uiTelemetry.js.map +1 -0
- package/lib/dist/lib/utils.d.ts +96 -0
- package/lib/dist/lib/utils.d.ts.map +1 -0
- package/lib/dist/lib/utils.js +232 -0
- package/lib/dist/lib/utils.js.map +1 -0
- package/lib/dist/lib/workflow/consolidate.d.ts +12 -0
- package/lib/dist/lib/workflow/consolidate.d.ts.map +1 -0
- package/lib/dist/lib/workflow/consolidate.js +33 -0
- package/lib/dist/lib/workflow/consolidate.js.map +1 -0
- package/lib/dist/lib/workflow/index.d.ts +13 -0
- package/lib/dist/lib/workflow/index.d.ts.map +1 -0
- package/lib/dist/lib/workflow/index.js +12 -0
- package/lib/dist/lib/workflow/index.js.map +1 -0
- package/lib/dist/lib/workflow/ledger.d.ts +30 -0
- package/lib/dist/lib/workflow/ledger.d.ts.map +1 -0
- package/lib/dist/lib/workflow/ledger.js +41 -0
- package/lib/dist/lib/workflow/ledger.js.map +1 -0
- package/lib/dist/lib/workflow/pool.d.ts +13 -0
- package/lib/dist/lib/workflow/pool.d.ts.map +1 -0
- package/lib/dist/lib/workflow/pool.js +44 -0
- package/lib/dist/lib/workflow/pool.js.map +1 -0
- package/lib/dist/lib/workflow/source.d.ts +22 -0
- package/lib/dist/lib/workflow/source.d.ts.map +1 -0
- package/lib/dist/lib/workflow/source.js +29 -0
- package/lib/dist/lib/workflow/source.js.map +1 -0
- package/lib/dist/lib/workflow/stepB.d.ts +71 -0
- package/lib/dist/lib/workflow/stepB.d.ts.map +1 -0
- package/lib/dist/lib/workflow/stepB.js +99 -0
- package/lib/dist/lib/workflow/stepB.js.map +1 -0
- package/lib/dist/lib/workflow/types.d.ts +86 -0
- package/lib/dist/lib/workflow/types.d.ts.map +1 -0
- package/lib/dist/lib/workflow/types.js +6 -0
- package/lib/dist/lib/workflow/types.js.map +1 -0
- package/lib/dist/lib/workflow/workflow.d.ts +119 -0
- package/lib/dist/lib/workflow/workflow.d.ts.map +1 -0
- package/lib/dist/lib/workflow/workflow.js +195 -0
- package/lib/dist/lib/workflow/workflow.js.map +1 -0
- package/lib/dist/services/agent/aguiConverter.d.ts +50 -0
- package/lib/dist/services/agent/aguiConverter.d.ts.map +1 -0
- package/lib/dist/services/agent/aguiConverter.js +449 -0
- package/lib/dist/services/agent/aguiConverter.js.map +1 -0
- package/lib/dist/services/agent/index.d.ts +10 -0
- package/lib/dist/services/agent/index.d.ts.map +1 -0
- package/lib/dist/services/agent/index.js +12 -0
- package/lib/dist/services/agent/index.js.map +1 -0
- package/lib/dist/services/agent/payloadBuilder.d.ts +33 -0
- package/lib/dist/services/agent/payloadBuilder.d.ts.map +1 -0
- package/lib/dist/services/agent/payloadBuilder.js +75 -0
- package/lib/dist/services/agent/payloadBuilder.js.map +1 -0
- package/lib/dist/services/agent/sseStream.d.ts +43 -0
- package/lib/dist/services/agent/sseStream.d.ts.map +1 -0
- package/lib/dist/services/agent/sseStream.js +223 -0
- package/lib/dist/services/agent/sseStream.js.map +1 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts +44 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js +95 -0
- package/lib/dist/services/connectors/agui/AGUIStreamingConnector.js.map +1 -0
- package/lib/dist/services/connectors/base/BaseConnector.d.ts +81 -0
- package/lib/dist/services/connectors/base/BaseConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/base/BaseConnector.js +170 -0
- package/lib/dist/services/connectors/base/BaseConnector.js.map +1 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts +116 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js +403 -0
- package/lib/dist/services/connectors/claude-code/ClaudeCodeConnector.js.map +1 -0
- package/lib/dist/services/connectors/index.d.ts +13 -0
- package/lib/dist/services/connectors/index.d.ts.map +1 -0
- package/lib/dist/services/connectors/index.js +32 -0
- package/lib/dist/services/connectors/index.js.map +1 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.d.ts +48 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.js +158 -0
- package/lib/dist/services/connectors/kiro/KiroConnector.js.map +1 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts +36 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.js +175 -0
- package/lib/dist/services/connectors/langgraph/LangGraphConnector.js.map +1 -0
- package/lib/dist/services/connectors/mock/MockConnector.d.ts +37 -0
- package/lib/dist/services/connectors/mock/MockConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/mock/MockConnector.js +120 -0
- package/lib/dist/services/connectors/mock/MockConnector.js.map +1 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts +42 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js +133 -0
- package/lib/dist/services/connectors/openai-compatible/OpenAICompatibleConnector.js.map +1 -0
- package/lib/dist/services/connectors/pi/PiConnector.d.ts +87 -0
- package/lib/dist/services/connectors/pi/PiConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/pi/PiConnector.js +274 -0
- package/lib/dist/services/connectors/pi/PiConnector.js.map +1 -0
- package/lib/dist/services/connectors/registry.d.ts +57 -0
- package/lib/dist/services/connectors/registry.d.ts.map +1 -0
- package/lib/dist/services/connectors/registry.js +106 -0
- package/lib/dist/services/connectors/registry.js.map +1 -0
- package/lib/dist/services/connectors/rest/RESTConnector.d.ts +38 -0
- package/lib/dist/services/connectors/rest/RESTConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/rest/RESTConnector.js +117 -0
- package/lib/dist/services/connectors/rest/RESTConnector.js.map +1 -0
- package/lib/dist/services/connectors/server.d.ts +13 -0
- package/lib/dist/services/connectors/server.d.ts.map +1 -0
- package/lib/dist/services/connectors/server.js +34 -0
- package/lib/dist/services/connectors/server.js.map +1 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.d.ts +48 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.js +221 -0
- package/lib/dist/services/connectors/strands/StrandsConnector.js.map +1 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts +88 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.d.ts.map +1 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.js +418 -0
- package/lib/dist/services/connectors/subprocess/SubprocessConnector.js.map +1 -0
- package/lib/dist/services/connectors/types.d.ts +213 -0
- package/lib/dist/services/connectors/types.d.ts.map +1 -0
- package/lib/dist/services/connectors/types.js +6 -0
- package/lib/dist/services/connectors/types.js.map +1 -0
- package/lib/dist/services/evaluation/bedrockJudge.d.ts +64 -0
- package/lib/dist/services/evaluation/bedrockJudge.d.ts.map +1 -0
- package/lib/dist/services/evaluation/bedrockJudge.js +167 -0
- package/lib/dist/services/evaluation/bedrockJudge.js.map +1 -0
- package/lib/dist/services/evaluation/evaluatorError.d.ts +56 -0
- package/lib/dist/services/evaluation/evaluatorError.d.ts.map +1 -0
- package/lib/dist/services/evaluation/evaluatorError.js +56 -0
- package/lib/dist/services/evaluation/evaluatorError.js.map +1 -0
- package/lib/dist/services/evaluation/index.d.ts +106 -0
- package/lib/dist/services/evaluation/index.d.ts.map +1 -0
- package/lib/dist/services/evaluation/index.js +684 -0
- package/lib/dist/services/evaluation/index.js.map +1 -0
- package/lib/dist/services/evaluation/mockTrajectory.d.ts +3 -0
- package/lib/dist/services/evaluation/mockTrajectory.d.ts.map +1 -0
- package/lib/dist/services/evaluation/mockTrajectory.js +72 -0
- package/lib/dist/services/evaluation/mockTrajectory.js.map +1 -0
- package/lib/dist/services/opensearch/client.d.ts +26 -0
- package/lib/dist/services/opensearch/client.d.ts.map +1 -0
- package/lib/dist/services/opensearch/client.js +131 -0
- package/lib/dist/services/opensearch/client.js.map +1 -0
- package/lib/dist/services/opensearch/index.d.ts +16 -0
- package/lib/dist/services/opensearch/index.d.ts.map +1 -0
- package/lib/dist/services/opensearch/index.js +25 -0
- package/lib/dist/services/opensearch/index.js.map +1 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts +123 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.js +429 -0
- package/lib/dist/services/storage/asyncBenchmarkStorage.js.map +1 -0
- package/lib/dist/services/storage/asyncRunStorage.d.ts +127 -0
- package/lib/dist/services/storage/asyncRunStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncRunStorage.js +448 -0
- package/lib/dist/services/storage/asyncRunStorage.js.map +1 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.d.ts +156 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.d.ts.map +1 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.js +285 -0
- package/lib/dist/services/storage/asyncTestCaseStorage.js.map +1 -0
- package/lib/dist/services/storage/index.d.ts +17 -0
- package/lib/dist/services/storage/index.d.ts.map +1 -0
- package/lib/dist/services/storage/index.js +20 -0
- package/lib/dist/services/storage/index.js.map +1 -0
- package/lib/dist/services/storage/migration.d.ts +54 -0
- package/lib/dist/services/storage/migration.d.ts.map +1 -0
- package/lib/dist/services/storage/migration.js +296 -0
- package/lib/dist/services/storage/migration.js.map +1 -0
- package/lib/dist/services/storage/opensearchClient.d.ts +924 -0
- package/lib/dist/services/storage/opensearchClient.d.ts.map +1 -0
- package/lib/dist/services/storage/opensearchClient.js +435 -0
- package/lib/dist/services/storage/opensearchClient.js.map +1 -0
- package/lib/dist/services/traces/browserRecovery.d.ts +26 -0
- package/lib/dist/services/traces/browserRecovery.d.ts.map +1 -0
- package/lib/dist/services/traces/browserRecovery.js +81 -0
- package/lib/dist/services/traces/browserRecovery.js.map +1 -0
- package/lib/dist/services/traces/categoryStyles.d.ts +21 -0
- package/lib/dist/services/traces/categoryStyles.d.ts.map +1 -0
- package/lib/dist/services/traces/categoryStyles.js +56 -0
- package/lib/dist/services/traces/categoryStyles.js.map +1 -0
- package/lib/dist/services/traces/executionOrderTransform.d.ts +35 -0
- package/lib/dist/services/traces/executionOrderTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/executionOrderTransform.js +313 -0
- package/lib/dist/services/traces/executionOrderTransform.js.map +1 -0
- package/lib/dist/services/traces/fetchSpansForRun.d.ts +86 -0
- package/lib/dist/services/traces/fetchSpansForRun.d.ts.map +1 -0
- package/lib/dist/services/traces/fetchSpansForRun.js +69 -0
- package/lib/dist/services/traces/fetchSpansForRun.js.map +1 -0
- package/lib/dist/services/traces/flowTransform.d.ts +24 -0
- package/lib/dist/services/traces/flowTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/flowTransform.js +228 -0
- package/lib/dist/services/traces/flowTransform.js.map +1 -0
- package/lib/dist/services/traces/index.d.ts +121 -0
- package/lib/dist/services/traces/index.d.ts.map +1 -0
- package/lib/dist/services/traces/index.js +255 -0
- package/lib/dist/services/traces/index.js.map +1 -0
- package/lib/dist/services/traces/intentTransform.d.ts +20 -0
- package/lib/dist/services/traces/intentTransform.d.ts.map +1 -0
- package/lib/dist/services/traces/intentTransform.js +131 -0
- package/lib/dist/services/traces/intentTransform.js.map +1 -0
- package/lib/dist/services/traces/judgeAgentsHints.d.ts +63 -0
- package/lib/dist/services/traces/judgeAgentsHints.d.ts.map +1 -0
- package/lib/dist/services/traces/judgeAgentsHints.js +89 -0
- package/lib/dist/services/traces/judgeAgentsHints.js.map +1 -0
- package/lib/dist/services/traces/messageExtraction.d.ts +15 -0
- package/lib/dist/services/traces/messageExtraction.d.ts.map +1 -0
- package/lib/dist/services/traces/messageExtraction.js +251 -0
- package/lib/dist/services/traces/messageExtraction.js.map +1 -0
- package/lib/dist/services/traces/spanCategorization.d.ts +63 -0
- package/lib/dist/services/traces/spanCategorization.d.ts.map +1 -0
- package/lib/dist/services/traces/spanCategorization.js +276 -0
- package/lib/dist/services/traces/spanCategorization.js.map +1 -0
- package/lib/dist/services/traces/spanPreprocessing.d.ts +37 -0
- package/lib/dist/services/traces/spanPreprocessing.d.ts.map +1 -0
- package/lib/dist/services/traces/spanPreprocessing.js +102 -0
- package/lib/dist/services/traces/spanPreprocessing.js.map +1 -0
- package/lib/dist/services/traces/spansToTrajectory.d.ts +36 -0
- package/lib/dist/services/traces/spansToTrajectory.d.ts.map +1 -0
- package/lib/dist/services/traces/spansToTrajectory.js +387 -0
- package/lib/dist/services/traces/spansToTrajectory.js.map +1 -0
- package/lib/dist/services/traces/toolSimilarity.d.ts +35 -0
- package/lib/dist/services/traces/toolSimilarity.d.ts.map +1 -0
- package/lib/dist/services/traces/toolSimilarity.js +203 -0
- package/lib/dist/services/traces/toolSimilarity.js.map +1 -0
- package/lib/dist/services/traces/traceComparison.d.ts +31 -0
- package/lib/dist/services/traces/traceComparison.d.ts.map +1 -0
- package/lib/dist/services/traces/traceComparison.js +318 -0
- package/lib/dist/services/traces/traceComparison.js.map +1 -0
- package/lib/dist/services/traces/traceGrouping.d.ts +19 -0
- package/lib/dist/services/traces/traceGrouping.d.ts.map +1 -0
- package/lib/dist/services/traces/traceGrouping.js +107 -0
- package/lib/dist/services/traces/traceGrouping.js.map +1 -0
- package/lib/dist/services/traces/tracePoller.d.ts +84 -0
- package/lib/dist/services/traces/tracePoller.d.ts.map +1 -0
- package/lib/dist/services/traces/tracePoller.js +309 -0
- package/lib/dist/services/traces/tracePoller.js.map +1 -0
- package/lib/dist/services/traces/traceStats.d.ts +45 -0
- package/lib/dist/services/traces/traceStats.d.ts.map +1 -0
- package/lib/dist/services/traces/traceStats.js +114 -0
- package/lib/dist/services/traces/traceStats.js.map +1 -0
- package/lib/dist/services/traces/traceSummary.d.ts +47 -0
- package/lib/dist/services/traces/traceSummary.d.ts.map +1 -0
- package/lib/dist/services/traces/traceSummary.js +68 -0
- package/lib/dist/services/traces/traceSummary.js.map +1 -0
- package/lib/dist/services/traces/utils.d.ts +33 -0
- package/lib/dist/services/traces/utils.d.ts.map +1 -0
- package/lib/dist/services/traces/utils.js +114 -0
- package/lib/dist/services/traces/utils.js.map +1 -0
- package/lib/dist/types/agui.d.ts +13 -0
- package/lib/dist/types/agui.d.ts.map +1 -0
- package/lib/dist/types/agui.js +16 -0
- package/lib/dist/types/agui.js.map +1 -0
- package/lib/dist/types/index.d.ts +1175 -0
- package/lib/dist/types/index.d.ts.map +1 -0
- package/lib/dist/types/index.js +12 -0
- package/lib/dist/types/index.js.map +1 -0
- package/lib/dist/types/skills.d.ts +146 -0
- package/lib/dist/types/skills.d.ts.map +1 -0
- package/lib/dist/types/skills.js +6 -0
- package/lib/dist/types/skills.js.map +1 -0
- package/observio-sample-agent/pi-package/README.md +112 -0
- package/observio-sample-agent/pi-package/extensions/agent-health.ts +373 -0
- package/observio-sample-agent/pi-package/package.json +17 -0
- package/observio-sample-agent/pi-package/prompts/agent-health.md +37 -0
- package/observio-sample-agent/pi-package/skills/create-pr/SKILL.md +88 -0
- package/observio-sample-agent/pi-package/skills/fix-bug/SKILL.md +71 -0
- package/observio-sample-agent/pi-package/skills/implement-feature/SKILL.md +156 -0
- package/observio-sample-agent/pi-package/skills/instrument-otel/SKILL.md +208 -0
- package/observio-sample-agent/pi-package/skills/setup-collector/SKILL.md +146 -0
- package/observio-sample-agent/pi-package/skills/write-test/SKILL.md +115 -0
- package/package.json +64 -13
- package/server/dist/app.js +32651 -17637
- package/server/dist/index.js +29875 -14638
- package/tsconfig.lib.json +71 -0
- package/dist/assets/index-EvPLSTAS.js +0 -267
- package/dist/assets/index-RXasQKUs.css +0 -1
- package/lib/dist/config/index.js +0 -404
- package/lib/dist/index.js +0 -1665
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# Connector Development Guide
|
|
7
|
+
|
|
8
|
+
This guide explains how to create custom connectors for Agent Health to support different agent protocols.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Connectors are protocol adapters that handle communication with different types of AI agents. Each connector implements a standard interface that converts between Agent Health's internal request/response format and the agent's native protocol.
|
|
13
|
+
|
|
14
|
+
## Built-in Connectors
|
|
15
|
+
|
|
16
|
+
| Type | Protocol | Use Case | Browser-safe |
|
|
17
|
+
|------|----------|----------|:---:|
|
|
18
|
+
| `agui-streaming` | AG-UI SSE | ML-Commons agents (default) | Yes |
|
|
19
|
+
| `rest` | HTTP POST | Non-streaming REST APIs | Yes |
|
|
20
|
+
| `openai-compatible` | OpenAI Chat Completions | LiteLLM, Ollama, vLLM | Yes |
|
|
21
|
+
| `langgraph` | LangGraph REST `/invoke` | Non-AG-UI LangGraph instances | Yes |
|
|
22
|
+
| `strands` | Bedrock Agent Runtime | Amazon Strands agents (requires AWS SDK) | No |
|
|
23
|
+
| `subprocess` | CLI stdin/stdout | Command-line tools | No |
|
|
24
|
+
| `claude-code` | Claude Code CLI | Claude Code agent comparison | No |
|
|
25
|
+
| `kiro` | Kiro CLI | Kiro coding agent (parses `[tool]` stderr markers) | No |
|
|
26
|
+
| `pi` | Pi CLI | Pi coding agent | No |
|
|
27
|
+
| `mock` | In-memory | Demo and testing | Yes |
|
|
28
|
+
|
|
29
|
+
## Creating a Custom Connector
|
|
30
|
+
|
|
31
|
+
### 1. Extend BaseConnector
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { BaseConnector } from '@/services/connectors';
|
|
35
|
+
import type {
|
|
36
|
+
ConnectorAuth,
|
|
37
|
+
ConnectorRequest,
|
|
38
|
+
ConnectorResponse,
|
|
39
|
+
ConnectorProgressCallback,
|
|
40
|
+
ConnectorRawEventCallback,
|
|
41
|
+
} from '@/services/connectors/types';
|
|
42
|
+
import type { TrajectoryStep } from '@/types';
|
|
43
|
+
|
|
44
|
+
export class MyConnector extends BaseConnector {
|
|
45
|
+
// Unique connector type identifier
|
|
46
|
+
readonly type = 'my-connector' as const;
|
|
47
|
+
|
|
48
|
+
// Human-readable name
|
|
49
|
+
readonly name = 'My Custom Connector';
|
|
50
|
+
|
|
51
|
+
// Whether this connector supports streaming progress updates
|
|
52
|
+
readonly supportsStreaming = true;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Build the payload to send to the agent
|
|
56
|
+
*/
|
|
57
|
+
buildPayload(request: ConnectorRequest): any {
|
|
58
|
+
return {
|
|
59
|
+
prompt: request.testCase.initialPrompt,
|
|
60
|
+
context: request.testCase.context,
|
|
61
|
+
model: request.modelId,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Execute the agent request
|
|
67
|
+
*/
|
|
68
|
+
async execute(
|
|
69
|
+
endpoint: string,
|
|
70
|
+
request: ConnectorRequest,
|
|
71
|
+
auth: ConnectorAuth,
|
|
72
|
+
onProgress?: ConnectorProgressCallback,
|
|
73
|
+
onRawEvent?: ConnectorRawEventCallback
|
|
74
|
+
): Promise<ConnectorResponse> {
|
|
75
|
+
const payload = this.buildPayload(request);
|
|
76
|
+
const headers = this.buildAuthHeaders(auth);
|
|
77
|
+
const trajectory: TrajectoryStep[] = [];
|
|
78
|
+
|
|
79
|
+
// Make your API call here
|
|
80
|
+
const response = await fetch(endpoint, {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
headers: {
|
|
83
|
+
'Content-Type': 'application/json',
|
|
84
|
+
...headers,
|
|
85
|
+
},
|
|
86
|
+
body: JSON.stringify(payload),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const data = await response.json();
|
|
90
|
+
onRawEvent?.(data);
|
|
91
|
+
|
|
92
|
+
// Parse the response into trajectory steps
|
|
93
|
+
const steps = this.parseResponse(data);
|
|
94
|
+
steps.forEach(step => {
|
|
95
|
+
trajectory.push(step);
|
|
96
|
+
onProgress?.(step);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
trajectory,
|
|
101
|
+
runId: data.runId || null,
|
|
102
|
+
rawEvents: [data],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parse agent response into trajectory steps
|
|
108
|
+
*/
|
|
109
|
+
parseResponse(data: any): TrajectoryStep[] {
|
|
110
|
+
const steps: TrajectoryStep[] = [];
|
|
111
|
+
|
|
112
|
+
// Add thinking step
|
|
113
|
+
if (data.thinking) {
|
|
114
|
+
steps.push(this.createStep('thinking', data.thinking));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Add tool calls
|
|
118
|
+
if (data.toolCalls) {
|
|
119
|
+
for (const call of data.toolCalls) {
|
|
120
|
+
steps.push(this.createStep('action', `Calling ${call.name}`, {
|
|
121
|
+
toolName: call.name,
|
|
122
|
+
toolArgs: call.args,
|
|
123
|
+
}));
|
|
124
|
+
if (call.result) {
|
|
125
|
+
steps.push(this.createStep('tool_result', call.result, {
|
|
126
|
+
status: 'SUCCESS',
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Add final response
|
|
133
|
+
if (data.response) {
|
|
134
|
+
steps.push(this.createStep('response', data.response));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return steps;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 2. Register the Connector
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import { connectorRegistry } from '@/services/connectors';
|
|
146
|
+
import { MyConnector } from './MyConnector';
|
|
147
|
+
|
|
148
|
+
// Register on module load
|
|
149
|
+
connectorRegistry.register(new MyConnector());
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. Use in Agent Configuration
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// In lib/constants.ts or your config file
|
|
156
|
+
const agent: AgentConfig = {
|
|
157
|
+
key: 'my-agent',
|
|
158
|
+
name: 'My Agent',
|
|
159
|
+
endpoint: 'https://api.example.com/agent',
|
|
160
|
+
connectorType: 'my-connector',
|
|
161
|
+
models: ['claude-sonnet'],
|
|
162
|
+
};
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Connector Interface
|
|
166
|
+
|
|
167
|
+
### Required Properties
|
|
168
|
+
|
|
169
|
+
| Property | Type | Description |
|
|
170
|
+
|----------|------|-------------|
|
|
171
|
+
| `type` | `ConnectorProtocol` | Unique identifier for the connector |
|
|
172
|
+
| `name` | `string` | Human-readable display name |
|
|
173
|
+
| `supportsStreaming` | `boolean` | Whether the connector supports real-time progress |
|
|
174
|
+
|
|
175
|
+
### Required Methods
|
|
176
|
+
|
|
177
|
+
#### `buildPayload(request: ConnectorRequest): any`
|
|
178
|
+
|
|
179
|
+
Transforms the standard request into your agent's expected format.
|
|
180
|
+
|
|
181
|
+
**Parameters:**
|
|
182
|
+
- `request`: Contains `testCase`, `modelId`, `threadId`, `runId`
|
|
183
|
+
|
|
184
|
+
**Returns:** Payload object in your agent's format
|
|
185
|
+
|
|
186
|
+
#### `execute(...): Promise<ConnectorResponse>`
|
|
187
|
+
|
|
188
|
+
Main execution method that calls the agent and processes the response.
|
|
189
|
+
|
|
190
|
+
**Parameters:**
|
|
191
|
+
- `endpoint`: The agent's URL or command
|
|
192
|
+
- `request`: The connector request
|
|
193
|
+
- `auth`: Authentication configuration
|
|
194
|
+
- `onProgress`: Optional callback for streaming updates
|
|
195
|
+
- `onRawEvent`: Optional callback for raw protocol events
|
|
196
|
+
|
|
197
|
+
**Returns:** `ConnectorResponse` with trajectory, runId, and metadata
|
|
198
|
+
|
|
199
|
+
#### `parseResponse(data: any): TrajectoryStep[]`
|
|
200
|
+
|
|
201
|
+
Converts the raw agent response into standardized trajectory steps.
|
|
202
|
+
|
|
203
|
+
### Helper Methods (from BaseConnector)
|
|
204
|
+
|
|
205
|
+
#### `createStep(type, content, options?)`
|
|
206
|
+
|
|
207
|
+
Creates a trajectory step with proper ID and timestamp.
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
const step = this.createStep('action', 'Querying database', {
|
|
211
|
+
toolName: 'sql_query',
|
|
212
|
+
toolArgs: { query: 'SELECT * FROM users' },
|
|
213
|
+
});
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### `buildAuthHeaders(auth: ConnectorAuth)`
|
|
217
|
+
|
|
218
|
+
Builds HTTP headers from authentication configuration.
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
const headers = this.buildAuthHeaders(auth);
|
|
222
|
+
// Returns: { 'Authorization': 'Bearer xxx' } or similar
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### `buildAuthEnv(auth: ConnectorAuth)`
|
|
226
|
+
|
|
227
|
+
Builds environment variables for subprocess connectors.
|
|
228
|
+
|
|
229
|
+
## Authentication Types
|
|
230
|
+
|
|
231
|
+
| Type | Description | Fields |
|
|
232
|
+
|------|-------------|--------|
|
|
233
|
+
| `none` | No authentication | `headers` (passthrough) |
|
|
234
|
+
| `basic` | HTTP Basic Auth | `username`, `password` or `token` |
|
|
235
|
+
| `bearer` | Bearer token | `token` |
|
|
236
|
+
| `api-key` | API key header | `token`, `headerName` |
|
|
237
|
+
| `aws-sigv4` | AWS Signature V4 | `awsRegion`, `awsService`, `awsAccessKeyId`, `awsSecretAccessKey`, `awsSessionToken` |
|
|
238
|
+
|
|
239
|
+
### AWS SigV4 Authentication
|
|
240
|
+
|
|
241
|
+
AWS SigV4 is used in two contexts:
|
|
242
|
+
|
|
243
|
+
1. **OpenSearch cluster connections** (storage and observability) — handled by the `opensearchClientFactory.ts` using `@opensearch-project/opensearch/aws-v3` and the AWS credential provider chain. Configure via environment variables (`OPENSEARCH_STORAGE_AUTH_TYPE=sigv4`) or the Settings UI.
|
|
244
|
+
|
|
245
|
+
2. **Connector-level auth** (agent endpoints) — handled by `BaseConnector.buildAuthHeaders()` and `buildAuthEnv()`. When `auth.type` is `aws-sigv4`, the connector passes AWS credentials as environment variables for subprocess connectors or headers for HTTP connectors.
|
|
246
|
+
|
|
247
|
+
For OpenSearch clusters, SigV4 supports the full AWS credential chain:
|
|
248
|
+
- AWS profile (`awsProfile` / `OPENSEARCH_STORAGE_AWS_PROFILE`)
|
|
249
|
+
- Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`)
|
|
250
|
+
- IAM roles (EC2 instance profile, ECS task role, etc.)
|
|
251
|
+
|
|
252
|
+
Set `awsService` to `es` for managed OpenSearch domains or `aoss` for OpenSearch Serverless collections.
|
|
253
|
+
|
|
254
|
+
## Streaming Support
|
|
255
|
+
|
|
256
|
+
For connectors that support streaming, emit progress updates as they arrive:
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
async execute(endpoint, request, auth, onProgress, onRawEvent) {
|
|
260
|
+
const eventSource = new EventSource(endpoint);
|
|
261
|
+
|
|
262
|
+
eventSource.onmessage = (event) => {
|
|
263
|
+
const data = JSON.parse(event.data);
|
|
264
|
+
onRawEvent?.(data);
|
|
265
|
+
|
|
266
|
+
// Emit progress for each event
|
|
267
|
+
if (data.type === 'thinking') {
|
|
268
|
+
const step = this.createStep('thinking', data.content);
|
|
269
|
+
onProgress?.(step);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// Wait for completion
|
|
274
|
+
return new Promise((resolve) => {
|
|
275
|
+
eventSource.addEventListener('done', () => {
|
|
276
|
+
resolve({ trajectory, runId, rawEvents });
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Browser vs Server Connectors
|
|
283
|
+
|
|
284
|
+
Some connectors require Node.js APIs (like `child_process`) and cannot run in the browser:
|
|
285
|
+
|
|
286
|
+
**Browser-safe connectors** (in `services/connectors/index.ts`):
|
|
287
|
+
- `agui-streaming`
|
|
288
|
+
- `rest`
|
|
289
|
+
- `openai-compatible`
|
|
290
|
+
- `langgraph`
|
|
291
|
+
- `mock`
|
|
292
|
+
|
|
293
|
+
**Server-only connectors** (in `services/connectors/server.ts`):
|
|
294
|
+
- `subprocess`
|
|
295
|
+
- `claude-code`
|
|
296
|
+
- `kiro`
|
|
297
|
+
- `pi`
|
|
298
|
+
- `strands` (requires `@aws-sdk/client-bedrock-agent-runtime`)
|
|
299
|
+
|
|
300
|
+
If your connector needs Node.js APIs, export it from `server.ts` only.
|
|
301
|
+
|
|
302
|
+
## Testing Connectors
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
import { MyConnector } from './MyConnector';
|
|
306
|
+
|
|
307
|
+
describe('MyConnector', () => {
|
|
308
|
+
const connector = new MyConnector();
|
|
309
|
+
|
|
310
|
+
it('should build correct payload', () => {
|
|
311
|
+
const request = {
|
|
312
|
+
testCase: { initialPrompt: 'Test prompt', context: [] },
|
|
313
|
+
modelId: 'test-model',
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const payload = connector.buildPayload(request);
|
|
317
|
+
|
|
318
|
+
expect(payload.prompt).toBe('Test prompt');
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('should parse response into trajectory', () => {
|
|
322
|
+
const data = {
|
|
323
|
+
thinking: 'Analyzing...',
|
|
324
|
+
response: 'The answer is 42',
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const steps = connector.parseResponse(data);
|
|
328
|
+
|
|
329
|
+
expect(steps).toHaveLength(2);
|
|
330
|
+
expect(steps[0].type).toBe('thinking');
|
|
331
|
+
expect(steps[1].type).toBe('response');
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Custom Payload Mapping
|
|
337
|
+
|
|
338
|
+
Some agents require specific payload structures beyond the standard `prompt` + `context` format. For example, agents may need:
|
|
339
|
+
- Custom system prompts
|
|
340
|
+
- Template overrides (planner prompts, reflection prompts)
|
|
341
|
+
- Agent-specific configuration fields
|
|
342
|
+
|
|
343
|
+
### Use Case: Agent with Custom Prompts
|
|
344
|
+
|
|
345
|
+
For an agent like PER (Planner-Executor-Reflector) that expects this payload:
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"parameters": {
|
|
350
|
+
"context": "# Investigation Context...",
|
|
351
|
+
"question": "Why the train ticket website is abnormal...",
|
|
352
|
+
"system_prompt": "# Investigation Planner Agent...",
|
|
353
|
+
"planner_prompt_template": "## AVAILABLE TOOLS...",
|
|
354
|
+
"planner_with_history_template": "...",
|
|
355
|
+
"reflect_prompt_template": "..."
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**Solution:** Create a custom connector that extracts special fields from context items by description:
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
export class PERAgentConnector extends BaseConnector {
|
|
364
|
+
readonly type = 'per-agent' as const;
|
|
365
|
+
readonly name = 'PER Investigation Agent';
|
|
366
|
+
readonly supportsStreaming = false;
|
|
367
|
+
|
|
368
|
+
// Map context item descriptions to payload field names
|
|
369
|
+
private readonly FIELD_MAPPINGS: Record<string, string> = {
|
|
370
|
+
'system_prompt': 'system_prompt',
|
|
371
|
+
'planner_prompt_template': 'planner_prompt_template',
|
|
372
|
+
'planner_with_history_template': 'planner_with_history_template',
|
|
373
|
+
'reflect_prompt_template': 'reflect_prompt_template',
|
|
374
|
+
'context': 'context', // Main investigation context
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
buildPayload(request: ConnectorRequest): any {
|
|
378
|
+
const { testCase } = request;
|
|
379
|
+
const payload: Record<string, any> = {
|
|
380
|
+
parameters: {
|
|
381
|
+
question: testCase.initialPrompt,
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// Extract special fields from context items
|
|
386
|
+
for (const item of testCase.context) {
|
|
387
|
+
const fieldName = this.FIELD_MAPPINGS[item.description];
|
|
388
|
+
if (fieldName) {
|
|
389
|
+
payload.parameters[fieldName] = item.value;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return payload;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async execute(endpoint, request, auth, onProgress, onRawEvent) {
|
|
397
|
+
const payload = this.buildPayload(request);
|
|
398
|
+
const headers = this.buildAuthHeaders(auth);
|
|
399
|
+
|
|
400
|
+
const response = await fetch(endpoint, {
|
|
401
|
+
method: 'POST',
|
|
402
|
+
headers: { 'Content-Type': 'application/json', ...headers },
|
|
403
|
+
body: JSON.stringify(payload),
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
const data = await response.json();
|
|
407
|
+
onRawEvent?.(data);
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
trajectory: this.parseResponse(data),
|
|
411
|
+
runId: data.run_id || null,
|
|
412
|
+
rawEvents: [data],
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
parseResponse(data: any): TrajectoryStep[] {
|
|
417
|
+
// Parse PER agent response format
|
|
418
|
+
const steps: TrajectoryStep[] = [];
|
|
419
|
+
|
|
420
|
+
if (data.response) {
|
|
421
|
+
steps.push(this.createStep('response', data.response));
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return steps;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Setting Up Test Cases for Custom Payloads
|
|
430
|
+
|
|
431
|
+
When creating test cases in the UI, use context items with descriptions matching your field mappings:
|
|
432
|
+
|
|
433
|
+
| Context Description | Mapped To |
|
|
434
|
+
|---------------------|-----------|
|
|
435
|
+
| `system_prompt` | `parameters.system_prompt` |
|
|
436
|
+
| `planner_prompt_template` | `parameters.planner_prompt_template` |
|
|
437
|
+
| `context` | `parameters.context` |
|
|
438
|
+
|
|
439
|
+
**Example Test Case Configuration:**
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"name": "Investigation: Train Ticket Website",
|
|
444
|
+
"initialPrompt": "Why the train ticket website is abnormal?",
|
|
445
|
+
"context": [
|
|
446
|
+
{
|
|
447
|
+
"description": "context",
|
|
448
|
+
"value": "# Investigation Context\n\nService: train-ticket-frontend..."
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"description": "system_prompt",
|
|
452
|
+
"value": "# Investigation Planner Agent\n\nYou are an expert..."
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"description": "planner_prompt_template",
|
|
456
|
+
"value": "## AVAILABLE TOOLS\n{{tools}}\n\n## TASK..."
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
This pattern allows you to pass arbitrary agent-specific fields through the standard test case schema by using context item descriptions as field identifiers.
|
|
463
|
+
|
|
464
|
+
## Trace Correlation
|
|
465
|
+
|
|
466
|
+
So an agent's OpenTelemetry spans join the eval `test_case` trace tree (instead
|
|
467
|
+
of landing as a separate, orphaned trace), `BaseConnector` propagates trace
|
|
468
|
+
context. Configure per-agent via `connectorConfig.traceContext` in
|
|
469
|
+
`agent-health.config.ts`:
|
|
470
|
+
|
|
471
|
+
```typescript
|
|
472
|
+
{
|
|
473
|
+
key: 'my-agent',
|
|
474
|
+
connectorType: 'subprocess',
|
|
475
|
+
connectorConfig: {
|
|
476
|
+
traceContext: {
|
|
477
|
+
propagateEnv: true, // inject TRACEPARENT env (subprocess agents)
|
|
478
|
+
propagateHeader: true, // inject `traceparent` header (HTTP/SSE agents)
|
|
479
|
+
serviceName: 'my-otel-service-name', // service-name + time-window fallback
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
Three layered strategies, applied in priority order:
|
|
486
|
+
|
|
487
|
+
- **Strategy A — W3C trace context.** The eval `test_case` span is active when
|
|
488
|
+
the connector runs; `buildTraceparentEnv()` / `injectTraceparentHeaders()`
|
|
489
|
+
emit a W3C `traceparent` so a compliant agent adopts the eval span as parent
|
|
490
|
+
and shares its `traceId` (single trace tree).
|
|
491
|
+
- **Strategy B — `agent_health.run.id` / `gen_ai.conversation.id`.**
|
|
492
|
+
`SubprocessConnector` exports `AGENT_EVAL_RUN_ID=<runId>`; agents you
|
|
493
|
+
instrument can tag spans with the run id under **either** Agent Health's own
|
|
494
|
+
`agent_health.run.id` **or** the OTEL-standard `gen_ai.conversation.id` for a
|
|
495
|
+
loose link. Agent Health's eval + sample-agent spans stamp both, and the
|
|
496
|
+
correlation queries match either. (The legacy `gen_ai.request.id` is **not** a
|
|
497
|
+
registered attribute and is no longer used.)
|
|
498
|
+
- **Strategy C — service-name + time window (always-on fallback).** Each
|
|
499
|
+
connector declares a default `serviceName` (`claude-code-agent`, `kiro-agent`,
|
|
500
|
+
`pi-agent`, `observio-sample-agent`); the run-report Traces tab unions a
|
|
501
|
+
`serviceName + time-window` clause so closed-source agents still correlate.
|
|
502
|
+
- **Strategy D — `session.id` (precise, real-world adopted).** Agents that emit
|
|
503
|
+
the OTEL `session.id` on every span (e.g. Claude Code) are correlated exactly
|
|
504
|
+
on it. `ClaudeCodeConnector` captures the agent's `session_id`, persists it as
|
|
505
|
+
`report.sessionId`, and the trace query matches `attributes.session.id`
|
|
506
|
+
unioned with C.
|
|
507
|
+
|
|
508
|
+
See the full "Trace correlation conventions" section in
|
|
509
|
+
[AGENTS.md](../AGENTS.md) for the convention map and window-derivation rules.
|
|
510
|
+
|
|
511
|
+
## Examples
|
|
512
|
+
|
|
513
|
+
### Observio Sample Agent
|
|
514
|
+
|
|
515
|
+
The repository includes **Observio**, a reference ReAct agent in `observio-sample-agent/` that uses the `agui-streaming` connector. It's a great way to test connector integration end-to-end. See the [Observio README](../observio-sample-agent/README.md) for setup.
|
|
516
|
+
|
|
517
|
+
### REST API Connector
|
|
518
|
+
|
|
519
|
+
See `services/connectors/rest/RESTConnector.ts` for a complete example of a non-streaming HTTP connector.
|
|
520
|
+
|
|
521
|
+
### Subprocess Connector
|
|
522
|
+
|
|
523
|
+
See `services/connectors/subprocess/SubprocessConnector.ts` for a complete example of a CLI tool connector.
|
|
524
|
+
|
|
525
|
+
### Claude Code Connector
|
|
526
|
+
|
|
527
|
+
See `services/connectors/claude-code/ClaudeCodeConnector.ts` for a complete example extending SubprocessConnector with custom output parsing.
|
|
528
|
+
|
|
529
|
+
### Kiro Connector
|
|
530
|
+
|
|
531
|
+
See `services/connectors/kiro/KiroConnector.ts` for a `SubprocessConnector`
|
|
532
|
+
subclass that overrides `parseStderrChunk()` to convert Kiro's stderr-borne
|
|
533
|
+
`[tool] Running:` / `[tool] status:` markers into structured `action` +
|
|
534
|
+
`tool_result` steps. The base `SubprocessConnector` also persists `stderr` to
|
|
535
|
+
`rawOutput` and honors per-request `connectorConfig` overrides (`args` /
|
|
536
|
+
`inputMode` / `timeout`).
|