@kb-labs/rest-api-app 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.kb/agents/sessions/session-1771531145393-ws3uh6q/turns.json +42 -0
- package/.kb/agents/sessions/session-1771548930486-ui6rtvm/turns.json +33 -0
- package/.kb/agents/sessions/session-1771549691485-nibqroq/turns.json +133 -0
- package/.kb/agents/sessions/session-1771550943182-dkwqdjc/turns.json +130 -0
- package/.kb/agents/sessions/session-1771551564182-cr4bwzn/turns.json +349 -0
- package/.kb/agents/sessions/session-1771552401370-g4ztwd1/turns.json +206 -0
- package/.kb/commit/current/plan.json +248 -0
- package/.kb/commit/current/status.json +472 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js +215 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js +271 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js +230 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js +228 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js +281 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js +266 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js +284 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/flags-WLdpSZl4.d.ts +77 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.d.ts +2 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js +441 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.d.ts +196 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js +441 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.d.ts +19 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js +48 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.d.ts +6 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js +170 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.d.ts +12 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.d.ts +22 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js +43 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.d.ts +26 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js +63 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.d.ts +16 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js +58 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js +50 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.d.ts +7 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js +39 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js +47 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.d.ts +14 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js +53 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js +54 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.d.ts +12 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js +51 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.d.ts +17 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js +133 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js.map +1 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js +46 -0
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js +215 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js +271 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js +230 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js +228 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js +281 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js +266 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js +284 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/flags-WLdpSZl4.d.ts +77 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.d.ts +2 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js +441 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.d.ts +196 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js +441 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.d.ts +19 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js +48 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.d.ts +6 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js +170 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.d.ts +12 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.d.ts +22 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js +52 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js +43 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.d.ts +26 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js +63 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.d.ts +16 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js +58 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.d.ts +9 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js +50 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.d.ts +7 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js +39 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.d.ts +10 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js +46 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js +47 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.d.ts +14 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js +53 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.d.ts +13 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js +54 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.d.ts +12 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js +51 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.d.ts +17 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js +133 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js.map +1 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.d.ts +11 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js +46 -0
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js.map +1 -0
- package/README.md +54 -0
- package/eslint.config.js +23 -0
- package/package.json +72 -0
- package/src/.kb/agents/sessions/session-1773470583796-ximqnfk/kpi-baseline.json +17 -0
- package/src/.kb/memory/sessions/session-1773470583796-ximqnfk/fact-sheet.json +1 -0
- package/src/bootstrap.ts +233 -0
- package/src/diagnostics/header-debug.ts +37 -0
- package/src/events/hub.ts +60 -0
- package/src/events/index.ts +1 -0
- package/src/index.ts +13 -0
- package/src/manifest.ts +21 -0
- package/src/middleware/__tests__/cache.spec.ts +184 -0
- package/src/middleware/__tests__/envelope.spec.ts +268 -0
- package/src/middleware/__tests__/metrics.redis.spec.ts +64 -0
- package/src/middleware/__tests__/rate-limit.spec.ts +283 -0
- package/src/middleware/__tests__/request-id.spec.ts +160 -0
- package/src/middleware/cache.ts +67 -0
- package/src/middleware/envelope.ts +136 -0
- package/src/middleware/error-guard.ts +69 -0
- package/src/middleware/index.ts +37 -0
- package/src/middleware/metrics.ts +810 -0
- package/src/middleware/mock-mode.ts +44 -0
- package/src/middleware/prom-metrics.ts +284 -0
- package/src/middleware/rate-limit-routes.ts +73 -0
- package/src/middleware/rate-limit.ts +72 -0
- package/src/middleware/request-id.ts +41 -0
- package/src/middleware/request-timeout.ts +69 -0
- package/src/middleware/security-headers.ts +24 -0
- package/src/middleware/startup-guard.ts +107 -0
- package/src/observability/service-contract.ts +192 -0
- package/src/plugins/index.ts +118 -0
- package/src/routes/__tests__/adapters-date-helpers.spec.ts +332 -0
- package/src/routes/__tests__/adapters.spec.ts +680 -0
- package/src/routes/__tests__/cache.spec.ts +264 -0
- package/src/routes/__tests__/events.spec.ts +434 -0
- package/src/routes/__tests__/health.spec.ts +414 -0
- package/src/routes/__tests__/logs.spec.ts +494 -0
- package/src/routes/__tests__/observability.spec.ts +392 -0
- package/src/routes/__tests__/plugins.spec.ts +931 -0
- package/src/routes/__tests__/workflow-management.spec.ts +698 -0
- package/src/routes/__tests__/workflows.spec.ts +204 -0
- package/src/routes/adapter-call.ts +220 -0
- package/src/routes/adapters.ts +1206 -0
- package/src/routes/analytics.ts +328 -0
- package/src/routes/cache.ts +104 -0
- package/src/routes/debug-routes.ts +95 -0
- package/src/routes/events.ts +115 -0
- package/src/routes/health.ts +348 -0
- package/src/routes/hello.ts +47 -0
- package/src/routes/index.ts +395 -0
- package/src/routes/jobs.ts +253 -0
- package/src/routes/logs.ts +718 -0
- package/src/routes/metrics.ts +120 -0
- package/src/routes/observability.ts +1388 -0
- package/src/routes/openapi.ts +101 -0
- package/src/routes/platform.ts +143 -0
- package/src/routes/plugins.ts +998 -0
- package/src/routes/readiness.ts +83 -0
- package/src/routes/workflow-management.ts +469 -0
- package/src/routes/workflows.ts +256 -0
- package/src/server.ts +203 -0
- package/src/services/historical-metrics.ts +496 -0
- package/src/services/incident-analyzer.ts +289 -0
- package/src/services/incident-detector.ts +691 -0
- package/src/services/incident-schema.sql +76 -0
- package/src/services/incident-storage.ts +593 -0
- package/src/services/system-metrics-collector.ts +244 -0
- package/src/types/fastify.d.ts +58 -0
- package/src/utils/__tests__/sse-auth.spec.ts +113 -0
- package/src/utils/path-helpers.ts +15 -0
- package/src/utils/repo.ts +42 -0
- package/src/utils/schema.ts +20 -0
- package/src/utils/sse-auth.ts +81 -0
- package/test-sandbox.sh +105 -0
- package/tsconfig.build.json +15 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +18 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi, afterEach } from 'vitest';
|
|
2
|
+
import Fastify from 'fastify';
|
|
3
|
+
|
|
4
|
+
import type { RestApiConfig } from '@kb-labs/rest-api-core';
|
|
5
|
+
import { registerObservabilityRoutes } from '../observability';
|
|
6
|
+
import { exec } from 'node:child_process';
|
|
7
|
+
|
|
8
|
+
// Mock node:child_process
|
|
9
|
+
vi.mock('node:child_process', () => ({
|
|
10
|
+
exec: vi.fn(),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
const BASE_CONFIG: RestApiConfig = {
|
|
14
|
+
port: 3000,
|
|
15
|
+
basePath: '/api/v1',
|
|
16
|
+
apiVersion: 'test',
|
|
17
|
+
cors: {
|
|
18
|
+
origins: [],
|
|
19
|
+
allowCredentials: true,
|
|
20
|
+
profile: 'dev',
|
|
21
|
+
},
|
|
22
|
+
plugins: [],
|
|
23
|
+
mockMode: false,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Mock global fetch
|
|
27
|
+
const mockFetch = vi.fn();
|
|
28
|
+
global.fetch = mockFetch as any;
|
|
29
|
+
|
|
30
|
+
describe('registerObservabilityRoutes', () => {
|
|
31
|
+
let app: ReturnType<typeof Fastify>;
|
|
32
|
+
const repoRoot = '/mock/repo';
|
|
33
|
+
|
|
34
|
+
beforeEach(async () => {
|
|
35
|
+
vi.clearAllMocks();
|
|
36
|
+
app = Fastify({ logger: false });
|
|
37
|
+
await registerObservabilityRoutes(app, BASE_CONFIG, repoRoot);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
afterEach(async () => {
|
|
41
|
+
await app.close();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('GET /api/v1/observability/state-broker', () => {
|
|
45
|
+
it('returns State Broker statistics', async () => {
|
|
46
|
+
const mockStats = {
|
|
47
|
+
totalEntries: 42,
|
|
48
|
+
hitRate: 0.85,
|
|
49
|
+
namespaces: ['mind', 'workflow'],
|
|
50
|
+
uptime: 3600,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
mockFetch.mockResolvedValue({
|
|
54
|
+
ok: true,
|
|
55
|
+
json: vi.fn().mockResolvedValue(mockStats),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const response = await app.inject({
|
|
59
|
+
method: 'GET',
|
|
60
|
+
url: '/api/v1/observability/state-broker',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
expect(response.statusCode).toBe(200);
|
|
64
|
+
const payload = response.json();
|
|
65
|
+
|
|
66
|
+
expect(payload.ok).toBe(true);
|
|
67
|
+
expect(payload.data).toEqual(mockStats);
|
|
68
|
+
expect(payload.meta.source).toBe('state-broker');
|
|
69
|
+
expect(payload.meta.daemonUrl).toBeDefined();
|
|
70
|
+
|
|
71
|
+
expect(mockFetch).toHaveBeenCalledWith(
|
|
72
|
+
expect.stringContaining('/stats'),
|
|
73
|
+
expect.objectContaining({
|
|
74
|
+
signal: expect.any(AbortSignal),
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('uses KB_STATE_DAEMON_URL environment variable', async () => {
|
|
80
|
+
const customUrl = 'http://custom-daemon:8888';
|
|
81
|
+
process.env.KB_STATE_DAEMON_URL = customUrl;
|
|
82
|
+
|
|
83
|
+
mockFetch.mockResolvedValue({
|
|
84
|
+
ok: true,
|
|
85
|
+
json: vi.fn().mockResolvedValue({}),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const response = await app.inject({
|
|
89
|
+
method: 'GET',
|
|
90
|
+
url: '/api/v1/observability/state-broker',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
expect(response.statusCode).toBe(200);
|
|
94
|
+
const payload = response.json();
|
|
95
|
+
expect(payload.meta.daemonUrl).toBe(customUrl);
|
|
96
|
+
|
|
97
|
+
expect(mockFetch).toHaveBeenCalledWith(
|
|
98
|
+
`${customUrl}/stats`,
|
|
99
|
+
expect.anything()
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
delete process.env.KB_STATE_DAEMON_URL;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('falls back to default URL when env var not set', async () => {
|
|
106
|
+
delete process.env.KB_STATE_DAEMON_URL;
|
|
107
|
+
|
|
108
|
+
mockFetch.mockResolvedValue({
|
|
109
|
+
ok: true,
|
|
110
|
+
json: vi.fn().mockResolvedValue({}),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const response = await app.inject({
|
|
114
|
+
method: 'GET',
|
|
115
|
+
url: '/api/v1/observability/state-broker',
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
expect(response.statusCode).toBe(200);
|
|
119
|
+
|
|
120
|
+
expect(mockFetch).toHaveBeenCalledWith(
|
|
121
|
+
'http://localhost:7777/stats',
|
|
122
|
+
expect.anything()
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('returns 503 when State Broker responds with error status', async () => {
|
|
127
|
+
mockFetch.mockResolvedValue({
|
|
128
|
+
ok: false,
|
|
129
|
+
status: 500,
|
|
130
|
+
json: vi.fn(),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const response = await app.inject({
|
|
134
|
+
method: 'GET',
|
|
135
|
+
url: '/api/v1/observability/state-broker',
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
expect(response.statusCode).toBe(503);
|
|
139
|
+
const payload = response.json();
|
|
140
|
+
|
|
141
|
+
expect(payload.ok).toBe(false);
|
|
142
|
+
expect(payload.error.code).toBe('STATE_BROKER_UNAVAILABLE');
|
|
143
|
+
expect(payload.error.message).toContain('not available');
|
|
144
|
+
expect(payload.error.details.status).toBe(500);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('returns 503 when State Broker times out', async () => {
|
|
148
|
+
const abortError = new Error('Timeout');
|
|
149
|
+
abortError.name = 'AbortError';
|
|
150
|
+
|
|
151
|
+
mockFetch.mockRejectedValue(abortError);
|
|
152
|
+
|
|
153
|
+
const response = await app.inject({
|
|
154
|
+
method: 'GET',
|
|
155
|
+
url: '/api/v1/observability/state-broker',
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
expect(response.statusCode).toBe(503);
|
|
159
|
+
const payload = response.json();
|
|
160
|
+
|
|
161
|
+
expect(payload.ok).toBe(false);
|
|
162
|
+
expect(payload.error.code).toBe('STATE_BROKER_TIMEOUT');
|
|
163
|
+
expect(payload.error.message).toContain('did not respond in time');
|
|
164
|
+
expect(payload.error.details.isTimeout).toBe(true);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('returns 503 when State Broker connection fails', async () => {
|
|
168
|
+
mockFetch.mockRejectedValue(new Error('Connection refused'));
|
|
169
|
+
|
|
170
|
+
const response = await app.inject({
|
|
171
|
+
method: 'GET',
|
|
172
|
+
url: '/api/v1/observability/state-broker',
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
expect(response.statusCode).toBe(503);
|
|
176
|
+
const payload = response.json();
|
|
177
|
+
|
|
178
|
+
expect(payload.ok).toBe(false);
|
|
179
|
+
expect(payload.error.code).toBe('STATE_BROKER_ERROR');
|
|
180
|
+
expect(payload.error.message).toBe('Connection refused');
|
|
181
|
+
expect(payload.error.details.isTimeout).toBe(false);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('handles non-Error exceptions', async () => {
|
|
185
|
+
mockFetch.mockRejectedValue('String error');
|
|
186
|
+
|
|
187
|
+
const response = await app.inject({
|
|
188
|
+
method: 'GET',
|
|
189
|
+
url: '/api/v1/observability/state-broker',
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
expect(response.statusCode).toBe(503);
|
|
193
|
+
const payload = response.json();
|
|
194
|
+
|
|
195
|
+
expect(payload.ok).toBe(false);
|
|
196
|
+
expect(payload.error.code).toBe('STATE_BROKER_ERROR');
|
|
197
|
+
expect(payload.error.message).toBe('String error');
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
describe('GET /api/v1/observability/devkit', () => {
|
|
202
|
+
it('returns DevKit health check results', async () => {
|
|
203
|
+
const mockHealth = {
|
|
204
|
+
healthScore: 85,
|
|
205
|
+
grade: 'B',
|
|
206
|
+
issues: {
|
|
207
|
+
critical: 0,
|
|
208
|
+
warning: 5,
|
|
209
|
+
},
|
|
210
|
+
packages: {
|
|
211
|
+
total: 90,
|
|
212
|
+
withIssues: 12,
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const mockExec = vi.mocked(exec);
|
|
217
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
218
|
+
callback(null, {
|
|
219
|
+
stdout: JSON.stringify(mockHealth),
|
|
220
|
+
stderr: '',
|
|
221
|
+
});
|
|
222
|
+
return {} as any;
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
const response = await app.inject({
|
|
226
|
+
method: 'GET',
|
|
227
|
+
url: '/api/v1/observability/devkit',
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
expect(response.statusCode).toBe(200);
|
|
231
|
+
const payload = response.json();
|
|
232
|
+
|
|
233
|
+
expect(payload.ok).toBe(true);
|
|
234
|
+
expect(payload.data).toEqual(mockHealth);
|
|
235
|
+
expect(payload.meta.source).toBe('devkit-cli');
|
|
236
|
+
expect(payload.meta.repoRoot).toBe(repoRoot);
|
|
237
|
+
expect(payload.meta.command).toBe('npx kb-devkit-health --json');
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it('executes DevKit command in repo root', async () => {
|
|
241
|
+
const mockExec = vi.mocked(exec);
|
|
242
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
243
|
+
callback(null, { stdout: '{}', stderr: '' });
|
|
244
|
+
return {} as any;
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
await app.inject({
|
|
248
|
+
method: 'GET',
|
|
249
|
+
url: '/api/v1/observability/devkit',
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
expect(mockExec).toHaveBeenCalledWith(
|
|
253
|
+
'npx kb-devkit-health --json',
|
|
254
|
+
expect.objectContaining({
|
|
255
|
+
cwd: repoRoot,
|
|
256
|
+
timeout: 30000,
|
|
257
|
+
env: expect.objectContaining({
|
|
258
|
+
CI: 'true',
|
|
259
|
+
}),
|
|
260
|
+
}),
|
|
261
|
+
expect.any(Function)
|
|
262
|
+
);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('logs warnings when stderr is present', async () => {
|
|
266
|
+
const mockExec = vi.mocked(exec);
|
|
267
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
268
|
+
callback(null, {
|
|
269
|
+
stdout: '{"healthScore": 70}',
|
|
270
|
+
stderr: 'Warning: deprecated package found',
|
|
271
|
+
});
|
|
272
|
+
return {} as any;
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
const response = await app.inject({
|
|
276
|
+
method: 'GET',
|
|
277
|
+
url: '/api/v1/observability/devkit',
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
expect(response.statusCode).toBe(200);
|
|
281
|
+
const payload = response.json();
|
|
282
|
+
expect(payload.data.healthScore).toBe(70);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it('returns 500 when DevKit command fails', async () => {
|
|
286
|
+
const mockExec = vi.mocked(exec);
|
|
287
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
288
|
+
callback(new Error('Command failed'), { stdout: '', stderr: 'Error output' });
|
|
289
|
+
return {} as any;
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
const response = await app.inject({
|
|
293
|
+
method: 'GET',
|
|
294
|
+
url: '/api/v1/observability/devkit',
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
expect(response.statusCode).toBe(500);
|
|
298
|
+
const payload = response.json();
|
|
299
|
+
|
|
300
|
+
expect(payload.ok).toBe(false);
|
|
301
|
+
expect(payload.error.code).toBe('DEVKIT_ERROR');
|
|
302
|
+
expect(payload.error.message).toContain('Command failed');
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('includes partial data when DevKit fails but outputs JSON', async () => {
|
|
306
|
+
const partialHealth = {
|
|
307
|
+
healthScore: 50,
|
|
308
|
+
grade: 'F',
|
|
309
|
+
issues: { critical: 10 },
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const mockExec = vi.mocked(exec);
|
|
313
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
314
|
+
const error = new Error('Exit code 1') as any;
|
|
315
|
+
error.stdout = JSON.stringify(partialHealth);
|
|
316
|
+
callback(error, { stdout: error.stdout, stderr: '' });
|
|
317
|
+
return {} as any;
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
const response = await app.inject({
|
|
321
|
+
method: 'GET',
|
|
322
|
+
url: '/api/v1/observability/devkit',
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
expect(response.statusCode).toBe(500);
|
|
326
|
+
const payload = response.json();
|
|
327
|
+
|
|
328
|
+
expect(payload.ok).toBe(false);
|
|
329
|
+
expect(payload.error.code).toBe('DEVKIT_ERROR');
|
|
330
|
+
expect(payload.error.details.partialData).toEqual(partialHealth);
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it('handles invalid JSON in partial data gracefully', async () => {
|
|
334
|
+
const mockExec = vi.mocked(exec);
|
|
335
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
336
|
+
const error = new Error('Exit code 1') as any;
|
|
337
|
+
error.stdout = 'invalid json{';
|
|
338
|
+
callback(error, { stdout: error.stdout, stderr: '' });
|
|
339
|
+
return {} as any;
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
const response = await app.inject({
|
|
343
|
+
method: 'GET',
|
|
344
|
+
url: '/api/v1/observability/devkit',
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
expect(response.statusCode).toBe(500);
|
|
348
|
+
const payload = response.json();
|
|
349
|
+
|
|
350
|
+
expect(payload.error.details.partialData).toBeNull();
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('handles DevKit command timeout', async () => {
|
|
354
|
+
const mockExec = vi.mocked(exec);
|
|
355
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
356
|
+
const error = new Error('Command timed out after 30000ms');
|
|
357
|
+
callback(error, { stdout: '', stderr: '' });
|
|
358
|
+
return {} as any;
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
const response = await app.inject({
|
|
362
|
+
method: 'GET',
|
|
363
|
+
url: '/api/v1/observability/devkit',
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
expect(response.statusCode).toBe(500);
|
|
367
|
+
const payload = response.json();
|
|
368
|
+
|
|
369
|
+
expect(payload.ok).toBe(false);
|
|
370
|
+
expect(payload.error.message).toContain('timed out');
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it('handles non-Error exceptions', async () => {
|
|
374
|
+
const mockExec = vi.mocked(exec);
|
|
375
|
+
mockExec.mockImplementation((cmd: any, options: any, callback: any) => {
|
|
376
|
+
callback('String error', { stdout: '', stderr: '' });
|
|
377
|
+
return {} as any;
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
const response = await app.inject({
|
|
381
|
+
method: 'GET',
|
|
382
|
+
url: '/api/v1/observability/devkit',
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
expect(response.statusCode).toBe(500);
|
|
386
|
+
const payload = response.json();
|
|
387
|
+
|
|
388
|
+
expect(payload.error.code).toBe('DEVKIT_ERROR');
|
|
389
|
+
expect(payload.error.message).toBe('Failed to execute DevKit health check');
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
});
|