@kb-labs/rest-api-app 1.3.0 → 1.5.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.
Files changed (257) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +8151 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +23 -20
  5. package/.kb/agents/sessions/session-1771531145393-ws3uh6q/turns.json +0 -42
  6. package/.kb/agents/sessions/session-1771548930486-ui6rtvm/turns.json +0 -33
  7. package/.kb/agents/sessions/session-1771549691485-nibqroq/turns.json +0 -133
  8. package/.kb/agents/sessions/session-1771550943182-dkwqdjc/turns.json +0 -130
  9. package/.kb/agents/sessions/session-1771551564182-cr4bwzn/turns.json +0 -349
  10. package/.kb/agents/sessions/session-1771552401370-g4ztwd1/turns.json +0 -206
  11. package/.kb/commit/current/plan.json +0 -248
  12. package/.kb/commit/current/status.json +0 -472
  13. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.d.ts +0 -10
  14. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js +0 -215
  15. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js.map +0 -1
  16. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.d.ts +0 -10
  17. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js +0 -271
  18. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js.map +0 -1
  19. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.d.ts +0 -10
  20. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js +0 -230
  21. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js.map +0 -1
  22. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.d.ts +0 -10
  23. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js +0 -228
  24. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js.map +0 -1
  25. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.d.ts +0 -11
  26. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js +0 -281
  27. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js.map +0 -1
  28. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.d.ts +0 -10
  29. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js +0 -266
  30. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js.map +0 -1
  31. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.d.ts +0 -11
  32. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js +0 -284
  33. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js.map +0 -1
  34. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/flags-WLdpSZl4.d.ts +0 -77
  35. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.d.ts +0 -2
  36. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js +0 -441
  37. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js.map +0 -1
  38. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.d.ts +0 -196
  39. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js +0 -441
  40. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js.map +0 -1
  41. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.d.ts +0 -19
  42. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js +0 -48
  43. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js.map +0 -1
  44. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.d.ts +0 -6
  45. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js +0 -170
  46. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js.map +0 -1
  47. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.d.ts +0 -12
  48. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js +0 -52
  49. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js.map +0 -1
  50. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.d.ts +0 -22
  51. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js +0 -52
  52. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js.map +0 -1
  53. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.d.ts +0 -13
  54. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js +0 -52
  55. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js.map +0 -1
  56. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.d.ts +0 -9
  57. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js +0 -43
  58. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js.map +0 -1
  59. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.d.ts +0 -26
  60. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js +0 -63
  61. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js.map +0 -1
  62. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.d.ts +0 -9
  63. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js +0 -46
  64. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js.map +0 -1
  65. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.d.ts +0 -16
  66. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js +0 -58
  67. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js.map +0 -1
  68. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.d.ts +0 -9
  69. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js +0 -46
  70. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js.map +0 -1
  71. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.d.ts +0 -11
  72. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js +0 -50
  73. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js.map +0 -1
  74. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.d.ts +0 -7
  75. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js +0 -39
  76. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js.map +0 -1
  77. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.d.ts +0 -10
  78. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js +0 -46
  79. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js.map +0 -1
  80. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.d.ts +0 -13
  81. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js +0 -47
  82. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js.map +0 -1
  83. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.d.ts +0 -14
  84. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js +0 -53
  85. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js.map +0 -1
  86. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.d.ts +0 -13
  87. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js +0 -54
  88. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js.map +0 -1
  89. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.d.ts +0 -12
  90. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js +0 -51
  91. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js.map +0 -1
  92. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.d.ts +0 -17
  93. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js +0 -133
  94. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js.map +0 -1
  95. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.d.ts +0 -11
  96. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js +0 -46
  97. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js.map +0 -1
  98. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.d.ts +0 -10
  99. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js +0 -215
  100. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js.map +0 -1
  101. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.d.ts +0 -10
  102. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js +0 -271
  103. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js.map +0 -1
  104. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.d.ts +0 -10
  105. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js +0 -230
  106. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js.map +0 -1
  107. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.d.ts +0 -10
  108. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js +0 -228
  109. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js.map +0 -1
  110. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.d.ts +0 -11
  111. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js +0 -281
  112. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js.map +0 -1
  113. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.d.ts +0 -10
  114. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js +0 -266
  115. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js.map +0 -1
  116. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.d.ts +0 -11
  117. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js +0 -284
  118. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js.map +0 -1
  119. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/flags-WLdpSZl4.d.ts +0 -77
  120. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.d.ts +0 -2
  121. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js +0 -441
  122. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js.map +0 -1
  123. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.d.ts +0 -196
  124. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js +0 -441
  125. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js.map +0 -1
  126. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.d.ts +0 -19
  127. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js +0 -48
  128. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js.map +0 -1
  129. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.d.ts +0 -6
  130. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js +0 -170
  131. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js.map +0 -1
  132. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.d.ts +0 -12
  133. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js +0 -52
  134. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js.map +0 -1
  135. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.d.ts +0 -22
  136. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js +0 -52
  137. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js.map +0 -1
  138. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.d.ts +0 -13
  139. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js +0 -52
  140. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js.map +0 -1
  141. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.d.ts +0 -9
  142. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js +0 -43
  143. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js.map +0 -1
  144. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.d.ts +0 -26
  145. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js +0 -63
  146. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js.map +0 -1
  147. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.d.ts +0 -9
  148. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js +0 -46
  149. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js.map +0 -1
  150. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.d.ts +0 -16
  151. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js +0 -58
  152. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js.map +0 -1
  153. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.d.ts +0 -9
  154. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js +0 -46
  155. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js.map +0 -1
  156. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.d.ts +0 -11
  157. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js +0 -50
  158. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js.map +0 -1
  159. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.d.ts +0 -7
  160. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js +0 -39
  161. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js.map +0 -1
  162. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.d.ts +0 -10
  163. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js +0 -46
  164. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js.map +0 -1
  165. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.d.ts +0 -13
  166. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js +0 -47
  167. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js.map +0 -1
  168. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.d.ts +0 -14
  169. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js +0 -53
  170. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js.map +0 -1
  171. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.d.ts +0 -13
  172. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js +0 -54
  173. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js.map +0 -1
  174. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.d.ts +0 -12
  175. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js +0 -51
  176. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js.map +0 -1
  177. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.d.ts +0 -17
  178. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js +0 -133
  179. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js.map +0 -1
  180. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.d.ts +0 -11
  181. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js +0 -46
  182. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js.map +0 -1
  183. package/eslint.config.js +0 -23
  184. package/src/.kb/agents/sessions/session-1773470583796-ximqnfk/kpi-baseline.json +0 -17
  185. package/src/.kb/memory/sessions/session-1773470583796-ximqnfk/fact-sheet.json +0 -1
  186. package/src/bootstrap.ts +0 -233
  187. package/src/diagnostics/header-debug.ts +0 -37
  188. package/src/events/hub.ts +0 -60
  189. package/src/events/index.ts +0 -1
  190. package/src/index.ts +0 -13
  191. package/src/manifest.ts +0 -21
  192. package/src/middleware/__tests__/cache.spec.ts +0 -184
  193. package/src/middleware/__tests__/envelope.spec.ts +0 -268
  194. package/src/middleware/__tests__/metrics.redis.spec.ts +0 -64
  195. package/src/middleware/__tests__/rate-limit.spec.ts +0 -283
  196. package/src/middleware/__tests__/request-id.spec.ts +0 -160
  197. package/src/middleware/cache.ts +0 -67
  198. package/src/middleware/envelope.ts +0 -136
  199. package/src/middleware/error-guard.ts +0 -69
  200. package/src/middleware/index.ts +0 -37
  201. package/src/middleware/metrics.ts +0 -810
  202. package/src/middleware/mock-mode.ts +0 -44
  203. package/src/middleware/prom-metrics.ts +0 -284
  204. package/src/middleware/rate-limit-routes.ts +0 -73
  205. package/src/middleware/rate-limit.ts +0 -72
  206. package/src/middleware/request-id.ts +0 -41
  207. package/src/middleware/request-timeout.ts +0 -69
  208. package/src/middleware/security-headers.ts +0 -24
  209. package/src/middleware/startup-guard.ts +0 -107
  210. package/src/observability/service-contract.ts +0 -192
  211. package/src/plugins/index.ts +0 -118
  212. package/src/routes/__tests__/adapters-date-helpers.spec.ts +0 -332
  213. package/src/routes/__tests__/adapters.spec.ts +0 -680
  214. package/src/routes/__tests__/cache.spec.ts +0 -264
  215. package/src/routes/__tests__/events.spec.ts +0 -434
  216. package/src/routes/__tests__/health.spec.ts +0 -414
  217. package/src/routes/__tests__/logs.spec.ts +0 -494
  218. package/src/routes/__tests__/observability.spec.ts +0 -392
  219. package/src/routes/__tests__/plugins.spec.ts +0 -931
  220. package/src/routes/__tests__/workflow-management.spec.ts +0 -698
  221. package/src/routes/__tests__/workflows.spec.ts +0 -204
  222. package/src/routes/adapter-call.ts +0 -220
  223. package/src/routes/adapters.ts +0 -1206
  224. package/src/routes/analytics.ts +0 -328
  225. package/src/routes/cache.ts +0 -104
  226. package/src/routes/debug-routes.ts +0 -95
  227. package/src/routes/events.ts +0 -115
  228. package/src/routes/health.ts +0 -348
  229. package/src/routes/hello.ts +0 -47
  230. package/src/routes/index.ts +0 -395
  231. package/src/routes/jobs.ts +0 -253
  232. package/src/routes/logs.ts +0 -718
  233. package/src/routes/metrics.ts +0 -120
  234. package/src/routes/observability.ts +0 -1388
  235. package/src/routes/openapi.ts +0 -101
  236. package/src/routes/platform.ts +0 -143
  237. package/src/routes/plugins.ts +0 -998
  238. package/src/routes/readiness.ts +0 -83
  239. package/src/routes/workflow-management.ts +0 -469
  240. package/src/routes/workflows.ts +0 -256
  241. package/src/server.ts +0 -203
  242. package/src/services/historical-metrics.ts +0 -496
  243. package/src/services/incident-analyzer.ts +0 -289
  244. package/src/services/incident-detector.ts +0 -691
  245. package/src/services/incident-schema.sql +0 -76
  246. package/src/services/incident-storage.ts +0 -593
  247. package/src/services/system-metrics-collector.ts +0 -244
  248. package/src/types/fastify.d.ts +0 -58
  249. package/src/utils/__tests__/sse-auth.spec.ts +0 -113
  250. package/src/utils/path-helpers.ts +0 -15
  251. package/src/utils/repo.ts +0 -42
  252. package/src/utils/schema.ts +0 -20
  253. package/src/utils/sse-auth.ts +0 -81
  254. package/test-sandbox.sh +0 -105
  255. package/tsconfig.build.json +0 -15
  256. package/tsconfig.json +0 -9
  257. package/tsup.config.ts +0 -18
@@ -1,414 +0,0 @@
1
- import { beforeEach, describe, expect, it, vi } from 'vitest';
2
- import Fastify from 'fastify';
3
- import type { FastifyInstance } from 'fastify';
4
- import type { IEntityRegistry, SystemHealthSnapshot } from '@kb-labs/core-registry';
5
- import {
6
- checkCanonicalObservabilityMetrics,
7
- validateServiceObservabilityDescribe,
8
- validateServiceObservabilityHealth,
9
- } from '@kb-labs/core-contracts';
10
- import type { RestApiConfig } from '@kb-labs/rest-api-core';
11
- import type { ReadinessState } from '../readiness';
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
- function buildSnapshot(
27
- overrides: Partial<SystemHealthSnapshot> = {}
28
- ): SystemHealthSnapshot {
29
- const base: SystemHealthSnapshot = {
30
- schema: 'kb.health/1',
31
- ts: new Date().toISOString(),
32
- uptimeSec: 42,
33
- version: {
34
- kbLabs: 'test-suite',
35
- rest: 'test-rest',
36
- },
37
- registry: {
38
- total: 1,
39
- withRest: 1,
40
- withStudio: 0,
41
- errors: 0,
42
- generatedAt: new Date().toISOString(),
43
- expiresAt: new Date(Date.now() + 60_000).toISOString(),
44
- partial: false,
45
- stale: false,
46
- },
47
- status: 'healthy',
48
- components: [],
49
- };
50
-
51
- return {
52
- ...base,
53
- ...overrides,
54
- version: {
55
- ...base.version,
56
- ...(overrides.version ?? {}),
57
- },
58
- registry: {
59
- ...base.registry,
60
- ...(overrides.registry ?? {}),
61
- },
62
- components: overrides.components ?? base.components,
63
- ...(overrides.meta !== undefined ? { meta: overrides.meta } : {}),
64
- };
65
- }
66
-
67
- beforeEach(() => {
68
- vi.resetModules();
69
- });
70
-
71
- describe('registerHealthRoutes', () => {
72
- it('returns kb.health/1 snapshot with readiness metadata and degraded status when plugin failures exist', async () => {
73
- const { registerHealthRoutes } = await import('../health');
74
- const app = Fastify({ logger: false }) as unknown as FastifyInstance;
75
-
76
- const readiness: ReadinessState = {
77
- cliApiInitialized: true,
78
- registryLoaded: true,
79
- registryPartial: false,
80
- registryStale: false,
81
- pluginRoutesMounted: true,
82
- pluginMountInProgress: false,
83
- pluginRoutesCount: 2,
84
- pluginRouteErrors: 1,
85
- pluginRouteFailures: [
86
- { id: '@kb-labs/mind', error: 'rest_mount_failed handler_missing' },
87
- ],
88
- lastPluginMountTs: null,
89
- pluginRoutesLastDurationMs: null,
90
- redisEnabled: false,
91
- redisConnected: true,
92
- redisStates: {
93
- publisher: null,
94
- subscriber: null,
95
- cache: null,
96
- },
97
- };
98
-
99
- const baseSnapshot = buildSnapshot({
100
- components: [
101
- {
102
- id: '@kb-labs/mind',
103
- version: '1.0.0',
104
- restRoutes: 2,
105
- studioWidgets: 1,
106
- },
107
- ],
108
- });
109
-
110
- const cliApi = {
111
- getSystemHealth: vi.fn().mockResolvedValue(baseSnapshot),
112
- snapshot: vi.fn(() => ({
113
- schema: 'kb.registry/1' as const,
114
- rev: 1,
115
- generatedAt: new Date().toISOString(),
116
- expiresAt: new Date(Date.now() + 60_000).toISOString(),
117
- ttlMs: 60_000,
118
- partial: false,
119
- stale: false,
120
- source: { cliVersion: 'test', cwd: process.cwd() },
121
- corrupted: false,
122
- plugins: [],
123
- })),
124
- } as unknown as IEntityRegistry;
125
-
126
- await registerHealthRoutes(app, BASE_CONFIG, process.cwd(), cliApi, readiness);
127
-
128
- const response = await app.inject({ method: 'GET', url: '/health' });
129
- expect(response.statusCode).toBe(200);
130
-
131
- const payload = response.json() as SystemHealthSnapshot;
132
- expect(payload.schema).toBe('kb.health/1');
133
- expect(payload.status).toBe('degraded');
134
- const meta = (payload.meta ?? {}) as Record<string, any>;
135
- expect(meta.readiness).toBeDefined();
136
- expect(meta.readiness.pluginRouteErrors).toBe(1);
137
- expect(meta.readinessFailures).toHaveLength(1);
138
-
139
- expect(cliApi.getSystemHealth).toHaveBeenCalledTimes(1);
140
-
141
- await app.close();
142
- });
143
-
144
- it('ready endpoint waits for registry load and mounted routes', async () => {
145
- const { registerHealthRoutes } = await import('../health');
146
- const app = Fastify({ logger: false }) as unknown as FastifyInstance;
147
-
148
- const readiness: ReadinessState = {
149
- cliApiInitialized: true,
150
- registryLoaded: false,
151
- registryPartial: true,
152
- registryStale: true,
153
- pluginRoutesMounted: false,
154
- pluginMountInProgress: true,
155
- pluginRoutesCount: 0,
156
- pluginRouteErrors: 0,
157
- pluginRouteFailures: [],
158
- lastPluginMountTs: null,
159
- pluginRoutesLastDurationMs: null,
160
- redisEnabled: false,
161
- redisConnected: true,
162
- redisStates: {
163
- publisher: null,
164
- subscriber: null,
165
- cache: null,
166
- },
167
- };
168
-
169
- const baseSnapshot = buildSnapshot();
170
- let snapshotRev = 0;
171
- let snapshotPartial = true;
172
- let snapshotStale = true;
173
- let snapshotPlugins: Array<{ id: string }> = [];
174
-
175
- const cliApi = {
176
- getSystemHealth: vi.fn().mockResolvedValue(baseSnapshot),
177
- snapshot: vi.fn(() => ({
178
- schema: 'kb.registry/1' as const,
179
- rev: snapshotRev,
180
- generatedAt: new Date().toISOString(),
181
- expiresAt: new Date(Date.now() + 60_000).toISOString(),
182
- ttlMs: 60_000,
183
- partial: snapshotPartial,
184
- stale: snapshotStale,
185
- source: { cliVersion: 'test', cwd: process.cwd() },
186
- corrupted: false,
187
- plugins: snapshotPlugins as any,
188
- })),
189
- } as unknown as IEntityRegistry;
190
-
191
- await registerHealthRoutes(app, BASE_CONFIG, process.cwd(), cliApi, readiness);
192
-
193
- const notReady = await app.inject({ method: 'GET', url: '/ready' });
194
- expect(notReady.statusCode).toBe(503);
195
- expect(notReady.json()).toMatchObject({
196
- schema: 'kb.ready/1',
197
- ready: false,
198
- status: 'initializing',
199
- reason: 'registry_snapshot_stale',
200
- components: {
201
- cliApi: {
202
- initialized: true,
203
- },
204
- registry: {
205
- loaded: false,
206
- partial: true,
207
- stale: true,
208
- },
209
- plugins: {
210
- mounted: false,
211
- inProgress: true,
212
- },
213
- },
214
- });
215
-
216
- snapshotRev = 1;
217
- snapshotPartial = false;
218
- snapshotStale = false;
219
- snapshotPlugins = [{ id: 'test' }];
220
- readiness.pluginRoutesMounted = true;
221
- readiness.pluginRouteErrors = 0;
222
- readiness.pluginRouteFailures = [];
223
- readiness.registryLoaded = true;
224
- readiness.registryPartial = false;
225
- readiness.registryStale = false;
226
- readiness.pluginMountInProgress = false;
227
-
228
- const ready = await app.inject({ method: 'GET', url: '/ready' });
229
- expect(ready.statusCode).toBe(200);
230
- expect(ready.json()).toMatchObject({
231
- schema: 'kb.ready/1',
232
- ready: true,
233
- status: 'ready',
234
- reason: 'ready',
235
- components: {
236
- cliApi: {
237
- initialized: true,
238
- },
239
- registry: {
240
- loaded: true,
241
- partial: false,
242
- stale: false,
243
- },
244
- plugins: {
245
- mounted: true,
246
- inProgress: false,
247
- routeCount: 0,
248
- errors: 0,
249
- },
250
- },
251
- });
252
-
253
- await app.close();
254
- });
255
-
256
- it('reports redis_unavailable when redis is enabled but unhealthy', async () => {
257
- const { registerHealthRoutes } = await import('../health');
258
- const app = Fastify({ logger: false }) as unknown as FastifyInstance;
259
-
260
- const readiness: ReadinessState = {
261
- cliApiInitialized: true,
262
- registryLoaded: true,
263
- registryPartial: false,
264
- registryStale: false,
265
- pluginRoutesMounted: true,
266
- pluginMountInProgress: false,
267
- pluginRoutesCount: 4,
268
- pluginRouteErrors: 0,
269
- pluginRouteFailures: [],
270
- lastPluginMountTs: new Date().toISOString(),
271
- pluginRoutesLastDurationMs: 128,
272
- redisEnabled: true,
273
- redisConnected: false,
274
- redisStates: {
275
- publisher: 'reconnecting',
276
- subscriber: 'end',
277
- cache: 'error',
278
- },
279
- };
280
-
281
- const baseSnapshot = buildSnapshot();
282
- const cliApi = {
283
- getSystemHealth: vi.fn().mockResolvedValue(baseSnapshot),
284
- snapshot: vi.fn(() => ({
285
- schema: 'kb.registry/1' as const,
286
- rev: 2,
287
- generatedAt: new Date().toISOString(),
288
- expiresAt: new Date(Date.now() + 60_000).toISOString(),
289
- ttlMs: 60_000,
290
- partial: false,
291
- stale: false,
292
- source: { cliVersion: 'test', cwd: process.cwd() },
293
- corrupted: false,
294
- plugins: [{ id: '@kb-labs/demo' }],
295
- })),
296
- getRedisStatus: vi.fn(() => ({
297
- enabled: true,
298
- healthy: false,
299
- roles: {
300
- publisher: 'reconnecting',
301
- subscriber: 'end',
302
- cache: 'error',
303
- },
304
- })),
305
- } as unknown as IEntityRegistry;
306
-
307
- await registerHealthRoutes(app, BASE_CONFIG, process.cwd(), cliApi, readiness);
308
-
309
- const response = await app.inject({ method: 'GET', url: '/ready' });
310
- expect(response.statusCode).toBe(503);
311
- expect(response.json()).toMatchObject({
312
- schema: 'kb.ready/1',
313
- ready: false,
314
- status: 'initializing',
315
- reason: 'redis_unavailable',
316
- components: {
317
- redis: {
318
- enabled: true,
319
- healthy: false,
320
- },
321
- },
322
- });
323
-
324
- await app.close();
325
- });
326
-
327
- it('exposes observability describe and health surfaces', async () => {
328
- const { registerHealthRoutes } = await import('../health');
329
- const app = Fastify({ logger: false }) as unknown as FastifyInstance;
330
-
331
- const readiness: ReadinessState = {
332
- cliApiInitialized: true,
333
- registryLoaded: true,
334
- registryPartial: false,
335
- registryStale: false,
336
- pluginRoutesMounted: true,
337
- pluginMountInProgress: false,
338
- pluginRoutesCount: 3,
339
- pluginRouteErrors: 0,
340
- pluginRouteFailures: [],
341
- lastPluginMountTs: new Date().toISOString(),
342
- pluginRoutesLastDurationMs: 12,
343
- redisEnabled: false,
344
- redisConnected: true,
345
- redisStates: {
346
- publisher: null,
347
- subscriber: null,
348
- cache: null,
349
- },
350
- };
351
-
352
- const baseSnapshot = buildSnapshot();
353
- const cliApi = {
354
- getSystemHealth: vi.fn().mockResolvedValue(baseSnapshot),
355
- snapshot: vi.fn(() => ({
356
- schema: 'kb.registry/1' as const,
357
- rev: 7,
358
- generatedAt: new Date().toISOString(),
359
- expiresAt: new Date(Date.now() + 60_000).toISOString(),
360
- ttlMs: 60_000,
361
- partial: false,
362
- stale: false,
363
- source: { cwd: process.cwd(), platformVersion: 'test' },
364
- corrupted: false,
365
- plugins: [{ id: '@kb-labs/demo' }],
366
- })),
367
- } as unknown as IEntityRegistry;
368
-
369
- await registerHealthRoutes(app, BASE_CONFIG, process.cwd(), cliApi, readiness);
370
-
371
- const describe = await app.inject({ method: 'GET', url: '/api/v1/observability/describe' });
372
- expect(describe.statusCode).toBe(200);
373
- expect(describe.json()).toMatchObject({
374
- serviceId: 'rest',
375
- contractVersion: '1.0',
376
- metricsEndpoint: '/api/v1/metrics',
377
- healthEndpoint: '/api/v1/observability/health',
378
- });
379
-
380
- const health = await app.inject({ method: 'GET', url: '/api/v1/observability/health' });
381
- expect(health.statusCode).toBe(200);
382
- expect(health.json()).toMatchObject({
383
- serviceId: 'rest',
384
- contractVersion: '1.0',
385
- status: 'healthy',
386
- state: 'active',
387
- checks: expect.arrayContaining([
388
- expect.objectContaining({ id: 'registry', status: 'ok' }),
389
- ]),
390
- });
391
-
392
- expect(validateServiceObservabilityDescribe(describe.json()).ok).toBe(true);
393
- expect(validateServiceObservabilityHealth(health.json()).ok).toBe(true);
394
-
395
- await app.close();
396
- });
397
-
398
- it('metrics endpoint exposes canonical observability families', async () => {
399
- const { registerMetricsRoutes } = await import('../metrics');
400
- const app = Fastify({ logger: false }) as unknown as FastifyInstance;
401
-
402
- registerMetricsRoutes(app, BASE_CONFIG);
403
-
404
- const metrics = await app.inject({ method: 'GET', url: '/api/v1/metrics' });
405
- expect(metrics.statusCode).toBe(200);
406
- const compliance = checkCanonicalObservabilityMetrics(metrics.body);
407
- expect(compliance.missing).toEqual([]);
408
-
409
- const legacy = await app.inject({ method: 'GET', url: '/api/v1/metrics/json' });
410
- expect(legacy.statusCode).toBe(404);
411
-
412
- await app.close();
413
- });
414
- });