@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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Kindgi Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,218 @@
1
1
  # @kindgi/api
2
2
 
3
- A placeholder. Releases come from https://github.com/kindgi/kindgi-sdk.
3
+ REST + SSE HTTP surface for the Kindgi platform. Exposes the runtime
4
+ (kernel, agents, HITL, supervisor — reached through the bindings passed
5
+ to `createApp`) behind two wire faces:
6
+
7
+ - **`/v1/*`** — the Kindgi REST API. JSON in, JSON out. Bearer
8
+ token auth. Documented via OpenAPI 3.1 (snapshot shipped as `@kindgi/api/openapi.json`).
9
+ Conventions locked in [`docs/API-ROUTE-CONVENTIONS.md`](../../docs/API-ROUTE-CONVENTIONS.md).
10
+ - **`/s3/*`** — AWS S3 API v4 wire surface. XML in,
11
+ XML out. SigV4 auth. Documented in this file.
12
+
13
+ Both surfaces route through the same runtime bindings — an artifact
14
+ uploaded via one is readable via the other. Deployments enable
15
+ either or both via `createApp(...)` bindings.
16
+
17
+ ## `createApp(input)`
18
+
19
+ Assemble the Hono app instance. Every runtime dependency is caller-
20
+ plugged; the API package does not own persistence. See
21
+ [`src/app.ts`](src/app.ts) for the full `CreateAppInput` shape.
22
+
23
+ Minimal wiring for BOTH surfaces:
24
+
25
+ ```ts
26
+ import { createApp } from '@kindgi/api';
27
+
28
+ const app = createApp({
29
+ // Required runtime bindings — supplied by the Kindgi runtime in a
30
+ // deployment; `createStubAppBindings()` from @kindgi/testing in tests.
31
+ ...runtimeBindings,
32
+ resolveToken: async (token) => /* ... */,
33
+ runHandler: /* ... */,
34
+ blobStorage, // any BlobStorageBinding (filesystem, S3, GCS, …)
35
+ s3Credentials: {
36
+ async resolve(accessKeyId) {
37
+ // Deployment-owned lookup — return { secretKey, tenantId, bucket }
38
+ // or null for unknown / revoked.
39
+ return await lookupAccessKey(accessKeyId);
40
+ },
41
+ },
42
+ });
43
+ ```
44
+
45
+ Omit `s3Credentials` → the `/s3/*` mount is skipped (Hono 404).
46
+ Omit `blobStorage` → both `/v1/artifacts` AND `/s3` are skipped.
47
+
48
+ ## Interactive docs (Scalar)
49
+
50
+ Set `openapi.docs` on `createApp(...)` to mount a Scalar-rendered
51
+ interactive API reference alongside the JSON spec. The docs page reads
52
+ the (already-public) `/v1/openapi.json` in the browser, so it sits on
53
+ the public side of the auth chain — no bearer required to browse.
54
+
55
+ ```ts
56
+ const app = createApp({
57
+ ...runtimeBindings,
58
+ resolveToken: /* ... */,
59
+ runHandler: /* ... */,
60
+ openapi: { docs: true }, // → mounts /docs (default path)
61
+ });
62
+
63
+ // Or customize:
64
+ openapi: { docs: { path: '/reference', title: 'Acme Legal API' } }
65
+ ```
66
+
67
+ `docs` is opt-in — omit it and the docs UI is unmounted (Hono 404). The
68
+ JSON spec at `/v1/openapi.json` is always mounted independent of this
69
+ flag.
70
+
71
+ ## The `/s3/*` mount
72
+
73
+ Any S3-aware client (`aws s3 cp`, `rclone`, `mc`, aws-sdk-js, boto3)
74
+ hits `/s3/*` with zero code changes. The server verifies AWS Signature
75
+ Version 4 itself (`node:crypto`; see
76
+ [`src/middleware/sigv4-verify.ts`](src/middleware/sigv4-verify.ts)).
77
+
78
+ ### Auth model
79
+
80
+ Every `/s3/*` request carries SigV4 credentials, either as:
81
+
82
+ - **Header auth** — `Authorization: AWS4-HMAC-SHA256 Credential=<accessKeyId>/<date>/<region>/s3/aws4_request, SignedHeaders=..., Signature=<hex>`
83
+ - **Presigned URL** — query params `X-Amz-Algorithm=AWS4-HMAC-SHA256`,
84
+ `X-Amz-Credential=...`, `X-Amz-Date=...`, `X-Amz-Expires=...`,
85
+ `X-Amz-SignedHeaders=...`, `X-Amz-Signature=...`.
86
+
87
+ The middleware:
88
+
89
+ 1. Parses the auth params (header OR presigned).
90
+ 2. Checks the signed timestamp and credential scope: within ±15 minutes
91
+ of the server clock for header auth (`RequestTimeTooSkewed`
92
+ otherwise); presigned URLs until `X-Amz-Expires`.
93
+ 3. Calls `S3CredentialBinding.resolve(accessKeyId)` → resolves to
94
+ `{ secretKey, tenantId, bucket, expiresAt? }` or `null`.
95
+ 4. For header auth, verifies `x-amz-content-sha256` matches the
96
+ received body — returns `400 XAmzContentSHA256Mismatch` on payload
97
+ tampering before signature comparison.
98
+ 5. Re-derives the signature under `secretKey` from exactly what the
99
+ client signed (its timestamp and its `SignedHeaders`) and compares
100
+ it in constant time.
101
+ 6. Compares the URL-declared bucket to the credential's `bucket`
102
+ field. Mismatch → `403 AccessDenied` (each credential is scoped to
103
+ one bucket).
104
+ 7. Sets `c.set('tenantId', ...)` + `c.set('bucket', ...)` for the
105
+ downstream S3 route handlers.
106
+
107
+ All auth failures return S3-style XML errors
108
+ (`<Error><Code>...</Code>...</Error>`) with `Content-Type: application/xml`.
109
+
110
+ ### Supported operations
111
+
112
+ Object routes (bucket + key):
113
+
114
+ | Verb | Path | Op |
115
+ |--- |--- |--- |
116
+ | PUT | `/s3/:bucket/*` | PutObject |
117
+ | GET | `/s3/:bucket/*` | GetObject |
118
+ | HEAD | `/s3/:bucket/*` | HeadObject |
119
+ | DELETE | `/s3/:bucket/*` | DeleteObject |
120
+
121
+ Bucket routes:
122
+
123
+ | Verb | Path | Op |
124
+ |--- |--- |--- |
125
+ | HEAD | `/s3/:bucket` | HeadBucket |
126
+ | GET | `/s3/:bucket` | ListObjectsV2 (requires `?list-type=2`) |
127
+
128
+ Multipart upload (S3-standard `md5(concat(md5(part_i)))-N` ETag):
129
+
130
+ | Verb | Path | Op |
131
+ |--- |--- |--- |
132
+ | POST | `/s3/:bucket/*?uploads` | InitiateMultipartUpload |
133
+ | PUT | `/s3/:bucket/*?partNumber=&uploadId=` | UploadPart |
134
+ | POST | `/s3/:bucket/*?uploadId=` | CompleteMultipartUpload |
135
+ | GET | `/s3/:bucket/*?uploadId=` | ListParts |
136
+ | DELETE | `/s3/:bucket/*?uploadId=` | AbortMultipartUpload |
137
+
138
+ Semantic notes:
139
+
140
+ - **Content-MD5** on PUT (regular OR part upload) is verified;
141
+ mismatch → `400 BadDigest`.
142
+ - **Range** requests on GET support single-range only (`bytes=N-M`,
143
+ `bytes=N-`, `bytes=-M`) — response is `206 Partial Content` with
144
+ `Content-Range: bytes N-M/total`. Multi-range (comma-separated)
145
+ requests are rejected with `416 InvalidRange`.
146
+ - **DELETE** always returns `204` — whether the key existed or not
147
+ (S3 semantics).
148
+ - **ListObjectsV2** requires `?list-type=2`; v1 listing is not
149
+ implemented (returns `501 NotImplemented`). `?prefix=`,
150
+ `?max-keys=`, `?continuation-token=` are honored.
151
+ - **x-amz-tagging** header on PUT is form-encoded
152
+ (`key1=val1&key2=val2`) and stored as `BlobMeta.tags`. The
153
+ dedicated `?tagging` subresource verbs are not implemented.
154
+
155
+ ### Cross-surface interop
156
+
157
+ Every persisted blob carries BOTH a `blobId` (UUID) AND a
158
+ `(bucket, key)` pair. Bespoke uploads via `POST /v1/artifacts` land
159
+ under `bucket: 'artifacts', key: <blobId>` by default — S3
160
+ credentials granted the `artifacts` bucket see them via
161
+ `s3://artifacts/<blobId>`.
162
+
163
+ Conversely, S3 uploads via `PUT /s3/:bucket/:key` are visible in
164
+ `GET /v1/artifacts` listings under the same `blobId` and are
165
+ downloadable via `GET /v1/artifacts/:blobId`.
166
+
167
+ ### Errors (S3-style XML)
168
+
169
+ | HTTP | S3 Code | When |
170
+ |--- |--- |--- |
171
+ | 400 | `InvalidRequest` | Malformed request |
172
+ | 400 | `MalformedXML` | `CompleteMultipartUpload` body invalid |
173
+ | 400 | `InvalidArgument` | Bad query param (e.g. `partNumber` OOB) |
174
+ | 416 | `InvalidRange` | Bad `Range` header |
175
+ | 400 | `BadDigest` | `Content-MD5` mismatch |
176
+ | 400 | `XAmzContentSHA256Mismatch` | Payload hash header mismatch |
177
+ | 400 | `InvalidPart` | Multipart part ETag mismatch |
178
+ | 403 | `AccessDenied` | Credential expired / wrong bucket |
179
+ | 403 | `InvalidAccessKeyId` | Unknown access key |
180
+ | 403 | `SignatureDoesNotMatch` | SigV4 verification failed |
181
+ | 403 | `RequestTimeTooSkewed` | Signed timestamp outside the ±15 min window |
182
+ | 403 | `InvalidRequest` | Malformed SigV4 authorization |
183
+ | 400 | `AuthorizationQueryParametersError` | Malformed presigned-URL parameters |
184
+ | 404 | `NoSuchKey` | Unknown key |
185
+ | 404 | `NoSuchUpload` | Unknown or aborted `uploadId` |
186
+ | 501 | `NotImplemented` | Unsupported operation |
187
+ | 500 | `InternalError` | Backing store failure |
188
+
189
+ ## Development
190
+
191
+ ```sh
192
+ pnpm --filter @kindgi/api build # compile TS + emit dist
193
+ pnpm --filter @kindgi/api typecheck # no-emit typecheck
194
+ pnpm --filter @kindgi/api test # vitest run
195
+ pnpm --filter @kindgi/api gen:openapi # regenerate packages/api/openapi.json
196
+ ```
197
+
198
+ `gen:openapi` documents the `/v1/*` surface only. The `/s3/*` surface
199
+ follows the S3 wire (XML, AWS-native SDKs) and is intentionally NOT
200
+ in the OpenAPI document — consumers use their own S3 SDKs pointed at
201
+ the mount.
202
+
203
+ ## Adapters (production-readiness plug-ins)
204
+
205
+ `createApp(...)` bindings are caller-plugged so this package can stay
206
+ free of persistence choices. The Kindgi runtime ships production
207
+ implementations (e.g. a Postgres-backed `idempotencyStore` whose retries
208
+ survive restarts and multi-instance deployments, filesystem and object-store
209
+ `blobStorage`). This package includes `createInMemoryIdempotencyStore()`,
210
+ which is correct for dev + tests.
211
+
212
+ ## See also
213
+
214
+ - [`docs/API-ROUTE-CONVENTIONS.md`](../../docs/API-ROUTE-CONVENTIONS.md)
215
+ — locked URL / auth / error-envelope / pagination / SSE conventions
216
+ for `/v1/*`.
217
+ - [`docs/ADDING-A-ROUTE.md`](../../docs/ADDING-A-ROUTE.md) — how to add
218
+ a new `/v1/*` route.
@@ -0,0 +1,177 @@
1
+ import type { Cursor, TenantId } from '@kindgi/types';
2
+ /**
3
+ * Caller-plugged surface for the adapter catalog — part of the admin
4
+ * control plane. Read-only + smoke-test-only
5
+ * over HTTP: tenants + operators see every adapter the deployment
6
+ * wired at boot time and probe each one for liveness.
7
+ *
8
+ * Adapters are the concrete bridges the runtime uses to talk to
9
+ * outside systems: model providers, embedding providers, blob storage,
10
+ * sandbox providers, eval judges. Each adapter package
11
+ * (the filesystem blob adapter, the inprocess sandbox adapter,
12
+ * `@kindgi/adapter-model-in-process`, `@kindgi/adapter-model-openai-compat`,
13
+ * the local embedding adapter, the AJV eval-judge adapter, ...)
14
+ * exports a factory + optional metadata; the deployment aggregates the
15
+ * ones it actually wired into an `AdapterRegistryBinding`.
16
+ *
17
+ * ## Why read-only + test-only
18
+ *
19
+ * Adapter lifecycle (register / unregister / reconfigure) is a
20
+ * **deployment concern**, not a runtime one. The runtime learns about
21
+ * adapters at `CreateAppInput` time; if a deployment wants to change
22
+ * what's wired it restarts the process with different config. This
23
+ * mirrors the pattern used elsewhere in the framework where lifecycle
24
+ * state is deployment-owned (bucket allocation in S3, key store for
25
+ * signing). HTTP-driven adapter reconfigure would require the runtime
26
+ * to accept live reconfiguration, which it does not.
27
+ *
28
+ * ## Wire shape discipline
29
+ *
30
+ * `AdapterInfo.config` is REDACTED — no secrets on the wire. A binding
31
+ * MAY expose non-sensitive routing hints (`{ region: 'us-east-1' }`)
32
+ * but MUST NOT surface API keys, endpoints, credentials, or any
33
+ * material that could be used to impersonate the adapter. The binding
34
+ * is authoritative on what counts as safe to expose per adapter kind.
35
+ *
36
+ * ## Probe semantics
37
+ *
38
+ * `test(...)` runs a kind-specific smoke probe against the adapter.
39
+ * Probe failures return an `AdapterTestOutcome` with `ok: false` — not
40
+ * an error. A failed probe is a valid observation about the adapter's
41
+ * state, not a server error. The route surfaces `AdapterTestOutcome`
42
+ * as HTTP 200 either way; a 5xx would indicate the probe machinery
43
+ * itself broke (which is legitimately a server error).
44
+ *
45
+ * ### Default probes by adapter kind
46
+ *
47
+ * - `blob`: write 32 random bytes → read back → verify hash → delete.
48
+ * - `sandbox`: create a context-isolated (or `none`) sandbox → run
49
+ * `1 + 1 === 2` → verify result → destroy.
50
+ * - `model` / `model-provider`: minimal completion with
51
+ * `[{ role: 'user', content: 'ping' }]` and `maxTokens: 1` — verify
52
+ * the provider returns a well-shaped response.
53
+ * - `embedding`: embed the string `'ping'` — verify the vector length
54
+ * matches the advertised dimension.
55
+ * - `eval-judge`: run a trivial pass-through eval — verify success.
56
+ *
57
+ * Adapter authors MAY accept a caller-supplied `input` on `test(...)`
58
+ * for more elaborate probes; when absent the binding falls back to
59
+ * the default above.
60
+ *
61
+ * Every method is tenant-scoped. Cursors are opaque — the binding
62
+ * chooses its encoding. The API layer only validates round-trip as a
63
+ * string; it never inspects the payload.
64
+ */
65
+ export interface AdapterRegistryBinding {
66
+ /**
67
+ * Cursor-paginated list of adapters the deployment has wired.
68
+ * Optional filters narrow to a specific `kind` or `status`.
69
+ */
70
+ list(input: AdapterListInput): Promise<AdapterPage>;
71
+ /**
72
+ * Fetch a single adapter by id, or `null` when unknown. The route
73
+ * surfaces `null` as `404 adapter-not-found`.
74
+ */
75
+ get(input: AdapterGetInput): Promise<AdapterInfo | null>;
76
+ /**
77
+ * Run the kind-specific smoke probe. Returns `null` when the id is
78
+ * unknown — the route surfaces that as `404 adapter-not-found`.
79
+ * Otherwise returns an `AdapterTestOutcome` (which itself carries
80
+ * `ok: true | false` — failed probes are data, not errors).
81
+ */
82
+ test(input: AdapterTestInput): Promise<AdapterTestOutcome | null>;
83
+ }
84
+ /**
85
+ * Closed set of adapter kinds the framework knows about. New kinds
86
+ * require an additive schema update — we enumerate rather than accept
87
+ * an open string so wire consumers (UIs, command-line tools) can render
88
+ * kind-specific columns without guessing.
89
+ *
90
+ * `model-provider` is distinct from `model` for adapters that wrap a
91
+ * remote provider gateway (a hosted API or a self-hosted inference
92
+ * server) vs. adapters that host the model in-process.
93
+ */
94
+ export type AdapterKind = 'model' | 'model-provider' | 'embedding' | 'blob' | 'sandbox' | 'eval-judge';
95
+ export declare const ADAPTER_KINDS: readonly AdapterKind[];
96
+ /**
97
+ * Adapter status the wire surface exposes. `active` = wired and
98
+ * last-observed healthy. `degraded` = wired but the binding has seen
99
+ * recent failures / partial capability loss. `error` = wired but
100
+ * unusable (e.g. auth material missing at boot). The binding is
101
+ * authoritative on how it derives the value.
102
+ */
103
+ export type AdapterStatus = 'active' | 'degraded' | 'error';
104
+ export declare const ADAPTER_STATUSES: readonly AdapterStatus[];
105
+ /**
106
+ * Wire shape for a single wired adapter. Deployments produce this
107
+ * from whatever data structure they use to hold their adapter set —
108
+ * commonly the `describe()` output on the adapter factory plus a
109
+ * status field the deployment tracks itself.
110
+ */
111
+ export interface AdapterInfo {
112
+ /** Stable id chosen by the deployment (e.g. `'sandbox-primary'`). */
113
+ readonly adapterId: string;
114
+ readonly kind: AdapterKind;
115
+ /** Package name that owns the implementation (e.g. `'@kindgi/adapter-model-in-process'`). */
116
+ readonly name: string;
117
+ /** Semver of the wired package. */
118
+ readonly version: string;
119
+ /**
120
+ * Kind-specific capability tags. Free-form strings scoped by kind —
121
+ * e.g. `['context-isolated']` for a sandbox adapter, `['tool-use', 'streaming']`
122
+ * for a model adapter, `['multipart-upload']` for blob storage.
123
+ */
124
+ readonly capabilities: readonly string[];
125
+ /**
126
+ * Redacted routing hints only. No secrets. Absent when the binding
127
+ * has nothing safe to expose.
128
+ */
129
+ readonly config?: Readonly<Record<string, unknown>>;
130
+ readonly status: AdapterStatus;
131
+ /** Human-readable reason accompanying `degraded` / `error` status. */
132
+ readonly statusReason?: string;
133
+ }
134
+ export interface AdapterListInput {
135
+ readonly tenantId: TenantId;
136
+ readonly limit: number;
137
+ readonly cursor?: Cursor;
138
+ readonly filter?: AdapterListFilter;
139
+ }
140
+ export interface AdapterListFilter {
141
+ readonly kind?: AdapterKind;
142
+ readonly status?: AdapterStatus;
143
+ }
144
+ export interface AdapterPage {
145
+ readonly data: readonly AdapterInfo[];
146
+ readonly nextCursor?: Cursor;
147
+ }
148
+ export interface AdapterGetInput {
149
+ readonly tenantId: TenantId;
150
+ readonly adapterId: string;
151
+ }
152
+ export interface AdapterTestInput {
153
+ readonly tenantId: TenantId;
154
+ readonly adapterId: string;
155
+ /**
156
+ * Optional kind-specific probe input. When absent the binding runs
157
+ * the default probe documented in the interface JSDoc above. Shape
158
+ * is intentionally open so bindings can extend the probe surface
159
+ * per kind without a schema change.
160
+ */
161
+ readonly input?: Readonly<Record<string, unknown>>;
162
+ }
163
+ /**
164
+ * Result of a probe run. `ok: false` is a valid observation — the
165
+ * route serialises it as HTTP 200 either way.
166
+ *
167
+ * `probe` is kind-specific data (e.g. `{ vectorLength: 384 }` for an
168
+ * embedding probe, `{ latencyMs: 42, completion: '2' }` for a model
169
+ * probe). Consumers should not depend on its exact shape — the UI
170
+ * treats it as a diagnostic bag to render as JSON.
171
+ */
172
+ export interface AdapterTestOutcome {
173
+ readonly ok: boolean;
174
+ readonly latencyMs: number;
175
+ readonly probe: Readonly<Record<string, unknown>>;
176
+ }
177
+ //# sourceMappingURL=adapter-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-binding.d.ts","sourceRoot":"","sources":["../src/adapter-binding.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACpD;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzD;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACnE;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,gBAAgB,GAChB,WAAW,GACX,MAAM,GACN,SAAS,GACT,YAAY,CAAC;AAEjB,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAO/C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAAoC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD"}
@@ -0,0 +1,12 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2026 Kindgi Inc.
3
+ export const ADAPTER_KINDS = [
4
+ 'model',
5
+ 'model-provider',
6
+ 'embedding',
7
+ 'blob',
8
+ 'sandbox',
9
+ 'eval-judge',
10
+ ];
11
+ export const ADAPTER_STATUSES = ['active', 'degraded', 'error'];
12
+ //# sourceMappingURL=adapter-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-binding.js","sourceRoot":"","sources":["../src/adapter-binding.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAyGjC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,MAAM;IACN,SAAS;IACT,YAAY;CACb,CAAC;AAWF,MAAM,CAAC,MAAM,gBAAgB,GAA6B,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC"}