@indexnetwork/protocol 6.12.1-rc.404.1 → 6.13.22-rc.405.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1180) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/IMPLEMENTATION.md +20 -0
  3. package/STABILITY.md +4 -0
  4. package/dist/agent/agent.tools.d.ts +11 -3
  5. package/dist/agent/agent.tools.js +11 -301
  6. package/dist/capabilities/communities.facade.d.ts +13 -0
  7. package/dist/capabilities/communities.facade.js +12 -0
  8. package/dist/capabilities/communities.tools.port.d.ts +5 -0
  9. package/dist/capabilities/communities.tools.port.js +1 -0
  10. package/dist/capabilities/contacts.facade.d.ts +9 -0
  11. package/dist/capabilities/contacts.facade.js +8 -0
  12. package/dist/capabilities/contacts.tools.port.d.ts +9 -0
  13. package/dist/capabilities/contacts.tools.port.js +1 -0
  14. package/dist/capabilities/integrations.facade.d.ts +8 -0
  15. package/dist/capabilities/integrations.facade.js +7 -0
  16. package/dist/capabilities/integrations.tools.port.d.ts +9 -0
  17. package/dist/capabilities/integrations.tools.port.js +1 -0
  18. package/dist/capabilities/interaction-composition.facade.d.ts +10 -0
  19. package/dist/capabilities/interaction-composition.facade.js +9 -0
  20. package/dist/capabilities/negotiation.discovery.facade.d.ts +9 -0
  21. package/dist/capabilities/negotiation.discovery.facade.js +7 -0
  22. package/dist/capabilities/negotiation.facade.d.ts +23 -0
  23. package/dist/capabilities/negotiation.facade.js +17 -0
  24. package/dist/capabilities/negotiation.memory.facade.d.ts +6 -0
  25. package/dist/capabilities/negotiation.memory.facade.js +5 -0
  26. package/dist/capabilities/negotiation.questions.facade.d.ts +6 -0
  27. package/dist/capabilities/negotiation.questions.facade.js +5 -0
  28. package/dist/capabilities/negotiation.state.facade.d.ts +5 -0
  29. package/dist/capabilities/negotiation.state.facade.js +1 -0
  30. package/dist/capabilities/negotiation.summary.facade.d.ts +5 -0
  31. package/dist/capabilities/negotiation.summary.facade.js +5 -0
  32. package/dist/capabilities/negotiation.tools.port.d.ts +5 -0
  33. package/dist/capabilities/negotiation.tools.port.js +1 -0
  34. package/dist/capabilities/opportunities.facade.d.ts +50 -0
  35. package/dist/capabilities/opportunities.facade.js +50 -0
  36. package/dist/capabilities/opportunities.safety.facade.d.ts +2 -0
  37. package/dist/capabilities/opportunities.safety.facade.js +2 -0
  38. package/dist/capabilities/opportunities.tools.port.d.ts +5 -0
  39. package/dist/capabilities/opportunities.tools.port.js +1 -0
  40. package/dist/capabilities/participant-agents.debug.facade.d.ts +2 -0
  41. package/dist/capabilities/participant-agents.debug.facade.js +1 -0
  42. package/dist/capabilities/participant-agents.facade.d.ts +35 -0
  43. package/dist/capabilities/participant-agents.facade.js +35 -0
  44. package/dist/capabilities/participant-agents.tools.facade.d.ts +8 -0
  45. package/dist/capabilities/participant-agents.tools.facade.js +8 -0
  46. package/dist/capabilities/participant-agents.tools.port.d.ts +9 -0
  47. package/dist/capabilities/participant-agents.tools.port.js +1 -0
  48. package/dist/capabilities/participant-context.facade.d.ts +13 -0
  49. package/dist/capabilities/participant-context.facade.js +14 -0
  50. package/dist/capabilities/participant-context.tools.port.d.ts +9 -0
  51. package/dist/capabilities/participant-context.tools.port.js +1 -0
  52. package/dist/capabilities/questions.enqueue.facade.d.ts +5 -0
  53. package/dist/capabilities/questions.enqueue.facade.js +1 -0
  54. package/dist/capabilities/questions.facade.d.ts +8 -0
  55. package/dist/capabilities/questions.facade.js +7 -0
  56. package/dist/capabilities/questions.runtime.facade.d.ts +5 -0
  57. package/dist/capabilities/questions.runtime.facade.js +5 -0
  58. package/dist/capabilities/questions.tools.port.d.ts +5 -0
  59. package/dist/capabilities/questions.tools.port.js +1 -0
  60. package/dist/capabilities/signals.facade.d.ts +16 -0
  61. package/dist/capabilities/signals.facade.js +14 -0
  62. package/dist/capabilities/signals.indexing.facade.d.ts +12 -0
  63. package/dist/capabilities/signals.indexing.facade.js +11 -0
  64. package/dist/capabilities/signals.tools.port.d.ts +5 -0
  65. package/dist/capabilities/signals.tools.port.js +1 -0
  66. package/dist/chat/chat-streaming.types.d.ts +0 -1
  67. package/dist/chat/chat-streaming.types.js +1 -2
  68. package/dist/chat/chat.agent.d.ts +0 -1
  69. package/dist/chat/chat.agent.js +0 -1
  70. package/dist/chat/chat.graph.d.ts +0 -1
  71. package/dist/chat/chat.graph.js +0 -1
  72. package/dist/chat/chat.interrupt.classifier.d.ts +0 -1
  73. package/dist/chat/chat.interrupt.classifier.js +0 -1
  74. package/dist/chat/chat.persona.d.ts +0 -1
  75. package/dist/chat/chat.persona.js +0 -1
  76. package/dist/chat/chat.prompt.d.ts +0 -1
  77. package/dist/chat/chat.prompt.js +0 -1
  78. package/dist/chat/chat.prompt.modules.d.ts +0 -1
  79. package/dist/chat/chat.prompt.modules.js +0 -1
  80. package/dist/chat/chat.question-dedup.d.ts +0 -1
  81. package/dist/chat/chat.question-dedup.js +0 -1
  82. package/dist/chat/chat.state.d.ts +0 -1
  83. package/dist/chat/chat.state.js +0 -1
  84. package/dist/chat/chat.streamer.d.ts +0 -1
  85. package/dist/chat/chat.streamer.js +0 -1
  86. package/dist/chat/chat.suggester.d.ts +0 -1
  87. package/dist/chat/chat.suggester.js +0 -1
  88. package/dist/chat/chat.summarizer.d.ts +0 -1
  89. package/dist/chat/chat.summarizer.js +0 -1
  90. package/dist/chat/chat.title.generator.d.ts +0 -1
  91. package/dist/chat/chat.title.generator.js +0 -1
  92. package/dist/chat/chat.tools.d.ts +0 -1
  93. package/dist/chat/chat.tools.js +0 -1
  94. package/dist/chat/chat.utils.d.ts +0 -1
  95. package/dist/chat/chat.utils.js +0 -1
  96. package/dist/chat/negotiator.persona.d.ts +0 -1
  97. package/dist/chat/negotiator.persona.js +0 -1
  98. package/dist/chat/negotiator.prompt.d.ts +1 -2
  99. package/dist/chat/negotiator.prompt.js +1 -2
  100. package/dist/chat/negotiator.tools.d.ts +0 -1
  101. package/dist/chat/negotiator.tools.js +0 -1
  102. package/dist/chat/onboarding.persona.d.ts +0 -1
  103. package/dist/chat/onboarding.persona.js +0 -1
  104. package/dist/chat/onboarding.prompt.d.ts +0 -1
  105. package/dist/chat/onboarding.prompt.js +0 -1
  106. package/dist/chat/reporter.action.contracts.d.ts +36 -0
  107. package/dist/chat/reporter.action.contracts.js +1 -0
  108. package/dist/chat/reporter.action.tools.d.ts +2 -37
  109. package/dist/chat/reporter.action.tools.js +0 -1
  110. package/dist/chat/reporter.persona.d.ts +0 -1
  111. package/dist/chat/reporter.persona.js +0 -1
  112. package/dist/chat/reporter.prompt.d.ts +0 -1
  113. package/dist/chat/reporter.prompt.js +0 -1
  114. package/dist/chat/signal.persona.d.ts +0 -1
  115. package/dist/chat/signal.persona.js +0 -1
  116. package/dist/chat/signal.prompt.d.ts +0 -1
  117. package/dist/chat/signal.prompt.js +0 -1
  118. package/dist/communities/application/index.d.ts +45 -0
  119. package/dist/communities/application/index.js +50 -0
  120. package/dist/communities/application/indexer.graph.d.ts +446 -0
  121. package/dist/communities/application/indexer.graph.js +420 -0
  122. package/dist/communities/application/indexer.state.d.ts +172 -0
  123. package/dist/communities/application/indexer.state.js +116 -0
  124. package/dist/communities/application/membership.graph.d.ts +270 -0
  125. package/dist/communities/application/membership.graph.js +229 -0
  126. package/dist/communities/application/network.graph.d.ts +648 -0
  127. package/dist/communities/application/network.graph.js +303 -0
  128. package/dist/communities/application/network.recommender.d.ts +44 -0
  129. package/dist/communities/application/network.recommender.js +113 -0
  130. package/dist/communities/application/network.tools.d.ts +35 -0
  131. package/dist/communities/application/network.tools.js +578 -0
  132. package/dist/communities/domain/index.d.ts +29 -0
  133. package/dist/communities/domain/index.js +31 -0
  134. package/dist/communities/domain/membership.state.d.ts +87 -0
  135. package/dist/communities/domain/membership.state.js +53 -0
  136. package/dist/communities/domain/network.state.d.ts +192 -0
  137. package/dist/communities/domain/network.state.js +66 -0
  138. package/dist/communities/index.d.ts +14 -0
  139. package/dist/communities/index.js +14 -0
  140. package/dist/communities/ports/index.d.ts +25 -0
  141. package/dist/communities/ports/index.js +27 -0
  142. package/dist/communities/public/index.d.ts +30 -0
  143. package/dist/communities/public/index.js +33 -0
  144. package/dist/contact/contact.inviter.d.ts +7 -44
  145. package/dist/contact/contact.inviter.js +6 -59
  146. package/dist/contact/contact.tools.d.ts +7 -5
  147. package/dist/contact/contact.tools.js +7 -177
  148. package/dist/contacts/application/contact.inviter.d.ts +49 -0
  149. package/dist/contacts/application/contact.inviter.js +64 -0
  150. package/dist/contacts/application/contact.tools.d.ts +20 -0
  151. package/dist/contacts/application/contact.tools.js +191 -0
  152. package/dist/contacts/application/index.d.ts +22 -0
  153. package/dist/contacts/application/index.js +21 -0
  154. package/dist/contacts/domain/contact.types.d.ts +51 -0
  155. package/dist/contacts/domain/contact.types.js +10 -0
  156. package/dist/contacts/domain/index.d.ts +18 -0
  157. package/dist/contacts/domain/index.js +1 -0
  158. package/dist/contacts/index.d.ts +24 -0
  159. package/dist/contacts/index.js +24 -0
  160. package/dist/contacts/ports/contact.repository.port.d.ts +28 -0
  161. package/dist/contacts/ports/contact.repository.port.js +14 -0
  162. package/dist/contacts/ports/contact.tools.port.d.ts +26 -0
  163. package/dist/contacts/ports/contact.tools.port.js +21 -0
  164. package/dist/contacts/ports/index.d.ts +22 -0
  165. package/dist/contacts/ports/index.js +21 -0
  166. package/dist/contacts/public/index.d.ts +36 -0
  167. package/dist/contacts/public/index.js +33 -0
  168. package/dist/context/context.generator.d.ts +0 -1
  169. package/dist/context/context.generator.js +0 -1
  170. package/dist/enrichment/enrichment.enricher.d.ts +0 -1
  171. package/dist/enrichment/enrichment.enricher.js +0 -1
  172. package/dist/enrichment/enrichment.generator.d.ts +0 -1
  173. package/dist/enrichment/enrichment.generator.js +0 -1
  174. package/dist/enrichment/enrichment.graph.d.ts +6 -7
  175. package/dist/enrichment/enrichment.graph.js +0 -1
  176. package/dist/enrichment/enrichment.state.d.ts +2 -3
  177. package/dist/enrichment/enrichment.state.js +0 -1
  178. package/dist/enrichment/enrichment.tools.d.ts +3 -3
  179. package/dist/enrichment/enrichment.tools.js +0 -1
  180. package/dist/index.d.ts +106 -91
  181. package/dist/index.js +79 -71
  182. package/dist/integration/integration.tools.d.ts +6 -10
  183. package/dist/integration/integration.tools.js +6 -82
  184. package/dist/integrations/application/index.d.ts +14 -0
  185. package/dist/integrations/application/index.js +14 -0
  186. package/dist/integrations/application/integration.tools.d.ts +27 -0
  187. package/dist/integrations/application/integration.tools.js +98 -0
  188. package/dist/integrations/domain/index.d.ts +18 -0
  189. package/dist/integrations/domain/index.js +1 -0
  190. package/dist/integrations/domain/integration.types.d.ts +53 -0
  191. package/dist/integrations/domain/integration.types.js +11 -0
  192. package/dist/integrations/index.d.ts +27 -0
  193. package/dist/integrations/index.js +27 -0
  194. package/dist/integrations/ports/index.d.ts +28 -0
  195. package/dist/integrations/ports/index.js +26 -0
  196. package/dist/integrations/ports/integration.adapter.port.d.ts +62 -0
  197. package/dist/integrations/ports/integration.adapter.port.js +15 -0
  198. package/dist/integrations/ports/integration.importer.port.d.ts +31 -0
  199. package/dist/integrations/ports/integration.importer.port.js +15 -0
  200. package/dist/integrations/ports/integration.tools.port.d.ts +28 -0
  201. package/dist/integrations/ports/integration.tools.port.js +21 -0
  202. package/dist/integrations/public/index.d.ts +37 -0
  203. package/dist/integrations/public/index.js +34 -0
  204. package/dist/intent/intent.clarifier.d.ts +3 -52
  205. package/dist/intent/intent.clarifier.js +2 -202
  206. package/dist/intent/intent.graph.d.ts +3 -551
  207. package/dist/intent/intent.graph.js +3 -937
  208. package/dist/intent/intent.indexer.d.ts +2 -83
  209. package/dist/intent/intent.indexer.js +2 -171
  210. package/dist/intent/intent.inferrer.d.ts +2 -95
  211. package/dist/intent/intent.inferrer.js +2 -234
  212. package/dist/intent/intent.reconciler.d.ts +2 -106
  213. package/dist/intent/intent.reconciler.js +2 -187
  214. package/dist/intent/intent.specificity.d.ts +2 -3
  215. package/dist/intent/intent.specificity.js +2 -3
  216. package/dist/intent/intent.state.d.ts +8 -229
  217. package/dist/intent/intent.state.js +8 -189
  218. package/dist/intent/intent.tools.d.ts +6 -24
  219. package/dist/intent/intent.tools.js +4 -788
  220. package/dist/intent/intent.verifier.d.ts +2 -116
  221. package/dist/intent/intent.verifier.js +2 -263
  222. package/dist/maintenance/maintenance.graph.d.ts +0 -1
  223. package/dist/maintenance/maintenance.graph.js +0 -1
  224. package/dist/maintenance/maintenance.state.d.ts +0 -1
  225. package/dist/maintenance/maintenance.state.js +0 -1
  226. package/dist/mcp/elicitation.builder.d.ts +0 -1
  227. package/dist/mcp/elicitation.builder.js +0 -1
  228. package/dist/mcp/elicitation.dispatcher.d.ts +0 -1
  229. package/dist/mcp/elicitation.dispatcher.js +0 -1
  230. package/dist/mcp/mcp.server.d.ts +0 -1
  231. package/dist/mcp/mcp.server.js +1 -2
  232. package/dist/negotiation/application/index.d.ts +48 -0
  233. package/dist/negotiation/application/index.js +49 -0
  234. package/dist/negotiation/application/insight.generator.d.ts +31 -0
  235. package/dist/negotiation/application/insight.generator.js +105 -0
  236. package/dist/negotiation/application/negotiation.agent.d.ts +110 -0
  237. package/dist/negotiation/application/negotiation.agent.js +244 -0
  238. package/dist/negotiation/application/negotiation.detail-reader.d.ts +94 -0
  239. package/dist/negotiation/application/negotiation.detail-reader.js +91 -0
  240. package/dist/negotiation/application/negotiation.graph.d.ts +664 -0
  241. package/dist/negotiation/application/negotiation.graph.js +1393 -0
  242. package/dist/negotiation/application/negotiation.reflect.d.ts +194 -0
  243. package/dist/negotiation/application/negotiation.reflect.js +145 -0
  244. package/dist/negotiation/application/negotiation.screen.d.ts +78 -0
  245. package/dist/negotiation/application/negotiation.screen.js +108 -0
  246. package/dist/negotiation/application/negotiation.summarizer.d.ts +25 -0
  247. package/dist/negotiation/application/negotiation.summarizer.js +101 -0
  248. package/dist/negotiation/application/negotiation.tools.d.ts +18 -0
  249. package/dist/negotiation/application/negotiation.tools.js +782 -0
  250. package/dist/negotiation/domain/index.d.ts +48 -0
  251. package/dist/negotiation/domain/index.js +50 -0
  252. package/dist/negotiation/domain/negotiation.consultation-policy.d.ts +39 -0
  253. package/dist/negotiation/domain/negotiation.consultation-policy.js +68 -0
  254. package/dist/negotiation/domain/negotiation.deadlock.contracts.d.ts +10 -0
  255. package/dist/negotiation/domain/negotiation.deadlock.contracts.js +1 -0
  256. package/dist/negotiation/domain/negotiation.deadlock.d.ts +81 -0
  257. package/dist/negotiation/domain/negotiation.deadlock.js +103 -0
  258. package/dist/negotiation/domain/negotiation.intent-snapshot-provenance.d.ts +21 -0
  259. package/dist/negotiation/domain/negotiation.intent-snapshot-provenance.js +28 -0
  260. package/dist/negotiation/domain/negotiation.lifecycle-narration.d.ts +18 -0
  261. package/dist/negotiation/domain/negotiation.lifecycle-narration.js +87 -0
  262. package/dist/negotiation/domain/negotiation.memory.d.ts +65 -0
  263. package/dist/negotiation/domain/negotiation.memory.js +83 -0
  264. package/dist/negotiation/domain/negotiation.protocol.d.ts +536 -0
  265. package/dist/negotiation/domain/negotiation.protocol.js +202 -0
  266. package/dist/negotiation/domain/negotiation.question-safety.d.ts +25 -0
  267. package/dist/negotiation/domain/negotiation.question-safety.js +55 -0
  268. package/dist/negotiation/domain/negotiation.screen.contracts.d.ts +88 -0
  269. package/dist/negotiation/domain/negotiation.screen.contracts.js +58 -0
  270. package/dist/negotiation/domain/negotiation.state.d.ts +497 -0
  271. package/dist/negotiation/domain/negotiation.state.js +288 -0
  272. package/dist/negotiation/domain/negotiation.task-lock-policy.d.ts +10 -0
  273. package/dist/negotiation/domain/negotiation.task-lock-policy.js +22 -0
  274. package/dist/negotiation/index.d.ts +49 -0
  275. package/dist/negotiation/index.js +49 -0
  276. package/dist/negotiation/insight.generator.d.ts +3 -30
  277. package/dist/negotiation/insight.generator.js +3 -104
  278. package/dist/negotiation/negotiation.agent.d.ts +3 -109
  279. package/dist/negotiation/negotiation.agent.js +3 -248
  280. package/dist/negotiation/negotiation.attribution.d.ts +0 -1
  281. package/dist/negotiation/negotiation.attribution.js +0 -1
  282. package/dist/negotiation/negotiation.consultation-policy.d.ts +3 -38
  283. package/dist/negotiation/negotiation.consultation-policy.js +3 -67
  284. package/dist/negotiation/negotiation.deadlock.contracts.d.ts +5 -0
  285. package/dist/negotiation/negotiation.deadlock.contracts.js +5 -0
  286. package/dist/negotiation/negotiation.deadlock.d.ts +3 -94
  287. package/dist/negotiation/negotiation.deadlock.js +3 -101
  288. package/dist/negotiation/negotiation.detail-reader.d.ts +5 -0
  289. package/dist/negotiation/negotiation.detail-reader.js +5 -0
  290. package/dist/negotiation/negotiation.graph.d.ts +3 -663
  291. package/dist/negotiation/negotiation.graph.js +3 -1459
  292. package/dist/negotiation/negotiation.intent-snapshot-provenance.d.ts +5 -0
  293. package/dist/negotiation/negotiation.intent-snapshot-provenance.js +5 -0
  294. package/dist/negotiation/negotiation.lifecycle-narration.d.ts +5 -0
  295. package/dist/negotiation/negotiation.lifecycle-narration.js +5 -0
  296. package/dist/negotiation/negotiation.memory.d.ts +5 -56
  297. package/dist/negotiation/negotiation.memory.js +5 -69
  298. package/dist/negotiation/negotiation.protocol.d.ts +3 -535
  299. package/dist/negotiation/negotiation.protocol.js +3 -201
  300. package/dist/negotiation/negotiation.question-safety.d.ts +3 -24
  301. package/dist/negotiation/negotiation.question-safety.js +3 -54
  302. package/dist/negotiation/negotiation.reflect.d.ts +4 -197
  303. package/dist/negotiation/negotiation.reflect.js +4 -151
  304. package/dist/negotiation/negotiation.screen.d.ts +6 -159
  305. package/dist/negotiation/negotiation.screen.js +6 -152
  306. package/dist/negotiation/negotiation.state.d.ts +3 -495
  307. package/dist/negotiation/negotiation.state.js +3 -284
  308. package/dist/negotiation/negotiation.summarizer.d.ts +3 -24
  309. package/dist/negotiation/negotiation.summarizer.js +3 -100
  310. package/dist/negotiation/negotiation.task-lock-policy.d.ts +5 -0
  311. package/dist/negotiation/negotiation.task-lock-policy.js +5 -0
  312. package/dist/negotiation/negotiation.tools.d.ts +3 -15
  313. package/dist/negotiation/negotiation.tools.js +3 -946
  314. package/dist/negotiation/ports/index.d.ts +18 -0
  315. package/dist/negotiation/ports/index.js +18 -0
  316. package/dist/negotiation/ports/negotiation.tools.port.d.ts +18 -0
  317. package/dist/negotiation/ports/negotiation.tools.port.js +1 -0
  318. package/dist/negotiation/public/index.d.ts +58 -0
  319. package/dist/negotiation/public/index.js +60 -0
  320. package/dist/network/indexer/indexer.graph.d.ts +3 -413
  321. package/dist/network/indexer/indexer.graph.js +3 -375
  322. package/dist/network/indexer/indexer.state.d.ts +3 -149
  323. package/dist/network/indexer/indexer.state.js +3 -98
  324. package/dist/network/membership/membership.graph.d.ts +3 -248
  325. package/dist/network/membership/membership.graph.js +3 -202
  326. package/dist/network/membership/membership.state.d.ts +3 -75
  327. package/dist/network/membership/membership.state.js +3 -41
  328. package/dist/network/network.graph.d.ts +3 -629
  329. package/dist/network/network.graph.js +3 -267
  330. package/dist/network/network.recommender.d.ts +3 -40
  331. package/dist/network/network.recommender.js +3 -109
  332. package/dist/network/network.state.d.ts +3 -180
  333. package/dist/network/network.state.js +3 -54
  334. package/dist/network/network.tools.d.ts +5 -3
  335. package/dist/network/network.tools.js +5 -566
  336. package/dist/opportunity/application/delivery-card.cache.d.ts +25 -0
  337. package/dist/opportunity/application/delivery-card.cache.js +43 -0
  338. package/dist/opportunity/application/index.d.ts +63 -0
  339. package/dist/opportunity/application/index.js +68 -0
  340. package/dist/opportunity/application/negotiation-context.loader.d.ts +59 -0
  341. package/dist/opportunity/application/negotiation-context.loader.js +88 -0
  342. package/dist/opportunity/application/opportunity.card-presentation.d.ts +44 -0
  343. package/dist/opportunity/application/opportunity.card-presentation.js +104 -0
  344. package/dist/opportunity/application/opportunity.discover.d.ts +215 -0
  345. package/dist/opportunity/application/opportunity.discover.js +793 -0
  346. package/dist/opportunity/application/opportunity.discovery-continuation-finalization.d.ts +34 -0
  347. package/dist/opportunity/application/opportunity.discovery-continuation-finalization.js +74 -0
  348. package/dist/opportunity/application/opportunity.discovery-mcp-lifecycle-finalization.d.ts +44 -0
  349. package/dist/opportunity/application/opportunity.discovery-mcp-lifecycle-finalization.js +92 -0
  350. package/dist/opportunity/application/opportunity.discovery-negotiation-summary.d.ts +14 -0
  351. package/dist/opportunity/application/opportunity.discovery-negotiation-summary.js +46 -0
  352. package/dist/opportunity/application/opportunity.enricher.d.ts +71 -0
  353. package/dist/opportunity/application/opportunity.enricher.js +280 -0
  354. package/dist/opportunity/application/opportunity.evaluator.d.ts +275 -0
  355. package/dist/opportunity/application/opportunity.evaluator.js +459 -0
  356. package/dist/opportunity/application/opportunity.existing-negotiation.d.ts +77 -0
  357. package/dist/opportunity/application/opportunity.existing-negotiation.js +109 -0
  358. package/dist/opportunity/application/opportunity.feed-selection.d.ts +30 -0
  359. package/dist/opportunity/application/opportunity.feed-selection.js +96 -0
  360. package/dist/opportunity/application/opportunity.graph.d.ts +1427 -0
  361. package/dist/opportunity/application/opportunity.graph.js +3693 -0
  362. package/dist/opportunity/application/opportunity.introducer.d.ts +77 -0
  363. package/dist/opportunity/application/opportunity.introducer.js +99 -0
  364. package/dist/opportunity/application/opportunity.lifecycle.d.ts +63 -0
  365. package/dist/opportunity/application/opportunity.lifecycle.js +181 -0
  366. package/dist/opportunity/application/opportunity.newborn-stamping.d.ts +41 -0
  367. package/dist/opportunity/application/opportunity.newborn-stamping.js +81 -0
  368. package/dist/opportunity/application/opportunity.pending-questions.d.ts +33 -0
  369. package/dist/opportunity/application/opportunity.pending-questions.js +42 -0
  370. package/dist/opportunity/application/opportunity.persist.d.ts +58 -0
  371. package/dist/opportunity/application/opportunity.persist.js +145 -0
  372. package/dist/opportunity/application/opportunity.persistence-admission.d.ts +39 -0
  373. package/dist/opportunity/application/opportunity.persistence-admission.js +59 -0
  374. package/dist/opportunity/application/opportunity.presenter.d.ts +156 -0
  375. package/dist/opportunity/application/opportunity.presenter.js +736 -0
  376. package/dist/opportunity/application/opportunity.tools.d.ts +131 -0
  377. package/dist/opportunity/application/opportunity.tools.js +1834 -0
  378. package/dist/opportunity/application/opportunity.update-admission.d.ts +24 -0
  379. package/dist/opportunity/application/opportunity.update-admission.js +38 -0
  380. package/dist/opportunity/delivery-card.cache.d.ts +5 -26
  381. package/dist/opportunity/delivery-card.cache.js +5 -44
  382. package/dist/opportunity/discovery-question.helper.d.ts +3 -17
  383. package/dist/opportunity/discovery-question.helper.js +3 -14
  384. package/dist/opportunity/discriminator/discriminator.adjustments.d.ts +0 -1
  385. package/dist/opportunity/discriminator/discriminator.adjustments.js +0 -1
  386. package/dist/opportunity/discriminator/discriminator.assigner.d.ts +4 -5
  387. package/dist/opportunity/discriminator/discriminator.assigner.js +0 -1
  388. package/dist/opportunity/discriminator/discriminator.env.d.ts +0 -1
  389. package/dist/opportunity/discriminator/discriminator.env.js +0 -1
  390. package/dist/opportunity/discriminator/discriminator.miner.d.ts +0 -1
  391. package/dist/opportunity/discriminator/discriminator.miner.js +0 -1
  392. package/dist/opportunity/discriminator/discriminator.push.d.ts +0 -1
  393. package/dist/opportunity/discriminator/discriminator.push.js +0 -1
  394. package/dist/opportunity/discriminator/discriminator.question.d.ts +0 -1
  395. package/dist/opportunity/discriminator/discriminator.question.js +0 -1
  396. package/dist/opportunity/discriminator/discriminator.scorer.d.ts +0 -1
  397. package/dist/opportunity/discriminator/discriminator.scorer.js +0 -1
  398. package/dist/opportunity/discriminator/discriminator.shadow.d.ts +0 -1
  399. package/dist/opportunity/discriminator/discriminator.shadow.js +0 -1
  400. package/dist/opportunity/discriminator/discriminator.types.d.ts +0 -1
  401. package/dist/opportunity/discriminator/discriminator.types.js +0 -1
  402. package/dist/opportunity/domain/discovery-question.helper.d.ts +18 -0
  403. package/dist/opportunity/domain/discovery-question.helper.js +15 -0
  404. package/dist/opportunity/domain/index.d.ts +55 -0
  405. package/dist/opportunity/domain/index.js +52 -0
  406. package/dist/opportunity/domain/negotiation-summary.builder.d.ts +37 -0
  407. package/dist/opportunity/domain/negotiation-summary.builder.js +66 -0
  408. package/dist/opportunity/domain/opportunity.actor.d.ts +15 -0
  409. package/dist/opportunity/domain/opportunity.actor.js +39 -0
  410. package/dist/opportunity/domain/opportunity.claim-safety.d.ts +24 -0
  411. package/dist/opportunity/domain/opportunity.claim-safety.js +88 -0
  412. package/dist/opportunity/domain/opportunity.discovery-run-coalescing.d.ts +33 -0
  413. package/dist/opportunity/domain/opportunity.discovery-run-coalescing.js +33 -0
  414. package/dist/opportunity/domain/opportunity.discovery.contracts.d.ts +45 -0
  415. package/dist/opportunity/domain/opportunity.discovery.contracts.js +1 -0
  416. package/dist/opportunity/domain/opportunity.evidence.d.ts +21 -0
  417. package/dist/opportunity/domain/opportunity.evidence.js +78 -0
  418. package/dist/opportunity/domain/opportunity.labels.d.ts +8 -0
  419. package/dist/opportunity/domain/opportunity.labels.js +10 -0
  420. package/dist/opportunity/domain/opportunity.presentation-cache.d.ts +6 -0
  421. package/dist/opportunity/domain/opportunity.presentation-cache.js +14 -0
  422. package/dist/opportunity/domain/opportunity.presentation.d.ts +76 -0
  423. package/dist/opportunity/domain/opportunity.presentation.js +516 -0
  424. package/dist/opportunity/domain/opportunity.safe-presentation.d.ts +104 -0
  425. package/dist/opportunity/domain/opportunity.safe-presentation.js +102 -0
  426. package/dist/opportunity/domain/opportunity.state.d.ts +519 -0
  427. package/dist/opportunity/domain/opportunity.state.js +309 -0
  428. package/dist/opportunity/domain/opportunity.utils.d.ts +217 -0
  429. package/dist/opportunity/domain/opportunity.utils.js +395 -0
  430. package/dist/opportunity/feed/feed.categorizer.d.ts +0 -1
  431. package/dist/opportunity/feed/feed.categorizer.js +0 -1
  432. package/dist/opportunity/feed/feed.graph.d.ts +1 -2
  433. package/dist/opportunity/feed/feed.graph.js +0 -1
  434. package/dist/opportunity/feed/feed.health.d.ts +0 -1
  435. package/dist/opportunity/feed/feed.health.js +0 -1
  436. package/dist/opportunity/feed/feed.state.d.ts +1 -2
  437. package/dist/opportunity/feed/feed.state.js +0 -1
  438. package/dist/opportunity/index.d.ts +37 -0
  439. package/dist/opportunity/index.js +37 -0
  440. package/dist/opportunity/negotiation-context.loader.d.ts +3 -58
  441. package/dist/opportunity/negotiation-context.loader.js +3 -87
  442. package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.d.ts +0 -1
  443. package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.js +0 -1
  444. package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.d.ts +0 -1
  445. package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.js +0 -1
  446. package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.d.ts +0 -1
  447. package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.js +0 -1
  448. package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.d.ts +0 -1
  449. package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.js +0 -1
  450. package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.d.ts +0 -1
  451. package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.js +0 -1
  452. package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.d.ts +0 -1
  453. package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.js +0 -1
  454. package/dist/opportunity/negotiation-summary.builder.d.ts +3 -36
  455. package/dist/opportunity/negotiation-summary.builder.js +3 -65
  456. package/dist/opportunity/opportunity.actor.d.ts +3 -14
  457. package/dist/opportunity/opportunity.actor.js +3 -38
  458. package/dist/opportunity/opportunity.card-presentation.d.ts +5 -0
  459. package/dist/opportunity/opportunity.card-presentation.js +5 -0
  460. package/dist/opportunity/opportunity.claim-safety.d.ts +3 -23
  461. package/dist/opportunity/opportunity.claim-safety.js +3 -87
  462. package/dist/opportunity/opportunity.discover.d.ts +3 -218
  463. package/dist/opportunity/opportunity.discover.js +3 -917
  464. package/dist/opportunity/opportunity.discovery-continuation-finalization.d.ts +5 -0
  465. package/dist/opportunity/opportunity.discovery-continuation-finalization.js +5 -0
  466. package/dist/opportunity/opportunity.discovery-mcp-lifecycle-finalization.d.ts +5 -0
  467. package/dist/opportunity/opportunity.discovery-mcp-lifecycle-finalization.js +5 -0
  468. package/dist/opportunity/opportunity.discovery-negotiation-summary.d.ts +5 -0
  469. package/dist/opportunity/opportunity.discovery-negotiation-summary.js +5 -0
  470. package/dist/opportunity/opportunity.discovery-run-coalescing.d.ts +5 -0
  471. package/dist/opportunity/opportunity.discovery-run-coalescing.js +5 -0
  472. package/dist/opportunity/opportunity.discovery.contracts.d.ts +5 -0
  473. package/dist/opportunity/opportunity.discovery.contracts.js +5 -0
  474. package/dist/opportunity/opportunity.enricher.d.ts +3 -70
  475. package/dist/opportunity/opportunity.enricher.js +3 -279
  476. package/dist/opportunity/opportunity.evaluator.d.ts +5 -276
  477. package/dist/opportunity/opportunity.evaluator.js +5 -460
  478. package/dist/opportunity/opportunity.evidence.d.ts +5 -22
  479. package/dist/opportunity/opportunity.evidence.js +5 -79
  480. package/dist/opportunity/opportunity.existing-negotiation.d.ts +5 -0
  481. package/dist/opportunity/opportunity.existing-negotiation.js +5 -0
  482. package/dist/opportunity/opportunity.feed-selection.d.ts +5 -0
  483. package/dist/opportunity/opportunity.feed-selection.js +5 -0
  484. package/dist/opportunity/opportunity.graph.d.ts +3 -1489
  485. package/dist/opportunity/opportunity.graph.js +3 -4071
  486. package/dist/opportunity/opportunity.introducer.d.ts +3 -76
  487. package/dist/opportunity/opportunity.introducer.js +3 -98
  488. package/dist/opportunity/opportunity.labels.d.ts +5 -9
  489. package/dist/opportunity/opportunity.labels.js +5 -11
  490. package/dist/opportunity/opportunity.lifecycle.d.ts +5 -0
  491. package/dist/opportunity/opportunity.lifecycle.js +5 -0
  492. package/dist/opportunity/opportunity.newborn-stamping.d.ts +5 -0
  493. package/dist/opportunity/opportunity.newborn-stamping.js +5 -0
  494. package/dist/opportunity/opportunity.pending-questions.d.ts +3 -32
  495. package/dist/opportunity/opportunity.pending-questions.js +3 -41
  496. package/dist/opportunity/opportunity.persist.d.ts +3 -57
  497. package/dist/opportunity/opportunity.persist.js +3 -144
  498. package/dist/opportunity/opportunity.persistence-admission.d.ts +5 -0
  499. package/dist/opportunity/opportunity.persistence-admission.js +5 -0
  500. package/dist/opportunity/opportunity.presentation-cache.d.ts +5 -7
  501. package/dist/opportunity/opportunity.presentation-cache.js +5 -15
  502. package/dist/opportunity/opportunity.presentation.d.ts +3 -75
  503. package/dist/opportunity/opportunity.presentation.js +3 -515
  504. package/dist/opportunity/opportunity.presenter.d.ts +10 -155
  505. package/dist/opportunity/opportunity.presenter.js +10 -735
  506. package/dist/opportunity/opportunity.safe-presentation.d.ts +3 -103
  507. package/dist/opportunity/opportunity.safe-presentation.js +3 -101
  508. package/dist/opportunity/opportunity.state.d.ts +3 -518
  509. package/dist/opportunity/opportunity.state.js +3 -308
  510. package/dist/opportunity/opportunity.tools.d.ts +3 -157
  511. package/dist/opportunity/opportunity.tools.js +3 -2238
  512. package/dist/opportunity/opportunity.update-admission.d.ts +5 -0
  513. package/dist/opportunity/opportunity.update-admission.js +5 -0
  514. package/dist/opportunity/opportunity.utils.d.ts +3 -216
  515. package/dist/opportunity/opportunity.utils.js +3 -394
  516. package/dist/opportunity/outcome/outcome.env.d.ts +0 -1
  517. package/dist/opportunity/outcome/outcome.env.js +0 -1
  518. package/dist/opportunity/outcome/outcome.hypotheses.d.ts +0 -1
  519. package/dist/opportunity/outcome/outcome.hypotheses.js +0 -1
  520. package/dist/opportunity/outcome/outcome.shadow.d.ts +0 -1
  521. package/dist/opportunity/outcome/outcome.shadow.js +0 -1
  522. package/dist/opportunity/outcome/outcome.types.d.ts +0 -1
  523. package/dist/opportunity/outcome/outcome.types.js +0 -1
  524. package/dist/opportunity/ports/index.d.ts +5 -0
  525. package/dist/opportunity/ports/index.js +1 -0
  526. package/dist/opportunity/ports/opportunity.tools.port.d.ts +5 -0
  527. package/dist/opportunity/ports/opportunity.tools.port.js +1 -0
  528. package/dist/opportunity/public/index.d.ts +58 -0
  529. package/dist/opportunity/public/index.js +51 -0
  530. package/dist/participant-agents/application/agent.tools.d.ts +16 -0
  531. package/dist/participant-agents/application/agent.tools.js +313 -0
  532. package/dist/participant-agents/application/index.d.ts +21 -0
  533. package/dist/participant-agents/application/index.js +22 -0
  534. package/dist/participant-agents/domain/agent.types.d.ts +76 -0
  535. package/dist/participant-agents/domain/agent.types.js +22 -0
  536. package/dist/participant-agents/domain/index.d.ts +20 -0
  537. package/dist/participant-agents/domain/index.js +1 -0
  538. package/dist/participant-agents/index.d.ts +24 -0
  539. package/dist/participant-agents/index.js +24 -0
  540. package/dist/participant-agents/ports/agent.dispatcher.port.d.ts +25 -0
  541. package/dist/participant-agents/ports/agent.dispatcher.port.js +1 -0
  542. package/dist/participant-agents/ports/agent.repository.port.d.ts +118 -0
  543. package/dist/participant-agents/ports/agent.repository.port.js +10 -0
  544. package/dist/participant-agents/ports/agent.tools.port.d.ts +24 -0
  545. package/dist/participant-agents/ports/agent.tools.port.js +20 -0
  546. package/dist/participant-agents/ports/index.d.ts +29 -0
  547. package/dist/participant-agents/ports/index.js +27 -0
  548. package/dist/participant-agents/public/index.d.ts +39 -0
  549. package/dist/participant-agents/public/index.js +36 -0
  550. package/dist/participant-context/application/index.d.ts +73 -0
  551. package/dist/participant-context/application/index.js +83 -0
  552. package/dist/participant-context/domain/index.d.ts +67 -0
  553. package/dist/participant-context/domain/index.js +68 -0
  554. package/dist/participant-context/index.d.ts +16 -0
  555. package/dist/participant-context/index.js +16 -0
  556. package/dist/participant-context/ports/index.d.ts +37 -0
  557. package/dist/participant-context/ports/index.js +34 -0
  558. package/dist/participant-context/public/index.d.ts +48 -0
  559. package/dist/participant-context/public/index.js +55 -0
  560. package/dist/platform/index.d.ts +19 -0
  561. package/dist/platform/index.js +23 -0
  562. package/dist/premise/premise.analyzer.d.ts +0 -1
  563. package/dist/premise/premise.analyzer.js +0 -2
  564. package/dist/premise/premise.decomposer.d.ts +0 -1
  565. package/dist/premise/premise.decomposer.js +0 -2
  566. package/dist/premise/premise.graph.d.ts +1 -2
  567. package/dist/premise/premise.graph.js +0 -2
  568. package/dist/premise/premise.indexer.d.ts +0 -1
  569. package/dist/premise/premise.indexer.js +0 -2
  570. package/dist/premise/premise.state.d.ts +1 -2
  571. package/dist/premise/premise.state.js +0 -1
  572. package/dist/premise/premise.tools.d.ts +3 -3
  573. package/dist/premise/premise.tools.js +0 -2
  574. package/dist/public/index.d.ts +17 -0
  575. package/dist/public/index.js +17 -0
  576. package/dist/questioner/questioner.agent.d.ts +4 -27
  577. package/dist/questioner/questioner.agent.js +3 -133
  578. package/dist/questioner/questioner.ask.tool.d.ts +3 -12
  579. package/dist/questioner/questioner.ask.tool.js +3 -299
  580. package/dist/questioner/questioner.discovery.prompt.d.ts +3 -7
  581. package/dist/questioner/questioner.discovery.prompt.js +3 -180
  582. package/dist/questioner/questioner.env.d.ts +3 -57
  583. package/dist/questioner/questioner.env.js +3 -93
  584. package/dist/questioner/questioner.presets.d.ts +4 -19
  585. package/dist/questioner/questioner.presets.js +3 -465
  586. package/dist/questioner/questioner.qud.d.ts +3 -6
  587. package/dist/questioner/questioner.qud.js +3 -10
  588. package/dist/questioner/questioner.tools.d.ts +3 -15
  589. package/dist/questioner/questioner.tools.js +3 -186
  590. package/dist/questioner/questioner.types.d.ts +4 -218
  591. package/dist/questioner/questioner.types.js +5 -62
  592. package/dist/questions/application/index.d.ts +39 -0
  593. package/dist/questions/application/index.js +41 -0
  594. package/dist/questions/application/question.agent.d.ts +28 -0
  595. package/dist/questions/application/question.agent.js +139 -0
  596. package/dist/questions/application/question.ask.tool.d.ts +12 -0
  597. package/dist/questions/application/question.ask.tool.js +300 -0
  598. package/dist/questions/application/question.discovery.prompt.d.ts +8 -0
  599. package/dist/questions/application/question.discovery.prompt.js +181 -0
  600. package/dist/questions/application/question.env.d.ts +61 -0
  601. package/dist/questions/application/question.env.js +97 -0
  602. package/dist/questions/application/question.input.d.ts +237 -0
  603. package/dist/questions/application/question.input.js +61 -0
  604. package/dist/questions/application/question.presets.d.ts +24 -0
  605. package/dist/questions/application/question.presets.js +445 -0
  606. package/dist/questions/application/question.qud.d.ts +12 -0
  607. package/dist/questions/application/question.qud.js +16 -0
  608. package/dist/questions/application/question.tools.d.ts +15 -0
  609. package/dist/questions/application/question.tools.js +190 -0
  610. package/dist/questions/domain/index.d.ts +25 -0
  611. package/dist/questions/domain/index.js +25 -0
  612. package/dist/questions/domain/question.schema.d.ts +1537 -0
  613. package/dist/questions/domain/question.schema.js +422 -0
  614. package/dist/questions/index.d.ts +22 -0
  615. package/dist/questions/index.js +22 -0
  616. package/dist/questions/ports/index.d.ts +29 -0
  617. package/dist/questions/ports/index.js +27 -0
  618. package/dist/questions/ports/question.generator.port.d.ts +34 -0
  619. package/dist/questions/ports/question.generator.port.js +1 -0
  620. package/dist/questions/ports/question.persistence.port.d.ts +87 -0
  621. package/dist/questions/ports/question.persistence.port.js +1 -0
  622. package/dist/questions/ports/question.tools.port.d.ts +15 -0
  623. package/dist/questions/ports/question.tools.port.js +1 -0
  624. package/dist/questions/public/index.d.ts +47 -0
  625. package/dist/questions/public/index.js +49 -0
  626. package/dist/runtime/background/index.d.ts +14 -0
  627. package/dist/runtime/background/index.js +14 -0
  628. package/dist/runtime/foreground/composition/tool.factory.d.ts +16 -0
  629. package/dist/runtime/foreground/composition/tool.factory.js +224 -0
  630. package/dist/runtime/foreground/composition/tool.registry.d.ts +11 -0
  631. package/dist/runtime/foreground/composition/tool.registry.js +106 -0
  632. package/dist/runtime/foreground/index.d.ts +13 -0
  633. package/dist/runtime/foreground/index.js +13 -0
  634. package/dist/runtime/foreground/signals/intent.tools.d.ts +13 -0
  635. package/dist/runtime/foreground/signals/intent.tools.js +13 -0
  636. package/dist/shared/agent/model-signal.d.ts +0 -1
  637. package/dist/shared/agent/model-signal.js +0 -1
  638. package/dist/shared/agent/model.config.d.ts +0 -1
  639. package/dist/shared/agent/model.config.js +0 -1
  640. package/dist/shared/agent/tool.factory.d.ts +4 -15
  641. package/dist/shared/agent/tool.factory.js +4 -226
  642. package/dist/shared/agent/tool.helpers.d.ts +51 -12
  643. package/dist/shared/agent/tool.helpers.js +0 -1
  644. package/dist/shared/agent/tool.registry.d.ts +9 -9
  645. package/dist/shared/agent/tool.registry.js +9 -104
  646. package/dist/shared/agent/tool.runtime.d.ts +0 -1
  647. package/dist/shared/agent/tool.runtime.js +0 -1
  648. package/dist/shared/agent/tool.scope.d.ts +0 -1
  649. package/dist/shared/agent/tool.scope.js +0 -1
  650. package/dist/shared/agent/utility.tools.d.ts +5 -3
  651. package/dist/shared/agent/utility.tools.js +0 -1
  652. package/dist/shared/assignment/network-assignment.policy.d.ts +0 -1
  653. package/dist/shared/assignment/network-assignment.policy.js +0 -1
  654. package/dist/shared/hyde/hyde.documents.d.ts +0 -1
  655. package/dist/shared/hyde/hyde.documents.js +0 -1
  656. package/dist/shared/hyde/hyde.env.d.ts +0 -1
  657. package/dist/shared/hyde/hyde.env.js +0 -1
  658. package/dist/shared/hyde/hyde.frame.d.ts +4 -5
  659. package/dist/shared/hyde/hyde.frame.js +0 -1
  660. package/dist/shared/hyde/hyde.generator.d.ts +0 -1
  661. package/dist/shared/hyde/hyde.generator.js +0 -1
  662. package/dist/shared/hyde/hyde.graph.d.ts +0 -1
  663. package/dist/shared/hyde/hyde.graph.js +0 -1
  664. package/dist/shared/hyde/hyde.state.d.ts +0 -1
  665. package/dist/shared/hyde/hyde.state.js +0 -1
  666. package/dist/shared/hyde/hyde.strategies.d.ts +0 -1
  667. package/dist/shared/hyde/hyde.strategies.js +0 -1
  668. package/dist/shared/hyde/hyde.validator.d.ts +0 -1
  669. package/dist/shared/hyde/hyde.validator.js +0 -1
  670. package/dist/shared/hyde/lens.inferrer.d.ts +6 -7
  671. package/dist/shared/hyde/lens.inferrer.js +0 -1
  672. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +4 -1
  673. package/dist/shared/interfaces/agent-dispatcher.interface.js +4 -1
  674. package/dist/shared/interfaces/agent.interface.d.ts +13 -173
  675. package/dist/shared/interfaces/agent.interface.js +12 -12
  676. package/dist/shared/interfaces/auth.interface.d.ts +0 -1
  677. package/dist/shared/interfaces/auth.interface.js +0 -1
  678. package/dist/shared/interfaces/cache.interface.d.ts +0 -1
  679. package/dist/shared/interfaces/cache.interface.js +0 -1
  680. package/dist/shared/interfaces/chat-message-writer.interface.d.ts +0 -1
  681. package/dist/shared/interfaces/chat-message-writer.interface.js +0 -1
  682. package/dist/shared/interfaces/chat-session.interface.d.ts +0 -1
  683. package/dist/shared/interfaces/chat-session.interface.js +0 -1
  684. package/dist/shared/interfaces/chat-summary.interface.d.ts +0 -1
  685. package/dist/shared/interfaces/chat-summary.interface.js +0 -1
  686. package/dist/shared/interfaces/connect-link.interface.d.ts +0 -1
  687. package/dist/shared/interfaces/connect-link.interface.js +0 -1
  688. package/dist/shared/interfaces/contact.interface.d.ts +7 -55
  689. package/dist/shared/interfaces/contact.interface.js +7 -1
  690. package/dist/shared/interfaces/database.interface.d.ts +0 -1
  691. package/dist/shared/interfaces/database.interface.js +0 -1
  692. package/dist/shared/interfaces/delivery-ledger.interface.d.ts +0 -1
  693. package/dist/shared/interfaces/delivery-ledger.interface.js +0 -1
  694. package/dist/shared/interfaces/discovery-run.interface.d.ts +2 -3
  695. package/dist/shared/interfaces/discovery-run.interface.js +0 -1
  696. package/dist/shared/interfaces/embedder.interface.d.ts +0 -1
  697. package/dist/shared/interfaces/embedder.interface.js +0 -1
  698. package/dist/shared/interfaces/enrichment-run.interface.d.ts +2 -3
  699. package/dist/shared/interfaces/enrichment-run.interface.js +0 -1
  700. package/dist/shared/interfaces/enrichment.interface.d.ts +0 -1
  701. package/dist/shared/interfaces/enrichment.interface.js +0 -1
  702. package/dist/shared/interfaces/integration.interface.d.ts +6 -88
  703. package/dist/shared/interfaces/integration.interface.js +7 -1
  704. package/dist/shared/interfaces/negotiation-events.interface.d.ts +0 -1
  705. package/dist/shared/interfaces/negotiation-events.interface.js +0 -1
  706. package/dist/shared/interfaces/negotiation-summary.interface.d.ts +0 -1
  707. package/dist/shared/interfaces/negotiation-summary.interface.js +0 -1
  708. package/dist/shared/interfaces/negotiator-memory.interface.d.ts +0 -1
  709. package/dist/shared/interfaces/negotiator-memory.interface.js +0 -1
  710. package/dist/shared/interfaces/question-generator.interface.d.ts +3 -28
  711. package/dist/shared/interfaces/question-generator.interface.js +0 -1
  712. package/dist/shared/interfaces/questioner.interface.d.ts +3 -77
  713. package/dist/shared/interfaces/questioner.interface.js +0 -1
  714. package/dist/shared/interfaces/queue.interface.d.ts +0 -1
  715. package/dist/shared/interfaces/queue.interface.js +0 -1
  716. package/dist/shared/interfaces/scraper.interface.d.ts +0 -1
  717. package/dist/shared/interfaces/scraper.interface.js +0 -1
  718. package/dist/shared/interfaces/tool-request-context.interface.d.ts +12 -0
  719. package/dist/shared/interfaces/tool-request-context.interface.js +1 -0
  720. package/dist/shared/network/metadata.renderer.d.ts +0 -1
  721. package/dist/shared/network/metadata.renderer.js +0 -1
  722. package/dist/shared/observability/debug-meta.sanitizer.d.ts +0 -1
  723. package/dist/shared/observability/debug-meta.sanitizer.js +0 -1
  724. package/dist/shared/observability/log.d.ts +0 -1
  725. package/dist/shared/observability/log.js +0 -1
  726. package/dist/shared/observability/performance.d.ts +0 -1
  727. package/dist/shared/observability/performance.js +0 -1
  728. package/dist/shared/observability/protocol.logger.d.ts +0 -1
  729. package/dist/shared/observability/protocol.logger.js +0 -1
  730. package/dist/shared/observability/request-context.d.ts +0 -1
  731. package/dist/shared/observability/request-context.js +0 -1
  732. package/dist/shared/observability/trace.d.ts +0 -1
  733. package/dist/shared/observability/trace.js +0 -1
  734. package/dist/shared/schemas/chat-context.schema.d.ts +0 -1
  735. package/dist/shared/schemas/chat-context.schema.js +0 -1
  736. package/dist/shared/schemas/discovery-question.schema.d.ts +17 -18
  737. package/dist/shared/schemas/discovery-question.schema.js +0 -1
  738. package/dist/shared/schemas/identity.schema.d.ts +0 -1
  739. package/dist/shared/schemas/identity.schema.js +0 -1
  740. package/dist/shared/schemas/mcp-auth.schema.d.ts +0 -1
  741. package/dist/shared/schemas/mcp-auth.schema.js +0 -1
  742. package/dist/shared/schemas/negotiation-digest.schema.d.ts +5 -6
  743. package/dist/shared/schemas/negotiation-digest.schema.js +0 -1
  744. package/dist/shared/schemas/negotiation-state.schema.d.ts +4 -5
  745. package/dist/shared/schemas/negotiation-state.schema.js +0 -1
  746. package/dist/shared/schemas/network-assignment.schema.d.ts +0 -1
  747. package/dist/shared/schemas/network-assignment.schema.js +0 -1
  748. package/dist/shared/schemas/pending-question.schema.d.ts +0 -1
  749. package/dist/shared/schemas/pending-question.schema.js +0 -1
  750. package/dist/shared/schemas/question.schema.d.ts +3 -1535
  751. package/dist/shared/schemas/question.schema.js +3 -420
  752. package/dist/shared/ui/lucide.icon-catalog.d.ts +0 -1
  753. package/dist/shared/ui/lucide.icon-catalog.js +0 -1
  754. package/dist/shared/utils/social-label.d.ts +0 -1
  755. package/dist/shared/utils/social-label.js +0 -1
  756. package/dist/shared/utils/telegram-handle.d.ts +0 -1
  757. package/dist/shared/utils/telegram-handle.js +0 -1
  758. package/dist/signals/application/index.d.ts +19 -0
  759. package/dist/signals/application/index.js +22 -0
  760. package/dist/signals/application/intent.clarifier.d.ts +51 -0
  761. package/dist/signals/application/intent.clarifier.js +201 -0
  762. package/dist/signals/application/intent.graph.d.ts +552 -0
  763. package/dist/signals/application/intent.graph.js +938 -0
  764. package/dist/signals/application/intent.indexer.d.ts +82 -0
  765. package/dist/signals/application/intent.indexer.js +170 -0
  766. package/dist/signals/application/intent.inferrer.d.ts +94 -0
  767. package/dist/signals/application/intent.inferrer.js +233 -0
  768. package/dist/signals/application/intent.reconciler.d.ts +105 -0
  769. package/dist/signals/application/intent.reconciler.js +186 -0
  770. package/dist/signals/application/intent.tools.d.ts +24 -0
  771. package/dist/signals/application/intent.tools.js +789 -0
  772. package/dist/signals/application/intent.verifier.d.ts +115 -0
  773. package/dist/signals/application/intent.verifier.js +262 -0
  774. package/dist/signals/domain/index.d.ts +9 -0
  775. package/dist/signals/domain/index.js +11 -0
  776. package/dist/signals/domain/intent.state.d.ts +230 -0
  777. package/dist/signals/domain/intent.state.js +190 -0
  778. package/dist/signals/domain/signal.specificity.d.ts +2 -0
  779. package/dist/signals/domain/signal.specificity.js +2 -0
  780. package/dist/signals/index.d.ts +13 -0
  781. package/dist/signals/index.js +13 -0
  782. package/dist/signals/ports/index.d.ts +15 -0
  783. package/dist/signals/ports/index.js +13 -0
  784. package/dist/signals/public/index.d.ts +15 -0
  785. package/dist/signals/public/index.js +16 -0
  786. package/package.json +14 -3
  787. package/dist/agent/agent.tools.d.ts.map +0 -1
  788. package/dist/agent/agent.tools.js.map +0 -1
  789. package/dist/agent/tests/fakes.d.ts +0 -25
  790. package/dist/agent/tests/fakes.d.ts.map +0 -1
  791. package/dist/agent/tests/fakes.js +0 -178
  792. package/dist/agent/tests/fakes.js.map +0 -1
  793. package/dist/chat/chat-streaming.types.d.ts.map +0 -1
  794. package/dist/chat/chat-streaming.types.js.map +0 -1
  795. package/dist/chat/chat.agent.d.ts.map +0 -1
  796. package/dist/chat/chat.agent.js.map +0 -1
  797. package/dist/chat/chat.graph.d.ts.map +0 -1
  798. package/dist/chat/chat.graph.js.map +0 -1
  799. package/dist/chat/chat.interrupt.classifier.d.ts.map +0 -1
  800. package/dist/chat/chat.interrupt.classifier.js.map +0 -1
  801. package/dist/chat/chat.persona.d.ts.map +0 -1
  802. package/dist/chat/chat.persona.js.map +0 -1
  803. package/dist/chat/chat.prompt.d.ts.map +0 -1
  804. package/dist/chat/chat.prompt.js.map +0 -1
  805. package/dist/chat/chat.prompt.modules.d.ts.map +0 -1
  806. package/dist/chat/chat.prompt.modules.js.map +0 -1
  807. package/dist/chat/chat.question-dedup.d.ts.map +0 -1
  808. package/dist/chat/chat.question-dedup.js.map +0 -1
  809. package/dist/chat/chat.state.d.ts.map +0 -1
  810. package/dist/chat/chat.state.js.map +0 -1
  811. package/dist/chat/chat.streamer.d.ts.map +0 -1
  812. package/dist/chat/chat.streamer.js.map +0 -1
  813. package/dist/chat/chat.suggester.d.ts.map +0 -1
  814. package/dist/chat/chat.suggester.js.map +0 -1
  815. package/dist/chat/chat.summarizer.d.ts.map +0 -1
  816. package/dist/chat/chat.summarizer.js.map +0 -1
  817. package/dist/chat/chat.title.generator.d.ts.map +0 -1
  818. package/dist/chat/chat.title.generator.js.map +0 -1
  819. package/dist/chat/chat.tools.d.ts.map +0 -1
  820. package/dist/chat/chat.tools.js.map +0 -1
  821. package/dist/chat/chat.utils.d.ts.map +0 -1
  822. package/dist/chat/chat.utils.js.map +0 -1
  823. package/dist/chat/negotiator.persona.d.ts.map +0 -1
  824. package/dist/chat/negotiator.persona.js.map +0 -1
  825. package/dist/chat/negotiator.prompt.d.ts.map +0 -1
  826. package/dist/chat/negotiator.prompt.js.map +0 -1
  827. package/dist/chat/negotiator.tools.d.ts.map +0 -1
  828. package/dist/chat/negotiator.tools.js.map +0 -1
  829. package/dist/chat/onboarding.persona.d.ts.map +0 -1
  830. package/dist/chat/onboarding.persona.js.map +0 -1
  831. package/dist/chat/onboarding.prompt.d.ts.map +0 -1
  832. package/dist/chat/onboarding.prompt.js.map +0 -1
  833. package/dist/chat/reporter.action.tools.d.ts.map +0 -1
  834. package/dist/chat/reporter.action.tools.js.map +0 -1
  835. package/dist/chat/reporter.persona.d.ts.map +0 -1
  836. package/dist/chat/reporter.persona.js.map +0 -1
  837. package/dist/chat/reporter.prompt.d.ts.map +0 -1
  838. package/dist/chat/reporter.prompt.js.map +0 -1
  839. package/dist/chat/signal.persona.d.ts.map +0 -1
  840. package/dist/chat/signal.persona.js.map +0 -1
  841. package/dist/chat/signal.prompt.d.ts.map +0 -1
  842. package/dist/chat/signal.prompt.js.map +0 -1
  843. package/dist/chat/tests/chat.graph.mocks.d.ts +0 -98
  844. package/dist/chat/tests/chat.graph.mocks.d.ts.map +0 -1
  845. package/dist/chat/tests/chat.graph.mocks.js +0 -225
  846. package/dist/chat/tests/chat.graph.mocks.js.map +0 -1
  847. package/dist/contact/contact.inviter.d.ts.map +0 -1
  848. package/dist/contact/contact.inviter.js.map +0 -1
  849. package/dist/contact/contact.tools.d.ts.map +0 -1
  850. package/dist/contact/contact.tools.js.map +0 -1
  851. package/dist/context/context.generator.d.ts.map +0 -1
  852. package/dist/context/context.generator.js.map +0 -1
  853. package/dist/enrichment/enrichment.enricher.d.ts.map +0 -1
  854. package/dist/enrichment/enrichment.enricher.js.map +0 -1
  855. package/dist/enrichment/enrichment.generator.d.ts.map +0 -1
  856. package/dist/enrichment/enrichment.generator.js.map +0 -1
  857. package/dist/enrichment/enrichment.graph.d.ts.map +0 -1
  858. package/dist/enrichment/enrichment.graph.js.map +0 -1
  859. package/dist/enrichment/enrichment.state.d.ts.map +0 -1
  860. package/dist/enrichment/enrichment.state.js.map +0 -1
  861. package/dist/enrichment/enrichment.tools.d.ts.map +0 -1
  862. package/dist/enrichment/enrichment.tools.js.map +0 -1
  863. package/dist/index.d.ts.map +0 -1
  864. package/dist/index.js.map +0 -1
  865. package/dist/integration/integration.tools.d.ts.map +0 -1
  866. package/dist/integration/integration.tools.js.map +0 -1
  867. package/dist/intent/intent.clarifier.d.ts.map +0 -1
  868. package/dist/intent/intent.clarifier.js.map +0 -1
  869. package/dist/intent/intent.graph.d.ts.map +0 -1
  870. package/dist/intent/intent.graph.js.map +0 -1
  871. package/dist/intent/intent.indexer.d.ts.map +0 -1
  872. package/dist/intent/intent.indexer.js.map +0 -1
  873. package/dist/intent/intent.inferrer.d.ts.map +0 -1
  874. package/dist/intent/intent.inferrer.js.map +0 -1
  875. package/dist/intent/intent.reconciler.d.ts.map +0 -1
  876. package/dist/intent/intent.reconciler.js.map +0 -1
  877. package/dist/intent/intent.specificity.d.ts.map +0 -1
  878. package/dist/intent/intent.specificity.js.map +0 -1
  879. package/dist/intent/intent.state.d.ts.map +0 -1
  880. package/dist/intent/intent.state.js.map +0 -1
  881. package/dist/intent/intent.tools.d.ts.map +0 -1
  882. package/dist/intent/intent.tools.js.map +0 -1
  883. package/dist/intent/intent.verifier.d.ts.map +0 -1
  884. package/dist/intent/intent.verifier.js.map +0 -1
  885. package/dist/maintenance/maintenance.graph.d.ts.map +0 -1
  886. package/dist/maintenance/maintenance.graph.js.map +0 -1
  887. package/dist/maintenance/maintenance.state.d.ts.map +0 -1
  888. package/dist/maintenance/maintenance.state.js.map +0 -1
  889. package/dist/mcp/elicitation.builder.d.ts.map +0 -1
  890. package/dist/mcp/elicitation.builder.js.map +0 -1
  891. package/dist/mcp/elicitation.dispatcher.d.ts.map +0 -1
  892. package/dist/mcp/elicitation.dispatcher.js.map +0 -1
  893. package/dist/mcp/mcp.server.d.ts.map +0 -1
  894. package/dist/mcp/mcp.server.js.map +0 -1
  895. package/dist/negotiation/insight.generator.d.ts.map +0 -1
  896. package/dist/negotiation/insight.generator.js.map +0 -1
  897. package/dist/negotiation/negotiation.agent.d.ts.map +0 -1
  898. package/dist/negotiation/negotiation.agent.js.map +0 -1
  899. package/dist/negotiation/negotiation.attribution.d.ts.map +0 -1
  900. package/dist/negotiation/negotiation.attribution.js.map +0 -1
  901. package/dist/negotiation/negotiation.consultation-policy.d.ts.map +0 -1
  902. package/dist/negotiation/negotiation.consultation-policy.js.map +0 -1
  903. package/dist/negotiation/negotiation.deadlock.d.ts.map +0 -1
  904. package/dist/negotiation/negotiation.deadlock.js.map +0 -1
  905. package/dist/negotiation/negotiation.graph.d.ts.map +0 -1
  906. package/dist/negotiation/negotiation.graph.js.map +0 -1
  907. package/dist/negotiation/negotiation.memory.d.ts.map +0 -1
  908. package/dist/negotiation/negotiation.memory.js.map +0 -1
  909. package/dist/negotiation/negotiation.protocol.d.ts.map +0 -1
  910. package/dist/negotiation/negotiation.protocol.js.map +0 -1
  911. package/dist/negotiation/negotiation.question-safety.d.ts.map +0 -1
  912. package/dist/negotiation/negotiation.question-safety.js.map +0 -1
  913. package/dist/negotiation/negotiation.reflect.d.ts.map +0 -1
  914. package/dist/negotiation/negotiation.reflect.js.map +0 -1
  915. package/dist/negotiation/negotiation.screen.d.ts.map +0 -1
  916. package/dist/negotiation/negotiation.screen.js.map +0 -1
  917. package/dist/negotiation/negotiation.state.d.ts.map +0 -1
  918. package/dist/negotiation/negotiation.state.js.map +0 -1
  919. package/dist/negotiation/negotiation.summarizer.d.ts.map +0 -1
  920. package/dist/negotiation/negotiation.summarizer.js.map +0 -1
  921. package/dist/negotiation/negotiation.tools.d.ts.map +0 -1
  922. package/dist/negotiation/negotiation.tools.js.map +0 -1
  923. package/dist/network/indexer/indexer.graph.d.ts.map +0 -1
  924. package/dist/network/indexer/indexer.graph.js.map +0 -1
  925. package/dist/network/indexer/indexer.state.d.ts.map +0 -1
  926. package/dist/network/indexer/indexer.state.js.map +0 -1
  927. package/dist/network/membership/membership.graph.d.ts.map +0 -1
  928. package/dist/network/membership/membership.graph.js.map +0 -1
  929. package/dist/network/membership/membership.state.d.ts.map +0 -1
  930. package/dist/network/membership/membership.state.js.map +0 -1
  931. package/dist/network/network.graph.d.ts.map +0 -1
  932. package/dist/network/network.graph.js.map +0 -1
  933. package/dist/network/network.recommender.d.ts.map +0 -1
  934. package/dist/network/network.recommender.js.map +0 -1
  935. package/dist/network/network.state.d.ts.map +0 -1
  936. package/dist/network/network.state.js.map +0 -1
  937. package/dist/network/network.tools.d.ts.map +0 -1
  938. package/dist/network/network.tools.js.map +0 -1
  939. package/dist/opportunity/delivery-card.cache.d.ts.map +0 -1
  940. package/dist/opportunity/delivery-card.cache.js.map +0 -1
  941. package/dist/opportunity/discovery-question.helper.d.ts.map +0 -1
  942. package/dist/opportunity/discovery-question.helper.js.map +0 -1
  943. package/dist/opportunity/discriminator/discriminator.adjustments.d.ts.map +0 -1
  944. package/dist/opportunity/discriminator/discriminator.adjustments.js.map +0 -1
  945. package/dist/opportunity/discriminator/discriminator.assigner.d.ts.map +0 -1
  946. package/dist/opportunity/discriminator/discriminator.assigner.js.map +0 -1
  947. package/dist/opportunity/discriminator/discriminator.env.d.ts.map +0 -1
  948. package/dist/opportunity/discriminator/discriminator.env.js.map +0 -1
  949. package/dist/opportunity/discriminator/discriminator.miner.d.ts.map +0 -1
  950. package/dist/opportunity/discriminator/discriminator.miner.js.map +0 -1
  951. package/dist/opportunity/discriminator/discriminator.push.d.ts.map +0 -1
  952. package/dist/opportunity/discriminator/discriminator.push.js.map +0 -1
  953. package/dist/opportunity/discriminator/discriminator.question.d.ts.map +0 -1
  954. package/dist/opportunity/discriminator/discriminator.question.js.map +0 -1
  955. package/dist/opportunity/discriminator/discriminator.scorer.d.ts.map +0 -1
  956. package/dist/opportunity/discriminator/discriminator.scorer.js.map +0 -1
  957. package/dist/opportunity/discriminator/discriminator.shadow.d.ts.map +0 -1
  958. package/dist/opportunity/discriminator/discriminator.shadow.js.map +0 -1
  959. package/dist/opportunity/discriminator/discriminator.types.d.ts.map +0 -1
  960. package/dist/opportunity/discriminator/discriminator.types.js.map +0 -1
  961. package/dist/opportunity/feed/feed.categorizer.d.ts.map +0 -1
  962. package/dist/opportunity/feed/feed.categorizer.js.map +0 -1
  963. package/dist/opportunity/feed/feed.graph.d.ts.map +0 -1
  964. package/dist/opportunity/feed/feed.graph.js.map +0 -1
  965. package/dist/opportunity/feed/feed.health.d.ts.map +0 -1
  966. package/dist/opportunity/feed/feed.health.js.map +0 -1
  967. package/dist/opportunity/feed/feed.state.d.ts.map +0 -1
  968. package/dist/opportunity/feed/feed.state.js.map +0 -1
  969. package/dist/opportunity/negotiation-context.loader.d.ts.map +0 -1
  970. package/dist/opportunity/negotiation-context.loader.js.map +0 -1
  971. package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.d.ts.map +0 -1
  972. package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.js.map +0 -1
  973. package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.d.ts.map +0 -1
  974. package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.js.map +0 -1
  975. package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.d.ts.map +0 -1
  976. package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.js.map +0 -1
  977. package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.d.ts.map +0 -1
  978. package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.js.map +0 -1
  979. package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.d.ts.map +0 -1
  980. package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.js.map +0 -1
  981. package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.d.ts.map +0 -1
  982. package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.js.map +0 -1
  983. package/dist/opportunity/negotiation-summary.builder.d.ts.map +0 -1
  984. package/dist/opportunity/negotiation-summary.builder.js.map +0 -1
  985. package/dist/opportunity/opportunity.actor.d.ts.map +0 -1
  986. package/dist/opportunity/opportunity.actor.js.map +0 -1
  987. package/dist/opportunity/opportunity.claim-safety.d.ts.map +0 -1
  988. package/dist/opportunity/opportunity.claim-safety.js.map +0 -1
  989. package/dist/opportunity/opportunity.discover.d.ts.map +0 -1
  990. package/dist/opportunity/opportunity.discover.js.map +0 -1
  991. package/dist/opportunity/opportunity.enricher.d.ts.map +0 -1
  992. package/dist/opportunity/opportunity.enricher.js.map +0 -1
  993. package/dist/opportunity/opportunity.evaluator.d.ts.map +0 -1
  994. package/dist/opportunity/opportunity.evaluator.js.map +0 -1
  995. package/dist/opportunity/opportunity.evidence.d.ts.map +0 -1
  996. package/dist/opportunity/opportunity.evidence.js.map +0 -1
  997. package/dist/opportunity/opportunity.graph.d.ts.map +0 -1
  998. package/dist/opportunity/opportunity.graph.js.map +0 -1
  999. package/dist/opportunity/opportunity.introducer.d.ts.map +0 -1
  1000. package/dist/opportunity/opportunity.introducer.js.map +0 -1
  1001. package/dist/opportunity/opportunity.labels.d.ts.map +0 -1
  1002. package/dist/opportunity/opportunity.labels.js.map +0 -1
  1003. package/dist/opportunity/opportunity.pending-questions.d.ts.map +0 -1
  1004. package/dist/opportunity/opportunity.pending-questions.js.map +0 -1
  1005. package/dist/opportunity/opportunity.persist.d.ts.map +0 -1
  1006. package/dist/opportunity/opportunity.persist.js.map +0 -1
  1007. package/dist/opportunity/opportunity.presentation-cache.d.ts.map +0 -1
  1008. package/dist/opportunity/opportunity.presentation-cache.js.map +0 -1
  1009. package/dist/opportunity/opportunity.presentation.d.ts.map +0 -1
  1010. package/dist/opportunity/opportunity.presentation.js.map +0 -1
  1011. package/dist/opportunity/opportunity.presenter.d.ts.map +0 -1
  1012. package/dist/opportunity/opportunity.presenter.js.map +0 -1
  1013. package/dist/opportunity/opportunity.safe-presentation.d.ts.map +0 -1
  1014. package/dist/opportunity/opportunity.safe-presentation.js.map +0 -1
  1015. package/dist/opportunity/opportunity.state.d.ts.map +0 -1
  1016. package/dist/opportunity/opportunity.state.js.map +0 -1
  1017. package/dist/opportunity/opportunity.tools.d.ts.map +0 -1
  1018. package/dist/opportunity/opportunity.tools.js.map +0 -1
  1019. package/dist/opportunity/opportunity.utils.d.ts.map +0 -1
  1020. package/dist/opportunity/opportunity.utils.js.map +0 -1
  1021. package/dist/opportunity/outcome/outcome.env.d.ts.map +0 -1
  1022. package/dist/opportunity/outcome/outcome.env.js.map +0 -1
  1023. package/dist/opportunity/outcome/outcome.hypotheses.d.ts.map +0 -1
  1024. package/dist/opportunity/outcome/outcome.hypotheses.js.map +0 -1
  1025. package/dist/opportunity/outcome/outcome.shadow.d.ts.map +0 -1
  1026. package/dist/opportunity/outcome/outcome.shadow.js.map +0 -1
  1027. package/dist/opportunity/outcome/outcome.types.d.ts.map +0 -1
  1028. package/dist/opportunity/outcome/outcome.types.js.map +0 -1
  1029. package/dist/premise/premise.analyzer.d.ts.map +0 -1
  1030. package/dist/premise/premise.analyzer.js.map +0 -1
  1031. package/dist/premise/premise.decomposer.d.ts.map +0 -1
  1032. package/dist/premise/premise.decomposer.js.map +0 -1
  1033. package/dist/premise/premise.graph.d.ts.map +0 -1
  1034. package/dist/premise/premise.graph.js.map +0 -1
  1035. package/dist/premise/premise.indexer.d.ts.map +0 -1
  1036. package/dist/premise/premise.indexer.js.map +0 -1
  1037. package/dist/premise/premise.state.d.ts.map +0 -1
  1038. package/dist/premise/premise.state.js.map +0 -1
  1039. package/dist/premise/premise.tools.d.ts.map +0 -1
  1040. package/dist/premise/premise.tools.js.map +0 -1
  1041. package/dist/questioner/questioner.agent.d.ts.map +0 -1
  1042. package/dist/questioner/questioner.agent.js.map +0 -1
  1043. package/dist/questioner/questioner.ask.tool.d.ts.map +0 -1
  1044. package/dist/questioner/questioner.ask.tool.js.map +0 -1
  1045. package/dist/questioner/questioner.discovery.prompt.d.ts.map +0 -1
  1046. package/dist/questioner/questioner.discovery.prompt.js.map +0 -1
  1047. package/dist/questioner/questioner.env.d.ts.map +0 -1
  1048. package/dist/questioner/questioner.env.js.map +0 -1
  1049. package/dist/questioner/questioner.presets.d.ts.map +0 -1
  1050. package/dist/questioner/questioner.presets.js.map +0 -1
  1051. package/dist/questioner/questioner.qud.d.ts.map +0 -1
  1052. package/dist/questioner/questioner.qud.js.map +0 -1
  1053. package/dist/questioner/questioner.tools.d.ts.map +0 -1
  1054. package/dist/questioner/questioner.tools.js.map +0 -1
  1055. package/dist/questioner/questioner.types.d.ts.map +0 -1
  1056. package/dist/questioner/questioner.types.js.map +0 -1
  1057. package/dist/shared/agent/model-signal.d.ts.map +0 -1
  1058. package/dist/shared/agent/model-signal.js.map +0 -1
  1059. package/dist/shared/agent/model.config.d.ts.map +0 -1
  1060. package/dist/shared/agent/model.config.js.map +0 -1
  1061. package/dist/shared/agent/tests/llm-assert.d.ts +0 -11
  1062. package/dist/shared/agent/tests/llm-assert.d.ts.map +0 -1
  1063. package/dist/shared/agent/tests/llm-assert.js +0 -43
  1064. package/dist/shared/agent/tests/llm-assert.js.map +0 -1
  1065. package/dist/shared/agent/tool.factory.d.ts.map +0 -1
  1066. package/dist/shared/agent/tool.factory.js.map +0 -1
  1067. package/dist/shared/agent/tool.helpers.d.ts.map +0 -1
  1068. package/dist/shared/agent/tool.helpers.js.map +0 -1
  1069. package/dist/shared/agent/tool.registry.d.ts.map +0 -1
  1070. package/dist/shared/agent/tool.registry.js.map +0 -1
  1071. package/dist/shared/agent/tool.runtime.d.ts.map +0 -1
  1072. package/dist/shared/agent/tool.runtime.js.map +0 -1
  1073. package/dist/shared/agent/tool.scope.d.ts.map +0 -1
  1074. package/dist/shared/agent/tool.scope.js.map +0 -1
  1075. package/dist/shared/agent/utility.tools.d.ts.map +0 -1
  1076. package/dist/shared/agent/utility.tools.js.map +0 -1
  1077. package/dist/shared/assignment/network-assignment.policy.d.ts.map +0 -1
  1078. package/dist/shared/assignment/network-assignment.policy.js.map +0 -1
  1079. package/dist/shared/hyde/hyde.documents.d.ts.map +0 -1
  1080. package/dist/shared/hyde/hyde.documents.js.map +0 -1
  1081. package/dist/shared/hyde/hyde.env.d.ts.map +0 -1
  1082. package/dist/shared/hyde/hyde.env.js.map +0 -1
  1083. package/dist/shared/hyde/hyde.frame.d.ts.map +0 -1
  1084. package/dist/shared/hyde/hyde.frame.js.map +0 -1
  1085. package/dist/shared/hyde/hyde.generator.d.ts.map +0 -1
  1086. package/dist/shared/hyde/hyde.generator.js.map +0 -1
  1087. package/dist/shared/hyde/hyde.graph.d.ts.map +0 -1
  1088. package/dist/shared/hyde/hyde.graph.js.map +0 -1
  1089. package/dist/shared/hyde/hyde.state.d.ts.map +0 -1
  1090. package/dist/shared/hyde/hyde.state.js.map +0 -1
  1091. package/dist/shared/hyde/hyde.strategies.d.ts.map +0 -1
  1092. package/dist/shared/hyde/hyde.strategies.js.map +0 -1
  1093. package/dist/shared/hyde/hyde.validator.d.ts.map +0 -1
  1094. package/dist/shared/hyde/hyde.validator.js.map +0 -1
  1095. package/dist/shared/hyde/lens.inferrer.d.ts.map +0 -1
  1096. package/dist/shared/hyde/lens.inferrer.js.map +0 -1
  1097. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts.map +0 -1
  1098. package/dist/shared/interfaces/agent-dispatcher.interface.js.map +0 -1
  1099. package/dist/shared/interfaces/agent.interface.d.ts.map +0 -1
  1100. package/dist/shared/interfaces/agent.interface.js.map +0 -1
  1101. package/dist/shared/interfaces/auth.interface.d.ts.map +0 -1
  1102. package/dist/shared/interfaces/auth.interface.js.map +0 -1
  1103. package/dist/shared/interfaces/cache.interface.d.ts.map +0 -1
  1104. package/dist/shared/interfaces/cache.interface.js.map +0 -1
  1105. package/dist/shared/interfaces/chat-message-writer.interface.d.ts.map +0 -1
  1106. package/dist/shared/interfaces/chat-message-writer.interface.js.map +0 -1
  1107. package/dist/shared/interfaces/chat-session.interface.d.ts.map +0 -1
  1108. package/dist/shared/interfaces/chat-session.interface.js.map +0 -1
  1109. package/dist/shared/interfaces/chat-summary.interface.d.ts.map +0 -1
  1110. package/dist/shared/interfaces/chat-summary.interface.js.map +0 -1
  1111. package/dist/shared/interfaces/connect-link.interface.d.ts.map +0 -1
  1112. package/dist/shared/interfaces/connect-link.interface.js.map +0 -1
  1113. package/dist/shared/interfaces/contact.interface.d.ts.map +0 -1
  1114. package/dist/shared/interfaces/contact.interface.js.map +0 -1
  1115. package/dist/shared/interfaces/database.interface.d.ts.map +0 -1
  1116. package/dist/shared/interfaces/database.interface.js.map +0 -1
  1117. package/dist/shared/interfaces/delivery-ledger.interface.d.ts.map +0 -1
  1118. package/dist/shared/interfaces/delivery-ledger.interface.js.map +0 -1
  1119. package/dist/shared/interfaces/discovery-run.interface.d.ts.map +0 -1
  1120. package/dist/shared/interfaces/discovery-run.interface.js.map +0 -1
  1121. package/dist/shared/interfaces/embedder.interface.d.ts.map +0 -1
  1122. package/dist/shared/interfaces/embedder.interface.js.map +0 -1
  1123. package/dist/shared/interfaces/enrichment-run.interface.d.ts.map +0 -1
  1124. package/dist/shared/interfaces/enrichment-run.interface.js.map +0 -1
  1125. package/dist/shared/interfaces/enrichment.interface.d.ts.map +0 -1
  1126. package/dist/shared/interfaces/enrichment.interface.js.map +0 -1
  1127. package/dist/shared/interfaces/integration.interface.d.ts.map +0 -1
  1128. package/dist/shared/interfaces/integration.interface.js.map +0 -1
  1129. package/dist/shared/interfaces/negotiation-events.interface.d.ts.map +0 -1
  1130. package/dist/shared/interfaces/negotiation-events.interface.js.map +0 -1
  1131. package/dist/shared/interfaces/negotiation-summary.interface.d.ts.map +0 -1
  1132. package/dist/shared/interfaces/negotiation-summary.interface.js.map +0 -1
  1133. package/dist/shared/interfaces/negotiator-memory.interface.d.ts.map +0 -1
  1134. package/dist/shared/interfaces/negotiator-memory.interface.js.map +0 -1
  1135. package/dist/shared/interfaces/question-generator.interface.d.ts.map +0 -1
  1136. package/dist/shared/interfaces/question-generator.interface.js.map +0 -1
  1137. package/dist/shared/interfaces/questioner.interface.d.ts.map +0 -1
  1138. package/dist/shared/interfaces/questioner.interface.js.map +0 -1
  1139. package/dist/shared/interfaces/queue.interface.d.ts.map +0 -1
  1140. package/dist/shared/interfaces/queue.interface.js.map +0 -1
  1141. package/dist/shared/interfaces/scraper.interface.d.ts.map +0 -1
  1142. package/dist/shared/interfaces/scraper.interface.js.map +0 -1
  1143. package/dist/shared/network/metadata.renderer.d.ts.map +0 -1
  1144. package/dist/shared/network/metadata.renderer.js.map +0 -1
  1145. package/dist/shared/observability/debug-meta.sanitizer.d.ts.map +0 -1
  1146. package/dist/shared/observability/debug-meta.sanitizer.js.map +0 -1
  1147. package/dist/shared/observability/log.d.ts.map +0 -1
  1148. package/dist/shared/observability/log.js.map +0 -1
  1149. package/dist/shared/observability/performance.d.ts.map +0 -1
  1150. package/dist/shared/observability/performance.js.map +0 -1
  1151. package/dist/shared/observability/protocol.logger.d.ts.map +0 -1
  1152. package/dist/shared/observability/protocol.logger.js.map +0 -1
  1153. package/dist/shared/observability/request-context.d.ts.map +0 -1
  1154. package/dist/shared/observability/request-context.js.map +0 -1
  1155. package/dist/shared/observability/trace.d.ts.map +0 -1
  1156. package/dist/shared/observability/trace.js.map +0 -1
  1157. package/dist/shared/schemas/chat-context.schema.d.ts.map +0 -1
  1158. package/dist/shared/schemas/chat-context.schema.js.map +0 -1
  1159. package/dist/shared/schemas/discovery-question.schema.d.ts.map +0 -1
  1160. package/dist/shared/schemas/discovery-question.schema.js.map +0 -1
  1161. package/dist/shared/schemas/identity.schema.d.ts.map +0 -1
  1162. package/dist/shared/schemas/identity.schema.js.map +0 -1
  1163. package/dist/shared/schemas/mcp-auth.schema.d.ts.map +0 -1
  1164. package/dist/shared/schemas/mcp-auth.schema.js.map +0 -1
  1165. package/dist/shared/schemas/negotiation-digest.schema.d.ts.map +0 -1
  1166. package/dist/shared/schemas/negotiation-digest.schema.js.map +0 -1
  1167. package/dist/shared/schemas/negotiation-state.schema.d.ts.map +0 -1
  1168. package/dist/shared/schemas/negotiation-state.schema.js.map +0 -1
  1169. package/dist/shared/schemas/network-assignment.schema.d.ts.map +0 -1
  1170. package/dist/shared/schemas/network-assignment.schema.js.map +0 -1
  1171. package/dist/shared/schemas/pending-question.schema.d.ts.map +0 -1
  1172. package/dist/shared/schemas/pending-question.schema.js.map +0 -1
  1173. package/dist/shared/schemas/question.schema.d.ts.map +0 -1
  1174. package/dist/shared/schemas/question.schema.js.map +0 -1
  1175. package/dist/shared/ui/lucide.icon-catalog.d.ts.map +0 -1
  1176. package/dist/shared/ui/lucide.icon-catalog.js.map +0 -1
  1177. package/dist/shared/utils/social-label.d.ts.map +0 -1
  1178. package/dist/shared/utils/social-label.js.map +0 -1
  1179. package/dist/shared/utils/telegram-handle.d.ts.map +0 -1
  1180. package/dist/shared/utils/telegram-handle.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/integration.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5B,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC,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AO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEpG;;;OAGG;IACH,UAAU,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.interface.js","sourceRoot":"/","sources":["shared/interfaces/integration.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Session for interacting with an external integration platform.\n * Provides access to tools, OAuth authorization, and toolkit discovery.\n */\nexport interface IntegrationSession {\n tools(): Promise<unknown[]>;\n authorize(toolkit: string): Promise<{ redirectUrl: string; waitForConnection(timeout?: number): Promise<unknown> }>;\n toolkits(): Promise<{ items: Array<{ slug: string; name: string; connection?: { connectedAccount?: { id: string } } }> }>;\n}\n\n/** Options for creating an integration session. */\nexport interface IntegrationSessionOptions {\n manageConnections?: boolean | { callbackUrl?: string };\n /** Toolkit slug → auth config ID mapping to pin existing auth configs. */\n authConfigs?: Record<string, string>;\n}\n\n/** Response from executing a tool action on the integration platform. */\nexport interface ToolActionResponse {\n successful: boolean;\n error?: string;\n data?: Record<string, unknown>;\n}\n\n/** A connected integration account for a user. */\nexport interface IntegrationConnection {\n id: string;\n toolkit: string;\n status: string;\n createdAt: string;\n}\n\n/**\n * Adapter for external integration platforms (OAuth sessions, tool execution).\n *\n * @remarks\n * Implementations wrap a specific platform SDK (e.g. Composio) and expose\n * a platform-agnostic API for creating user sessions and executing tool actions.\n */\nexport interface IntegrationAdapter {\n /**\n * Create an authenticated session for a user.\n * @param userId - User ID for the session\n * @param options - Session configuration (e.g. connection management)\n * @returns A session object for interacting with the platform\n */\n createSession(userId: string, options?: IntegrationSessionOptions): Promise<IntegrationSession>;\n\n /**\n * Execute a named tool action on behalf of a user.\n * @param slug - Tool action identifier (e.g. 'GMAIL_GET_CONTACTS')\n * @param userId - User to execute the action for\n * @param args - Arguments to pass to the tool action\n * @returns The tool execution response\n */\n executeToolAction(slug: string, userId: string, args: Record<string, unknown>): Promise<ToolActionResponse>;\n\n /**\n * List all connected accounts for a user.\n * @param userId - User to list connections for\n * @returns Array of connected integration accounts\n */\n listConnections(userId: string): Promise<IntegrationConnection[]>;\n\n /**\n * Get an OAuth authorization URL to connect a toolkit.\n * @param userId - User to authorize\n * @param toolkit - Toolkit slug (e.g. 'gmail')\n * @param callbackUrl - URL to redirect to after OAuth\n * @returns The redirect URL for OAuth\n */\n getAuthUrl(userId: string, toolkit: string, callbackUrl?: string): Promise<{ redirectUrl: string }>;\n\n /**\n * Disconnect (delete) a connected account.\n * @param connectedAccountId - The connected account ID to remove\n */\n disconnect(connectedAccountId: string): Promise<{ success: boolean }>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-events.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5F;;;OAGG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-events.interface.js","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * Interfaces for negotiation yield/resume support.\n * Used by the negotiation graph and dispatcher to manage timeouts\n * for external agents that haven't responded yet.\n */\n\n/**\n * Manages delayed timeout jobs for negotiations waiting on external agents.\n * When a negotiation yields, a timeout is enqueued. If the external agent\n * responds before the timeout, the job is cancelled.\n */\nexport interface NegotiationTimeoutQueue {\n /**\n * Enqueue a delayed timeout job.\n * @param negotiationId - The negotiation task ID\n * @param turnNumber - Current turn number (used to detect stale jobs)\n * @param delayMs - Delay in milliseconds before the timeout fires\n * @returns The BullMQ job ID for cancellation\n */\n enqueueTimeout(negotiationId: string, turnNumber: number, delayMs: number): Promise<string>;\n\n /**\n * Cancel a pending timeout job for a negotiation.\n * @param negotiationId - The negotiation task ID\n */\n cancelTimeout(negotiationId: string): Promise<void>;\n\n /**\n * Arm the answer-window timer for an `ask_user` pause (P3.2). Fires after\n * `delayMs` (typically 24 h); the worker resumes the negotiation with a\n * conservative no-disclosure default when the task is still\n * `input_required`, and no-ops otherwise (stale job).\n *\n * Optional so fakes and pre-P3.2 implementations stay valid; the graph only\n * offers `ask_user` when this method is present.\n *\n * @param negotiationId - The paused negotiation task ID\n * @param payload - Resume coordinates + observability context\n * @param delayMs - Delay before the expiry fires\n * @returns The job ID for cancellation\n */\n enqueueAskUserExpiry?(\n negotiationId: string,\n payload: AskUserExpiryPayload,\n delayMs: number,\n ): Promise<string>;\n\n /**\n * Cancel a pending ask_user answer-window timer (the client answered in\n * time, or the negotiation reached a terminal state another way).\n * @param negotiationId - The paused negotiation task ID\n */\n cancelAskUserExpiry?(negotiationId: string): Promise<void>;\n}\n\n/** Payload carried by an ask_user answer-window expiry job. */\nexport interface AskUserExpiryPayload {\n /** Deterministic durable settlement/outbox key for this exact paused task. */\n settlementId: string;\n /** Opportunity to resume via the run-existing continuation path. */\n opportunityId: string;\n /** The asking side's client (the user who was asked and did not answer). */\n userId: string;\n /** Exact owned signal consulted by the paused negotiator. */\n recipientIntentId: string;\n /** Exact non-personal network shared by the opportunity actors. */\n networkId: string;\n /** Admission-time canonical hash of the recipient intent payload/summary. */\n intentFingerprint: string;\n /** Admission-time opportunity lifecycle marker. */\n opportunityStatus: string;\n opportunityUpdatedAt: string;\n /** Exact counterparty provenance for settlement-time eligibility checks. */\n counterpartyUserId: string;\n counterpartyIntentId: string;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-summary.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/negotiation-summary.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;OASG;IACH,SAAS,CACP,WAAW,EAAE,oBAAoB,EACjC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjC,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;CAC/C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-summary.interface.js","sourceRoot":"/","sources":["shared/interfaces/negotiation-summary.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Protocol-side contract for summarizing discovery negotiations into compact\n * digests. The protocol layer only sees this shape; the LLM implementation\n * (NegotiationSummarizer) is injected through dependency wiring.\n *\n * Pattern mirrors ChatSummaryReader: protocol defines the read shape, the\n * backend (or any consumer) provides the implementation.\n */\nimport type { DiscoveryNegotiation } from \"../schemas/discovery-question.schema.js\";\nimport type { DiscoveryNegotiationDigest } from \"../schemas/negotiation-digest.schema.js\";\n\nexport interface NegotiationSummaryReader {\n /**\n * Summarize a single negotiation into a compact digest.\n *\n * @param negotiation The raw negotiation to compress.\n * @param options.signal Optional AbortSignal. When aborted (deadline reached or\n * upstream cancel) the in-flight LLM call is cancelled and `null` is returned —\n * callers fall back to a deterministic digest so question generation can\n * still proceed.\n * @returns the digest, or `null` when summarization fails or is aborted.\n */\n summarize(\n negotiation: DiscoveryNegotiation,\n options?: { signal?: AbortSignal },\n ): Promise<DiscoveryNegotiationDigest | null>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiator-memory.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/negotiator-memory.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;iCAEiC;AACjC,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG,UAAU,GAAG,WAAW,CAAC;AAElF,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,sBAAsB,CAAC;IAC7B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mFAAmF;AACnF,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,4BAA4B;AACtC,kDAAkD;AAChD;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,wBAAwB,CAAA;CAAE;AACzD,kFAAkF;GAChF;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,wBAAwB,EAAE,CAAA;CAAE;AACjE,iDAAiD;GAC/C;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAE5B,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAC5C;;;;OAIG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,OAAO,CAAC,4BAA4B,CAAC,CAAC;CAC1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiator-memory.interface.js","sourceRoot":"/","sources":["shared/interfaces/negotiator-memory.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG","sourcesContent":["/**\n * Host bridge for the negotiator persona's `remember`/`forget` chat tools\n * (P5.4 / IND-408).\n *\n * The negotiator's private memory store lives on the host (API) side; the\n * protocol package only ever sees this narrow surface. The bridge is\n * injected by the composition root ONLY into the negotiator persona's\n * toolset — the orchestrator registry never registers these tools — and\n * only when the host's memory write flag is on.\n */\n\n/** Memory kinds the client can create directly from chat. Deliberately\n * excludes `counterparty_dossier`: dossiers are distilled from negotiation\n * transcripts, not dictated. */\nexport type RememberableMemoryKind = \"disclosure_rule\" | \"playbook\" | \"threshold\";\n\nexport interface NegotiatorMemoryRememberInput {\n kind: RememberableMemoryKind;\n /** The rule as one self-contained sentence (what the client actually said). */\n content: string;\n /** Chat session the instruction came from (provenance). */\n sessionId?: string;\n}\n\n/** A remembered/deleted row, shaped for chat rendering (no embedding, no refs). */\nexport interface NegotiatorMemoryToolView {\n id: string;\n kind: string;\n content: string;\n}\n\nexport type NegotiatorMemoryForgetResult =\n /** Exactly one memory matched and was deleted. */\n | { status: \"deleted\"; memory: NegotiatorMemoryToolView }\n /** Several memories matched; the client must pick one (re-call with memoryId). */\n | { status: \"ambiguous\"; candidates: NegotiatorMemoryToolView[] }\n /** Nothing matched the reference/description. */\n | { status: \"not_found\" };\n\nexport interface NegotiatorMemoryToolsHost {\n /**\n * Persist a standing rule the client just stated in chat.\n * Returns null when memory writes are disabled on the host.\n */\n remember(\n userId: string,\n input: NegotiatorMemoryRememberInput,\n ): Promise<NegotiatorMemoryToolView | null>;\n /**\n * Delete a memory by id or by the client's description of it.\n * Deletion is always honored regardless of the write flag — forgetting is\n * the client's standing right.\n */\n forget(\n userId: string,\n input: { memoryId?: string; description?: string },\n ): Promise<NegotiatorMemoryForgetResult>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"question-generator.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/question-generator.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjC,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;CAC7C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"question-generator.interface.js","sourceRoot":"/","sources":["shared/interfaces/question-generator.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @deprecated Inline question generation is superseded by the async\n * QuestionerQueue path (`questionerEnqueue`). Will be removed once the inline\n * fallback in `opportunity.discover.ts` is retired.\n *\n * Protocol-level read contract for decision-question generation. Implementations\n * live in the backend (see `QuestionGeneratorService`, which delegates to the\n * QuestionerAgent's `discovery` mode) and are injected into the protocol via\n * `ProtocolDeps`/`ToolContext`. The protocol module never constructs its own\n * LLM-bound generator — callers inject one (or `undefined` to opt out).\n */\nimport type { DiscoveryQuestionInput } from \"../schemas/discovery-question.schema.js\";\nimport type { QuestionGenerationResult } from \"../schemas/question.schema.js\";\n\nexport interface QuestionGeneratorReader {\n /**\n * Run the question generator over a single discovery turn.\n *\n * @param input Discovery turn payload (query + negotiation digests + chat context).\n * @param options.signal Optional AbortSignal. When aborted (deadline reached or\n * upstream cancel) the in-flight LLM call is cancelled and `null` is returned —\n * discovery still emits its response, just without questions.\n * @returns The structured result, or `null` when generation failed,\n * guardrails dropped all candidates, the underlying LLM threw, or\n * the call was aborted.\n */\n generate(\n input: DiscoveryQuestionInput,\n options?: { signal?: AbortSignal },\n ): Promise<QuestionGenerationResult | null>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"questioner.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/questioner.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEzL,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,0FAA0F;IAC1F,sBAAsB,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACvD,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB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,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAErF;;0FAEsF;IACtF,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErF;;0FAEsF;IACtF,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"questioner.interface.js","sourceRoot":"/","sources":["shared/interfaces/questioner.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Protocol-level persistence contract for structured questions generated by\n * the QuestionerAgent. Implementations live in the backend and are injected\n * into ProtocolDeps.\n */\nimport type { Question, QuestionMode, QuestionPurpose, QuestionStrategy, QuestionDetection, QuestionActor, QuestionAnswer, UnderspecificationType } from \"../schemas/question.schema.js\";\n\n/** Shape accepted by `persist()` — everything needed to insert a question row. */\nexport interface PersistableQuestion {\n detection: QuestionDetection;\n actors: QuestionActor[];\n payload: Question;\n strategy: QuestionStrategy;\n /** Internal QUD repair category; null when the question repairs no underspecification. */\n underspecificationType?: UnderspecificationType | null;\n /** Conversation ID — set when the question originates from a chat session. */\n conversationId?: string;\n}\n\n/** Shape returned by `findPending()` — a persisted question with its DB id and status. */\nexport interface PersistedQuestion {\n id: string;\n detection: QuestionDetection;\n actors: QuestionActor[];\n payload: Question;\n status: \"pending\" | \"answered\" | \"dismissed\";\n answer: QuestionAnswer | null;\n createdAt: string;\n}\n\n/** Optional filters for `findPending()`. */\nexport interface QuestionFilters {\n mode?: QuestionMode;\n purpose?: QuestionPurpose;\n sourceType?: string;\n sourceId?: string;\n /** Optional selected-intent scope. When `scopeType === 'intent'`, `scopeId` is the selected intent id. */\n scopeType?: 'intent';\n scopeId?: string;\n}\n\n/**\n * Resolution outcome for a single awaited chat question.\n * `timeout` means the wait budget elapsed (or the run was aborted) before the\n * user responded — the question stays `pending` in the database.\n */\nexport interface ChatQuestionAnswerOutcome {\n questionId: string;\n status: \"answered\" | \"dismissed\" | \"timeout\";\n answer?: QuestionAnswer;\n}\n\n/**\n * Host bridge for the orchestrator's blocking `ask_user_question` tool.\n * `persist` synchronously inserts chat-mode question rows; `awaitAnswers`\n * blocks until every question resolves (answer/dismiss via the questions\n * REST endpoints) or the wait times out / the run is aborted.\n *\n * Implementations live in the backend (in-memory per-question wait bus,\n * single-instance semantics like the chat steer/queue interrupt emitter).\n */\nexport interface ChatQuestionsHost {\n persist(batch: PersistableQuestion[]): Promise<PersistedQuestion[]>;\n awaitAnswers(\n questionIds: string[],\n opts?: { timeoutMs?: number; signal?: AbortSignal },\n ): Promise<ChatQuestionAnswerOutcome[]>;\n}\n\nexport interface QuestionerDatabase {\n /** Persist a batch of generated questions (up to 3 per generation).\n * @returns The IDs of the inserted rows. */\n persist(questions: PersistableQuestion[]): Promise<string[]>;\n\n /** Find pending questions for a user, optionally filtered by mode/source. */\n findPending(userId: string, filters?: QuestionFilters): Promise<PersistedQuestion[]>;\n\n /** Record an answer for a question. Sets status to \"answered\".\n * Only succeeds if the user is an actor on a pending question.\n * @returns `true` if updated, `false` if not found, not pending, or unauthorized. */\n answer(questionId: string, userId: string, answer: QuestionAnswer): Promise<boolean>;\n\n /** Dismiss a question. Sets status to \"dismissed\".\n * Only succeeds if the user is an actor on a pending question.\n * @returns `true` if updated, `false` if not found, not pending, or unauthorized. */\n dismiss(questionId: string, userId: string): Promise<boolean>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/queue.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzG,gBAAgB,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.interface.js","sourceRoot":"/","sources":["shared/interfaces/queue.interface.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Queue types for protocol layer.\n */\n\nimport type { ToolScopeType } from \"../agent/tool.scope.js\";\n\nexport interface IntentGraphQueueScope {\n scopeType?: ToolScopeType;\n scopeId?: string;\n /** @deprecated networkScopeId is legacy; use `scopeType: 'network'` + `scopeId`. */\n networkScopeId?: string;\n}\n\n/**\n * Operations the Intent Graph needs to enqueue follow-up work (e.g. HyDE generation/deletion).\n * Implemented by the intent queue; protocol layer depends only on this interface.\n */\nexport interface IntentGraphQueue {\n addGenerateHydeJob(data: { intentId: string; userId: string } & IntentGraphQueueScope): Promise<unknown>;\n addDeleteHydeJob(data: { intentId: string }): Promise<unknown>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scraper.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/scraper.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC5F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scraper.interface.js","sourceRoot":"/","sources":["shared/interfaces/scraper.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for URL content extraction (e.g. to tailor output for intent vs profile).\n */\nexport interface ExtractUrlContentOptions {\n /**\n * Optional natural-language objective describing why we're scraping.\n * Examples: \"User wants to create an intent from this link (project/repo).\",\n * \"User wants to update their profile from this page.\", or omit for generic extraction.\n */\n objective?: string;\n /** Optional cancellation signal for caller/client disconnect or runtime deadline. */\n signal?: AbortSignal;\n}\n\n/**\n * Interface for scraping web content.\n */\nexport interface Scraper {\n /**\n * Scrapes the content from the given URL.\n * @param url The URL to scrape.\n * @returns The scraped text content.\n */\n scrape(url: string): Promise<string>;\n\n /**\n * Extracts content from a URL. When `options.objective` is provided, extraction\n * may be tailored for that use (e.g. intent-focused vs profile-focused content).\n * @param url The URL to extract content from.\n * @param options Optional. Pass `objective` to get content better suited for intent creation or profile update.\n * @returns The extracted content as a string, or null if extraction failed.\n */\n extractUrlContent(url: string, options?: ExtractUrlContentOptions): Promise<string | null>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"metadata.renderer.d.ts","sourceRoot":"/","sources":["shared/network/metadata.renderer.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAmBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC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C,OAAO,KAAK,QAAQ,CAAC;IAC/G,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CACxB,MAA4C,EAC5C,UAAkB;IAElB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,GAAG,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACzD,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACvD,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,SAAS,CAAC;SAC1D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACzB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC","sourcesContent":["interface NetworkForRendering {\n type: string;\n title: string;\n prompt?: string | null;\n metadata: Record<string, unknown>;\n}\n\ninterface EventMetadata {\n startDate?: string;\n endDate?: string;\n timezone?: string;\n location?: string;\n themes?: string[];\n events?: Array<{\n externalId: string;\n title: string;\n startTime: string;\n endTime: string;\n location?: string;\n description?: string;\n tags?: string[];\n }>;\n}\n\n/**\n * Render a network's metadata as structured markdown for LLM context.\n *\n * @param network - The network to render, with type, title, optional prompt, and metadata.\n * @returns Markdown string suitable for injection into an LLM prompt.\n */\nexport function renderNetworkContext(network: NetworkForRendering): string {\n switch (network.type) {\n case 'event':\n return renderEventNetwork(network);\n case 'community':\n default:\n return renderCommunityNetwork(network);\n }\n}\n\nfunction renderCommunityNetwork(network: NetworkForRendering): string {\n const lines: string[] = [`## ${network.title}`];\n if (network.prompt) {\n lines.push('', network.prompt);\n }\n return lines.join('\\n');\n}\n\nfunction renderEventNetwork(network: NetworkForRendering): string {\n const meta = network.metadata;\n const startDate = typeof meta.startDate === 'string' ? meta.startDate : undefined;\n const endDate = typeof meta.endDate === 'string' ? meta.endDate : undefined;\n const location = typeof meta.location === 'string' ? meta.location : undefined;\n const timezone = typeof meta.timezone === 'string' ? meta.timezone : undefined;\n const themes = Array.isArray(meta.themes) ? meta.themes.filter((t: unknown): t is string => typeof t === 'string') : [];\n const events = Array.isArray(meta.events) ? normalizeEvents(meta.events) : [];\n const lines: string[] = [`## ${network.title}`];\n\n if (network.prompt) {\n lines.push('', network.prompt);\n }\n\n lines.push('');\n lines.push('- **Type:** Event');\n\n const dateRange = startDate && endDate ? formatDateRange(startDate, endDate) : undefined;\n if (dateRange) {\n lines.push(`- **Dates:** ${dateRange}`);\n }\n if (location) {\n lines.push(`- **Location:** ${location}`);\n }\n if (timezone) {\n lines.push(`- **Timezone:** ${timezone}`);\n }\n if (themes.length > 0) {\n lines.push(`- **Themes:** ${themes.join(', ')}`);\n }\n\n lines.push('');\n const upcoming = getUpcomingEvents(events, 7);\n if (upcoming.length === 0) {\n lines.push('No upcoming events in the next 7 days.');\n } else {\n lines.push('### Upcoming Events (next 7 days)');\n lines.push('| Time | Event | Location |');\n lines.push('|------|-------|----------|');\n for (const evt of upcoming) {\n const time = formatEventTime(evt.startTime);\n const loc = escapeTableCell(evt.location ?? '');\n const title = escapeTableCell(evt.title);\n lines.push(`| ${time} | ${title} | ${loc} |`);\n }\n }\n\n return lines.join('\\n');\n}\n\nfunction formatDateRange(start: string, end: string): string | undefined {\n const s = new Date(start);\n const e = new Date(end);\n if (isNaN(s.getTime()) || isNaN(e.getTime())) return undefined;\n const opts: Intl.DateTimeFormatOptions = { month: 'long', day: 'numeric', year: 'numeric', timeZone: 'UTC' };\n return `${s.toLocaleDateString('en-US', opts)} – ${e.toLocaleDateString('en-US', opts)}`;\n}\n\nfunction formatEventTime(iso: string): string {\n const d = new Date(iso);\n if (isNaN(d.getTime())) return iso;\n return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' }) +\n ', ' +\n d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', timeZone: 'UTC' });\n}\n\nfunction escapeTableCell(value: string): string {\n return value.replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ');\n}\n\nfunction normalizeEvents(raw: unknown[]): NonNullable<EventMetadata['events']> {\n return raw.filter((e): e is NonNullable<EventMetadata['events']>[number] => {\n if (typeof e !== 'object' || e === null) return false;\n const obj = e as Record<string, unknown>;\n return typeof obj.title === 'string' && typeof obj.startTime === 'string' && typeof obj.endTime === 'string';\n });\n}\n\nfunction getUpcomingEvents(\n events: NonNullable<EventMetadata['events']>,\n windowDays: number,\n): NonNullable<EventMetadata['events']> {\n const now = Date.now();\n const windowEnd = now + windowDays * 24 * 60 * 60 * 1000;\n return events\n .map((e) => ({ e, t: new Date(e.startTime).getTime() }))\n .filter(({ t }) => !isNaN(t) && t >= now && t <= windowEnd)\n .sort((a, b) => a.t - b.t)\n .map(({ e }) => e);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-meta.sanitizer.d.ts","sourceRoot":"/","sources":["shared/observability/debug-meta.sanitizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,kEAAkE;AAClE,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAwDrE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,eAAe,GAAE,MAAkC,GAClD,OAAO,CAOT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-meta.sanitizer.js","sourceRoot":"/","sources":["shared/observability/debug-meta.sanitizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC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U,oBAAoB,CAClC,GAAY,EACZ,kBAA0B,yBAAyB;IAEnD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,OAAO,EAAU,CAAC;QACnC,OAAO,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,8BAA8B,CAAC;IACxC,CAAC;AACH,CAAC","sourcesContent":["/**\n * Sanitizes objects for inclusion in chat debug meta.\n * Strips embeddings, truncates long strings, and handles circular refs.\n */\n\nconst BLOCKLIST_KEYS = new Set([\n \"embedding\",\n \"embeddingVector\",\n \"vector\",\n]);\nconst BLOCKLIST_SUFFIXES = [\"Embedding\", \"Vector\"];\nconst EMBEDDING_ARRAY_THRESHOLD = 100;\nconst DEFAULT_MAX_STRING_LENGTH = 2048;\n/** Exported for tests that assert on circular-ref placeholder. */\nexport const SANITIZATION_ERROR_PLACEHOLDER = \"[sanitization error]\";\n\nfunction isBlocklistedKey(key: string): boolean {\n if (BLOCKLIST_KEYS.has(key)) return true;\n return BLOCKLIST_SUFFIXES.some((s) => key.endsWith(s));\n}\n\nfunction isNumberArray(arr: unknown): arr is number[] {\n return Array.isArray(arr) && arr.length > 0 && typeof arr[0] === \"number\";\n}\n\nfunction truncateString(str: string, maxLen: number): string {\n if (str.length <= maxLen) return str;\n return `[truncated, ${str.length} chars]`;\n}\n\nfunction sanitizeValue(\n value: unknown,\n maxStringLength: number,\n seen: WeakSet<object>,\n): unknown {\n if (value === null || value === undefined) return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return value;\n if (typeof value === \"string\")\n return truncateString(value, maxStringLength);\n\n if (typeof value === \"object\") {\n if (seen.has(value as object)) return SANITIZATION_ERROR_PLACEHOLDER;\n seen.add(value as object);\n\n if (Array.isArray(value)) {\n if (isNumberArray(value) && value.length > EMBEDDING_ARRAY_THRESHOLD)\n return `[embedding, length ${value.length}]`;\n return value.map((item) => sanitizeValue(item, maxStringLength, seen));\n }\n\n const obj = value as Record<string, unknown>;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(obj)) {\n if (isBlocklistedKey(k)) {\n if (Array.isArray(v) && isNumberArray(v))\n out[k] = `[embedding, length ${v.length}]`;\n else if (Array.isArray(v))\n out[k] = `[array, length ${v.length}]`;\n else\n out[k] = \"[redacted]\";\n } else {\n out[k] = sanitizeValue(v, maxStringLength, seen);\n }\n }\n return out;\n }\n\n return value;\n}\n\n/**\n * Sanitizes an object for safe inclusion in debug meta.\n * - Replaces embedding/vector keys and long number arrays with placeholders.\n * - Truncates strings over maxStringLength.\n * - On circular reference or error, returns a placeholder string.\n *\n * @param obj - Value to sanitize (object, array, or primitive)\n * @param maxStringLength - Max string length before truncation (default 2048)\n * @returns Sanitized copy or \"[sanitization error]\" on failure\n */\nexport function sanitizeForDebugMeta(\n obj: unknown,\n maxStringLength: number = DEFAULT_MAX_STRING_LENGTH,\n): unknown {\n try {\n const seen = new WeakSet<object>();\n return sanitizeValue(obj, maxStringLength, seen);\n } catch {\n return SANITIZATION_ERROR_PLACEHOLDER;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"/","sources":["shared/observability/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAA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EAAE,IAAI,CAAC;KACjD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO;QACL,IAAI,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC;IACvB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;IAC3B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAC5B,CAAC","sourcesContent":["/**\n * Protocol-internal logging module.\n *\n * Self-contained — no imports from outside the protocol library.\n * Ships with a minimal console-based default. The host application can\n * call `setLoggerFactory()` at startup to wire in a richer implementation\n * (e.g. the project-wide `log` utility with ANSI colors, context filtering,\n * and embedding redaction).\n */\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// TYPES\n// ═══════════════════════════════════════════════════════════════════════════════\n\ntype LogMethod = (message: string, meta?: Record<string, unknown>) => void;\n\nexport type LoggerWithSource = {\n verbose: LogMethod;\n debug: LogMethod;\n info: LogMethod;\n warn: LogMethod;\n error: LogMethod;\n};\n\nexport type LogContext = 'protocol' | 'lib' | 'agent' | 'graph';\n\nexport type LogLevel = 'verbose' | 'debug' | 'info' | 'warn' | 'error';\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// DEFAULT IMPLEMENTATION\n// ═══════════════════════════════════════════════════════════════════════════════\n\nfunction defaultCreateLogger(_context: string, source: string): LoggerWithSource {\n const prefix = `[${source}]`;\n const emit = (sink: (...args: unknown[]) => void, msg: string, meta?: Record<string, unknown>) =>\n sink(prefix, msg, ...(meta ? [sanitizeFn(meta)] : []));\n return {\n // eslint-disable-next-line no-console\n verbose: (msg, meta) => emit(console.debug, msg, meta),\n // eslint-disable-next-line no-console\n debug: (msg, meta) => emit(console.debug, msg, meta),\n // eslint-disable-next-line no-console\n info: (msg, meta) => emit(console.info, msg, meta),\n // eslint-disable-next-line no-console\n warn: (msg, meta) => emit(console.warn, msg, meta),\n // eslint-disable-next-line no-console\n error: (msg, meta) => emit(console.error, msg, meta),\n };\n}\n\n/** Truncation limits for the default (host-less) sanitizer — never dump big payloads. */\nconst MAX_STRING_LENGTH = 2000;\nconst MAX_ARRAY_ITEMS = 25;\nconst MAX_DEPTH = 6;\n\nfunction defaultSanitize(value: unknown, depth = 0): unknown {\n if (value == null) return value;\n if (typeof value === 'string') {\n return value.length > MAX_STRING_LENGTH\n ? `${value.slice(0, MAX_STRING_LENGTH)}… [truncated ${value.length - MAX_STRING_LENGTH} chars]`\n : value;\n }\n if (Array.isArray(value)) {\n if (value.length > 0 && typeof value[0] === 'number') return `[redacted: ${value.length} values]`;\n if (depth >= MAX_DEPTH) return `[truncated: array(${value.length})]`;\n const items = value.slice(0, MAX_ARRAY_ITEMS).map((item) => defaultSanitize(item, depth + 1));\n if (value.length > MAX_ARRAY_ITEMS) items.push(`… [truncated ${value.length - MAX_ARRAY_ITEMS} more items]`);\n return items;\n }\n if (value instanceof Error) {\n return { name: value.name, message: defaultSanitize(value.message, depth + 1) };\n }\n if (typeof value === 'object' && value.constructor === Object) {\n if (depth >= MAX_DEPTH) return `[truncated: object(${Object.keys(value).length} keys)]`;\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>).map(([k, v]) => [k, defaultSanitize(v, depth + 1)])\n );\n }\n return value;\n}\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// PLUGGABLE FACTORY\n// ═══════════════════════════════════════════════════════════════════════════════\n\ntype LoggerFactory = (context: string, source: string) => LoggerWithSource;\ntype SanitizeFn = (value: unknown) => unknown;\n\nlet createLoggerFn: LoggerFactory = defaultCreateLogger;\nlet sanitizeFn: SanitizeFn = defaultSanitize;\n/** Bumped on every setLoggerFactory() call; invalidates cached logger instances. */\nlet factoryGeneration = 0;\n\n/**\n * Override the logger factory used by all protocol-internal logging.\n * Call this at application startup to wire in your project's logger.\n *\n * @example\n * ```ts\n * import { log, sanitizeForLog } from \"./lib/log.js\";\n * import { setLoggerFactory } from \"./lib/protocol/support/log.js\";\n *\n * setLoggerFactory(\n * (context, source) => log.withContext(context as LogContext, source),\n * sanitizeForLog,\n * );\n * ```\n */\nexport function setLoggerFactory(factory: LoggerFactory, sanitize?: SanitizeFn) {\n createLoggerFn = factory;\n if (sanitize) sanitizeFn = sanitize;\n factoryGeneration++;\n}\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// PUBLIC API\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/** Sanitize an object for logging (redacts embeddings when host logger is wired in). */\nexport function sanitizeForLog(value: unknown): unknown {\n return sanitizeFn(value);\n}\n\n/**\n * Late-bound logger: resolves the current factory at emit time (cached per\n * factory generation). This makes `const logger = log.lib.from('X')` at module\n * import time safe — loggers created BEFORE the host calls `setLoggerFactory()`\n * still pick up the rich implementation afterwards.\n */\nfunction makeLateBoundLogger(context: string, source: string): LoggerWithSource {\n let cached: LoggerWithSource | undefined;\n let cachedGeneration = -1;\n const resolve = (): LoggerWithSource => {\n if (!cached || cachedGeneration !== factoryGeneration) {\n cached = createLoggerFn(context, source);\n cachedGeneration = factoryGeneration;\n }\n return cached;\n };\n return {\n verbose: (msg, meta) => resolve().verbose(msg, meta),\n debug: (msg, meta) => resolve().debug(msg, meta),\n info: (msg, meta) => resolve().info(msg, meta),\n warn: (msg, meta) => resolve().warn(msg, meta),\n error: (msg, meta) => resolve().error(msg, meta),\n };\n}\n\nfunction lazyContext(context: string) {\n return {\n from: (source: string) => makeLateBoundLogger(context, source),\n };\n}\n\n/**\n * Logger with pre-bound context. Usage:\n * ```ts\n * const logger = log.protocol.from('MyComponent');\n * logger.info('started');\n * ```\n *\n * Loggers are late-bound: the factory is resolved at emit time, so\n * `setLoggerFactory()` at app startup upgrades even loggers that were created\n * at module import time.\n */\nexport const log = {\n protocol: lazyContext('protocol'),\n lib: lazyContext('lib'),\n agent: lazyContext('agent'),\n graph: lazyContext('graph'),\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"performance.d.ts","sourceRoot":"/","sources":["shared/observability/performance.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;AACjE,KAAK,aAAa,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAK3E,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,cAAc,GAAG,SAAS,QAE/D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,QAElE;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAc7E;AAED;;;GAGG;AAEH,wBAAgB,KAAK,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAWlG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"performance.js","sourceRoot":"/","sources":["shared/observability/performance.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,IAAI,QAAoC,CAAC;AACzC,IAAI,aAAwC,CAAC;AAE7C,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAAC,EAA8B;IAC9D,QAAQ,GAAG,EAAE,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAkC;IACjE,aAAa,GAAG,OAAO,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI,IAAY,EAAE,EAAoB;IAC/D,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;QACrB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;YAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;YAC5C,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;YAC5C,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,8DAA8D;AAC9D,MAAM,UAAU,KAAK;IACnB,8DAA8D;IAC9D,OAAO,UAAU,OAAY,EAAE,WAAmB,EAAE,UAA8B;QAChF,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAClC,8DAA8D;QAC9D,UAAU,CAAC,KAAK,GAAG,UAAqB,GAAG,IAAW;YACpD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YACxC,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,WAAW,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Simple performance timing utilities for the protocol library.\n * Standalone — no external dependencies.\n */\n\ntype TimingCallback = (name: string, durationMs: number) => void;\ntype TimingWrapper = <T>(name: string, fn: () => Promise<T>) => Promise<T>;\n\nlet onTiming: TimingCallback | undefined;\nlet timingWrapper: TimingWrapper | undefined;\n\n/** Set a global callback for timing events (e.g. for aggregation/logging). */\nexport function setTimingCallback(cb: TimingCallback | undefined) {\n onTiming = cb;\n}\n\n/**\n * Set a global wrapper around timed operations.\n * Host applications can use this to attach protocol timings to their tracing backend\n * without coupling the protocol package to any observability vendor.\n */\nexport function setTimingWrapper(wrapper: TimingWrapper | undefined) {\n timingWrapper = wrapper;\n}\n\n/**\n * Wraps an async function with timing measurement.\n * Reports duration to the global timing callback if set.\n */\nexport async function timed<T>(name: string, fn: () => Promise<T>): Promise<T> {\n const run = async () => {\n const start = performance.now();\n try {\n const result = await fn();\n onTiming?.(name, performance.now() - start);\n return result;\n } catch (err) {\n onTiming?.(name, performance.now() - start);\n throw err;\n }\n };\n\n return timingWrapper ? timingWrapper(name, run) : run();\n}\n\n/**\n * Method decorator that wraps an async method with timing measurement.\n * Uses `ClassName.methodName` as the timing label.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function Timed(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (_target: any, propertyKey: string, descriptor: PropertyDescriptor) {\n const original = descriptor.value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n descriptor.value = function (this: any, ...args: any[]) {\n const className = this.constructor.name;\n const name = `${className}.${propertyKey}`;\n return timed(name, () => original.apply(this, args));\n };\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol.logger.d.ts","sourceRoot":"/","sources":["shared/observability/protocol.logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,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AE,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QACtC,MAAM,OAAO,GAA4B;YACvC,QAAQ;YACR,UAAU;YACV,GAAG,OAAO;SACX,CAAC;QACF,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QACtC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE;YAC1B,QAAQ;YACR,KAAK,EAAE,GAAG;YACV,UAAU;YACV,GAAG,OAAO;SACX,CAAC,CAAC;QACH,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["/**\n * Protocol-layer logging: call-scoped inputs, outputs, and context for debugging.\n * Use protocolLogger('ComponentName') for the logger, then wrap calls with\n * withCallLogging. All protocol code should log inputs at call start and\n * outputs (or summary) + duration at end.\n */\n\nimport { log, sanitizeForLog } from \"./log.js\";\nimport type { LoggerWithSource } from \"./log.js\";\n\nexport type { LoggerWithSource };\n\n/** Create a protocol logger for a given source (e.g. \"ChatTools\", \"DiscoverNodes\"). */\nexport function protocolLogger(source: string): LoggerWithSource {\n return log.protocol.from(source);\n}\n\nexport interface CallLogOptions {\n /** Log full output on success (default: true). Set false for very large payloads. */\n logOutput?: boolean;\n /** Extra context to include in both start and end (e.g. userId, networkId). */\n context?: Record<string, unknown>;\n}\n\n/**\n * Wraps an async call with consistent logging: inputs at start, outputs + duration at end,\n * error + duration on failure. All payloads are sanitized (embeddings redacted).\n */\nexport async function withCallLogging<T>(\n logger: LoggerWithSource,\n callName: string,\n inputs: Record<string, unknown>,\n fn: () => Promise<T>,\n options: CallLogOptions = {}\n): Promise<T> {\n const { logOutput = true, context = {} } = options;\n const start = Date.now();\n const sanitizedInputs = sanitizeForLog(inputs) as Record<string, unknown>;\n logger.verbose('call start', { callName, inputs: sanitizedInputs, ...context });\n\n try {\n const result = await fn();\n const durationMs = Date.now() - start;\n const outMeta: Record<string, unknown> = {\n callName,\n durationMs,\n ...context,\n };\n if (logOutput) {\n outMeta.output = sanitizeForLog(result);\n }\n logger.verbose('call end', outMeta);\n return result;\n } catch (err) {\n const durationMs = Date.now() - start;\n logger.error('call failed', {\n callName,\n error: err,\n durationMs,\n ...context,\n });\n throw err;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-context.d.ts","sourceRoot":"/","sources":["shared/observability/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EACD;IACE,IAAI,EAAE,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACD;IAKE,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC,GACD;IAGE,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,yBAAyB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,KACF,IAAI,CAAC;AAEV,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,mCAA0C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-context.js","sourceRoot":"/","sources":["shared/observability/request-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA0EhD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iBAAiB,EAAkB,CAAC","sourcesContent":["import type { Opportunity } from \"../interfaces/database.interface.js\";\nimport { AsyncLocalStorage } from \"async_hooks\";\n\n/**\n * Callback for streaming trace / domain events from deep inside graph nodes\n * back to the caller (typically chat.agent's stream pipeline).\n *\n * Carries two flavors of event:\n * - Trace events (`graph_start | graph_end | agent_start | agent_end`) — used\n * by the chat TRACE panel to visualize what the agent is doing.\n * - Domain events (`opportunity_draft_ready`) — emitted by the orchestrator\n * branch of OpportunityGraph.negotiateNode so the frontend can render each\n * accepted draft card progressively as its negotiation resolves.\n *\n * Kept as a single emitter rather than splitting into two to minimize plumbing\n * through AsyncLocalStorage; the chat.agent relay branches on event.type.\n */\nexport type TraceEmitter = (\n event:\n | {\n type: \"graph_start\" | \"graph_end\" | \"agent_start\" | \"agent_end\";\n name: string;\n durationMs?: number;\n summary?: string;\n }\n | {\n // Emitted by the ask_user_question tool: structured questions were\n // persisted and the turn is now blocked awaiting the user's answer.\n // Carries persisted question ids so the frontend can answer them\n // through the questions REST endpoints while the stream is live.\n type: \"user_question\";\n questions: Array<{ id: string }>;\n }\n | {\n // Lightweight keep-alive/status line. Used by long-blocking tools\n // (ask_user_question wait loop) so SSE transports do not idle out.\n type: \"status\";\n message: string;\n }\n | {\n type: \"opportunity_draft_ready\";\n opportunityId: string;\n opportunity: Opportunity;\n /** Viewer-centric summary derived from interpretation.reasoning. */\n personalizedSummary?: string;\n /**\n * Minimal counterparty data for rendering the inline card without a\n * second-round-trip user lookup. Populated from the negotiation\n * candidate's profile; avatar is intentionally omitted (the card\n * falls back to initials) since UserNegotiationContext doesn't\n * carry avatars.\n */\n counterparty: {\n userId: string;\n name?: string;\n };\n },\n) => void;\n\ninterface RequestContext {\n originUrl?: string;\n traceEmitter?: TraceEmitter;\n /**\n * Signal for cooperative cancellation — propagates the caller's AbortSignal\n * into long-running graph nodes (e.g. orchestrator negotiation fan-out) so\n * they can stop emitting events when the chat session closes.\n *\n * The orchestrator branch checks this before persisting status flips or\n * pushing `opportunity_draft_ready` events. In-flight negotiations are not\n * forcibly cancelled — they finish or time out naturally via their park\n * window — but their results are suppressed once the signal trips.\n */\n abortSignal?: AbortSignal;\n}\n\n/**\n * AsyncLocalStorage for propagating request-scoped context through the protocol layer.\n * The host application is responsible for calling `requestContext.run()` to set the context.\n */\nexport const requestContext = new AsyncLocalStorage<RequestContext>();\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"/","sources":["shared/observability/trace.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CASlF;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CASlF;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAA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AAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACjF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CACrB,IAA2D;IAG3D,OAAO,CAAC,IAAY,EAAE,EAAE;IACtB,8DAA8D;IAC9D,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAClC,8DAA8D;QAC9D,UAAU,CAAC,KAAK,GAAG,UAAqB,GAAG,IAAW;YACpD,OAAO,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * Trace helpers — wrap async work in `graph_start`/`graph_end` or\n * `agent_start`/`agent_end` events automatically. Pulls the emitter from the\n * ambient request context so callers don't pass it manually.\n *\n * Available in two flavours:\n * - Functional: `traceGraph(name, fn)` / `traceAgent(name, fn)` — for inline\n * blocks. Returns whatever the wrapped function returns.\n * - Decorator: `@TraceGraph(name)` / `@TraceAgent(name)` — for class methods.\n * Uses the legacy decorator shape already adopted by `@Timed()`.\n */\nimport { requestContext } from \"./request-context.js\";\n\ntype Emitter = (event: Record<string, unknown>) => void;\n\nfunction getEmitter(): Emitter | undefined {\n const raw = requestContext.getStore()?.traceEmitter;\n // The ambient TraceEmitter is typed against a constrained event union; we\n // emit a broader shape here. Same wide-cast pattern used elsewhere\n // (see opportunity.graph.ts, opportunity.discover.ts).\n return raw as unknown as Emitter | undefined;\n}\n\n/**\n * Wrap an async function so it emits `graph_start` / `graph_end` events around\n * its execution. `durationMs` is measured in wall time. If the wrapped\n * function throws, `graph_end` still fires before the error propagates.\n *\n * Use ONLY for actual LangGraph compiled state machines (Opportunity graph,\n * Negotiation graph, etc). For logical groupings of inline work, use\n * `tracePhase` — it has a distinct visual in the trace UI so users can tell\n * \"this is a graph\" from \"this is a phase\".\n */\nexport async function traceGraph<T>(name: string, fn: () => Promise<T>): Promise<T> {\n const emit = getEmitter();\n emit?.({ type: \"graph_start\", name });\n const start = Date.now();\n try {\n return await fn();\n } finally {\n emit?.({ type: \"graph_end\", name, durationMs: Date.now() - start });\n }\n}\n\n/**\n * Wrap an async function so it emits `phase_start` / `phase_end` events around\n * its execution. Phases are logical groupings of inline async work — they\n * share container semantics with graphs (they can host agents) but render\n * differently in the trace UI to make it clear they're NOT LangGraph state\n * machines.\n */\nexport async function tracePhase<T>(name: string, fn: () => Promise<T>): Promise<T> {\n const emit = getEmitter();\n emit?.({ type: \"phase_start\", name });\n const start = Date.now();\n try {\n return await fn();\n } finally {\n emit?.({ type: \"phase_end\", name, durationMs: Date.now() - start });\n }\n}\n\n/**\n * Wrap an async function so it emits `agent_start` / `agent_end` events. The\n * optional `summarize` callback produces a short string shown in the trace\n * panel; receives the wrapped function's resolved value.\n */\nexport async function traceAgent<T>(\n name: string,\n fn: () => Promise<T>,\n summarize?: (value: T) => string | undefined,\n): Promise<T> {\n const emit = getEmitter();\n emit?.({ type: \"agent_start\", name });\n const start = Date.now();\n let value: T;\n try {\n value = await fn();\n } catch (err) {\n emit?.({ type: \"agent_end\", name, durationMs: Date.now() - start });\n throw err;\n }\n const durationMs = Date.now() - start;\n const summary = summarize?.(value);\n emit?.({ type: \"agent_end\", name, durationMs, ...(summary ? { summary } : {}) });\n return value;\n}\n\n/**\n * Builds a method decorator that wraps the decorated async method in the given\n * trace wrapper (`traceGraph` / `traceAgent` / `tracePhase`). Uses the legacy\n * decorator shape already adopted by `@Timed()`.\n */\nfunction traceDecorator(\n wrap: <T>(name: string, fn: () => Promise<T>) => Promise<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (name: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void {\n return (name: string) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {\n const original = descriptor.value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n descriptor.value = function (this: any, ...args: any[]) {\n return wrap(name, () => original.apply(this, args));\n };\n };\n}\n\n/**\n * Method decorator. Wraps the decorated async method in `traceGraph(name, ...)`.\n * Use on class methods that represent a logical \"graph\" (a sub-flow with\n * internal agent calls).\n *\n * @example\n * class RefinePhase {\n * @TraceGraph(\"Refine\")\n * async run() { ... }\n * }\n */\nexport const TraceGraph = traceDecorator(traceGraph);\n\n/**\n * Method decorator. Wraps the decorated async method in `traceAgent(name, ...)`.\n * Use on class methods that represent a single agent step (one LLM call,\n * one summarization, etc).\n *\n * @example\n * class ChatSummary {\n * @TraceAgent(\"Chat summary\")\n * async run() { ... }\n * }\n */\nexport const TraceAgent = traceDecorator(traceAgent);\n\n/**\n * Method decorator. Wraps the decorated async method in `tracePhase(name, ...)`.\n * Use for logical groupings of inline work that aren't LangGraph state machines.\n *\n * @example\n * class RefinePhase {\n * @TracePhase(\"Refine\")\n * async run() { ... }\n * }\n */\nexport const TracePhase = traceDecorator(tracePhase);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-context.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/chat-context.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;IAClC,4EAA4E;;IAE5E,wEAAwE;;IAExE,uDAAuD;;IAEvD,6EAA6E;;;;;;;;;;;;EAE7E,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-context.schema.js","sourceRoot":"/","sources":["shared/schemas/chat-context.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,4EAA4E;IAC5E,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACnC,wEAAwE;IACxE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,uDAAuD;IACvD,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,6EAA6E;IAC7E,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;CACzC,CAAC,CAAC","sourcesContent":["/**\n * ChatContextDigest — distilled view of a chat session used as anti-duplication\n * input for the decision-question generator. Each field is bounded so the\n * digest stays compact even as sessions grow.\n */\nimport { z } from \"zod\";\n\n/** Per-entry character cap. Mirrors the summarizer prompt's \"≤140 chars\" rule. */\nconst ENTRY_MAX_CHARS = 140;\nconst entry = z.string().max(ENTRY_MAX_CHARS);\n\nexport const ChatContextDigestSchema = z.object({\n /** Facts the user volunteered (stage, location, role, timing, scope, …). */\n statedFacts: z.array(entry).max(20),\n /** Questions the assistant asked that the user has not yet answered. */\n openQuestions: z.array(entry).max(10),\n /** User pushback / negative signals on prior cards. */\n rejectionReasons: z.array(entry).max(10),\n /** Facts the assistant has already surfaced from prior negotiation turns. */\n surfacedFindings: z.array(entry).max(20),\n});\n\nexport type ChatContextDigest = z.infer<typeof ChatContextDigestSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"discovery-question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/discovery-question.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,eAAO,MAAM,qBAAqB,yCAAuC,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,EAAE;IAC3B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9D,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * DiscoveryQuestionInput and nested types.\n * Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is\n * a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,\n * ChatContextDigest) to avoid Zod cross-schema runtime coupling.\n */\nimport { z } from \"zod\";\nimport type { DiscoveryNegotiationDigest } from \"./negotiation-digest.schema.js\";\nimport type { ChatContextDigest } from \"./chat-context.schema.js\";\n\n// ─── Primitives ───────────────────────────────────────────────────────────────\n\nexport const NegotiationRoleSchema = z.enum([\"agent\", \"patient\", \"peer\"]);\nexport type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;\n\nexport const DiscoveryTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\", \"outreach\", \"withdraw\", \"decline\", \"ask_user\"]),\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: NegotiationRoleSchema,\n otherUser: NegotiationRoleSchema,\n }),\n});\nexport type DiscoveryTurn = z.infer<typeof DiscoveryTurnSchema>;\n\nexport const DiscoveryOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n reasoning: z.string(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: NegotiationRoleSchema,\n })).optional(),\n reason: z.enum([\"turn_cap\", \"timeout\", \"screened_out\"]).optional(),\n});\nexport type DiscoveryOutcome = z.infer<typeof DiscoveryOutcomeSchema>;\n\nexport const DiscoveryNegotiationSchema = z.object({\n counterpartyId: z.string(),\n counterpartyHint: z.string(),\n indexContext: z.string(),\n turns: z.array(DiscoveryTurnSchema),\n outcome: DiscoveryOutcomeSchema,\n seedAssessmentScore: z.number().optional(),\n});\nexport type DiscoveryNegotiation = z.infer<typeof DiscoveryNegotiationSchema>;\n\nexport const DiscoverySummarySchema = z.object({\n totalCandidates: z.number(),\n opportunitiesFound: z.number(),\n noOpportunityCount: z.number(),\n timeoutCount: z.number(),\n roleDistribution: z.record(NegotiationRoleSchema, z.number()),\n});\nexport type DiscoverySummary = {\n totalCandidates: number;\n opportunitiesFound: number;\n noOpportunityCount: number;\n timeoutCount: number;\n roleDistribution: Partial<Record<NegotiationRole, number>>;\n};\n\nexport const DiscoverySourceProfileSchema = z.object({\n name: z.string().optional(),\n bio: z.string().optional(),\n location: z.string().optional(),\n skills: z.array(z.string()).optional(),\n interests: z.array(z.string()).optional(),\n});\nexport type DiscoverySourceProfile = z.infer<typeof DiscoverySourceProfileSchema>;\n\n// ─── Composite input (pure interface — references cross-schema types) ─────────\n\n/**\n * Full input to the question generator.\n * Defined as a pure interface so it can reference DiscoveryNegotiationDigest\n * and ChatContextDigest from sibling schemas without Zod runtime coupling.\n */\nexport interface DiscoveryQuestionInput {\n query: string;\n /** The seeker's global user_context paragraph (profile-replacing identity text). */\n userContext: string;\n negotiationDigests: DiscoveryNegotiationDigest[];\n summary: DiscoverySummary;\n chatContext?: ChatContextDigest;\n now: string;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/identity.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity.schema.js","sourceRoot":"/","sources":["shared/schemas/identity.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC","sourcesContent":["/**\n * UserIdentity DTO — pure Zod schema and inferred type.\n * Shared contract for the database/interface layer.\n *\n * A user is represented by their `users` identity row + `user_contexts`; there\n * is no separate \"profile\" entity. `identity` carries the thin name/bio/location\n * fields sourced from `users`, and `context` carries the synthesized identity\n * paragraph (the global `user_context` text).\n */\nimport { z } from \"zod\";\n\nexport const UserIdentitySchema = z.object({\n userId: z.string().optional(),\n identity: z.object({\n name: z.string(),\n bio: z.string(),\n location: z.string(),\n }),\n context: z.string(),\n});\n\nexport type UserIdentity = z.infer<typeof UserIdentitySchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-auth.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/mcp-auth.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;IACnC,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-auth.schema.js","sourceRoot":"/","sources":["shared/schemas/mcp-auth.schema.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * McpAuthInput — plain DTO extracted from the MCP HTTP request at the transport\n * edge before the protocol auth resolver is called. Keeps the shared auth\n * interface free of platform-specific `Request` coupling.\n */\nexport interface McpAuthInput {\n /** Authorization Bearer token (JWT or opaque session token). */\n bearerToken?: string;\n /** API key for agent/API-key authentication. */\n apiKey?: string;\n /** Client surface hint for UI branching (telegram vs web). */\n clientSurface?: 'telegram' | 'web';\n /** Telegram handle for identity verification (extracted from request headers). */\n telegramHandle?: string;\n /** Telegram username for identity verification (extracted from request headers). */\n telegramUsername?: string;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-digest.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/negotiation-digest.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,gCAAgC;IAC3C,0FAA0F;;IAE1F,gEAAgE;;IAEhE,uDAAuD;;IAEvD,qGAAqG;;IAErG;;;;OAIG;;IAEH,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9E,C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,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAC7C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAChD,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["/**\n * NegotiationDigest — compact, fixed-size structured summary of one discovery\n * negotiation. Produced by the negotiation summarizer; consumed by the\n * decision-question generator in place of raw negotiations.\n *\n * Goal: cap the question generator's per-negotiation prompt budget so that a\n * 10-candidate discovery turn produces a ~1.5 KB prompt instead of a 60+ KB\n * blob that stalls upstream LLM providers.\n */\nimport { z } from \"zod\";\n\n// LLMs ignore .max() length constraints often enough that strict validation\n// throws every call and forces a fallback. Slice strings down before validating\n// so JSON schema still advertises the limit but a small overshoot doesn't drop\n// the whole digest.\nconst clampedString = (maxLen: number) =>\n z.preprocess(\n (v) => (typeof v === \"string\" ? v.slice(0, maxLen) : v),\n z.string().min(1).max(maxLen),\n );\n\nexport const DiscoveryNegotiationDigestSchema = z.object({\n /** Abstract counterparty descriptor (no PII, no IDs). E.g. \"AI infra founder, Berlin\". */\n counterpartyHint: clampedString(120),\n /** The network the negotiation ran under (community prompt). */\n indexContext: clampedString(120),\n /** Whether the negotiation produced an opportunity. */\n outcomeRole: z.enum([\"opportunity\", \"no-opportunity\"]),\n /** When `outcomeRole === \"no-opportunity\"`, why the negotiation didn't yield one. Null otherwise. */\n outcomeReason: z.enum([\"turn_cap\", \"timeout\", \"rejected\", \"stalled\", \"screened_out\"]).nullable(),\n /**\n * One-sentence (≤180 chars) summary of the decisive moment or pattern in\n * this negotiation. Written for the downstream question generator — should\n * highlight a fact or tension that could inform a clarifying question.\n */\n keyTake: clampedString(180),\n /** Suggested roles agreed by both parties. Null when no agreement reached. */\n suggestedRoles: z\n .object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n })\n .nullable(),\n});\n\nexport type DiscoveryNegotiationDigest = z.infer<typeof DiscoveryNegotiationDigestSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"negotiation-state.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,gHAItB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,8DAA8D;AAC9D,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,cAAc,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUhC,oDAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpD,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;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,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD,CAAC;KACH,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,oDAAoD;IACpD,OAAO,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnE,CAAC,CAAC","sourcesContent":["/**\n * Negotiation state DTOs extracted from negotiation/negotiation.state.ts for\n * consumption by shared interfaces. This shared module owns the DTO schemas;\n * LangGraph Annotation.Root stays in the domain file.\n */\nimport { z } from \"zod\";\n\n// ─── Zod schemas (available for runtime validation) ───────────────────────────\n\n/**\n * Union of every negotiation turn action across protocol versions.\n *\n * v1 vocabulary: `propose | accept | reject | counter | question`.\n * v2 (client-advocate seat rules) renames `propose`→`outreach` and splits\n * `reject` into `withdraw` (initiator seat) / `decline` (counterparty seat).\n * Which subset is valid for a given turn depends on the task's\n * `protocolVersion` and the acting user's seat — see\n * `negotiation/negotiation.protocol.ts` for the seat-scoped schemas.\n */\nexport const NEGOTIATION_ACTIONS = [\n \"propose\", \"accept\", \"reject\", \"counter\", \"question\",\n \"outreach\", \"withdraw\", \"decline\",\n \"ask_user\",\n] as const;\nexport type NegotiationAction = (typeof NEGOTIATION_ACTIONS)[number];\n\n/** Negotiation seat under the v2 client-advocate protocol. */\nexport type NegotiationSeat = \"initiator\" | \"counterparty\";\n\n/** Negotiation protocol version stamped on task metadata. */\nexport type NegotiationProtocolVersion = \"v1\" | \"v2\";\n\n/**\n * Payload for the v2 `ask_user` action (P3.2): the negotiator pauses the\n * negotiation to consult its OWN client. `disclosureSubject` states what the\n * negotiator wants permission to share or needs to know; `draftQuestion` is\n * the negotiator's own phrasing, refined by the questioner's\n * `negotiation_inflight` preset before delivery.\n */\nexport const AskUserPayloadSchema = z.object({\n disclosureSubject: z.string(),\n draftQuestion: z.string().nullable().optional(),\n});\nexport type AskUserPayload = z.infer<typeof AskUserPayloadSchema>;\n\nexport const NegotiationTurnSchema = z.object({\n action: z.enum(NEGOTIATION_ACTIONS),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n /** Present when action is `ask_user` (v2, P3.2). */\n askUser: AskUserPayloadSchema.nullable().optional(),\n});\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\", \"screened_out\"]).optional(),\n});\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n// ─── Pure interfaces ──────────────────────────────────────────────────────────\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-assignment.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/network-assignment.schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mCAAmC,kCAAgC,CAAC;AACjF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,2BAA2B,6CAA2C,CAAC;AACpF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,4BAA4B,kCAAgC,CAAC;AAC1E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,qCAAqC,gDAA8C,CAAC;AACjG,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,6BAA6B,qCAAmC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,gCAAgC;;;;;;;;;EAG3C,CAAC;AACH,MAAM,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BAAoB;IACpB,mBAAmB;IACnB,SAAS;CACV,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,6BAA6B;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxF,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["/**\n * Shared assignment and opportunity-evidence DTOs.\n *\n * These schemas are graph-agnostic protocol contracts. Protocol graphs and\n * backend workers may use the inferred TypeScript types, while backend storage\n * remains responsible for schema/SQL details.\n */\nimport { z } from \"zod\";\n\nexport const NetworkAssignmentResourceTypeSchema = z.enum([\"premise\", \"intent\"]);\nexport type NetworkAssignmentResourceType = z.infer<typeof NetworkAssignmentResourceTypeSchema>;\n\nexport const NetworkAssignmentModeSchema = z.enum([\"automatic\", \"manual_override\"]);\nexport type NetworkAssignmentMode = z.infer<typeof NetworkAssignmentModeSchema>;\n\nexport const NetworkAssignmentScopeSchema = z.enum([\"global\", \"network\"]);\nexport type NetworkAssignmentScope = z.infer<typeof NetworkAssignmentScopeSchema>;\n\nexport const NetworkAssignmentPromptPresenceSchema = z.enum([\"none\", \"index\", \"member\", \"both\"]);\nexport type NetworkAssignmentPromptPresence = z.infer<typeof NetworkAssignmentPromptPresenceSchema>;\n\nexport const NetworkAssignmentPolicySchema = z.enum([\"unified-threshold-v1\"]);\nexport type NetworkAssignmentPolicy = z.infer<typeof NetworkAssignmentPolicySchema>;\n\nexport const NetworkAssignmentRawScoresSchema = z.object({\n indexScore: z.number().min(0).max(1).optional(),\n memberScore: z.number().min(0).max(1).optional(),\n});\nexport type NetworkAssignmentRawScores = z.infer<typeof NetworkAssignmentRawScoresSchema>;\n\nexport const NetworkAssignmentMetadataSchema = z.object({\n resourceType: NetworkAssignmentResourceTypeSchema,\n mode: NetworkAssignmentModeSchema,\n scope: NetworkAssignmentScopeSchema,\n policy: NetworkAssignmentPolicySchema,\n threshold: z.number().min(0).max(1),\n promptPresence: NetworkAssignmentPromptPresenceSchema,\n rawScores: NetworkAssignmentRawScoresSchema.optional(),\n finalScore: z.number().min(0).max(1),\n assigned: z.boolean(),\n reason: z.string().optional(),\n evaluator: z.string().optional(),\n source: z.string().optional(),\n createdAt: z.string().datetime().optional(),\n});\nexport type NetworkAssignmentMetadata = z.infer<typeof NetworkAssignmentMetadataSchema>;\n\nexport const OpportunityEvidenceKindSchema = z.enum([\n \"query_intent\",\n \"query_premise\",\n \"premise_similarity\",\n \"context_to_intent\",\n \"profile\",\n]);\nexport type OpportunityEvidenceKind = z.infer<typeof OpportunityEvidenceKindSchema>;\n\nexport const OpportunityEvidenceSchema = z.object({\n kind: OpportunityEvidenceKindSchema,\n networkId: z.string(),\n score: z.number().min(0).max(1).optional(),\n lens: z.string().optional(),\n discoverySource: z.enum([\"query\", \"premise-similarity\", \"context-to-intent\"]).optional(),\n matchedStrategies: z.array(z.string()).optional(),\n sourcePremiseId: z.string().optional(),\n candidatePremiseId: z.string().optional(),\n candidateIntentId: z.string().optional(),\n sourceContextId: z.string().optional(),\n payload: z.string().optional(),\n summary: z.string().optional(),\n assertionText: z.string().optional(),\n});\nexport type OpportunityEvidence = z.infer<typeof OpportunityEvidenceSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending-question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/pending-question.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE1E,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,wEAAwE;IACxE,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sHAAsH;IACtH,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending-question.schema.js","sourceRoot":"/","sources":["shared/schemas/pending-question.schema.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Lightweight projection of a persisted question, suitable for embedding\n * in tool results. Omits internal fields (actors, answer, status) that\n * are not needed by the chat agent or MCP client.\n */\nimport type { QuestionMode, QuestionPurpose } from \"./question.schema.js\";\n\nexport interface PendingQuestionSummary {\n id: string;\n title: string;\n prompt: string;\n options: Array<{ label: string; description: string }>;\n multiSelect: boolean;\n mode: QuestionMode;\n /** Internal generation purpose used for exact server-side filtering. */\n purpose?: QuestionPurpose;\n sourceType: string;\n sourceId: string;\n createdAt: string;\n expiresAt?: string;\n /** Internal actor projection used for defense-in-depth scoped filtering; tool responses strip it before returning. */\n actors?: Array<{ userId: string; networkId?: string }>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/question.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;IAC/B,+EAA+E;;IAE/E,iFAAiF;;;;;;;;EAEjF,CAAC;AAEH,eAAO,MAAM,cAAc;IACzB,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;IAE1E;;;;;;;;;;;;;;OAcG;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,kFAIvC,CAAC;AAEH,eAAO,MAAM,sBAAsB,oIAMjC,CAAC;AAEH,eAAO,MAAM,0BAA0B;IAzCrC,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;IAE1E;;;;;;;;;;;;;;OAcG;;;;IAqBH,0FAA0F;;;;;;;;;;;;;;;;;;;;;;;;EAE1F,CAAC;AAEH,eAAO,MAAM,+BAA+B;;QA/C1C,+EAA+E;;QAE/E,yDA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AAC,QAAQ,EAAE;IAChC,iEAAiE;IACjE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,uCAAuC;IACvC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,iEAAiE;IACjE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,+BAA+B;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,2DAA2D;IAC3D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9B,CAAC,CAAC","sourcesContent":["/**\n * Question — public structured shape consumed by frontend renderers and MCP\n * elicitation dispatch. Mirrors the brainstorming AskUserQuestion skill so a\n * Question can be rendered identically across surfaces.\n *\n * `QuestionWithStrategy` extends the public shape with internal `strategy`\n * and QUD underspecification tags used by generator guardrails and persisted\n * metadata. Both tags are stripped before the public payload leaves the\n * generator — users never see them.\n */\nimport { z } from \"zod\";\n\nexport const QuestionOptionSchema = z.object({\n /** Display text. Suffix \" (Recommended)\" on the safest path; list it first. */\n label: z.string().min(1).max(120),\n /** Explains the consequence of choosing this option, not just its definition. */\n description: z.string().min(1).max(280),\n});\n\nexport const QuestionSchema = z.object({\n /** ≤12 chars. Noun of the decision domain — e.g. \"Stage\", \"Timing\", \"Role\". */\n title: z.string().min(1).max(12),\n /** ≤2 sentences, ≤400 chars. Ends in a question mark. */\n prompt: z.string().min(1).max(400),\n /** 2–4 options. No explicit \"Other\" — clients provide that automatically. */\n options: z.array(QuestionOptionSchema).min(2).max(4),\n /** True when options are not mutually exclusive (priorities, bundles). */\n multiSelect: z.boolean(),\n /**\n * Optional provenance line rendered as a muted chip above the prompt\n * (e.g. \"based on 18 people matching this intent\"). Aggregate counts only —\n * never individual identities (pool_discovery k-anonymity invariant).\n *\n * Declared `.nullable().optional()` (not bare `.optional()`) so the schema\n * survives OpenAI/OpenRouter strict structured-output conversion, which\n * rejects optional-without-nullable fields (see createStructuredModel in the\n * questioner agent). The `.transform()` normalizes an LLM-returned `null`\n * back to `undefined` so a null is NEVER persisted or treated as\n * \"evidence present\": real string evidence flows through unchanged, while\n * both `null` and omitted read as absent everywhere downstream\n * (e.g. the intent-recovery `!question.evidence` selection filter and the\n * pool_discovery provenance chip).\n */\n evidence: z.string().min(1).max(160).nullable().optional().transform((value) => value ?? undefined),\n});\n\n/** Canonical QUD repair categories for underspecified intents/questions. */\nexport const UnderspecificationTypeSchema = z.enum([\n \"missing_constituent\",\n \"missing_constraint\",\n \"open_alternative_set\",\n]);\n\nexport const QuestionStrategySchema = z.enum([\n \"refine_intent\",\n \"surface_missing_detail\",\n \"open_adjacent_thread\",\n \"reflective_summary\",\n \"surface_emergent_knowledge\",\n]);\n\nexport const QuestionWithStrategySchema = QuestionSchema.extend({\n strategy: QuestionStrategySchema,\n /** QUD repair category, or null when the question is not an underspecification repair. */\n underspecificationType: UnderspecificationTypeSchema.nullable(),\n});\n\nexport const QuestionGeneratorResponseSchema = z.object({\n questions: z.array(QuestionWithStrategySchema).max(3),\n});\n\nexport type QuestionOption = z.infer<typeof QuestionOptionSchema>;\nexport type Question = z.infer<typeof QuestionSchema>;\nexport type UnderspecificationType = z.infer<typeof UnderspecificationTypeSchema>;\nexport type QuestionStrategy = z.infer<typeof QuestionStrategySchema>;\nexport type QuestionWithStrategy = z.infer<typeof QuestionWithStrategySchema>;\nexport type QuestionGeneratorResponse = z.infer<typeof QuestionGeneratorResponseSchema>;\n\n/**\n * Internal generator output: public questions plus parallel strategy and QUD\n * taxonomy arrays for metadata-only consumption. The generator emits this;\n * callers forward only `questions` to renderers.\n */\nexport interface QuestionGenerationResult {\n questions: Question[];\n strategies: QuestionStrategy[];\n underspecificationTypes: Array<UnderspecificationType | null>;\n}\n\n// ─── Persistence types (opportunity-style composable jsonb) ──────────────────\n\n/** Internal reason a question was generated, orthogonal to mode and QUD metadata. */\nexport const NegotiationQuestionPurposeSchema = z.enum([\n \"uptake\",\n \"stalled_followup\",\n \"inflight_consultation\",\n]);\nexport const QuestionPurposeSchema = z.enum([\n \"uptake\",\n \"recovery\",\n \"stalled_followup\",\n \"inflight_consultation\",\n]);\n\n/**\n * Producer-supplied candidate binding. The API re-resolves every field from\n * authoritative rows before generation; callers cannot mint provenance.\n */\nexport const NegotiationQuestionCandidateSchema = z.object({\n purpose: NegotiationQuestionPurposeSchema,\n recipientUserId: z.string().min(1),\n recipientIntentId: z.string().min(1),\n opportunityId: z.string().min(1),\n taskId: z.string().min(1).optional(),\n networkId: z.string().min(1),\n /** Uptake only: exact low-authority counterparty eligibility binding. */\n counterpartyUserId: z.string().min(1).optional(),\n counterpartyIntentId: z.string().min(1).optional(),\n counterpartyFelicityAuthority: z.number().min(0).max(100).optional(),\n}).superRefine((candidate, ctx) => {\n const taskRequired = candidate.purpose !== \"uptake\";\n if (taskRequired !== Boolean(candidate.taskId)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"taskId\"],\n message: taskRequired\n ? \"task-backed negotiation questions require taskId\"\n : \"uptake questions must not carry a synthetic taskId\",\n });\n }\n const hasCounterparty = Boolean(candidate.counterpartyUserId) || Boolean(candidate.counterpartyIntentId);\n if (candidate.purpose === \"uptake\" && (!candidate.counterpartyUserId || !candidate.counterpartyIntentId || candidate.counterpartyFelicityAuthority === undefined)) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"counterpartyUserId\"], message: \"uptake questions require exact counterparty provenance\" });\n }\n if (candidate.purpose !== \"uptake\" && (hasCounterparty || candidate.counterpartyFelicityAuthority !== undefined)) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"counterpartyUserId\"], message: \"only uptake questions carry counterparty provenance\" });\n }\n});\n\n/**\n * Durable server-only routing and freshness envelope for negotiation-family\n * questions. This object is stripped from every REST/MCP projection.\n */\nexport const NegotiationQuestionProvenanceSchema = z.object({\n version: z.literal(1),\n purpose: NegotiationQuestionPurposeSchema,\n recipientUserId: z.string().min(1),\n recipientIntentId: z.string().min(1),\n opportunityId: z.string().min(1),\n taskId: z.string().min(1).optional(),\n networkId: z.string().min(1),\n intentFingerprint: z.string().min(1),\n opportunityStatus: z.enum([\"latent\", \"draft\", \"negotiating\", \"pending\", \"stalled\", \"accepted\", \"rejected\", \"expired\"]),\n opportunityUpdatedAt: z.string().datetime(),\n taskState: z.enum([\"submitted\", \"working\", \"input_required\", \"completed\", \"canceled\", \"failed\", \"rejected\", \"auth_required\", \"waiting_for_agent\", \"claimed\"]).optional(),\n taskUpdatedAt: z.string().datetime().optional(),\n /** Uptake only: exact low-authority counterparty eligibility binding. */\n counterpartyUserId: z.string().min(1).optional(),\n counterpartyIntentId: z.string().min(1).optional(),\n counterpartyFelicityAuthority: z.number().min(0).max(100).optional(),\n /** Stable per-generation position so retries dedupe without reducing cardinality. */\n questionOrdinal: z.number().int().min(0).max(2),\n}).superRefine((provenance, ctx) => {\n const taskRequired = provenance.purpose !== \"uptake\";\n if (taskRequired && (!provenance.taskId || !provenance.taskState || !provenance.taskUpdatedAt)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"taskId\"],\n message: \"task-backed provenance requires task id, state, and updatedAt\",\n });\n }\n if (!taskRequired && (provenance.taskId || provenance.taskState || provenance.taskUpdatedAt)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"taskId\"],\n message: \"uptake provenance must not carry task fields\",\n });\n }\n if (provenance.purpose === \"stalled_followup\" && provenance.taskState !== \"completed\") {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"taskState\"], message: \"follow-up task must be completed\" });\n }\n if (provenance.purpose === \"inflight_consultation\" && provenance.taskState !== \"input_required\") {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"taskState\"], message: \"inflight task must be input_required\" });\n }\n const hasCounterparty = Boolean(provenance.counterpartyUserId) || Boolean(provenance.counterpartyIntentId);\n if (provenance.purpose === \"uptake\" && (!provenance.counterpartyUserId || !provenance.counterpartyIntentId || provenance.counterpartyFelicityAuthority === undefined)) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"counterpartyUserId\"], message: \"uptake provenance requires exact counterparty eligibility\" });\n }\n if (provenance.purpose !== \"uptake\" && (hasCounterparty || provenance.counterpartyFelicityAuthority !== undefined)) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"counterpartyUserId\"], message: \"only uptake provenance carries counterparty eligibility\" });\n }\n});\n\nexport const QuestionModeSchema = z.enum([\n \"discovery\",\n \"intent\",\n \"enrichment\",\n \"negotiation\",\n // Negotiator-initiated mid-negotiation client questions (ask_user action, P3).\n // Distinct from \"negotiation\", which covers post-stall questions only.\n \"negotiation_inflight\",\n // Orchestrator-initiated mid-conversation questions (ask_user_question tool).\n \"chat\",\n // Pool-discriminator questions mined from the intent's candidate pool\n // (IND-418). Synthesized deterministically — no generator LLM call.\n \"pool_discovery\",\n]);\n\n/** One server-side candidate→side assignment (never serialized to clients). */\nexport const QuestionPoolAssignmentSchema = z.object({\n opportunityId: z.string().min(1),\n side: z.string().min(1),\n});\n\n/**\n * One mined discriminator carried inside a pool_discovery question's\n * detection (the asked one plus ranked alternates for interview-mode\n * chaining). INTERNAL — the read path strips `detection.pool` before any\n * payload leaves the server.\n */\nexport const QuestionPoolDiscriminatorSchema = z.object({\n label: z.string().min(1),\n questionSeed: z.string().min(1),\n sides: z.array(z.string().min(1)).min(2).max(3),\n /** Verified-assignment count per side label. */\n sideCounts: z.record(z.string(), z.number()),\n voi: z.number(),\n evidenceRate: z.number(),\n /** Discriminator embedding retained for durable semantic novelty checks. */\n embedding: z.array(z.number().finite()).min(1).max(4096).optional(),\n /** Model that generated `embedding`; mismatches must fall back to text. */\n embeddingModel: z.string().min(1).optional(),\n /** Verified assignments only — the P3 re-rank input. */\n assignments: z.array(QuestionPoolAssignmentSchema),\n});\n\n/** Pool snapshot stored on pool_discovery questions (server-side only). */\nexport const QuestionPoolSnapshotSchema = z.object({\n poolSize: z.number().int().min(0),\n /** ISO-8601 timestamp of the mining pass. */\n minedAt: z.string().min(1),\n /** Discovery run that produced the pool, when known. */\n runId: z.string().optional(),\n /** Intent payload snippet (≤160 chars) — reused by chained questions' evidence chips. */\n intentText: z.string().optional(),\n /** Stable hash of the full normalized payload + summary used for freshness. */\n intentFingerprint: z.string().min(1).optional(),\n /** Exact bounded candidate pool. Optional for legacy rows/jobs created before IND-422. */\n opportunityIds: z.array(z.string().uuid()).optional(),\n /** The discriminator this question asks about. */\n discriminator: QuestionPoolDiscriminatorSchema,\n /** Remaining ranked discriminators for interview-mode chaining. */\n alternates: z.array(QuestionPoolDiscriminatorSchema),\n});\n\n/** Internal delivery ledger for proactive pool-question pushes (IND-421). */\nexport const QuestionPoolPushSchema = z.object({\n version: z.literal(1),\n source: z.literal(\"pool_discovery\"),\n recipientId: z.string().min(1),\n intentId: z.string().min(1),\n cycleKey: z.string().min(1),\n messageId: z.string().min(1),\n surfaces: z.tuple([\n z.literal(\"personal_agent_badge\"),\n z.literal(\"negotiator_dm\"),\n ]),\n claimedAt: z.string().min(1),\n deliveryStatus: z.enum([\"claimed\", \"delivered\", \"suppressed\", \"failed\"]),\n conversationId: z.string().min(1).optional(),\n deliveredAt: z.string().min(1).optional(),\n suppressedAt: z.string().min(1).optional(),\n failure: z.string().min(1).max(500).optional(),\n});\n\n/** Durable request state for proactive pool-question delivery. */\nexport const QuestionPoolPushRequestStatusSchema = z.enum([\"requested\", \"suppressed\"]);\n\n/** Private snapshot for a post-discovery recovery refinement question. */\nexport const QuestionRecoverySnapshotSchema = z.object({\n version: z.literal(1),\n intentFingerprint: z.string().regex(/^[a-f0-9]{64}$/),\n completionSource: z.enum([\"intent_creation\", \"from_intent\", \"discovery_run\"]),\n /** Privacy-safe aggregate only; raw negotiation evidence is never persisted. */\n rejectedNegotiationCount: z.number().int().min(1).max(50).optional(),\n /** Bounded internal correlation id for an asynchronous discovery run. */\n runId: z.string().min(1).max(128).optional(),\n});\n\n/** Internal reason a pending question was voided. */\nexport const QuestionVoidedReasonSchema = z.enum([\n \"pool_drift\",\n \"intent_edit\",\n \"recovery_drift\",\n \"negotiation_stale\",\n]);\n\n/** Permanent reasons that terminalize an unclaimed proactive push request. */\nexport const QuestionPoolPushRequestReasonSchema = z.enum([\n \"question_lifecycle\",\n \"intent_lifecycle\",\n \"malformed_source\",\n \"malformed_actor\",\n \"malformed_pool\",\n \"malformed_cycle\",\n \"visited\",\n \"pool_size\",\n \"voi\",\n \"cycle_budget\",\n]);\n\nexport const QuestionDetectionSchema = z.object({\n /** Which preset mode generated this question. */\n mode: QuestionModeSchema,\n /** Internal reason for generation; independent of mode and QUD repair metadata. */\n purpose: QuestionPurposeSchema.optional(),\n /** Exact negotiation recipient/intent/task routing provenance. Internal only. */\n negotiation: NegotiationQuestionProvenanceSchema.optional(),\n /** Entity type that triggered generation (e.g. \"opportunity\", \"intent\", \"profile\"). */\n sourceType: z.string().min(1),\n /** ID of the triggering entity. */\n sourceId: z.string().min(1),\n /** Optional intent ID that was the root cause. */\n triggeredBy: z.string().optional(),\n /** ISO-8601 timestamp of generation. */\n timestamp: z.string().min(1),\n /** Generation strategy persisted as internal metadata. */\n strategy: QuestionStrategySchema.optional(),\n /** QUD repair category persisted as internal metadata. */\n underspecificationType: UnderspecificationTypeSchema.nullable().optional(),\n /** ID of the assistant message that triggered this question. Used by the frontend to anchor the question card inline. */\n messageId: z.string().optional(),\n /** Durable server-only conversation session binding used to validate messageId. */\n sessionId: z.string().optional(),\n /**\n * pool_discovery only: the mined pool snapshot (assignments + alternates).\n * INTERNAL — stripped from every client-facing read (web + MCP).\n */\n pool: QuestionPoolSnapshotSchema.optional(),\n /** Post-discovery intent recovery snapshot. Internal only. */\n recovery: QuestionRecoverySnapshotSchema.optional(),\n /** Durable request marker written before enqueueing proactive delivery. Internal only. */\n pushRequestedAt: z.string().min(1).optional(),\n /** Last bounded recovery sweep that selected this request. Internal only. */\n pushRecoveryAttemptedAt: z.string().min(1).optional(),\n /** Durable request outcome. Internal only. */\n pushRequestStatus: QuestionPoolPushRequestStatusSchema.optional(),\n /** Permanent suppression reason for an unclaimed request. Internal only. */\n pushRequestReason: QuestionPoolPushRequestReasonSchema.optional(),\n /** ISO-8601 timestamp at which an unclaimed request was suppressed. Internal only. */\n pushRequestSuppressedAt: z.string().min(1).optional(),\n /** Internal proactive delivery state. Never serialize to public clients. */\n push: QuestionPoolPushSchema.optional(),\n /** Internal reason this question was voided after pool or intent drift. */\n voidedReason: QuestionVoidedReasonSchema.optional(),\n /** Authoritative successful-delivery ledger timestamp. Internal only. */\n pushedAt: z.string().min(1).optional(),\n}).superRefine((detection, ctx) => {\n const negotiationFamily = detection.mode === \"negotiation\" || detection.mode === \"negotiation_inflight\";\n if (negotiationFamily !== Boolean(detection.negotiation)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"negotiation\"],\n message: negotiationFamily\n ? \"negotiation-family detection requires exact provenance\"\n : \"non-negotiation detection must not carry negotiation provenance\",\n });\n }\n if (detection.negotiation) {\n if (detection.sourceType !== \"opportunity\" || detection.sourceId !== detection.negotiation.opportunityId) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"sourceId\"], message: \"negotiation sourceId must equal opportunityId\" });\n }\n if (detection.purpose !== detection.negotiation.purpose) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"purpose\"], message: \"detection purpose must match negotiation provenance\" });\n }\n if (detection.mode === \"negotiation_inflight\" && detection.negotiation.purpose !== \"inflight_consultation\") {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"negotiation\", \"purpose\"], message: \"inflight mode requires inflight purpose\" });\n }\n if (detection.mode === \"negotiation\" && detection.negotiation.purpose === \"inflight_consultation\") {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [\"negotiation\", \"purpose\"], message: \"ordinary negotiation mode cannot carry inflight purpose\" });\n }\n }\n if (\n detection.mode === \"pool_discovery\"\n && (!detection.triggeredBy?.trim() || detection.triggeredBy !== detection.sourceId)\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"triggeredBy\"],\n message: \"pool_discovery triggeredBy must be non-empty and equal sourceId\",\n });\n }\n if (detection.purpose === \"recovery\") {\n if (\n detection.mode !== \"intent\"\n || detection.sourceType !== \"intent\"\n || !detection.triggeredBy?.trim()\n || detection.triggeredBy !== detection.sourceId\n || !detection.recovery\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"recovery\"],\n message: \"recovery purpose requires intent mode/source, equal trigger provenance, and a recovery snapshot\",\n });\n }\n } else if (detection.recovery) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"purpose\"],\n message: \"recovery snapshot requires recovery purpose\",\n });\n }\n if (detection.pushRequestStatus && !detection.pushRequestedAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"pushRequestedAt\"],\n message: \"push request state requires a request timestamp\",\n });\n }\n if (detection.pushRecoveryAttemptedAt && !detection.pushRequestedAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"pushRequestedAt\"],\n message: \"push recovery attempts require a request timestamp\",\n });\n }\n if (detection.pushRequestStatus === \"suppressed\") {\n if (!detection.pushRequestReason) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"pushRequestReason\"],\n message: \"suppressed push requests require a reason\",\n });\n }\n if (!detection.pushRequestSuppressedAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"pushRequestSuppressedAt\"],\n message: \"suppressed push requests require a timestamp\",\n });\n }\n }\n});\n\nexport const QuestionActorSchema = z.object({\n /** The user this question is for. */\n userId: z.string().min(1),\n /** Optional network context. */\n networkId: z.string().optional(),\n /** Actor's role in the question — currently always \"subject\". */\n role: z.literal(\"subject\"),\n});\n\nexport const QuestionAnswerSchema = z.object({\n /** Option labels the user selected. */\n selectedOptions: z.array(z.string()),\n /** Free-text input when the user chose \"Other\" or elaborated. */\n freeText: z.string().optional(),\n /** User ID of the answerer. */\n answeredBy: z.string().min(1),\n /** ISO-8601 timestamp of when the answer was submitted. */\n answeredAt: z.string().min(1),\n});\n\nexport type NegotiationQuestionPurpose = z.infer<typeof NegotiationQuestionPurposeSchema>;\nexport type NegotiationQuestionCandidate = z.infer<typeof NegotiationQuestionCandidateSchema>;\nexport type NegotiationQuestionProvenance = z.infer<typeof NegotiationQuestionProvenanceSchema>;\nexport type QuestionPurpose = z.infer<typeof QuestionPurposeSchema>;\nexport type QuestionMode = z.infer<typeof QuestionModeSchema>;\nexport type QuestionDetection = z.infer<typeof QuestionDetectionSchema>;\nexport type QuestionActor = z.infer<typeof QuestionActorSchema>;\nexport type QuestionAnswer = z.infer<typeof QuestionAnswerSchema>;\nexport type QuestionPoolAssignment = z.infer<typeof QuestionPoolAssignmentSchema>;\nexport type QuestionPoolDiscriminator = z.infer<typeof QuestionPoolDiscriminatorSchema>;\nexport type QuestionPoolSnapshot = z.infer<typeof QuestionPoolSnapshotSchema>;\nexport type QuestionRecoverySnapshot = z.infer<typeof QuestionRecoverySnapshotSchema>;\nexport type QuestionPoolPush = z.infer<typeof QuestionPoolPushSchema>;\nexport type QuestionVoidedReason = z.infer<typeof QuestionVoidedReasonSchema>;\nexport type QuestionPoolPushRequestStatus = z.infer<typeof QuestionPoolPushRequestStatusSchema>;\nexport type QuestionPoolPushRequestReason = z.infer<typeof QuestionPoolPushRequestReasonSchema>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lucide.icon-catalog.d.ts","sourceRoot":"/","sources":["shared/ui/lucide.icon-catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kEAAkE;AAClE,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAiE3C,CAAC;AAIX;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAKzE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAG9E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAK,GAAG,MAAM,CAG3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lucide.icon-catalog.js","sourceRoot":"/","sources":["shared/ui/lucide.icon-catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAErD,qEAAqE;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,WAAW;IACX,WAAW;IACX,OAAO;IACP,KAAK;IACL,MAAM;IACN,OAAO;IACP,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,QAAQ;IACR,KAAK;IACL,WAAW;IACX,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,aAAa;IACb,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,aAAa;IACb,OAAO;IACP,MAAM;IACN,MAAM;IACN,UAAU;IACV,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,WAAW;IACX,OAAO;IACP,gBAAgB;IAChB,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,MAAM;IACN,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,aAAa;IACb,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,YAAY;IACZ,aAAa;IACb,MAAM;IACN,YAAY;IACZ,WAAW;IACX,MAAM;IACN,KAAK;IACL,SAAS;IACT,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,cAAc;CACN,CAAC;AAEX,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAA+B;IAC/D,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,yBAAyB,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClE,IAAI,CAAC,UAAU;QAAE,OAAO,yBAAyB,CAAC;IAClD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAA+B;IACpE,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,yBAAyB,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAQ,GAAG,EAAE;IACjD,MAAM,IAAI,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/**\n * Lucide icon catalog for home view section headings.\n * Icon names are kebab-case for use with lucide-react DynamicIcon (name prop).\n * Used by home graph LLM to pick an icon per dynamic section.\n */\n\n/** Default icon when LLM returns invalid or missing icon name. */\nexport const DEFAULT_HOME_SECTION_ICON = 'hourglass';\n\n/** Allowed icon names for home sections (subset of Lucide icons). */\nexport const HOME_SECTION_ICON_NAMES: readonly string[] = [\n 'hourglass',\n 'telescope',\n 'route',\n 'bot',\n 'user',\n 'users',\n 'message-circle',\n 'sparkles',\n 'handshake',\n 'target',\n 'zap',\n 'lightbulb',\n 'compass',\n 'globe',\n 'heart',\n 'star',\n 'trending-up',\n 'briefcase',\n 'rocket',\n 'search',\n 'filter',\n 'list',\n 'layout-grid',\n 'inbox',\n 'send',\n 'mail',\n 'calendar',\n 'clock',\n 'timer',\n 'flag',\n 'bookmark',\n 'link',\n 'share-2',\n 'thumbs-up',\n 'award',\n 'graduation-cap',\n 'building-2',\n 'network',\n 'git-branch',\n 'code',\n 'palette',\n 'pen-tool',\n 'folder',\n 'file-text',\n 'bar-chart',\n 'pie-chart',\n 'activity',\n 'arrow-right',\n 'chevron-right',\n 'circle-dot',\n 'circle-user',\n 'user-plus',\n 'user-check',\n 'users-round',\n 'hand',\n 'hand-metal',\n 'megaphone',\n 'bell',\n 'eye',\n 'eye-off',\n 'lock',\n 'unlock',\n 'shield',\n 'shield-check',\n] as const;\n\nconst ALLOWED_SET = new Set<string>(HOME_SECTION_ICON_NAMES);\n\n/**\n * Normalize icon name: lowercase, strip spaces (allow kebab-case from LLM).\n */\nexport function normalizeIconName(name: string | undefined | null): string {\n if (name == null || typeof name !== 'string') return DEFAULT_HOME_SECTION_ICON;\n const normalized = name.trim().toLowerCase().replace(/\\s+/g, '-');\n if (!normalized) return DEFAULT_HOME_SECTION_ICON;\n return normalized;\n}\n\n/**\n * Validate and return an allowed icon name; fallback to default if unknown.\n */\nexport function resolveHomeSectionIcon(name: string | undefined | null): string {\n const normalized = normalizeIconName(name);\n return ALLOWED_SET.has(normalized) ? normalized : DEFAULT_HOME_SECTION_ICON;\n}\n\n/**\n * Return a formatted list of icon names for LLM prompts (comma-separated, truncated if needed).\n */\nexport function getIconNamesForPrompt(maxItems = 60): string {\n const list = HOME_SECTION_ICON_NAMES.slice(0, maxItems);\n return list.join(', ');\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"social-label.d.ts","sourceRoot":"/","sources":["shared/utils/social-label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEt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ACb,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC;gBAC1B,MAAM;YACR,KAAK,SAAS;gBACZ,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC;gBACzB,MAAM;YACR,KAAK,QAAQ;gBACX,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;gBACxB,MAAM;YACR,KAAK,UAAU;gBACb,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC;gBAC1B,MAAM;YACR,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,IAAI,CAAC,MAAM,CAAC,QAAQ;oBAAE,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;gBAC3C,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC9B,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { UserSocial } from '../interfaces/database.interface.js';\n\n/**\n * Infers a canonical social label from a URL or handle string.\n *\n * @param value - A URL or plain handle string.\n * @returns One of `'linkedin' | 'twitter' | 'github' | 'telegram' | 'custom'`.\n */\nexport function detectSocialLabel(value: string): string {\n const lower = value.toLowerCase();\n if (lower.includes('linkedin.com')) return 'linkedin';\n if (lower.includes('x.com') || lower.includes('twitter.com')) return 'twitter';\n if (lower.includes('github.com')) return 'github';\n if (lower.includes('t.me') || lower.includes('telegram.me')) return 'telegram';\n return 'custom';\n}\n\n/** Flat enrichment request shape produced from a UserSocial array. */\nexport interface EnrichmentRequest {\n linkedin?: string;\n twitter?: string;\n github?: string;\n telegram?: string;\n websites?: string[];\n}\n\n/**\n * Converts a `UserSocial[]` array into the flat shape expected by enrichment tools.\n * Custom-labelled entries are collected into `websites[]`.\n *\n * @param socials - Row array from `user_socials`.\n * @returns Flat enrichment request object (omits keys that have no value).\n */\nexport function socialsToEnrichmentRequest(socials: UserSocial[]): EnrichmentRequest {\n const result: EnrichmentRequest = {};\n for (const s of socials) {\n switch (s.label) {\n case 'linkedin':\n result.linkedin = s.value;\n break;\n case 'twitter':\n result.twitter = s.value;\n break;\n case 'github':\n result.github = s.value;\n break;\n case 'telegram':\n result.telegram = s.value;\n break;\n case 'custom': {\n if (!result.websites) result.websites = [];\n result.websites.push(s.value);\n break;\n }\n }\n }\n return result;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"telegram-handle.d.ts","sourceRoot":"/","sources":["shared/utils/telegram-handle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAUrF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"telegram-handle.js","sourceRoot":"/","sources":["shared/utils/telegram-handle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAA8B;IACpE,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAEtB,MAAM,QAAQ,GAAG,GAAG;SACjB,IAAI,EAAE;SACN,OAAO,CAAC,2CAA2C,EAAE,EAAE,CAAC;SACxD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;SACjB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAErB,OAAO,QAAQ,IAAI,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC","sourcesContent":["/**\n * Normalize a raw Telegram social value into a bare handle.\n * Trims surrounding whitespace, strips URL prefixes (t.me, telegram.me),\n * strips @ prefix, and strips query/hash/path suffixes.\n * Returns null if the result is not a valid Telegram handle (5-32 alphanumeric/underscore chars).\n */\nexport function normalizeTelegramHandle(raw: string | null | undefined): string | null {\n if (!raw) return null;\n\n const stripped = raw\n .trim()\n .replace(/^(?:https?:\\/\\/)?(?:t\\.me|telegram\\.me)\\//, '')\n .replace(/^@/, '')\n .split(/[/?#]/)[0];\n\n return stripped && /^[A-Za-z0-9_]{5,32}$/.test(stripped) ? stripped : null;\n}\n"]}