@lobu/runtime-server 24.9.0 → 24.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/catalogs/automations.json +2 -2
  2. package/dist/catalogs/connectors.json +16 -4
  3. package/dist/catalogs/skills.json +1 -1
  4. package/dist/component.json +1 -1
  5. package/dist/connectors/postgres.ts +39 -24
  6. package/dist/connectors/whatsapp-web-adapter.js +41 -10
  7. package/dist/connectors/whatsapp-web-helpers.ts +12 -2
  8. package/dist/connectors/whatsapp_web.ts +18 -2
  9. package/dist/db/migrations/20261112210000_instance_identity.sql +18 -0
  10. package/dist/dependencies.bun.lock +62 -60
  11. package/dist/embeddings-server.mjs +38 -5
  12. package/dist/owletto/dist/assets/_-CYvj1y65.js +3 -0
  13. package/dist/owletto/dist/assets/_-CeLTSYYY.js +2 -0
  14. package/dist/owletto/dist/assets/_agentId-BB5E-L6T.js +2 -0
  15. package/dist/owletto/dist/assets/{_agentId-bna2tPsW.js → _agentId-DN0EwMAC.js} +2 -2
  16. package/dist/owletto/dist/assets/_automationId-DvUl9CSd.js +2 -0
  17. package/dist/owletto/dist/assets/_connectorKey._connectionId-CVKfL9AG.js +2 -0
  18. package/dist/owletto/dist/assets/_connectorKey.index-Cv6FzK1v.js +2 -0
  19. package/dist/owletto/dist/assets/{_conversationId-zcs-S3dY.js → _conversationId-CPpNySjO.js} +2 -2
  20. package/dist/owletto/dist/assets/_eventId-DZKicuq6.js +2 -0
  21. package/dist/owletto/dist/assets/_owner-Dauk3YuD.js +3 -0
  22. package/dist/owletto/dist/assets/_shape-cKrEID3T.js +2 -0
  23. package/dist/owletto/dist/assets/_slug-DJx_8fsV.js +2 -0
  24. package/dist/owletto/dist/assets/_viewKey-CPVzVKEf.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-CW8gexOQ.js +2 -0
  26. package/dist/owletto/dist/assets/accept-invitation-Dwq1GAnG.js +2 -0
  27. package/dist/owletto/dist/assets/activity-route-location-C1jcXC7v.js +2 -0
  28. package/dist/owletto/dist/assets/activity-route-view-D78Wj0RH.js +2 -0
  29. package/dist/owletto/dist/assets/agent-connect-pages-DoI9UR0a.js +4 -0
  30. package/dist/owletto/dist/assets/{agent-editor-form-Bnc_q5WD.js → agent-editor-form-DlavYg2q.js} +2 -2
  31. package/dist/owletto/dist/assets/{agent-loading-shells-xteN-pyK.js → agent-loading-shells-DYqQphN7.js} +2 -2
  32. package/dist/owletto/dist/assets/agent-permissions-matrix-C1L8IcYR.js +2 -0
  33. package/dist/owletto/dist/assets/{agent-skill-context-r0O0BVOu.js → agent-skill-context-D1nMrVod.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-subpage-shell-C2KpYdu3.js → agent-subpage-shell-2w7vTeXw.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-thread-Bv_chdPy.js → agent-thread-BopD-2k1.js} +3 -3
  36. package/dist/owletto/dist/assets/{app._appId-BUcNaSMS.js → app._appId-BXeFXW1w.js} +2 -2
  37. package/dist/owletto/dist/assets/{assist-composer-B1LykXpD.js → assist-composer-CL5x8pNt.js} +2 -2
  38. package/dist/owletto/dist/assets/automation-run-now-MtxUTfzd.js +2 -0
  39. package/dist/owletto/dist/assets/{callback-kSLa4n5s.js → callback-BgfwP1Eo.js} +2 -2
  40. package/dist/owletto/dist/assets/{card-C01y1O-W.js → card-DtLIFq7D.js} +2 -2
  41. package/dist/owletto/dist/assets/{claim-Dnux9Lqf.js → claim-CT3hYVMF.js} +2 -2
  42. package/dist/owletto/dist/assets/{client-activity-scopes-BBIq16tG.js → client-activity-scopes-BPbRX-Pe.js} +2 -2
  43. package/dist/owletto/dist/assets/{client-rows-DGh1O-Fu.js → client-rows-vrNA6FLs.js} +2 -2
  44. package/dist/owletto/dist/assets/clients-xnzZeEdZ.js +2 -0
  45. package/dist/owletto/dist/assets/{code-editor-BdRMYojw.js → code-editor-mrKkAfcE.js} +2 -2
  46. package/dist/owletto/dist/assets/connect-NUCSay8X.js +2 -0
  47. package/dist/owletto/dist/assets/{connect-menu-D4w-JhJW.js → connect-menu-C6iVtuSo.js} +2 -2
  48. package/dist/owletto/dist/assets/connect._clientId-Cp-d9Q5b.js +2 -0
  49. package/dist/owletto/dist/assets/{connected._clientId-BsDzltNz.js → connected._clientId-ROfVgp9h.js} +2 -2
  50. package/dist/owletto/dist/assets/connection-BMz740Wi.js +2 -0
  51. package/dist/owletto/dist/assets/{connection-feed-detail-CJju0qiw.js → connection-feed-detail-0VAJiZTP.js} +2 -2
  52. package/dist/owletto/dist/assets/connector-page-shell-BFv21yuv.js +2 -0
  53. package/dist/owletto/dist/assets/{connector-provenance-B2C2cjBg.js → connector-provenance-b59RfBtk.js} +2 -2
  54. package/dist/owletto/dist/assets/connectors-nYS31lO2.js +2 -0
  55. package/dist/owletto/dist/assets/consent-cPRF9JQv.js +2 -0
  56. package/dist/owletto/dist/assets/{copy-button-BhXeXLIm.js → copy-button-C3wMMv63.js} +2 -2
  57. package/dist/owletto/dist/assets/{core.esm-CJUp2aNZ.js → core.esm-C9QlSrgK.js} +3 -3
  58. package/dist/owletto/dist/assets/{create-DUlRsFNn.js → create-ASRN3Obq.js} +2 -2
  59. package/dist/owletto/dist/assets/create-CBcodaSO.js +2 -0
  60. package/dist/owletto/dist/assets/create-CGOWfMk4.js +2 -0
  61. package/dist/owletto/dist/assets/{create-automation-form-D141prEG.js → create-automation-form-CLicoPH5.js} +3 -3
  62. package/dist/owletto/dist/assets/create._connectorKey-s4xkktTC.js +2 -0
  63. package/dist/owletto/dist/assets/{custom-guardrail-edits-DuQ28xv3.js → custom-guardrail-edits-BUL7nmuO.js} +2 -2
  64. package/dist/owletto/dist/assets/{definition-comparison-BUDNuAN_.js → definition-comparison-4UYMI6BK.js} +2 -2
  65. package/dist/owletto/dist/assets/{detail-page-skeleton-BRHaq5Sj.js → detail-page-skeleton-C8v3rJXK.js} +2 -2
  66. package/dist/owletto/dist/assets/device-BBwsOi7q.js +2 -0
  67. package/dist/owletto/dist/assets/{device-pin-tombstone-BIM-ziCH.js → device-pin-tombstone-Bcpe7nAA.js} +2 -2
  68. package/dist/owletto/dist/assets/{device._deviceId-BnPqTgK1.js → device._deviceId-DLT4jh0Z.js} +2 -2
  69. package/dist/owletto/dist/assets/{dynamic-schema-form-OkIZImgp.js → dynamic-schema-form-BDT8x0Vg.js} +2 -2
  70. package/dist/owletto/dist/assets/{entity-options-CpeX7iiX.js → entity-options-B9hm9V87.js} +2 -2
  71. package/dist/owletto/dist/assets/entity-page-DZjzQ2V4.js +2 -0
  72. package/dist/owletto/dist/assets/entity-pages-BWBpttz3.js +2 -0
  73. package/dist/owletto/dist/assets/entity-schema-graph-lMMx3HhR.js +2 -0
  74. package/dist/owletto/dist/assets/{entity-type-page-MgZ7_0oh.js → entity-type-page-CkQm0yEu.js} +2 -2
  75. package/dist/owletto/dist/assets/{event-detail-D6AH6a2C.js → event-detail-CkzfakTK.js} +2 -2
  76. package/dist/owletto/dist/assets/events-feed-DmRzikZW.js +2 -0
  77. package/dist/owletto/dist/assets/{filter-editors-DDTwyYt0.js → filter-editors-CQoSj-20.js} +3 -3
  78. package/dist/owletto/dist/assets/{full-page-spinner-DWo519BU.js → full-page-spinner-CYyCnKve.js} +2 -2
  79. package/dist/owletto/dist/assets/index-BE7eb2kE.js +2 -0
  80. package/dist/owletto/dist/assets/index-BFR0uiKY.js +2 -0
  81. package/dist/owletto/dist/assets/{index-Cd8jMsz8.js → index-BS5Ty3tf.js} +2 -2
  82. package/dist/owletto/dist/assets/index-C38OzBpB.js +2 -0
  83. package/dist/owletto/dist/assets/{index-D1UCJQl1.js → index-C3hz9tzx.js} +2 -2
  84. package/dist/owletto/dist/assets/index-CDyFQ32o.js +2 -0
  85. package/dist/owletto/dist/assets/{index-BW7IFKXC.js → index-CUndAH6o.js} +2 -2
  86. package/dist/owletto/dist/assets/index-CiKysEhV.js +2 -0
  87. package/dist/owletto/dist/assets/{index-CdDNNAx2.js → index-DByaMzsG.js} +274 -274
  88. package/dist/owletto/dist/assets/index-DfdinB7B.js +2 -0
  89. package/dist/owletto/dist/assets/index-DgMM4Zt5.css +1 -0
  90. package/dist/owletto/dist/assets/index-Xk711gVC.js +2 -0
  91. package/dist/owletto/dist/assets/{index-DmqnKGqW.js → index-ittfA0k8.js} +2 -2
  92. package/dist/owletto/dist/assets/{json-diff-C-WQqyIf.js → json-diff-mcDgyct_.js} +2 -2
  93. package/dist/owletto/dist/assets/{list-skeleton-0B1bTrAK.js → list-skeleton-DsYGUHxi.js} +2 -2
  94. package/dist/owletto/dist/assets/login-EoLq136v.js +2 -0
  95. package/dist/owletto/dist/assets/{logout-D474YsYQ.js → logout-gLgEQOiX.js} +2 -2
  96. package/dist/owletto/dist/assets/{member-scope-gate-CH_0jHiM.js → member-scope-gate-vvkgSAb2.js} +2 -2
  97. package/dist/owletto/dist/assets/memory-browse-page-DvDtwrEI.js +74 -0
  98. package/dist/owletto/dist/assets/{model-selector-XYmk7Iru.js → model-selector-D3vSMLO2.js} +2 -2
  99. package/dist/owletto/dist/assets/{needs-you-list-Bd4iiiqm.js → needs-you-list-B5Bgd05M.js} +2 -2
  100. package/dist/owletto/dist/assets/{new-CJ6TF3Vc.js → new-BPW3V0Y1.js} +2 -2
  101. package/dist/owletto/dist/assets/new-Bk_flKQO.js +2 -0
  102. package/dist/owletto/dist/assets/new-C5HtQdM_.js +2 -0
  103. package/dist/owletto/dist/assets/new-dLXsCHBd.js +2 -0
  104. package/dist/owletto/dist/assets/organization-DBfgBkzq.js +2 -0
  105. package/dist/owletto/dist/assets/{peek-pane-content-Cc8YX1oy.js → peek-pane-content-c2PG3TEX.js} +2 -2
  106. package/dist/owletto/dist/assets/{pending-seed-D7-ld7as.js → pending-seed-CBhx2Ql-.js} +2 -2
  107. package/dist/owletto/dist/assets/{proposal-review-shell-BWRJidwb.js → proposal-review-shell-B-jYcKfB.js} +2 -2
  108. package/dist/owletto/dist/assets/public-shell-ready-D8TijlRY.js +2 -0
  109. package/dist/owletto/dist/assets/record-activity-DnRVOrG2.js +2 -0
  110. package/dist/owletto/dist/assets/{record-session-ClKBr1_C.js → record-session-CAmGHMyM.js} +2 -2
  111. package/dist/owletto/dist/assets/{renderer-DZ0w2k2r.js → renderer-olRv_HMI.js} +3 -3
  112. package/dist/owletto/dist/assets/reset-password-B9_xi8Pq.js +2 -0
  113. package/dist/owletto/dist/assets/{run-initiator-B8IRlRd-.js → run-initiator-DhE5v4z0.js} +2 -2
  114. package/dist/owletto/dist/assets/runs-C8sZQr4o.js +2 -0
  115. package/dist/owletto/dist/assets/{runs-list-8gUPWjP4.js → runs-list-CwtH-wmk.js} +2 -2
  116. package/dist/owletto/dist/assets/{schema-value-k19Ata7u.js → schema-value-zTJGE4eh.js} +3 -3
  117. package/dist/owletto/dist/assets/{scoped-feed-bar-L7h-Ca4u.js → scoped-feed-bar-BKyJSa3_.js} +2 -2
  118. package/dist/owletto/dist/assets/{settings-BZqntV3E.js → settings-z02cvVS3.js} +2 -2
  119. package/dist/owletto/dist/assets/source-record-panels-CGmKIJdN.js +2 -0
  120. package/dist/owletto/dist/assets/{status-variants-BR_iGWN5.js → status-variants-DyRCXBzM.js} +2 -2
  121. package/dist/owletto/dist/assets/subDays-D8nHthaS.js +2 -0
  122. package/dist/owletto/dist/assets/{table-C3DMoL4K.js → table-C637cQxG.js} +2 -2
  123. package/dist/owletto/dist/assets/use-automations-CgWNoYio.js +2 -0
  124. package/dist/owletto/dist/assets/use-login-redirect-tDdhXTpt.js +2 -0
  125. package/dist/owletto/dist/assets/{use-mention-search-CtbixPEE.js → use-mention-search-D-kIKchD.js} +2 -2
  126. package/dist/owletto/dist/assets/view-param-filters-CUCj9Df-.js +2 -0
  127. package/dist/owletto/dist/assets/{views-access-required-CvIIxdS_.js → views-access-required-C35Dyt91.js} +2 -2
  128. package/dist/owletto/dist/index.html +2 -2
  129. package/dist/server-main.bundle.mjs +2733 -1795
  130. package/npm-shrinkwrap.json +238 -221
  131. package/package.json +1 -1
  132. package/vendor/connector-sdk/dist/connector-types.d.ts +6 -0
  133. package/vendor/connector-sdk/dist/index.d.ts +1 -0
  134. package/vendor/connector-sdk/dist/index.js +1 -0
  135. package/vendor/connector-sdk/dist/ip-reachability.d.ts +1 -1
  136. package/vendor/connector-sdk/dist/ip-reachability.js +1 -1
  137. package/vendor/connector-sdk/dist/logger.d.ts +1 -1
  138. package/vendor/connector-sdk/dist/logger.js +1 -1
  139. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +3 -1
  140. package/vendor/connector-sdk/dist/retry.d.ts +1 -1
  141. package/vendor/connector-sdk/dist/retry.js +1 -1
  142. package/vendor/connector-sdk/dist/source-withheld-error.d.ts +16 -0
  143. package/vendor/connector-sdk/dist/source-withheld-error.js +19 -0
  144. package/vendor/connector-sdk/package.json +1 -1
  145. package/vendor/core/dist/classify-error.d.ts +1 -1
  146. package/vendor/core/dist/classify-error.js +2 -2
  147. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +28 -3
  148. package/vendor/core/dist/contracts/tools/manage-automations.js +27 -8
  149. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +8 -0
  150. package/vendor/core/dist/contracts/tools/manage-entity.js +11 -3
  151. package/vendor/core/dist/contracts/tools/save-memory.d.ts +11 -1
  152. package/vendor/core/dist/contracts/tools/save-memory.js +25 -3
  153. package/vendor/core/dist/contracts/tools/search-memory.js +1 -1
  154. package/vendor/core/dist/credentials.d.ts +12 -0
  155. package/vendor/core/dist/credentials.js +1 -0
  156. package/vendor/core/dist/errors.js +2 -2
  157. package/vendor/core/dist/worker/auth.d.ts +5 -0
  158. package/vendor/core/dist/worker/auth.js +15 -4
  159. package/vendor/core/package.json +1 -1
  160. package/vendor/postgres/cf/src/connection.js +7 -2
  161. package/vendor/postgres/cjs/src/connection.js +7 -2
  162. package/vendor/postgres/src/connection.js +7 -2
  163. package/vendor/views/dist/native.d.ts +33 -1
  164. package/vendor/views/dist/native.js +3 -0
  165. package/vendor/views/package.json +1 -1
  166. package/dist/owletto/dist/assets/_-B2C9B2RM.js +0 -2
  167. package/dist/owletto/dist/assets/_-CjyiGzwB.js +0 -3
  168. package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +0 -2
  169. package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +0 -2
  170. package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +0 -2
  171. package/dist/owletto/dist/assets/_connectorKey.index-DqwSv8Zs.js +0 -2
  172. package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +0 -2
  173. package/dist/owletto/dist/assets/_owner-DsvIC94q.js +0 -3
  174. package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +0 -2
  175. package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +0 -2
  176. package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +0 -2
  177. package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +0 -2
  178. package/dist/owletto/dist/assets/accept-invitation-k1u3zBcn.js +0 -2
  179. package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +0 -2
  180. package/dist/owletto/dist/assets/agent-connect-pages-D3mVM_q4.js +0 -4
  181. package/dist/owletto/dist/assets/agent-permissions-matrix-C_ayr0pd.js +0 -2
  182. package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +0 -2
  183. package/dist/owletto/dist/assets/clients-BCvjAJDT.js +0 -2
  184. package/dist/owletto/dist/assets/connect-DZeFSGIH.js +0 -2
  185. package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +0 -2
  186. package/dist/owletto/dist/assets/connection-C7glVpPE.js +0 -2
  187. package/dist/owletto/dist/assets/connector-page-shell-BeuyjiB2.js +0 -2
  188. package/dist/owletto/dist/assets/connectors-DSQ5AWPf.js +0 -2
  189. package/dist/owletto/dist/assets/consent-B6Aw_89N.js +0 -2
  190. package/dist/owletto/dist/assets/create-CWcza8NT.js +0 -2
  191. package/dist/owletto/dist/assets/create-bGOYifof.js +0 -2
  192. package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +0 -2
  193. package/dist/owletto/dist/assets/device-D3fzoIrM.js +0 -2
  194. package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +0 -2
  195. package/dist/owletto/dist/assets/entity-pages-18xSANrS.js +0 -2
  196. package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +0 -2
  197. package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +0 -2
  198. package/dist/owletto/dist/assets/index-9tTjJo_J.css +0 -1
  199. package/dist/owletto/dist/assets/index-BYcFrinP.js +0 -2
  200. package/dist/owletto/dist/assets/index-BhJsTy-C.js +0 -2
  201. package/dist/owletto/dist/assets/index-CEcsgXDj.js +0 -2
  202. package/dist/owletto/dist/assets/index-CPscKk2u.js +0 -2
  203. package/dist/owletto/dist/assets/index-CfJ2-EpK.js +0 -2
  204. package/dist/owletto/dist/assets/index-D5DM4g2w.js +0 -2
  205. package/dist/owletto/dist/assets/index-DznAbTOF.js +0 -2
  206. package/dist/owletto/dist/assets/login-CH7P2AyR.js +0 -2
  207. package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +0 -74
  208. package/dist/owletto/dist/assets/new-BOsrRqp8.js +0 -2
  209. package/dist/owletto/dist/assets/new-DGPOjak2.js +0 -2
  210. package/dist/owletto/dist/assets/new-Q0XqiZq2.js +0 -2
  211. package/dist/owletto/dist/assets/organization-hD_Z6TSd.js +0 -2
  212. package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +0 -2
  213. package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +0 -2
  214. package/dist/owletto/dist/assets/reset-password-D2RfrEVZ.js +0 -2
  215. package/dist/owletto/dist/assets/runs-CuC7WMtd.js +0 -2
  216. package/dist/owletto/dist/assets/source-record-panels-C4UItfdk.js +0 -2
  217. package/dist/owletto/dist/assets/subDays-hOwerOLo.js +0 -2
  218. package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +0 -2
  219. package/dist/owletto/dist/assets/use-login-redirect-CYlVkAhE.js +0 -2
  220. package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +0 -2
  221. /package/vendor/postgres/{.bun-tag-c81dacd34e959a7a → .bun-tag-652f2580b8090d71} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/runtime-server",
3
- "version": "24.9.0",
3
+ "version": "24.10.0",
4
4
  "type": "module",
5
5
  "license": "BUSL-1.1",
6
6
  "repository": {
@@ -1087,6 +1087,12 @@ export interface FeedReadResult {
1087
1087
  window?: FeedReadWindowCoverage;
1088
1088
  }
1089
1089
  export type FeedSyncHandler<C = Record<string, unknown>, F = Record<string, unknown>> = (ctx: SyncContext<C, F>) => Promise<SyncResult>;
1090
+ /**
1091
+ * Reads one page from the source. Throw `SourceWithheldError` (or any error
1092
+ * whose own `code` is `'withheld'`) when the source deliberately withholds the
1093
+ * requested record: callers report it as private with the error's message as
1094
+ * the reason, and never retry it. Any other rejection is a read failure.
1095
+ */
1090
1096
  export type FeedReadHandler<F = Record<string, unknown>> = (ctx: FeedReadContext<F>) => Promise<FeedReadResult>;
1091
1097
  /** Executable feed definition held only inside a connector runtime. */
1092
1098
  export interface RuntimeFeedDefinition<C = Record<string, unknown>, F = Record<string, unknown>> extends Omit<FeedDefinition, 'operations' | 'webhook'> {
@@ -58,6 +58,7 @@ export type { FileDelta, FileSystemSource, Snapshot } from './file-source.js';
58
58
  export { connect } from './net.js';
59
59
  export type { ConnectFn, Socket, SocketAddress, SocketOptions, } from './net.js';
60
60
  export { assertFeedReadWindow, validateFeedReadWindow } from './feed-read-window.js';
61
+ export { SourceWithheldError } from './source-withheld-error.js';
61
62
  export { isSecretOutputKey, redactOutput } from './redact.js';
62
63
  export { scrubDiagnosticValue } from '@lobu/core/diagnostic-scrubber';
63
64
  //# sourceMappingURL=index.d.ts.map
@@ -46,6 +46,7 @@ export { extensionNetworkSync } from './extension-network.js';
46
46
  // =============================================================================
47
47
  export { connect } from './net.js';
48
48
  export { assertFeedReadWindow, validateFeedReadWindow } from './feed-read-window.js';
49
+ export { SourceWithheldError } from './source-withheld-error.js';
49
50
  // The worker's output redaction catalog, shared so a connector that returns
50
51
  // third-party text (logs, messages) can scrub it with the same patterns.
51
52
  export { isSecretOutputKey, redactOutput } from './redact.js';
@@ -21,7 +21,7 @@
21
21
  * Keeping the classifier here rather than in each consumer is deliberate:
22
22
  * `@lobu/connector-sdk` is the only package every consumer can import (the
23
23
  * server package is not reachable from a bundled connector, and `@lobu/core`
24
- * pulls OpenTelemetry, Sentry, and winston, which connectors intentionally
24
+ * pulls OpenTelemetry and winston, which connectors intentionally
25
25
  * avoid).
26
26
  *
27
27
  * The matcher collapses the spellings an attacker can use to dress up an
@@ -21,7 +21,7 @@
21
21
  * Keeping the classifier here rather than in each consumer is deliberate:
22
22
  * `@lobu/connector-sdk` is the only package every consumer can import (the
23
23
  * server package is not reachable from a bundled connector, and `@lobu/core`
24
- * pulls OpenTelemetry, Sentry, and winston, which connectors intentionally
24
+ * pulls OpenTelemetry and winston, which connectors intentionally
25
25
  * avoid).
26
26
  *
27
27
  * The matcher collapses the spellings an attacker can use to dress up an
@@ -2,7 +2,7 @@
2
2
  * SDK logger.
3
3
  *
4
4
  * Deliberately self-contained. The package root must stay loadable inside a
5
- * V8 isolate, and `@lobu/core`'s root entry pulls winston, Sentry and
5
+ * V8 isolate, and `@lobu/core`'s root entry pulls winston and
6
6
  * OpenTelemetry into every connector bundle — 6 MB of gateway internals whose
7
7
  * first `require('util')` throws where no Node runtime exists (guarded by
8
8
  * `packages/server/src/__tests__/integration/sandbox/connector-isolate-lane.test.ts`).
@@ -2,7 +2,7 @@
2
2
  * SDK logger.
3
3
  *
4
4
  * Deliberately self-contained. The package root must stay loadable inside a
5
- * V8 isolate, and `@lobu/core`'s root entry pulls winston, Sentry and
5
+ * V8 isolate, and `@lobu/core`'s root entry pulls winston and
6
6
  * OpenTelemetry into every connector bundle — 6 MB of gateway internals whose
7
7
  * first `require('util')` throws where no Node runtime exists (guarded by
8
8
  * `packages/server/src/__tests__/integration/sandbox/connector-isolate-lane.test.ts`).
@@ -17,7 +17,7 @@ import type { ConnectionListInput } from "@lobu/core/contracts/tools/manage-conn
17
17
  import type { EntityCreateInput, EntityCreateResult, EntityDeleteInput, EntityDeleteResult, EntityDiscoverDuplicatesInput, EntityDiscoverDuplicatesResult, EntityGetInput, EntityGetResult, EntityLinkInput, EntityLinkResult, EntityListInput, EntityListResult, EntityListLinksInput, EntityListLinksResult, EntityUnlinkInput, EntityUnlinkResult, EntityUpdateInput, EntityUpdateResult, EntityUpdateLinkInput, EntityUpdateLinkResult } from "@lobu/core/contracts/tools/manage-entity";
18
18
  import type { OperationExecuteInput, OperationListAvailableInput, OperationListRunsInput } from "@lobu/core/contracts/tools/manage-operations";
19
19
  import type { PublicGetContentArgs } from "@lobu/core/contracts/tools/read-knowledge";
20
- import type { SaveContentInput } from "@lobu/core/contracts/tools/save-memory";
20
+ import type { SaveContentInput, UnlinkedEntityName } from "@lobu/core/contracts/tools/save-memory";
21
21
  import type { PublicSearchArgs } from "@lobu/core/contracts/tools/search-memory";
22
22
  /**
23
23
  * A rich card for chat delivery, as a plain serializable object — a `chat`
@@ -58,6 +58,8 @@ export interface KnowledgeSaveResult {
58
58
  id: number;
59
59
  created: boolean;
60
60
  metadata: Record<string, unknown>;
61
+ /** `{ name }` entries from `entity_ids` that did not link. */
62
+ unlinked: UnlinkedEntityName[];
61
63
  }
62
64
  export interface NotificationsSendInput {
63
65
  /** Notification title (≤200 chars). */
@@ -9,7 +9,7 @@
9
9
  * 503.
10
10
  *
11
11
  * The backoff loop lives here rather than being imported from `@lobu/core`:
12
- * core's root entry drags winston, Sentry and OpenTelemetry into every
12
+ * core's root entry drags winston and OpenTelemetry into every
13
13
  * connector bundle, and the package root must stay loadable inside a V8
14
14
  * isolate. It keeps the semantics of core's `retryWithBackoff` for the one
15
15
  * configuration `withHttpRetry` uses: exponential, capped, full jitter.
@@ -9,7 +9,7 @@
9
9
  * 503.
10
10
  *
11
11
  * The backoff loop lives here rather than being imported from `@lobu/core`:
12
- * core's root entry drags winston, Sentry and OpenTelemetry into every
12
+ * core's root entry drags winston and OpenTelemetry into every
13
13
  * connector bundle, and the package root must stay loadable inside a V8
14
14
  * isolate. It keeps the semantics of core's `retryWithBackoff` for the one
15
15
  * configuration `withHttpRetry` uses: exponential, capped, full jitter.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Thrown from a feed `read` when the source deliberately withholds the
3
+ * requested record (for example, a private person's communications). The read
4
+ * is reported as withheld rather than failed: the caller is told the reason,
5
+ * nothing is retried, and pagination continues past it.
6
+ *
7
+ * The platform keys on the error's own `code === 'withheld'`, never on this
8
+ * class, so a connector on an older SDK opts in with
9
+ * `Object.assign(new Error(reason), { code: 'withheld' })`. The message is the
10
+ * human reason shown to the user.
11
+ */
12
+ export declare class SourceWithheldError extends Error {
13
+ readonly code: "withheld";
14
+ constructor(reason: string);
15
+ }
16
+ //# sourceMappingURL=source-withheld-error.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Thrown from a feed `read` when the source deliberately withholds the
3
+ * requested record (for example, a private person's communications). The read
4
+ * is reported as withheld rather than failed: the caller is told the reason,
5
+ * nothing is retried, and pagination continues past it.
6
+ *
7
+ * The platform keys on the error's own `code === 'withheld'`, never on this
8
+ * class, so a connector on an older SDK opts in with
9
+ * `Object.assign(new Error(reason), { code: 'withheld' })`. The message is the
10
+ * human reason shown to the user.
11
+ */
12
+ export class SourceWithheldError extends Error {
13
+ code = 'withheld';
14
+ constructor(reason) {
15
+ super(reason);
16
+ this.name = 'SourceWithheldError';
17
+ }
18
+ }
19
+ //# sourceMappingURL=source-withheld-error.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/connector-sdk",
3
- "version": "24.9.0",
3
+ "version": "24.10.0",
4
4
  "description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  * agent as `agent_error`.
11
11
  * - `response-renderer.ts` and `chat-response-bridge.ts` resolve the code to
12
12
  * a remediation CTA; with none, the user gets the provider's raw prose.
13
- * - An unclassified failure also misses the `PROVIDER_*` Sentry alerting.
13
+ * - An unclassified failure also misses the `PROVIDER_*` error alerting.
14
14
  *
15
15
  * Adding a failure mode = one pattern here + one entry in `AGENT_ERRORS`.
16
16
  *
@@ -11,7 +11,7 @@
11
11
  * agent as `agent_error`.
12
12
  * - `response-renderer.ts` and `chat-response-bridge.ts` resolve the code to
13
13
  * a remediation CTA; with none, the user gets the provider's raw prose.
14
- * - An unclassified failure also misses the `PROVIDER_*` Sentry alerting.
14
+ * - An unclassified failure also misses the `PROVIDER_*` error alerting.
15
15
  *
16
16
  * Adding a failure mode = one pattern here + one entry in `AGENT_ERRORS`.
17
17
  *
@@ -115,7 +115,7 @@ function classifyErrorMessage(message) {
115
115
  // (code no_credentials) when every credential tier misses. The live red-test
116
116
  // (LOBU-BACKEND-W) landed as `unclassified` because the auth-hint regex
117
117
  // doesn't cover this shape — and an unclassified event dodges the
118
- // PROVIDER_* Sentry alert.
118
+ // PROVIDER_* alert.
119
119
  if (/no\s+(provider\s+)?credentials\s+configured|no_credentials/i.test(message))
120
120
  return errors_js_1.AgentErrorCode.PROVIDER_AUTH;
121
121
  // The provider accepted the credential but refuses to USE it: Anthropic 403s
@@ -417,9 +417,17 @@ export declare const AutomationClaimNextWindowContextSchema: import("@sinclair/t
417
417
  }>>;
418
418
  }>;
419
419
  export type AutomationClaimNextWindowContext = Static<typeof AutomationClaimNextWindowContextSchema>;
420
- export declare const AutomationClaimNextWindowResultSchema: import("@sinclair/typebox").TObject<{
420
+ /**
421
+ * A claim either leases a window (`claimed`, with context to process and a
422
+ * window_token for completeWindow) or reports that the due window had no new
423
+ * or changed source content and was already booked as a no-op run
424
+ * (`completed`). A completed receipt needs no completeWindow: the schedule
425
+ * has advanced, so refresh activity for the next due window.
426
+ */
427
+ export declare const AutomationClaimNextWindowResultSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
421
428
  action: import("@sinclair/typebox").TLiteral<"claim_next_window">;
422
429
  automation_id: import("@sinclair/typebox").TString;
430
+ status: import("@sinclair/typebox").TLiteral<"claimed">;
423
431
  run_id: import("@sinclair/typebox").TInteger;
424
432
  lease_expires_at: import("@sinclair/typebox").TString;
425
433
  context: import("@sinclair/typebox").TObject<{
@@ -460,7 +468,15 @@ export declare const AutomationClaimNextWindowResultSchema: import("@sinclair/ty
460
468
  }>>;
461
469
  }>>;
462
470
  }>;
463
- }>;
471
+ }>, import("@sinclair/typebox").TObject<{
472
+ action: import("@sinclair/typebox").TLiteral<"claim_next_window">;
473
+ automation_id: import("@sinclair/typebox").TString;
474
+ status: import("@sinclair/typebox").TLiteral<"completed">;
475
+ run_id: import("@sinclair/typebox").TInteger;
476
+ skipped_unchanged: import("@sinclair/typebox").TLiteral<true>;
477
+ window_start: import("@sinclair/typebox").TString;
478
+ window_end: import("@sinclair/typebox").TString;
479
+ }>]>;
464
480
  export type AutomationClaimNextWindowResult = Static<typeof AutomationClaimNextWindowResultSchema>;
465
481
  export declare const AutomationTriggerExecutionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
466
482
  lane: import("@sinclair/typebox").TLiteral<"managed_agent">;
@@ -596,9 +612,10 @@ export declare const ManageAutomationsResultSchema: import("@sinclair/typebox").
596
612
  window_start: import("@sinclair/typebox").TString;
597
613
  window_end: import("@sinclair/typebox").TString;
598
614
  content_linked: import("@sinclair/typebox").TInteger;
599
- }>, import("@sinclair/typebox").TObject<{
615
+ }>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
600
616
  action: import("@sinclair/typebox").TLiteral<"claim_next_window">;
601
617
  automation_id: import("@sinclair/typebox").TString;
618
+ status: import("@sinclair/typebox").TLiteral<"claimed">;
602
619
  run_id: import("@sinclair/typebox").TInteger;
603
620
  lease_expires_at: import("@sinclair/typebox").TString;
604
621
  context: import("@sinclair/typebox").TObject<{
@@ -640,6 +657,14 @@ export declare const ManageAutomationsResultSchema: import("@sinclair/typebox").
640
657
  }>>;
641
658
  }>;
642
659
  }>, import("@sinclair/typebox").TObject<{
660
+ action: import("@sinclair/typebox").TLiteral<"claim_next_window">;
661
+ automation_id: import("@sinclair/typebox").TString;
662
+ status: import("@sinclair/typebox").TLiteral<"completed">;
663
+ run_id: import("@sinclair/typebox").TInteger;
664
+ skipped_unchanged: import("@sinclair/typebox").TLiteral<true>;
665
+ window_start: import("@sinclair/typebox").TString;
666
+ window_end: import("@sinclair/typebox").TString;
667
+ }>]>, import("@sinclair/typebox").TObject<{
643
668
  action: import("@sinclair/typebox").TLiteral<"trigger">;
644
669
  automation_id: import("@sinclair/typebox").TString;
645
670
  run_id: import("@sinclair/typebox").TInteger;
@@ -122,7 +122,7 @@ exports.AutomationScheduleTriggerSchema = typebox_1.Type.Object({
122
122
  })),
123
123
  skip_if_unchanged: typebox_1.Type.Optional(typebox_1.Type.Boolean({
124
124
  default: true,
125
- description: "Book a due window with no new or changed source content as a no-op run instead of dispatching an agent. Applies to native dispatch and to external claimNextWindow, which answers 409 for a skipped window.",
125
+ description: "Book a due window with no new or changed source content as a no-op run instead of dispatching an agent. Applies to native dispatch and to external claimNextWindow, which returns a status 'completed' receipt for a skipped window.",
126
126
  })),
127
127
  }, { additionalProperties: false });
128
128
  exports.AutomationTriggerSchema = typebox_1.Type.Union([
@@ -700,13 +700,32 @@ exports.AutomationClaimNextWindowContextSchema = typebox_1.Type.Object({
700
700
  skills: typebox_1.Type.Array(typebox_1.Type.Object({ name: typebox_1.Type.String(), content: typebox_1.Type.String() })),
701
701
  })),
702
702
  });
703
- exports.AutomationClaimNextWindowResultSchema = typebox_1.Type.Object({
704
- action: typebox_1.Type.Literal("claim_next_window"),
705
- automation_id: typebox_1.Type.String(),
706
- run_id: typebox_1.Type.Integer(),
707
- lease_expires_at: typebox_1.Type.String(),
708
- context: exports.AutomationClaimNextWindowContextSchema,
709
- });
703
+ /**
704
+ * A claim either leases a window (`claimed`, with context to process and a
705
+ * window_token for completeWindow) or reports that the due window had no new
706
+ * or changed source content and was already booked as a no-op run
707
+ * (`completed`). A completed receipt needs no completeWindow: the schedule
708
+ * has advanced, so refresh activity for the next due window.
709
+ */
710
+ exports.AutomationClaimNextWindowResultSchema = typebox_1.Type.Union([
711
+ typebox_1.Type.Object({
712
+ action: typebox_1.Type.Literal("claim_next_window"),
713
+ automation_id: typebox_1.Type.String(),
714
+ status: typebox_1.Type.Literal("claimed"),
715
+ run_id: typebox_1.Type.Integer(),
716
+ lease_expires_at: typebox_1.Type.String(),
717
+ context: exports.AutomationClaimNextWindowContextSchema,
718
+ }),
719
+ typebox_1.Type.Object({
720
+ action: typebox_1.Type.Literal("claim_next_window"),
721
+ automation_id: typebox_1.Type.String(),
722
+ status: typebox_1.Type.Literal("completed"),
723
+ run_id: typebox_1.Type.Integer(),
724
+ skipped_unchanged: typebox_1.Type.Literal(true),
725
+ window_start: typebox_1.Type.String(),
726
+ window_end: typebox_1.Type.String(),
727
+ }),
728
+ ]);
710
729
  exports.AutomationTriggerExecutionSchema = typebox_1.Type.Union([
711
730
  typebox_1.Type.Object({
712
731
  lane: typebox_1.Type.Literal("managed_agent"),
@@ -365,6 +365,13 @@ declare const RelationshipReadFailureSchema: import("@sinclair/typebox").TObject
365
365
  code: import("@sinclair/typebox").TString;
366
366
  }>;
367
367
  export type RelationshipReadFailure = Static<typeof RelationshipReadFailureSchema>;
368
+ /** A feed of a source-backed record's live read that returned no rows. */
369
+ export declare const SourceReadFailureSchema: import("@sinclair/typebox").TObject<{
370
+ feed_id: import("@sinclair/typebox").TInteger;
371
+ error: import("@sinclair/typebox").TString;
372
+ code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"withheld">>;
373
+ }>;
374
+ export type SourceReadFailure = Static<typeof SourceReadFailureSchema>;
368
375
  export declare const ManageEntityResultSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
369
376
  action: import("@sinclair/typebox").TLiteral<"create">;
370
377
  entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
@@ -686,6 +693,7 @@ export declare const ManageEntityResultSchema: import("@sinclair/typebox").TUnio
686
693
  record_failures: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
687
694
  feed_id: import("@sinclair/typebox").TInteger;
688
695
  error: import("@sinclair/typebox").TString;
696
+ code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<"withheld">>;
689
697
  }>>;
690
698
  next_cursor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
691
699
  }>, import("@sinclair/typebox").TObject<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageEntityResultSchema = exports.ManageEntityItemSchema = exports.EntityIdentitySchema = exports.RelationshipCountByTypeSchema = exports.RelationshipRowSchema = exports.ManageEntitySchema = exports.DiscoverDuplicatesAction = exports.ListLinksAction = exports.UpdateLinkAction = exports.UnlinkEntitiesAction = exports.LinkEntitiesAction = exports.DeleteEntityAction = exports.GetEntityAction = exports.ListEntitiesAction = exports.UpdateEntityAction = exports.CreateEntityAction = void 0;
3
+ exports.ManageEntityResultSchema = exports.SourceReadFailureSchema = exports.ManageEntityItemSchema = exports.EntityIdentitySchema = exports.RelationshipCountByTypeSchema = exports.RelationshipRowSchema = exports.ManageEntitySchema = exports.DiscoverDuplicatesAction = exports.ListLinksAction = exports.UpdateLinkAction = exports.UnlinkEntitiesAction = exports.LinkEntitiesAction = exports.DeleteEntityAction = exports.GetEntityAction = exports.ListEntitiesAction = exports.UpdateEntityAction = exports.CreateEntityAction = void 0;
4
4
  const typebox_1 = require("@sinclair/typebox");
5
5
  const interaction_envelope_1 = require("../interaction-envelope");
6
6
  const collection_selection_1 = require("./collection-selection");
@@ -277,7 +277,7 @@ exports.ListLinksAction = typebox_1.Type.Object({
277
277
  include_deleted: typebox_1.Type.Optional(IncludeDeleted),
278
278
  ...(0, pagination_1.paginationFields)(100),
279
279
  cursor: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String({ minLength: 1, maxLength: 65536 }), typebox_1.Type.Null()], {
280
- description: "[list_links, source records] Omit or pass null for the first bounded page, then pass next_cursor until it is null. Stop automatic pagination on record_failures; the cursor retains failed sources for an explicit retry. Pages may be short or empty while next_cursor exists. Merge repeated links across pages by (relationship_type, direction, entity_type, key), keeping the newest occurred_at. Numeric entity_id calls retain limit/offset pagination; source pages bound limit to 100. Authored relationships are permission checked at both endpoints. counts_by_type describes the visible page (counts_scope: page), not a global total. Source pages reject source, confidence_min and include_deleted filters, which cannot be applied to live links. Source reads share a 20 second page deadline. Unavailable endpoints are withheld with key-free relationship_failures; readable links remain available. Updating an edge still requires readable endpoints. Unlink by relationship_id remains available during outages.",
280
+ description: "[list_links, source records] Omit or pass null for the first bounded page, then pass next_cursor until it is null. Stop automatic pagination on record_failures without a code; the cursor retains those failed sources for an explicit retry. A failure with code 'withheld' is a source deliberately keeping the record private (error is its reason): its links are not missing, it is never retried, and pagination continues. Pages may be short or empty while next_cursor exists. Merge repeated links across pages by (relationship_type, direction, entity_type, key), keeping the newest occurred_at. Numeric entity_id calls retain limit/offset pagination; source pages bound limit to 100. Authored relationships are permission checked at both endpoints. counts_by_type describes the visible page (counts_scope: page), not a global total. Source pages reject source, confidence_min and include_deleted filters, which cannot be applied to live links. Source reads share a 20 second page deadline. Unavailable endpoints are withheld with key-free relationship_failures; readable links remain available. Updating an edge still requires readable endpoints. Unlink by relationship_id remains available during outages.",
281
281
  })),
282
282
  automation_source: typebox_1.Type.Optional(AutomationSource),
283
283
  });
@@ -412,6 +412,14 @@ const RelationshipReadFailureSchema = typebox_1.Type.Object({
412
412
  relationship_id: typebox_1.Type.Integer(),
413
413
  code: typebox_1.Type.String(),
414
414
  });
415
+ /** A feed of a source-backed record's live read that returned no rows. */
416
+ exports.SourceReadFailureSchema = typebox_1.Type.Object({
417
+ feed_id: typebox_1.Type.Integer(),
418
+ error: typebox_1.Type.String(),
419
+ code: typebox_1.Type.Optional(typebox_1.Type.Literal("withheld", {
420
+ description: "The source deliberately withholds this record and `error` is its reason. Its items are private, not missing; it is never retained for retry.",
421
+ })),
422
+ });
415
423
  exports.ManageEntityResultSchema = typebox_1.Type.Union([
416
424
  typebox_1.Type.Object({
417
425
  action: typebox_1.Type.Literal("create"),
@@ -537,7 +545,7 @@ exports.ManageEntityResultSchema = typebox_1.Type.Union([
537
545
  occurred_at: typebox_1.Type.String(),
538
546
  source_url: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
539
547
  })),
540
- record_failures: typebox_1.Type.Array(typebox_1.Type.Object({ feed_id: typebox_1.Type.Integer(), error: typebox_1.Type.String() })),
548
+ record_failures: typebox_1.Type.Array(exports.SourceReadFailureSchema),
541
549
  next_cursor: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
542
550
  }),
543
551
  typebox_1.Type.Object({
@@ -11,8 +11,12 @@
11
11
  */
12
12
  import { type Static } from "@sinclair/typebox";
13
13
  import type { FlatActionInput } from "./action-input";
14
+ /** Bounds on `{ name }` entries in `entity_ids`; the handler enforces the count. */
15
+ export declare const MAX_ENTITY_NAMES = 20;
14
16
  export declare const SaveContentSchema: import("@sinclair/typebox").TObject<{
15
- entity_ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
17
+ entity_ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TObject<{
18
+ name: import("@sinclair/typebox").TString;
19
+ }>]>>>;
16
20
  content: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
17
21
  title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
18
22
  author: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -32,6 +36,12 @@ export declare const SaveContentSchema: import("@sinclair/typebox").TObject<{
32
36
  }>>;
33
37
  }>;
34
38
  export type SaveContentArgs = Static<typeof SaveContentSchema>;
39
+ /** A `{ name }` entry from `entity_ids` that did not link, as returned in the save result's `unlinked`. */
40
+ export declare const UnlinkedEntityNameSchema: import("@sinclair/typebox").TObject<{
41
+ name: import("@sinclair/typebox").TString;
42
+ reason: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"ambiguous">, import("@sinclair/typebox").TLiteral<"not_writable">]>;
43
+ }>;
44
+ export type UnlinkedEntityName = Static<typeof UnlinkedEntityNameSchema>;
35
45
  /**
36
46
  * `client.knowledge.save` input. The schema leaves every field optional
37
47
  * because `saveContent` resolves the requirement per `payload_type`:
@@ -11,11 +11,23 @@
11
11
  * connector isolate lane can bundle it (`packages/connector-sdk/AGENTS.md`).
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.SaveContentSchema = void 0;
14
+ exports.UnlinkedEntityNameSchema = exports.SaveContentSchema = exports.MAX_ENTITY_NAMES = void 0;
15
15
  const typebox_1 = require("@sinclair/typebox");
16
+ /** Bounds on `{ name }` entries in `entity_ids`; the handler enforces the count. */
17
+ exports.MAX_ENTITY_NAMES = 20;
18
+ const MAX_ENTITY_NAME_LENGTH = 256;
16
19
  exports.SaveContentSchema = typebox_1.Type.Object({
17
- entity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Number(), {
18
- description: "Entity IDs to associate content with. Omit for org-scoped content.",
20
+ entity_ids: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Union([
21
+ typebox_1.Type.Integer({ minimum: 1 }),
22
+ typebox_1.Type.Object({
23
+ name: typebox_1.Type.String({
24
+ minLength: 1,
25
+ maxLength: MAX_ENTITY_NAME_LENGTH,
26
+ description: "The record's exact full name: a person's full name, owner/repo for a repository.",
27
+ }),
28
+ }, { additionalProperties: false }),
29
+ ]), {
30
+ description: `Records this content is about. Each entry is a record id, or { name } with the record's exact full name. A name links only when exactly one record in this workspace has that name; otherwise it is returned in \`unlinked\` and the content is still saved. Reference only records the content is substantially about, at most ${exports.MAX_ENTITY_NAMES} names. Omit for org-scoped content.`,
19
31
  })),
20
32
  content: typebox_1.Type.Optional(typebox_1.Type.String({
21
33
  description: "The text content to save. Required for text/markdown payload types.",
@@ -69,4 +81,14 @@ exports.SaveContentSchema = typebox_1.Type.Object({
69
81
  description: "Attribution source when save is triggered by an Automation reaction",
70
82
  })),
71
83
  });
84
+ /** A `{ name }` entry from `entity_ids` that did not link, as returned in the save result's `unlinked`. */
85
+ exports.UnlinkedEntityNameSchema = typebox_1.Type.Object({
86
+ name: typebox_1.Type.String(),
87
+ reason: typebox_1.Type.Union([
88
+ typebox_1.Type.Literal("not_found"),
89
+ typebox_1.Type.Literal("ambiguous"),
90
+ // Only on a replay of a save stored before members could link records (Nov 2026).
91
+ typebox_1.Type.Literal("not_writable"),
92
+ ]),
93
+ });
72
94
  //# sourceMappingURL=save-memory.js.map
@@ -38,7 +38,7 @@ exports.SearchSchema = typebox_1.Type.Object({
38
38
  description: "Filter by category metadata field",
39
39
  })),
40
40
  fuzzy: typebox_1.Type.Optional(typebox_1.Type.Boolean({
41
- description: "Enable fuzzy name matching",
41
+ description: "Enable fuzzy name matching. When false, an entity matches only on its exact name or an exact identifier (case-insensitive); no partial or similar names.",
42
42
  default: true,
43
43
  })),
44
44
  min_similarity: typebox_1.Type.Optional(typebox_1.Type.Number({
@@ -53,6 +53,18 @@ export declare function normalizeCredential<C extends BaseCredential = BaseCrede
53
53
  export declare function readCredentialStore<C extends BaseCredential = BaseCredential>(file: string, defaultContextName: string): Promise<CredentialStore<C>>;
54
54
  /** Read one context's credential (null when absent/corrupt). */
55
55
  export declare function readContextCredential<C extends BaseCredential = BaseCredential>(file: string, contextName: string, defaultContextName: string): Promise<C | null>;
56
+ /**
57
+ * Atomically write `data` to `file` with 0600 perms. Writes to a sibling temp
58
+ * file (same dir, so `rename` is on the same filesystem and therefore atomic on
59
+ * POSIX), chmods the temp BEFORE the rename so the published file never has a
60
+ * window of looser perms, then renames over the target. This makes concurrent
61
+ * writers (CLI `lobu login` + the server's token-refresh write-back) safe: each
62
+ * writer commits its whole-file image in a single atomic `rename`, so a reader
63
+ * always sees one writer's complete file — never a half-written / interleaved
64
+ * one. (Last-writer-wins on the rename; we don't merge, but neither writer can
65
+ * corrupt the store.)
66
+ */
67
+ export declare function atomicWriteFile(file: string, data: string): Promise<void>;
56
68
  /**
57
69
  * Write one context's credential into the store, preserving other contexts.
58
70
  * The write is atomic (temp-file + `rename`) so a concurrent writer (e.g. the
@@ -16,6 +16,7 @@ exports.CREDENTIAL_REFRESH_BUFFER_MS = void 0;
16
16
  exports.normalizeCredential = normalizeCredential;
17
17
  exports.readCredentialStore = readCredentialStore;
18
18
  exports.readContextCredential = readContextCredential;
19
+ exports.atomicWriteFile = atomicWriteFile;
19
20
  exports.writeContextCredential = writeContextCredential;
20
21
  exports.deleteContextCredential = deleteContextCredential;
21
22
  exports.credentialNeedsRefresh = credentialNeedsRefresh;
@@ -179,7 +179,7 @@ exports.AGENT_ERRORS = {
179
179
  // The provider's own finish_reason string is not useful to an end user
180
180
  // ("function_call_filter: MALFORMED_FUNCTION_CALL"), so unlike the other
181
181
  // PROVIDER_* entries this one carries its own text and does NOT relay the
182
- // upstream blob. The raw message stays in the logs / Sentry.
182
+ // upstream blob. The raw message stays in the logs.
183
183
  [AgentErrorCode.PROVIDER_TOOL_CALL_FAILED]: {
184
184
  message: "The model provider rejected its own tool call and ended the turn. This is usually temporary — please try again.",
185
185
  cta: "none",
@@ -241,7 +241,7 @@ exports.PROVIDER_BALANCE_EXHAUSTED = /credit balance is too low|insufficient (?:
241
241
  * Keep windowed wording ONLY. These classify as quota, but they often clear
242
242
  * within the minute, so nothing may treat them as a balance wall.
243
243
  */
244
- exports.PROVIDER_WINDOWED_QUOTA = /limit exhausted|usage limit|rate[-\s]?limit|quota (?:exceeded|exhausted)|too many requests|\b429\b|resource_exhausted/i;
244
+ exports.PROVIDER_WINDOWED_QUOTA = /limit exhausted|usage limit|(?:you've|you have) hit your weekly limit\b|rate[-\s]?limit|quota (?:exceeded|exhausted)|too many requests|\b429\b|resource_exhausted/i;
245
245
  /** Parse an `AgentErrorCode` from an unknown value (payload/DB boundary). */
246
246
  function toAgentErrorCode(value) {
247
247
  if (typeof value !== "string")
@@ -236,6 +236,11 @@ export interface WorkerTokenOptions {
236
236
  nixPackages?: string[];
237
237
  }
238
238
  export declare function generateWorkerToken(userId: string, conversationId: string, deploymentName: string, options: WorkerTokenOptions): string;
239
+ /** Mint a session bearer and advertise the same lifetime the verifier enforces. */
240
+ export declare function generateWorkerTokenWithExpiry(userId: string, conversationId: string, deploymentName: string, options: WorkerTokenOptions): {
241
+ token: string;
242
+ expiresAt: number;
243
+ };
239
244
  /**
240
245
  * Mint deployment-lifetime worker and proxy credentials with one revocation
241
246
  * identity. Revoking the deployment token must also stop its egress.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CHAT_TURN_ACCESS = void 0;
4
4
  exports.looksLikeWorkerToken = looksLikeWorkerToken;
5
5
  exports.generateWorkerToken = generateWorkerToken;
6
+ exports.generateWorkerTokenWithExpiry = generateWorkerTokenWithExpiry;
6
7
  exports.generateWorkerTokenPair = generateWorkerTokenPair;
7
8
  exports.mintGatewayMcpToken = mintGatewayMcpToken;
8
9
  exports.verifyWorkerToken = verifyWorkerToken;
@@ -32,7 +33,7 @@ exports.CHAT_TURN_ACCESS = [
32
33
  "public_visitor",
33
34
  "reply_only",
34
35
  ];
35
- function generateToken(userId, conversationId, deploymentName, options, tokenKind, jti = (0, node_crypto_1.randomUUID)()) {
36
+ function generateToken(userId, conversationId, deploymentName, options, tokenKind, jti = (0, node_crypto_1.randomUUID)(), timestamp = Date.now()) {
36
37
  if (!options.channelId) {
37
38
  throw new Error("channelId is required for worker token generation");
38
39
  }
@@ -47,7 +48,7 @@ function generateToken(userId, conversationId, deploymentName, options, tokenKin
47
48
  connectionId: options.connectionId,
48
49
  responseThreadId: options.responseThreadId,
49
50
  deploymentName,
50
- timestamp: Date.now(),
51
+ timestamp,
51
52
  platform: options.platform,
52
53
  source: options.source,
53
54
  executionMode: options.executionMode,
@@ -72,6 +73,14 @@ function generateToken(userId, conversationId, deploymentName, options, tokenKin
72
73
  function generateWorkerToken(userId, conversationId, deploymentName, options) {
73
74
  return generateToken(userId, conversationId, deploymentName, options, "worker");
74
75
  }
76
+ /** Mint a session bearer and advertise the same lifetime the verifier enforces. */
77
+ function generateWorkerTokenWithExpiry(userId, conversationId, deploymentName, options) {
78
+ const issuedAt = Date.now();
79
+ return {
80
+ token: generateToken(userId, conversationId, deploymentName, options, "worker", (0, node_crypto_1.randomUUID)(), issuedAt),
81
+ expiresAt: workerTokenExpiresAt(issuedAt),
82
+ };
83
+ }
75
84
  /**
76
85
  * Mint deployment-lifetime worker and proxy credentials with one revocation
77
86
  * identity. Revoking the deployment token must also stop its egress.
@@ -108,6 +117,9 @@ function parsePositiveIntEnv(name, fallback, allowZero = false) {
108
117
  return fallback;
109
118
  return raw;
110
119
  }
120
+ function workerTokenExpiresAt(issuedAt) {
121
+ return (issuedAt + parsePositiveIntEnv("WORKER_TOKEN_TTL_MS", 2 * 60 * 60 * 1000));
122
+ }
111
123
  /**
112
124
  * Verify and decrypt a worker authentication token
113
125
  */
@@ -273,10 +285,9 @@ function verifyToken(token, expectedKind) {
273
285
  // WORKER_TOKEN_CLOCK_SKEW_MS. Tokens timestamped further in the future
274
286
  // than the skew are rejected too — otherwise forward drift would grant
275
287
  // an unbounded validity window.
276
- const ttl = parsePositiveIntEnv("WORKER_TOKEN_TTL_MS", 2 * 60 * 60 * 1000);
277
288
  const skewMs = parsePositiveIntEnv("WORKER_TOKEN_CLOCK_SKEW_MS", 30 * 1000, true);
278
289
  const age = Date.now() - data.timestamp;
279
- if (age > ttl + skewMs) {
290
+ if (Date.now() > workerTokenExpiresAt(data.timestamp) + skewMs) {
280
291
  logger.error("Worker token rejected: expired");
281
292
  return null;
282
293
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "24.9.0",
3
+ "version": "24.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -180,11 +180,16 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
180
180
  : (query = q, query.active = true)
181
181
 
182
182
  build(q)
183
- return write(toBuffer(q))
183
+ const written = write(toBuffer(q))
184
+ // BEGIN must reserve its connection even when this write fills the
185
+ // pipeline or reports backpressure. The hook's result still controls
186
+ // whether the pool may schedule another query on this connection.
187
+ const executed = !q.options.onexecute || q.options.onexecute(connection)
188
+ return written
184
189
  && !q.describeFirst
185
190
  && !q.cursorFn
186
191
  && sent.length < max_pipeline
187
- && (!q.options.onexecute || q.options.onexecute(connection))
192
+ && executed
188
193
  } catch (error) {
189
194
  sent.length === 0 && write(Sync)
190
195
  errored(error)