@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.
Files changed (255) hide show
  1. package/.kb/agents/sessions/session-1771531145393-ws3uh6q/turns.json +42 -0
  2. package/.kb/agents/sessions/session-1771548930486-ui6rtvm/turns.json +33 -0
  3. package/.kb/agents/sessions/session-1771549691485-nibqroq/turns.json +133 -0
  4. package/.kb/agents/sessions/session-1771550943182-dkwqdjc/turns.json +130 -0
  5. package/.kb/agents/sessions/session-1771551564182-cr4bwzn/turns.json +349 -0
  6. package/.kb/agents/sessions/session-1771552401370-g4ztwd1/turns.json +206 -0
  7. package/.kb/commit/current/plan.json +248 -0
  8. package/.kb/commit/current/status.json +472 -0
  9. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.d.ts +10 -0
  10. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js +215 -0
  11. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/health.js.map +1 -0
  12. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.d.ts +10 -0
  13. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js +271 -0
  14. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/list.js.map +1 -0
  15. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.d.ts +10 -0
  16. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js +230 -0
  17. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/logs.js.map +1 -0
  18. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.d.ts +10 -0
  19. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js +228 -0
  20. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/metrics.js.map +1 -0
  21. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.d.ts +11 -0
  22. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js +281 -0
  23. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/run.js.map +1 -0
  24. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.d.ts +10 -0
  25. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js +266 -0
  26. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/status.js.map +1 -0
  27. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.d.ts +11 -0
  28. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js +284 -0
  29. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/commands/workflow-run.js.map +1 -0
  30. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/flags-WLdpSZl4.d.ts +77 -0
  31. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.d.ts +2 -0
  32. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js +441 -0
  33. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/index.js.map +1 -0
  34. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.d.ts +196 -0
  35. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js +441 -0
  36. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/manifest.js.map +1 -0
  37. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.d.ts +19 -0
  38. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js +48 -0
  39. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/cron-list-handler.js.map +1 -0
  40. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.d.ts +6 -0
  41. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js +170 -0
  42. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/index.js.map +1 -0
  43. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.d.ts +12 -0
  44. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js +52 -0
  45. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-cancel-handler.js.map +1 -0
  46. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.d.ts +22 -0
  47. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js +52 -0
  48. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-detail-handler.js.map +1 -0
  49. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.d.ts +13 -0
  50. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js +52 -0
  51. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-logs-handler.js.map +1 -0
  52. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.d.ts +9 -0
  53. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js +43 -0
  54. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/job-steps-handler.js.map +1 -0
  55. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.d.ts +26 -0
  56. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js +63 -0
  57. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/jobs-list-handler.js.map +1 -0
  58. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.d.ts +9 -0
  59. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js +46 -0
  60. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/pending-approvals-handler.js.map +1 -0
  61. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.d.ts +16 -0
  62. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js +58 -0
  63. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/resolve-approval-handler.js.map +1 -0
  64. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.d.ts +9 -0
  65. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js +46 -0
  66. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/run-detail-handler.js.map +1 -0
  67. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.d.ts +11 -0
  68. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js +50 -0
  69. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/runs-list-handler.js.map +1 -0
  70. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.d.ts +7 -0
  71. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js +39 -0
  72. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/stats-handler.js.map +1 -0
  73. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.d.ts +10 -0
  74. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js +46 -0
  75. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-detail-handler.js.map +1 -0
  76. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.d.ts +13 -0
  77. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js +47 -0
  78. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-cancel-handler.js.map +1 -0
  79. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.d.ts +14 -0
  80. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js +53 -0
  81. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-run-handler.js.map +1 -0
  82. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.d.ts +13 -0
  83. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js +54 -0
  84. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflow-runs-handler.js.map +1 -0
  85. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.d.ts +12 -0
  86. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js +51 -0
  87. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/rest/workflows-list-handler.js.map +1 -0
  88. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.d.ts +17 -0
  89. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js +133 -0
  90. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/logs-channel.js.map +1 -0
  91. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.d.ts +11 -0
  92. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js +46 -0
  93. package/.kb/runtime/workspaces/ws_94c2deab-4cf9-49cb-94ac-3958062754a1/ws/progress-channel.js.map +1 -0
  94. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.d.ts +10 -0
  95. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js +215 -0
  96. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/health.js.map +1 -0
  97. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.d.ts +10 -0
  98. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js +271 -0
  99. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/list.js.map +1 -0
  100. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.d.ts +10 -0
  101. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js +230 -0
  102. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/logs.js.map +1 -0
  103. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.d.ts +10 -0
  104. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js +228 -0
  105. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/metrics.js.map +1 -0
  106. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.d.ts +11 -0
  107. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js +281 -0
  108. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/run.js.map +1 -0
  109. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.d.ts +10 -0
  110. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js +266 -0
  111. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/status.js.map +1 -0
  112. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.d.ts +11 -0
  113. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js +284 -0
  114. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/commands/workflow-run.js.map +1 -0
  115. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/flags-WLdpSZl4.d.ts +77 -0
  116. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.d.ts +2 -0
  117. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js +441 -0
  118. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/index.js.map +1 -0
  119. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.d.ts +196 -0
  120. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js +441 -0
  121. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/manifest.js.map +1 -0
  122. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.d.ts +19 -0
  123. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js +48 -0
  124. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/cron-list-handler.js.map +1 -0
  125. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.d.ts +6 -0
  126. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js +170 -0
  127. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/index.js.map +1 -0
  128. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.d.ts +12 -0
  129. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js +52 -0
  130. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-cancel-handler.js.map +1 -0
  131. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.d.ts +22 -0
  132. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js +52 -0
  133. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-detail-handler.js.map +1 -0
  134. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.d.ts +13 -0
  135. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js +52 -0
  136. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-logs-handler.js.map +1 -0
  137. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.d.ts +9 -0
  138. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js +43 -0
  139. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/job-steps-handler.js.map +1 -0
  140. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.d.ts +26 -0
  141. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js +63 -0
  142. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/jobs-list-handler.js.map +1 -0
  143. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.d.ts +9 -0
  144. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js +46 -0
  145. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/pending-approvals-handler.js.map +1 -0
  146. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.d.ts +16 -0
  147. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js +58 -0
  148. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/resolve-approval-handler.js.map +1 -0
  149. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.d.ts +9 -0
  150. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js +46 -0
  151. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/run-detail-handler.js.map +1 -0
  152. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.d.ts +11 -0
  153. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js +50 -0
  154. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/runs-list-handler.js.map +1 -0
  155. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.d.ts +7 -0
  156. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js +39 -0
  157. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/stats-handler.js.map +1 -0
  158. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.d.ts +10 -0
  159. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js +46 -0
  160. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-detail-handler.js.map +1 -0
  161. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.d.ts +13 -0
  162. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js +47 -0
  163. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-cancel-handler.js.map +1 -0
  164. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.d.ts +14 -0
  165. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js +53 -0
  166. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-run-handler.js.map +1 -0
  167. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.d.ts +13 -0
  168. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js +54 -0
  169. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflow-runs-handler.js.map +1 -0
  170. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.d.ts +12 -0
  171. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js +51 -0
  172. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/rest/workflows-list-handler.js.map +1 -0
  173. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.d.ts +17 -0
  174. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js +133 -0
  175. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/logs-channel.js.map +1 -0
  176. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.d.ts +11 -0
  177. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js +46 -0
  178. package/.kb/runtime/workspaces/ws_f0f301b8-388d-4dc4-b301-475f2bc95f02/ws/progress-channel.js.map +1 -0
  179. package/README.md +54 -0
  180. package/eslint.config.js +23 -0
  181. package/package.json +72 -0
  182. package/src/.kb/agents/sessions/session-1773470583796-ximqnfk/kpi-baseline.json +17 -0
  183. package/src/.kb/memory/sessions/session-1773470583796-ximqnfk/fact-sheet.json +1 -0
  184. package/src/bootstrap.ts +233 -0
  185. package/src/diagnostics/header-debug.ts +37 -0
  186. package/src/events/hub.ts +60 -0
  187. package/src/events/index.ts +1 -0
  188. package/src/index.ts +13 -0
  189. package/src/manifest.ts +21 -0
  190. package/src/middleware/__tests__/cache.spec.ts +184 -0
  191. package/src/middleware/__tests__/envelope.spec.ts +268 -0
  192. package/src/middleware/__tests__/metrics.redis.spec.ts +64 -0
  193. package/src/middleware/__tests__/rate-limit.spec.ts +283 -0
  194. package/src/middleware/__tests__/request-id.spec.ts +160 -0
  195. package/src/middleware/cache.ts +67 -0
  196. package/src/middleware/envelope.ts +136 -0
  197. package/src/middleware/error-guard.ts +69 -0
  198. package/src/middleware/index.ts +37 -0
  199. package/src/middleware/metrics.ts +810 -0
  200. package/src/middleware/mock-mode.ts +44 -0
  201. package/src/middleware/prom-metrics.ts +284 -0
  202. package/src/middleware/rate-limit-routes.ts +73 -0
  203. package/src/middleware/rate-limit.ts +72 -0
  204. package/src/middleware/request-id.ts +41 -0
  205. package/src/middleware/request-timeout.ts +69 -0
  206. package/src/middleware/security-headers.ts +24 -0
  207. package/src/middleware/startup-guard.ts +107 -0
  208. package/src/observability/service-contract.ts +192 -0
  209. package/src/plugins/index.ts +118 -0
  210. package/src/routes/__tests__/adapters-date-helpers.spec.ts +332 -0
  211. package/src/routes/__tests__/adapters.spec.ts +680 -0
  212. package/src/routes/__tests__/cache.spec.ts +264 -0
  213. package/src/routes/__tests__/events.spec.ts +434 -0
  214. package/src/routes/__tests__/health.spec.ts +414 -0
  215. package/src/routes/__tests__/logs.spec.ts +494 -0
  216. package/src/routes/__tests__/observability.spec.ts +392 -0
  217. package/src/routes/__tests__/plugins.spec.ts +931 -0
  218. package/src/routes/__tests__/workflow-management.spec.ts +698 -0
  219. package/src/routes/__tests__/workflows.spec.ts +204 -0
  220. package/src/routes/adapter-call.ts +220 -0
  221. package/src/routes/adapters.ts +1206 -0
  222. package/src/routes/analytics.ts +328 -0
  223. package/src/routes/cache.ts +104 -0
  224. package/src/routes/debug-routes.ts +95 -0
  225. package/src/routes/events.ts +115 -0
  226. package/src/routes/health.ts +348 -0
  227. package/src/routes/hello.ts +47 -0
  228. package/src/routes/index.ts +395 -0
  229. package/src/routes/jobs.ts +253 -0
  230. package/src/routes/logs.ts +718 -0
  231. package/src/routes/metrics.ts +120 -0
  232. package/src/routes/observability.ts +1388 -0
  233. package/src/routes/openapi.ts +101 -0
  234. package/src/routes/platform.ts +143 -0
  235. package/src/routes/plugins.ts +998 -0
  236. package/src/routes/readiness.ts +83 -0
  237. package/src/routes/workflow-management.ts +469 -0
  238. package/src/routes/workflows.ts +256 -0
  239. package/src/server.ts +203 -0
  240. package/src/services/historical-metrics.ts +496 -0
  241. package/src/services/incident-analyzer.ts +289 -0
  242. package/src/services/incident-detector.ts +691 -0
  243. package/src/services/incident-schema.sql +76 -0
  244. package/src/services/incident-storage.ts +593 -0
  245. package/src/services/system-metrics-collector.ts +244 -0
  246. package/src/types/fastify.d.ts +58 -0
  247. package/src/utils/__tests__/sse-auth.spec.ts +113 -0
  248. package/src/utils/path-helpers.ts +15 -0
  249. package/src/utils/repo.ts +42 -0
  250. package/src/utils/schema.ts +20 -0
  251. package/src/utils/sse-auth.ts +81 -0
  252. package/test-sandbox.sh +105 -0
  253. package/tsconfig.build.json +15 -0
  254. package/tsconfig.json +9 -0
  255. package/tsup.config.ts +18 -0
@@ -0,0 +1,494 @@
1
+ /**
2
+ * Integration tests for log query endpoints
3
+ */
4
+
5
+ import { beforeEach, describe, expect, it, vi, afterEach } from 'vitest';
6
+ import Fastify from 'fastify';
7
+
8
+ import type { RestApiConfig } from '@kb-labs/rest-api-core';
9
+ import { registerLogRoutes } from '../logs.js';
10
+ import { platform } from '@kb-labs/core-runtime';
11
+ import type { LogRecord, ILogReader } from '@kb-labs/core-platform';
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
+ // Helper to create mock log
27
+ const createMockLog = (id: string, level: string, message: string, timestamp = Date.now()): LogRecord => ({
28
+ id,
29
+ timestamp,
30
+ level: level as LogRecord['level'],
31
+ message,
32
+ fields: { plugin: 'test', executionId: 'exec-123' },
33
+ source: 'test',
34
+ });
35
+
36
+ describe('Log Routes Integration Tests', () => {
37
+ let app: ReturnType<typeof Fastify>;
38
+ let mockLogService: Partial<ILogReader>;
39
+
40
+ beforeEach(async () => {
41
+ vi.clearAllMocks();
42
+
43
+ // Create mock log service
44
+ mockLogService = {
45
+ query: vi.fn(),
46
+ getById: vi.fn(),
47
+ search: vi.fn(),
48
+ subscribe: vi.fn(),
49
+ getStats: vi.fn(),
50
+ getCapabilities: vi.fn(),
51
+ };
52
+
53
+ // Mock platform.logs
54
+ vi.spyOn(platform, 'logs', 'get').mockReturnValue(mockLogService as ILogReader);
55
+
56
+ app = Fastify({ logger: false });
57
+ await registerLogRoutes(app, BASE_CONFIG, {} as any);
58
+ });
59
+
60
+ afterEach(async () => {
61
+ await app.close();
62
+ vi.restoreAllMocks();
63
+ });
64
+
65
+ describe('GET /api/v1/logs', () => {
66
+ it('should query logs with filters', async () => {
67
+ const mockLogs = [
68
+ createMockLog('log-1', 'error', 'Error 1', 1000),
69
+ createMockLog('log-2', 'error', 'Error 2', 2000),
70
+ ];
71
+
72
+ (mockLogService.query as any).mockResolvedValue({
73
+ logs: mockLogs,
74
+ total: 2,
75
+ hasMore: false,
76
+ source: 'persistence',
77
+ });
78
+
79
+ (mockLogService.getStats as any).mockResolvedValue({
80
+ persistence: {
81
+ totalLogs: 100,
82
+ oldestTimestamp: 1000,
83
+ newestTimestamp: 2000,
84
+ sizeBytes: 1024,
85
+ },
86
+ });
87
+
88
+ const response = await app.inject({
89
+ method: 'GET',
90
+ url: '/api/v1/logs?level=error&limit=10',
91
+ });
92
+
93
+ expect(response.statusCode).toBe(200);
94
+ const payload = response.json();
95
+
96
+ expect(payload.ok).toBe(true);
97
+ expect(payload.data.logs).toHaveLength(2);
98
+ expect(payload.data.total).toBe(2);
99
+ expect(payload.data.hasMore).toBe(false);
100
+ expect(payload.data.source).toBe('persistence');
101
+
102
+ expect(mockLogService.query).toHaveBeenCalledWith(
103
+ expect.objectContaining({ level: 'error' }),
104
+ expect.objectContaining({ limit: 10 })
105
+ );
106
+ });
107
+
108
+ it('should use search when search query provided', async () => {
109
+ const mockLogs = [
110
+ createMockLog('log-1', 'error', 'Authentication failed'),
111
+ ];
112
+
113
+ (mockLogService.search as any).mockResolvedValue({
114
+ logs: mockLogs,
115
+ total: 1,
116
+ hasMore: false,
117
+ });
118
+
119
+ (mockLogService.getStats as any).mockResolvedValue({});
120
+
121
+ const response = await app.inject({
122
+ method: 'GET',
123
+ url: '/api/v1/logs?search=authentication',
124
+ });
125
+
126
+ expect(response.statusCode).toBe(200);
127
+ const payload = response.json();
128
+
129
+ expect(payload.ok).toBe(true);
130
+ expect(payload.data.logs).toHaveLength(1);
131
+
132
+ expect(mockLogService.search).toHaveBeenCalledWith(
133
+ 'authentication',
134
+ expect.objectContaining({ limit: 100, offset: 0 })
135
+ );
136
+ expect(mockLogService.query).not.toHaveBeenCalled();
137
+ });
138
+
139
+ it('should handle pagination', async () => {
140
+ const mockLogs = Array.from({ length: 5 }, (_, i) =>
141
+ createMockLog(`log-${i}`, 'info', `Info ${i}`)
142
+ );
143
+
144
+ (mockLogService.query as any).mockResolvedValue({
145
+ logs: mockLogs,
146
+ total: 50,
147
+ hasMore: true,
148
+ source: 'buffer',
149
+ });
150
+
151
+ (mockLogService.getStats as any).mockResolvedValue({});
152
+
153
+ const response = await app.inject({
154
+ method: 'GET',
155
+ url: '/api/v1/logs?limit=5&offset=10',
156
+ });
157
+
158
+ expect(response.statusCode).toBe(200);
159
+ const payload = response.json();
160
+
161
+ expect(payload.data.hasMore).toBe(true);
162
+ expect(payload.data.total).toBe(50);
163
+
164
+ expect(mockLogService.query).toHaveBeenCalledWith(
165
+ expect.anything(),
166
+ expect.objectContaining({ limit: 5, offset: 10 })
167
+ );
168
+ });
169
+
170
+ it('should return stats in response', async () => {
171
+ (mockLogService.query as any).mockResolvedValue({
172
+ logs: [],
173
+ total: 0,
174
+ hasMore: false,
175
+ source: 'persistence',
176
+ });
177
+
178
+ (mockLogService.getStats as any).mockResolvedValue({
179
+ buffer: {
180
+ size: 100,
181
+ maxSize: 1000,
182
+ oldestTimestamp: 1000,
183
+ newestTimestamp: 2000,
184
+ },
185
+ persistence: {
186
+ totalLogs: 5000,
187
+ oldestTimestamp: 100,
188
+ newestTimestamp: 3000,
189
+ sizeBytes: 1024000,
190
+ },
191
+ });
192
+
193
+ const response = await app.inject({
194
+ method: 'GET',
195
+ url: '/api/v1/logs',
196
+ });
197
+
198
+ expect(response.statusCode).toBe(200);
199
+ const payload = response.json();
200
+
201
+ expect(payload.data.stats.buffer).toBeDefined();
202
+ expect(payload.data.stats.buffer.size).toBe(100);
203
+ expect(payload.data.stats.persistence).toBeDefined();
204
+ expect(payload.data.stats.persistence.totalLogs).toBe(5000);
205
+ });
206
+
207
+ it('should handle errors gracefully', async () => {
208
+ (mockLogService.query as any).mockRejectedValue(
209
+ new Error('No log storage backend available')
210
+ );
211
+
212
+ const response = await app.inject({
213
+ method: 'GET',
214
+ url: '/api/v1/logs',
215
+ });
216
+
217
+ expect(response.statusCode).toBe(503);
218
+ const payload = response.json();
219
+
220
+ expect(payload.ok).toBe(false);
221
+ expect(payload.error).toBe('Log query failed');
222
+ expect(payload.message).toContain('No log storage backend');
223
+ });
224
+ });
225
+
226
+ describe('GET /api/v1/logs/:id', () => {
227
+ it('should return log by ID', async () => {
228
+ const mockLog = createMockLog('log-123', 'error', 'Test error');
229
+
230
+ (mockLogService.getById as any).mockResolvedValue(mockLog);
231
+
232
+ const response = await app.inject({
233
+ method: 'GET',
234
+ url: '/api/v1/logs/log-123',
235
+ });
236
+
237
+ expect(response.statusCode).toBe(200);
238
+ const payload = response.json();
239
+
240
+ expect(payload.ok).toBe(true);
241
+ expect(payload.data.log.msg).toBe('Test error');
242
+ expect(payload.data.log.level).toBe('error');
243
+
244
+ expect(mockLogService.getById).toHaveBeenCalledWith('log-123');
245
+ });
246
+
247
+ it('should return 404 when log not found', async () => {
248
+ (mockLogService.getById as any).mockResolvedValue(null);
249
+
250
+ const response = await app.inject({
251
+ method: 'GET',
252
+ url: '/api/v1/logs/non-existent',
253
+ });
254
+
255
+ expect(response.statusCode).toBe(404);
256
+ const payload = response.json();
257
+
258
+ expect(payload.ok).toBe(false);
259
+ expect(payload.error).toBe('Log not found');
260
+ });
261
+
262
+ it('should handle errors', async () => {
263
+ (mockLogService.getById as any).mockRejectedValue(
264
+ new Error('Database connection failed')
265
+ );
266
+
267
+ const response = await app.inject({
268
+ method: 'GET',
269
+ url: '/api/v1/logs/log-123',
270
+ });
271
+
272
+ expect(response.statusCode).toBe(500);
273
+ const payload = response.json();
274
+
275
+ expect(payload.ok).toBe(false);
276
+ expect(payload.error).toBe('Failed to fetch log');
277
+ });
278
+ });
279
+
280
+ describe('GET /api/v1/logs/stream', () => {
281
+ it('should return 503 when streaming not supported', async () => {
282
+ (mockLogService.getCapabilities as any).mockReturnValue({
283
+ hasBuffer: false,
284
+ hasPersistence: true,
285
+ hasSearch: true,
286
+ hasStreaming: false,
287
+ });
288
+
289
+ const response = await app.inject({
290
+ method: 'GET',
291
+ url: '/api/v1/logs/stream',
292
+ });
293
+
294
+ expect(response.statusCode).toBe(503);
295
+ const payload = response.json();
296
+
297
+ expect(payload.error).toBe('Log streaming not enabled');
298
+ });
299
+
300
+ // Note: SSE streaming is hard to test in unit tests
301
+ // Would need separate E2E tests with real SSE client
302
+ });
303
+
304
+ describe('GET /api/v1/logs/stats', () => {
305
+ it('should return combined statistics', async () => {
306
+ (mockLogService.getStats as any).mockResolvedValue({
307
+ buffer: {
308
+ size: 150,
309
+ maxSize: 1000,
310
+ oldestTimestamp: 5000,
311
+ newestTimestamp: 10000,
312
+ },
313
+ persistence: {
314
+ totalLogs: 10000,
315
+ oldestTimestamp: 1000,
316
+ newestTimestamp: 10000,
317
+ sizeBytes: 5120000,
318
+ },
319
+ });
320
+
321
+ (mockLogService.getCapabilities as any).mockReturnValue({
322
+ hasBuffer: true,
323
+ hasPersistence: true,
324
+ hasSearch: true,
325
+ hasStreaming: true,
326
+ });
327
+
328
+ const response = await app.inject({
329
+ method: 'GET',
330
+ url: '/api/v1/logs/stats',
331
+ });
332
+
333
+ expect(response.statusCode).toBe(200);
334
+ const payload = response.json();
335
+
336
+ expect(payload.ok).toBe(true);
337
+ expect(payload.data.capabilities).toEqual({
338
+ hasBuffer: true,
339
+ hasPersistence: true,
340
+ hasSearch: true,
341
+ hasStreaming: true,
342
+ });
343
+
344
+ expect(payload.data.buffer).toBeDefined();
345
+ expect(payload.data.buffer.size).toBe(150);
346
+
347
+ expect(payload.data.persistence).toBeDefined();
348
+ expect(payload.data.persistence.totalLogs).toBe(10000);
349
+ });
350
+
351
+ it('should handle only buffer stats', async () => {
352
+ (mockLogService.getStats as any).mockResolvedValue({
353
+ buffer: {
354
+ size: 50,
355
+ maxSize: 1000,
356
+ oldestTimestamp: null,
357
+ newestTimestamp: null,
358
+ },
359
+ });
360
+
361
+ (mockLogService.getCapabilities as any).mockReturnValue({
362
+ hasBuffer: true,
363
+ hasPersistence: false,
364
+ hasSearch: false,
365
+ hasStreaming: true,
366
+ });
367
+
368
+ const response = await app.inject({
369
+ method: 'GET',
370
+ url: '/api/v1/logs/stats',
371
+ });
372
+
373
+ expect(response.statusCode).toBe(200);
374
+ const payload = response.json();
375
+
376
+ expect(payload.data.buffer).toBeDefined();
377
+ expect(payload.data.persistence).toBeUndefined();
378
+ expect(payload.data.capabilities.hasPersistence).toBe(false);
379
+ });
380
+
381
+ it('should handle errors', async () => {
382
+ (mockLogService.getStats as any).mockRejectedValue(
383
+ new Error('Stats unavailable')
384
+ );
385
+
386
+ const response = await app.inject({
387
+ method: 'GET',
388
+ url: '/api/v1/logs/stats',
389
+ });
390
+
391
+ expect(response.statusCode).toBe(500);
392
+ const payload = response.json();
393
+
394
+ expect(payload.ok).toBe(false);
395
+ expect(payload.error).toBe('Failed to fetch stats');
396
+ });
397
+ });
398
+
399
+ describe('POST /api/v1/logs/summarize', () => {
400
+ it('should summarize logs with LLM', async () => {
401
+ const mockLogs = [
402
+ createMockLog('log-1', 'error', 'Database connection failed'),
403
+ createMockLog('log-2', 'error', 'Timeout connecting to DB'),
404
+ ];
405
+
406
+ (mockLogService.query as any).mockResolvedValue({
407
+ logs: mockLogs,
408
+ total: 2,
409
+ hasMore: false,
410
+ source: 'persistence',
411
+ });
412
+
413
+ // Mock platform.llm
414
+ const mockLLM = {
415
+ complete: vi.fn().mockResolvedValue({
416
+ content: 'Database connection issues detected. Multiple timeouts occurred.',
417
+ }),
418
+ };
419
+ vi.spyOn(platform, 'llm', 'get').mockReturnValue(mockLLM as any);
420
+
421
+ const response = await app.inject({
422
+ method: 'POST',
423
+ url: '/api/v1/logs/summarize',
424
+ payload: {
425
+ timeRange: {
426
+ from: new Date(Date.now() - 3600000).toISOString(),
427
+ to: new Date().toISOString(),
428
+ },
429
+ filters: { level: 'error' },
430
+ question: 'What errors occurred?',
431
+ },
432
+ });
433
+
434
+ expect(response.statusCode).toBe(200);
435
+ const payload = response.json();
436
+
437
+ expect(payload.ok).toBe(true);
438
+ expect(payload.data.aiSummary).toContain('Database connection issues');
439
+ expect(payload.data.summary.total).toBe(2);
440
+
441
+ expect(mockLogService.query).toHaveBeenCalled();
442
+ expect(mockLLM.complete).toHaveBeenCalled();
443
+ });
444
+
445
+ it('should handle missing LLM gracefully', async () => {
446
+ const mockLogs = [
447
+ createMockLog('log-1', 'error', 'Error 1'),
448
+ ];
449
+
450
+ (mockLogService.query as any).mockResolvedValue({
451
+ logs: mockLogs,
452
+ total: 1,
453
+ hasMore: false,
454
+ source: 'buffer',
455
+ });
456
+
457
+ // No LLM available
458
+ vi.spyOn(platform, 'llm', 'get').mockReturnValue(undefined as any);
459
+
460
+ const response = await app.inject({
461
+ method: 'POST',
462
+ url: '/api/v1/logs/summarize',
463
+ payload: {
464
+ question: 'What happened?',
465
+ },
466
+ });
467
+
468
+ expect(response.statusCode).toBe(200);
469
+ const payload = response.json();
470
+
471
+ expect(payload.ok).toBe(true);
472
+ expect(payload.data.aiSummary).toContain('Log Summary'); // Fallback summary
473
+ expect(payload.data.message).toContain('LLM not configured');
474
+ });
475
+
476
+ it('should handle errors', async () => {
477
+ (mockLogService.query as any).mockRejectedValue(
478
+ new Error('Query failed')
479
+ );
480
+
481
+ const response = await app.inject({
482
+ method: 'POST',
483
+ url: '/api/v1/logs/summarize',
484
+ payload: {},
485
+ });
486
+
487
+ expect(response.statusCode).toBe(500);
488
+ const payload = response.json();
489
+
490
+ expect(payload.ok).toBe(false);
491
+ expect(payload.error).toBe('Log summarization failed');
492
+ });
493
+ });
494
+ });