@indexnetwork/protocol 20.0.1-rc.485.1 → 21.0.0-rc.487.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 (264) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/IMPLEMENTATION.md +1 -1
  3. package/dist/agents/{ports/agent.dispatcher.port.d.ts → agent.dispatcher.port.d.ts} +2 -2
  4. package/dist/agents/agent.module.d.ts +19 -0
  5. package/dist/agents/agent.module.js +11 -0
  6. package/dist/agents/{ports/agent.repository.port.d.ts → agent.repository.port.d.ts} +1 -1
  7. package/dist/agents/{application/agent.tools.d.ts → agent.tools.d.ts} +2 -2
  8. package/dist/agents/{application/agent.tools.js → agent.tools.js} +2 -2
  9. package/dist/chat/chat-streaming.types.d.ts +1 -1
  10. package/dist/chat/chat.agent.d.ts +1 -7
  11. package/dist/chat/chat.agent.js +0 -94
  12. package/dist/chat/chat.persona.d.ts +1 -2
  13. package/dist/chat/chat.prompt.js +1 -1
  14. package/dist/chat/chat.prompt.modules.d.ts +0 -2
  15. package/dist/chat/negotiator.prompt.d.ts +1 -1
  16. package/dist/chat/negotiator.prompt.js +1 -1
  17. package/dist/contacts/contact.module.d.ts +8 -0
  18. package/dist/contacts/contact.module.js +6 -0
  19. package/dist/contacts/{ports/contact.repository.port.d.ts → contact.repository.port.d.ts} +1 -1
  20. package/dist/contacts/{application/contact.tools.d.ts → contact.tools.d.ts} +2 -2
  21. package/dist/contacts/{application/contact.tools.js → contact.tools.js} +2 -2
  22. package/dist/contexts/context.module.d.ts +13 -0
  23. package/dist/contexts/context.module.js +12 -0
  24. package/dist/contexts/{ports/participant-context.tools.port.d.ts → context.tools.port.d.ts} +1 -1
  25. package/dist/discovery/hyde.graph.d.ts +1 -1
  26. package/dist/discovery/hyde.state.d.ts +1 -1
  27. package/dist/enrichment/enrichment.graph.d.ts +1 -1
  28. package/dist/enrichment/enrichment.state.d.ts +1 -1
  29. package/dist/enrichment/enrichment.tools.context-read.d.ts +1 -1
  30. package/dist/enrichment/enrichment.tools.context-write.d.ts +1 -1
  31. package/dist/enrichment/enrichment.tools.d.ts +1 -1
  32. package/dist/enrichment/enrichment.tools.helpers.d.ts +1 -1
  33. package/dist/index.d.ts +86 -87
  34. package/dist/index.js +61 -62
  35. package/dist/intents/graph/intent.graph.d.ts +1 -1
  36. package/dist/intents/graph/intent.graph.infer.d.ts +1 -1
  37. package/dist/intents/graph/intent.graph.reconcile.d.ts +1 -1
  38. package/dist/intents/graph/intent.graph.shared.d.ts +1 -1
  39. package/dist/intents/graph/intent.graph.state.d.ts +1 -1
  40. package/dist/intents/intent.module.d.ts +1 -1
  41. package/dist/maintenance/maintenance.graph.js +3 -3
  42. package/dist/mcp/mcp.server.js +1 -1
  43. package/dist/negotiations/{application/insight.generator.js → insight.generator.js} +4 -4
  44. package/dist/negotiations/{application/negotiation.agent.d.ts → negotiation.agent.d.ts} +6 -6
  45. package/dist/negotiations/{application/negotiation.agent.js → negotiation.agent.js} +9 -9
  46. package/dist/negotiations/negotiation.attribution.d.ts +1 -1
  47. package/dist/negotiations/{application/negotiation.candidates.d.ts → negotiation.candidates.d.ts} +5 -5
  48. package/dist/negotiations/{application/negotiation.candidates.js → negotiation.candidates.js} +1 -1
  49. package/dist/negotiations/{domain/negotiation.consultation-policy.d.ts → negotiation.consultation-policy.d.ts} +2 -2
  50. package/dist/negotiations/{application/negotiation.detail-reader.d.ts → negotiation.detail-reader.d.ts} +5 -5
  51. package/dist/negotiations/{application/negotiation.detail-reader.js → negotiation.detail-reader.js} +3 -3
  52. package/dist/negotiations/{application/negotiation.graph.d.ts → negotiation.graph.d.ts} +81 -81
  53. package/dist/negotiations/{application/negotiation.graph.finalize.js → negotiation.graph.finalize.js} +4 -4
  54. package/dist/negotiations/{application/negotiation.graph.init.d.ts → negotiation.graph.init.d.ts} +8 -8
  55. package/dist/negotiations/{application/negotiation.graph.init.js → negotiation.graph.init.js} +5 -5
  56. package/dist/negotiations/{application/negotiation.graph.js → negotiation.graph.js} +4 -4
  57. package/dist/negotiations/{application/negotiation.graph.screen.d.ts → negotiation.graph.screen.d.ts} +1 -1
  58. package/dist/negotiations/{application/negotiation.graph.screen.js → negotiation.graph.screen.js} +2 -2
  59. package/dist/negotiations/{application/negotiation.graph.shared.d.ts → negotiation.graph.shared.d.ts} +13 -13
  60. package/dist/negotiations/{application/negotiation.graph.shared.js → negotiation.graph.shared.js} +2 -2
  61. package/dist/negotiations/{application/negotiation.graph.turn.d.ts → negotiation.graph.turn.d.ts} +2 -2
  62. package/dist/negotiations/{application/negotiation.graph.turn.js → negotiation.graph.turn.js} +6 -6
  63. package/dist/negotiations/{domain/negotiation.hermes-contract.d.ts → negotiation.hermes-contract.d.ts} +1 -1
  64. package/dist/negotiations/{domain/negotiation.lifecycle-narration.d.ts → negotiation.lifecycle-narration.d.ts} +1 -1
  65. package/dist/negotiations/negotiation.module.d.ts +28 -0
  66. package/dist/negotiations/negotiation.module.js +19 -0
  67. package/dist/negotiations/{domain/negotiation.protocol.d.ts → negotiation.protocol.d.ts} +1 -1
  68. package/dist/negotiations/{domain/negotiation.protocol.js → negotiation.protocol.js} +1 -1
  69. package/dist/negotiations/{domain/negotiation.question-safety.js → negotiation.question-safety.js} +1 -1
  70. package/dist/negotiations/{application/negotiation.reflect.d.ts → negotiation.reflect.d.ts} +3 -3
  71. package/dist/negotiations/{application/negotiation.reflect.js → negotiation.reflect.js} +5 -5
  72. package/dist/negotiations/{application/negotiation.screen.d.ts → negotiation.screen.d.ts} +8 -8
  73. package/dist/negotiations/{application/negotiation.screen.js → negotiation.screen.js} +7 -7
  74. package/dist/negotiations/{domain/negotiation.state.d.ts → negotiation.state.d.ts} +2 -2
  75. package/dist/negotiations/{domain/negotiation.state.js → negotiation.state.js} +1 -1
  76. package/dist/negotiations/{application/negotiation.summarizer.d.ts → negotiation.summarizer.d.ts} +2 -2
  77. package/dist/negotiations/{application/negotiation.summarizer.js → negotiation.summarizer.js} +4 -4
  78. package/dist/negotiations/{application/negotiation.tools.d.ts → negotiation.tools.d.ts} +3 -3
  79. package/dist/negotiations/{application/negotiation.tools.js → negotiation.tools.js} +9 -9
  80. package/dist/negotiations/{ports/negotiation.tools.port.d.ts → negotiation.tools.port.d.ts} +4 -4
  81. package/dist/networks/indexer.graph.d.ts +1 -1
  82. package/dist/networks/indexer.state.d.ts +1 -1
  83. package/dist/opportunities/{application/delivery-card.cache.d.ts → delivery-card.cache.d.ts} +2 -2
  84. package/dist/opportunities/{application/delivery-card.cache.js → delivery-card.cache.js} +2 -2
  85. package/dist/opportunities/discriminator/discriminator.adjustments.d.ts +1 -1
  86. package/dist/opportunities/discriminator/discriminator.push.d.ts +1 -1
  87. package/dist/opportunities/discriminator/discriminator.question.d.ts +1 -1
  88. package/dist/opportunities/{application/negotiation-context.loader.d.ts → negotiation-context.loader.d.ts} +2 -2
  89. package/dist/opportunities/{application/negotiation-context.loader.js → negotiation-context.loader.js} +1 -1
  90. package/dist/opportunities/{domain/negotiation-summary.builder.d.ts → negotiation-summary.builder.d.ts} +2 -2
  91. package/dist/opportunities/{domain/opportunity.actor.d.ts → opportunity.actor.d.ts} +1 -1
  92. package/dist/opportunities/{application/opportunity.discovery-negotiation-summary.d.ts → opportunity.discovery-negotiation-summary.d.ts} +3 -3
  93. package/dist/opportunities/{application/opportunity.discovery-negotiation-summary.js → opportunity.discovery-negotiation-summary.js} +3 -3
  94. package/dist/opportunities/{application/opportunity.enricher.d.ts → opportunity.enricher.d.ts} +2 -2
  95. package/dist/opportunities/{application/opportunity.enricher.js → opportunity.enricher.js} +2 -2
  96. package/dist/opportunities/{application/opportunity.evaluator.d.ts → opportunity.evaluator.d.ts} +3 -3
  97. package/dist/opportunities/{application/opportunity.evaluator.js → opportunity.evaluator.js} +7 -7
  98. package/dist/opportunities/{domain/opportunity.evidence.d.ts → opportunity.evidence.d.ts} +1 -1
  99. package/dist/opportunities/{application/opportunity.existing-negotiation.d.ts → opportunity.existing-negotiation.d.ts} +2 -2
  100. package/dist/opportunities/{application/opportunity.existing-negotiation.js → opportunity.existing-negotiation.js} +1 -1
  101. package/dist/opportunities/{application/opportunity.feed-selection.d.ts → opportunity.feed-selection.d.ts} +2 -2
  102. package/dist/opportunities/{application/opportunity.feed-selection.js → opportunity.feed-selection.js} +1 -1
  103. package/dist/opportunities/{application/opportunity.graph.d.ts → opportunity.graph.d.ts} +130 -130
  104. package/dist/opportunities/{application/opportunity.graph.discovery-strategies.d.ts → opportunity.graph.discovery-strategies.d.ts} +5 -5
  105. package/dist/opportunities/{application/opportunity.graph.discovery-strategies.js → opportunity.graph.discovery-strategies.js} +5 -5
  106. package/dist/opportunities/{application/opportunity.graph.discovery.d.ts → opportunity.graph.discovery.d.ts} +3 -3
  107. package/dist/opportunities/{application/opportunity.graph.discovery.js → opportunity.graph.discovery.js} +6 -6
  108. package/dist/opportunities/{application/opportunity.graph.evaluation.d.ts → opportunity.graph.evaluation.d.ts} +3 -3
  109. package/dist/opportunities/{application/opportunity.graph.evaluation.js → opportunity.graph.evaluation.js} +8 -8
  110. package/dist/opportunities/{application/opportunity.graph.js → opportunity.graph.js} +13 -13
  111. package/dist/opportunities/{application/opportunity.graph.modes.d.ts → opportunity.graph.modes.d.ts} +37 -37
  112. package/dist/opportunities/{application/opportunity.graph.modes.js → opportunity.graph.modes.js} +9 -9
  113. package/dist/opportunities/{application/opportunity.graph.negotiate.d.ts → opportunity.graph.negotiate.d.ts} +4 -4
  114. package/dist/opportunities/{application/opportunity.graph.negotiate.js → opportunity.graph.negotiate.js} +6 -6
  115. package/dist/opportunities/{application/opportunity.graph.persist-node.d.ts → opportunity.graph.persist-node.d.ts} +2 -2
  116. package/dist/opportunities/{application/opportunity.graph.persist-node.js → opportunity.graph.persist-node.js} +9 -9
  117. package/dist/opportunities/{application/opportunity.graph.prep.d.ts → opportunity.graph.prep.d.ts} +4 -4
  118. package/dist/opportunities/{application/opportunity.graph.prep.js → opportunity.graph.prep.js} +6 -6
  119. package/dist/opportunities/{application/opportunity.graph.shared.d.ts → opportunity.graph.shared.d.ts} +28 -28
  120. package/dist/opportunities/{application/opportunity.graph.shared.js → opportunity.graph.shared.js} +4 -4
  121. package/dist/opportunities/{application/opportunity.introducer.js → opportunity.introducer.js} +1 -1
  122. package/dist/opportunities/{application/opportunity.lifecycle.d.ts → opportunity.lifecycle.d.ts} +1 -1
  123. package/dist/opportunities/{index.d.ts → opportunity.module.d.ts} +24 -24
  124. package/dist/opportunities/{index.js → opportunity.module.js} +16 -16
  125. package/dist/opportunities/{application/opportunity.newborn-stamping.d.ts → opportunity.newborn-stamping.d.ts} +1 -1
  126. package/dist/opportunities/{application/opportunity.owner-provenance.d.ts → opportunity.owner-provenance.d.ts} +1 -1
  127. package/dist/opportunities/{application/opportunity.pending-questions.d.ts → opportunity.pending-questions.d.ts} +1 -1
  128. package/dist/opportunities/{application/opportunity.pending-questions.js → opportunity.pending-questions.js} +1 -1
  129. package/dist/opportunities/{application/opportunity.persist.d.ts → opportunity.persist.d.ts} +3 -3
  130. package/dist/opportunities/{application/opportunity.persist.js → opportunity.persist.js} +3 -3
  131. package/dist/opportunities/{application/opportunity.persistence-admission.d.ts → opportunity.persistence-admission.d.ts} +1 -1
  132. package/dist/opportunities/{application/opportunity.presentation.d.ts → opportunity.presentation.d.ts} +3 -3
  133. package/dist/opportunities/{application/opportunity.presentation.js → opportunity.presentation.js} +6 -6
  134. package/dist/opportunities/{domain/opportunity.state.d.ts → opportunity.state.d.ts} +6 -6
  135. package/dist/opportunities/{application/opportunity.tools.cards.d.ts → opportunity.tools.cards.d.ts} +4 -4
  136. package/dist/opportunities/{application/opportunity.tools.cards.js → opportunity.tools.cards.js} +2 -2
  137. package/dist/opportunities/{application/opportunity.tools.d.ts → opportunity.tools.d.ts} +2 -2
  138. package/dist/opportunities/{application/opportunity.tools.js → opportunity.tools.js} +7 -7
  139. package/dist/opportunities/{application/opportunity.tools.list.d.ts → opportunity.tools.list.d.ts} +2 -2
  140. package/dist/opportunities/{application/opportunity.tools.list.js → opportunity.tools.list.js} +4 -4
  141. package/dist/opportunities/{ports/opportunity.tools.port.d.ts → opportunity.tools.port.d.ts} +2 -2
  142. package/dist/opportunities/{application/opportunity.update-admission.d.ts → opportunity.update-admission.d.ts} +1 -1
  143. package/dist/opportunities/{domain/opportunity.utils.d.ts → opportunity.utils.d.ts} +3 -3
  144. package/dist/opportunities/{domain/opportunity.utils.js → opportunity.utils.js} +3 -3
  145. package/dist/opportunities/radar/radar.graph.d.ts +2 -2
  146. package/dist/opportunities/radar/radar.graph.js +6 -6
  147. package/dist/opportunities/radar/radar.health.js +1 -1
  148. package/dist/opportunities/radar/radar.state.d.ts +1 -1
  149. package/dist/premises/premise.graph.d.ts +1 -1
  150. package/dist/premises/premise.state.d.ts +1 -1
  151. package/dist/premises/premise.tools.d.ts +1 -1
  152. package/dist/questions/question.input.d.ts +1 -1
  153. package/dist/questions/question.input.js +1 -1
  154. package/dist/questions/question.presets.js +1 -1
  155. package/dist/shared/agent/tool.factory.d.ts +1 -1
  156. package/dist/shared/agent/tool.factory.js +9 -10
  157. package/dist/shared/agent/tool.helpers.d.ts +4 -12
  158. package/dist/shared/agent/tool.helpers.js +1 -2
  159. package/dist/shared/agent/tool.registry.d.ts +1 -1
  160. package/dist/shared/agent/tool.registry.js +5 -5
  161. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +1 -1
  162. package/package.json +1 -1
  163. package/dist/agents/application/index.d.ts +0 -23
  164. package/dist/agents/application/index.js +0 -24
  165. package/dist/agents/domain/index.d.ts +0 -19
  166. package/dist/agents/domain/index.js +0 -1
  167. package/dist/agents/index.d.ts +0 -22
  168. package/dist/agents/index.js +0 -12
  169. package/dist/agents/ports/index.d.ts +0 -27
  170. package/dist/agents/ports/index.js +0 -25
  171. package/dist/chat/reporter.action.contracts.d.ts +0 -36
  172. package/dist/chat/reporter.action.tools.d.ts +0 -17
  173. package/dist/chat/reporter.action.tools.js +0 -145
  174. package/dist/chat/reporter.persona.d.ts +0 -31
  175. package/dist/chat/reporter.persona.js +0 -207
  176. package/dist/chat/reporter.prompt.d.ts +0 -24
  177. package/dist/chat/reporter.prompt.js +0 -149
  178. package/dist/contacts/application/index.d.ts +0 -10
  179. package/dist/contacts/application/index.js +0 -10
  180. package/dist/contacts/domain/index.d.ts +0 -12
  181. package/dist/contacts/domain/index.js +0 -1
  182. package/dist/contacts/index.d.ts +0 -9
  183. package/dist/contacts/index.js +0 -8
  184. package/dist/contacts/ports/index.d.ts +0 -19
  185. package/dist/contacts/ports/index.js +0 -18
  186. package/dist/contexts/application/index.d.ts +0 -72
  187. package/dist/contexts/application/index.js +0 -82
  188. package/dist/contexts/domain/index.d.ts +0 -67
  189. package/dist/contexts/domain/index.js +0 -68
  190. package/dist/contexts/index.d.ts +0 -13
  191. package/dist/contexts/index.js +0 -12
  192. package/dist/contexts/ports/index.d.ts +0 -37
  193. package/dist/contexts/ports/index.js +0 -34
  194. package/dist/contexts/ports/participant-context.tools.port.js +0 -1
  195. package/dist/negotiations/application/index.d.ts +0 -48
  196. package/dist/negotiations/application/index.js +0 -49
  197. package/dist/negotiations/domain/index.d.ts +0 -56
  198. package/dist/negotiations/domain/index.js +0 -57
  199. package/dist/negotiations/index.d.ts +0 -12
  200. package/dist/negotiations/index.js +0 -9
  201. package/dist/negotiations/ports/index.d.ts +0 -16
  202. package/dist/negotiations/ports/index.js +0 -16
  203. package/dist/opportunities/application/index.d.ts +0 -59
  204. package/dist/opportunities/application/index.js +0 -64
  205. package/dist/opportunities/domain/index.d.ts +0 -51
  206. package/dist/opportunities/domain/index.js +0 -48
  207. package/dist/opportunities/ports/index.d.ts +0 -5
  208. package/dist/opportunities/ports/index.js +0 -1
  209. /package/dist/agents/{ports/agent.dispatcher.port.js → agent.dispatcher.port.js} +0 -0
  210. /package/dist/agents/{ports/agent.repository.port.js → agent.repository.port.js} +0 -0
  211. /package/dist/agents/{ports/agent.tools.port.d.ts → agent.tools.port.d.ts} +0 -0
  212. /package/dist/agents/{ports/agent.tools.port.js → agent.tools.port.js} +0 -0
  213. /package/dist/agents/{domain/agent.types.d.ts → agent.types.d.ts} +0 -0
  214. /package/dist/agents/{domain/agent.types.js → agent.types.js} +0 -0
  215. /package/dist/contacts/{ports/contact.repository.port.js → contact.repository.port.js} +0 -0
  216. /package/dist/contacts/{ports/contact.tools.port.d.ts → contact.tools.port.d.ts} +0 -0
  217. /package/dist/contacts/{ports/contact.tools.port.js → contact.tools.port.js} +0 -0
  218. /package/dist/contacts/{domain/contact.types.d.ts → contact.types.d.ts} +0 -0
  219. /package/dist/contacts/{domain/contact.types.js → contact.types.js} +0 -0
  220. /package/dist/{chat/reporter.action.contracts.js → contexts/context.tools.port.js} +0 -0
  221. /package/dist/negotiations/{application/insight.generator.d.ts → insight.generator.d.ts} +0 -0
  222. /package/dist/negotiations/{domain/negotiation.consultation-policy.js → negotiation.consultation-policy.js} +0 -0
  223. /package/dist/negotiations/{domain/negotiation.deadlock.contracts.d.ts → negotiation.deadlock.contracts.d.ts} +0 -0
  224. /package/dist/negotiations/{domain/negotiation.deadlock.contracts.js → negotiation.deadlock.contracts.js} +0 -0
  225. /package/dist/negotiations/{domain/negotiation.deadlock.d.ts → negotiation.deadlock.d.ts} +0 -0
  226. /package/dist/negotiations/{domain/negotiation.deadlock.js → negotiation.deadlock.js} +0 -0
  227. /package/dist/negotiations/{domain/negotiation.expected-speaker.d.ts → negotiation.expected-speaker.d.ts} +0 -0
  228. /package/dist/negotiations/{domain/negotiation.expected-speaker.js → negotiation.expected-speaker.js} +0 -0
  229. /package/dist/negotiations/{application/negotiation.graph.finalize.d.ts → negotiation.graph.finalize.d.ts} +0 -0
  230. /package/dist/negotiations/{domain/negotiation.hermes-contract.js → negotiation.hermes-contract.js} +0 -0
  231. /package/dist/negotiations/{domain/negotiation.intent-snapshot-provenance.d.ts → negotiation.intent-snapshot-provenance.d.ts} +0 -0
  232. /package/dist/negotiations/{domain/negotiation.intent-snapshot-provenance.js → negotiation.intent-snapshot-provenance.js} +0 -0
  233. /package/dist/negotiations/{domain/negotiation.lifecycle-narration.js → negotiation.lifecycle-narration.js} +0 -0
  234. /package/dist/negotiations/{domain/negotiation.memory.d.ts → negotiation.memory.d.ts} +0 -0
  235. /package/dist/negotiations/{domain/negotiation.memory.js → negotiation.memory.js} +0 -0
  236. /package/dist/negotiations/{domain/negotiation.question-safety.d.ts → negotiation.question-safety.d.ts} +0 -0
  237. /package/dist/negotiations/{domain/negotiation.screen.contracts.d.ts → negotiation.screen.contracts.d.ts} +0 -0
  238. /package/dist/negotiations/{domain/negotiation.screen.contracts.js → negotiation.screen.contracts.js} +0 -0
  239. /package/dist/negotiations/{domain/negotiation.stance.contracts.d.ts → negotiation.stance.contracts.d.ts} +0 -0
  240. /package/dist/negotiations/{domain/negotiation.stance.contracts.js → negotiation.stance.contracts.js} +0 -0
  241. /package/dist/negotiations/{domain/negotiation.task-lock-policy.d.ts → negotiation.task-lock-policy.d.ts} +0 -0
  242. /package/dist/negotiations/{domain/negotiation.task-lock-policy.js → negotiation.task-lock-policy.js} +0 -0
  243. /package/dist/negotiations/{ports/negotiation.tools.port.js → negotiation.tools.port.js} +0 -0
  244. /package/dist/negotiations/{domain/negotiation.turn-cap.d.ts → negotiation.turn-cap.d.ts} +0 -0
  245. /package/dist/negotiations/{domain/negotiation.turn-cap.js → negotiation.turn-cap.js} +0 -0
  246. /package/dist/opportunities/{domain/negotiation-summary.builder.js → negotiation-summary.builder.js} +0 -0
  247. /package/dist/opportunities/{domain/opportunity.actor.js → opportunity.actor.js} +0 -0
  248. /package/dist/opportunities/{domain/opportunity.evidence.js → opportunity.evidence.js} +0 -0
  249. /package/dist/opportunities/{application/opportunity.introducer-feature.d.ts → opportunity.introducer-feature.d.ts} +0 -0
  250. /package/dist/opportunities/{application/opportunity.introducer-feature.js → opportunity.introducer-feature.js} +0 -0
  251. /package/dist/opportunities/{application/opportunity.introducer.d.ts → opportunity.introducer.d.ts} +0 -0
  252. /package/dist/opportunities/{domain/opportunity.labels.d.ts → opportunity.labels.d.ts} +0 -0
  253. /package/dist/opportunities/{domain/opportunity.labels.js → opportunity.labels.js} +0 -0
  254. /package/dist/opportunities/{application/opportunity.lifecycle.js → opportunity.lifecycle.js} +0 -0
  255. /package/dist/opportunities/{application/opportunity.newborn-stamping.js → opportunity.newborn-stamping.js} +0 -0
  256. /package/dist/opportunities/{application/opportunity.owner-approval.d.ts → opportunity.owner-approval.d.ts} +0 -0
  257. /package/dist/opportunities/{application/opportunity.owner-approval.js → opportunity.owner-approval.js} +0 -0
  258. /package/dist/opportunities/{application/opportunity.owner-provenance.js → opportunity.owner-provenance.js} +0 -0
  259. /package/dist/opportunities/{application/opportunity.persistence-admission.js → opportunity.persistence-admission.js} +0 -0
  260. /package/dist/opportunities/{domain/opportunity.state.js → opportunity.state.js} +0 -0
  261. /package/dist/opportunities/{ports/opportunity.tools.port.js → opportunity.tools.port.js} +0 -0
  262. /package/dist/opportunities/{application/opportunity.update-admission.js → opportunity.update-admission.js} +0 -0
  263. /package/dist/questions/{index.d.ts → question.module.d.ts} +0 -0
  264. /package/dist/questions/{index.js → question.module.js} +0 -0
@@ -1,207 +0,0 @@
1
- import { tool } from "@langchain/core/tools";
2
- import { z } from "zod";
3
- import { createChatTools } from "../shared/agent/tool.factory.js";
4
- import { error, resolveChatContext, success } from "../shared/agent/tool.helpers.js";
5
- import { focusedNetworkId, scopeFromNetworkId } from "../shared/agent/tool.scope.js";
6
- import { buildReporterSystemContent, resolveReporterDeterministicResponse } from "./reporter.prompt.js";
7
- import { createReporterActionTool } from "./reporter.action.tools.js";
8
- /** Public kickoff marker used by the Agent surface to request its opening briefing. */
9
- export { REPORTER_BRIEFING_KICKOFF } from "./reporter.prompt.js";
10
- /** Stable persona id persisted for read-only Agent reporting sessions. */
11
- export const REPORTER_PERSONA_ID = "reporter";
12
- /**
13
- * Exact positive allowlist for the reporter persona. New shared tools remain
14
- * unavailable until they are explicitly reviewed here.
15
- */
16
- export const REPORTER_TOOL_NAMES = [
17
- "read_intents",
18
- "search_intents",
19
- "read_user_contexts",
20
- "preview_user_context",
21
- "read_premises",
22
- "read_networks",
23
- "read_network_memberships",
24
- "read_pending_questions",
25
- "list_opportunities",
26
- "read_activity_summary",
27
- ];
28
- const REPORTER_TOOL_ALLOWLIST = new Set(REPORTER_TOOL_NAMES);
29
- /** Filters a shared registry through the reporter's positive allowlist. */
30
- export function filterReporterTools(tools) {
31
- return tools.filter((candidate) => REPORTER_TOOL_ALLOWLIST.has(candidate.name));
32
- }
33
- function invokeSharedTool(sharedTool, input) {
34
- return sharedTool.invoke(input);
35
- }
36
- /**
37
- * Replaces shared tools whose normal modes can enumerate other users with
38
- * reporter-safe, self-only read contracts. Opportunity listing is deliberately
39
- * aggregate-only: it never returns a counterpart name, row, or explanation.
40
- */
41
- export function narrowReporterTools(allowed, boundary) {
42
- const { context, userDb } = boundary;
43
- return allowed.map((sharedTool) => {
44
- if (sharedTool.name === "read_intents") {
45
- return tool(async (query) => {
46
- const limit = query.limit ?? 100;
47
- const page = query.page ?? 1;
48
- const intents = await userDb.getActiveIntents();
49
- const start = (page - 1) * limit;
50
- return success({
51
- intents: intents.slice(start, start + limit),
52
- page,
53
- limit,
54
- total: intents.length,
55
- });
56
- }, {
57
- name: "read_intents",
58
- description: "Read the authenticated user's own active signals only.",
59
- schema: z.object({
60
- limit: z.number().int().min(1).max(100).optional(),
61
- page: z.number().int().min(1).optional(),
62
- }).strict(),
63
- });
64
- }
65
- if (sharedTool.name === "search_intents") {
66
- return tool(async (query) => success({
67
- intents: await userDb.searchOwnIntents(query.query, query.limit ?? 20),
68
- }), {
69
- name: "search_intents",
70
- description: "Search the authenticated user's own active signals only.",
71
- schema: z.object({
72
- query: z.string().trim().min(1),
73
- limit: z.number().int().min(1).max(100).optional(),
74
- }).strict(),
75
- });
76
- }
77
- if (sharedTool.name === "read_user_contexts") {
78
- return tool(async () => invokeSharedTool(sharedTool, {}), {
79
- name: "read_user_contexts",
80
- description: "Read the authenticated user's own identity and global context only.",
81
- schema: z.object({}).strict(),
82
- });
83
- }
84
- if (sharedTool.name === "read_premises") {
85
- return tool(async (query) => invokeSharedTool(sharedTool, {
86
- includeRetracted: query.includeRetracted ?? false,
87
- userId: context.userId,
88
- }), {
89
- name: "read_premises",
90
- description: "Read the authenticated user's own premises only.",
91
- schema: z.object({ includeRetracted: z.boolean().optional() }).strict(),
92
- });
93
- }
94
- if (sharedTool.name === "read_network_memberships") {
95
- return tool(async () => invokeSharedTool(sharedTool, {}), {
96
- name: "read_network_memberships",
97
- description: "Read the authenticated user's own network memberships only.",
98
- schema: z.object({}).strict(),
99
- });
100
- }
101
- if (sharedTool.name === "read_networks") {
102
- return tool(async () => invokeSharedTool(sharedTool, { userId: context.userId }), {
103
- name: "read_networks",
104
- description: "Read networks available to the authenticated user.",
105
- schema: z.object({}).strict(),
106
- });
107
- }
108
- if (sharedTool.name === "read_pending_questions") {
109
- return tool(async (query) => {
110
- if (!boundary.findPendingQuestions)
111
- return error("Question lookup is not available.");
112
- const questions = await boundary.findPendingQuestions(context.userId, {
113
- modes: ["intent"],
114
- limit: query.limit ?? 10,
115
- });
116
- return success({ questions: questions.slice(0, query.limit ?? 10) });
117
- }, {
118
- name: "read_pending_questions",
119
- description: "Read the user's own non-negotiation pending questions; answering is unavailable here.",
120
- schema: z.object({ limit: z.number().int().min(1).max(10).optional() }).strict(),
121
- });
122
- }
123
- if (sharedTool.name === "list_opportunities") {
124
- return tool(async (query) => {
125
- const scopedNetworkId = focusedNetworkId(context);
126
- if (scopedNetworkId && query.networkId && query.networkId !== scopedNetworkId) {
127
- return error("This chat is scoped to a different network.");
128
- }
129
- const activeIntents = await userDb.getActiveIntents();
130
- const intentById = new Map(activeIntents.map((intent) => [intent.id, intent]));
131
- const opportunities = await userDb.getOpportunitiesForUser({
132
- ...(query.networkId || scopedNetworkId ? { networkId: query.networkId || scopedNetworkId } : {}),
133
- statuses: ["draft", "pending", "latent"],
134
- limit: 100,
135
- });
136
- const counts = new Map();
137
- const seen = new Set();
138
- for (const opportunity of opportunities) {
139
- const ownIntentIds = new Set(opportunity.actors
140
- .filter((actor) => actor.userId === context.userId && actor.intent && intentById.has(actor.intent))
141
- .map((actor) => actor.intent));
142
- if (ownIntentIds.size === 0)
143
- continue;
144
- seen.add(opportunity.id);
145
- for (const intentId of ownIntentIds) {
146
- const intent = intentById.get(intentId);
147
- if (!intent)
148
- continue;
149
- const existing = counts.get(intentId) ?? {
150
- intentId,
151
- title: intent.summary?.trim() || intent.payload,
152
- count: 0,
153
- };
154
- existing.count += 1;
155
- counts.set(intentId, existing);
156
- }
157
- }
158
- return success({
159
- found: seen.size > 0,
160
- count: seen.size,
161
- bySignal: [...counts.values()],
162
- });
163
- }, {
164
- name: "list_opportunities",
165
- description: "Report current opportunity counts by the user's own signal, without counterpart identities or rows.",
166
- schema: z.object({ networkId: z.string().uuid().optional() }).strict(),
167
- });
168
- }
169
- return sharedTool;
170
- });
171
- }
172
- /** Creates the reporter's context-bound, allowlisted toolset. */
173
- export async function createReporterTools(deps, preResolvedContext) {
174
- const explicitScope = deps.scopeType && deps.scopeId
175
- ? { scopeType: deps.scopeType, scopeId: deps.scopeId }
176
- : scopeFromNetworkId(deps.networkId);
177
- const resolvedContext = preResolvedContext ?? await resolveChatContext({
178
- database: deps.database,
179
- userId: deps.userId,
180
- networkId: explicitScope.scopeType === "network" ? explicitScope.scopeId : deps.networkId,
181
- sessionId: deps.sessionId,
182
- actionToolsEnabled: deps.actionToolsEnabled,
183
- });
184
- if (explicitScope.scopeType && explicitScope.scopeId) {
185
- resolvedContext.scopeType = explicitScope.scopeType;
186
- resolvedContext.scopeId = explicitScope.scopeId;
187
- }
188
- const userDb = deps.userDb ?? deps.createUserDatabase(deps.database, resolvedContext.userId);
189
- const allowed = filterReporterTools(await createChatTools(deps, resolvedContext));
190
- const narrowed = narrowReporterTools(allowed, {
191
- context: resolvedContext,
192
- userDb,
193
- findPendingQuestions: deps.findPendingQuestions,
194
- });
195
- const actionTool = createReporterActionTool(deps, resolvedContext, userDb);
196
- return actionTool ? [...narrowed, actionTool] : narrowed;
197
- }
198
- /** Restricted read-only Agent reporter persona. */
199
- export const REPORTER_PERSONA = {
200
- id: REPORTER_PERSONA_ID,
201
- buildSystemContent: (ctx, iterCtx) => buildReporterSystemContent(ctx, iterCtx),
202
- createTools: (deps, preResolvedContext) => createReporterTools(deps, preResolvedContext),
203
- resolveDeterministicResponse: (_ctx, iterCtx) => resolveReporterDeterministicResponse(iterCtx),
204
- loopBehaviors: {
205
- hallucinationRecovery: false,
206
- },
207
- };
@@ -1,24 +0,0 @@
1
- import type { ResolvedToolContext } from "../shared/agent/tool.factory.js";
2
- import type { IterationContext } from "./chat.prompt.modules.js";
3
- /** Stable marker used by the Agent surface to request its opening briefing. */
4
- export declare const REPORTER_BRIEFING_KICKOFF = "reporter-briefing-kickoff";
5
- /**
6
- * Recognizes the explicit opening briefing marker without putting ordinary
7
- * reporter conversations into briefing mode accidentally.
8
- *
9
- * @param message - Latest user message in the current turn
10
- * @returns Whether this turn is the Agent-surface briefing kickoff
11
- */
12
- export declare function isReporterBriefingKickoff(message?: string): boolean;
13
- /** Recognizes a short acknowledgement only when a prior proposal is visible. */
14
- export declare function isReporterActionConfirmation(message?: string, hasPriorProposal?: boolean): boolean;
15
- /** Deterministic reporter response for contextual typed acknowledgements. */
16
- export declare function resolveReporterDeterministicResponse(iterCtx: IterationContext): string | null;
17
- /**
18
- * Builds the read-only reporter persona prompt.
19
- *
20
- * @param ctx - Resolved authenticated user context
21
- * @param iterCtx - Current agent-loop context used for briefing kickoff
22
- * @returns Complete reporter system content
23
- */
24
- export declare function buildReporterSystemContent(ctx: ResolvedToolContext, iterCtx?: IterationContext): string;
@@ -1,149 +0,0 @@
1
- /** Stable marker used by the Agent surface to request its opening briefing. */
2
- export const REPORTER_BRIEFING_KICKOFF = "reporter-briefing-kickoff";
3
- /**
4
- * Recognizes the explicit opening briefing marker without putting ordinary
5
- * reporter conversations into briefing mode accidentally.
6
- *
7
- * @param message - Latest user message in the current turn
8
- * @returns Whether this turn is the Agent-surface briefing kickoff
9
- */
10
- export function isReporterBriefingKickoff(message) {
11
- const normalized = message?.trim().toLocaleLowerCase()
12
- .replace(/[–—]/g, "-")
13
- .replace(/^_+|_+$/g, "");
14
- if (!normalized)
15
- return false;
16
- return normalized === REPORTER_BRIEFING_KICKOFF;
17
- }
18
- /** Recognizes a short acknowledgement only when a prior proposal is visible. */
19
- export function isReporterActionConfirmation(message, hasPriorProposal = false) {
20
- const normalized = message?.trim().toLocaleLowerCase()
21
- .replace(/[.!?,;:]+$/g, "")
22
- .replace(/\s+/g, " ");
23
- if (!normalized || !hasPriorProposal)
24
- return false;
25
- return new Set([
26
- "i confirm",
27
- "confirm",
28
- "confirm it",
29
- "approve",
30
- "approved",
31
- "approve it",
32
- "i approve",
33
- "yes",
34
- "yes i confirm",
35
- "yes please",
36
- "please do it",
37
- "proceed",
38
- "go ahead",
39
- ]).has(normalized);
40
- }
41
- /** Deterministic reporter response for contextual typed acknowledgements. */
42
- export function resolveReporterDeterministicResponse(iterCtx) {
43
- if (!isReporterActionConfirmation(iterCtx.currentMessage, iterCtx.hasPriorAgentActionProposal === true))
44
- return null;
45
- return "Use the visible proposal card's Confirm control to approve this request. I won't run or recreate it from a chat acknowledgement.";
46
- }
47
- function buildBriefingGuidance(iterCtx) {
48
- if (!isReporterBriefingKickoff(iterCtx?.currentMessage))
49
- return "";
50
- return `
51
-
52
- ## Opening briefing
53
- This is the Agent-surface briefing kickoff. Call read_activity_summary first with the default window, then call the read tools needed to ground the four transparency asks below. Present one concise briefing covering:
54
- 1. summarize all my signals;
55
- 2. what did you do today?;
56
- 3. how do I look to others?;
57
- 4. what should I sharpen?
58
- Do not claim a metric unless it appears in a tool result from this turn. If a section has no grounded data, say that plainly rather than filling the gap.`;
59
- }
60
- function buildTurnGuidance(iterCtx) {
61
- const currentMessage = iterCtx?.currentMessage;
62
- const confirmation = isReporterActionConfirmation(currentMessage, iterCtx?.hasPriorAgentActionProposal === true);
63
- return `
64
-
65
- ## Turn discipline
66
- - The detailed four-section opening briefing is reserved for the exact reporter-briefing-kickoff marker. Do not repeat the full briefing or duplicate all reads for a focused follow-up.
67
- - For every non-kickoff message, answer only the user's current request and perform only the reads needed to answer it.
68
- ${confirmation ? `- This message is only a natural-language acknowledgement. Never execute, claim execution, create, or reuse an action proposal in response. Do not call read_activity_summary or propose_cleanup_actions. Tell the owner to use the visible proposal card's Confirm control; “${currentMessage?.trim()}” is not endpoint confirmation.` : ""}`;
69
- }
70
- /**
71
- * Builds the read-only reporter persona prompt.
72
- *
73
- * @param ctx - Resolved authenticated user context
74
- * @param iterCtx - Current agent-loop context used for briefing kickoff
75
- * @returns Complete reporter system content
76
- */
77
- export function buildReporterSystemContent(ctx, iterCtx) {
78
- const userContext = JSON.stringify(ctx.user, null, 2);
79
- const profileContext = ctx.userProfile
80
- ? JSON.stringify(ctx.userProfile, null, 2)
81
- : "null";
82
- const membershipContext = JSON.stringify(ctx.userNetworks.map((network) => ({
83
- id: network.networkId,
84
- title: network.networkTitle,
85
- isPersonal: network.isPersonal,
86
- })), null, 2);
87
- const roleGuidance = ctx.actionToolsEnabled
88
- ? "Your role is to report what the user's Index agent has done and what the user's own signals currently communicate. You may prepare a cleanup-action request from grounded same-turn reads, but you never change anything in chat."
89
- : "Your role is to report what the user's Index agent has done and what the user's own signals currently communicate. You observe; you never change anything. Suggestions such as pausing or merging a signal are recommendations for the user to carry out through existing product UI, never actions for this persona.";
90
- const mutationRule = ctx.actionToolsEnabled
91
- ? "- Never mutate data in chat. You may call propose_cleanup_actions only after same-turn owner-scoped reads; it creates a REQUEST block and never executes an action. The owner must confirm through the product UI."
92
- : "- Never create, update, delete, confirm, answer, remember, forget, assign, discover, negotiate, scrape, or otherwise mutate data. Do not ask the user a question through a tool.";
93
- const actionGuidance = ctx.actionToolsEnabled ? `
94
-
95
- ## Cleanup-action requests
96
- - You may propose only retract_premise, narrow_signal, and pause_signal actions grounded in read results from this same turn.
97
- - Resolve references through owner-scoped read tools and pass exact full UUIDs only; never use suffixes, guesses, or IDs from another user.
98
- - pause_signal requires non-empty evidence recorded from this turn, such as zero live opportunities plus the owner's statement.
99
- - The proposal block is a REQUEST for owner confirmation. Never narrate an action as completed and never mutate inside chat.
100
- - Do not propose actions for counterparties or expose counterparty identity.
101
- ` : "";
102
- return `You are Agent, the user's private read-only activity reporter for ${ctx.userName}.
103
-
104
- ${roleGuidance}${actionGuidance}
105
-
106
- ## Hard rules
107
- - Every factual claim, number, status, or trend must come from a tool result in the current turn. Never invent, estimate, or reuse an unverified metric.
108
- - Use read_activity_summary for activity counts and read_intents/read_user_contexts/read_premises/read_networks/read_network_memberships/read_pending_questions for the underlying current state.
109
- - Counterparties are identity-free aggregate data only: never reveal names, IDs, transcripts, message text, or per-counterparty rows. Do not infer what another person thinks from a match or negotiation.
110
- ${mutationRule}
111
- - Do not write observed behavior back as a preference or premise. The user decides whether to act on a suggestion.
112
- - If opportunity information is relevant, use only the restricted list_opportunities result or read_activity_summary result. Do not expose raw evaluator reasoning, matchReason, or internal JSON. Any opportunity copy must be presenter-backed; this persona's list view is aggregate-only.
113
- - Be transparent about missing data and the reporting window. Keep the response concise, calm, and useful without hype.
114
-
115
- ## Four transparency asks
116
- Be ready to answer:
117
- - “summarize all my signals” — read the user's own signals and describe their current themes without inventing a synthesis.
118
- - “what did you do today?” — report only grounded activity counts from the requested window.
119
- - “how do I look to others?” — describe only the user's own stored context and signals; do not claim access to private counterparty opinions.
120
- - “what should I sharpen?” — suggest possible signal/context improvements based on observed gaps in the returned data, clearly label them as suggestions, and point the user to existing UI. Never apply them.
121
-
122
- ## Allowed capabilities
123
- - Own signal reads: read_intents, search_intents.
124
- - Own context reads: read_user_contexts, preview_user_context, read_premises.
125
- - Own community context: read_networks, read_network_memberships.
126
- - Own pending-question reads: read_pending_questions (never answer them).
127
- - Aggregate activity reporting: read_activity_summary.
128
- - Aggregate current opportunity reporting: list_opportunities (no counterpart identities or rows).${ctx.actionToolsEnabled ? "\n- Cleanup-action requests: propose_cleanup_actions (request only; owner confirmation is required)." : ""}
129
-
130
- ## Session identity (preloaded)
131
- - User: ${ctx.userName} (${ctx.userEmail}), id: ${ctx.userId}
132
-
133
- ### User record
134
- \`\`\`json
135
- ${userContext}
136
- \`\`\`
137
-
138
- ### User context
139
- \`\`\`json
140
- ${profileContext}
141
- \`\`\`
142
-
143
- ### Current memberships
144
- \`\`\`json
145
- ${membershipContext}
146
- \`\`\`
147
-
148
- Only the identity, context, and membership metadata above are preloaded. Signals, premises, questions, and activity are not preloaded: call the appropriate read/report tool before describing them.${buildTurnGuidance(iterCtx)}${buildBriefingGuidance(iterCtx)}`;
149
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * contacts/application — foreground adapters and application services.
3
- *
4
- * ## Exports
5
- *
6
- * ### Tool factory
7
- * - `createContactTools` — creates contact management MCP tools
8
- * (list, remove, search).
9
- */
10
- export { createContactTools } from "./contact.tools.js";
@@ -1,10 +0,0 @@
1
- /**
2
- * contacts/application — foreground adapters and application services.
3
- *
4
- * ## Exports
5
- *
6
- * ### Tool factory
7
- * - `createContactTools` — creates contact management MCP tools
8
- * (list, remove, search).
9
- */
10
- export { createContactTools } from "./contact.tools.js";
@@ -1,12 +0,0 @@
1
- /**
2
- * contacts/domain — pure contact entity value types and constants.
3
- *
4
- * Contains ContactEntry and ContactSearchResult.
5
- *
6
- * ## What does NOT live here
7
- *
8
- * - ContactServiceAdapter: persistence port — lives in contacts/ports.
9
- * - ContactToolDeps: tool host port — lives in contacts/ports.
10
- * - createContactTools: application layer — lives in contacts/application.
11
- */
12
- export type { ContactEntry, ContactSearchResult, } from "./contact.types.js";
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * contacts — the capability's sole cross-capability surface.
3
- *
4
- * Anything outside this capability imports from here and nowhere else.
5
- * Supersedes the capabilities/contacts.facade.ts + contacts/public/ pair; the
6
- * export list is the union of the facades it replaces, so the contract is unchanged.
7
- */
8
- export { createContactTools } from "./application/index.js";
9
- export type { ContactServiceAdapter, ContactToolDeps, } from "./ports/index.js";
@@ -1,8 +0,0 @@
1
- /**
2
- * contacts — the capability's sole cross-capability surface.
3
- *
4
- * Anything outside this capability imports from here and nowhere else.
5
- * Supersedes the capabilities/contacts.facade.ts + contacts/public/ pair; the
6
- * export list is the union of the facades it replaces, so the contract is unchanged.
7
- */
8
- export { createContactTools } from "./application/index.js";
@@ -1,19 +0,0 @@
1
- /**
2
- * contacts/ports — injected dependency contracts for the contacts capability.
3
- *
4
- * Re-exports the narrow port types that the contacts module declares as
5
- * explicit injected boundaries. Consumers import these to wire host
6
- * implementations without depending on the application layer.
7
- *
8
- * ## Port groups
9
- *
10
- * ### Persistence port
11
- * - ContactServiceAdapter — contact reads and removal: list, remove, search.
12
- *
13
- * ### Tool host port
14
- * - ContactToolDeps — host capabilities for contact management tools.
15
- *
16
- * IND-549: canonical ports surface for the contacts capability.
17
- */
18
- export type { ContactServiceAdapter } from "./contact.repository.port.js";
19
- export type { ContactToolDeps } from "./contact.tools.port.js";
@@ -1,18 +0,0 @@
1
- /**
2
- * contacts/ports — injected dependency contracts for the contacts capability.
3
- *
4
- * Re-exports the narrow port types that the contacts module declares as
5
- * explicit injected boundaries. Consumers import these to wire host
6
- * implementations without depending on the application layer.
7
- *
8
- * ## Port groups
9
- *
10
- * ### Persistence port
11
- * - ContactServiceAdapter — contact reads and removal: list, remove, search.
12
- *
13
- * ### Tool host port
14
- * - ContactToolDeps — host capabilities for contact management tools.
15
- *
16
- * IND-549: canonical ports surface for the contacts capability.
17
- */
18
- export {};
@@ -1,72 +0,0 @@
1
- /**
2
- * contexts/application — orchestrators, factories, and service classes.
3
- *
4
- * Re-exports the orchestration tier of the participant-context capability:
5
- * graph factories (LangGraph compilations), LLM service classes, and utility
6
- * helpers that belong to the application layer. These are the building blocks
7
- * that foreground and ambient adapters compose to implement use cases.
8
- *
9
- * Boundary: application-layer only. Imports from contexts/domain,
10
- * contexts/ports, and shared/ infrastructure — never from runtime/,
11
- * host implementations, or capability facades.
12
- *
13
- * ## Foreground use cases (onboarding / explicit enrichment)
14
- *
15
- * - {@link EnrichmentGraphFactory} — compiles the enrichment pipeline graph
16
- * (scrape → decompose-premises → generate-profile → write-profile).
17
- * Invoked by the foreground shell for `preview_profile`, `confirm_profile`,
18
- * and `enrich_from_url` tools.
19
- * - {@link PremiseGraphFactory} — compiles the premise lifecycle graph
20
- * (analyze → embed → dedupe → persist → index → assign-networks).
21
- * Invoked by the foreground shell for premise CRUD tools.
22
- * - {@link UserContextGenerator} — synthesizes network-scoped context paragraphs
23
- * and the global identity paragraph from the active premise set.
24
- * Called by the background context-refresh adapter after premise mutations.
25
- *
26
- * ## Ambient use cases (scrape / decompose / regenerate / index)
27
- *
28
- * - {@link PremiseDecomposer} — decomposes free-text or scraped input into atomic
29
- * premises. Used inside EnrichmentGraphFactory (decompose-premises node) and
30
- * standalone by the background decompose adapter.
31
- * - {@link PremiseAnalyzer} — Speech Act classification and felicity scoring.
32
- * Used inside PremiseGraphFactory (analyze node).
33
- * - {@link PremiseIndexer} — scores premise relevance to a network index.
34
- * Used inside PremiseGraphFactory (assign-networks node).
35
- * - {@link EnrichmentGenerator} — generates a structured profile from user account
36
- * data via the enrichment generate-mode LLM pipeline.
37
- *
38
- * ## HyDE (Hypothetical Document Embeddings)
39
- *
40
- * HyDE is a protocol-owned technology binding that produces hypothetical
41
- * embedding documents for semantic retrieval. The HyDE sub-capability is
42
- * participant-context-adjacent: it transforms participant context (premise text,
43
- * profile summary) into search-optimized representations.
44
- *
45
- * - {@link HydeGraphFactory} — compiles the full HyDE pipeline graph.
46
- * - {@link HydeGenerator} — generates hypothetical documents from a source text
47
- * and a lens label.
48
- * - {@link LensInferrer} — infers retrieval lenses from a source text and optional
49
- * profile context.
50
- * - {@link HydeValidator} — validates generated hypothetical documents against
51
- * prompt-injection and out-of-scope risks.
52
- *
53
- * IND-545: canonical application home for participant-context orchestrators
54
- * previously spread across premises/, contexts/, enrichment/, and discovery/.
55
- */
56
- export { PremiseGraphFactory } from "../../premises/premise.graph.js";
57
- export { PremiseDecomposer, type PremiseDecomposerOutput, type DecomposedPremise, type ExistingPremiseRef, } from "../../premises/premise.decomposer.js";
58
- export { PremiseAnalyzer, type PremiseAnalyzerOutput, } from "../../premises/premise.analyzer.js";
59
- export { PremiseIndexer, type PremiseIndexerOutput, } from "../../premises/premise.indexer.js";
60
- export { EnrichmentGraphFactory, type CompiledPremiseGraph, } from "../../enrichment/enrichment.graph.js";
61
- export { EnrichmentGenerator, type GeneratedProfile } from "../../enrichment/enrichment.generator.js";
62
- export { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
63
- export { createPremiseTools } from "../../premises/premise.tools.js";
64
- export { UserContextGenerator } from "../../contexts/context.generator.js";
65
- export { HydeGraphFactory, type HydeLensInferrerLike, type HydeGeneratorLike, type HydeValidatorLike, type HydeGraphOptions, } from "../../discovery/index.js";
66
- export { HydeGenerator, type HydeGeneratorOutput, type HydeGenerateInput, } from "../../discovery/index.js";
67
- export { LensInferrer, type LensInferenceInput, type LensInferenceOutput, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../discovery/index.js";
68
- export { HydeValidator, type HydeValidationDocument, type HydeValidationInput, type HydeValidationVerdict, type HydeValidationOutput, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../discovery/index.js";
69
- export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../discovery/index.js";
70
- export { getHydeGenerationMode, type HydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../discovery/index.js";
71
- export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../discovery/index.js";
72
- export { type HydeSourceFrame, HydeSourceFrameSchema, type HydeFrameRole, type HydeFrameHardConstraint, type HydeFrameNamedEntity, type HydeFrameVocabulary, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../discovery/index.js";
@@ -1,82 +0,0 @@
1
- /**
2
- * contexts/application — orchestrators, factories, and service classes.
3
- *
4
- * Re-exports the orchestration tier of the participant-context capability:
5
- * graph factories (LangGraph compilations), LLM service classes, and utility
6
- * helpers that belong to the application layer. These are the building blocks
7
- * that foreground and ambient adapters compose to implement use cases.
8
- *
9
- * Boundary: application-layer only. Imports from contexts/domain,
10
- * contexts/ports, and shared/ infrastructure — never from runtime/,
11
- * host implementations, or capability facades.
12
- *
13
- * ## Foreground use cases (onboarding / explicit enrichment)
14
- *
15
- * - {@link EnrichmentGraphFactory} — compiles the enrichment pipeline graph
16
- * (scrape → decompose-premises → generate-profile → write-profile).
17
- * Invoked by the foreground shell for `preview_profile`, `confirm_profile`,
18
- * and `enrich_from_url` tools.
19
- * - {@link PremiseGraphFactory} — compiles the premise lifecycle graph
20
- * (analyze → embed → dedupe → persist → index → assign-networks).
21
- * Invoked by the foreground shell for premise CRUD tools.
22
- * - {@link UserContextGenerator} — synthesizes network-scoped context paragraphs
23
- * and the global identity paragraph from the active premise set.
24
- * Called by the background context-refresh adapter after premise mutations.
25
- *
26
- * ## Ambient use cases (scrape / decompose / regenerate / index)
27
- *
28
- * - {@link PremiseDecomposer} — decomposes free-text or scraped input into atomic
29
- * premises. Used inside EnrichmentGraphFactory (decompose-premises node) and
30
- * standalone by the background decompose adapter.
31
- * - {@link PremiseAnalyzer} — Speech Act classification and felicity scoring.
32
- * Used inside PremiseGraphFactory (analyze node).
33
- * - {@link PremiseIndexer} — scores premise relevance to a network index.
34
- * Used inside PremiseGraphFactory (assign-networks node).
35
- * - {@link EnrichmentGenerator} — generates a structured profile from user account
36
- * data via the enrichment generate-mode LLM pipeline.
37
- *
38
- * ## HyDE (Hypothetical Document Embeddings)
39
- *
40
- * HyDE is a protocol-owned technology binding that produces hypothetical
41
- * embedding documents for semantic retrieval. The HyDE sub-capability is
42
- * participant-context-adjacent: it transforms participant context (premise text,
43
- * profile summary) into search-optimized representations.
44
- *
45
- * - {@link HydeGraphFactory} — compiles the full HyDE pipeline graph.
46
- * - {@link HydeGenerator} — generates hypothetical documents from a source text
47
- * and a lens label.
48
- * - {@link LensInferrer} — infers retrieval lenses from a source text and optional
49
- * profile context.
50
- * - {@link HydeValidator} — validates generated hypothetical documents against
51
- * prompt-injection and out-of-scope risks.
52
- *
53
- * IND-545: canonical application home for participant-context orchestrators
54
- * previously spread across premises/, contexts/, enrichment/, and discovery/.
55
- */
56
- // ── Premise graph ─────────────────────────────────────────────────────────────
57
- export { PremiseGraphFactory } from "../../premises/premise.graph.js";
58
- // ── Premise service classes ───────────────────────────────────────────────────
59
- export { PremiseDecomposer, } from "../../premises/premise.decomposer.js";
60
- export { PremiseAnalyzer, } from "../../premises/premise.analyzer.js";
61
- export { PremiseIndexer, } from "../../premises/premise.indexer.js";
62
- // ── Enrichment graph + service classes ───────────────────────────────────────
63
- export { EnrichmentGraphFactory, } from "../../enrichment/enrichment.graph.js";
64
- export { EnrichmentGenerator } from "../../enrichment/enrichment.generator.js";
65
- // ── Tool factories (foreground adapters) ──────────────────────────────────────
66
- // These are foreground adapter entry points consumed by the tool composition root (shared/agent)
67
- // composition. They accept compiled graphs and host deps through the tool-dep
68
- // ports and produce LangChain-compatible tool arrays.
69
- export { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
70
- export { createPremiseTools } from "../../premises/premise.tools.js";
71
- // ── Context synthesis ─────────────────────────────────────────────────────────
72
- export { UserContextGenerator } from "../../contexts/context.generator.js";
73
- // ── HyDE graph + service classes ─────────────────────────────────────────────
74
- export { HydeGraphFactory, } from "../../discovery/index.js";
75
- export { HydeGenerator, } from "../../discovery/index.js";
76
- export { LensInferrer, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../discovery/index.js";
77
- export { HydeValidator, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../discovery/index.js";
78
- // ── HyDE utilities ────────────────────────────────────────────────────────────
79
- export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../discovery/index.js";
80
- export { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../discovery/index.js";
81
- export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../discovery/index.js";
82
- export { HydeSourceFrameSchema, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../discovery/index.js";