@raybase/core 0.0.2 → 0.3.4

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 (435) hide show
  1. package/LICENSE +21 -0
  2. package/dist/.admin-build/AdminApp.css +2 -0
  3. package/dist/.admin-build/AdminApp.js +77 -0
  4. package/dist/.admin-docs-build/AdminDocsApp.css +2 -0
  5. package/dist/.admin-docs-build/AdminDocsApp.js +45 -0
  6. package/dist/actions.d.ts +347 -0
  7. package/dist/actions.d.ts.map +1 -0
  8. package/dist/actions.js +661 -0
  9. package/dist/actions.js.map +1 -0
  10. package/dist/admin-assets/admin.7738f50720a8ed7b.css +2 -0
  11. package/dist/admin-assets/admin.8678cb61db34dc81.js +77 -0
  12. package/dist/admin-boot.d.ts +94 -0
  13. package/dist/admin-boot.d.ts.map +1 -0
  14. package/dist/admin-boot.js +139 -0
  15. package/dist/admin-boot.js.map +1 -0
  16. package/dist/admin-docs-content.d.ts +95 -0
  17. package/dist/admin-docs-content.d.ts.map +1 -0
  18. package/dist/admin-docs-content.js +463 -0
  19. package/dist/admin-docs-content.js.map +1 -0
  20. package/dist/admin-docs-ui.d.ts +11 -0
  21. package/dist/admin-docs-ui.d.ts.map +1 -0
  22. package/dist/admin-docs-ui.js +23 -0
  23. package/dist/admin-docs-ui.js.map +1 -0
  24. package/dist/admin-kit.d.ts +29 -0
  25. package/dist/admin-kit.js +1557 -0
  26. package/dist/admin-role.d.ts +8 -0
  27. package/dist/admin-role.d.ts.map +1 -0
  28. package/dist/admin-role.js +22 -0
  29. package/dist/admin-role.js.map +1 -0
  30. package/dist/admin-ui.d.ts +3 -0
  31. package/dist/admin-ui.d.ts.map +1 -0
  32. package/dist/admin-ui.js +16 -0
  33. package/dist/admin-ui.js.map +1 -0
  34. package/dist/agent-ai-chat.d.ts +127 -0
  35. package/dist/agent-ai-chat.d.ts.map +1 -0
  36. package/dist/agent-ai-chat.js +5975 -0
  37. package/dist/agent-ai-chat.js.map +1 -0
  38. package/dist/agent-chapter-archive.d.ts +214 -0
  39. package/dist/agent-chapter-archive.d.ts.map +1 -0
  40. package/dist/agent-chapter-archive.js +696 -0
  41. package/dist/agent-chapter-archive.js.map +1 -0
  42. package/dist/agent-chapter-search.d.ts +116 -0
  43. package/dist/agent-chapter-search.d.ts.map +1 -0
  44. package/dist/agent-chapter-search.js +605 -0
  45. package/dist/agent-chapter-search.js.map +1 -0
  46. package/dist/agent-chapter-tools.d.ts +45 -0
  47. package/dist/agent-chapter-tools.d.ts.map +1 -0
  48. package/dist/agent-chapter-tools.js +344 -0
  49. package/dist/agent-chapter-tools.js.map +1 -0
  50. package/dist/agent-chapters.d.ts +228 -0
  51. package/dist/agent-chapters.d.ts.map +1 -0
  52. package/dist/agent-chapters.js +737 -0
  53. package/dist/agent-chapters.js.map +1 -0
  54. package/dist/agent-data-parts.d.ts +167 -0
  55. package/dist/agent-data-parts.d.ts.map +1 -0
  56. package/dist/agent-data-parts.js +68 -0
  57. package/dist/agent-data-parts.js.map +1 -0
  58. package/dist/agent-errors.d.ts +41 -0
  59. package/dist/agent-errors.d.ts.map +1 -0
  60. package/dist/agent-errors.js +191 -0
  61. package/dist/agent-errors.js.map +1 -0
  62. package/dist/agent-follow-up-store.d.ts +273 -0
  63. package/dist/agent-follow-up-store.d.ts.map +1 -0
  64. package/dist/agent-follow-up-store.js +703 -0
  65. package/dist/agent-follow-up-store.js.map +1 -0
  66. package/dist/agent-follow-ups.d.ts +314 -0
  67. package/dist/agent-follow-ups.d.ts.map +1 -0
  68. package/dist/agent-follow-ups.js +840 -0
  69. package/dist/agent-follow-ups.js.map +1 -0
  70. package/dist/agent-memory.d.ts +323 -0
  71. package/dist/agent-memory.d.ts.map +1 -0
  72. package/dist/agent-memory.js +1270 -0
  73. package/dist/agent-memory.js.map +1 -0
  74. package/dist/agent-message-parts.d.ts +58 -0
  75. package/dist/agent-message-parts.d.ts.map +1 -0
  76. package/dist/agent-message-parts.js +163 -0
  77. package/dist/agent-message-parts.js.map +1 -0
  78. package/dist/agent-remote-mcp-credentials.d.ts +154 -0
  79. package/dist/agent-remote-mcp-credentials.d.ts.map +1 -0
  80. package/dist/agent-remote-mcp-credentials.js +287 -0
  81. package/dist/agent-remote-mcp-credentials.js.map +1 -0
  82. package/dist/agent-remote-mcp-crypto.d.ts +32 -0
  83. package/dist/agent-remote-mcp-crypto.d.ts.map +1 -0
  84. package/dist/agent-remote-mcp-crypto.js +101 -0
  85. package/dist/agent-remote-mcp-crypto.js.map +1 -0
  86. package/dist/agent-remote-mcp-install.d.ts +299 -0
  87. package/dist/agent-remote-mcp-install.d.ts.map +1 -0
  88. package/dist/agent-remote-mcp-install.js +785 -0
  89. package/dist/agent-remote-mcp-install.js.map +1 -0
  90. package/dist/agent-remote-mcp-oauth.d.ts +73 -0
  91. package/dist/agent-remote-mcp-oauth.d.ts.map +1 -0
  92. package/dist/agent-remote-mcp-oauth.js +344 -0
  93. package/dist/agent-remote-mcp-oauth.js.map +1 -0
  94. package/dist/agent-remote-mcp-transport.d.ts +46 -0
  95. package/dist/agent-remote-mcp-transport.d.ts.map +1 -0
  96. package/dist/agent-remote-mcp-transport.js +225 -0
  97. package/dist/agent-remote-mcp-transport.js.map +1 -0
  98. package/dist/agent-remote-mcp.d.ts +147 -0
  99. package/dist/agent-remote-mcp.d.ts.map +1 -0
  100. package/dist/agent-remote-mcp.js +681 -0
  101. package/dist/agent-remote-mcp.js.map +1 -0
  102. package/dist/agent-room-redaction.d.ts +66 -0
  103. package/dist/agent-room-redaction.d.ts.map +1 -0
  104. package/dist/agent-room-redaction.js +264 -0
  105. package/dist/agent-room-redaction.js.map +1 -0
  106. package/dist/agent-rooms.d.ts +209 -0
  107. package/dist/agent-rooms.d.ts.map +1 -0
  108. package/dist/agent-rooms.js +244 -0
  109. package/dist/agent-rooms.js.map +1 -0
  110. package/dist/agent-runtime.d.ts +541 -0
  111. package/dist/agent-runtime.d.ts.map +1 -0
  112. package/dist/agent-runtime.js +4260 -0
  113. package/dist/agent-runtime.js.map +1 -0
  114. package/dist/agent-skill-archive.d.ts +20 -0
  115. package/dist/agent-skill-archive.d.ts.map +1 -0
  116. package/dist/agent-skill-archive.js +316 -0
  117. package/dist/agent-skill-archive.js.map +1 -0
  118. package/dist/agent-skill-discovery.d.ts +96 -0
  119. package/dist/agent-skill-discovery.d.ts.map +1 -0
  120. package/dist/agent-skill-discovery.js +464 -0
  121. package/dist/agent-skill-discovery.js.map +1 -0
  122. package/dist/agent-skill-format.d.ts +57 -0
  123. package/dist/agent-skill-format.d.ts.map +1 -0
  124. package/dist/agent-skill-format.js +238 -0
  125. package/dist/agent-skill-format.js.map +1 -0
  126. package/dist/agent-skill-import.d.ts +64 -0
  127. package/dist/agent-skill-import.d.ts.map +1 -0
  128. package/dist/agent-skill-import.js +295 -0
  129. package/dist/agent-skill-import.js.map +1 -0
  130. package/dist/agent-skill-publish.d.ts +51 -0
  131. package/dist/agent-skill-publish.d.ts.map +1 -0
  132. package/dist/agent-skill-publish.js +136 -0
  133. package/dist/agent-skill-publish.js.map +1 -0
  134. package/dist/agent-skill-store.d.ts +252 -0
  135. package/dist/agent-skill-store.d.ts.map +1 -0
  136. package/dist/agent-skill-store.js +514 -0
  137. package/dist/agent-skill-store.js.map +1 -0
  138. package/dist/agent-skills.d.ts +85 -0
  139. package/dist/agent-skills.d.ts.map +1 -0
  140. package/dist/agent-skills.js +291 -0
  141. package/dist/agent-skills.js.map +1 -0
  142. package/dist/agent-transcript-pager.d.ts +77 -0
  143. package/dist/agent-transcript-pager.d.ts.map +1 -0
  144. package/dist/agent-transcript-pager.js +210 -0
  145. package/dist/agent-transcript-pager.js.map +1 -0
  146. package/dist/agent-user-data-parts.d.ts +20 -0
  147. package/dist/agent-user-data-parts.d.ts.map +1 -0
  148. package/dist/agent-user-data-parts.js +161 -0
  149. package/dist/agent-user-data-parts.js.map +1 -0
  150. package/dist/agent-user-transcript.d.ts +46 -0
  151. package/dist/agent-user-transcript.d.ts.map +1 -0
  152. package/dist/agent-user-transcript.js +106 -0
  153. package/dist/agent-user-transcript.js.map +1 -0
  154. package/dist/agent-voice-notes.d.ts +15 -0
  155. package/dist/agent-voice-notes.d.ts.map +1 -0
  156. package/dist/agent-voice-notes.js +17 -0
  157. package/dist/agent-voice-notes.js.map +1 -0
  158. package/dist/agent-wakes.d.ts +213 -0
  159. package/dist/agent-wakes.d.ts.map +1 -0
  160. package/dist/agent-wakes.js +534 -0
  161. package/dist/agent-wakes.js.map +1 -0
  162. package/dist/agent.d.ts +1780 -0
  163. package/dist/agent.d.ts.map +1 -0
  164. package/dist/agent.js +3123 -0
  165. package/dist/agent.js.map +1 -0
  166. package/dist/ai.d.ts +583 -0
  167. package/dist/ai.d.ts.map +1 -0
  168. package/dist/ai.js +1858 -0
  169. package/dist/ai.js.map +1 -0
  170. package/dist/app-manifest.d.ts +255 -0
  171. package/dist/app-manifest.d.ts.map +1 -0
  172. package/dist/app-manifest.js +372 -0
  173. package/dist/app-manifest.js.map +1 -0
  174. package/dist/app-users.d.ts +30 -0
  175. package/dist/app-users.d.ts.map +1 -0
  176. package/dist/app-users.js +91 -0
  177. package/dist/app-users.js.map +1 -0
  178. package/dist/audit-archive.d.ts +85 -0
  179. package/dist/audit-archive.d.ts.map +1 -0
  180. package/dist/audit-archive.js +178 -0
  181. package/dist/audit-archive.js.map +1 -0
  182. package/dist/audit.d.ts +54 -0
  183. package/dist/audit.d.ts.map +1 -0
  184. package/dist/audit.js +95 -0
  185. package/dist/audit.js.map +1 -0
  186. package/dist/auth-logger.d.ts +28 -0
  187. package/dist/auth-logger.d.ts.map +1 -0
  188. package/dist/auth-logger.js +53 -0
  189. package/dist/auth-logger.js.map +1 -0
  190. package/dist/auth-password-secret.d.ts +59 -0
  191. package/dist/auth-password-secret.d.ts.map +1 -0
  192. package/dist/auth-password-secret.js +409 -0
  193. package/dist/auth-password-secret.js.map +1 -0
  194. package/dist/auth-schema.d.ts +120 -0
  195. package/dist/auth-schema.d.ts.map +1 -0
  196. package/dist/auth-schema.js +285 -0
  197. package/dist/auth-schema.js.map +1 -0
  198. package/dist/auth.d.ts +321 -0
  199. package/dist/auth.d.ts.map +1 -0
  200. package/dist/auth.js +1562 -0
  201. package/dist/auth.js.map +1 -0
  202. package/dist/backup-archive.d.ts +257 -0
  203. package/dist/backup-archive.d.ts.map +1 -0
  204. package/dist/backup-archive.js +2068 -0
  205. package/dist/backup-archive.js.map +1 -0
  206. package/dist/backup-crypto.d.ts +313 -0
  207. package/dist/backup-crypto.d.ts.map +1 -0
  208. package/dist/backup-crypto.js +693 -0
  209. package/dist/backup-crypto.js.map +1 -0
  210. package/dist/backup-format.d.ts +200 -0
  211. package/dist/backup-format.d.ts.map +1 -0
  212. package/dist/backup-format.js +1247 -0
  213. package/dist/backup-format.js.map +1 -0
  214. package/dist/cli.d.ts +9 -0
  215. package/dist/cli.d.ts.map +1 -0
  216. package/dist/cli.js +15 -0
  217. package/dist/cli.js.map +1 -0
  218. package/dist/clock.d.ts +35 -0
  219. package/dist/clock.d.ts.map +1 -0
  220. package/dist/clock.js +83 -0
  221. package/dist/clock.js.map +1 -0
  222. package/dist/data-client.d.ts +187 -0
  223. package/dist/data-client.d.ts.map +1 -0
  224. package/dist/data-client.js +590 -0
  225. package/dist/data-client.js.map +1 -0
  226. package/dist/data-secrets.d.ts +164 -0
  227. package/dist/data-secrets.d.ts.map +1 -0
  228. package/dist/data-secrets.js +383 -0
  229. package/dist/data-secrets.js.map +1 -0
  230. package/dist/db.d.ts +453 -0
  231. package/dist/db.d.ts.map +1 -0
  232. package/dist/db.js +324 -0
  233. package/dist/db.js.map +1 -0
  234. package/dist/dev-activity.d.ts +48 -0
  235. package/dist/dev-activity.d.ts.map +1 -0
  236. package/dist/dev-activity.js +50 -0
  237. package/dist/dev-activity.js.map +1 -0
  238. package/dist/do.d.ts +429 -0
  239. package/dist/do.d.ts.map +1 -0
  240. package/dist/do.js +4526 -0
  241. package/dist/do.js.map +1 -0
  242. package/dist/email.d.ts +137 -0
  243. package/dist/email.d.ts.map +1 -0
  244. package/dist/email.js +527 -0
  245. package/dist/email.js.map +1 -0
  246. package/dist/generated/admin-assets.d.ts +16 -0
  247. package/dist/generated/admin-assets.d.ts.map +1 -0
  248. package/dist/generated/admin-assets.js +16 -0
  249. package/dist/generated/admin-assets.js.map +1 -0
  250. package/dist/generated/admin-docs-assets.d.ts +3 -0
  251. package/dist/generated/admin-docs-assets.d.ts.map +1 -0
  252. package/dist/generated/admin-docs-assets.js +3 -0
  253. package/dist/generated/admin-docs-assets.js.map +1 -0
  254. package/dist/handoff-consumer.d.ts +79 -0
  255. package/dist/handoff-consumer.d.ts.map +1 -0
  256. package/dist/handoff-consumer.js +300 -0
  257. package/dist/handoff-consumer.js.map +1 -0
  258. package/dist/handoff.d.ts +70 -0
  259. package/dist/handoff.d.ts.map +1 -0
  260. package/dist/handoff.js +228 -0
  261. package/dist/handoff.js.map +1 -0
  262. package/dist/host-auth.d.ts +47 -0
  263. package/dist/host-auth.d.ts.map +1 -0
  264. package/dist/host-auth.js +59 -0
  265. package/dist/host-auth.js.map +1 -0
  266. package/dist/host-user.d.ts +15 -0
  267. package/dist/host-user.d.ts.map +1 -0
  268. package/dist/host-user.js +23 -0
  269. package/dist/host-user.js.map +1 -0
  270. package/dist/html.d.ts +35 -0
  271. package/dist/html.d.ts.map +1 -0
  272. package/dist/html.js +634 -0
  273. package/dist/html.js.map +1 -0
  274. package/dist/http-error.d.ts +13 -0
  275. package/dist/http-error.d.ts.map +1 -0
  276. package/dist/http-error.js +15 -0
  277. package/dist/http-error.js.map +1 -0
  278. package/dist/imports.d.ts +219 -0
  279. package/dist/imports.d.ts.map +1 -0
  280. package/dist/imports.js +571 -0
  281. package/dist/imports.js.map +1 -0
  282. package/dist/index.d.ts +78 -0
  283. package/dist/index.d.ts.map +1 -0
  284. package/dist/index.js +76 -0
  285. package/dist/index.js.map +1 -0
  286. package/dist/inference-tape.d.ts +64 -0
  287. package/dist/inference-tape.d.ts.map +1 -0
  288. package/dist/inference-tape.js +278 -0
  289. package/dist/inference-tape.js.map +1 -0
  290. package/dist/internal.d.ts +15 -0
  291. package/dist/internal.d.ts.map +1 -0
  292. package/dist/internal.js +48 -0
  293. package/dist/internal.js.map +1 -0
  294. package/dist/jobs.d.ts +796 -0
  295. package/dist/jobs.d.ts.map +1 -0
  296. package/dist/jobs.js +538 -0
  297. package/dist/jobs.js.map +1 -0
  298. package/dist/json-schema.d.ts +91 -0
  299. package/dist/json-schema.d.ts.map +1 -0
  300. package/dist/json-schema.js +884 -0
  301. package/dist/json-schema.js.map +1 -0
  302. package/dist/knowledge.d.ts +33 -0
  303. package/dist/knowledge.d.ts.map +1 -0
  304. package/dist/knowledge.js +348 -0
  305. package/dist/knowledge.js.map +1 -0
  306. package/dist/local-dev-chrome.d.ts +29 -0
  307. package/dist/local-dev-chrome.d.ts.map +1 -0
  308. package/dist/local-dev-chrome.js +514 -0
  309. package/dist/local-dev-chrome.js.map +1 -0
  310. package/dist/local-dev-personas.d.ts +15 -0
  311. package/dist/local-dev-personas.d.ts.map +1 -0
  312. package/dist/local-dev-personas.js +46 -0
  313. package/dist/local-dev-personas.js.map +1 -0
  314. package/dist/mcp.d.ts +567 -0
  315. package/dist/mcp.d.ts.map +1 -0
  316. package/dist/mcp.js +2480 -0
  317. package/dist/mcp.js.map +1 -0
  318. package/dist/modules.d.ts +145 -0
  319. package/dist/modules.d.ts.map +1 -0
  320. package/dist/modules.js +164 -0
  321. package/dist/modules.js.map +1 -0
  322. package/dist/notification-client.d.ts +94 -0
  323. package/dist/notification-client.d.ts.map +1 -0
  324. package/dist/notification-client.js +127 -0
  325. package/dist/notification-client.js.map +1 -0
  326. package/dist/notifications.d.ts +447 -0
  327. package/dist/notifications.d.ts.map +1 -0
  328. package/dist/notifications.js +1625 -0
  329. package/dist/notifications.js.map +1 -0
  330. package/dist/operator-data-query.d.ts +117 -0
  331. package/dist/operator-data-query.d.ts.map +1 -0
  332. package/dist/operator-data-query.js +431 -0
  333. package/dist/operator-data-query.js.map +1 -0
  334. package/dist/operator-mcp.d.ts +63 -0
  335. package/dist/operator-mcp.d.ts.map +1 -0
  336. package/dist/operator-mcp.js +2828 -0
  337. package/dist/operator-mcp.js.map +1 -0
  338. package/dist/outbound-https.d.ts +24 -0
  339. package/dist/outbound-https.d.ts.map +1 -0
  340. package/dist/outbound-https.js +172 -0
  341. package/dist/outbound-https.js.map +1 -0
  342. package/dist/pitr.d.ts +60 -0
  343. package/dist/pitr.d.ts.map +1 -0
  344. package/dist/pitr.js +94 -0
  345. package/dist/pitr.js.map +1 -0
  346. package/dist/platform.d.ts +199 -0
  347. package/dist/platform.d.ts.map +1 -0
  348. package/dist/platform.js +196 -0
  349. package/dist/platform.js.map +1 -0
  350. package/dist/policies.d.ts +115 -0
  351. package/dist/policies.d.ts.map +1 -0
  352. package/dist/policies.js +158 -0
  353. package/dist/policies.js.map +1 -0
  354. package/dist/principal.d.ts +143 -0
  355. package/dist/principal.d.ts.map +1 -0
  356. package/dist/principal.js +174 -0
  357. package/dist/principal.js.map +1 -0
  358. package/dist/realtime.d.ts +280 -0
  359. package/dist/realtime.d.ts.map +1 -0
  360. package/dist/realtime.js +578 -0
  361. package/dist/realtime.js.map +1 -0
  362. package/dist/retrieval.d.ts +263 -0
  363. package/dist/retrieval.d.ts.map +1 -0
  364. package/dist/retrieval.js +602 -0
  365. package/dist/retrieval.js.map +1 -0
  366. package/dist/runtime-error-client.d.ts +10 -0
  367. package/dist/runtime-error-client.d.ts.map +1 -0
  368. package/dist/runtime-error-client.js +70 -0
  369. package/dist/runtime-error-client.js.map +1 -0
  370. package/dist/runtime-errors.d.ts +180 -0
  371. package/dist/runtime-errors.d.ts.map +1 -0
  372. package/dist/runtime-errors.js +572 -0
  373. package/dist/runtime-errors.js.map +1 -0
  374. package/dist/schema.d.ts +434 -0
  375. package/dist/schema.d.ts.map +1 -0
  376. package/dist/schema.js +232 -0
  377. package/dist/schema.js.map +1 -0
  378. package/dist/search.d.ts +216 -0
  379. package/dist/search.d.ts.map +1 -0
  380. package/dist/search.js +785 -0
  381. package/dist/search.js.map +1 -0
  382. package/dist/settings.d.ts +191 -0
  383. package/dist/settings.d.ts.map +1 -0
  384. package/dist/settings.js +478 -0
  385. package/dist/settings.js.map +1 -0
  386. package/dist/sql.d.ts +7 -0
  387. package/dist/sql.d.ts.map +1 -0
  388. package/dist/sql.js +30 -0
  389. package/dist/sql.js.map +1 -0
  390. package/dist/storage-client.d.ts +69 -0
  391. package/dist/storage-client.d.ts.map +1 -0
  392. package/dist/storage-client.js +469 -0
  393. package/dist/storage-client.js.map +1 -0
  394. package/dist/storage.d.ts +21 -0
  395. package/dist/storage.d.ts.map +1 -0
  396. package/dist/storage.js +82 -0
  397. package/dist/storage.js.map +1 -0
  398. package/dist/subject-domains.d.ts +15 -0
  399. package/dist/subject-domains.d.ts.map +1 -0
  400. package/dist/subject-domains.js +38 -0
  401. package/dist/subject-domains.js.map +1 -0
  402. package/dist/support.d.ts +132 -0
  403. package/dist/support.d.ts.map +1 -0
  404. package/dist/support.js +483 -0
  405. package/dist/support.js.map +1 -0
  406. package/dist/system-tables.d.ts +12 -0
  407. package/dist/system-tables.d.ts.map +1 -0
  408. package/dist/system-tables.js +225 -0
  409. package/dist/system-tables.js.map +1 -0
  410. package/dist/test.d.ts +57 -0
  411. package/dist/test.d.ts.map +1 -0
  412. package/dist/test.js +454 -0
  413. package/dist/test.js.map +1 -0
  414. package/dist/vite.d.ts +82 -0
  415. package/dist/vite.d.ts.map +1 -0
  416. package/dist/vite.js +82 -0
  417. package/dist/vite.js.map +1 -0
  418. package/dist/webpush-crypto.d.ts +39 -0
  419. package/dist/webpush-crypto.d.ts.map +1 -0
  420. package/dist/webpush-crypto.js +213 -0
  421. package/dist/webpush-crypto.js.map +1 -0
  422. package/dist/webpush-private.d.ts +11 -0
  423. package/dist/webpush-private.d.ts.map +1 -0
  424. package/dist/webpush-private.js +11 -0
  425. package/dist/webpush-private.js.map +1 -0
  426. package/dist/webpush.d.ts +86 -0
  427. package/dist/webpush.d.ts.map +1 -0
  428. package/dist/webpush.js +375 -0
  429. package/dist/webpush.js.map +1 -0
  430. package/dist/worker.d.ts +185 -0
  431. package/dist/worker.d.ts.map +1 -0
  432. package/dist/worker.js +13021 -0
  433. package/dist/worker.js.map +1 -0
  434. package/package.json +161 -8
  435. package/README.md +0 -3
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,567 @@
1
+ import { z } from "zod";
2
+ import { type RaybaseActionDataClient } from "./data-client.js";
3
+ import { type DoMigration, type SqlExecutor } from "./db.js";
4
+ import { type JsonSchemaObject } from "./json-schema.js";
5
+ import type { RaybaseNotificationsRuntime } from "./notifications.js";
6
+ import type { RaybaseRuntimeScope } from "./platform.js";
7
+ import type { RaybaseJobsRuntime } from "./jobs.js";
8
+ import type { RaybaseUser } from "./policies.js";
9
+ import { type RaybaseSearch } from "./search.js";
10
+ import type { ResolvedRealtimeConfig, RealtimeSchemaSnapshot } from "./realtime.js";
11
+ import { type RaybaseConfig, type RaybaseSchema, type RaybaseSystemTable } from "./schema.js";
12
+ export declare const mcpAppsExtensionId = "io.modelcontextprotocol/ui";
13
+ export declare const mcpAppResourceMimeType = "text/html;profile=mcp-app";
14
+ export type RaybaseMcpAppVisibility = "model" | "app";
15
+ export type RaybaseMcpAppToolMeta = {
16
+ resourceUri?: string;
17
+ visibility?: RaybaseMcpAppVisibility[];
18
+ };
19
+ export type RaybaseMcpAppResourceCsp = {
20
+ connectDomains?: string[];
21
+ resourceDomains?: string[];
22
+ frameDomains?: string[];
23
+ baseUriDomains?: string[];
24
+ };
25
+ export type RaybaseMcpAppResourcePermissions = {
26
+ camera?: Record<string, never>;
27
+ microphone?: Record<string, never>;
28
+ geolocation?: Record<string, never>;
29
+ clipboardWrite?: Record<string, never>;
30
+ };
31
+ export type RaybaseMcpAppResourceMeta = {
32
+ csp?: RaybaseMcpAppResourceCsp;
33
+ permissions?: RaybaseMcpAppResourcePermissions;
34
+ domain?: string;
35
+ prefersBorder?: boolean;
36
+ };
37
+ export type RaybaseMcpAppClientCapability = {
38
+ mimeTypes?: string[];
39
+ [key: string]: unknown;
40
+ };
41
+ /** A picture in a tool's answer: base64 bytes and their media type, for example "image/png". */
42
+ export type RaybaseMcpImageContent = {
43
+ type: "image";
44
+ data: string;
45
+ mimeType: string;
46
+ _meta?: Record<string, unknown>;
47
+ };
48
+ export type RaybaseMcpToolResult = {
49
+ content?: Array<{
50
+ type: "text";
51
+ text: string;
52
+ } | RaybaseMcpImageContent | {
53
+ type: "resource";
54
+ resource: RaybaseMcpEmbeddedResource;
55
+ }>;
56
+ structuredContent?: unknown;
57
+ isError?: boolean;
58
+ _meta?: Record<string, unknown>;
59
+ };
60
+ export type RaybaseMcpActionToolDescriptor = {
61
+ name: string;
62
+ annotations?: {
63
+ readOnlyHint?: boolean;
64
+ destructiveHint?: boolean;
65
+ idempotentHint?: boolean;
66
+ };
67
+ resource?: {
68
+ name: string;
69
+ operation?: "create" | "read" | "list" | "search" | "get" | "update" | "delete" | "mutate";
70
+ inputRefs?: Record<string, {
71
+ resource?: string;
72
+ kind: "internal-id" | "external-id" | "context";
73
+ required?: boolean;
74
+ }>;
75
+ };
76
+ requiredInputKeys?: string[];
77
+ hasOutputSchema?: boolean;
78
+ };
79
+ export type RaybaseMcpEmbeddedResource = {
80
+ uri: string;
81
+ mimeType?: string;
82
+ text?: string;
83
+ blob?: string;
84
+ _meta?: {
85
+ ui?: RaybaseMcpAppResourceMeta;
86
+ [key: string]: unknown;
87
+ };
88
+ };
89
+ export type RaybaseMcpContext = {
90
+ clientId: string;
91
+ clientName?: string;
92
+ grantId: string;
93
+ scopes: string[];
94
+ subject: string;
95
+ /** Host account the grant is bound to, for grants made through `mcp.hostApproval`. */
96
+ hostAccount?: string;
97
+ /**
98
+ * Organization this call is scoped to: the grant's bound organization, or
99
+ * the one a layered runtime selected for the request. Null in Core.
100
+ */
101
+ organizationId?: string | null;
102
+ auditMetadata: Record<string, unknown>;
103
+ };
104
+ export type RaybaseMcpToolContext<Env = unknown> = {
105
+ request: Request;
106
+ env: Env;
107
+ config: RaybaseConfig;
108
+ user: RaybaseUser;
109
+ principal: RaybaseUser;
110
+ db: RaybaseActionDataClient;
111
+ control: SqlExecutor;
112
+ notifications?: RaybaseNotificationsRuntime<Env>;
113
+ jobs?: RaybaseJobsRuntime;
114
+ mcp: RaybaseMcpContext;
115
+ audit: (action: string, metadata?: unknown) => Promise<void>;
116
+ /**
117
+ * Organization scope a layered runtime resolved for this operator call.
118
+ * Addresses agent conversation Durable Objects and refuses conversation
119
+ * rows stamped for a different organization; undefined keeps the
120
+ * environment-derived scope.
121
+ */
122
+ agentConversationScope?: RaybaseRuntimeScope | null;
123
+ };
124
+ export type RaybaseMcpTool<Args = unknown, Env = unknown> = {
125
+ name: string;
126
+ description: string;
127
+ inputSchema: z.ZodType<Args> | JsonSchemaObject;
128
+ annotations?: {
129
+ title?: string;
130
+ readOnlyHint?: boolean;
131
+ destructiveHint?: boolean;
132
+ idempotentHint?: boolean;
133
+ openWorldHint?: boolean;
134
+ };
135
+ _meta?: {
136
+ ui?: RaybaseMcpAppToolMeta;
137
+ [key: string]: unknown;
138
+ };
139
+ raybase?: {
140
+ action?: RaybaseMcpActionToolDescriptor;
141
+ [key: string]: unknown;
142
+ };
143
+ scopes?: string[];
144
+ handler: (args: Args, ctx: RaybaseMcpToolContext<Env>) => Promise<RaybaseMcpToolResult>;
145
+ };
146
+ export type RaybaseMcpResource = {
147
+ uri: string;
148
+ name: string;
149
+ description?: string;
150
+ mimeType?: string;
151
+ scopes?: string[];
152
+ _meta?: {
153
+ ui?: RaybaseMcpAppResourceMeta;
154
+ [key: string]: unknown;
155
+ };
156
+ read: (ctx: RaybaseMcpToolContext) => Promise<RaybaseMcpEmbeddedResource>;
157
+ };
158
+ export type RaybaseGeneratedMcpToolsConfig = {
159
+ tables: Record<string, Array<"list" | "get" | "create" | "update" | "delete">>;
160
+ };
161
+ export type RaybaseMcpContextResolver<Env = unknown> = (ctx: {
162
+ request: Request;
163
+ env: Env;
164
+ token: RaybaseMcpAccessContext;
165
+ }) => Promise<Partial<RaybaseMcpContext> | void>;
166
+ export type RaybaseMcpOptions<Env = unknown> = {
167
+ config: RaybaseConfig;
168
+ schema: RaybaseSchema;
169
+ /** Manifest system tables; their secret() column names are kept out of tool-call audit records. */
170
+ systemTables?: readonly RaybaseSystemTable[];
171
+ surface?: "app" | "operator";
172
+ appMigrations?: DoMigration[];
173
+ search?: RaybaseSearch<Env>;
174
+ tools?: RaybaseMcpTool<unknown, Env>[];
175
+ resources?: RaybaseMcpResource[];
176
+ generatedTools?: RaybaseGeneratedMcpToolsConfig;
177
+ resolveContext?: RaybaseMcpContextResolver<Env>;
178
+ scopeOptions?: RaybaseMcpScopeOptions;
179
+ /**
180
+ * Lets a layered runtime validate tokens in its identity control plane.
181
+ * When present, the hook owns any control-plane schema initialization.
182
+ */
183
+ validateAccessToken?(input: {
184
+ request: Request;
185
+ env: Env;
186
+ surface: "app" | "operator";
187
+ expectedResource: string;
188
+ }): Promise<RaybaseMcpAccessContext | Response>;
189
+ /** Rebinds the runtime after token validation, for example to its tenant. */
190
+ resolveRuntimeEnv?(input: {
191
+ request: Request;
192
+ env: Env;
193
+ token: RaybaseMcpAccessContext;
194
+ surface: "app" | "operator";
195
+ }): Env | Promise<Env>;
196
+ /** Records grant usage in the control plane that owns the OAuth grant. */
197
+ recordEvent?(input: {
198
+ env: Env;
199
+ token: RaybaseMcpAccessContext;
200
+ action: string;
201
+ toolName?: string;
202
+ metadata?: unknown;
203
+ }): Promise<void>;
204
+ /** Persists Operator MCP evidence in the distribution's control plane. */
205
+ recordOperatorAudit?(input: {
206
+ env: Env;
207
+ token: RaybaseMcpAccessContext;
208
+ action: string;
209
+ targetType: string;
210
+ targetId?: string;
211
+ metadata?: unknown;
212
+ }): Promise<void>;
213
+ toolContext?: (ctx: {
214
+ request: Request;
215
+ env: Env;
216
+ user: RaybaseUser;
217
+ control: SqlExecutor;
218
+ mcp: RaybaseMcpContext;
219
+ }) => Partial<RaybaseMcpToolContext<Env>> | Promise<Partial<RaybaseMcpToolContext<Env>>>;
220
+ realtime?: {
221
+ config: ResolvedRealtimeConfig;
222
+ schema: RealtimeSchemaSnapshot;
223
+ };
224
+ };
225
+ /** Who a host-account grant acts as. `type` is stored as the grant's subjectType. */
226
+ export type RaybaseMcpHostSubject = {
227
+ type: string;
228
+ id: string;
229
+ email: string;
230
+ };
231
+ /**
232
+ * The connect-and-approve flow for an app embedded in another platform's
233
+ * admin: an MCP client's authorization request becomes a pending
234
+ * authorization, the host's admin shows the app's approval page, the app
235
+ * (having verified the host's session itself) issues a single-use ticket with
236
+ * `createMcpApprovalTicket`, and redeeming it at `oauthCompletePath` makes a
237
+ * grant bound to one of the host's accounts.
238
+ */
239
+ export type RaybaseMcpHostApprovalOptions<Env = unknown> = {
240
+ enabled?: boolean;
241
+ /**
242
+ * Where to send the person to approve: the app's approval page inside the
243
+ * host's admin for `hostAccount`, carrying `pendingAuthId`. `adminAuthPath`
244
+ * is the configured path of that page within the app.
245
+ */
246
+ approvalUrl(input: {
247
+ hostAccount: string;
248
+ pendingAuthId: string;
249
+ adminAuthPath: string;
250
+ env: Env;
251
+ }): string | URL;
252
+ /** Canonical form of a host account as typed or sent; throws when it is not one. */
253
+ normalizeHostAccount(input: string): string;
254
+ /** The identity a grant bound to `hostAccount` acts as. */
255
+ subject(hostAccount: string): RaybaseMcpHostSubject;
256
+ /**
257
+ * Request parameter that carries the host account: on the connect form, on
258
+ * the authorization request, and on MCP requests, where it must match the
259
+ * token's host account. Default "host_account".
260
+ */
261
+ hostAccountParam?: string;
262
+ /** Copy for the page that asks which host account to connect. */
263
+ connectPage?: {
264
+ title?: string;
265
+ description?: string;
266
+ label?: string;
267
+ placeholder?: string;
268
+ };
269
+ /** The app's approval page, rendered inside the host's admin. Default "/auth-mcp". */
270
+ adminAuthPath?: string;
271
+ /** Default "/mcp/connect". */
272
+ connectPath?: string;
273
+ /** Default "/mcp/oauth/complete". */
274
+ oauthCompletePath?: string;
275
+ };
276
+ export type RaybaseMcpPendingAuthorization = {
277
+ id: string;
278
+ clientId: string;
279
+ clientName: string;
280
+ redirectUri: string;
281
+ scope: string[];
282
+ resource: string;
283
+ state: string | null;
284
+ codeChallenge: string;
285
+ hostAccount: string | null;
286
+ expiresAt: string;
287
+ createdAt: string;
288
+ };
289
+ export type RaybaseMcpAccessContext = {
290
+ tokenId: string;
291
+ grantId: string;
292
+ user: RaybaseUser;
293
+ subjectType: string;
294
+ subjectId: string;
295
+ clientId: string;
296
+ clientName?: string;
297
+ scopes: string[];
298
+ resource: string;
299
+ /** Host account the grant is bound to, for grants made through `mcp.hostApproval`. */
300
+ hostAccount?: string;
301
+ /**
302
+ * Organization the grant was bound to when it was approved, or null when
303
+ * the grant follows the subject's active membership. Core has no
304
+ * organizations of its own; layered runtimes record and honour it.
305
+ */
306
+ organizationId?: string | null;
307
+ /** "client_credentials" for machine credentials, "authorization_code" otherwise. */
308
+ grantType?: "authorization_code" | "client_credentials";
309
+ };
310
+ export type RaybaseMcpOAuthClientSummary = {
311
+ clientId: string;
312
+ clientName: string;
313
+ grantId: string | null;
314
+ grantTypes: string[];
315
+ tokenEndpointAuthMethod: string;
316
+ scopes: string[];
317
+ resource: string | null;
318
+ organizationId: string | null;
319
+ createdByUserId: string | null;
320
+ createdAt: string;
321
+ revokedAt: string | null;
322
+ lastUsedAt: string | null;
323
+ };
324
+ export declare const raybaseMcpSystemTables: RaybaseSystemTable[];
325
+ export declare function normalizeMcpAppVisibility(value: unknown): RaybaseMcpAppVisibility[];
326
+ export declare function isMcpAppResource(resource: Pick<RaybaseMcpResource, "uri" | "mimeType">): boolean;
327
+ export declare function validateMcpAppResourceMeta(meta: RaybaseMcpResource["_meta"] | RaybaseMcpEmbeddedResource["_meta"] | undefined): void;
328
+ export declare function validateMcpAppResource(resource: RaybaseMcpResource): void;
329
+ export declare function validateMcpAppTool(tool: Pick<RaybaseMcpTool, "name" | "_meta">, resources: readonly RaybaseMcpResource[]): void;
330
+ export declare function withMcpAppUi<Args, Env>(tool: RaybaseMcpTool<Args, Env>, ui: RaybaseMcpAppToolMeta): RaybaseMcpTool<Args, Env>;
331
+ export declare function createMcpAppResource(input: {
332
+ uri: string;
333
+ name: string;
334
+ description?: string;
335
+ html?: string;
336
+ blob?: string;
337
+ scopes?: string[];
338
+ _meta?: {
339
+ ui?: RaybaseMcpAppResourceMeta;
340
+ [key: string]: unknown;
341
+ };
342
+ read?: (ctx: RaybaseMcpToolContext) => Promise<RaybaseMcpEmbeddedResource>;
343
+ }): RaybaseMcpResource;
344
+ export declare function canonicalMcpResource(request: Request, config: RaybaseConfig): string;
345
+ export declare function operatorMcpEndpoint(config: RaybaseConfig): string;
346
+ export declare function operatorMcpEnabled(config: RaybaseConfig): boolean;
347
+ export declare function canonicalOperatorMcpResource(request: Request, config: RaybaseConfig): string;
348
+ export declare const operatorMcpScopes: readonly ["operator:read", "operator:health:read", "operator:schema:read", "operator:policy:read", "operator:users:read", "operator:orgs:read", "operator:audit:read", "operator:imports:read", "operator:jobs:read", "operator:retrieval:read", "operator:search:read", "operator:mcp-grants:read", "operator:backups:read", "operator:storage:read", "operator:app-data:read", "operator:app-data:write", "operator:app-data:delete", "operator:settings:write", "operator:users:invite", "operator:users:lifecycle", "operator:findings:read", "operator:feedback:read", "operator:support:read", "operator:agent:read", "operator:agent-skills:read", "operator:agent-skills:write", "operator:agent-remote-mcp:read", "operator:agent-remote-mcp:write", "operator:ai:read", "operator:fleet:read"];
349
+ export type RaybaseMcpScopeOptions = {
350
+ operatorPermissions?: readonly string[];
351
+ /**
352
+ * First-party distributions may authorize their own fleet/scope-qualified
353
+ * operator grants after projecting a suitable operator identity.
354
+ */
355
+ allowExtendedOperatorScopes?: boolean;
356
+ /**
357
+ * Resolves the identity persisted on an OAuth grant. Core's default reads
358
+ * its closed `_auth_users` schema; layered runtimes can project their
359
+ * control-plane identity without changing the shared OAuth implementation.
360
+ */
361
+ resolveOAuthUser?(db: SqlExecutor, userId: string): Promise<RaybaseUser | null>;
362
+ /**
363
+ * Set by the runtime when `mcp.hostApproval` is enabled. Grants bound to a
364
+ * host account resolve through it, and refuse to resolve without it.
365
+ */
366
+ hostApproval?: Pick<RaybaseMcpHostApprovalOptions, "normalizeHostAccount" | "subject" | "hostAccountParam">;
367
+ };
368
+ /** The connector's name: `mcp.name`, else the app's name. */
369
+ export declare function mcpConnectorName(config: RaybaseConfig): string;
370
+ /** `mcp.instructions` as `initialize` returns it, or undefined when unset. */
371
+ export declare function mcpInstructions(config: RaybaseConfig): string | undefined;
372
+ export declare function checkMcpRateLimit(request: Request, bucket: string, limit?: number, windowMs?: number): Response | null;
373
+ export declare function isAllowedOrigin(origin: string, request: Request, config: RaybaseConfig): boolean;
374
+ /**
375
+ * Which connector a metadata request is about, from the path after
376
+ * `/.well-known/oauth-protected-resource` or `/.well-known/oauth-authorization-server`:
377
+ * nothing or the app's endpoint is the app connector, the operator endpoint is
378
+ * the operator connector (when it is on), anything else is no connector.
379
+ */
380
+ export declare function mcpMetadataSurface(config: RaybaseConfig, suffix: string): "app" | "operator" | null;
381
+ /**
382
+ * RFC 9728 metadata for one connector. It announces that connector's scopes
383
+ * and nothing else, so a product that asks for every scope it is told about
384
+ * asks only for what the connector grants.
385
+ */
386
+ export declare function protectedResourceMetadata(request: Request, config: RaybaseConfig, options?: RaybaseMcpScopeOptions, authorizationServer?: string, surface?: "app" | "operator"): {
387
+ resource: string;
388
+ resource_name: string;
389
+ authorization_servers: string[];
390
+ bearer_methods_supported: string[];
391
+ scopes_supported: string[];
392
+ resource_documentation: string;
393
+ };
394
+ /**
395
+ * RFC 8414 metadata. `scopes_supported` is the app connector's unless the
396
+ * request names the operator connector (`/.well-known/oauth-authorization-server/mcp/operator`).
397
+ */
398
+ export declare function authorizationServerMetadata(request: Request, options?: RaybaseMcpScopeOptions, authorizationServer?: string, surface?: "app" | "operator", config?: RaybaseConfig): {
399
+ issuer: string;
400
+ authorization_endpoint: string;
401
+ token_endpoint: string;
402
+ registration_endpoint: string;
403
+ revocation_endpoint: string;
404
+ response_types_supported: string[];
405
+ grant_types_supported: string[];
406
+ code_challenge_methods_supported: string[];
407
+ token_endpoint_auth_methods_supported: string[];
408
+ scopes_supported: string[];
409
+ client_id_metadata_document_supported: boolean;
410
+ authorization_response_iss_parameter_supported: boolean;
411
+ };
412
+ export declare function wwwAuthenticate(request: Request, config: RaybaseConfig, surface?: "app" | "operator"): string;
413
+ export declare function validateRedirectUri(uri: string, allowedHosts?: readonly string[]): string;
414
+ export declare function validateClientMetadataUrl(raw: string, allowedHosts?: readonly string[]): string;
415
+ type ClientMetadataDocument = {
416
+ client_id: string;
417
+ client_name: string;
418
+ redirect_uris: string[];
419
+ [key: string]: unknown;
420
+ };
421
+ export declare function fetchClientMetadataDocument(raw: string, options?: {
422
+ allowedHosts?: readonly string[];
423
+ fetcher?: typeof fetch;
424
+ timeoutMs?: number;
425
+ maxBytes?: number;
426
+ maxRedirects?: number;
427
+ }): Promise<ClientMetadataDocument>;
428
+ export type RaybaseMcpConfidentialClientBinding = {
429
+ /**
430
+ * Organization the machine credential is bound to. Layered runtimes pass the
431
+ * organization the registering session is acting in; Core leaves it null.
432
+ */
433
+ organizationId?: string | null;
434
+ };
435
+ export type RaybaseMcpMachineCredential = {
436
+ clientId: string;
437
+ /** Shown once: only its hash is stored. */
438
+ clientSecret: string;
439
+ grantId: string;
440
+ scopes: string[];
441
+ resource: string;
442
+ organizationId: string | null;
443
+ };
444
+ /**
445
+ * Makes a machine credential (a confidential `client_credentials` client and
446
+ * its grant) that acts as `user`, without a browser: for an app's own server
447
+ * code to hand a command-line tool or another service a way in. `resource` is
448
+ * the connector's absolute address (the app's `/mcp`, or `/mcp/operator`);
449
+ * `scope` defaults to that connector's default. The secret is returned once.
450
+ * Revoke with `revokeMcpOAuthClient`.
451
+ */
452
+ export declare function createMcpMachineCredential(db: SqlExecutor, config: RaybaseConfig, input: {
453
+ user: RaybaseUser;
454
+ clientName: string;
455
+ resource: string;
456
+ scope?: string;
457
+ /** The organization the credential is pinned to (a layered runtime's); null in Core. */
458
+ organizationId?: string | null;
459
+ tokenEndpointAuthMethod?: "client_secret_basic" | "client_secret_post";
460
+ metadata?: Record<string, unknown>;
461
+ }, options?: RaybaseMcpScopeOptions): Promise<RaybaseMcpMachineCredential>;
462
+ export declare function listMcpOAuthClientsForUser(db: SqlExecutor, userId: string): Promise<RaybaseMcpOAuthClientSummary[]>;
463
+ /**
464
+ * Revokes a confidential client and its grant family. When `ownerUserId` is
465
+ * given only that user's clients are revoked; admins pass null.
466
+ */
467
+ export declare function revokeMcpOAuthClient(db: SqlExecutor, clientId: string, actor: {
468
+ userId: string | null;
469
+ ownerUserId: string | null;
470
+ }): Promise<boolean>;
471
+ /**
472
+ * RFC 7591 registration. Public PKCE clients register anonymously as before.
473
+ * A body whose `grant_types` is `["client_credentials"]` registers a
474
+ * confidential client instead: it needs the signed-in `user`, takes `scope`
475
+ * (and optionally `resource`), and answers with a one-time `client_secret`.
476
+ */
477
+ export declare function registerMcpOAuthClient(request: Request, config: RaybaseConfig, db: SqlExecutor, user?: RaybaseUser | null, options?: RaybaseMcpScopeOptions, binding?: RaybaseMcpConfidentialClientBinding): Promise<Response>;
478
+ /**
479
+ * A choice the person makes on the consent page, posted back as the form
480
+ * field `name`. A layered runtime offers one when the grant could go to more
481
+ * than one place (Pro: which organization) and reads the posted value back.
482
+ */
483
+ export type RaybaseMcpConsentChoice = {
484
+ name: string;
485
+ label: string;
486
+ options: Array<{
487
+ value: string;
488
+ label: string;
489
+ }>;
490
+ /** The option chosen to begin with. Defaults to the first. */
491
+ selected?: string;
492
+ };
493
+ export type RaybaseMcpConsentOptions = {
494
+ choice?: RaybaseMcpConsentChoice | null;
495
+ };
496
+ /**
497
+ * The `org` hint an authorization request carries: the query string on GET,
498
+ * the form or JSON body on POST. Consumes the body, so callers that go on to
499
+ * call `authorizeMcpOAuthRequest` pass `request.clone()`. Core records
500
+ * nothing for it; a layered runtime resolves it to an organization the
501
+ * signed-in user belongs to and passes that as the grant binding.
502
+ */
503
+ export declare function mcpAuthorizationOrganizationHint(request: Request): Promise<string | null>;
504
+ export type RaybaseMcpGrantBinding = {
505
+ /**
506
+ * Organization the grant is pinned to. Null leaves the grant following the
507
+ * subject's active membership, which a layered runtime may switch per
508
+ * request; a pinned grant refuses any other organization.
509
+ */
510
+ organizationId?: string | null;
511
+ };
512
+ export declare function authorizeMcpOAuthRequest(request: Request, config: RaybaseConfig, db: SqlExecutor, user: RaybaseUser | null, options?: RaybaseMcpScopeOptions, binding?: RaybaseMcpGrantBinding, consent?: RaybaseMcpConsentOptions): Promise<Response>;
513
+ /**
514
+ * `GET /api/auth/oauth/consent`: what an app's own consent page (`mcp.consent.path`)
515
+ * shows, for the authorization request in the query. Answers 401 with
516
+ * `signIn` when nobody is signed in.
517
+ */
518
+ export declare function mcpOAuthConsentContext(request: Request, config: RaybaseConfig, db: SqlExecutor, user: RaybaseUser | null, options?: RaybaseMcpScopeOptions, consent?: RaybaseMcpConsentOptions): Promise<Response>;
519
+ /** The page that asks which host account to connect (GET), and its submit (POST) back into authorization. */
520
+ export declare function handleMcpHostConnect<Env>(request: Request, config: RaybaseConfig, options: RaybaseMcpHostApprovalOptions<Env>): Promise<Response>;
521
+ /**
522
+ * The authorization endpoint when host approval is on: records a pending
523
+ * authorization for the requested host account and sends the person to the
524
+ * host's admin to approve it. With no host account, sends them to the connect
525
+ * page first.
526
+ */
527
+ export declare function beginMcpHostAuthorization<Env>(request: Request, config: RaybaseConfig, db: SqlExecutor, env: Env, options: RaybaseMcpHostApprovalOptions<Env>): Promise<Response>;
528
+ export declare function getMcpPendingAuthorization(db: SqlExecutor, pendingAuthId: string): Promise<RaybaseMcpPendingAuthorization | null>;
529
+ /** The app's `mcp.hostApproval` as the host-account helpers below need it. */
530
+ export type RaybaseMcpHostAccountNormalizer = Pick<RaybaseMcpHostApprovalOptions, "normalizeHostAccount">;
531
+ /**
532
+ * Issues the single-use ticket that completes a pending authorization. Call it
533
+ * from the app's approval page only after verifying the host's own session;
534
+ * `hostAccount` is the account that session proves, in any form the app's
535
+ * `normalizeHostAccount` accepts: it is normalised here and must then equal
536
+ * the pending authorization's account. Pass the same `hostApproval` options
537
+ * the app gives `mcp.hostApproval`.
538
+ */
539
+ export declare function createMcpApprovalTicket(db: SqlExecutor, hostApproval: RaybaseMcpHostAccountNormalizer, input: {
540
+ pendingAuthId: string;
541
+ hostAccount: string;
542
+ }): Promise<{
543
+ ticket: string;
544
+ expiresAt: string;
545
+ }>;
546
+ export declare function topLevelMcpApprovalRedirectHtml(url: string): string;
547
+ export declare function redirectMcpPendingAuthorizationError(pending: RaybaseMcpPendingAuthorization, error: string): Response;
548
+ /** Redeems an approval ticket (once) and makes the grant bound to its host account. */
549
+ export declare function completeMcpHostApproval<Env>(request: Request, config: RaybaseConfig, db: SqlExecutor, options: RaybaseMcpHostApprovalOptions<Env>): Promise<Response>;
550
+ export declare function exchangeMcpOAuthToken(request: Request, config: RaybaseConfig, db: SqlExecutor, options?: RaybaseMcpScopeOptions): Promise<Response>;
551
+ export declare function revokeMcpOAuthToken(request: Request, db: SqlExecutor): Promise<Response>;
552
+ export declare function validateMcpBearerToken(request: Request, config: RaybaseConfig, db: SqlExecutor, expectedSurface?: "app" | "operator", options?: RaybaseMcpScopeOptions, resourceOverride?: string): Promise<RaybaseMcpAccessContext | Response>;
553
+ export declare function generatedMcpTools<Env>(schema: RaybaseSchema, config?: RaybaseGeneratedMcpToolsConfig): RaybaseMcpTool<unknown, Env>[];
554
+ export declare function createMcpHandler<Env>(options: RaybaseMcpOptions<Env>): (request: Request, env: Env) => Promise<Response>;
555
+ export declare function listMcpGrants(db: SqlExecutor): Promise<Record<string, unknown>[]>;
556
+ export declare function revokeMcpGrant(db: SqlExecutor, grantId: string, actorId: string | null): Promise<void>;
557
+ /**
558
+ * Revokes every live grant bound to a host account, and their tokens, for
559
+ * example when the host reports that the account uninstalled the app.
560
+ * `hostAccount` may be in any form the app's `normalizeHostAccount` accepts;
561
+ * it is normalised here (pass the same `hostApproval` options the app gives
562
+ * `mcp.hostApproval`), and a value it rejects throws. Returns how many grants
563
+ * were revoked.
564
+ */
565
+ export declare function revokeMcpGrantsForHostAccount(db: SqlExecutor, hostApproval: RaybaseMcpHostAccountNormalizer, hostAccountInput: string, actorId?: string | null): Promise<number>;
566
+ export {};
567
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,KAAK,uBAAuB,EAAyC,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAA6B,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAExF,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,sBAAsB,EAA8B,sBAAsB,EAAwB,MAAM,eAAe,CAAC;AACtI,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAC;AAKrB,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAC/D,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,KAAK,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,CA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