@wildo-ai/saas-backend-lib 1.1.1 → 1.1.3

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 (972) hide show
  1. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
  2. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js +19 -1
  3. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
  4. package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
  5. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +4 -0
  6. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
  7. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts +35 -0
  8. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -0
  9. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js +111 -0
  10. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -0
  11. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts +50 -0
  12. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -0
  13. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +199 -0
  14. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -0
  15. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts +111 -0
  16. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
  17. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js +140 -0
  18. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
  19. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
  20. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  21. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +138 -24
  22. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  23. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
  24. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  25. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
  26. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  27. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
  28. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  29. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
  30. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
  31. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts +124 -13
  32. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +207 -21
  34. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts +60 -8
  36. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +174 -26
  38. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +48 -4
  40. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +102 -30
  42. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  43. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts +55 -0
  44. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -0
  45. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js +114 -0
  46. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -0
  47. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
  48. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
  49. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
  50. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
  51. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  52. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
  53. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
  54. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
  55. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  56. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +96 -32
  57. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  58. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
  59. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  60. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
  61. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
  62. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
  63. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  64. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
  65. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +80 -0
  66. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  67. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +298 -23
  68. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  69. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
  70. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  71. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +85 -5
  72. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  73. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
  74. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  75. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +146 -4
  76. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  77. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
  78. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
  79. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
  80. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
  81. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  82. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
  83. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
  84. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
  85. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +4 -1
  86. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
  87. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts +11 -0
  88. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
  89. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js +39 -5
  90. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
  91. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +181 -2
  92. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  93. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +533 -43
  94. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  95. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts +36 -3
  96. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
  97. package/dist/esm/base-classes/services/services/system-access.backend.service.js +70 -8
  98. package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
  99. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts +28 -0
  100. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -0
  101. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js +90 -0
  102. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -0
  103. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts +44 -0
  104. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -0
  105. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js +99 -0
  106. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -0
  107. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts +91 -0
  108. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -0
  109. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js +152 -0
  110. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -0
  111. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +186 -0
  112. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -0
  113. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +474 -0
  114. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
  115. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +100 -0
  116. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
  117. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +209 -6
  118. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
  119. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +200 -4
  120. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
  121. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +593 -64
  122. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
  123. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts +36 -0
  124. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -0
  125. package/dist/esm/billing/services/billing-adapter-registry.backend.js +83 -0
  126. package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -0
  127. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts +9 -0
  128. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
  129. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js +11 -1
  130. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
  131. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
  132. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +54 -13
  133. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  134. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +38 -1
  135. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
  136. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +67 -2
  137. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
  138. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +30 -1
  139. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
  140. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +43 -1
  141. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
  142. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +11 -3
  143. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  144. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +30 -16
  145. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
  146. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
  147. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +104 -25
  148. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
  149. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +18 -1
  150. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
  151. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +106 -2
  152. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
  153. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +52 -0
  154. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -0
  155. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +74 -0
  156. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -0
  157. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +104 -11
  158. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
  159. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +260 -26
  160. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
  161. package/dist/esm/billing/testing/mock-billing-provider.d.ts +30 -1
  162. package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
  163. package/dist/esm/billing/testing/mock-billing-provider.js +25 -0
  164. package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
  165. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js +11 -4
  166. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
  167. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +263 -13
  168. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  169. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +376 -58
  170. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  171. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +264 -7
  172. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  173. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +414 -5
  174. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  175. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
  176. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js +7 -1
  177. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
  178. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +16 -0
  179. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
  180. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +140 -0
  181. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
  182. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +42 -0
  183. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  184. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +65 -6
  185. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  186. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts +110 -0
  187. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -0
  188. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js +192 -0
  189. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -0
  190. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  191. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +45 -0
  192. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  193. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts +5 -0
  194. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
  195. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js +6 -0
  196. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
  197. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  198. package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
  199. package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
  200. package/dist/esm/config/models/app-config.backend.schemas.d.ts +146 -46
  201. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  202. package/dist/esm/config/models/app-config.backend.schemas.js +121 -12
  203. package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
  204. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts +38 -15
  205. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js +17 -2
  207. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
  208. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +0 -1
  209. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
  210. package/dist/esm/config/services/app-configuration-loader.backend.service.js +68 -76
  211. package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
  212. package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
  213. package/dist/esm/config/services/app-configuration.backend.service.js +23 -1
  214. package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
  215. package/dist/esm/config/services/app-configuration.backend.utils.d.ts +43 -1
  216. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  217. package/dist/esm/config/services/app-configuration.backend.utils.js +52 -3
  218. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  219. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +25 -0
  220. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
  221. package/dist/esm/config/services/application-startup-config-validator.backend.service.js +41 -1
  222. package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
  223. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
  224. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
  225. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
  226. package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
  227. package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
  228. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  229. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
  230. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
  231. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
  232. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
  233. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
  234. package/dist/esm/databases/services/redis.service.d.ts +27 -0
  235. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  236. package/dist/esm/databases/services/redis.service.js +29 -0
  237. package/dist/esm/databases/services/redis.service.js.map +1 -1
  238. package/dist/esm/errors/services/error-builder.backend.service.d.ts +13 -1
  239. package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
  240. package/dist/esm/errors/services/error-builder.backend.service.js +13 -1
  241. package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
  242. package/dist/esm/errors/services/error-handler.backend.service.d.ts +70 -7
  243. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  244. package/dist/esm/errors/services/error-handler.backend.service.js +134 -8
  245. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  246. package/dist/esm/errors/services/rate-limit.backend.service.d.ts +66 -0
  247. package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
  248. package/dist/esm/errors/services/rate-limit.backend.service.js +102 -25
  249. package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
  250. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts +5 -0
  251. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
  252. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js +25 -0
  253. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
  254. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts +33 -0
  255. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
  256. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js +40 -0
  257. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
  258. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
  259. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
  260. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
  261. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
  262. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
  263. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
  264. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
  265. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
  266. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +72 -4
  267. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  268. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +60 -19
  269. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  270. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  271. package/dist/esm/external-data/external-data-transform.backend.js +7 -1
  272. package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
  273. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
  274. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  275. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
  276. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts +4 -2
  278. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
  279. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
  280. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +256 -0
  281. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -0
  282. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +333 -0
  283. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -0
  284. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts +56 -0
  285. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -0
  286. package/dist/esm/external-providers/operations/provider-operation-request.backend.js +211 -0
  287. package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -0
  288. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts +45 -0
  289. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -0
  290. package/dist/esm/external-providers/operations/provider-request-signing.backend.js +216 -0
  291. package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -0
  292. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts +56 -0
  293. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -0
  294. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js +78 -0
  295. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -0
  296. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +1 -1
  297. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
  298. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +2 -2
  299. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
  300. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts +89 -0
  301. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -0
  302. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js +164 -0
  303. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -0
  304. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts +26 -27
  305. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
  306. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js +50 -64
  307. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
  308. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
  309. package/dist/esm/external-providers/services/document-extraction.backend.service.js +3 -3
  310. package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
  311. package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
  312. package/dist/esm/external-providers/services/embeddings.backend.service.js +4 -4
  313. package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
  314. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +306 -7
  315. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  316. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +539 -45
  317. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  318. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
  319. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +25 -2
  320. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
  321. package/dist/esm/files/controllers/file.controller.d.ts +24 -1
  322. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  323. package/dist/esm/files/controllers/file.controller.js +83 -11
  324. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  325. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
  326. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
  327. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
  328. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
  329. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
  330. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  331. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +76 -13
  332. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  333. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
  334. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  335. package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
  336. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  337. package/dist/esm/files/services/file-scanning.backend.service.d.ts +94 -9
  338. package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
  339. package/dist/esm/files/services/file-scanning.backend.service.js +197 -17
  340. package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
  341. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +60 -1
  342. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
  343. package/dist/esm/files/services/file-text-extraction.backend.service.js +167 -8
  344. package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
  345. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +214 -0
  346. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
  347. package/dist/esm/files/services/file-upload-grant.backend.service.js +566 -0
  348. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
  349. package/dist/esm/files/services/files.backend.service.d.ts +87 -0
  350. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  351. package/dist/esm/files/services/files.backend.service.js +252 -19
  352. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  353. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts +109 -0
  354. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -0
  355. package/dist/esm/files/storage/application-storage-key.backend.utils.js +123 -0
  356. package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -0
  357. package/dist/esm/files/storage/file-storage-provider.types.d.ts +16 -10
  358. package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
  359. package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
  360. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +67 -8
  361. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
  362. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +101 -28
  363. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
  364. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
  365. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
  366. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
  367. package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
  368. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
  369. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
  370. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  371. package/dist/esm/files/utils/file-uploader.utils.js +12 -0
  372. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  373. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts +86 -0
  374. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -0
  375. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js +288 -0
  376. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -0
  377. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts +15 -0
  378. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
  379. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js +76 -5
  380. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
  381. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
  382. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js +6 -1
  383. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
  384. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts +60 -0
  385. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
  386. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js +63 -0
  387. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
  388. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts +74 -0
  389. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +200 -44
  391. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  392. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts +7 -1
  393. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
  394. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js +53 -1
  395. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
  396. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts +18 -0
  397. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
  398. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js +18 -0
  399. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
  400. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts +12 -7
  401. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
  402. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
  403. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +0 -13
  404. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
  405. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +14 -22
  406. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
  407. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +8 -3
  408. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
  409. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +25 -15
  410. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
  411. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +13 -1
  412. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
  413. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
  414. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +88 -8
  415. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
  416. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +333 -31
  417. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
  418. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
  419. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js +4 -2
  420. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
  421. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts +113 -0
  422. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -0
  423. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js +62 -0
  424. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -0
  425. package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
  426. package/dist/esm/flows-actors/services/actors-system.backend.service.js +0 -2
  427. package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
  428. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +107 -1
  429. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  430. package/dist/esm/flows-actors/services/agents.backend.service.js +519 -56
  431. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  432. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +5 -1
  433. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
  434. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +79 -16
  435. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
  436. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +34 -5
  437. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
  438. package/dist/esm/flows-actors/services/flows-actors-registry.service.js +154 -20
  439. package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
  440. package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
  441. package/dist/esm/flows-actors/services/flows.backend.services.js +27 -23
  442. package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
  443. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
  444. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js +7 -1
  445. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
  446. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts +90 -0
  447. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -0
  448. package/dist/esm/flows-actors/services/mcp-client.backend.service.js +368 -0
  449. package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
  450. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +9 -5
  451. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
  452. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +12 -17
  453. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
  454. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
  455. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  456. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +308 -143
  457. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  458. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts +0 -207
  459. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
  460. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js +8 -243
  461. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
  462. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
  463. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
  464. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +9 -14
  465. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
  466. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +18 -89
  467. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
  468. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts +86 -0
  469. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -0
  470. package/dist/esm/guidance/services/progression-state-store.backend.service.js +155 -0
  471. package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -0
  472. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +10 -0
  473. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
  474. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +55 -5
  475. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
  476. package/dist/esm/index.d.ts +15 -5
  477. package/dist/esm/index.d.ts.map +1 -1
  478. package/dist/esm/index.js +45 -5
  479. package/dist/esm/index.js.map +1 -1
  480. package/dist/esm/inject/models/container.d.ts.map +1 -1
  481. package/dist/esm/inject/models/container.js +82 -10
  482. package/dist/esm/inject/models/container.js.map +1 -1
  483. package/dist/esm/inject/models/service-types.d.ts +20 -3
  484. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  485. package/dist/esm/inject/models/service-types.js +21 -3
  486. package/dist/esm/inject/models/service-types.js.map +1 -1
  487. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  488. package/dist/esm/mcp/controllers/mcp.controller.js +32 -4
  489. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  490. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
  491. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  492. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
  493. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  494. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +84 -1
  495. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  496. package/dist/esm/mcp/services/mcp-server.backend.service.js +235 -11
  497. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  498. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
  499. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  500. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +152 -6
  501. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  502. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
  503. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +49 -4
  504. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
  505. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts +66 -0
  506. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -0
  507. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js +199 -0
  508. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -0
  509. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +149 -13
  510. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
  511. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +411 -19
  512. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
  513. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +11 -2
  514. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
  515. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
  516. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +28 -9
  517. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
  518. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +30 -10
  519. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
  520. package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
  521. package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
  522. package/dist/esm/monitoring/logger/services/logger.service.js +52 -11
  523. package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
  524. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts +62 -0
  525. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -0
  526. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js +78 -0
  527. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -0
  528. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +309 -0
  529. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -0
  530. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +385 -0
  531. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -0
  532. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +1 -0
  533. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
  534. package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
  535. package/dist/esm/monitoring/observability/services/metrics.service.d.ts +21 -0
  536. package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
  537. package/dist/esm/monitoring/observability/services/metrics.service.js +38 -0
  538. package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
  539. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -80
  540. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -1
  541. package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -25
  542. package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -1
  543. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -49
  544. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -1
  545. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -141
  546. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -1
  547. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -37
  548. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -1
  549. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -121
  550. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -1
  551. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +66 -1
  552. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
  553. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +105 -10
  554. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
  555. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -58
  556. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -1
  557. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -223
  558. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -1
  559. package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
  560. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +10 -1
  561. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
  562. package/dist/esm/notifications/email/services/email.backend.service.d.ts +60 -4
  563. package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
  564. package/dist/esm/notifications/email/services/email.backend.service.js +145 -43
  565. package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
  566. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +0 -1
  567. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
  568. package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
  569. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +142 -21
  570. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
  571. package/dist/esm/notifications/services/notification-badge.backend.service.js +283 -58
  572. package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
  573. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +108 -13
  574. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  575. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +432 -101
  576. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  577. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +2 -2
  578. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
  579. package/dist/esm/notifications/sms/services/sms.backend.service.js +5 -5
  580. package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
  581. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +117 -5
  582. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
  583. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +164 -6
  584. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
  585. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts +0 -6
  586. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  587. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +54 -7
  588. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  589. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
  590. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  591. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
  592. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
  593. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
  594. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  595. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +18 -8
  596. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  597. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  598. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +20 -18
  599. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  600. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +16 -0
  601. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
  602. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +18 -0
  603. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
  604. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts +2 -2
  605. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js +2 -2
  606. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
  607. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
  608. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
  609. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
  610. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  611. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
  612. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
  613. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts +66 -0
  614. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -0
  615. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js +257 -0
  616. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -0
  617. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts +12 -0
  618. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -0
  619. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js +47 -0
  620. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -0
  621. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts +87 -0
  622. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -0
  623. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js +1 -0
  624. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -0
  625. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts +31 -0
  626. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -0
  627. package/dist/esm/queue/adapters/queue-adapter.backend.options.js +13 -0
  628. package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -0
  629. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +19 -25
  630. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
  631. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +33 -0
  632. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
  633. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +2 -2
  634. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
  635. package/dist/esm/queue/domain-queue-consumer.backend.service.js +1 -4
  636. package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
  637. package/dist/esm/queue/job-consumer.backend.service.d.ts +2 -2
  638. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  639. package/dist/esm/queue/job-consumer.backend.service.js +1 -4
  640. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  641. package/dist/esm/queue/job-executor.backend.service.d.ts +2 -2
  642. package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
  643. package/dist/esm/queue/job-executor.backend.service.js +1 -4
  644. package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
  645. package/dist/esm/queue/queue-monitoring.backend.service.d.ts +8 -4
  646. package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
  647. package/dist/esm/queue/queue-monitoring.backend.service.js +25 -17
  648. package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
  649. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +16 -1
  650. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
  651. package/dist/esm/queue/queue-worker-initializer.backend.service.js +16 -1
  652. package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
  653. package/dist/esm/queue/queue.backend.service.d.ts +3 -3
  654. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  655. package/dist/esm/queue/queue.backend.service.js +26 -4
  656. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  657. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +2 -2
  658. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
  659. package/dist/esm/queue/worker-shutdown-manager.backend.service.js +18 -3
  660. package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
  661. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts +50 -25
  662. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
  663. package/dist/esm/rag/utils/rag-chunking.backend.utils.js +147 -39
  664. package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
  665. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts +12 -3
  666. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
  667. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js +12 -3
  668. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
  669. package/dist/esm/requests/service/websocket.service.d.ts +9 -0
  670. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  671. package/dist/esm/requests/service/websocket.service.js +88 -15
  672. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  673. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  674. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +16 -2
  675. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  676. package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
  677. package/dist/esm/resources/models/resources-operations.backend.definitions.js +2 -0
  678. package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
  679. package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
  680. package/dist/esm/resources/models/resources-relationships.backend.definitions.js +14 -0
  681. package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
  682. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +2 -1
  683. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
  684. package/dist/esm/resources/models/resources-types.backend.schemas.js +8 -0
  685. package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
  686. package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
  687. package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
  688. package/dist/esm/resources/services/resources-registry.backend.service.d.ts +60 -5
  689. package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
  690. package/dist/esm/resources/services/resources-registry.backend.service.js +91 -7
  691. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  692. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +36 -3
  693. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
  694. package/dist/esm/runtime/controllers/health-controller.backend.service.js +32 -10
  695. package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
  696. package/dist/esm/runtime/domain-module.backend.definitions.d.ts +24 -0
  697. package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
  698. package/dist/esm/runtime/domain-module.backend.definitions.js +24 -0
  699. package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
  700. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  701. package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
  702. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  703. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +51 -0
  704. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
  705. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
  706. package/dist/esm/runtime/services/http-server.backend.service.d.ts +26 -0
  707. package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
  708. package/dist/esm/runtime/services/http-server.backend.service.js +181 -1
  709. package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
  710. package/dist/esm/runtime/services/start-application.backend.service.d.ts +47 -1
  711. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  712. package/dist/esm/runtime/services/start-application.backend.service.js +343 -77
  713. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  714. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts +15 -0
  715. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
  716. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js +28 -0
  717. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
  718. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +5 -1
  719. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
  720. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +24 -4
  721. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
  722. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
  723. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +29 -4
  724. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
  725. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts +114 -0
  726. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
  727. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js +354 -3
  728. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
  729. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts +1 -0
  730. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
  731. package/dist/esm/security/authentications/models/cimd.backend.schemas.js +22 -0
  732. package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
  733. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
  734. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  735. package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
  736. package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
  737. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
  738. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
  739. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
  740. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +0 -2
  741. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
  742. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +23 -14
  743. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
  744. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +0 -1
  745. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
  746. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +15 -12
  747. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
  748. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +113 -3
  749. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
  750. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +207 -30
  751. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
  752. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +95 -2
  753. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
  754. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +153 -9
  755. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
  756. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +190 -0
  757. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
  758. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +377 -53
  759. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
  760. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
  761. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  762. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +77 -2
  763. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  764. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  765. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
  766. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
  767. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +41 -0
  768. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
  769. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +202 -23
  770. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
  771. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
  772. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +42 -1
  773. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
  774. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
  775. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +34 -4
  776. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
  777. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +29 -5
  778. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
  779. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +77 -5
  780. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
  781. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +41 -1
  782. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  783. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +87 -4
  784. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  785. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +43 -1
  786. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
  787. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +277 -97
  788. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
  789. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts +28 -5
  790. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
  791. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js +72 -12
  792. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
  793. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
  794. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +3 -0
  795. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
  796. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts +28 -0
  797. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -0
  798. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +283 -0
  799. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -0
  800. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +4 -3
  801. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
  802. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +4 -3
  803. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
  804. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts +35 -0
  805. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
  806. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js +111 -21
  807. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
  808. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts +14 -1
  809. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
  810. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js +49 -8
  811. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
  812. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
  813. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js +4 -0
  814. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
  815. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
  816. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +6 -0
  817. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
  818. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts +37 -1
  819. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
  820. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js +51 -0
  821. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
  822. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts +41 -0
  823. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
  824. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js +45 -0
  825. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
  826. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
  827. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
  828. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
  829. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
  830. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  831. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
  832. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
  833. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
  834. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
  835. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
  836. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
  837. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
  838. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +77 -3
  839. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
  840. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
  841. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
  842. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
  843. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
  844. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts +4 -0
  845. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
  846. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js +4 -0
  847. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
  848. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +93 -0
  849. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -0
  850. package/dist/esm/security/authorizations/role-conferral.backend.utils.js +95 -0
  851. package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -0
  852. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +124 -1
  853. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
  854. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +142 -5
  855. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
  856. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +175 -14
  857. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  858. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +385 -49
  859. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  860. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +6 -14
  861. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
  862. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +13 -22
  863. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
  864. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts +60 -0
  865. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -0
  866. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js +79 -0
  867. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -0
  868. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +161 -0
  869. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -0
  870. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +512 -0
  871. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -0
  872. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +59 -0
  873. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -0
  874. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js +22 -0
  875. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -0
  876. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts +44 -0
  877. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -0
  878. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js +20 -0
  879. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -0
  880. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +191 -0
  881. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -0
  882. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +385 -0
  883. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -0
  884. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts +41 -0
  885. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
  886. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js +358 -0
  887. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -0
  888. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts +160 -0
  889. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -0
  890. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +266 -0
  891. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -0
  892. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +111 -0
  893. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -0
  894. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +107 -0
  895. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -0
  896. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts +54 -0
  897. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -0
  898. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +153 -0
  899. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -0
  900. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +195 -0
  901. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -0
  902. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +387 -0
  903. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -0
  904. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts +45 -0
  905. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
  906. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js +291 -0
  907. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -0
  908. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +62 -0
  909. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -0
  910. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js +29 -0
  911. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -0
  912. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts +127 -0
  913. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -0
  914. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js +277 -0
  915. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -0
  916. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts +66 -0
  917. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -0
  918. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js +75 -0
  919. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -0
  920. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
  921. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  922. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
  923. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
  924. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
  925. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
  926. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
  927. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
  928. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
  929. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  930. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
  931. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
  932. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +41 -3
  933. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  934. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +83 -20
  935. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  936. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts +9 -4
  937. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
  938. package/dist/esm/security/credential-rotation-grace.backend.utils.js +9 -4
  939. package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
  940. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  941. package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
  942. package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
  943. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts +26 -0
  944. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
  945. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js +43 -0
  946. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
  947. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +8 -1
  948. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
  949. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +49 -0
  950. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
  951. package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
  952. package/dist/esm/security/scim/controllers/scim.backend.controller.js +17 -5
  953. package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
  954. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +67 -29
  955. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
  956. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +47 -25
  957. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
  958. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts +10 -2
  959. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
  960. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js +10 -2
  961. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
  962. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts +143 -0
  963. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -0
  964. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js +258 -0
  965. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -0
  966. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts +39 -0
  967. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -0
  968. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js +159 -0
  969. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -0
  970. package/dist/tsconfig.build.tsbuildinfo +1 -1
  971. package/package.json +17 -9
  972. package/dist/esm/.builder.pid +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.backend.service.js","sourceRoot":"","sources":["../../../../../src/mcp/services/mcp-server.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAGL,kCAAkC,EAClC,qBAAqB,EACrB,SAAS,EACT,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kE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AAC;IAEO,aAAa,CAAC,QAAgB;QACpC,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACjE,IAAI,cAAc,IAAI,CAAC,IAAI,cAAc,GAAG,uBAAuB,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC9F,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE;gBAClE,sBAAsB,EAAE,2BAA2B,CAAC,iBAAiB;gBACrE,OAAO,EAAE,EAAE,OAAO,EAAE,4BAA4B,QAAQ,2BAA2B,uBAAuB,cAAc,EAAE,QAAQ,EAAE;aACrI,CAAC,CAAC;QACL,CAAC;QACD,OAAO;YACL,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAiB;YAC/D,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,GAAG,uBAAuB,CAAC,MAAM,CAAC;SACrF,CAAC;IACJ,CAAC;CACF,CAAA;AApPY,uBAAuB;IADnC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IACzC,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;+CAJ8B,0BAA0B;QAChC,4BAA4B;QACtB,4BAA4B;QACd,qCAAqC;QAC1C,+BAA+B;GAThH,uBAAuB,CAoPnC","sourcesContent":["import { injectable, inject } from 'inversify';\nimport {\n ResourceType,\n ResourceConfiguration_OperationPath,\n ResourcesConfig_OperationPathUtils,\n CoreResourceOperation,\n ErrorType,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport { z } from 'zod';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { toResponseSafeToolOutput } from '~wildo-backend-lib/base-classes/services/controllers/utils/operation-response-serializer.backend.utils';\nimport { normalizeCollectionQueryRequestData } from '~wildo-backend-lib/base-classes/services/controllers/controller-resource.backend.service';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport {\n McpToolAdapterBackendService,\n mcpReachableScopesForPrincipal,\n mcpPrincipalForAuthenticatedCaller,\n resolveEffectiveMcpOperation,\n isCollectionQueryMcpOperation,\n} from '~wildo-backend-lib/mcp/services/mcp-tool-adapter.backend.service';\nimport {\n McpToolDescriptor,\n McpToolAdapterBuildOptions,\n MCP_TOOL_NAME_SEPARATOR,\n} from '~wildo-backend-lib/mcp/models/mcp-tool.backend.schemas';\n\n/**\n * Per-call options for {@link McpServerBackendService.callTool}.\n */\nexport interface McpCallToolOptions {\n /**\n * Target resource id for resource-specific operations (READ / UPDATE / DELETE\n * and instance-scoped custom operations). Omit for collection operations\n * (CREATE / LIST / SEARCH / COUNT), which authorize on roles + parent scope only.\n */\n resourceId?: string;\n /**\n * The NAMED MCP server instance this call arrived on (R-2), or omitted for the default `/mcp`\n * server. MUST mirror the transport's route: the exposability gate below re-resolves the tool\n * against this instance, so a tool curated onto another server is NOT callable here even by name.\n */\n instanceRef?: string;\n}\n\n/**\n * Result of a successful `tools/call`. `result` is the operation output projected\n * through the operation's response DTO (backend-only/secret fields stripped, dates\n * JSON-normalized — see `callTool`), returned WITHOUT MCP `content` framing: the\n * `{ content: [...], isError }` envelope is applied by the transport\n * ({@link MCPControllerBackendService.handleToolsCall}). Keeping this service\n * transport-agnostic lets the same `callTool` back another transport unchanged.\n */\nexport interface McpCallToolResult {\n toolName: string;\n result: unknown;\n}\n\n/**\n * The MCP server core: lists resource-operation tools and executes them against\n * the SERVICE layer with per-call authorization. Transport-agnostic — the\n * JSON-RPC / Streamable-HTTP wire layer + OAuth 2.1 resource-server auth\n * (RFC 9728 metadata, RFC 8707 audience validation) live in\n * {@link MCPControllerBackendService}; this core carries no wire concern so the\n * same `listTools`/`callTool` can back another transport unchanged.\n *\n * # Boundaries\n *\n * - `listTools()` delegates to {@link McpToolAdapterBackendService}.\n * - `callTool()` resolves the target operation, RE-RUNS `authorizeInController`\n * against the caller's execution context (fail-closed), then invokes the\n * service pipeline DIRECTLY via {@link ServicesRegistryHandlerBackendService}\n * (never re-HTTP). The service pipeline enforces `requiredFeatures` /\n * `enabledCondition` downstream.\n * - KNOWN GAP (tracked — `.claude/plans/mcp-server-followups.md` Item 5): the\n * per-route HTTP rate-limit middleware is bypassed on this direct dispatch path,\n * so an operation's `rateLimit` policy is not yet enforced here. The planned fix\n * is a per-principal quota shared with the A2A dispatch surface.\n * - Server-initiated streaming (SSE / notifications / progress) is intentionally\n * absent: every exposed operation is synchronous request/response, for which a\n * single JSON response is Streamable-HTTP-compliant (Item 1, deferred).\n */\n/**\n * Operations whose RESULT is the paginated `{ data, pagination }` envelope, for OUTPUT.\n *\n * Deliberately NOT the same set as {@link isCollectionQueryOperation}: `COUNT` takes the collection\n * argument envelope but RETURNS A SCALAR, so asking the repository to wrap it would hand back a\n * shape its response DTO does not declare — trading one contract mismatch for another.\n *\n * Mirrors `needsPagination` in `ControllerResourceBackendService`, which is where this decision has\n * always been made for the HTTP surface. The two must agree: they select the shape the SAME response\n * DTO is asked to validate.\n */\nfunction isPaginationWrappedOperation(effectiveOperation: string): boolean {\n return effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n}\n\n@injectable()\nexport class McpServerBackendService {\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) protected readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) protected readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.McpToolAdapter) protected readonly toolAdapter: McpToolAdapterBackendService,\n @inject(SAAS_SERVICE_TYPES.AuthorizationsService) protected readonly authorizer: AuthorizationsBackendService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) protected readonly servicesHandler: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) protected readonly resourcesRegistry: ResourcesRegistryBackendService,\n ) {\n this.logDebug = this.logger.debugByType('McpServerBackendService');\n this.logger.setDebugTypeLogging('McpServerBackendService', false);\n }\n\n /**\n * Return the exposed tool descriptors for the caller's reachable scopes (`options.reachableScopes`).\n * PROGRESSIVE principal-awareness (C): a caller presenting a valid Bearer bound to this endpoint\n * passes its principal's scopes, so a user-delegated caller additionally sees its USER_SELF tools.\n * Omitting the scopes yields the MACHINE catalog; an ANONYMOUS caller passes an EMPTY set and the\n * transport challenges it rather than serving the empty page. Authorization is still enforced\n * fail-closed at `callTool` time — the catalog is a discovery aid, never an authorization grant.\n */\n public listTools(options: McpToolAdapterBuildOptions = {}): McpToolDescriptor[] {\n return this.toolAdapter.buildToolDescriptors(options);\n }\n\n /**\n * Execute one tool: resolve → authorize (fail-closed) → dispatch to the service layer.\n *\n * @param toolName - `<resourceIdentifier>__<operationIdentifier>`.\n * @param args - the tool arguments (the operation request body).\n * @param executionContext - the caller's context (a machine principal for api-key\n * / client-credentials callers; a user-delegated context once OIDC lands).\n * @param options - per-call options ({@link McpCallToolOptions}).\n * @throws AUTHORIZATION when the principal is not permitted to run the operation.\n * @throws NOT_FOUND when the tool name does not map to an exposable operation.\n */\n public async callTool(\n toolName: string,\n args: unknown,\n executionContext: ExecutionContext<any>,\n options: McpCallToolOptions = {},\n ): Promise<McpCallToolResult> {\n const { resourceType, operationIdentifier } = this.parseToolName(toolName);\n\n // Single source of exposability truth: the adapter decides whether this resource+operation is a\n // valid, default URL-bearing tool REACHABLE BY THIS CALLER. Progressive principal-awareness — a\n // user-delegated principal (USER_REQUEST, carries a `userId`) reaches USER_SELF operations; a\n // machine principal reaches ORG/APP only. Rejecting here (before authorization) prevents a crafted\n // name from reaching a scope the caller cannot use (e.g. a machine hitting USER_SELF → always 403).\n // Derived from the SAME source `tools/list` filters on, so advertise ≡ callable per principal.\n // R-2: also gated on the server INSTANCE the call arrived on, so `(principal, instance)` together\n // decide callability — the same pair `tools/list` filters on.\n // Post-authentication by construction: `callTool` is only reached with a validated token.\n const reachableScopes = mcpReachableScopesForPrincipal(mcpPrincipalForAuthenticatedCaller(executionContext.isUserExecution()));\n const operation = this.toolAdapter.resolveExposableOperation(resourceType, operationIdentifier, reachableScopes, options.instanceRef);\n if (!operation) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_NOT_FOUND,\n context: { message: `MCP tool \"${toolName}\" does not map to an exposable resource operation`, toolName },\n });\n }\n\n // Bind the resolved operation onto the caller's context (preserves principal\n // identity + roles) so the authorizer and the service pipeline both see the\n // operation actually being executed.\n const boundExecutionContext = executionContext.withOperation(operation);\n\n const idOrIds = options.resourceId;\n\n // Fail-closed per-operation authorization: reads `operation.roles` +\n // `executionContext.initiatorRoles` / scope. Throws AUTHORIZATION on denial.\n await this.authorizer.authorizeInController(idOrIds, boundExecutionContext);\n\n // Dispatch to the service layer directly (NOT re-HTTP). The service pipeline\n // enforces enabledCondition / requiredFeatures downstream.\n //\n // Dispatch the EXACT operation we resolved + authorized + advertised (the URL-bearing default\n // from `resolveExposableOperation`), via `extractOperationPath`. We deliberately do NOT\n // re-resolve through `getServiceOperationPathDefault`: for a resource that declares BOTH a\n // URL-bearing default AND an INTERNAL_CALL default for the same operation identifier, that\n // helper PREFERS the INTERNAL_CALL variant — which would execute a different variant (different\n // `requestDto` validating `args`, different side effects / custom-impl) than the one\n // `authorizeInController` just checked and than the `inputSchema` advertised to the agent.\n // Using the resolved operation's own path mirrors how the HTTP controllers dispatch the URL\n // operation and keeps authorize ≡ advertise ≡ execute on one variant.\n const operationPath: ResourceConfiguration_OperationPath<any, any> = ResourcesConfig_OperationPathUtils.extractOperationPath(operation);\n\n const dispatchArgs = this.toDispatchArguments(operation, args, boundExecutionContext);\n\n this.logDebug('Executing MCP tool call', { toolName, resourceType, operationIdentifier, hasResourceId: idOrIds !== undefined });\n\n /**\n * Request the pagination WRAPPER for collection operations, exactly as the HTTP controller does.\n *\n * The repository's `list` returns a BARE ARRAY unless the caller asks for the envelope\n * (`options.paginated`), and the decision to ask is made in `ControllerResourceBackendService`:\n * `needsPagination = LIST || SEARCH` → `{ paginated: true }`. That is a CONTROLLER-tier\n * decision, and this path does not go through the controller — so `tools/call` dispatched a\n * paginated LIST without ever requesting pagination, the repository returned a bare array, and\n * the operation's RESPONSE DTO (which for a paginated list declares `{ data, pagination }`)\n * rejected it. Every paginated `*__list` tool answered `-32603` with\n * `expected array, received undefined` at `data`.\n *\n * Two things hid it. `*__search` was unaffected — the search path builds its own envelope — and\n * the one LIST that worked (`todosRelationships__list`) is UNPAGINATED, so a bare array is\n * exactly what its response DTO declares. So the failure looked resource-specific when it was\n * operation-wide.\n *\n * This is the OUTPUT half of the defect family the input normalisation already fixed on\n * 2026-08-01: \"the advertised contract is not the enforced contract\". `tools/list` advertises a\n * paginated collection envelope because the response DTO says so; the dispatch has to request\n * the shape that DTO describes, or the two tiers disagree about what the operation returns.\n */\n const needsPaginationWrapper = isPaginationWrappedOperation(this.resolveEffectiveOperation(operation));\n\n const result = await this.servicesHandler.doByOperationPath(\n operationPath,\n boundExecutionContext,\n idOrIds,\n dispatchArgs,\n needsPaginationWrapper ? { paginated: true } : undefined,\n );\n\n // Project the raw service result through the operation's RESPONSE DTO — the SAME\n // output-serialization boundary the HTTP controller (`sendResponse`) and the A2A tool\n // path use — BEFORE it crosses to the external MCP agent. `doByOperationPath` returns the\n // internal DTO, which still carries `.isBackendOnly()` / write-only-secret fields and raw\n // `Date`/`ObjectId` instances; returning it verbatim would leak backend-only/secret material\n // into the agent's model context. `toResponseSafeToolOutput` strips + JSON-normalizes so the\n // MCP tool result is byte-identical to what a REST client would receive.\n const safeResult = await toResponseSafeToolOutput(operation, result);\n\n return { toolName, result: safeResult };\n }\n\n /**\n * Split `<resourceIdentifier>__<operationIdentifier>` on the FIRST double\n * underscore. Resource identifiers use single underscores only, so the first\n * `__` unambiguously delimits the resource from the operation.\n */\n /**\n * Bring the agent's raw `arguments` onto the SAME input contract the HTTP controller produces\n * before dispatch. Added 2026-08-01; until then `tools/call` passed `args` through untouched.\n *\n * Two distinct defects that fixed, both of the \"advertised contract is not the enforced\n * contract\" family:\n *\n * 1. **Collection tools silently ignored the agent's filter.** `tools/list` advertises an\n * `inputSchema` derived from the operation's `requestDto`, which for LIST / SEARCH is keyed\n * `{ filters, pagination, sorting }`. The service reads `{ filter, page, limit, sort,\n * searchQuery }`. The HTTP controller bridges the two; MCP did not, so an agent that\n * followed the schema it was given received the UNFILTERED collection while believing it was\n * filtered — the worst shape for an LLM caller, which then reasons over the wrong rows.\n * {@link normalizeCollectionQueryRequestData} is now the single authority both surfaces use,\n * and it accepts either vocabulary. It also carries the filter ALLOW-LIST, which matters\n * here: the repository's `sanitizeRequestFilter` returns the filter UNCHANGED when an\n * operation declares no `filterFields`, so for a surface with no strict DTO parse in front\n * of it this is the layer that stops an arbitrary key reaching the database.\n * 2. **The published request contract was not enforced.** Every other operation now gets the\n * controller's strict `requestDto.parse`, so a key the tool never advertised is dropped at\n * the boundary that advertised it, rather than three layers away. Writes were already safe —\n * the repository re-parses against the same DTO\n * (`repositories-registry-handler.backend.service.ts`) — but relying on a distant guard for\n * an external protocol surface is defence by coincidence: nothing tells a future refactor of\n * that method that MCP depends on it.\n *\n * Parse failures are deliberately NOT swallowed. An agent that sends a malformed argument should\n * be told, so the model can correct itself; silently dropping it teaches the model nothing and\n * leaves it reasoning about an operation it did not actually perform.\n */\n private toDispatchArguments(\n operation: {\n requestDto?: z.ZodTypeAny;\n resourceOperationLike?: unknown;\n operationIdentifier: unknown;\n resourceIdentifier: unknown;\n },\n args: unknown,\n executionContext: ExecutionContext<any>,\n ): unknown {\n const effectiveOperation = this.resolveEffectiveOperation(operation);\n const isCollectionOperation = isCollectionQueryMcpOperation(effectiveOperation);\n\n if (isCollectionOperation) {\n const rawArguments = (args && typeof args === 'object' && !Array.isArray(args))\n ? args as Record<string, unknown>\n : {};\n const resourceOperations = this.resourcesRegistry\n .getResourceConfiguration(operation.resourceIdentifier as ResourceType)\n .operations;\n return normalizeCollectionQueryRequestData(\n rawArguments,\n operation as never,\n effectiveOperation,\n resourceOperations as never,\n );\n }\n\n if (!operation.requestDto) return args;\n\n try {\n return operation.requestDto.parse(args);\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: {\n message: 'MCP tool arguments do not satisfy the operation request contract advertised by tools/list',\n operationIdentifier: operation.operationIdentifier,\n zodIssues: error.issues,\n },\n });\n }\n throw error;\n }\n }\n\n /**\n * The operation this tool really performs — a custom operation declares what it behaves LIKE via\n * `resourceOperationLike`, and both the input normalisation and the output envelope must key on\n * the same answer. Derived once here because they previously derived it separately, and a\n * custom LIST-like operation that only one of them recognised would be normalised as a collection\n * on the way in and dispatched without pagination on the way out.\n */\n private resolveEffectiveOperation(operation: { resourceOperationLike?: unknown; operationIdentifier: unknown }): string {\n return resolveEffectiveMcpOperation(operation);\n }\n\n private parseToolName(toolName: string): { resourceType: ResourceType; operationIdentifier: string } {\n const separatorIndex = toolName.indexOf(MCP_TOOL_NAME_SEPARATOR);\n if (separatorIndex <= 0 || separatorIndex + MCP_TOOL_NAME_SEPARATOR.length >= toolName.length) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_NOT_FOUND,\n context: { message: `Malformed MCP tool name \"${toolName}\" — expected \"<resource>${MCP_TOOL_NAME_SEPARATOR}<operation>\"`, toolName },\n });\n }\n return {\n resourceType: toolName.slice(0, separatorIndex) as ResourceType,\n operationIdentifier: toolName.slice(separatorIndex + MCP_TOOL_NAME_SEPARATOR.length),\n };\n }\n}\n"]}
1
+ {"version":3,"file":"mcp-server.backend.service.js","sourceRoot":"","sources":["../../../../../src/mcp/services/mcp-server.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAEL,4BAA4B,EAE5B,kCAAkC,EAClC,qBAAqB,EACrB,SAAS,EACT,2BAA2B,EAC3B,cAAc,EACd,kBAAkB,EAClB,gCAAgC,EAChC,yCAAyC,GAI1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,qEAAqE,CAAC;AACpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAEtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,4BAA4B,EAAE,MAAM,oFAAoF,CAAC;AAClI,OAAO,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AACpJ,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,iBAAiB;gBACrE,OAAO,EAAE,EAAE,OAAO,EAAE,4BAA4B,QAAQ,2BAA2B,uBAAuB,cAAc,EAAE,QAAQ,EAAE;aACrI,CAAC,CAAC;QACL,CAAC;QACD,OAAO;YACL,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAiB;YAC/D,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,GAAG,uBAAuB,CAAC,MAAM,CAAC;SACrF,CAAC;IACJ,CAAC;CACF,CAAA;AA3dY,uBAAuB;IADnC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IACzC,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAA;IACjD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;+CAP8B,0BAA0B;QAChC,4BAA4B;QACtB,4BAA4B;QACd,qCAAqC;QAC1C,+BAA+B;QAC3B,6BAA6B;QACzC,uBAAuB;QAChB,uBAAuB;GAZvG,uBAAuB,CA2dnC","sourcesContent":["import { injectable, inject } from 'inversify';\nimport {\n ResourceType,\n ResourceOperationVariantType,\n ResourceConfiguration_OperationPath,\n ResourcesConfig_OperationPathUtils,\n CoreResourceOperation,\n ErrorType,\n ErrorCustomMessageReference,\n BackendApiType,\n MAIN_API_BASE_PATH,\n FileUploadGrantMintRequestSchema,\n ResourcesConfigOperationsUrlsBuilderUtils,\n type ResourcePrimaryScope,\n type ResourceConfiguration_Operation,\n type FileUploadGrantOperation,\n} from '@wildo-ai/saas-models';\nimport { z } from 'zod';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { FileUploadGrantBackendService } from '~wildo-backend-lib/files/services/file-upload-grant.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { MCP_UPLOAD_GRANT_TOOL_MARKER } from '~wildo-backend-lib/mcp/models/mcp-tool.backend.schemas';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { toResponseSafeToolOutput } from '~wildo-backend-lib/base-classes/services/controllers/utils/operation-response-serializer.backend.utils';\nimport { normalizeCollectionQueryRequestData } from '~wildo-backend-lib/base-classes/services/controllers/controller-resource.backend.service';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport { RateLimitBackendService } from '~wildo-backend-lib/errors/services/rate-limit.backend.service';\nimport { resolveDeclaredPolicySubjectKey } from '~wildo-backend-lib/security/authentications/services/utils/external-turn-rate-limit.backend.utils';\nimport {\n McpToolAdapterBackendService,\n mcpReachableScopesForPrincipal,\n mcpPrincipalForAuthenticatedCaller,\n resolveEffectiveMcpOperation,\n isCollectionQueryMcpOperation,\n} from '~wildo-backend-lib/mcp/services/mcp-tool-adapter.backend.service';\nimport {\n McpToolDescriptor,\n McpToolAdapterBuildOptions,\n MCP_TOOL_NAME_SEPARATOR,\n} from '~wildo-backend-lib/mcp/models/mcp-tool.backend.schemas';\n\n/**\n * Per-call options for {@link McpServerBackendService.callTool}.\n */\nexport interface McpCallToolOptions {\n /**\n * Target resource id for resource-specific operations (READ / UPDATE / DELETE\n * and instance-scoped custom operations). Omit for collection operations\n * (CREATE / LIST / SEARCH / COUNT), which authorize on roles + parent scope only.\n */\n resourceId?: string;\n /**\n * The NAMED MCP server instance this call arrived on (R-2), or omitted for the default `/mcp`\n * server. MUST mirror the transport's route: the exposability gate below re-resolves the tool\n * against this instance, so a tool curated onto another server is NOT callable here even by name.\n */\n instanceRef?: string;\n}\n\n/**\n * Result of a successful `tools/call`. `result` is the operation output projected\n * through the operation's response DTO (backend-only/secret fields stripped, dates\n * JSON-normalized — see `callTool`), returned WITHOUT MCP `content` framing: the\n * `{ content: [...], isError }` envelope is applied by the transport\n * ({@link MCPControllerBackendService.handleToolsCall}). Keeping this service\n * transport-agnostic lets the same `callTool` back another transport unchanged.\n */\nexport interface McpCallToolResult {\n toolName: string;\n result: unknown;\n}\n\n/**\n * The MCP server core: lists resource-operation tools and executes them against\n * the SERVICE layer with per-call authorization. Transport-agnostic — the\n * JSON-RPC / Streamable-HTTP wire layer + OAuth 2.1 resource-server auth\n * (RFC 9728 metadata, RFC 8707 audience validation) live in\n * {@link MCPControllerBackendService}; this core carries no wire concern so the\n * same `listTools`/`callTool` can back another transport unchanged.\n *\n * # Boundaries\n *\n * - `listTools()` delegates to {@link McpToolAdapterBackendService}.\n * - `callTool()` resolves the target operation, RE-RUNS `authorizeInController`\n * against the caller's execution context (fail-closed), enforces the operation's\n * own declared `rateLimit` policy (see `assertOperationRateLimitPolicy`), then\n * invokes the service pipeline DIRECTLY via\n * {@link ServicesRegistryHandlerBackendService} (never re-HTTP). The service\n * pipeline enforces `requiredFeatures` / `enabledCondition` downstream.\n * - RATE LIMITING on this plane is now TWO guards, and they answer different questions:\n * the transport applies the framework's blanket per-principal `tools/call` cap\n * (`MCP_EXTERNAL_CALL_RATE_MAX`, an abuse throttle nobody declared, fails OPEN), and\n * THIS service applies the operation's own AUTHORED `rateLimit` (a statement the\n * application made about that endpoint, enforced identically to the HTTP seam). The\n * second one lives here rather than in the transport for the same reason\n * `authorizeInController` does: it is a property of the OPERATION, so a second\n * transport backed by this core must inherit it rather than re-implement it.\n * (Historical note: the block that stood here recorded the per-operation policy as a\n * KNOWN GAP whose \"planned fix is a per-principal quota shared with the A2A dispatch\n * surface\". That per-principal quota SHIPPED — `assertExternalTurnWithinRate`, used by\n * both `MCPControllerBackendService` and `A2ABackendService` — and the comment was\n * never updated, so it read as wholly open when only its per-operation half was.)\n * - Server-initiated streaming (SSE / notifications / progress) is intentionally\n * absent: every exposed operation is synchronous request/response, for which a\n * single JSON response is Streamable-HTTP-compliant (Item 1, deferred).\n */\n/**\n * Operations whose RESULT is the paginated `{ data, pagination }` envelope, for OUTPUT.\n *\n * Deliberately NOT the same set as {@link isCollectionQueryOperation}: `COUNT` takes the collection\n * argument envelope but RETURNS A SCALAR, so asking the repository to wrap it would hand back a\n * shape its response DTO does not declare — trading one contract mismatch for another.\n *\n * Mirrors `needsPagination` in `ControllerResourceBackendService`, which is where this decision has\n * always been made for the HTTP surface. The two must agree: they select the shape the SAME response\n * DTO is asked to validate.\n */\nfunction isPaginationWrappedOperation(effectiveOperation: string): boolean {\n return effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n}\n\n@injectable()\nexport class McpServerBackendService {\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) protected readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) protected readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.McpToolAdapter) protected readonly toolAdapter: McpToolAdapterBackendService,\n @inject(SAAS_SERVICE_TYPES.AuthorizationsService) protected readonly authorizer: AuthorizationsBackendService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) protected readonly servicesHandler: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) protected readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.FileUploadGrantService) protected readonly fileUploadGrantService: FileUploadGrantBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) protected readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.RateLimitBackendService) protected readonly rateLimitService: RateLimitBackendService,\n ) {\n this.logDebug = this.logger.debugByType('McpServerBackendService');\n this.logger.setDebugTypeLogging('McpServerBackendService', false);\n }\n\n /**\n * Return the exposed tool descriptors for the caller's reachable scopes (`options.reachableScopes`).\n * PROGRESSIVE principal-awareness (C): a caller presenting a valid Bearer bound to this endpoint\n * passes its principal's scopes, so a user-delegated caller additionally sees its USER_SELF tools.\n * Omitting the scopes yields the MACHINE catalog; an ANONYMOUS caller passes an EMPTY set and the\n * transport challenges it rather than serving the empty page. Authorization is still enforced\n * fail-closed at `callTool` time — the catalog is a discovery aid, never an authorization grant.\n */\n public listTools(options: McpToolAdapterBuildOptions = {}): McpToolDescriptor[] {\n return this.toolAdapter.buildToolDescriptors(options);\n }\n\n /**\n * Execute one tool: resolve → authorize (fail-closed) → dispatch to the service layer.\n *\n * @param toolName - `<resourceIdentifier>__<operationIdentifier>`.\n * @param args - the tool arguments (the operation request body).\n * @param executionContext - the caller's context (a machine principal for api-key\n * / client-credentials callers; a user-delegated context once OIDC lands).\n * @param options - per-call options ({@link McpCallToolOptions}).\n * @throws AUTHORIZATION when the principal is not permitted to run the operation.\n * @throws NOT_FOUND when the tool name does not map to an exposable operation.\n */\n public async callTool(\n toolName: string,\n args: unknown,\n executionContext: ExecutionContext<any>,\n options: McpCallToolOptions = {},\n ): Promise<McpCallToolResult> {\n const { resourceType, operationIdentifier } = this.parseToolName(toolName);\n\n // Single source of exposability truth: the adapter decides whether this resource+operation is a\n // valid, default URL-bearing tool REACHABLE BY THIS CALLER. Progressive principal-awareness — a\n // user-delegated principal (USER_REQUEST, carries a `userId`) reaches USER_SELF operations; a\n // machine principal reaches ORG/APP only. Rejecting here (before authorization) prevents a crafted\n // name from reaching a scope the caller cannot use (e.g. a machine hitting USER_SELF → always 403).\n // Derived from the SAME source `tools/list` filters on, so advertise ≡ callable per principal.\n // R-2: also gated on the server INSTANCE the call arrived on, so `(principal, instance)` together\n // decide callability — the same pair `tools/list` filters on.\n // Post-authentication by construction: `callTool` is only reached with a validated token.\n const reachableScopes = mcpReachableScopesForPrincipal(mcpPrincipalForAuthenticatedCaller(executionContext.isUserExecution()));\n\n // Issue #312, D11: a DERIVED upload-grant tool mints a grant instead of dispatching an operation.\n // It resolves its PARENT through the same adapter gate (exposure, instance, scope inherited), is\n // authorized exactly as the parent would be, then calls the ONE mint function the REST door calls.\n if (operationIdentifier.includes(MCP_UPLOAD_GRANT_TOOL_MARKER)) {\n return this.callUploadGrantTool(toolName, resourceType, operationIdentifier, args, executionContext, options, reachableScopes);\n }\n\n const operation = this.toolAdapter.resolveExposableOperation(resourceType, operationIdentifier, reachableScopes, options.instanceRef);\n if (!operation) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_NOT_FOUND,\n context: { message: `MCP tool \"${toolName}\" does not map to an exposable resource operation`, toolName },\n });\n }\n\n // Bind the resolved operation onto the caller's context (preserves principal\n // identity + roles) so the authorizer and the service pipeline both see the\n // operation actually being executed.\n const boundExecutionContext = executionContext.withOperation(operation);\n\n const idOrIds = options.resourceId;\n\n // Fail-closed per-operation authorization: reads `operation.roles` +\n // `executionContext.initiatorRoles` / scope. Throws AUTHORIZATION on denial.\n await this.authorizer.authorizeInController(idOrIds, boundExecutionContext);\n\n // The operation's OWN declared request budget. AFTER authorization on purpose: a caller who may\n // not run the operation at all must be refused with AUTHORIZATION rather than told how much of a\n // budget they have — and must not consume a slot of a budget that is not theirs, which would let\n // an unauthorized caller exhaust an authorized one's quota. (The HTTP seam orders these the other\n // way round because it has no choice: `checkPolicyForVariant` runs pre-flight, before the\n // execution context that authorization needs even exists. Here the identity is already resolved,\n // so the safer order is available and is taken.)\n await this.assertOperationRateLimitPolicy(operation, boundExecutionContext);\n\n // Dispatch to the service layer directly (NOT re-HTTP). The service pipeline\n // enforces enabledCondition / requiredFeatures downstream.\n //\n // Dispatch the EXACT operation we resolved + authorized + advertised (the URL-bearing default\n // from `resolveExposableOperation`), via `extractOperationPath`. We deliberately do NOT\n // re-resolve through `getServiceOperationPathDefault`: for a resource that declares BOTH a\n // URL-bearing default AND an INTERNAL_CALL default for the same operation identifier, that\n // helper PREFERS the INTERNAL_CALL variant — which would execute a different variant (different\n // `requestDto` validating `args`, different side effects / custom-impl) than the one\n // `authorizeInController` just checked and than the `inputSchema` advertised to the agent.\n // Using the resolved operation's own path mirrors how the HTTP controllers dispatch the URL\n // operation and keeps authorize ≡ advertise ≡ execute on one variant.\n const operationPath: ResourceConfiguration_OperationPath<any, any> = ResourcesConfig_OperationPathUtils.extractOperationPath(operation);\n\n const dispatchArgs = this.toDispatchArguments(operation, args, boundExecutionContext);\n\n this.logDebug('Executing MCP tool call', { toolName, resourceType, operationIdentifier, hasResourceId: idOrIds !== undefined });\n\n /**\n * Request the pagination WRAPPER for collection operations, exactly as the HTTP controller does.\n *\n * The repository's `list` returns a BARE ARRAY unless the caller asks for the envelope\n * (`options.paginated`), and the decision to ask is made in `ControllerResourceBackendService`:\n * `needsPagination = LIST || SEARCH` → `{ paginated: true }`. That is a CONTROLLER-tier\n * decision, and this path does not go through the controller — so `tools/call` dispatched a\n * paginated LIST without ever requesting pagination, the repository returned a bare array, and\n * the operation's RESPONSE DTO (which for a paginated list declares `{ data, pagination }`)\n * rejected it. Every paginated `*__list` tool answered `-32603` with\n * `expected array, received undefined` at `data`.\n *\n * Two things hid it. `*__search` was unaffected — the search path builds its own envelope — and\n * the one LIST that worked (`todosRelationships__list`) is UNPAGINATED, so a bare array is\n * exactly what its response DTO declares. So the failure looked resource-specific when it was\n * operation-wide.\n *\n * This is the OUTPUT half of the defect family the input normalisation already fixed on\n * 2026-08-01: \"the advertised contract is not the enforced contract\". `tools/list` advertises a\n * paginated collection envelope because the response DTO says so; the dispatch has to request\n * the shape that DTO describes, or the two tiers disagree about what the operation returns.\n */\n const needsPaginationWrapper = isPaginationWrappedOperation(this.resolveEffectiveOperation(operation));\n\n const result = await this.servicesHandler.doByOperationPath(\n operationPath,\n boundExecutionContext,\n idOrIds,\n dispatchArgs,\n needsPaginationWrapper ? { paginated: true } : undefined,\n );\n\n // Project the raw service result through the operation's RESPONSE DTO — the SAME\n // output-serialization boundary the HTTP controller (`sendResponse`) and the A2A tool\n // path use — BEFORE it crosses to the external MCP agent. `doByOperationPath` returns the\n // internal DTO, which still carries `.isBackendOnly()` / write-only-secret fields and raw\n // `Date`/`ObjectId` instances; returning it verbatim would leak backend-only/secret material\n // into the agent's model context. `toResponseSafeToolOutput` strips + JSON-normalizes so the\n // MCP tool result is byte-identical to what a REST client would receive.\n const safeResult = await toResponseSafeToolOutput(operation, result);\n\n return { toolName, result: safeResult };\n }\n\n /**\n * Enforce the resolved operation's OWN `rateLimit?` policy on the tool plane.\n *\n * ## What was broken\n *\n * `rateLimit?` is authored on an `API_CALL` / `API_CALL_WITH_CALLBACK` variant and was enforced\n * by exactly one consumer — `RateLimitBackendService.checkPolicyForVariant`, called from the\n * resource controller's HTTP pre-flight. `callTool` dispatches the SAME operation through the\n * SAME service pipeline while bypassing Express entirely, so the identical operation was\n * throttled over REST and unthrottled as a tool. An application that declared a budget on an\n * endpoint got one; an agent asked for the same endpoint by its tool name and got none.\n *\n * ## Subject: the CREDENTIAL, not the IP and not the tenant\n *\n * See {@link resolveDeclaredPolicySubjectKey} for the full argument. In short: the HTTP seam\n * keys on the source IP because at its pre-flight moment no identity exists yet, so `5/min` has\n * always meant \"5/min per CLIENT\". On this plane the client is the credential the agent\n * presented — a server-verified field of the execution context, never anything the model\n * supplied. Keying on the tenant instead would make the same authored number several times\n * stricter here than over REST for any tenant running more than one agent.\n *\n * ## Scope: a SEPARATE bucket from the REST route, deliberately\n *\n * The key is namespaced `mcp:resource:<resource>:<operation>` rather than sharing the HTTP\n * seam's `resource:<resource>:<operation>`. Sharing would be incoherent — the two seams count\n * different SUBJECTS (an IP and a credential), so one bucket would mix two identity spaces and\n * let a browser's traffic spend an agent's budget. Per-plane-per-client is the faithful\n * extension of a policy that was already per-client rather than a global cap.\n *\n * ## Not applied to the derived upload-grant tool\n *\n * `callUploadGrantTool` MINTS a grant; it does not dispatch the parent operation. Charging the\n * parent's budget there would spend two slots for one upload (mint + the upload itself, which\n * traverses the real HTTP route and meets `checkPolicyForVariant`) while a REST client spends\n * one — the declared number would mean something different depending on how the caller got the\n * URL. It is left uncharged for that reason, not by omission.\n *\n * ## Postures\n *\n * - **No declared policy, or a non-HTTP variant** → no-op, zero Redis traffic. Mirrors\n * `checkPolicyForVariant`'s two early returns exactly; the variant guard is defensive, since\n * `resolveExposableOperation` only ever yields a URL-bearing default.\n * - **Unkeyable subject** → not enforced, logged. Structurally unreachable: `callTool` is only\n * reached post-authentication, and `ExecutionContext`'s own constructor rejects an\n * authenticated principal carrying no identity field. It is not \"unbounded\" either — the\n * transport's blanket per-principal cap is the backstop, and it declines on exactly the same\n * input. Refusing a well-formed call here instead would invent an outage out of a branch that\n * cannot happen.\n * - **Limiter outage** → propagates, as it does over HTTP for the same declared policy. An\n * authored budget must not quietly become \"unlimited\" on one plane while it is a 500 on the\n * other.\n */\n private async assertOperationRateLimitPolicy(\n operation: ResourceConfiguration_Operation<any, any, any>,\n boundExecutionContext: ExecutionContext<any>,\n ): Promise<void> {\n if (\n operation.variantType !== ResourceOperationVariantType.API_CALL\n && operation.variantType !== ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n ) {\n return;\n }\n const policy = operation.rateLimit;\n if (!policy) {\n return;\n }\n\n const subjectKey = resolveDeclaredPolicySubjectKey(boundExecutionContext.initiatorIds);\n if (!subjectKey) {\n this.logger.warn('[mcp] declared rateLimit not enforced — the authenticated caller carries no keyable identity', {\n resourceIdentifier: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n });\n return;\n }\n\n await this.rateLimitService.checkPolicyForSubject(\n policy,\n `mcp:resource:${String(operation.resourceIdentifier)}:${String(operation.operationIdentifier)}`,\n subjectKey,\n boundExecutionContext.organizationId,\n );\n }\n\n /**\n * Execute a derived upload-grant tool (issue #312, D11).\n *\n * Authorization is the PARENT's: the caller's context is bound to the parent operation and\n * `authorizeInController` runs on it with the same `resourceId` the parent would take — so minting\n * requires exactly the authority uploading would, which is the invariant the REST door gets from\n * sharing the upload middleware. The upload URL is built from the parent's own route pattern with\n * the parameters the context and the call supply, and the API origin comes from CONFIGURATION,\n * never from a request header.\n */\n private async callUploadGrantTool(\n toolName: string,\n resourceType: ResourceType,\n operationPart: string,\n args: unknown,\n executionContext: ExecutionContext<any>,\n options: McpCallToolOptions,\n reachableScopes: ReadonlySet<ResourcePrimaryScope>,\n ): Promise<McpCallToolResult> {\n const derived = this.toolAdapter.resolveUploadGrantTool(resourceType, operationPart, reachableScopes, options.instanceRef);\n if (!derived) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_NOT_FOUND,\n context: { message: `MCP tool \"${toolName}\" does not map to an exposable upload-grant tool`, toolName },\n });\n }\n const { parentOperation, fieldName, operationKind } = derived;\n const boundExecutionContext = executionContext.withOperation(parentOperation);\n const resourceId = options.resourceId;\n if (operationKind === CoreResourceOperation.UPDATE && !resourceId) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, boundExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { message: 'An upload grant for an UPDATE requires the record id', toolName },\n });\n }\n\n // Same gate, same order, same arguments as the parent operation.\n await this.authorizer.authorizeInController(resourceId, boundExecutionContext);\n\n const parsedArgs = FileUploadGrantMintRequestSchema.safeParse(this.withoutInstanceId(args, resourceType));\n if (!parsedArgs.success) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, boundExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { toolName, errors: parsedArgs.error.issues.map((issue) => ({ path: issue.path.join('.'), message: issue.message })) },\n });\n }\n\n const apiPublicUrl = this.appConfigService.config.runtime?.endPoints?.[BackendApiType.MAIN_BACKEND_API]?.publicUrl;\n if (!apiPublicUrl) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, boundExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: `runtime.endPoints.${BackendApiType.MAIN_BACKEND_API}.publicUrl is required to mint a file upload grant` },\n });\n }\n const origin = apiPublicUrl.replace(/\\/+$/, '');\n // Scope ids come from the CALLER's context: binding an operation onto a context never changes who is calling.\n const uploadPath = this.resolveUploadRoutePath(parentOperation, resourceType, fieldName, operationKind, resourceId, executionContext);\n const grant = await this.fileUploadGrantService.mint({\n executionContext: boundExecutionContext,\n target: { resourceType, fieldName, operation: operationKind, resourceId },\n expiresInMinutes: parsedArgs.data.expiresInMinutes,\n declared: { name: parsedArgs.data.name, mimeType: parsedArgs.data.mimeType, size: parsedArgs.data.size },\n uploadUrl: `${origin}${uploadPath}`,\n apiBaseUrl: `${origin}${MAIN_API_BASE_PATH}`,\n });\n this.logDebug('Executing MCP upload-grant tool call', { toolName, resourceType, fieldName, operationKind, hasResourceId: resourceId !== undefined });\n return { toolName, result: grant };\n }\n\n /** The tool arguments minus the resource's own id, which the transport already split out into `options.resourceId`. */\n private withoutInstanceId(args: unknown, resourceType: ResourceType): unknown {\n if (!args || typeof args !== 'object') return args ?? {};\n const selfField = this.resourcesRegistry.getAllResourceFieldIdentifiers()[resourceType];\n if (!selfField || !(selfField in (args as Record<string, unknown>))) return args;\n const { [selfField]: _dropped, ...rest } = args as Record<string, unknown>;\n return rest;\n }\n\n /**\n * The concrete upload-route PATH (mount prefix included) for one file field of the parent\n * operation, from the parent's own route patterns — the same builder the resource controller used\n * to REGISTER the route, so the grant's `uploadUrl` is a route that exists.\n *\n * A parent can carry several patterns (one per parent-resource combination); the one chosen is the\n * first whose every `{param}` the call can supply: the resource's own id from `resourceId`, and scope\n * / parent ids from the context's `initiatorIds`. Patterns are tried shortest first, so the\n * primary-scope form wins over a nested FK form the MCP call cannot address anyway.\n */\n private resolveUploadRoutePath(\n parentOperation: ResourceConfiguration_Operation<any, any, any>,\n resourceType: ResourceType,\n fieldName: string,\n operationKind: FileUploadGrantOperation,\n resourceId: string | undefined,\n executionContext: ExecutionContext<any>,\n ): string {\n const selfField = this.resourcesRegistry.getAllResourceFieldIdentifiers()[resourceType];\n const initiatorInfos = [...(('initiatorInfos' in parentOperation ? parentOperation.initiatorInfos : undefined) ?? [])]\n .sort((a, b) => (a.parameters?.length ?? 0) - (b.parameters?.length ?? 0));\n const supplied: Record<string, string | undefined> = {\n ...(executionContext.initiatorIds as Record<string, string | undefined> | undefined ?? {}),\n ...(selfField && resourceId ? { [selfField]: resourceId } : {}),\n };\n for (const info of initiatorInfos) {\n const route = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: info.url,\n operationParameters: info.parameters ?? [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: selfField ?? 'id',\n fieldName,\n requiresTargetResourceId: operationKind === CoreResourceOperation.UPDATE,\n isFrontend: false,\n });\n let unresolved = false;\n const path = route.url.replace(/\\{([^}]+)\\}/g, (_m, param: string) => {\n const value = supplied[param];\n if (typeof value !== 'string' || value.length === 0) { unresolved = true; return `{${param}}`; }\n return encodeURIComponent(value);\n });\n if (!unresolved) return path;\n }\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: 'No upload route of this operation can be addressed from the MCP call', resourceType, fieldName, operationKind, patterns: initiatorInfos.map((i) => i.url) },\n });\n }\n\n /**\n * Split `<resourceIdentifier>__<operationIdentifier>` on the FIRST double\n * underscore. Resource identifiers use single underscores only, so the first\n * `__` unambiguously delimits the resource from the operation.\n */\n /**\n * Bring the agent's raw `arguments` onto the SAME input contract the HTTP controller produces\n * before dispatch. Added 2026-08-01; until then `tools/call` passed `args` through untouched.\n *\n * Two distinct defects that fixed, both of the \"advertised contract is not the enforced\n * contract\" family:\n *\n * 1. **Collection tools silently ignored the agent's filter.** `tools/list` advertises an\n * `inputSchema` derived from the operation's `requestDto`, which for LIST / SEARCH is keyed\n * `{ filters, pagination, sorting }`. The service reads `{ filter, page, limit, sort,\n * searchQuery }`. The HTTP controller bridges the two; MCP did not, so an agent that\n * followed the schema it was given received the UNFILTERED collection while believing it was\n * filtered — the worst shape for an LLM caller, which then reasons over the wrong rows.\n * {@link normalizeCollectionQueryRequestData} is now the single authority both surfaces use,\n * and it accepts either vocabulary. It also carries the filter ALLOW-LIST, which matters\n * here: the repository's `sanitizeRequestFilter` returns the filter UNCHANGED when an\n * operation declares no `filterFields`, so for a surface with no strict DTO parse in front\n * of it this is the layer that stops an arbitrary key reaching the database.\n * 2. **The published request contract was not enforced.** Every other operation now gets the\n * controller's strict `requestDto.parse`, so a key the tool never advertised is dropped at\n * the boundary that advertised it, rather than three layers away. Writes were already safe —\n * the repository re-parses against the same DTO\n * (`repositories-registry-handler.backend.service.ts`) — but relying on a distant guard for\n * an external protocol surface is defence by coincidence: nothing tells a future refactor of\n * that method that MCP depends on it.\n *\n * Parse failures are deliberately NOT swallowed. An agent that sends a malformed argument should\n * be told, so the model can correct itself; silently dropping it teaches the model nothing and\n * leaves it reasoning about an operation it did not actually perform.\n */\n private toDispatchArguments(\n operation: {\n requestDto?: z.ZodTypeAny;\n resourceOperationLike?: unknown;\n operationIdentifier: unknown;\n resourceIdentifier: unknown;\n },\n args: unknown,\n executionContext: ExecutionContext<any>,\n ): unknown {\n const effectiveOperation = this.resolveEffectiveOperation(operation);\n const isCollectionOperation = isCollectionQueryMcpOperation(effectiveOperation);\n\n if (isCollectionOperation) {\n const rawArguments = (args && typeof args === 'object' && !Array.isArray(args))\n ? args as Record<string, unknown>\n : {};\n const resourceOperations = this.resourcesRegistry\n .getResourceConfiguration(operation.resourceIdentifier as ResourceType)\n .operations;\n return normalizeCollectionQueryRequestData(\n rawArguments,\n operation as never,\n effectiveOperation,\n resourceOperations as never,\n );\n }\n\n if (!operation.requestDto) return args;\n\n try {\n return operation.requestDto.parse(args);\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: {\n message: 'MCP tool arguments do not satisfy the operation request contract advertised by tools/list',\n operationIdentifier: operation.operationIdentifier,\n zodIssues: error.issues,\n },\n });\n }\n throw error;\n }\n }\n\n /**\n * The operation this tool really performs — a custom operation declares what it behaves LIKE via\n * `resourceOperationLike`, and both the input normalisation and the output envelope must key on\n * the same answer. Derived once here because they previously derived it separately, and a\n * custom LIST-like operation that only one of them recognised would be normalised as a collection\n * on the way in and dispatched without pagination on the way out.\n */\n private resolveEffectiveOperation(operation: { resourceOperationLike?: unknown; operationIdentifier: unknown }): string {\n return resolveEffectiveMcpOperation(operation);\n }\n\n private parseToolName(toolName: string): { resourceType: ResourceType; operationIdentifier: string } {\n const separatorIndex = toolName.indexOf(MCP_TOOL_NAME_SEPARATOR);\n if (separatorIndex <= 0 || separatorIndex + MCP_TOOL_NAME_SEPARATOR.length >= toolName.length) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_NOT_FOUND,\n context: { message: `Malformed MCP tool name \"${toolName}\" — expected \"<resource>${MCP_TOOL_NAME_SEPARATOR}<operation>\"`, toolName },\n });\n }\n return {\n resourceType: toolName.slice(0, separatorIndex) as ResourceType,\n operationIdentifier: toolName.slice(separatorIndex + MCP_TOOL_NAME_SEPARATOR.length),\n };\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { ResourceType, ResourceConfiguration_Operation, ResourcePrimaryScope } from '@wildo-ai/saas-models';
1
+ import { ResourceType, ResourceConfiguration_Operation, ResourcePrimaryScope, type FileUploadGrantOperation } from '@wildo-ai/saas-models';
2
+ import type { FileFieldDetectionBackendService } from '../../files/services/file-field-detection.backend.service';
2
3
  import type { LoggerService } from '../../monitoring/logger/services/logger.service';
3
4
  import { ResourcesRegistryBackendService } from '../../resources/services/resources-registry.backend.service';
4
5
  import { McpToolDescriptor, McpToolAdapterBuildOptions } from '../../mcp/models/mcp-tool.backend.schemas';
@@ -60,6 +61,12 @@ export declare function resolveEffectiveMcpOperation(operation: {
60
61
  * would ask the repository to wrap a scalar in a pagination envelope its response DTO never declares.
61
62
  */
62
63
  export declare function isCollectionQueryMcpOperation(effectiveOperation: string): boolean;
64
+ /**
65
+ * The kebab-case segment a file field gets in its upload ROUTE (`…/files/<segment>`) — the same
66
+ * transform `ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation` applies, so
67
+ * a derived tool name and the route it mints for agree by construction.
68
+ */
69
+ export declare function fileFieldRouteSegment(fieldName: string): string;
63
70
  /**
64
71
  * Adapts registered resource operations into MCP tool descriptors.
65
72
  *
@@ -100,8 +107,24 @@ export declare function isCollectionQueryMcpOperation(effectiveOperation: string
100
107
  export declare class McpToolAdapterBackendService {
101
108
  protected readonly logger: LoggerService;
102
109
  protected readonly resourcesRegistry: ResourcesRegistryBackendService;
110
+ /**
111
+ * Detects the user-uploadable file fields a resource carries — the same detector the resource
112
+ * controller uses to REGISTER upload routes, so a derived upload-grant tool is advertised for
113
+ * exactly the fields that have a route. Optional only so harnesses that never look at file
114
+ * fields can construct the adapter; the container always binds it, and without it no derived
115
+ * tool is advertised or callable (fail-closed, logged once).
116
+ */
117
+ protected readonly fileFieldDetection?: FileFieldDetectionBackendService;
103
118
  protected logDebug: (message: string, context?: Record<string, unknown>) => void;
104
- constructor(logger: LoggerService, resourcesRegistry: ResourcesRegistryBackendService);
119
+ constructor(logger: LoggerService, resourcesRegistry: ResourcesRegistryBackendService,
120
+ /**
121
+ * Detects the user-uploadable file fields a resource carries — the same detector the resource
122
+ * controller uses to REGISTER upload routes, so a derived upload-grant tool is advertised for
123
+ * exactly the fields that have a route. Optional only so harnesses that never look at file
124
+ * fields can construct the adapter; the container always binds it, and without it no derived
125
+ * tool is advertised or callable (fail-closed, logged once).
126
+ */
127
+ fileFieldDetection?: FileFieldDetectionBackendService);
105
128
  /**
106
129
  * Build the MCP tool descriptor set for the requested resources, filtered to the caller's reachable
107
130
  * scopes (`options.reachableScopes`, default = machine-reachable ORG/APP). A user-delegated caller
@@ -195,6 +218,45 @@ export declare class McpToolAdapterBackendService {
195
218
  * build their tool descriptors, sorted by operation identifier.
196
219
  */
197
220
  private buildResourceToolDescriptors;
221
+ /**
222
+ * The user-uploadable file fields a CREATE / UPDATE operation carries; `[]` for every other operation
223
+ * (a READ or DELETE never receives a file) and whenever no detector is bound.
224
+ */
225
+ private uploadableFileFieldsFor;
226
+ private warnedNoFileFieldDetection;
227
+ /**
228
+ * Debug, not warn: the container always binds the detector, so in production this never fires; where
229
+ * it does fire — a harness that constructs the adapter bare — a warning would be noise about a
230
+ * dependency the harness deliberately left out.
231
+ */
232
+ private warnOnceNoFileFieldDetection;
233
+ /**
234
+ * Append, to the PARENT tool's description, where each file field's `fileId` comes from. Engine-
235
+ * appended for the same reason as the envelope note: how a file reaches a resource is a framework
236
+ * fact, not app prose, and an agent reading `attachments.fileId: string` would otherwise have no way
237
+ * to learn that the value cannot be invented.
238
+ */
239
+ private withUploadGrantNote;
240
+ /**
241
+ * The derived upload-grant descriptor. Its arguments are the parent's instance id (UPDATE only —
242
+ * the same id the parent advertises, split out by the transport exactly the same way) and an
243
+ * optional lifetime bounded by the engine ceiling. Nothing about the file itself: bytes never
244
+ * travel through a tool call, which is the whole reason this tool exists.
245
+ */
246
+ private buildUploadGrantDescriptor;
247
+ /**
248
+ * Resolve a DERIVED upload-grant tool back to its parent operation and file field — the callable
249
+ * half of `buildToolDescriptors`' derived emission, kept symmetric with it: the parent is resolved
250
+ * through `resolveExposableOperation` (so exposure, instance and principal-scope gating are
251
+ * inherited verbatim), the field must be one of the resource's uploadable file fields, and the
252
+ * composed name must satisfy the naming guidance. `undefined` for anything that is not a well-formed,
253
+ * advertised derived tool.
254
+ */
255
+ resolveUploadGrantTool(resourceType: ResourceType, operationPart: string, reachableScopes: ReadonlySet<ResourcePrimaryScope>, instanceRef?: string): {
256
+ parentOperation: ResourceConfiguration_Operation<any, any, any>;
257
+ fieldName: string;
258
+ operationKind: FileUploadGrantOperation;
259
+ } | undefined;
198
260
  /** `<resourceIdentifier>__<operationIdentifier>`. */
199
261
  private buildToolName;
200
262
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool-adapter.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/services/mcp-tool-adapter.backend.service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEZ,+BAA+B,EAC/B,oBAAoB,EAMrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAE3H,OAAO,EACL,iBAAiB,EAEjB,0BAA0B,EAK3B,MAAM,wDAAwD,CAAC;AAuDhE;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,gCAAgC;IAChC,SAAS,cAAc;IACvB,0EAA0E;IAC1E,OAAO,YAAY;IACnB,sFAAsF;IACtF,cAAc,mBAAmB;CAClC;AAED;;;;;;GAMG;AACH;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAAC,eAAe,EAAE,OAAO,GAAG,kBAAkB,CAE/F;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,kBAAkB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAS/G;AAED;;;;;;;;;;;GAWG;AACH,w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AAC,aAAa;IAIrB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,uBAAuB;IAoB/B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,4BAA4B;IAsBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,CAAC,uBAAuB;IA8B/B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,gBAAgB;CAWzB"}
1
+ {"version":3,"file":"mcp-tool-adapter.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/services/mcp-tool-adapter.backend.service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEZ,+BAA+B,EAC/B,oBAAoB,EASpB,KAAK,wBAAwB,EAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gCAAgC,EAAqB,MAAM,wEAAwE,CAAC;AAClJ,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAE3H,OAAO,EACL,iBAAiB,EAEjB,0BAA0B,EAO3B,MAAM,wDAAwD,CAAC;AAuDhE;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,gCAAgC;IAChC,SAAS,cAAc;IACvB,0EAA0E;IAC1E,OAAO,YAAY;IACnB,sFAAsF;IACtF,cAAc,mBAAmB;CAClC;AAED;;;;;;GAMG;AACH;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAAC,eAAe,EAAE,OAAO,GAAG,kBAAkB,CAE/F;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,kBAAkB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAS/G;AAED;;;;;;;;;;;GAWG;AACH,w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AsB9B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,2BAA2B;IAInC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,qBAAqB;IAS7B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IA2IpC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,0BAA0B,CAAS;IAC3C;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAoClC;;;;;;;OAOG;IACH,sBAAsB,CACpB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC,EAClD,WAAW,CAAC,EAAE,MAAM,GACnB;QAAE,eAAe,EAAE,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,wBAAwB,CAAA;KAAE,GAAG,SAAS;IAa9I,qDAAqD;IACrD,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,uBAAuB;IAoB/B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,4BAA4B;IAsBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,CAAC,uBAAuB;IA8B/B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,gBAAgB;CAWzB"}
@@ -10,12 +10,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { injectable, inject } from 'inversify';
14
- import { ResourcePrimaryScope, PRIMARY_SCOPE_TO_FIELD_IDENTIFIER, ResourceOperationRiskLevel, CoreResourceOperation, isDefaultUrlBearingOperation, createResourceSearchQueryRequestSchema, } from '@wildo-ai/saas-models';
13
+ import { injectable, inject, optional } from 'inversify';
14
+ import { ResourcePrimaryScope, PRIMARY_SCOPE_TO_FIELD_IDENTIFIER, ResourceOperationRiskLevel, CoreResourceOperation, isDefaultUrlBearingOperation, createResourceSearchQueryRequestSchema, FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES, FILE_UPLOAD_GRANT_DEFAULT_MINUTES, ResourcesConfigNamingUtils, } from '@wildo-ai/saas-models';
15
15
  import { SAAS_SERVICE_TYPES } from '../../inject/models/service-types.js';
16
16
  import { ResourcesRegistryBackendService } from '../../resources/services/resources-registry.backend.service.js';
17
17
  import { convertZodSchemaToMcpInputSchema, isMcpValueWrappedRequestDto } from '../../mcp/utils/zod-to-mcp-json-schema.backend.utils.js';
18
- import { MCP_TOOL_NAME_SEPARATOR, MCP_TOOL_NAME_MAX_LENGTH, isSpecConformantMcpToolName, } from '../../mcp/models/mcp-tool.backend.schemas.js';
18
+ import { MCP_TOOL_NAME_SEPARATOR, MCP_TOOL_NAME_MAX_LENGTH, isSpecConformantMcpToolName, buildUploadGrantToolOperationPart, parseUploadGrantToolOperationPart, } from '../../mcp/models/mcp-tool.backend.schemas.js';
19
19
  /**
20
20
  * Resource primary scopes a **machine principal** can reach — ORG / APP only. Verified against the
21
21
  * authorizer (`authorizations.backend.service.ts`): `authorizeUserSelf` requires
@@ -139,6 +139,14 @@ export function isCollectionQueryMcpOperation(effectiveOperation) {
139
139
  || effectiveOperation === CoreResourceOperation.SEARCH
140
140
  || effectiveOperation === CoreResourceOperation.COUNT;
141
141
  }
142
+ /**
143
+ * The kebab-case segment a file field gets in its upload ROUTE (`…/files/<segment>`) — the same
144
+ * transform `ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation` applies, so
145
+ * a derived tool name and the route it mints for agree by construction.
146
+ */
147
+ export function fileFieldRouteSegment(fieldName) {
148
+ return ResourcesConfigNamingUtils.toKebabCase(fieldName.replace(/\./g, '-'));
149
+ }
142
150
  /** Core operations that only read — surfaced as `annotations.readOnlyHint`. */
143
151
  const READ_ONLY_CORE_OPERATIONS = new Set([
144
152
  CoreResourceOperation.READ,
@@ -203,10 +211,12 @@ const DESTRUCTIVE_RISK_LEVELS = new Set([
203
211
  let McpToolAdapterBackendService = class McpToolAdapterBackendService {
204
212
  logger;
205
213
  resourcesRegistry;
214
+ fileFieldDetection;
206
215
  logDebug;
207
- constructor(logger, resourcesRegistry) {
216
+ constructor(logger, resourcesRegistry, fileFieldDetection) {
208
217
  this.logger = logger;
209
218
  this.resourcesRegistry = resourcesRegistry;
219
+ this.fileFieldDetection = fileFieldDetection;
210
220
  this.logDebug = this.logger.debugByType('McpToolAdapterBackendService');
211
221
  this.logger.setDebugTypeLogging('McpToolAdapterBackendService', false);
212
222
  }
@@ -451,17 +461,151 @@ let McpToolAdapterBackendService = class McpToolAdapterBackendService {
451
461
  : baseInputSchema;
452
462
  // …then withdraw the SCOPE field, wherever the DTO happens to place it.
453
463
  const inputSchema = this.withoutScopeParameters(advertisedSchema, config.resourcePrimaryScope);
464
+ const uploadableFileFields = this.uploadableFileFieldsFor(config.resourceIdentifier, operationIdentifier);
454
465
  descriptors.push({
455
466
  name,
456
- description: this.resolveDescription(config.resourceIdentifier, operationIdentifier, operation, descriptionProvider),
467
+ description: this.withUploadGrantNote(config.resourceIdentifier, operationIdentifier, uploadableFileFields, this.resolveDescription(config.resourceIdentifier, operationIdentifier, operation, descriptionProvider)),
457
468
  inputSchema,
458
469
  annotations: this.buildAnnotations(operationIdentifier, operation.riskLevel),
459
470
  resourceType: config.resourceIdentifier,
460
471
  operationIdentifier,
461
472
  });
473
+ /*
474
+ * ## Coverage: unit tests only, accepted deliberately — 2026-09-08 (#467)
475
+ *
476
+ * NO application reaches this derivation. Neither dogfood exposes an MCP operation carrying a
477
+ * user-uploadable file field: the two file fields declared belong to `todo-lists` and
478
+ * `knowledge-documents`, neither MCP-exposed, and the only file field on an MCP-exposed
479
+ * resource is `todos.generatedSummaryPdf` — PDF-template generated, and therefore excluded
480
+ * from uploadable fields BY DESIGN. So the derivation below, `resolveUploadGrantTool` and the
481
+ * mint path are covered by unit tests only.
482
+ *
483
+ * Nothing is wrong; the shape that reaches this code simply does not exist in any application.
484
+ * Buying the proof would mean authoring an uploadable file field for the purpose of testing
485
+ * it, which proves the harness more than the product — weighed and accepted.
486
+ *
487
+ * **What would change the answer:** an MCP-exposed resource gaining a user-uploadable file
488
+ * field. That author is the first party to execute this path.
489
+ */
490
+ // Issue #312, D11: one DERIVED upload-grant tool per user-uploadable file field of an exposed
491
+ // CREATE / UPDATE. It inherits every gate the parent just passed (exposure, instance, scope) by
492
+ // construction — it is emitted inside the parent's own iteration — and is resolved back through
493
+ // the parent by `resolveUploadGrantTool`, so advertised ≡ callable holds for it too.
494
+ for (const fileField of uploadableFileFields) {
495
+ const derivedName = this.buildToolName(config.resourceIdentifier, buildUploadGrantToolOperationPart(operationIdentifier, fileFieldRouteSegment(fileField.fieldName)));
496
+ if (!isSpecConformantMcpToolName(derivedName)) {
497
+ // Same withdrawal as the parent's guard above: a name the client could not parse is not
498
+ // advertised, and `resolveUploadGrantTool` mirrors the check so it is not callable either.
499
+ this.logger.warn('Skipping MCP upload-grant tool whose derived name does not satisfy the MCP naming guidance', {
500
+ toolName: derivedName, resourceIdentifier: config.resourceIdentifier, operationIdentifier, fieldName: fileField.fieldName, maxLength: MCP_TOOL_NAME_MAX_LENGTH,
501
+ });
502
+ continue;
503
+ }
504
+ if (seen.has(derivedName))
505
+ continue;
506
+ seen.add(derivedName);
507
+ descriptors.push(this.buildUploadGrantDescriptor(config.resourceIdentifier, operationIdentifier, fileField, derivedName, bindsInstanceId ? selfFieldIdentifier : undefined, name));
508
+ }
462
509
  }
463
510
  return descriptors.sort((a, b) => a.operationIdentifier.localeCompare(b.operationIdentifier));
464
511
  }
512
+ /**
513
+ * The user-uploadable file fields a CREATE / UPDATE operation carries; `[]` for every other operation
514
+ * (a READ or DELETE never receives a file) and whenever no detector is bound.
515
+ */
516
+ uploadableFileFieldsFor(resourceType, operationIdentifier) {
517
+ if (operationIdentifier !== String(CoreResourceOperation.CREATE) && operationIdentifier !== String(CoreResourceOperation.UPDATE))
518
+ return [];
519
+ if (!this.fileFieldDetection) {
520
+ this.warnOnceNoFileFieldDetection();
521
+ return [];
522
+ }
523
+ return this.fileFieldDetection.getUploadableFileFields(resourceType);
524
+ }
525
+ warnedNoFileFieldDetection = false;
526
+ /**
527
+ * Debug, not warn: the container always binds the detector, so in production this never fires; where
528
+ * it does fire — a harness that constructs the adapter bare — a warning would be noise about a
529
+ * dependency the harness deliberately left out.
530
+ */
531
+ warnOnceNoFileFieldDetection() {
532
+ if (this.warnedNoFileFieldDetection)
533
+ return;
534
+ this.warnedNoFileFieldDetection = true;
535
+ this.logDebug('No FileFieldDetectionService bound — no upload-grant tool is advertised or callable');
536
+ }
537
+ /**
538
+ * Append, to the PARENT tool's description, where each file field's `fileId` comes from. Engine-
539
+ * appended for the same reason as the envelope note: how a file reaches a resource is a framework
540
+ * fact, not app prose, and an agent reading `attachments.fileId: string` would otherwise have no way
541
+ * to learn that the value cannot be invented.
542
+ */
543
+ withUploadGrantNote(resourceType, operationIdentifier, fileFields, description) {
544
+ if (fileFields.length === 0)
545
+ return description;
546
+ const lines = fileFields.map((f) => `"${f.fieldName}.${f.fileMetadata.multiple ? 'fileIds' : 'fileId'}" is obtained by calling ${this.buildToolName(resourceType, buildUploadGrantToolOperationPart(operationIdentifier, fileFieldRouteSegment(f.fieldName)))} and uploading the file with the link it returns; a fileId cannot be invented.`);
547
+ return `${description}
548
+
549
+ File fields: ${lines.join(' ')}`;
550
+ }
551
+ /**
552
+ * The derived upload-grant descriptor. Its arguments are the parent's instance id (UPDATE only —
553
+ * the same id the parent advertises, split out by the transport exactly the same way) and an
554
+ * optional lifetime bounded by the engine ceiling. Nothing about the file itself: bytes never
555
+ * travel through a tool call, which is the whole reason this tool exists.
556
+ */
557
+ buildUploadGrantDescriptor(resourceType, parentOperationIdentifier, fileField, name, instanceIdField, parentToolName) {
558
+ const properties = {
559
+ ...(instanceIdField ? { [instanceIdField]: { type: 'string', description: `The ${String(resourceType)} record the file is for — the same id ${parentToolName} takes.` } } : {}),
560
+ expiresInMinutes: {
561
+ type: 'integer', minimum: 1, maximum: FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES,
562
+ description: `How long the link stays usable (default ${FILE_UPLOAD_GRANT_DEFAULT_MINUTES}, at most ${FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES}).`,
563
+ },
564
+ // Declaring the file up front lets the server refuse an impossible one BEFORE a link exists — the
565
+ // same facts the MCP File Objects proposal has a client declare when it asks to upload.
566
+ name: { type: 'string', maxLength: 255, description: 'The file name you intend to upload (used in the returned command).' },
567
+ mimeType: { type: 'string', maxLength: 255, description: `Declared MIME type; refused now if the field does not accept it (accepted: ${fileField.fileMetadata.allowedMimeTypes?.join(', ') || 'any'}).` },
568
+ size: { type: 'integer', minimum: 1, description: 'Declared size in bytes; refused now if above the field maximum.' },
569
+ };
570
+ const target = `the "${fileField.fieldName}" file of a ${String(resourceType)} record (${parentOperationIdentifier})`;
571
+ return {
572
+ name,
573
+ description: `Mint a single-use upload link for ${target}. NOTHING is uploaded by this call and no bytes ever travel through a tool call. `
574
+ + 'It returns uploadCommand — run it if you can execute commands and the file is on your filesystem — and uploadPageUrl — show it to the user otherwise, so they can drop the file in their browser. '
575
+ + 'The link is not the caller\'s credential: it unlocks exactly ONE upload of ONE file into this field and then dies. '
576
+ + `Afterwards read the produced fileId (from the upload response, or from statusUrl if a human uploaded) and pass it as "${fileField.fieldName}.${fileField.fileMetadata.multiple ? 'fileIds' : 'fileId'}" in ${parentToolName}. `
577
+ + 'If the link expires or the upload is refused, call this again.',
578
+ inputSchema: { type: 'object', properties, ...(instanceIdField ? { required: [instanceIdField] } : {}), additionalProperties: false },
579
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
580
+ resourceType,
581
+ operationIdentifier: buildUploadGrantToolOperationPart(parentOperationIdentifier, fileFieldRouteSegment(fileField.fieldName)),
582
+ };
583
+ }
584
+ /**
585
+ * Resolve a DERIVED upload-grant tool back to its parent operation and file field — the callable
586
+ * half of `buildToolDescriptors`' derived emission, kept symmetric with it: the parent is resolved
587
+ * through `resolveExposableOperation` (so exposure, instance and principal-scope gating are
588
+ * inherited verbatim), the field must be one of the resource's uploadable file fields, and the
589
+ * composed name must satisfy the naming guidance. `undefined` for anything that is not a well-formed,
590
+ * advertised derived tool.
591
+ */
592
+ resolveUploadGrantTool(resourceType, operationPart, reachableScopes, instanceRef) {
593
+ const parsed = parseUploadGrantToolOperationPart(operationPart);
594
+ if (!parsed)
595
+ return undefined;
596
+ const kind = parsed.parentOperationIdentifier;
597
+ if (kind !== String(CoreResourceOperation.CREATE) && kind !== String(CoreResourceOperation.UPDATE))
598
+ return undefined;
599
+ if (!isSpecConformantMcpToolName(this.buildToolName(resourceType, operationPart)))
600
+ return undefined;
601
+ const parentOperation = this.resolveExposableOperation(resourceType, kind, reachableScopes, instanceRef);
602
+ if (!parentOperation)
603
+ return undefined;
604
+ const field = this.uploadableFileFieldsFor(resourceType, kind).find((f) => fileFieldRouteSegment(f.fieldName) === parsed.fieldRouteSegment);
605
+ if (!field)
606
+ return undefined;
607
+ return { parentOperation, fieldName: field.fieldName, operationKind: kind };
608
+ }
465
609
  /** `<resourceIdentifier>__<operationIdentifier>`. */
466
610
  buildToolName(resourceIdentifier, operationIdentifier) {
467
611
  return `${String(resourceIdentifier)}${MCP_TOOL_NAME_SEPARATOR}${operationIdentifier}`;
@@ -681,7 +825,9 @@ McpToolAdapterBackendService = __decorate([
681
825
  injectable(),
682
826
  __param(0, inject(SAAS_SERVICE_TYPES.Logger)),
683
827
  __param(1, inject(SAAS_SERVICE_TYPES.ResourceRegistryService)),
684
- __metadata("design:paramtypes", [Function, ResourcesRegistryBackendService])
828
+ __param(2, inject(SAAS_SERVICE_TYPES.FileFieldDetectionService)),
829
+ __param(2, optional()),
830
+ __metadata("design:paramtypes", [Function, ResourcesRegistryBackendService, Function])
685
831
  ], McpToolAdapterBackendService);
686
832
  export { McpToolAdapterBackendService };
687
833
  //# sourceMappingURL=mcp-tool-adapter.backend.service.js.map