@kindgi/api 0.0.0-bootstrap.0 → 0.1.1

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 (505) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +216 -1
  3. package/dist/adapter-binding.d.ts +177 -0
  4. package/dist/adapter-binding.d.ts.map +1 -0
  5. package/dist/adapter-binding.js +12 -0
  6. package/dist/adapter-binding.js.map +1 -0
  7. package/dist/agent-binding.d.ts +207 -0
  8. package/dist/agent-binding.d.ts.map +1 -0
  9. package/dist/agent-binding.js +4 -0
  10. package/dist/agent-binding.js.map +1 -0
  11. package/dist/app.d.ts +770 -0
  12. package/dist/app.d.ts.map +1 -0
  13. package/dist/app.js +397 -0
  14. package/dist/app.js.map +1 -0
  15. package/dist/capability-binding.d.ts +76 -0
  16. package/dist/capability-binding.d.ts.map +1 -0
  17. package/dist/capability-binding.js +4 -0
  18. package/dist/capability-binding.js.map +1 -0
  19. package/dist/cost-binding.d.ts +175 -0
  20. package/dist/cost-binding.d.ts.map +1 -0
  21. package/dist/cost-binding.js +13 -0
  22. package/dist/cost-binding.js.map +1 -0
  23. package/dist/deployment-binding.d.ts +201 -0
  24. package/dist/deployment-binding.d.ts.map +1 -0
  25. package/dist/deployment-binding.js +4 -0
  26. package/dist/deployment-binding.js.map +1 -0
  27. package/dist/env-binding.d.ts +132 -0
  28. package/dist/env-binding.d.ts.map +1 -0
  29. package/dist/env-binding.js +4 -0
  30. package/dist/env-binding.js.map +1 -0
  31. package/dist/errors.d.ts +37 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +268 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/eval-run-binding.d.ts +196 -0
  36. package/dist/eval-run-binding.d.ts.map +1 -0
  37. package/dist/eval-run-binding.js +16 -0
  38. package/dist/eval-run-binding.js.map +1 -0
  39. package/dist/eval-run-dispatcher.d.ts +131 -0
  40. package/dist/eval-run-dispatcher.d.ts.map +1 -0
  41. package/dist/eval-run-dispatcher.js +368 -0
  42. package/dist/eval-run-dispatcher.js.map +1 -0
  43. package/dist/eval-suite-binding.d.ts +227 -0
  44. package/dist/eval-suite-binding.d.ts.map +1 -0
  45. package/dist/eval-suite-binding.js +24 -0
  46. package/dist/eval-suite-binding.js.map +1 -0
  47. package/dist/event-bus-binding.d.ts +107 -0
  48. package/dist/event-bus-binding.d.ts.map +1 -0
  49. package/dist/event-bus-binding.js +5 -0
  50. package/dist/event-bus-binding.js.map +1 -0
  51. package/dist/flow-binding.d.ts +194 -0
  52. package/dist/flow-binding.d.ts.map +1 -0
  53. package/dist/flow-binding.js +4 -0
  54. package/dist/flow-binding.js.map +1 -0
  55. package/dist/guardrail-binding.d.ts +138 -0
  56. package/dist/guardrail-binding.d.ts.map +1 -0
  57. package/dist/guardrail-binding.js +4 -0
  58. package/dist/guardrail-binding.js.map +1 -0
  59. package/dist/handler-binding.d.ts +126 -0
  60. package/dist/handler-binding.d.ts.map +1 -0
  61. package/dist/handler-binding.js +4 -0
  62. package/dist/handler-binding.js.map +1 -0
  63. package/dist/hitl-binding.d.ts +115 -0
  64. package/dist/hitl-binding.d.ts.map +1 -0
  65. package/dist/hitl-binding.js +4 -0
  66. package/dist/hitl-binding.js.map +1 -0
  67. package/dist/identity-directory-binding.d.ts +116 -0
  68. package/dist/identity-directory-binding.d.ts.map +1 -0
  69. package/dist/identity-directory-binding.js +4 -0
  70. package/dist/identity-directory-binding.js.map +1 -0
  71. package/dist/identity-provider-binding.d.ts +184 -0
  72. package/dist/identity-provider-binding.d.ts.map +1 -0
  73. package/dist/identity-provider-binding.js +4 -0
  74. package/dist/identity-provider-binding.js.map +1 -0
  75. package/dist/image-registry-binding.d.ts +165 -0
  76. package/dist/image-registry-binding.d.ts.map +1 -0
  77. package/dist/image-registry-binding.js +4 -0
  78. package/dist/image-registry-binding.js.map +1 -0
  79. package/dist/index.d.ts +72 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +26 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/key-management-binding.d.ts +101 -0
  84. package/dist/key-management-binding.d.ts.map +1 -0
  85. package/dist/key-management-binding.js +4 -0
  86. package/dist/key-management-binding.js.map +1 -0
  87. package/dist/mcp-endpoint-binding.d.ts +312 -0
  88. package/dist/mcp-endpoint-binding.d.ts.map +1 -0
  89. package/dist/mcp-endpoint-binding.js +12 -0
  90. package/dist/mcp-endpoint-binding.js.map +1 -0
  91. package/dist/memory-binding.d.ts +209 -0
  92. package/dist/memory-binding.d.ts.map +1 -0
  93. package/dist/memory-binding.js +4 -0
  94. package/dist/memory-binding.js.map +1 -0
  95. package/dist/middleware/auth.d.ts +168 -0
  96. package/dist/middleware/auth.d.ts.map +1 -0
  97. package/dist/middleware/auth.js +247 -0
  98. package/dist/middleware/auth.js.map +1 -0
  99. package/dist/middleware/authorize.d.ts +26 -0
  100. package/dist/middleware/authorize.d.ts.map +1 -0
  101. package/dist/middleware/authorize.js +65 -0
  102. package/dist/middleware/authorize.js.map +1 -0
  103. package/dist/middleware/error-mapper.d.ts +20 -0
  104. package/dist/middleware/error-mapper.d.ts.map +1 -0
  105. package/dist/middleware/error-mapper.js +34 -0
  106. package/dist/middleware/error-mapper.js.map +1 -0
  107. package/dist/middleware/idempotency.d.ts +43 -0
  108. package/dist/middleware/idempotency.d.ts.map +1 -0
  109. package/dist/middleware/idempotency.js +118 -0
  110. package/dist/middleware/idempotency.js.map +1 -0
  111. package/dist/middleware/principal.d.ts +4 -0
  112. package/dist/middleware/principal.d.ts.map +1 -0
  113. package/dist/middleware/principal.js +42 -0
  114. package/dist/middleware/principal.js.map +1 -0
  115. package/dist/middleware/public-run-routes.d.ts +16 -0
  116. package/dist/middleware/public-run-routes.d.ts.map +1 -0
  117. package/dist/middleware/public-run-routes.js +43 -0
  118. package/dist/middleware/public-run-routes.js.map +1 -0
  119. package/dist/middleware/request-id.d.ts +14 -0
  120. package/dist/middleware/request-id.d.ts.map +1 -0
  121. package/dist/middleware/request-id.js +24 -0
  122. package/dist/middleware/request-id.js.map +1 -0
  123. package/dist/middleware/sigv4-verify.d.ts +64 -0
  124. package/dist/middleware/sigv4-verify.d.ts.map +1 -0
  125. package/dist/middleware/sigv4-verify.js +286 -0
  126. package/dist/middleware/sigv4-verify.js.map +1 -0
  127. package/dist/middleware/sigv4.d.ts +25 -0
  128. package/dist/middleware/sigv4.d.ts.map +1 -0
  129. package/dist/middleware/sigv4.js +120 -0
  130. package/dist/middleware/sigv4.js.map +1 -0
  131. package/dist/openapi/generate.d.ts +15 -0
  132. package/dist/openapi/generate.d.ts.map +1 -0
  133. package/dist/openapi/generate.js +241 -0
  134. package/dist/openapi/generate.js.map +1 -0
  135. package/dist/openapi/operations.d.ts +70 -0
  136. package/dist/openapi/operations.d.ts.map +1 -0
  137. package/dist/openapi/operations.js +5050 -0
  138. package/dist/openapi/operations.js.map +1 -0
  139. package/dist/openapi/schemas.d.ts +590 -0
  140. package/dist/openapi/schemas.d.ts.map +1 -0
  141. package/dist/openapi/schemas.js +5820 -0
  142. package/dist/openapi/schemas.js.map +1 -0
  143. package/dist/provenance-binding.d.ts +116 -0
  144. package/dist/provenance-binding.d.ts.map +1 -0
  145. package/dist/provenance-binding.js +31 -0
  146. package/dist/provenance-binding.js.map +1 -0
  147. package/dist/provider-binding.d.ts +174 -0
  148. package/dist/provider-binding.d.ts.map +1 -0
  149. package/dist/provider-binding.js +4 -0
  150. package/dist/provider-binding.js.map +1 -0
  151. package/dist/public-run-token.d.ts +97 -0
  152. package/dist/public-run-token.d.ts.map +1 -0
  153. package/dist/public-run-token.js +167 -0
  154. package/dist/public-run-token.js.map +1 -0
  155. package/dist/retention-binding.d.ts +69 -0
  156. package/dist/retention-binding.d.ts.map +1 -0
  157. package/dist/retention-binding.js +4 -0
  158. package/dist/retention-binding.js.map +1 -0
  159. package/dist/reviewer-binding.d.ts +84 -0
  160. package/dist/reviewer-binding.d.ts.map +1 -0
  161. package/dist/reviewer-binding.js +4 -0
  162. package/dist/reviewer-binding.js.map +1 -0
  163. package/dist/rotation-status-store.d.ts +96 -0
  164. package/dist/rotation-status-store.d.ts.map +1 -0
  165. package/dist/rotation-status-store.js +106 -0
  166. package/dist/rotation-status-store.js.map +1 -0
  167. package/dist/routes/adapters.d.ts +29 -0
  168. package/dist/routes/adapters.d.ts.map +1 -0
  169. package/dist/routes/adapters.js +230 -0
  170. package/dist/routes/adapters.js.map +1 -0
  171. package/dist/routes/agents.d.ts +17 -0
  172. package/dist/routes/agents.d.ts.map +1 -0
  173. package/dist/routes/agents.js +342 -0
  174. package/dist/routes/agents.js.map +1 -0
  175. package/dist/routes/approvals.d.ts +37 -0
  176. package/dist/routes/approvals.d.ts.map +1 -0
  177. package/dist/routes/approvals.js +551 -0
  178. package/dist/routes/approvals.js.map +1 -0
  179. package/dist/routes/artifacts.d.ts +25 -0
  180. package/dist/routes/artifacts.d.ts.map +1 -0
  181. package/dist/routes/artifacts.js +265 -0
  182. package/dist/routes/artifacts.js.map +1 -0
  183. package/dist/routes/audit.d.ts +6 -0
  184. package/dist/routes/audit.d.ts.map +1 -0
  185. package/dist/routes/audit.js +162 -0
  186. package/dist/routes/audit.js.map +1 -0
  187. package/dist/routes/auth.d.ts +47 -0
  188. package/dist/routes/auth.d.ts.map +1 -0
  189. package/dist/routes/auth.js +630 -0
  190. package/dist/routes/auth.js.map +1 -0
  191. package/dist/routes/capabilities.d.ts +14 -0
  192. package/dist/routes/capabilities.d.ts.map +1 -0
  193. package/dist/routes/capabilities.js +62 -0
  194. package/dist/routes/capabilities.js.map +1 -0
  195. package/dist/routes/compliance.d.ts +37 -0
  196. package/dist/routes/compliance.d.ts.map +1 -0
  197. package/dist/routes/compliance.js +321 -0
  198. package/dist/routes/compliance.js.map +1 -0
  199. package/dist/routes/conversations.d.ts +13 -0
  200. package/dist/routes/conversations.d.ts.map +1 -0
  201. package/dist/routes/conversations.js +295 -0
  202. package/dist/routes/conversations.js.map +1 -0
  203. package/dist/routes/cost.d.ts +24 -0
  204. package/dist/routes/cost.d.ts.map +1 -0
  205. package/dist/routes/cost.js +243 -0
  206. package/dist/routes/cost.js.map +1 -0
  207. package/dist/routes/deployments.d.ts +122 -0
  208. package/dist/routes/deployments.d.ts.map +1 -0
  209. package/dist/routes/deployments.js +1036 -0
  210. package/dist/routes/deployments.js.map +1 -0
  211. package/dist/routes/env.d.ts +62 -0
  212. package/dist/routes/env.d.ts.map +1 -0
  213. package/dist/routes/env.js +311 -0
  214. package/dist/routes/env.js.map +1 -0
  215. package/dist/routes/eval-runs.d.ts +28 -0
  216. package/dist/routes/eval-runs.d.ts.map +1 -0
  217. package/dist/routes/eval-runs.js +479 -0
  218. package/dist/routes/eval-runs.js.map +1 -0
  219. package/dist/routes/eval-suites.d.ts +24 -0
  220. package/dist/routes/eval-suites.d.ts.map +1 -0
  221. package/dist/routes/eval-suites.js +381 -0
  222. package/dist/routes/eval-suites.js.map +1 -0
  223. package/dist/routes/event-triggers.d.ts +12 -0
  224. package/dist/routes/event-triggers.d.ts.map +1 -0
  225. package/dist/routes/event-triggers.js +218 -0
  226. package/dist/routes/event-triggers.js.map +1 -0
  227. package/dist/routes/flows.d.ts +23 -0
  228. package/dist/routes/flows.d.ts.map +1 -0
  229. package/dist/routes/flows.js +344 -0
  230. package/dist/routes/flows.js.map +1 -0
  231. package/dist/routes/guardrails.d.ts +33 -0
  232. package/dist/routes/guardrails.d.ts.map +1 -0
  233. package/dist/routes/guardrails.js +236 -0
  234. package/dist/routes/guardrails.js.map +1 -0
  235. package/dist/routes/identity.d.ts +39 -0
  236. package/dist/routes/identity.d.ts.map +1 -0
  237. package/dist/routes/identity.js +138 -0
  238. package/dist/routes/identity.js.map +1 -0
  239. package/dist/routes/mcp.d.ts +23 -0
  240. package/dist/routes/mcp.d.ts.map +1 -0
  241. package/dist/routes/mcp.js +727 -0
  242. package/dist/routes/mcp.js.map +1 -0
  243. package/dist/routes/memory.d.ts +16 -0
  244. package/dist/routes/memory.d.ts.map +1 -0
  245. package/dist/routes/memory.js +353 -0
  246. package/dist/routes/memory.js.map +1 -0
  247. package/dist/routes/observations.d.ts +19 -0
  248. package/dist/routes/observations.d.ts.map +1 -0
  249. package/dist/routes/observations.js +135 -0
  250. package/dist/routes/observations.js.map +1 -0
  251. package/dist/routes/orgs.d.ts +24 -0
  252. package/dist/routes/orgs.d.ts.map +1 -0
  253. package/dist/routes/orgs.js +208 -0
  254. package/dist/routes/orgs.js.map +1 -0
  255. package/dist/routes/pagination.d.ts +18 -0
  256. package/dist/routes/pagination.d.ts.map +1 -0
  257. package/dist/routes/pagination.js +35 -0
  258. package/dist/routes/pagination.js.map +1 -0
  259. package/dist/routes/policies.d.ts +23 -0
  260. package/dist/routes/policies.d.ts.map +1 -0
  261. package/dist/routes/policies.js +314 -0
  262. package/dist/routes/policies.js.map +1 -0
  263. package/dist/routes/projects.d.ts +45 -0
  264. package/dist/routes/projects.d.ts.map +1 -0
  265. package/dist/routes/projects.js +485 -0
  266. package/dist/routes/projects.js.map +1 -0
  267. package/dist/routes/proposals.d.ts +24 -0
  268. package/dist/routes/proposals.d.ts.map +1 -0
  269. package/dist/routes/proposals.js +581 -0
  270. package/dist/routes/proposals.js.map +1 -0
  271. package/dist/routes/provenance.d.ts +34 -0
  272. package/dist/routes/provenance.d.ts.map +1 -0
  273. package/dist/routes/provenance.js +274 -0
  274. package/dist/routes/provenance.js.map +1 -0
  275. package/dist/routes/providers.d.ts +32 -0
  276. package/dist/routes/providers.d.ts.map +1 -0
  277. package/dist/routes/providers.js +490 -0
  278. package/dist/routes/providers.js.map +1 -0
  279. package/dist/routes/public-run-tokens.d.ts +17 -0
  280. package/dist/routes/public-run-tokens.d.ts.map +1 -0
  281. package/dist/routes/public-run-tokens.js +69 -0
  282. package/dist/routes/public-run-tokens.js.map +1 -0
  283. package/dist/routes/retention.d.ts +19 -0
  284. package/dist/routes/retention.d.ts.map +1 -0
  285. package/dist/routes/retention.js +152 -0
  286. package/dist/routes/retention.js.map +1 -0
  287. package/dist/routes/reviewers.d.ts +5 -0
  288. package/dist/routes/reviewers.d.ts.map +1 -0
  289. package/dist/routes/reviewers.js +161 -0
  290. package/dist/routes/reviewers.js.map +1 -0
  291. package/dist/routes/runs.d.ts +34 -0
  292. package/dist/routes/runs.d.ts.map +1 -0
  293. package/dist/routes/runs.js +705 -0
  294. package/dist/routes/runs.js.map +1 -0
  295. package/dist/routes/s3.d.ts +31 -0
  296. package/dist/routes/s3.d.ts.map +1 -0
  297. package/dist/routes/s3.js +433 -0
  298. package/dist/routes/s3.js.map +1 -0
  299. package/dist/routes/schedules.d.ts +20 -0
  300. package/dist/routes/schedules.d.ts.map +1 -0
  301. package/dist/routes/schedules.js +234 -0
  302. package/dist/routes/schedules.js.map +1 -0
  303. package/dist/routes/scope-params.d.ts +57 -0
  304. package/dist/routes/scope-params.d.ts.map +1 -0
  305. package/dist/routes/scope-params.js +105 -0
  306. package/dist/routes/scope-params.js.map +1 -0
  307. package/dist/routes/secret-ref.d.ts +20 -0
  308. package/dist/routes/secret-ref.d.ts.map +1 -0
  309. package/dist/routes/secret-ref.js +42 -0
  310. package/dist/routes/secret-ref.js.map +1 -0
  311. package/dist/routes/secrets.d.ts +53 -0
  312. package/dist/routes/secrets.d.ts.map +1 -0
  313. package/dist/routes/secrets.js +715 -0
  314. package/dist/routes/secrets.js.map +1 -0
  315. package/dist/routes/signing-keys.d.ts +23 -0
  316. package/dist/routes/signing-keys.d.ts.map +1 -0
  317. package/dist/routes/signing-keys.js +212 -0
  318. package/dist/routes/signing-keys.js.map +1 -0
  319. package/dist/routes/sse.d.ts +58 -0
  320. package/dist/routes/sse.d.ts.map +1 -0
  321. package/dist/routes/sse.js +92 -0
  322. package/dist/routes/sse.js.map +1 -0
  323. package/dist/routes/teams.d.ts +30 -0
  324. package/dist/routes/teams.d.ts.map +1 -0
  325. package/dist/routes/teams.js +443 -0
  326. package/dist/routes/teams.js.map +1 -0
  327. package/dist/routes/tenant.d.ts +57 -0
  328. package/dist/routes/tenant.d.ts.map +1 -0
  329. package/dist/routes/tenant.js +352 -0
  330. package/dist/routes/tenant.js.map +1 -0
  331. package/dist/routes/tokens.d.ts +14 -0
  332. package/dist/routes/tokens.d.ts.map +1 -0
  333. package/dist/routes/tokens.js +231 -0
  334. package/dist/routes/tokens.js.map +1 -0
  335. package/dist/routes/tools.d.ts +33 -0
  336. package/dist/routes/tools.d.ts.map +1 -0
  337. package/dist/routes/tools.js +380 -0
  338. package/dist/routes/tools.js.map +1 -0
  339. package/dist/routes/webhook-endpoints.d.ts +10 -0
  340. package/dist/routes/webhook-endpoints.d.ts.map +1 -0
  341. package/dist/routes/webhook-endpoints.js +407 -0
  342. package/dist/routes/webhook-endpoints.js.map +1 -0
  343. package/dist/routes/webhooks.d.ts +21 -0
  344. package/dist/routes/webhooks.d.ts.map +1 -0
  345. package/dist/routes/webhooks.js +228 -0
  346. package/dist/routes/webhooks.js.map +1 -0
  347. package/dist/s3-credential-binding.d.ts +54 -0
  348. package/dist/s3-credential-binding.d.ts.map +1 -0
  349. package/dist/s3-credential-binding.js +4 -0
  350. package/dist/s3-credential-binding.js.map +1 -0
  351. package/dist/secrets-binding.d.ts +281 -0
  352. package/dist/secrets-binding.d.ts.map +1 -0
  353. package/dist/secrets-binding.js +10 -0
  354. package/dist/secrets-binding.js.map +1 -0
  355. package/dist/secrets-provider-binding.d.ts +164 -0
  356. package/dist/secrets-provider-binding.d.ts.map +1 -0
  357. package/dist/secrets-provider-binding.js +4 -0
  358. package/dist/secrets-provider-binding.js.map +1 -0
  359. package/dist/session-store-binding.d.ts +148 -0
  360. package/dist/session-store-binding.d.ts.map +1 -0
  361. package/dist/session-store-binding.js +4 -0
  362. package/dist/session-store-binding.js.map +1 -0
  363. package/dist/signing-key-binding.d.ts +210 -0
  364. package/dist/signing-key-binding.d.ts.map +1 -0
  365. package/dist/signing-key-binding.js +4 -0
  366. package/dist/signing-key-binding.js.map +1 -0
  367. package/dist/state-store-binding.d.ts +53 -0
  368. package/dist/state-store-binding.d.ts.map +1 -0
  369. package/dist/state-store-binding.js +38 -0
  370. package/dist/state-store-binding.js.map +1 -0
  371. package/dist/supervisor-binding.d.ts +526 -0
  372. package/dist/supervisor-binding.d.ts.map +1 -0
  373. package/dist/supervisor-binding.js +4 -0
  374. package/dist/supervisor-binding.js.map +1 -0
  375. package/dist/tenant-host-access.d.ts +41 -0
  376. package/dist/tenant-host-access.d.ts.map +1 -0
  377. package/dist/tenant-host-access.js +42 -0
  378. package/dist/tenant-host-access.js.map +1 -0
  379. package/dist/token-admin.d.ts +99 -0
  380. package/dist/token-admin.d.ts.map +1 -0
  381. package/dist/token-admin.js +4 -0
  382. package/dist/token-admin.js.map +1 -0
  383. package/dist/tool-binding.d.ts +247 -0
  384. package/dist/tool-binding.d.ts.map +1 -0
  385. package/dist/tool-binding.js +4 -0
  386. package/dist/tool-binding.js.map +1 -0
  387. package/dist/trigger-binding.d.ts +13 -0
  388. package/dist/trigger-binding.d.ts.map +1 -0
  389. package/dist/trigger-binding.js +4 -0
  390. package/dist/trigger-binding.js.map +1 -0
  391. package/dist/types.d.ts +71 -0
  392. package/dist/types.d.ts.map +1 -0
  393. package/dist/types.js +4 -0
  394. package/dist/types.js.map +1 -0
  395. package/dist/webhook-endpoint-binding.d.ts +230 -0
  396. package/dist/webhook-endpoint-binding.d.ts.map +1 -0
  397. package/dist/webhook-endpoint-binding.js +12 -0
  398. package/dist/webhook-endpoint-binding.js.map +1 -0
  399. package/dist/xml.d.ts +79 -0
  400. package/dist/xml.d.ts.map +1 -0
  401. package/dist/xml.js +115 -0
  402. package/dist/xml.js.map +1 -0
  403. package/openapi.json +29649 -0
  404. package/package.json +76 -4
  405. package/scripts/emit-openapi.mjs +44 -0
  406. package/src/adapter-binding.ts +204 -0
  407. package/src/agent-binding.ts +231 -0
  408. package/src/app.ts +1286 -0
  409. package/src/capability-binding.ts +83 -0
  410. package/src/cost-binding.ts +213 -0
  411. package/src/deployment-binding.ts +225 -0
  412. package/src/env-binding.ts +140 -0
  413. package/src/errors.ts +295 -0
  414. package/src/eval-run-binding.ts +209 -0
  415. package/src/eval-run-dispatcher.ts +497 -0
  416. package/src/eval-suite-binding.ts +257 -0
  417. package/src/event-bus-binding.ts +127 -0
  418. package/src/flow-binding.ts +213 -0
  419. package/src/guardrail-binding.ts +151 -0
  420. package/src/handler-binding.ts +132 -0
  421. package/src/hitl-binding.ts +172 -0
  422. package/src/identity-directory-binding.ts +128 -0
  423. package/src/identity-provider-binding.ts +203 -0
  424. package/src/image-registry-binding.ts +193 -0
  425. package/src/index.ts +606 -0
  426. package/src/key-management-binding.ts +91 -0
  427. package/src/mcp-endpoint-binding.ts +311 -0
  428. package/src/memory-binding.ts +239 -0
  429. package/src/middleware/auth.ts +437 -0
  430. package/src/middleware/authorize.ts +125 -0
  431. package/src/middleware/error-mapper.ts +40 -0
  432. package/src/middleware/idempotency.ts +160 -0
  433. package/src/middleware/principal.ts +64 -0
  434. package/src/middleware/public-run-routes.ts +50 -0
  435. package/src/middleware/request-id.ts +28 -0
  436. package/src/middleware/sigv4-verify.ts +374 -0
  437. package/src/middleware/sigv4.ts +165 -0
  438. package/src/openapi/generate.ts +307 -0
  439. package/src/openapi/operations.ts +5444 -0
  440. package/src/openapi/schemas.ts +6363 -0
  441. package/src/provenance-binding.ts +169 -0
  442. package/src/provider-binding.ts +196 -0
  443. package/src/public-run-token.ts +263 -0
  444. package/src/retention-binding.ts +78 -0
  445. package/src/reviewer-binding.ts +99 -0
  446. package/src/rotation-status-store.ts +209 -0
  447. package/src/routes/adapters.ts +319 -0
  448. package/src/routes/agents.ts +424 -0
  449. package/src/routes/approvals.ts +759 -0
  450. package/src/routes/artifacts.ts +317 -0
  451. package/src/routes/audit.ts +219 -0
  452. package/src/routes/auth.ts +806 -0
  453. package/src/routes/capabilities.ts +79 -0
  454. package/src/routes/compliance.ts +482 -0
  455. package/src/routes/conversations.ts +369 -0
  456. package/src/routes/cost.ts +327 -0
  457. package/src/routes/deployments.ts +1493 -0
  458. package/src/routes/env.ts +429 -0
  459. package/src/routes/eval-runs.ts +631 -0
  460. package/src/routes/eval-suites.ts +490 -0
  461. package/src/routes/event-triggers.ts +283 -0
  462. package/src/routes/flows.ts +423 -0
  463. package/src/routes/guardrails.ts +320 -0
  464. package/src/routes/identity.ts +203 -0
  465. package/src/routes/mcp.ts +940 -0
  466. package/src/routes/memory.ts +430 -0
  467. package/src/routes/observations.ts +175 -0
  468. package/src/routes/orgs.ts +273 -0
  469. package/src/routes/pagination.ts +51 -0
  470. package/src/routes/policies.ts +413 -0
  471. package/src/routes/projects.ts +634 -0
  472. package/src/routes/proposals.ts +719 -0
  473. package/src/routes/provenance.ts +406 -0
  474. package/src/routes/providers.ts +624 -0
  475. package/src/routes/public-run-tokens.ts +104 -0
  476. package/src/routes/retention.ts +193 -0
  477. package/src/routes/reviewers.ts +209 -0
  478. package/src/routes/runs.ts +892 -0
  479. package/src/routes/s3.ts +519 -0
  480. package/src/routes/schedules.ts +300 -0
  481. package/src/routes/scope-params.ts +133 -0
  482. package/src/routes/secret-ref.ts +52 -0
  483. package/src/routes/secrets.ts +975 -0
  484. package/src/routes/signing-keys.ts +259 -0
  485. package/src/routes/sse.ts +148 -0
  486. package/src/routes/teams.ts +584 -0
  487. package/src/routes/tenant.ts +530 -0
  488. package/src/routes/tokens.ts +285 -0
  489. package/src/routes/tools.ts +491 -0
  490. package/src/routes/webhook-endpoints.ts +534 -0
  491. package/src/routes/webhooks.ts +296 -0
  492. package/src/s3-credential-binding.ts +58 -0
  493. package/src/secrets-binding.ts +308 -0
  494. package/src/secrets-provider-binding.ts +167 -0
  495. package/src/session-store-binding.ts +163 -0
  496. package/src/signing-key-binding.ts +235 -0
  497. package/src/state-store-binding.ts +84 -0
  498. package/src/supervisor-binding.ts +554 -0
  499. package/src/tenant-host-access.ts +62 -0
  500. package/src/token-admin.ts +104 -0
  501. package/src/tool-binding.ts +274 -0
  502. package/src/trigger-binding.ts +38 -0
  503. package/src/types.ts +74 -0
  504. package/src/webhook-endpoint-binding.ts +246 -0
  505. package/src/xml.ts +196 -0
package/dist/app.d.ts ADDED
@@ -0,0 +1,770 @@
1
+ import { Hono } from 'hono';
2
+ import type { ConversationBinding, RunSnapshotBinding } from '@kindgi/agents';
3
+ import type { AuditEventBinding } from '@kindgi/audit-events';
4
+ import type { AuthzCheckBinding } from '@kindgi/authz';
5
+ import type { AdapterFactoryRegistry } from '@kindgi/capabilities';
6
+ import type { ComplianceEvidenceGenerator, LoadedClassifier } from '@kindgi/compliance';
7
+ import type { SigningKeyBinding } from '@kindgi/crypto';
8
+ import type { TenantHierarchyBinding } from '@kindgi/platform';
9
+ import type { OrgBinding, ProjectBinding, ProjectMembershipBinding, TeamBinding, TeamMembershipBinding, TeamProjectGrantBinding } from '@kindgi/platform';
10
+ import type { KernelBinding } from '@kindgi/runtime';
11
+ import type { BlobStorageBinding } from '@kindgi/blob-binding';
12
+ import type { MemoryQueryBinding } from '@kindgi/memory';
13
+ import type { PolicyRegistryBinding } from '@kindgi/policy-contract';
14
+ import type { AdapterRegistryBinding } from './adapter-binding.js';
15
+ import type { AgentRegistryBinding } from './agent-binding.js';
16
+ import type { CapabilityRegistryBinding } from './capability-binding.js';
17
+ import type { CostBinding } from './cost-binding.js';
18
+ import type { DeploymentBinding } from './deployment-binding.js';
19
+ import type { EnvBinding } from './env-binding.js';
20
+ import type { EvalRunBinding } from './eval-run-binding.js';
21
+ import type { EvalSuiteRegistryBinding } from './eval-suite-binding.js';
22
+ import type { EventBusBinding } from './event-bus-binding.js';
23
+ import type { FlowRegistryBinding } from './flow-binding.js';
24
+ import type { GuardrailRegistryBinding } from './guardrail-binding.js';
25
+ import type { RunHandlerBinding } from './handler-binding.js';
26
+ import type { HitlBinding } from './hitl-binding.js';
27
+ import type { IdentityDirectoryBinding } from './identity-directory-binding.js';
28
+ import type { ExchangeCodeFn, IdentityProviderBinding, RefreshTokenFn } from './identity-provider-binding.js';
29
+ import type { ImageRegistryBinding } from './image-registry-binding.js';
30
+ import type { MCPClientProbeBinding, MCPEndpointRegistryBinding } from './mcp-endpoint-binding.js';
31
+ import type { MemoryBinding } from './memory-binding.js';
32
+ import { type TokenResolver } from './middleware/auth.js';
33
+ import { type IdempotencyStore } from './middleware/idempotency.js';
34
+ import { type GenerateOptions } from './openapi/generate.js';
35
+ import type { ProvenanceBinding } from './provenance-binding.js';
36
+ import type { ProviderRegistryBinding } from './provider-binding.js';
37
+ import { type PublicRunTokenConfig } from './public-run-token.js';
38
+ import type { RetentionBinding } from './retention-binding.js';
39
+ import type { ReviewerBinding, ReviewerRegistryBinding } from './reviewer-binding.js';
40
+ import { type RotationStatusStore } from './rotation-status-store.js';
41
+ import type { S3CredentialBinding } from './s3-credential-binding.js';
42
+ import type { SecretBinding } from './secrets-binding.js';
43
+ import type { SessionStoreBinding } from './session-store-binding.js';
44
+ import type { SigningKeyBinding as SigningKeyRegistryBinding } from './signing-key-binding.js';
45
+ import { type OauthStateStore } from './state-store-binding.js';
46
+ import type { SupervisorBinding } from './supervisor-binding.js';
47
+ import type { TenantHostAccess } from './tenant-host-access.js';
48
+ import type { TokenAdmin } from './token-admin.js';
49
+ import type { ToolRegistryBinding } from './tool-binding.js';
50
+ import type { TriggerRegistryBinding } from './trigger-binding.js';
51
+ import type { AppEnv } from './types.js';
52
+ import type { WebhookEndpointBinding } from './webhook-endpoint-binding.js';
53
+ /**
54
+ * Assemble the platform HTTP app. Caller-injectable dependencies:
55
+ *
56
+ * - `resolveToken`: `(token) → Promise<{ tenantId, … } | null>`. Caller
57
+ * plugs in the actual token store — this package doesn't own auth
58
+ * persistence.
59
+ * - `runHandler`: bridge from `POST /v1/runs` requests into the
60
+ * agent/flow invocation stack. See `RunHandlerBinding` for shape.
61
+ *
62
+ * The returned app is a plain Hono instance; callers mount it on a
63
+ * server (e.g. `@hono/node-server`) or invoke `.request(...)` directly
64
+ * for tests.
65
+ */
66
+ export interface CreateAppInput {
67
+ readonly resolveToken: TokenResolver;
68
+ readonly runHandler: RunHandlerBinding;
69
+ /**
70
+ * Conversation store binding — openConversation / getConversation /
71
+ * listConversations / listConversationsPage / closeConversation /
72
+ * deleteConversation / appendMessage / readMessages. Every
73
+ * conversation-touching route (conversations, approvals audit
74
+ * bundle, provenance signed export) routes through this binding.
75
+ * The Kindgi runtime supplies an implementation. Required.
76
+ */
77
+ readonly conversationBinding: ConversationBinding;
78
+ /**
79
+ * Run-snapshot store binding — write / read on the run reconstruction
80
+ * envelope. Not called by this package's routes; required so the host
81
+ * can assemble a complete `InvokeAgentBindings` (`@kindgi/agents`)
82
+ * when it constructs the agent-runtime handler. The Kindgi runtime
83
+ * supplies an implementation.
84
+ */
85
+ readonly runSnapshotBinding: RunSnapshotBinding;
86
+ /**
87
+ * Kernel binding (`@kindgi/runtime`) for run lifecycle + scheduler /
88
+ * waitpoint / retention / trigger-registry / event-bus sub-bindings.
89
+ * The Kindgi runtime supplies one (or pass a bespoke implementation).
90
+ *
91
+ * Required — @kindgi/api holds no reference to the kernel
92
+ * itself, so the caller owns the construction.
93
+ */
94
+ readonly kernelBinding: KernelBinding;
95
+ /**
96
+ * Tenant-hierarchy CRUD binding — atomic entity writes + FGA
97
+ * parent/owner tuple emission. Used by the always-mounted
98
+ * `/v1/tenant` route and by `/v1/orgs`, `/v1/teams`, `/v1/projects`
99
+ * when the corresponding platform bindings are supplied. The Kindgi
100
+ * runtime supplies an implementation.
101
+ *
102
+ * Required — same rationale as `kernelBinding`.
103
+ */
104
+ readonly tenantHierarchyBinding: TenantHierarchyBinding;
105
+ /**
106
+ * Memory data-access binding — listFacts / searchByKeyword /
107
+ * searchBySemantic / appendLog / readLog. Every agent-runtime memory
108
+ * read and log write routes through this binding. This package's
109
+ * routes don't call it (conversation transcripts are read through
110
+ * `conversationBinding`). The Kindgi runtime supplies an
111
+ * implementation (or pass a bespoke one).
112
+ *
113
+ * Required — same rationale as `kernelBinding` / `provenanceBinding`.
114
+ */
115
+ readonly memoryBinding: MemoryQueryBinding;
116
+ /**
117
+ * Provenance data-access binding — list summaries + full-DAG reads
118
+ * over stored provenance records. Used by the always-mounted
119
+ * `/v1/provenance` routes. The Kindgi runtime supplies an
120
+ * implementation (or pass a bespoke one).
121
+ *
122
+ * Required — @kindgi/api never touches the provenance schema or
123
+ * domain functions directly, so the caller owns the default
124
+ * construction.
125
+ */
126
+ readonly provenanceBinding: ProvenanceBinding;
127
+ /**
128
+ * Optional authz enforcement config. When present, route handlers get
129
+ * an `Authorizer` (`authorize()` / `can()` / `check()` /
130
+ * `filterByCan()`) backed by `authzCheckBinding`. `principalMiddleware`
131
+ * runs on `/v1/*` either way. When absent (e.g. dev deployments),
132
+ * routes still work but authz is not enforced — bearer + capability
133
+ * gates are the only checks.
134
+ */
135
+ readonly authz?: {
136
+ readonly fgaApiUrl: string;
137
+ /**
138
+ * PDP binding (`@kindgi/authz`) — `check(principal, action,
139
+ * resource, ctx?)` + `checkBatch(...)`. The Kindgi runtime supplies
140
+ * one (or pass a bespoke implementation).
141
+ */
142
+ readonly authzCheckBinding: AuthzCheckBinding;
143
+ };
144
+ /**
145
+ * Optional unified audit substrate. When present:
146
+ * - `GET /v1/audit/authz` is mounted (admin@tenant only) as a
147
+ * view filtered to `kind='authz-decision'`. Those events are
148
+ * written by the authz check binding (wired to this same sink),
149
+ * correlated with the request's `x-request-id` — the `Authorizer`
150
+ * passes it as `correlationId` on every `check()`.
151
+ * - `/v1/compliance/*` is mounted as a view filtered to
152
+ * classifier-marked exportable kinds (needs
153
+ * `complianceClassifier` too).
154
+ * Absent = no durable audit trail; every subsystem's audit
155
+ * writes become no-ops.
156
+ *
157
+ * One write surface — authz decisions and compliance evidence share
158
+ * this single binding.
159
+ */
160
+ readonly auditEvents?: AuditEventBinding;
161
+ /**
162
+ * Optional classification lens over `auditEvents`. Drives which
163
+ * audit-event kinds appear in the `/v1/compliance/*` view and (at
164
+ * export time) which get an Ed25519 signature. Absent =
165
+ * `/v1/compliance/*` is not mounted.
166
+ */
167
+ readonly complianceClassifier?: LoadedClassifier;
168
+ /**
169
+ * Optional compliance-evidence generator. Required when
170
+ * `auditEvents` + `complianceClassifier` are provided (i.e., when
171
+ * `/v1/compliance/*` mounts). The Kindgi runtime supplies the
172
+ * generator (or pass a bespoke implementation). The public interface
173
+ * has recordFromRun / exportSigned / describe; implementations may add
174
+ * more (e.g. subscriptions), which @kindgi/api doesn't use.
175
+ */
176
+ readonly complianceGenerator?: ComplianceEvidenceGenerator;
177
+ /**
178
+ * Optional. When omitted, a per-app in-memory store is used —
179
+ * appropriate for dev + tests, NOT for production (retries after a
180
+ * process restart won't dedupe). Prod deployments pass a persistent
181
+ * store (Postgres, Redis, etc.).
182
+ */
183
+ readonly idempotencyStore?: IdempotencyStore;
184
+ /**
185
+ * Optional. When present, mounts the API-key routes: `POST /v1/tokens`
186
+ * (mint), `GET /v1/tokens` (list), `GET /v1/tokens/:tokenId` and
187
+ * `POST /v1/tokens/:tokenId/revoke`. Omit if the deployment manages
188
+ * keys out-of-band (e.g. via a separate admin console).
189
+ */
190
+ readonly tokenAdmin?: TokenAdmin;
191
+ /**
192
+ * Optional. When present, mounts the HITL surface:
193
+ * - `GET /v1/approvals` (list, role-scoped)
194
+ * - `GET /v1/approvals/:approvalId`
195
+ * - `POST /v1/approvals/:approvalId/complete`
196
+ *
197
+ * Requires a `ReviewerBinding` because `hitl.submitReview` needs the
198
+ * reviewer's id (not their user id). Deployments plug in the
199
+ * `UserId → ReviewerId` lookup here.
200
+ *
201
+ * Also requires `hitlBinding` — the data-access surface. The Kindgi
202
+ * runtime supplies one (or pass a bespoke implementation); the api
203
+ * package holds no reference to the HITL domain functions.
204
+ */
205
+ readonly reviewerBinding?: ReviewerBinding;
206
+ /**
207
+ * Required alongside `reviewerBinding`. The approvals data-access
208
+ * binding (`getApproval` / `listApprovals` / `submitReview` /
209
+ * `loadReviewDecision`) — `@kindgi/api` never touches the HITL
210
+ * domain functions or their storage directly. The Kindgi runtime
211
+ * supplies an implementation.
212
+ */
213
+ readonly hitlBinding?: HitlBinding;
214
+ /**
215
+ * Optional. When present, mounts the reviewer roster sub-resource
216
+ * at `/v1/approvals/reviewers` — list / get / register / unregister.
217
+ * Caller-plugged, same pattern as `agentRegistry`. Distinct from
218
+ * `reviewerBinding` (which resolves a token's `UserId` to a
219
+ * `ReviewerId` for decision routing) so a deployment can wire the
220
+ * two independently.
221
+ */
222
+ readonly reviewerRegistry?: ReviewerRegistryBinding;
223
+ /**
224
+ * Optional. When `true` AND `supervisor` is wired, mounts
225
+ * `GET /v1/observations` (supervisor readback). Both are needed —
226
+ * the flag is the deploy-time opt-in, the binding is the query seam.
227
+ * Without a `supervisor`
228
+ * binding this flag is a no-op.
229
+ */
230
+ readonly enableObservations?: boolean;
231
+ /**
232
+ * Optional. When present, mounts the agents catalog surface
233
+ * (`/v1/agents` list/get/publish, `/v1/agents/:agentId/versions/*`).
234
+ * Same caller-plugged pattern as `TokenAdmin` — the API package does
235
+ * NOT own registry persistence. Deployments plug in any
236
+ * implementation, e.g. one over `@kindgi/agents`' in-memory
237
+ * `AgentRegistry`.
238
+ */
239
+ readonly agentRegistry?: AgentRegistryBinding;
240
+ /**
241
+ * Optional. When present, mounts the flows catalog surface
242
+ * (`/v1/flows` list/get/publish, `/v1/flows/:flowId/versions/*`).
243
+ * Caller-plugged pattern mirrors `agentRegistry` 1:1. Publish
244
+ * validates the wire body via `@kindgi/flow.loadFlow` — a flow
245
+ * published through the API is byte-identical to one constructed
246
+ * in-process. Enables non-agent workflows (webhook processors, ETL
247
+ * jobs, ingest pipelines) via HTTP.
248
+ */
249
+ readonly flowRegistry?: FlowRegistryBinding;
250
+ /**
251
+ * Optional. When present, mounts the tools catalog surface
252
+ * (`/v1/tools` list/get/register/unregister). Caller-plugged
253
+ * pattern mirrors `agentRegistry`. Registration here is metadata-only
254
+ * — handler code is bundled with the runtime or shipped in a signed
255
+ * deployment (`POST /v1/deployments`).
256
+ */
257
+ readonly toolRegistry?: ToolRegistryBinding;
258
+ /**
259
+ * Optional post-write hook fired after a successful tool publish /
260
+ * unregister / reinstate. The caller wires this to invalidate any
261
+ * in-process runtime cache that mirrors the persisted registry
262
+ * (e.g. the runtime's tool bridge, invalidated per tenant).
263
+ * Without it, a re-published tool's schema / description edits
264
+ * are silently ignored until the server process restarts.
265
+ */
266
+ readonly onToolWrite?: import('./routes/tools.js').ToolWriteHook;
267
+ /**
268
+ * Optional. When present, mounts the guardrails catalog surface
269
+ * (`/v1/guardrails` list/get/register/unregister). Caller-plugged
270
+ * pattern mirrors `agentRegistry`. Registration here is metadata-only
271
+ * — the check implementation is bundled with the runtime or shipped
272
+ * in a signed deployment.
273
+ */
274
+ readonly guardrailRegistry?: GuardrailRegistryBinding;
275
+ /**
276
+ * Optional post-write hook fired after a successful guardrail
277
+ * register / unregister. Caller wires this to invalidate any
278
+ * in-process runtime cache that mirrors the persisted registry
279
+ * (e.g. the runtime's guardrail bridge, invalidated per tenant).
280
+ * Without it, a newly-registered guardrail is stored but doesn't
281
+ * reach agent turns until the server process restarts. Same
282
+ * cache-invalidation concern as `onToolWrite` / `onProviderWrite`.
283
+ */
284
+ readonly onGuardrailWrite?: import('./routes/guardrails.js').GuardrailWriteHook;
285
+ /**
286
+ * Optional. When present, mounts the retention surface
287
+ * (`/v1/retention/scheduled`, `/v1/retention/sweep`,
288
+ * `/v1/retention/sweep/:domain`). Caller-plugged; the Kindgi runtime
289
+ * supplies an implementation over its per-domain retention sweeps.
290
+ */
291
+ readonly retention?: RetentionBinding;
292
+ /**
293
+ * Optional. When present, mounts the memory surface
294
+ * (`/v1/memory/facts` list/get/write/supersede, `/v1/memory/retrieve`).
295
+ * Caller-plugged pattern mirrors the other registry bindings — the
296
+ * API package doesn't hardwire an embedding provider or a retrieval
297
+ * policy registry. Deployments plug in a binding that wraps
298
+ * the memory subsystem runtime + their embedding registry.
299
+ */
300
+ readonly memory?: MemoryBinding;
301
+ /**
302
+ * Optional. When present, mounts the supervisor proposals surface
303
+ * (`/v1/proposals` list/get/draft, plus lifecycle actions
304
+ * dry-run / submit-review / apply / rollback / withdraw). Every
305
+ * route requires an `X-Supervisor-Id` request header — the API
306
+ * package doesn't own the supervisor registry, so the binding
307
+ * receives that scope explicitly.
308
+ *
309
+ * The binding wraps the supervisor runtime primitives +
310
+ * the deployment's `AgentRegistry` + `HITL` wiring + eval dataset
311
+ * registry. See `supervisor-binding.ts` for the full contract.
312
+ */
313
+ readonly supervisor?: SupervisorBinding;
314
+ /**
315
+ * Optional. Caller-plugged key store for signed provenance exports
316
+ * (`POST /v1/provenance/:runId/export`). When omitted, the export
317
+ * route responds `404 signing-not-configured` — the read routes
318
+ * (`GET /v1/provenance`, `GET /v1/provenance/:runId`) remain mounted
319
+ * either way because they read through `provenanceBinding` and do not
320
+ * need signing material.
321
+ *
322
+ * Same caller-plugged pattern as the other bindings — the API package
323
+ * does NOT own key persistence. Deployments plug in a binding that
324
+ * wraps their KMS / HSM / env-var store; see `SigningKeyBinding` in
325
+ * `@kindgi/crypto`.
326
+ */
327
+ readonly signingKey?: SigningKeyBinding;
328
+ /**
329
+ * Optional. Issue and accept public run tokens (`kgi_pt_…`):
330
+ * short-lived, read-only tokens a browser uses to follow specific runs
331
+ * (`GET /v1/runs/:runId/progress` and its stream: status and steps, no data). When
332
+ * present, `POST /v1/runs` returns a `publicAccessToken`,
333
+ * `POST /v1/tokens/public` mints them, and `allowedOrigins` get CORS
334
+ * on those two read routes. Checked at startup: the key must be an
335
+ * Ed25519 key in `signingKey`. Use a key for this purpose alone.
336
+ */
337
+ readonly publicRunTokens?: PublicRunTokenConfig;
338
+ /**
339
+ * Optional. When present, mounts the artifacts surface
340
+ * (`/v1/artifacts` list / multipart upload; `/v1/artifacts/:blobId`
341
+ * GET stream / HEAD / DELETE). Caller-plugged pattern mirrors the
342
+ * other registry bindings — the API package doesn't own storage.
343
+ * Deployments plug in a `BlobStorageBinding` implementation, e.g.
344
+ * filesystem-backed for development or object-store-backed in
345
+ * production.
346
+ */
347
+ readonly blobStorage?: BlobStorageBinding;
348
+ /**
349
+ * Optional. When present, mounts the read-only capabilities catalog
350
+ * surface (`/v1/capabilities` list, `/v1/capabilities/:capabilityId`
351
+ * get). Capabilities are framework-declared (`FEATURES` enum in
352
+ * `@kindgi/capabilities` + `@kindgi/specs/capability.schema.json`) and
353
+ * deployment-extended at boot time via the binding — tenants do NOT
354
+ * author capabilities via HTTP.
355
+ */
356
+ readonly capabilityRegistry?: CapabilityRegistryBinding;
357
+ /**
358
+ * Optional. When present, mounts the model-providers catalog surface
359
+ * (`/v1/providers` list, `/v1/providers/:providerId` get, `POST
360
+ * /v1/providers` register, `POST /v1/providers/:providerId/unregister`,
361
+ * `GET /v1/providers/:providerId/capabilities` sub-resource). Full
362
+ * CRUD — tenants register their own providers. `ProviderMetadata` is
363
+ * the wire shape; secrets never cross the wire (they stay inside the
364
+ * binding).
365
+ */
366
+ readonly providerRegistry?: ProviderRegistryBinding;
367
+ /**
368
+ * Optional post-write hook fired after a successful provider
369
+ * register / unregister. The caller wires this to invalidate any
370
+ * in-process runtime cache that mirrors the persisted registry
371
+ * (e.g. the runtime's provider bridge, invalidated per tenant).
372
+ * Without it, a provider registered after boot is stored but the
373
+ * runtime keeps serving its boot-time snapshot — routing continues
374
+ * to pick whatever was seeded at boot even after the operator
375
+ * registered another provider.
376
+ */
377
+ readonly onProviderWrite?: import('./routes/providers.js').ProviderWriteHook;
378
+ /**
379
+ * Optional. When present, mounts the MCP-endpoint registry surface at
380
+ * `/v1/mcp/endpoints/*` — `GET /v1/mcp/endpoints` (list, cursor-paginated,
381
+ * optional `?transport=` filter), `GET /v1/mcp/endpoints/:endpointId`,
382
+ * `POST /v1/mcp/endpoints` (register), `POST /v1/mcp/endpoints/:endpointId/unregister`.
383
+ * Full CRUD — tenants declare the remote MCP servers they want the
384
+ * runtime to consume. `MCPEndpoint` is the wire shape; its `secretRef`
385
+ * names a secret in the deployment's store, never the credential.
386
+ * The runtime can discover each endpoint's tools at boot and register
387
+ * them into the tool registry under the same tenant.
388
+ */
389
+ readonly mcpEndpointRegistry?: MCPEndpointRegistryBinding;
390
+ /**
391
+ * How far tenant configuration may reach into the server's host
392
+ * (`KINDGI_TENANT_HOST_ACCESS`, see `tenant-host-access.ts`): under
393
+ * `deployed`, registering a stdio MCP endpoint answers `403
394
+ * host-access-denied`. Default `deployed`; the runtime passes `local`
395
+ * only for a development server.
396
+ */
397
+ readonly tenantHostAccess?: TenantHostAccess;
398
+ /**
399
+ * Optional. Backs the MCP resources + prompts routes, which mount with
400
+ * `mcpEndpointRegistry`:
401
+ * `GET /v1/mcp/endpoints/:endpointId/resources`,
402
+ * `GET /v1/mcp/endpoints/:endpointId/resources/:uri`,
403
+ * `GET /v1/mcp/endpoints/:endpointId/prompts`,
404
+ * `POST /v1/mcp/endpoints/:endpointId/prompts/:name`.
405
+ *
406
+ * A typical implementation opens a fresh MCP client against the
407
+ * endpoint per request, runs the operation, and closes. When absent,
408
+ * the resources + prompts routes 404 with `mcp-endpoint-not-found`.
409
+ */
410
+ readonly mcpClientProbe?: MCPClientProbeBinding;
411
+ /**
412
+ * Optional. When present, mounts the cost readback surface at
413
+ * `/v1/cost/*` — `GET /v1/cost/records` (paginated list with
414
+ * `runId` / `agentId` / `conversationId` / `category` / `providerId` /
415
+ * time-window filters), `GET /v1/cost/records/:recordId` (single),
416
+ * `GET /v1/cost/aggregate` (multi-dimensional rollup over a required
417
+ * time window; default "last 30 days"). Read-only over HTTP —
418
+ * records are written by the runtime's agent / tool / sandbox
419
+ * instrumentation, not through this surface.
420
+ *
421
+ * Budgets are NOT part of this surface.
422
+ */
423
+ readonly cost?: CostBinding;
424
+ /**
425
+ * Optional. When present, mounts the unified adapters catalog surface
426
+ * at `/v1/adapters/*` — `GET /v1/adapters` (paginated list with
427
+ * optional `kind` / `status` filters), `GET /v1/adapters/:adapterId`
428
+ * (single), `POST /v1/adapters/:adapterId/test` (kind-specific smoke
429
+ * probe). Read-only + test-only over HTTP; adapter lifecycle
430
+ * (register / unregister / reconfigure) is a deployment concern
431
+ * — the runtime learns about adapters at `CreateAppInput` time.
432
+ *
433
+ * Deployments implement the binding by aggregating their wired
434
+ * adapters (they know which ones are active because they wire them).
435
+ * See `AdapterRegistryBinding` for the full contract.
436
+ */
437
+ readonly adapterRegistry?: AdapterRegistryBinding;
438
+ /**
439
+ * Optional. In-process factory registry that maps `adapter_id` →
440
+ * factory function + optional `prepare()` for adapter warmup /
441
+ * download. Backs `POST /v1/adapters/:adapterId/prepare` (mounted
442
+ * with `adapterRegistry`) — an SSE endpoint that iterates
443
+ * `entry.prepare()` and streams `PrepareEvent`s to the caller.
444
+ *
445
+ * The runtime builds this at boot alongside the adapter registry so
446
+ * registry entries and in-process factories stay coherent.
447
+ * Deployments without in-process adapter factories (e.g. a custom
448
+ * runHandler) can leave this undefined — the `prepare` route then
449
+ * answers `400 bad-input` for every adapter id.
450
+ */
451
+ readonly adapterFactories?: AdapterFactoryRegistry;
452
+ /**
453
+ * Optional. When present, mounts the trigger admin surfaces at
454
+ * `/v1/schedules/*`, `/v1/event-triggers/*`, and `/v1/webhooks/*`.
455
+ * Kernel runtime primitives (cron/event/webhook schedulers) do the
456
+ * firing; this binding satisfies the CRUD surface over the stored
457
+ * triggers.
458
+ *
459
+ * The Kindgi runtime supplies an implementation. Deployments that
460
+ * want bespoke persistence substitute their own binding.
461
+ */
462
+ readonly triggerRegistry?: TriggerRegistryBinding;
463
+ /**
464
+ * Optional. When present, mounts the outbound webhook surface at
465
+ * `/v1/webhook-endpoints/*`: endpoints the platform sends signed
466
+ * events to (`run.finished`), their delivery log, redelivery and a test
467
+ * event. The runtime supplies storage, secrets and the sender; see
468
+ * `WebhookEndpointBinding`.
469
+ */
470
+ readonly webhookEndpoints?: WebhookEndpointBinding;
471
+ /**
472
+ * Optional. When present, mounts the tenant policies catalog surface
473
+ * (`/v1/policies` list/get/publish, `/v1/policies/:policyId/versions/*`).
474
+ * Full versioned CRUD — mirrors `flows` 1:1. Registry-only:
475
+ * enforcement is out of scope. Runtime consumers (e.g. the kernel
476
+ * router for `model-routing`, an adapter-allowlist check for
477
+ * `adapter-allowlist`, retention sweepers for `retention`) read
478
+ * policies from this store and apply them at their own boundary.
479
+ * `policyKind` is enumerated + extensible — new kinds require a spec +
480
+ * validator update in tandem.
481
+ */
482
+ readonly policyRegistry?: PolicyRegistryBinding;
483
+ /**
484
+ * Optional. When present, mounts the evaluation-suite catalog surface
485
+ * (`/v1/eval-suites` list/get/publish, `/v1/eval-suites/:suiteId/versions/*`).
486
+ * Full versioned CRUD — mirrors `policies` 1:1. Registry-only:
487
+ * eval-run execution + per-kind grader dispatch (eval-judge adapter
488
+ * for `accuracy` / `pairwise` / `regression`, HITL bridge for
489
+ * `human-review`, sandbox handler for `custom`) is out of scope
490
+ * here (see `evalRunBinding`). `evalKind` is enumerated + extensible
491
+ * — new kinds require a spec + validator update in tandem.
492
+ */
493
+ readonly evalSuiteRegistry?: EvalSuiteRegistryBinding;
494
+ /**
495
+ * Optional. When present alongside `evalSuiteRegistry`, mounts the
496
+ * evaluation-run data-plane surface: `POST /v1/eval-suites/:suiteId/runs`
497
+ * (start), `GET /v1/eval-runs` (list, cursor-paginated),
498
+ * `GET /v1/eval-runs/:runId` (get), `POST /v1/eval-runs/:runId/cancel`,
499
+ * `GET /v1/eval-runs/:runId/events` (SSE). Caller-plugged binding —
500
+ * the API package doesn't own eval-run persistence. The reference
501
+ * `createInProcessEvalRunBinding` (`packages/api/src/eval-run-dispatcher.ts`)
502
+ * implements the pattern end-to-end for the `accuracy` kind; a suite
503
+ * of a kind with no registered dispatcher answers
504
+ * `422 dispatcher-not-registered`.
505
+ */
506
+ readonly evalRunBinding?: EvalRunBinding;
507
+ /**
508
+ * Optional. Push-based pub/sub binding used by SSE endpoints to
509
+ * deliver run events without polling. When present, `GET
510
+ * /v1/runs/:runId/stream` subscribes on channel
511
+ * `kernel:run:<runId>` and delivers push-mode; when absent, the
512
+ * route falls back to a 200 ms journal poll — wire shape identical
513
+ * either way, so callers can't tell.
514
+ *
515
+ * The Kindgi runtime supplies an implementation. Wire the same bus
516
+ * into the kernel behind `CreateAppInput.runHandler` so the kernel
517
+ * publishes on each journal write; without that, the subscription
518
+ * receives nothing (the kernel never posts).
519
+ *
520
+ * See `packages/api/src/event-bus-binding.ts` for the contract.
521
+ */
522
+ readonly eventBus?: EventBusBinding;
523
+ /**
524
+ * Optional. When present alongside `blobStorage`, mounts the
525
+ * AWS S3-compat wire surface at `/s3/*`. SigV4-authenticated
526
+ * per request against the credentials this binding resolves. Requests
527
+ * for buckets the credential is not authorized for return
528
+ * `403 AccessDenied`. Storage flows through the same
529
+ * `BlobStorageBinding` as the bespoke `/v1/artifacts/*` surface —
530
+ * cross-surface interop is a first-class guardrail. Includes the
531
+ * S3 multipart-upload operations (initiate / upload part / complete /
532
+ * list parts / abort).
533
+ */
534
+ readonly s3Credentials?: S3CredentialBinding;
535
+ /**
536
+ * Optional. When present, mounts the OAuth session persistence
537
+ * surface. Combined with `identityProvider` + `exchangeCode` (below),
538
+ * this activates the full `/v1/auth/*` route family. The static
539
+ * bearer-token flow remains available on the same routes byte-
540
+ * shape-identical; the middleware detects `kgi_sk_*` prefixed
541
+ * tokens and routes them through this store.
542
+ *
543
+ * Caller-plugged — the API package does NOT own session persistence.
544
+ * The Kindgi runtime supplies a durable implementation; deployments
545
+ * can also plug in their own (Redis, SQLite, memory, etc.).
546
+ */
547
+ readonly sessionStore?: SessionStoreBinding;
548
+ /**
549
+ * Optional. When present, tunes session-token lifecycle enforcement
550
+ * in the auth middleware. Absent → sensible defaults (absolute TTL
551
+ * from the stored session's `expiresAt`; inactivity timeout disabled).
552
+ * Only applies to `kgi_sk_*` session tokens; static bearer tokens are
553
+ * unaffected.
554
+ */
555
+ readonly session?: SessionConfig;
556
+ /**
557
+ * Optional. When present alongside `sessionStore` + `exchangeCode`,
558
+ * mounts the identity-provider catalog + auth flow at `/v1/auth/*`.
559
+ *
560
+ * Deployments register their OAuth/OIDC providers at boot (or via
561
+ * `POST /v1/auth/providers`); the framework does NOT bake in a
562
+ * provider list.
563
+ */
564
+ readonly identityProvider?: IdentityProviderBinding;
565
+ /**
566
+ * Required alongside `identityProvider`. Called by
567
+ * `POST /v1/auth/callback/:providerId` to exchange the authorization
568
+ * code for provider tokens + userinfo. Deployments implementing
569
+ * `IdentityProviderBinding` typically pair it with their own
570
+ * `exchangeCode` that speaks OAuth 2.0 + PKCE against the provider's
571
+ * `tokenEndpoint`.
572
+ */
573
+ readonly exchangeCode?: ExchangeCodeFn;
574
+ /**
575
+ * Optional. When present, `POST /v1/auth/refresh` rotates the
576
+ * underlying provider tokens via this callback before re-issuing a
577
+ * session token. When absent, refresh only rotates the framework's
578
+ * session token (still useful for scoping expiry to the framework
579
+ * boundary; the provider tokens keep their original TTL).
580
+ */
581
+ readonly refreshToken?: RefreshTokenFn;
582
+ /**
583
+ * Optional. Short-lived CSRF-`state` + PKCE-`code_verifier` cache
584
+ * used between login initiation and callback. When absent, a per-app
585
+ * in-memory store is used — appropriate for single-process dev + tests.
586
+ * Multi-pod deployments MUST plug in a shared store (Redis, Postgres)
587
+ * because the callback frequently lands on a different pod than the
588
+ * login. Mirror of the `idempotencyStore` caller-plugged pattern.
589
+ */
590
+ readonly oauthStateStore?: OauthStateStore;
591
+ /**
592
+ * Optional. Signed-deployment ledger — the audit anchor for every
593
+ * `POST /v1/deployments` landing. Caller-plugged per the pattern
594
+ * (e.g. in-memory for tests, a durable store in production). Mount
595
+ * happens only when this + `signingKeyRegistry` + `imageRegistry` are
596
+ * ALL wired.
597
+ */
598
+ readonly deploymentRegistry?: DeploymentBinding;
599
+ /**
600
+ * Optional. Tenant-scoped signing-key trust registry.
601
+ * Higher-level than `SigningKeyBinding` (which is
602
+ * KMS-shaped): answers "for tenant T, is this public key allowed to
603
+ * sign deploys?" and performs signature verification against the
604
+ * registered trust list. Aliased on import to avoid the local name
605
+ * collision with the crypto binding.
606
+ */
607
+ readonly signingKeyRegistry?: SigningKeyRegistryBinding;
608
+ /**
609
+ * Optional. OCI image registry client — Docker
610
+ * Registry HTTP API v2 seam. The deploy route calls `head` + one
611
+ * `extractFile('/app/index.json')` to verify pullability + integrity;
612
+ * `push` is for build tooling, not the API routes. Caller-plugged
613
+ * so deployments route different tenants at different registries.
614
+ */
615
+ readonly imageRegistry?: ImageRegistryBinding;
616
+ /**
617
+ * Optional. When present, mounts the tenant-scoped identity
618
+ * directory surface (`/v1/identity/users` list/get,
619
+ * `/v1/identity/users/:userId/sessions` list-active,
620
+ * `/v1/identity/users/:userId/revoke-sessions` admin op,
621
+ * `/v1/identity/whoami` self) — part of the admin control plane.
622
+ * Registry-only over HTTP; deployments plug in an
623
+ * LDAP / SCIM / bespoke user store behind
624
+ * `IdentityDirectoryBinding`. `whoami` returns the fuller
625
+ * `UserRecord` shape when the binding is wired and the token
626
+ * carries a `userId`; otherwise it falls back to the minimal
627
+ * `{ tenantId, ... }` shape.
628
+ */
629
+ readonly identityDirectory?: IdentityDirectoryBinding;
630
+ /**
631
+ * Optional. Overrides the default `info` + `servers` in the emitted
632
+ * OpenAPI document (`GET /v1/openapi.json`) and — via the `docs`
633
+ * sub-config — opts the deployment into an interactive Scalar-rendered
634
+ * API reference UI. Deployments typically set `servers[0].url` to their
635
+ * public base URL.
636
+ */
637
+ readonly openapi?: OpenApiConfig;
638
+ /**
639
+ * Optional. When present, mounts the `/v1/orgs` resource surface
640
+ * (list/create/get/patch/delete) of the multi-tenant hierarchy.
641
+ * Caller-plugged: the reference in-memory implementation is
642
+ * `makeInMemoryOrgBinding` in `@kindgi/platform`; the Kindgi runtime
643
+ * supplies a durable one.
644
+ */
645
+ readonly orgBinding?: OrgBinding;
646
+ /**
647
+ * Optional. When present, mounts the `/v1/teams` resource surface —
648
+ * team CRUD plus `/v1/teams/:teamId/memberships` sub-resource. Both
649
+ * `teamBinding` AND `teamMembershipBinding` MUST be supplied together
650
+ * (otherwise `/v1/teams` is not mounted) — the reference
651
+ * in-memory adapter returns them as a combined `{teams, memberships}`
652
+ * factory, and durable implementations mirror that shape.
653
+ */
654
+ readonly teamBinding?: TeamBinding;
655
+ readonly teamMembershipBinding?: TeamMembershipBinding;
656
+ /**
657
+ * Optional. When present, mounts the `/v1/projects` resource surface —
658
+ * project CRUD (including `/v1/projects/default`) plus
659
+ * `/v1/projects/:projectId/memberships` sub-resource. Both
660
+ * `projectBinding` AND `projectMembershipBinding` MUST be supplied
661
+ * together — same combined-factory pattern as teams.
662
+ */
663
+ readonly projectBinding?: ProjectBinding;
664
+ readonly projectMembershipBinding?: ProjectMembershipBinding;
665
+ /**
666
+ * Optional. The team↔project grant binding. Not consumed by this
667
+ * package's routes; the authz backend uses it to resolve
668
+ * team-mediated project grants.
669
+ */
670
+ readonly teamProjectGrantBinding?: TeamProjectGrantBinding;
671
+ /**
672
+ * Optional. Non-sensitive per-env values. When present alongside or
673
+ * separately from `secretsBinding`, mounts the `/v1/tenant/config`
674
+ * sub-routes at tenant scope. The base `GET /v1/tenant` route is
675
+ * always mounted; the `/config` surface is gated on at least one of
676
+ * `envBinding` / `secretsBinding` being present.
677
+ */
678
+ readonly envBinding?: EnvBinding;
679
+ /**
680
+ * Optional. Sensitive per-env values. Same mount rule as
681
+ * `envBinding` — either binding present is enough to mount
682
+ * `/v1/tenant/config`. Writes to `/v1/tenant/config` with
683
+ * `sensitive: true` (or `kind: 'secret'`) route to this binding; the
684
+ * routes 400 when a secret write is attempted but this binding is
685
+ * absent.
686
+ *
687
+ * When present, ALSO mounts `/v1/secrets/*` — the dedicated
688
+ * secrets HTTP surface. Same for `envBinding` and `/v1/env/*`.
689
+ */
690
+ readonly secretsBinding?: SecretBinding;
691
+ /**
692
+ * Optional. Backs the async-rotation wire (`POST /v1/secrets/:name/rotate`
693
+ * → 202 Accepted; poll via `GET /v1/secrets/:name/rotations/:rotationId`;
694
+ * subscribe via `GET /v1/secrets/:name/rotations/:rotationId/events`).
695
+ * When `secretsBinding` is present AND this is absent, a per-app
696
+ * in-memory reference store is used — appropriate for dev + tests
697
+ * only; multi-pod production deployments MUST plug in a durable
698
+ * adapter (rotations can take minutes to hours; the row must
699
+ * survive process restarts and reach pods handling later polls /
700
+ * subscribes).
701
+ */
702
+ readonly rotationStatusStore?: RotationStatusStore;
703
+ }
704
+ /**
705
+ * OpenAPI configuration. Extends `GenerateOptions` (info + servers) with
706
+ * an optional `docs` sub-config that opts the deployment into mounting
707
+ * an interactive Scalar-rendered API reference UI alongside the JSON
708
+ * spec at `/v1/openapi.json`.
709
+ *
710
+ * `docs` is opt-in (default off). Deployments that want the docs UI set
711
+ * `docs: true` (mounts at `/docs`) or `docs: { path: '/reference' }` for
712
+ * a custom mount path.
713
+ */
714
+ export interface OpenApiConfig extends GenerateOptions {
715
+ /**
716
+ * When set, mounts a Scalar-rendered interactive API reference UI
717
+ * that reads from `GET /v1/openapi.json`. Pass `true` for defaults
718
+ * (mounted at `/docs`, default theme, page title from the OpenAPI
719
+ * `info.title`) or an object to customize the mount path / title /
720
+ * theme. Absent = docs UI not mounted.
721
+ */
722
+ readonly docs?: boolean | ScalarDocsConfig;
723
+ }
724
+ /**
725
+ * Session lifecycle configuration. All fields optional; defaults keep
726
+ * the baseline behavior (absolute TTL from the stored session's
727
+ * `expiresAt`, inactivity enforcement disabled). Only applies to
728
+ * `kgi_sk_*` session tokens; static bearer tokens are unaffected.
729
+ * Milliseconds throughout — compared against `Date.now()` on the hot
730
+ * path.
731
+ */
732
+ export interface SessionConfig {
733
+ /**
734
+ * Recommended default for deployment-issued sessions. The framework
735
+ * itself uses the provider's `expiresAt` verbatim on OAuth callback;
736
+ * this default surfaces only when a downstream helper opts into it.
737
+ * 24h = `24 * 60 * 60 * 1000`.
738
+ */
739
+ readonly ttl?: number;
740
+ /**
741
+ * Inactivity timeout — requests whose session `lastActiveAt` is older
742
+ * than `Date.now() - inactivityTimeout` receive `401 session-inactive`.
743
+ * Absent → inactivity enforcement disabled. Recommended: 4 hours.
744
+ */
745
+ readonly inactivityTimeout?: number;
746
+ /**
747
+ * How often the middleware calls `sessionStore.touch()` to bump
748
+ * `lastActiveAt`. Defaults to 60_000 ms. Higher values ⇒ fewer writes
749
+ * but coarser inactivity enforcement.
750
+ */
751
+ readonly touchThrottle?: number;
752
+ }
753
+ /**
754
+ * Optional overrides for the Scalar-rendered docs UI. All fields are
755
+ * optional; sensible defaults are applied.
756
+ */
757
+ export interface ScalarDocsConfig {
758
+ /** Mount path. Default: `/docs`. */
759
+ readonly path?: string;
760
+ /** Browser tab title. Default: `Kindgi API`. */
761
+ readonly title?: string;
762
+ /**
763
+ * Scalar theme name — string-typed so it stays open to whatever
764
+ * themes Scalar ships without a version-lock. Default: Scalar's
765
+ * built-in default theme.
766
+ */
767
+ readonly theme?: string;
768
+ }
769
+ export declare function createApp(input: CreateAppInput): Hono<AppEnv>;
770
+ //# sourceMappingURL=app.d.ts.map