@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,191 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
# Agent Profiling — improve an agent from its own sessions
|
|
7
|
+
|
|
8
|
+
**Agent profiling** is to an AI agent what a CPU/JVM profiler is to a running
|
|
9
|
+
program: you attach to a *real session*, sample its execution (OpenTelemetry
|
|
10
|
+
traces), and get back a report of where the agent went wrong and what to fix —
|
|
11
|
+
in the agent's **own codebase**. Instead of profiling for performance hotspots,
|
|
12
|
+
it profiles for *behavioral* problems, scored against an evaluator you choose as
|
|
13
|
+
the rubric.
|
|
14
|
+
|
|
15
|
+
No synthetic test cases. The session you just ran is the input, and the
|
|
16
|
+
corrections you made while steering it are part of the signal. Because it reads
|
|
17
|
+
**traces**, not chat logs, it works for non-chat agents too.
|
|
18
|
+
|
|
19
|
+
It reuses the same pluggable `Evaluator` definitions and the same
|
|
20
|
+
`improvementStrategies[]` shape as the batch eval pipeline — it just points them
|
|
21
|
+
at a live session's traces.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Setup (once per project)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Install the agent-profiling hook + skill into Claude Code.
|
|
29
|
+
# - a PreToolUse hook that records the current session id to
|
|
30
|
+
# .claude/agent-health/current-session (deterministic — no mtime guessing)
|
|
31
|
+
# - the /agent-health:profile slash command
|
|
32
|
+
# - the curated customer skills (agent-health-profile, agent-health-assistant,
|
|
33
|
+
# instrument-otel)
|
|
34
|
+
npx @opensearch-project/agent-health setup
|
|
35
|
+
|
|
36
|
+
# 2. Stream Claude Code telemetry into Agent Health's OpenSearch.
|
|
37
|
+
npx @opensearch-project/agent-health setup-telemetry
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`setup` is idempotent — re-running won't duplicate the hook, and won't overwrite
|
|
41
|
+
skill/command files unless you pass `--force`. For **Kiro**, drop
|
|
42
|
+
`docs/skills/AGENT_PROFILE.md` under `.kiro/steering/`; for other tools, tell the
|
|
43
|
+
assistant "read AGENT_PROFILE.md and follow it".
|
|
44
|
+
|
|
45
|
+
### pi (pi.dev)
|
|
46
|
+
|
|
47
|
+
pi has no native telemetry, so a **zero-dependency, single-file extension**
|
|
48
|
+
([examples/pi-profiling/agent-health-profile.ts](../../examples/pi-profiling/agent-health-profile.ts))
|
|
49
|
+
both *instruments* the live pi session (emitting `invoke_agent` / `chat` /
|
|
50
|
+
`execute_tool` spans stamped with `session.id`, service `pi-agent`) and registers
|
|
51
|
+
the profiling command. It speaks OTLP over `fetch` — nothing to `npm install`.
|
|
52
|
+
Full guide: [docs/PI_PROFILING.md](../PI_PROFILING.md).
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 1. Drop the extension in (global = every pi session).
|
|
56
|
+
cp examples/pi-profiling/agent-health-profile.ts ~/.pi/agent/extensions/
|
|
57
|
+
|
|
58
|
+
# 2. Point telemetry at a trace store BEFORE starting pi. Simplest is
|
|
59
|
+
# Agent Health in FILE mode (no OpenSearch) — its embedded receiver persists
|
|
60
|
+
# spans and matches sessions out of the box:
|
|
61
|
+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4001 # /v1/traces is appended
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The extension records the session id to `.pi/agent-health/current-session` on
|
|
65
|
+
`session_start`, so `agent-health profile` resolves it with no guessing and
|
|
66
|
+
defaults `--service` to `pi-agent`. When done, run `/agent-health-profile -e
|
|
67
|
+
<evaluator-id>` from inside pi (or `agent-health profile --service pi-agent
|
|
68
|
+
--output json` from a shell). See [examples/pi-profiling/README.md](../../examples/pi-profiling/README.md)
|
|
69
|
+
for OpenSearch-backed routing notes (export to the cluster's own OTLP ingest;
|
|
70
|
+
the embedded receiver drops payloads when a cluster is configured).
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Use your agent normally and steer it as you like. When the session is done:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# From inside the coding session (slash command):
|
|
80
|
+
/agent-health:profile -e <evaluator-id>
|
|
81
|
+
|
|
82
|
+
# …or directly, optionally with upfront feedback to steer the analysis:
|
|
83
|
+
npx @opensearch-project/agent-health profile -e <evaluator-id> --feedback "focus on routing; it ignored the SOP"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If `-e` is omitted it defaults to `system-rca-default`. `--feedback "<text>"` is
|
|
87
|
+
optional upfront human steering — context the traces can't capture; the reasoner
|
|
88
|
+
weights it above the deterministic signals. List evaluators with
|
|
89
|
+
`agent-health list` (or the `/api/storage/evaluators` API).
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## How it works
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
your session ──OTel spans──▶ Agent Health (OpenSearch)
|
|
97
|
+
│
|
|
98
|
+
agent-health profile -e <id> │ resolves: evaluator rubric (by id)
|
|
99
|
+
▼ samples: this session's spans → trajectory
|
|
100
|
+
{ evaluator, trajectory, signals } + a deterministic signal scan
|
|
101
|
+
│
|
|
102
|
+
the coding agent adds: the live chat + the codebase it's sitting in
|
|
103
|
+
▼
|
|
104
|
+
prioritized edits → applied on a branch → you review
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`profile` supplies only the half the agent can't see — the **traces** and the
|
|
108
|
+
**rubric**. The agent already has the conversation and the code, so it does the
|
|
109
|
+
reasoning and the edits. (For a headless context the JSON profile can be fed to
|
|
110
|
+
any reasoner.)
|
|
111
|
+
|
|
112
|
+
### What the profile contains (`--output json`)
|
|
113
|
+
|
|
114
|
+
```jsonc
|
|
115
|
+
{
|
|
116
|
+
"session": { "sessionId", "serviceName", "traceIds", "spanCount", "trajectorySteps", "durationMs", "tokens" },
|
|
117
|
+
"evaluator": { "id", "name", "systemPrompt", "metrics", "passThreshold" },
|
|
118
|
+
"signals": [ { "id", "title", "severity", "count", "evidence" } ],
|
|
119
|
+
"userFeedback": "<your --feedback text, if given>",
|
|
120
|
+
"trajectory":[ /* TrajectoryStep[] reconstructed from spans */ ],
|
|
121
|
+
"instructions": "Using the rubric + feedback, review trajectory + signals + chat + codebase; propose edits…"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
It is also written to `.agent-health/data/profiles/<sessionId>/profile.json`.
|
|
126
|
+
|
|
127
|
+
### Signals scanned (deterministic, pre-LLM)
|
|
128
|
+
|
|
129
|
+
| id | meaning |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `user_rejection` | you rejected/aborted a tool the agent proposed (Claude Code permission denial — always available, no prompt logging needed) |
|
|
132
|
+
| `user_redirect` | you corrected/redirected the agent mid-session (requires `OTEL_LOG_USER_PROMPTS=1`) |
|
|
133
|
+
| `tool_error_retry` | a tool failed, then was retried — tool-usage / description gap |
|
|
134
|
+
| `repeated_tool_calls` | identical tool+args invoked more than once — loop / distrust |
|
|
135
|
+
| `long_session` | unusually many interactions — confusion or scope creep |
|
|
136
|
+
| `write_before_read` | mutated state before reading — safety / grounding gap |
|
|
137
|
+
|
|
138
|
+
Signals are evidence handed to the rubric, not the verdict — the evaluator's
|
|
139
|
+
`systemPrompt` decides what to improve. The adapter reads real Claude Code
|
|
140
|
+
telemetry (attribute-based `claude_code.*` spans) and falls back to generic OTel
|
|
141
|
+
GenAI event-based spans for other agents.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Session identification
|
|
146
|
+
|
|
147
|
+
`profile` resolves the session id in priority order:
|
|
148
|
+
1. `--session <id>` if you pass it,
|
|
149
|
+
2. `.pi/agent-health/current-session` (written by the pi `agent-health-profile`
|
|
150
|
+
extension on `session_start` — exact),
|
|
151
|
+
3. `.claude/agent-health/current-session` (written by the Claude setup hook — exact),
|
|
152
|
+
4. newest Claude Code transcript for this cwd (heuristic fallback).
|
|
153
|
+
|
|
154
|
+
Every Claude Code span carries `session.id`, and the pi extension stamps the
|
|
155
|
+
same `session.id` on the spans it emits, so once resolved the fetch is exact
|
|
156
|
+
(`fetchTracesBySessionId`). When the session is resolved from the pi marker,
|
|
157
|
+
`--service` defaults to `pi-agent`.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## The loop
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
profile → read findings → fix on a branch → merge → next session → re-profile
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Run it after any session, or on a schedule (cron) over production sessions to
|
|
168
|
+
get a continuous improvement signal at production distribution.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Guardrails
|
|
173
|
+
|
|
174
|
+
- `profile` is read-only — it never edits code; it produces the profile + a plan.
|
|
175
|
+
- Apply edits on a **branch**, never the working tree, and keep them minimal and
|
|
176
|
+
generalizable.
|
|
177
|
+
- The rubric is the customer's evaluator, so improvements track *their*
|
|
178
|
+
definition of good.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Prerequisites
|
|
183
|
+
|
|
184
|
+
`profile` reads traces from, and the judge scores against, the same backend the
|
|
185
|
+
rest of Agent Health uses:
|
|
186
|
+
- **OpenSearch** for traces (`OPENSEARCH_LOGS_*` or `agent-health.config.json`
|
|
187
|
+
→ `observability`) — the *same* cluster your telemetry is exported to.
|
|
188
|
+
- **AWS Bedrock** credentials for the LLM judge (`AWS_PROFILE` / `AWS_REGION`).
|
|
189
|
+
|
|
190
|
+
Verify with `agent-health doctor`. Litmus test: if your session shows up in the
|
|
191
|
+
**Traces** tab, `profile` will find it.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-connector
|
|
3
|
+
description: Use when adding, modifying, or debugging agent connectors. Provides connector architecture, built-in types, and custom connector template.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Connector System (`services/connectors/`)
|
|
7
|
+
|
|
8
|
+
Pluggable abstraction for agent communication protocols.
|
|
9
|
+
|
|
10
|
+
### Key Files
|
|
11
|
+
- `types.ts`: `AgentConnector`, `ConnectorRequest`, `ConnectorResponse` interfaces
|
|
12
|
+
- `registry.ts`: Singleton `connectorRegistry` — `get()`, `getForAgent()`
|
|
13
|
+
- `base/BaseConnector.ts`: Abstract base with auth header building
|
|
14
|
+
- `index.ts`: Browser-safe exports (no Node.js deps)
|
|
15
|
+
- `server.ts`: All connectors including Node.js-only (subprocess, claude-code)
|
|
16
|
+
|
|
17
|
+
### Built-in Connectors
|
|
18
|
+
|
|
19
|
+
| Connector | Protocol | Use Case |
|
|
20
|
+
|-----------|----------|----------|
|
|
21
|
+
| `agui-streaming` | AG-UI SSE | ML-Commons agents (default) |
|
|
22
|
+
| `rest` | HTTP POST | Non-streaming REST APIs |
|
|
23
|
+
| `openai-compatible` | OpenAI Chat Completions | LiteLLM, Ollama, vLLM |
|
|
24
|
+
| `langgraph` | LangGraph REST `/invoke` | Non-AG-UI LangGraph instances |
|
|
25
|
+
| `strands` | Bedrock Agent Runtime | Amazon Strands agents (server-only) |
|
|
26
|
+
| `subprocess` | CLI stdin/stdout | Generic command-line tools |
|
|
27
|
+
| `claude-code` | Claude CLI | Claude Code agent (extends `subprocess`) |
|
|
28
|
+
| `kiro` | Kiro CLI | Kiro coding agent (extends `subprocess`; parses `[tool]` stderr markers) |
|
|
29
|
+
| `pi` | Pi CLI | Pi coding agent (extends `subprocess`) |
|
|
30
|
+
| `mock` | In-memory | Demo and testing |
|
|
31
|
+
|
|
32
|
+
### Usage
|
|
33
|
+
```typescript
|
|
34
|
+
import { connectorRegistry } from '@/services/connectors';
|
|
35
|
+
const connector = connectorRegistry.getForAgent(agentConfig);
|
|
36
|
+
const response = await connector.execute(endpoint, request, auth, onProgress);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Creating a Custom Connector
|
|
40
|
+
```typescript
|
|
41
|
+
import { BaseConnector } from '@/services/connectors';
|
|
42
|
+
|
|
43
|
+
class CustomConnector extends BaseConnector {
|
|
44
|
+
readonly type = 'custom' as const;
|
|
45
|
+
readonly name = 'My Custom Agent';
|
|
46
|
+
readonly supportsStreaming = true;
|
|
47
|
+
|
|
48
|
+
async execute(endpoint, request, auth, onProgress) {
|
|
49
|
+
// Your protocol implementation
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
connectorRegistry.register(new CustomConnector());
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Trace correlation & subprocess hooks
|
|
57
|
+
|
|
58
|
+
- **Trace context propagation** is handled by `BaseConnector` — set
|
|
59
|
+
`connectorConfig.traceContext` so the agent's spans join the eval `test_case`
|
|
60
|
+
trace tree:
|
|
61
|
+
- `propagateEnv: true` → inject `TRACEPARENT` env into subprocess agents (`buildTraceparentEnv()`).
|
|
62
|
+
- `propagateHeader: true` → inject a `traceparent` HTTP header into HTTP/SSE agents (`injectTraceparentHeaders()`).
|
|
63
|
+
- `serviceName: '<otel-service-name>'` → service-name + time-window fallback. Defaults: `claude-code-agent`, `kiro-agent`, `pi-agent`, `observio-sample-agent`. See the "Trace correlation conventions" section in `AGENTS.md`.
|
|
64
|
+
- **Subprocess connectors** (`SubprocessConnector` subclasses) can override
|
|
65
|
+
`parseStderrChunk(chunk)` to turn stderr markers into trajectory steps (how
|
|
66
|
+
`kiro` surfaces `[tool] Running:` / `[tool] status:` as `action` +
|
|
67
|
+
`tool_result` steps). The base class persists `stderr` to `rawOutput` and
|
|
68
|
+
honors per-request `connectorConfig` overrides (`args` / `inputMode` / `timeout`).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-health-profile
|
|
3
|
+
description: Use when the user wants to profile or improve the agent/codebase based on the current session. Profiles this session's traces against a chosen evaluator and proposes concrete edits.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Health — Profile this session
|
|
7
|
+
|
|
8
|
+
When the user asks to profile/improve the agent (or runs `/agent-health:profile`):
|
|
9
|
+
|
|
10
|
+
1. Determine the evaluator id (the rubric). If the user gave one (e.g. `-e my-eval`),
|
|
11
|
+
use it; otherwise default to `system-rca-default`. You can list options with
|
|
12
|
+
`agent-health list` if needed.
|
|
13
|
+
|
|
14
|
+
1b. **Ask the user for any upfront feedback** on the session before profiling
|
|
15
|
+
(e.g. "anything you want me to focus on — a wrong decision, a skipped step?").
|
|
16
|
+
If they give some, pass it via `--feedback "..."`; it becomes the primary lens
|
|
17
|
+
over the deterministic signals. Skip if they have nothing to add.
|
|
18
|
+
|
|
19
|
+
2. Run:
|
|
20
|
+
```bash
|
|
21
|
+
__AH_CLI__ profile -e <evaluator-id> [--feedback "<their feedback>"] --output json
|
|
22
|
+
```
|
|
23
|
+
It auto-detects the current session id (from `.claude/agent-health/current-session`,
|
|
24
|
+
written by the setup hook) and prints a JSON profile: the evaluator rubric,
|
|
25
|
+
the session trajectory (reconstructed from traces), deterministic signals, and
|
|
26
|
+
your `userFeedback`.
|
|
27
|
+
|
|
28
|
+
3. Using `evaluator.systemPrompt` as the rubric, review together:
|
|
29
|
+
- the `userFeedback` (weight it highest, if present),
|
|
30
|
+
- the `trajectory` and `signals` from the JSON profile,
|
|
31
|
+
- THIS conversation (including any corrections the user made while steering you),
|
|
32
|
+
- the codebase in the current working directory.
|
|
33
|
+
|
|
34
|
+
4. Produce a prioritized list of concrete edits. For each: the file, the change,
|
|
35
|
+
why (tie it to a signal or a rubric criterion), a priority, and **cite the
|
|
36
|
+
evidence** — the signal that triggered it and the session's `traceIds`
|
|
37
|
+
(open them in the Traces tab to verify).
|
|
38
|
+
|
|
39
|
+
5. Apply the edits on a new branch (never the working tree directly), then
|
|
40
|
+
summarize the diff for the user to review.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: config-auth
|
|
3
|
+
description: Use when working on config loading, authentication, AWS profiles, or data source resolution. Explains the two config systems (TS vs JSON), auth priority, and multi-profile setup.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Config & Auth Architecture
|
|
7
|
+
|
|
8
|
+
Agent Health uses **two separate config systems** for different purposes. Understanding when each applies prevents auth confusion when users have multiple AWS profiles.
|
|
9
|
+
|
|
10
|
+
### Two Config Systems
|
|
11
|
+
|
|
12
|
+
| System | File | Format | Purpose | Managed By |
|
|
13
|
+
|--------|------|--------|---------|------------|
|
|
14
|
+
| **Agent/Model Config** | `agent-health.config.ts` | TS/JS/MJS | Agents, models, connectors, hooks, judge | User edits manually |
|
|
15
|
+
| **Data Source Config** | `agent-health.config.json` | JSON only | OpenSearch credentials (storage + observability) | CLI `setup-telemetry` / Settings UI |
|
|
16
|
+
|
|
17
|
+
**Priority for TS/JS config loading** (`lib/config/loader.ts`):
|
|
18
|
+
1. `agent-health.config.ts` (highest)
|
|
19
|
+
2. `agent-health.config.js`
|
|
20
|
+
3. `agent-health.config.mjs`
|
|
21
|
+
4. Built-in defaults — **only merged when `extends: false` is NOT set**; setting `extends: false` in your config disables default merging entirely
|
|
22
|
+
|
|
23
|
+
**Why two systems?**
|
|
24
|
+
- TS config can contain executable code (hooks, dynamic values, custom connectors)
|
|
25
|
+
- JSON config stores credentials that the server persists and the Settings UI manages
|
|
26
|
+
- **Browser never sees JSON credentials** — the server only exposes metadata (endpoint, authType, hasPassword) to the browser; all authenticated requests are proxied server-side
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### Auth Resolution Per Service
|
|
31
|
+
|
|
32
|
+
#### OpenSearch (Storage & Observability)
|
|
33
|
+
|
|
34
|
+
**Resolution order** (`server/middleware/dataSourceConfig.ts`):
|
|
35
|
+
1. **`agent-health.config.json`** (file) — highest priority
|
|
36
|
+
2. **Environment variables** (`OPENSEARCH_STORAGE_*` / `OPENSEARCH_LOGS_*`) — fallback
|
|
37
|
+
3. **null** — features degrade gracefully
|
|
38
|
+
|
|
39
|
+
**JSON config structure:**
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"storage": {
|
|
43
|
+
"endpoint": "https://search-....es.amazonaws.com",
|
|
44
|
+
"authType": "sigv4",
|
|
45
|
+
"awsProfile": "default",
|
|
46
|
+
"awsRegion": "us-west-2",
|
|
47
|
+
"awsService": "es"
|
|
48
|
+
},
|
|
49
|
+
"observability": {
|
|
50
|
+
"endpoint": "https://search-....es.amazonaws.com",
|
|
51
|
+
"authType": "sigv4",
|
|
52
|
+
"awsProfile": "default",
|
|
53
|
+
"awsRegion": "us-west-2",
|
|
54
|
+
"awsService": "es",
|
|
55
|
+
"tracesIndex": "otel-v1-apm-span-*"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Observability config** is where Agent Health reads OTel traces from. This is configured by:
|
|
61
|
+
1. `npx @opensearch-project/agent-health setup-telemetry` (writes to JSON automatically)
|
|
62
|
+
2. Manual edit of `agent-health.config.json` (add `observability` block with endpoint + auth)
|
|
63
|
+
|
|
64
|
+
The `tracesIndex` field defaults to `otel-v1-apm-span-*` if omitted. See `/instrument-otel` skill for the full instrumentation flow.
|
|
65
|
+
|
|
66
|
+
**Auth types** (`server/services/opensearchClientFactory.ts`):
|
|
67
|
+
|
|
68
|
+
| authType | Fields needed | How it works |
|
|
69
|
+
|----------|--------------|--------------|
|
|
70
|
+
| `none` | endpoint only | No auth headers |
|
|
71
|
+
| `basic` | endpoint, username, password | HTTP Basic Auth |
|
|
72
|
+
| `sigv4` | endpoint, awsRegion, awsService, awsProfile (optional) | AWS SigV4 credential chain |
|
|
73
|
+
|
|
74
|
+
**SigV4 credential resolution:**
|
|
75
|
+
```typescript
|
|
76
|
+
// If awsProfile specified → use that profile
|
|
77
|
+
// If omitted → use default AWS credential chain
|
|
78
|
+
const provider = fromNodeProviderChain({
|
|
79
|
+
...(config.awsProfile && { profile: config.awsProfile })
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Bedrock Judge (LLM Evaluation)
|
|
84
|
+
|
|
85
|
+
**Resolution** (`server/services/bedrockService.ts`):
|
|
86
|
+
- Uses AWS SDK **default credential chain** — picks up whatever `AWS_PROFILE` is set in the server's environment
|
|
87
|
+
- Region: `process.env.AWS_REGION || 'us-west-2'`
|
|
88
|
+
- Model: `process.env.BEDROCK_MODEL_ID || 'us.anthropic.claude-sonnet-4-5-20250929-v1:0'`
|
|
89
|
+
- No explicit `awsProfile` field — relies on environment
|
|
90
|
+
|
|
91
|
+
#### Claude Code Agent (Subprocess)
|
|
92
|
+
|
|
93
|
+
**Resolution** (`agent-health.config.ts` → agent `connectorConfig.env`):
|
|
94
|
+
```typescript
|
|
95
|
+
{
|
|
96
|
+
key: "claude-code",
|
|
97
|
+
connectorConfig: {
|
|
98
|
+
env: {
|
|
99
|
+
CLAUDE_CODE_USE_BEDROCK: "1",
|
|
100
|
+
AWS_PROFILE: "Bedrock", // ← explicit profile for Claude subprocess
|
|
101
|
+
AWS_REGION: "us-west-2",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
These env vars are set **inside the spawned Claude Code process** — isolated from the server's own credentials.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Multi-Profile Setup Pattern
|
|
111
|
+
|
|
112
|
+
A user with separate profiles for separate concerns:
|
|
113
|
+
|
|
114
|
+
| Purpose | AWS Profile | Account | Used By |
|
|
115
|
+
|---------|-------------|---------|---------|
|
|
116
|
+
| OpenSearch reads | `default` | 651304888251 | Server → `agent-health.config.json` (awsProfile: "default") |
|
|
117
|
+
| Bedrock judge | `Bedrock` | 070785328308 | Server env: `AWS_PROFILE=Bedrock` |
|
|
118
|
+
| Claude Code agent | `Bedrock` | 070785328308 | TS config: `connectorConfig.env.AWS_PROFILE` |
|
|
119
|
+
| Telemetry sending | (none needed) | — | API Gateway is public (no SigV4 on client) |
|
|
120
|
+
|
|
121
|
+
**Problem:** The server process can only have ONE `AWS_PROFILE` env var. If Bedrock judge needs profile "Bedrock" but OpenSearch needs profile "default", you must:
|
|
122
|
+
|
|
123
|
+
1. Set `AWS_PROFILE=Bedrock` for the server (judge uses default chain)
|
|
124
|
+
2. Set `"awsProfile": "default"` in `agent-health.config.json` for OpenSearch (explicit override via `fromNodeProviderChain({ profile })`)
|
|
125
|
+
|
|
126
|
+
This works because OpenSearch SigV4 uses **explicit profile from config**, while Bedrock uses **ambient credentials from environment**.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Key Files
|
|
131
|
+
|
|
132
|
+
| File | Purpose |
|
|
133
|
+
|------|---------|
|
|
134
|
+
| `lib/config/loader.ts` | Load + merge TS/JS config with defaults |
|
|
135
|
+
| `lib/config/types.ts` | `AgentHealthConfig`, `UserAgentConfig`, `UserModelConfig` |
|
|
136
|
+
| `server/middleware/dataSourceConfig.ts` | Resolve OpenSearch config (file → env → null) |
|
|
137
|
+
| `server/services/configService.ts` | Read/write `agent-health.config.json` |
|
|
138
|
+
| `server/services/opensearchClientFactory.ts` | Build OpenSearch client with correct auth |
|
|
139
|
+
| `server/services/bedrockService.ts` | Bedrock client init (uses ambient AWS creds) |
|
|
140
|
+
| `server/config/index.ts` | Server environment variable defaults |
|
|
141
|
+
| `agent-health.config.example.ts` | Reference TS config |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Environment Variables Reference
|
|
146
|
+
|
|
147
|
+
**OpenSearch Storage (fallback when not in JSON):**
|
|
148
|
+
```bash
|
|
149
|
+
OPENSEARCH_STORAGE_ENDPOINT=https://...
|
|
150
|
+
OPENSEARCH_STORAGE_AUTH_TYPE=sigv4|basic|none
|
|
151
|
+
OPENSEARCH_STORAGE_USERNAME=admin
|
|
152
|
+
OPENSEARCH_STORAGE_PASSWORD=secret
|
|
153
|
+
OPENSEARCH_STORAGE_AWS_REGION=us-west-2
|
|
154
|
+
OPENSEARCH_STORAGE_AWS_PROFILE=default
|
|
155
|
+
OPENSEARCH_STORAGE_AWS_SERVICE=es|aoss
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**OpenSearch Observability (fallback when not in JSON):**
|
|
159
|
+
```bash
|
|
160
|
+
OPENSEARCH_LOGS_ENDPOINT=https://...
|
|
161
|
+
OPENSEARCH_LOGS_AUTH_TYPE=sigv4|basic|none
|
|
162
|
+
OPENSEARCH_LOGS_AWS_REGION=us-west-2
|
|
163
|
+
OPENSEARCH_LOGS_AWS_PROFILE=default
|
|
164
|
+
OPENSEARCH_LOGS_AWS_SERVICE=es|aoss
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Bedrock Judge:**
|
|
168
|
+
```bash
|
|
169
|
+
AWS_PROFILE=Bedrock # Profile with Bedrock access
|
|
170
|
+
AWS_REGION=us-west-2 # Bedrock region
|
|
171
|
+
BEDROCK_MODEL_ID=us.anthropic.claude-sonnet-4-5-20250929-v1:0
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Telemetry (Client-side, in shell RC):**
|
|
175
|
+
```bash
|
|
176
|
+
CLAUDE_CODE_ENABLE_TELEMETRY=1
|
|
177
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=https://<api-gw>.execute-api.<region>.amazonaws.com
|
|
178
|
+
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
|
179
|
+
OTEL_TRACES_EXPORTER=otlp
|
|
180
|
+
OTEL_LOGS_EXPORTER=otlp
|
|
181
|
+
OTEL_METRICS_EXPORTER=otlp
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### Design Principles
|
|
187
|
+
|
|
188
|
+
1. **JSON for credentials, TS for behavior** — never put secrets in TS config (it's committed to git)
|
|
189
|
+
2. **Explicit profile wins** — `awsProfile` in JSON config overrides ambient `AWS_PROFILE`
|
|
190
|
+
3. **Each service resolves independently** — OpenSearch can use profile A while Bedrock uses profile B
|
|
191
|
+
4. **Degrade gracefully** — missing config means features are unavailable, not errors
|
|
192
|
+
5. **Browser never sees secrets** — the server proxies all authenticated requests; the browser only receives safe metadata (endpoint URL, authType, hasPassword boolean), never raw credentials
|
|
193
|
+
6. **`setup-telemetry` writes JSON** — it's the only automated way to populate credentials
|
|
194
|
+
7. **`extends: false` opts out of defaults** — without this flag, built-in defaults are always merged into your config; with it, you take full control of every value
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "config-auth",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Where does Agent Health store OpenSearch credentials and what file format does it use?",
|
|
7
|
+
"expected_output": "A clear explanation that OpenSearch credentials are stored in agent-health.config.json (JSON format, not TypeScript), managed by the CLI setup-telemetry command or Settings UI, and distinct from the agent-health.config.ts file which handles agents/models/hooks.",
|
|
8
|
+
"assertions": [
|
|
9
|
+
"Response identifies agent-health.config.json as the file storing OpenSearch credentials, not agent-health.config.ts",
|
|
10
|
+
"Response explains that agent-health.config.json is managed by the CLI `setup-telemetry` command or the Settings UI, not manually edited like the TS config",
|
|
11
|
+
"Response mentions that the browser never sees the JSON credentials — only metadata like endpoint, authType, and hasPassword"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": 2,
|
|
16
|
+
"prompt": "I have two AWS profiles: 'default' for my OpenSearch cluster and 'Bedrock' for the LLM judge. How do I configure Agent Health so each service uses the right profile? The server can only have one AWS_PROFILE set.",
|
|
17
|
+
"expected_output": "A concrete multi-profile setup: set AWS_PROFILE=Bedrock in the server environment (so the Bedrock judge uses its default credential chain), and set awsProfile: 'default' inside the storage block of agent-health.config.json (so OpenSearch SigV4 explicitly overrides the ambient profile). Explains why this works — OpenSearch uses fromNodeProviderChain with an explicit profile override while Bedrock uses ambient credentials.",
|
|
18
|
+
"assertions": [
|
|
19
|
+
"Response instructs setting AWS_PROFILE=Bedrock as the server environment variable so the Bedrock judge picks it up via default credential chain",
|
|
20
|
+
"Response instructs setting `awsProfile: 'default'` inside agent-health.config.json under the storage block to override the ambient AWS_PROFILE for OpenSearch SigV4 auth",
|
|
21
|
+
"Response explains that OpenSearch uses fromNodeProviderChain with an explicit profile parameter (from the JSON config) while Bedrock relies on the ambient environment — this is why the two services can use different profiles simultaneously"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": 3,
|
|
26
|
+
"prompt": "My agent config TypeScript file isn't being picked up. I have agent-health.config.mjs but Agent Health seems to be using defaults. What's the config loading priority and which file takes precedence?",
|
|
27
|
+
"expected_output": "Explanation of the four-level priority order for TS/JS config loading from lib/config/loader.ts: agent-health.config.ts (highest) → agent-health.config.js → agent-health.config.mjs → built-in defaults. Since .mjs is third priority, if a .ts or .js file exists it would shadow the .mjs file. Also notes that built-in defaults are only applied if `extends: false` is NOT set.",
|
|
28
|
+
"assertions": [
|
|
29
|
+
"Response states the exact priority order: agent-health.config.ts > agent-health.config.js > agent-health.config.mjs > built-in defaults, identifying .mjs as third priority",
|
|
30
|
+
"Response identifies lib/config/loader.ts as the file responsible for this loading priority logic",
|
|
31
|
+
"Response mentions that built-in defaults are only merged in when `extends: false` is NOT present in the config, meaning setting extends: false disables default merging"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-pr
|
|
3
|
+
description: Prepare and create a pull request against the upstream repository with all OpenSearch project compliance checks.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[branch-name]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## PR Workflow for opensearch-project/agent-health
|
|
9
|
+
|
|
10
|
+
**IMPORTANT:** PRs are created from your personal fork, NOT from branches on `opensearch-project/agent-health` directly. Push to your fork remote (e.g., `fork` or your GitHub username), then open a PR targeting `opensearch-project/agent-health:main`.
|
|
11
|
+
|
|
12
|
+
**MANDATORY:** Every commit MUST have DCO (Developer Certificate of Origin) signoff. Always use `git commit -s`. CI will reject commits without signoff. Never use `--no-verify` to bypass this.
|
|
13
|
+
|
|
14
|
+
### 1. Fetch latest and create branch
|
|
15
|
+
```bash
|
|
16
|
+
git fetch origin main
|
|
17
|
+
git checkout -b <branch-name> origin/main
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Cherry-pick commits (if from a dev branch)
|
|
21
|
+
```bash
|
|
22
|
+
git cherry-pick <oldest-commit>^..<newest-commit>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 3. Verify DCO sign-off on ALL commits
|
|
26
|
+
```bash
|
|
27
|
+
git log --format="%h %s" origin/main..HEAD
|
|
28
|
+
git log origin/main..HEAD | grep -c "Signed-off-by"
|
|
29
|
+
# If missing: git rebase origin/main --signoff
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 4. Add changelog entry (REQUIRED — CI will fail without this)
|
|
33
|
+
Update `CHANGELOG.md` under `## [Unreleased]` with appropriate category (`Added`, `Changed`, `Fixed`, `Removed`, `Security`). Include PR link:
|
|
34
|
+
```markdown
|
|
35
|
+
### Added
|
|
36
|
+
- Description of change ([#PR](https://github.com/opensearch-project/agent-health/pull/PR))
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 5. Run pre-PR checks (ALL must pass)
|
|
40
|
+
```bash
|
|
41
|
+
npm run build:all && npm run test:all
|
|
42
|
+
npm audit --audit-level=high
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 6. Pre-PR Checklist
|
|
46
|
+
- [ ] All commits have DCO signoff
|
|
47
|
+
- [ ] `CHANGELOG.md` updated under `## [Unreleased]` with PR link
|
|
48
|
+
- [ ] `npm run build:all` succeeds
|
|
49
|
+
- [ ] `npm run test:all` passes (unit + integration + e2e)
|
|
50
|
+
- [ ] `npm audit --audit-level=high` reports no vulnerabilities
|
|
51
|
+
- [ ] New source files have SPDX license headers
|
|
52
|
+
- [ ] No secrets committed (`.env`, credentials, tokens)
|
|
53
|
+
|
|
54
|
+
### 7. Push to your fork and create PR
|
|
55
|
+
```bash
|
|
56
|
+
# Push to your personal fork (NOT opensearch-project directly)
|
|
57
|
+
git push -u fork <branch-name>
|
|
58
|
+
# Create PR targeting the upstream repo
|
|
59
|
+
gh pr create --repo opensearch-project/agent-health --base main
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### License Headers (for new files)
|
|
63
|
+
```typescript
|
|
64
|
+
// .ts, .tsx, .js, .jsx, .cjs, .mjs, .css:
|
|
65
|
+
/*
|
|
66
|
+
* Copyright OpenSearch Contributors
|
|
67
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
68
|
+
*/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### DCO Signoff
|
|
72
|
+
All commits need `-s` flag: `git commit -s -m "message"`
|
|
73
|
+
Signoff: `Signed-off-by: Megha Goyal <goyamegh@amazon.com>`
|