@kb-labs/rest-api-app 1.3.0 → 1.4.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/dist/index.d.ts +2 -0
- package/dist/index.js +8151 -0
- package/dist/index.js.map +1 -0
- package/package.json +7 -4
- package/.kb/agents/sessions/session-1771531145393-ws3uh6q/turns.json +0 -42
- package/.kb/agents/sessions/session-1771548930486-ui6rtvm/turns.json +0 -33
- package/.kb/agents/sessions/session-1771549691485-nibqroq/turns.json +0 -133
- package/.kb/agents/sessions/session-1771550943182-dkwqdjc/turns.json +0 -130
- package/.kb/agents/sessions/session-1771551564182-cr4bwzn/turns.json +0 -349
- package/.kb/agents/sessions/session-1771552401370-g4ztwd1/turns.json +0 -206
- package/.kb/commit/current/plan.json +0 -248
- package/.kb/commit/current/status.json +0 -472
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js +0 -215
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js +0 -271
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js +0 -230
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js +0 -228
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js +0 -281
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js +0 -266
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js +0 -284
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/flags-WLdpSZl4.d.ts +0 -77
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.d.ts +0 -2
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js +0 -441
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.d.ts +0 -196
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js +0 -441
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.d.ts +0 -19
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js +0 -48
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.d.ts +0 -6
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js +0 -170
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.d.ts +0 -12
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.d.ts +0 -22
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js +0 -43
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.d.ts +0 -26
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js +0 -63
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.d.ts +0 -16
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js +0 -58
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js +0 -50
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.d.ts +0 -7
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js +0 -39
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js +0 -47
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.d.ts +0 -14
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js +0 -53
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js +0 -54
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.d.ts +0 -12
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js +0 -51
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.d.ts +0 -17
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js +0 -133
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js.map +0 -1
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js +0 -46
- package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js +0 -215
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js +0 -271
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js +0 -230
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js +0 -228
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js +0 -281
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js +0 -266
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js +0 -284
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/flags-WLdpSZl4.d.ts +0 -77
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.d.ts +0 -2
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js +0 -441
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.d.ts +0 -196
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js +0 -441
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.d.ts +0 -19
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js +0 -48
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.d.ts +0 -6
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js +0 -170
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.d.ts +0 -12
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.d.ts +0 -22
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js +0 -52
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js +0 -43
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.d.ts +0 -26
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js +0 -63
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.d.ts +0 -16
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js +0 -58
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.d.ts +0 -9
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js +0 -50
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.d.ts +0 -7
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js +0 -39
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.d.ts +0 -10
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js +0 -46
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js +0 -47
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.d.ts +0 -14
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js +0 -53
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.d.ts +0 -13
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js +0 -54
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.d.ts +0 -12
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js +0 -51
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.d.ts +0 -17
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js +0 -133
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js.map +0 -1
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.d.ts +0 -11
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js +0 -46
- package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js.map +0 -1
- package/eslint.config.js +0 -23
- package/src/.kb/agents/sessions/session-1773470583796-ximqnfk/kpi-baseline.json +0 -17
- package/src/.kb/memory/sessions/session-1773470583796-ximqnfk/fact-sheet.json +0 -1
- package/src/bootstrap.ts +0 -233
- package/src/diagnostics/header-debug.ts +0 -37
- package/src/events/hub.ts +0 -60
- package/src/events/index.ts +0 -1
- package/src/index.ts +0 -13
- package/src/manifest.ts +0 -21
- package/src/middleware/__tests__/cache.spec.ts +0 -184
- package/src/middleware/__tests__/envelope.spec.ts +0 -268
- package/src/middleware/__tests__/metrics.redis.spec.ts +0 -64
- package/src/middleware/__tests__/rate-limit.spec.ts +0 -283
- package/src/middleware/__tests__/request-id.spec.ts +0 -160
- package/src/middleware/cache.ts +0 -67
- package/src/middleware/envelope.ts +0 -136
- package/src/middleware/error-guard.ts +0 -69
- package/src/middleware/index.ts +0 -37
- package/src/middleware/metrics.ts +0 -810
- package/src/middleware/mock-mode.ts +0 -44
- package/src/middleware/prom-metrics.ts +0 -284
- package/src/middleware/rate-limit-routes.ts +0 -73
- package/src/middleware/rate-limit.ts +0 -72
- package/src/middleware/request-id.ts +0 -41
- package/src/middleware/request-timeout.ts +0 -69
- package/src/middleware/security-headers.ts +0 -24
- package/src/middleware/startup-guard.ts +0 -107
- package/src/observability/service-contract.ts +0 -192
- package/src/plugins/index.ts +0 -118
- package/src/routes/__tests__/adapters-date-helpers.spec.ts +0 -332
- package/src/routes/__tests__/adapters.spec.ts +0 -680
- package/src/routes/__tests__/cache.spec.ts +0 -264
- package/src/routes/__tests__/events.spec.ts +0 -434
- package/src/routes/__tests__/health.spec.ts +0 -414
- package/src/routes/__tests__/logs.spec.ts +0 -494
- package/src/routes/__tests__/observability.spec.ts +0 -392
- package/src/routes/__tests__/plugins.spec.ts +0 -931
- package/src/routes/__tests__/workflow-management.spec.ts +0 -698
- package/src/routes/__tests__/workflows.spec.ts +0 -204
- package/src/routes/adapter-call.ts +0 -220
- package/src/routes/adapters.ts +0 -1206
- package/src/routes/analytics.ts +0 -328
- package/src/routes/cache.ts +0 -104
- package/src/routes/debug-routes.ts +0 -95
- package/src/routes/events.ts +0 -115
- package/src/routes/health.ts +0 -348
- package/src/routes/hello.ts +0 -47
- package/src/routes/index.ts +0 -395
- package/src/routes/jobs.ts +0 -253
- package/src/routes/logs.ts +0 -718
- package/src/routes/metrics.ts +0 -120
- package/src/routes/observability.ts +0 -1388
- package/src/routes/openapi.ts +0 -101
- package/src/routes/platform.ts +0 -143
- package/src/routes/plugins.ts +0 -998
- package/src/routes/readiness.ts +0 -83
- package/src/routes/workflow-management.ts +0 -469
- package/src/routes/workflows.ts +0 -256
- package/src/server.ts +0 -203
- package/src/services/historical-metrics.ts +0 -496
- package/src/services/incident-analyzer.ts +0 -289
- package/src/services/incident-detector.ts +0 -691
- package/src/services/incident-schema.sql +0 -76
- package/src/services/incident-storage.ts +0 -593
- package/src/services/system-metrics-collector.ts +0 -244
- package/src/types/fastify.d.ts +0 -58
- package/src/utils/__tests__/sse-auth.spec.ts +0 -113
- package/src/utils/path-helpers.ts +0 -15
- package/src/utils/repo.ts +0 -42
- package/src/utils/schema.ts +0 -20
- package/src/utils/sse-auth.ts +0 -81
- package/test-sandbox.sh +0 -105
- package/tsconfig.build.json +0 -15
- package/tsconfig.json +0 -9
- package/tsup.config.ts +0 -18
package/src/routes/health.ts
DELETED
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/rest-api-app/routes/health
|
|
3
|
-
* Health check and diagnostics endpoints
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { FastifyInstance } from 'fastify';
|
|
7
|
-
import type { RestApiConfig } from '@kb-labs/rest-api-core';
|
|
8
|
-
import type { IEntityRegistry, SystemHealthSnapshot } from '@kb-labs/core-registry';
|
|
9
|
-
import { normalizeBasePath, resolvePaths } from '../utils/path-helpers';
|
|
10
|
-
import type { ReadinessState } from './readiness';
|
|
11
|
-
import { isReady, resolveReadinessReason } from './readiness';
|
|
12
|
-
import type { PluginsMetricsSnapshot } from '../middleware/metrics.js';
|
|
13
|
-
import { metricsCollector } from '../middleware/metrics.js';
|
|
14
|
-
import { updateServiceHealthStatus } from '../middleware/prom-metrics.js';
|
|
15
|
-
import {
|
|
16
|
-
buildRestObservabilityDescribe,
|
|
17
|
-
buildRestObservabilityHealth,
|
|
18
|
-
} from '../observability/service-contract.js';
|
|
19
|
-
|
|
20
|
-
// Version is injected at build time by tsup define
|
|
21
|
-
declare const __REST_API_VERSION__: string;
|
|
22
|
-
const REST_VERSION = typeof __REST_API_VERSION__ !== 'undefined' ? __REST_API_VERSION__ : '0.0.0';
|
|
23
|
-
|
|
24
|
-
const CACHE_WINDOW_MS = 200;
|
|
25
|
-
const READY_SCHEMA = 'kb.ready/1';
|
|
26
|
-
|
|
27
|
-
interface CachedSnapshot {
|
|
28
|
-
base: SystemHealthSnapshot;
|
|
29
|
-
expiresAt: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let cachedBaseSnapshot: CachedSnapshot | null = null;
|
|
33
|
-
let inFlightBaseSnapshot: Promise<SystemHealthSnapshot> | null = null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Register health and readiness routes
|
|
37
|
-
*/
|
|
38
|
-
export async function registerHealthRoutes(
|
|
39
|
-
fastify: FastifyInstance,
|
|
40
|
-
config: RestApiConfig,
|
|
41
|
-
_repoRoot: string,
|
|
42
|
-
registry: IEntityRegistry,
|
|
43
|
-
readiness: ReadinessState
|
|
44
|
-
): Promise<void> {
|
|
45
|
-
const basePath = normalizeBasePath(config.basePath);
|
|
46
|
-
const healthPaths = resolvePaths(basePath, '/health');
|
|
47
|
-
const readyPaths = resolvePaths(basePath, '/ready');
|
|
48
|
-
const observabilityDescribePaths = resolvePaths(basePath, '/observability/describe');
|
|
49
|
-
const observabilityHealthPaths = resolvePaths(basePath, '/observability/health');
|
|
50
|
-
|
|
51
|
-
for (const path of healthPaths) {
|
|
52
|
-
fastify.get(path, async (_request, reply) => {
|
|
53
|
-
const eventHub = fastify.kbEventHub;
|
|
54
|
-
try {
|
|
55
|
-
const baseSnapshot = await getBaseSnapshot(registry);
|
|
56
|
-
const { registryLoaded, registryPartial, registryStale } = evaluateRegistryState(registry);
|
|
57
|
-
readiness.registryLoaded = registryLoaded;
|
|
58
|
-
readiness.registryPartial = registryPartial;
|
|
59
|
-
readiness.registryStale = registryStale;
|
|
60
|
-
const ready = isReady(readiness);
|
|
61
|
-
const reason = resolveReadinessReason(readiness);
|
|
62
|
-
const pluginsMetrics = metricsCollector.getLastPluginMountSnapshot();
|
|
63
|
-
const response = augmentSnapshot(baseSnapshot, readiness, pluginsMetrics);
|
|
64
|
-
updateServiceHealthStatus(
|
|
65
|
-
response.status === 'healthy' ? 'healthy' : response.status === 'degraded' ? 'degraded' : 'unhealthy',
|
|
66
|
-
);
|
|
67
|
-
eventHub?.publish({
|
|
68
|
-
type: 'health',
|
|
69
|
-
status: response.status,
|
|
70
|
-
ts: response.ts,
|
|
71
|
-
ready,
|
|
72
|
-
reason,
|
|
73
|
-
registryPartial: readiness.registryPartial,
|
|
74
|
-
registryStale: readiness.registryStale,
|
|
75
|
-
registryLoaded: readiness.registryLoaded,
|
|
76
|
-
});
|
|
77
|
-
return reply.send(response);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
const fallback = buildFallbackSnapshot(error, readiness);
|
|
80
|
-
updateServiceHealthStatus('degraded');
|
|
81
|
-
const ready = isReady(readiness);
|
|
82
|
-
const reason = resolveReadinessReason(readiness);
|
|
83
|
-
eventHub?.publish({
|
|
84
|
-
type: 'health',
|
|
85
|
-
status: fallback.status,
|
|
86
|
-
ts: fallback.ts,
|
|
87
|
-
ready,
|
|
88
|
-
reason,
|
|
89
|
-
registryPartial: readiness.registryPartial,
|
|
90
|
-
registryStale: readiness.registryStale,
|
|
91
|
-
registryLoaded: readiness.registryLoaded,
|
|
92
|
-
});
|
|
93
|
-
return reply.send(fallback);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
for (const path of readyPaths) {
|
|
99
|
-
fastify.get(path, async (_request, reply) => {
|
|
100
|
-
const eventHub = fastify.kbEventHub;
|
|
101
|
-
const { registryLoaded, registryPartial, registryStale } = evaluateRegistryState(registry);
|
|
102
|
-
readiness.registryLoaded = registryLoaded;
|
|
103
|
-
readiness.registryPartial = registryPartial;
|
|
104
|
-
readiness.registryStale = registryStale;
|
|
105
|
-
|
|
106
|
-
const response = buildReadinessResponse(readiness);
|
|
107
|
-
const statusCode = response.ready ? 200 : 503;
|
|
108
|
-
updateServiceHealthStatus(response.ready ? 'healthy' : 'degraded');
|
|
109
|
-
|
|
110
|
-
eventHub?.publish({
|
|
111
|
-
type: 'health',
|
|
112
|
-
status: response.ready ? 'healthy' : 'degraded',
|
|
113
|
-
ts: new Date().toISOString(),
|
|
114
|
-
ready: response.ready,
|
|
115
|
-
reason: response.reason,
|
|
116
|
-
registryPartial: readiness.registryPartial,
|
|
117
|
-
registryStale: readiness.registryStale,
|
|
118
|
-
registryLoaded: readiness.registryLoaded,
|
|
119
|
-
pluginMountInProgress: readiness.pluginMountInProgress,
|
|
120
|
-
pluginRoutesMounted: readiness.pluginRoutesMounted,
|
|
121
|
-
lastPluginMountTs: readiness.lastPluginMountTs,
|
|
122
|
-
pluginRoutesLastDurationMs: readiness.pluginRoutesLastDurationMs,
|
|
123
|
-
pluginsMounted: metricsCollector.getLastPluginMountSnapshot()?.succeeded ?? 0,
|
|
124
|
-
pluginsFailed: metricsCollector.getLastPluginMountSnapshot()?.failed ?? 0,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
return reply.code(statusCode).send(response);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
for (const path of observabilityDescribePaths) {
|
|
132
|
-
fastify.get(path, async () => buildRestObservabilityDescribe(basePath));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
for (const path of observabilityHealthPaths) {
|
|
136
|
-
fastify.get(path, async () => {
|
|
137
|
-
try {
|
|
138
|
-
const baseSnapshot = await getBaseSnapshot(registry);
|
|
139
|
-
const pluginsMetrics = metricsCollector.getLastPluginMountSnapshot();
|
|
140
|
-
const augmented = augmentSnapshot(baseSnapshot, readiness, pluginsMetrics);
|
|
141
|
-
updateServiceHealthStatus(
|
|
142
|
-
augmented.status === 'healthy' ? 'healthy' : augmented.status === 'degraded' ? 'degraded' : 'unhealthy',
|
|
143
|
-
);
|
|
144
|
-
return buildRestObservabilityHealth(basePath, augmented, readiness, metricsCollector.getMetrics());
|
|
145
|
-
} catch (error) {
|
|
146
|
-
const fallback = buildFallbackSnapshot(error, readiness);
|
|
147
|
-
updateServiceHealthStatus('degraded');
|
|
148
|
-
return buildRestObservabilityHealth(basePath, fallback, readiness, metricsCollector.getMetrics());
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
async function getBaseSnapshot(registry: IEntityRegistry): Promise<SystemHealthSnapshot> {
|
|
155
|
-
const now = Date.now();
|
|
156
|
-
if (cachedBaseSnapshot && now < cachedBaseSnapshot.expiresAt) {
|
|
157
|
-
return cachedBaseSnapshot.base;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (inFlightBaseSnapshot) {
|
|
161
|
-
return inFlightBaseSnapshot;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
inFlightBaseSnapshot = registry
|
|
165
|
-
.getSystemHealth({
|
|
166
|
-
uptimeSec: process.uptime(),
|
|
167
|
-
version: { rest: REST_VERSION },
|
|
168
|
-
})
|
|
169
|
-
.then(snapshot => {
|
|
170
|
-
cachedBaseSnapshot = {
|
|
171
|
-
base: snapshot,
|
|
172
|
-
expiresAt: Date.now() + CACHE_WINDOW_MS,
|
|
173
|
-
};
|
|
174
|
-
inFlightBaseSnapshot = null;
|
|
175
|
-
return snapshot;
|
|
176
|
-
})
|
|
177
|
-
.catch(error => {
|
|
178
|
-
inFlightBaseSnapshot = null;
|
|
179
|
-
throw error;
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
return inFlightBaseSnapshot;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function augmentSnapshot(
|
|
186
|
-
base: SystemHealthSnapshot,
|
|
187
|
-
readiness: ReadinessState,
|
|
188
|
-
pluginsMetrics?: PluginsMetricsSnapshot | null
|
|
189
|
-
): SystemHealthSnapshot {
|
|
190
|
-
const snapshot = cloneSnapshot(base);
|
|
191
|
-
const failures = new Map(readiness.pluginRouteFailures.map(f => [f.id, f.error]));
|
|
192
|
-
|
|
193
|
-
const components = snapshot.components.map(component => {
|
|
194
|
-
const failure = failures.get(component.id);
|
|
195
|
-
return failure
|
|
196
|
-
? {
|
|
197
|
-
...component,
|
|
198
|
-
lastError: failure,
|
|
199
|
-
}
|
|
200
|
-
: component;
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
const readinessMeta = {
|
|
204
|
-
pluginRoutesMounted: readiness.pluginRoutesMounted,
|
|
205
|
-
pluginMountInProgress: readiness.pluginMountInProgress,
|
|
206
|
-
pluginRoutesCount: readiness.pluginRoutesCount,
|
|
207
|
-
pluginRouteErrors: readiness.pluginRouteErrors,
|
|
208
|
-
pluginRouteFailures: readiness.pluginRouteFailures,
|
|
209
|
-
registryPartial: readiness.registryPartial,
|
|
210
|
-
registryStale: readiness.registryStale,
|
|
211
|
-
pluginMounts: pluginsMetrics ?? null,
|
|
212
|
-
lastPluginMountTs: readiness.lastPluginMountTs ?? null,
|
|
213
|
-
pluginRoutesLastDurationMs: readiness.pluginRoutesLastDurationMs ?? null,
|
|
214
|
-
redisEnabled: readiness.redisEnabled,
|
|
215
|
-
redisConnected: readiness.redisConnected,
|
|
216
|
-
redisStates: readiness.redisStates,
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
const meta: Record<string, unknown> = {
|
|
220
|
-
source: 'rest',
|
|
221
|
-
...(snapshot.meta || {}),
|
|
222
|
-
readiness: readinessMeta,
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
if (readiness.pluginRouteFailures.length > 0) {
|
|
226
|
-
meta.readinessFailures = readiness.pluginRouteFailures;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const hasReadinessErrors = readiness.pluginRouteErrors > 0 || readiness.pluginRouteFailures.length > 0;
|
|
230
|
-
|
|
231
|
-
return {
|
|
232
|
-
...snapshot,
|
|
233
|
-
status: hasReadinessErrors ? 'degraded' : snapshot.status,
|
|
234
|
-
components,
|
|
235
|
-
meta,
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function buildFallbackSnapshot(
|
|
240
|
-
error: unknown,
|
|
241
|
-
readiness: ReadinessState
|
|
242
|
-
): SystemHealthSnapshot {
|
|
243
|
-
const message = sanitizeError(error);
|
|
244
|
-
const now = new Date();
|
|
245
|
-
|
|
246
|
-
const snapshot: SystemHealthSnapshot = {
|
|
247
|
-
schema: 'kb.health/1',
|
|
248
|
-
ts: now.toISOString(),
|
|
249
|
-
uptimeSec: Math.max(0, Math.floor(process.uptime())),
|
|
250
|
-
version: {
|
|
251
|
-
kbLabs: process.env.KB_LABS_VERSION || process.env.KB_VERSION || 'unknown',
|
|
252
|
-
rest: REST_VERSION,
|
|
253
|
-
},
|
|
254
|
-
registry: {
|
|
255
|
-
total: 0,
|
|
256
|
-
withRest: 0,
|
|
257
|
-
withStudio: 0,
|
|
258
|
-
errors: 1,
|
|
259
|
-
generatedAt: new Date(0).toISOString(),
|
|
260
|
-
expiresAt: undefined,
|
|
261
|
-
partial: true,
|
|
262
|
-
stale: true,
|
|
263
|
-
},
|
|
264
|
-
status: 'degraded',
|
|
265
|
-
components: [],
|
|
266
|
-
meta: {
|
|
267
|
-
source: 'rest',
|
|
268
|
-
error: message,
|
|
269
|
-
},
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
return augmentSnapshot(snapshot, readiness, metricsCollector.getLastPluginMountSnapshot());
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
function cloneSnapshot(base: SystemHealthSnapshot): SystemHealthSnapshot {
|
|
276
|
-
return {
|
|
277
|
-
schema: base.schema,
|
|
278
|
-
ts: base.ts,
|
|
279
|
-
uptimeSec: base.uptimeSec,
|
|
280
|
-
version: { ...base.version },
|
|
281
|
-
registry: { ...base.registry },
|
|
282
|
-
status: base.status,
|
|
283
|
-
components: base.components.map(component => ({ ...component })),
|
|
284
|
-
...(base.meta ? { meta: { ...base.meta } } : {}),
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function sanitizeError(error: unknown): string {
|
|
289
|
-
if (!error) {
|
|
290
|
-
return 'unknown_error';
|
|
291
|
-
}
|
|
292
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
293
|
-
const firstLine = message.trim().split('\n')[0] ?? message.trim();
|
|
294
|
-
return firstLine.length > 160 ? `${firstLine.slice(0, 157)}...` : firstLine;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function evaluateRegistryState(registry: IEntityRegistry): {
|
|
298
|
-
registryLoaded: boolean;
|
|
299
|
-
registryPartial: boolean;
|
|
300
|
-
registryStale: boolean;
|
|
301
|
-
} {
|
|
302
|
-
const snapshot = registry.snapshot();
|
|
303
|
-
return {
|
|
304
|
-
registryLoaded: snapshot.plugins.length > 0 && !snapshot.partial && !snapshot.stale,
|
|
305
|
-
registryPartial: snapshot.partial,
|
|
306
|
-
registryStale: snapshot.stale,
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function buildReadinessResponse(readiness: ReadinessState) {
|
|
311
|
-
const ready = isReady(readiness);
|
|
312
|
-
const pluginIssues =
|
|
313
|
-
readiness.pluginRouteErrors > 0 || readiness.pluginRouteFailures.length > 0;
|
|
314
|
-
const status = ready ? (pluginIssues ? 'degraded' : 'ready') : 'initializing';
|
|
315
|
-
const reason = ready ? 'ready' : resolveReadinessReason(readiness);
|
|
316
|
-
|
|
317
|
-
return {
|
|
318
|
-
schema: READY_SCHEMA,
|
|
319
|
-
ts: new Date().toISOString(),
|
|
320
|
-
ready,
|
|
321
|
-
status,
|
|
322
|
-
reason,
|
|
323
|
-
components: {
|
|
324
|
-
cliApi: {
|
|
325
|
-
initialized: readiness.cliApiInitialized,
|
|
326
|
-
},
|
|
327
|
-
registry: {
|
|
328
|
-
loaded: readiness.registryLoaded,
|
|
329
|
-
partial: readiness.registryPartial,
|
|
330
|
-
stale: readiness.registryStale,
|
|
331
|
-
},
|
|
332
|
-
plugins: {
|
|
333
|
-
mounted: readiness.pluginRoutesMounted,
|
|
334
|
-
inProgress: readiness.pluginMountInProgress,
|
|
335
|
-
routeCount: readiness.pluginRoutesCount,
|
|
336
|
-
errors: readiness.pluginRouteErrors,
|
|
337
|
-
failures: readiness.pluginRouteFailures,
|
|
338
|
-
lastCompletedAt: readiness.lastPluginMountTs ?? null,
|
|
339
|
-
lastDurationMs: readiness.pluginRoutesLastDurationMs ?? null,
|
|
340
|
-
},
|
|
341
|
-
redis: {
|
|
342
|
-
enabled: readiness.redisEnabled,
|
|
343
|
-
healthy: readiness.redisConnected,
|
|
344
|
-
states: readiness.redisStates,
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
}
|
package/src/routes/hello.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/rest-api-app/routes/hello
|
|
3
|
-
* Hello service endpoint — simple liveness / greeting check
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { FastifyInstance } from 'fastify';
|
|
7
|
-
import type { RestApiConfig } from '@kb-labs/rest-api-core';
|
|
8
|
-
import type { HelloResponse } from '@kb-labs/rest-api-contracts';
|
|
9
|
-
import { normalizeBasePath } from '../utils/path-helpers';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Register hello routes
|
|
13
|
-
*
|
|
14
|
-
* GET /api/v1/hello
|
|
15
|
-
* Returns a greeting message together with the current server timestamp.
|
|
16
|
-
* Useful as a lightweight smoke-test that the REST API is reachable.
|
|
17
|
-
*/
|
|
18
|
-
export async function registerHelloRoutes(
|
|
19
|
-
fastify: FastifyInstance,
|
|
20
|
-
config: RestApiConfig
|
|
21
|
-
): Promise<void> {
|
|
22
|
-
const basePath = normalizeBasePath(config.basePath);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* GET /hello
|
|
26
|
-
* Returns { schema, message, ts } wrapped in a SuccessEnvelope.
|
|
27
|
-
*/
|
|
28
|
-
fastify.get(`${basePath}/hello`, async (request, reply) => {
|
|
29
|
-
const start = Date.now();
|
|
30
|
-
|
|
31
|
-
const response: HelloResponse = {
|
|
32
|
-
ok: true,
|
|
33
|
-
data: {
|
|
34
|
-
schema: 'kb.hello/1',
|
|
35
|
-
message: 'Hello from KB Labs REST API!',
|
|
36
|
-
ts: new Date().toISOString(),
|
|
37
|
-
},
|
|
38
|
-
meta: {
|
|
39
|
-
requestId: request.id as string,
|
|
40
|
-
durationMs: Date.now() - start,
|
|
41
|
-
apiVersion: '1.0.0',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return reply.code(200).send(response);
|
|
46
|
-
});
|
|
47
|
-
}
|