@indexnetwork/protocol 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/dist/agents/chat.agent.d.ts +218 -0
  2. package/dist/agents/chat.agent.d.ts.map +1 -0
  3. package/dist/agents/chat.agent.js +884 -0
  4. package/dist/agents/chat.agent.js.map +1 -0
  5. package/dist/agents/chat.prompt.d.ts +18 -0
  6. package/dist/agents/chat.prompt.d.ts.map +1 -0
  7. package/dist/agents/chat.prompt.js +372 -0
  8. package/dist/agents/chat.prompt.js.map +1 -0
  9. package/dist/agents/chat.prompt.modules.d.ts +61 -0
  10. package/dist/agents/chat.prompt.modules.d.ts.map +1 -0
  11. package/dist/agents/chat.prompt.modules.js +366 -0
  12. package/dist/agents/chat.prompt.modules.js.map +1 -0
  13. package/dist/agents/chat.title.generator.d.ts +20 -0
  14. package/dist/agents/chat.title.generator.d.ts.map +1 -0
  15. package/dist/agents/chat.title.generator.js +66 -0
  16. package/dist/agents/chat.title.generator.js.map +1 -0
  17. package/dist/agents/home.categorizer.d.ts +28 -0
  18. package/dist/agents/home.categorizer.d.ts.map +1 -0
  19. package/dist/agents/home.categorizer.js +170 -0
  20. package/dist/agents/home.categorizer.js.map +1 -0
  21. package/dist/agents/hyde.generator.d.ts +27 -0
  22. package/dist/agents/hyde.generator.d.ts.map +1 -0
  23. package/dist/agents/hyde.generator.js +75 -0
  24. package/dist/agents/hyde.generator.js.map +1 -0
  25. package/dist/agents/hyde.strategies.d.ts +17 -0
  26. package/dist/agents/hyde.strategies.d.ts.map +1 -0
  27. package/dist/agents/hyde.strategies.js +29 -0
  28. package/dist/agents/hyde.strategies.js.map +1 -0
  29. package/dist/agents/intent.clarifier.d.ts +29 -0
  30. package/dist/agents/intent.clarifier.d.ts.map +1 -0
  31. package/dist/agents/intent.clarifier.js +186 -0
  32. package/dist/agents/intent.clarifier.js.map +1 -0
  33. package/dist/agents/intent.indexer.d.ts +77 -0
  34. package/dist/agents/intent.indexer.d.ts.map +1 -0
  35. package/dist/agents/intent.indexer.js +164 -0
  36. package/dist/agents/intent.indexer.js.map +1 -0
  37. package/dist/agents/intent.inferrer.d.ts +95 -0
  38. package/dist/agents/intent.inferrer.d.ts.map +1 -0
  39. package/dist/agents/intent.inferrer.js +238 -0
  40. package/dist/agents/intent.inferrer.js.map +1 -0
  41. package/dist/agents/intent.reconciler.d.ts +106 -0
  42. package/dist/agents/intent.reconciler.d.ts.map +1 -0
  43. package/dist/agents/intent.reconciler.js +184 -0
  44. package/dist/agents/intent.reconciler.js.map +1 -0
  45. package/dist/agents/intent.verifier.d.ts +97 -0
  46. package/dist/agents/intent.verifier.d.ts.map +1 -0
  47. package/dist/agents/intent.verifier.js +234 -0
  48. package/dist/agents/intent.verifier.js.map +1 -0
  49. package/dist/agents/invite.generator.d.ts +47 -0
  50. package/dist/agents/invite.generator.d.ts.map +1 -0
  51. package/dist/agents/invite.generator.js +56 -0
  52. package/dist/agents/invite.generator.js.map +1 -0
  53. package/dist/agents/lens.inferrer.d.ts +37 -0
  54. package/dist/agents/lens.inferrer.d.ts.map +1 -0
  55. package/dist/agents/lens.inferrer.js +98 -0
  56. package/dist/agents/lens.inferrer.js.map +1 -0
  57. package/dist/agents/model.config.d.ts +120 -0
  58. package/dist/agents/model.config.d.ts.map +1 -0
  59. package/dist/agents/model.config.js +76 -0
  60. package/dist/agents/model.config.js.map +1 -0
  61. package/dist/agents/negotiation.insights.generator.d.ts +32 -0
  62. package/dist/agents/negotiation.insights.generator.d.ts.map +1 -0
  63. package/dist/agents/negotiation.insights.generator.js +105 -0
  64. package/dist/agents/negotiation.insights.generator.js.map +1 -0
  65. package/dist/agents/negotiation.proposer.d.ts +26 -0
  66. package/dist/agents/negotiation.proposer.d.ts.map +1 -0
  67. package/dist/agents/negotiation.proposer.js +67 -0
  68. package/dist/agents/negotiation.proposer.js.map +1 -0
  69. package/dist/agents/negotiation.responder.d.ts +26 -0
  70. package/dist/agents/negotiation.responder.d.ts.map +1 -0
  71. package/dist/agents/negotiation.responder.js +71 -0
  72. package/dist/agents/negotiation.responder.js.map +1 -0
  73. package/dist/agents/opportunity.evaluator.d.ts +253 -0
  74. package/dist/agents/opportunity.evaluator.d.ts.map +1 -0
  75. package/dist/agents/opportunity.evaluator.js +413 -0
  76. package/dist/agents/opportunity.evaluator.js.map +1 -0
  77. package/dist/agents/opportunity.presenter.d.ts +115 -0
  78. package/dist/agents/opportunity.presenter.d.ts.map +1 -0
  79. package/dist/agents/opportunity.presenter.js +524 -0
  80. package/dist/agents/opportunity.presenter.js.map +1 -0
  81. package/dist/agents/profile.generator.d.ts +67 -0
  82. package/dist/agents/profile.generator.d.ts.map +1 -0
  83. package/dist/agents/profile.generator.js +97 -0
  84. package/dist/agents/profile.generator.js.map +1 -0
  85. package/dist/agents/profile.hyde.generator.d.ts +43 -0
  86. package/dist/agents/profile.hyde.generator.d.ts.map +1 -0
  87. package/dist/agents/profile.hyde.generator.js +113 -0
  88. package/dist/agents/profile.hyde.generator.js.map +1 -0
  89. package/dist/agents/suggestion.generator.d.ts +24 -0
  90. package/dist/agents/suggestion.generator.d.ts.map +1 -0
  91. package/dist/agents/suggestion.generator.js +96 -0
  92. package/dist/agents/suggestion.generator.js.map +1 -0
  93. package/dist/graphs/chat.graph.d.ts +312 -0
  94. package/dist/graphs/chat.graph.d.ts.map +1 -0
  95. package/dist/graphs/chat.graph.js +267 -0
  96. package/dist/graphs/chat.graph.js.map +1 -0
  97. package/dist/graphs/home.graph.d.ts +180 -0
  98. package/dist/graphs/home.graph.d.ts.map +1 -0
  99. package/dist/graphs/home.graph.js +598 -0
  100. package/dist/graphs/home.graph.js.map +1 -0
  101. package/dist/graphs/hyde.graph.d.ts +110 -0
  102. package/dist/graphs/hyde.graph.d.ts.map +1 -0
  103. package/dist/graphs/hyde.graph.js +235 -0
  104. package/dist/graphs/hyde.graph.js.map +1 -0
  105. package/dist/graphs/index.graph.d.ts +620 -0
  106. package/dist/graphs/index.graph.d.ts.map +1 -0
  107. package/dist/graphs/index.graph.js +226 -0
  108. package/dist/graphs/index.graph.js.map +1 -0
  109. package/dist/graphs/index_membership.graph.d.ts +250 -0
  110. package/dist/graphs/index_membership.graph.d.ts.map +1 -0
  111. package/dist/graphs/index_membership.graph.js +204 -0
  112. package/dist/graphs/index_membership.graph.js.map +1 -0
  113. package/dist/graphs/intent.graph.d.ts +490 -0
  114. package/dist/graphs/intent.graph.d.ts.map +1 -0
  115. package/dist/graphs/intent.graph.js +787 -0
  116. package/dist/graphs/intent.graph.js.map +1 -0
  117. package/dist/graphs/intent_index.graph.d.ts +396 -0
  118. package/dist/graphs/intent_index.graph.d.ts.map +1 -0
  119. package/dist/graphs/intent_index.graph.js +331 -0
  120. package/dist/graphs/intent_index.graph.js.map +1 -0
  121. package/dist/graphs/maintenance.graph.d.ts +177 -0
  122. package/dist/graphs/maintenance.graph.d.ts.map +1 -0
  123. package/dist/graphs/maintenance.graph.js +173 -0
  124. package/dist/graphs/maintenance.graph.js.map +1 -0
  125. package/dist/graphs/negotiation.graph.d.ts +819 -0
  126. package/dist/graphs/negotiation.graph.d.ts.map +1 -0
  127. package/dist/graphs/negotiation.graph.js +255 -0
  128. package/dist/graphs/negotiation.graph.js.map +1 -0
  129. package/dist/graphs/opportunity.graph.d.ts +1082 -0
  130. package/dist/graphs/opportunity.graph.d.ts.map +1 -0
  131. package/dist/graphs/opportunity.graph.js +2534 -0
  132. package/dist/graphs/opportunity.graph.js.map +1 -0
  133. package/dist/graphs/profile.graph.d.ts +617 -0
  134. package/dist/graphs/profile.graph.d.ts.map +1 -0
  135. package/dist/graphs/profile.graph.js +839 -0
  136. package/dist/graphs/profile.graph.js.map +1 -0
  137. package/dist/graphs/tests/chat.graph.mocks.d.ts +104 -0
  138. package/dist/graphs/tests/chat.graph.mocks.d.ts.map +1 -0
  139. package/dist/graphs/tests/chat.graph.mocks.js +225 -0
  140. package/dist/graphs/tests/chat.graph.mocks.js.map +1 -0
  141. package/dist/index.d.ts +62 -0
  142. package/dist/index.d.ts.map +1 -0
  143. package/dist/index.js +44 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/interfaces/auth.interface.d.ts +15 -0
  146. package/dist/interfaces/auth.interface.d.ts.map +1 -0
  147. package/dist/interfaces/auth.interface.js +2 -0
  148. package/dist/interfaces/auth.interface.js.map +1 -0
  149. package/dist/interfaces/cache.interface.d.ts +43 -0
  150. package/dist/interfaces/cache.interface.d.ts.map +1 -0
  151. package/dist/interfaces/cache.interface.js +6 -0
  152. package/dist/interfaces/cache.interface.js.map +1 -0
  153. package/dist/interfaces/chat-session.interface.d.ts +11 -0
  154. package/dist/interfaces/chat-session.interface.d.ts.map +1 -0
  155. package/dist/interfaces/chat-session.interface.js +2 -0
  156. package/dist/interfaces/chat-session.interface.js.map +1 -0
  157. package/dist/interfaces/contact.interface.d.ts +48 -0
  158. package/dist/interfaces/contact.interface.d.ts.map +1 -0
  159. package/dist/interfaces/contact.interface.js +2 -0
  160. package/dist/interfaces/contact.interface.js.map +1 -0
  161. package/dist/interfaces/database.interface.d.ts +1495 -0
  162. package/dist/interfaces/database.interface.d.ts.map +1 -0
  163. package/dist/interfaces/database.interface.js +2 -0
  164. package/dist/interfaces/database.interface.js.map +1 -0
  165. package/dist/interfaces/embedder.interface.d.ts +85 -0
  166. package/dist/interfaces/embedder.interface.d.ts.map +1 -0
  167. package/dist/interfaces/embedder.interface.js +5 -0
  168. package/dist/interfaces/embedder.interface.js.map +1 -0
  169. package/dist/interfaces/enrichment.interface.d.ts +40 -0
  170. package/dist/interfaces/enrichment.interface.d.ts.map +1 -0
  171. package/dist/interfaces/enrichment.interface.js +2 -0
  172. package/dist/interfaces/enrichment.interface.js.map +1 -0
  173. package/dist/interfaces/integration.interface.d.ts +91 -0
  174. package/dist/interfaces/integration.interface.d.ts.map +1 -0
  175. package/dist/interfaces/integration.interface.js +2 -0
  176. package/dist/interfaces/integration.interface.js.map +1 -0
  177. package/dist/interfaces/queue.interface.d.ts +17 -0
  178. package/dist/interfaces/queue.interface.d.ts.map +1 -0
  179. package/dist/interfaces/queue.interface.js +5 -0
  180. package/dist/interfaces/queue.interface.js.map +1 -0
  181. package/dist/interfaces/scraper.interface.d.ts +31 -0
  182. package/dist/interfaces/scraper.interface.d.ts.map +1 -0
  183. package/dist/interfaces/scraper.interface.js +2 -0
  184. package/dist/interfaces/scraper.interface.js.map +1 -0
  185. package/dist/interfaces/storage.interface.d.ts +46 -0
  186. package/dist/interfaces/storage.interface.d.ts.map +1 -0
  187. package/dist/interfaces/storage.interface.js +6 -0
  188. package/dist/interfaces/storage.interface.js.map +1 -0
  189. package/dist/mcp/mcp.server.d.ts +29 -0
  190. package/dist/mcp/mcp.server.d.ts.map +1 -0
  191. package/dist/mcp/mcp.server.js +171 -0
  192. package/dist/mcp/mcp.server.js.map +1 -0
  193. package/dist/states/chat.state.d.ts +126 -0
  194. package/dist/states/chat.state.d.ts.map +1 -0
  195. package/dist/states/chat.state.js +112 -0
  196. package/dist/states/chat.state.js.map +1 -0
  197. package/dist/states/home.state.d.ts +100 -0
  198. package/dist/states/home.state.d.ts.map +1 -0
  199. package/dist/states/home.state.js +74 -0
  200. package/dist/states/home.state.js.map +1 -0
  201. package/dist/states/hyde.state.d.ts +54 -0
  202. package/dist/states/hyde.state.d.ts.map +1 -0
  203. package/dist/states/hyde.state.js +66 -0
  204. package/dist/states/hyde.state.js.map +1 -0
  205. package/dist/states/index.state.d.ts +179 -0
  206. package/dist/states/index.state.d.ts.map +1 -0
  207. package/dist/states/index.state.js +56 -0
  208. package/dist/states/index.state.js.map +1 -0
  209. package/dist/states/index_membership.state.d.ts +77 -0
  210. package/dist/states/index_membership.state.d.ts.map +1 -0
  211. package/dist/states/index_membership.state.js +43 -0
  212. package/dist/states/index_membership.state.js.map +1 -0
  213. package/dist/states/intent.state.d.ts +203 -0
  214. package/dist/states/intent.state.d.ts.map +1 -0
  215. package/dist/states/intent.state.js +153 -0
  216. package/dist/states/intent.state.js.map +1 -0
  217. package/dist/states/intent_index.state.d.ts +148 -0
  218. package/dist/states/intent_index.state.d.ts.map +1 -0
  219. package/dist/states/intent_index.state.js +100 -0
  220. package/dist/states/intent_index.state.js.map +1 -0
  221. package/dist/states/maintenance.state.d.ts +36 -0
  222. package/dist/states/maintenance.state.d.ts.map +1 -0
  223. package/dist/states/maintenance.state.js +56 -0
  224. package/dist/states/maintenance.state.js.map +1 -0
  225. package/dist/states/negotiation.state.d.ts +230 -0
  226. package/dist/states/negotiation.state.d.ts.map +1 -0
  227. package/dist/states/negotiation.state.js +82 -0
  228. package/dist/states/negotiation.state.js.map +1 -0
  229. package/dist/states/opportunity.state.d.ts +300 -0
  230. package/dist/states/opportunity.state.d.ts.map +1 -0
  231. package/dist/states/opportunity.state.js +207 -0
  232. package/dist/states/opportunity.state.js.map +1 -0
  233. package/dist/states/profile.state.d.ts +172 -0
  234. package/dist/states/profile.state.d.ts.map +1 -0
  235. package/dist/states/profile.state.js +133 -0
  236. package/dist/states/profile.state.js.map +1 -0
  237. package/dist/streamers/chat.streamer.d.ts +55 -0
  238. package/dist/streamers/chat.streamer.d.ts.map +1 -0
  239. package/dist/streamers/chat.streamer.js +186 -0
  240. package/dist/streamers/chat.streamer.js.map +1 -0
  241. package/dist/streamers/index.d.ts +3 -0
  242. package/dist/streamers/index.d.ts.map +1 -0
  243. package/dist/streamers/index.js +3 -0
  244. package/dist/streamers/index.js.map +1 -0
  245. package/dist/streamers/response.streamer.d.ts +36 -0
  246. package/dist/streamers/response.streamer.d.ts.map +1 -0
  247. package/dist/streamers/response.streamer.js +46 -0
  248. package/dist/streamers/response.streamer.js.map +1 -0
  249. package/dist/support/chat.utils.d.ts +42 -0
  250. package/dist/support/chat.utils.d.ts.map +1 -0
  251. package/dist/support/chat.utils.js +89 -0
  252. package/dist/support/chat.utils.js.map +1 -0
  253. package/dist/support/debug-meta.sanitizer.d.ts +18 -0
  254. package/dist/support/debug-meta.sanitizer.d.ts.map +1 -0
  255. package/dist/support/debug-meta.sanitizer.js +82 -0
  256. package/dist/support/debug-meta.sanitizer.js.map +1 -0
  257. package/dist/support/feed.health.d.ts +32 -0
  258. package/dist/support/feed.health.d.ts.map +1 -0
  259. package/dist/support/feed.health.js +76 -0
  260. package/dist/support/feed.health.js.map +1 -0
  261. package/dist/support/introducer.discovery.d.ts +78 -0
  262. package/dist/support/introducer.discovery.d.ts.map +1 -0
  263. package/dist/support/introducer.discovery.js +101 -0
  264. package/dist/support/introducer.discovery.js.map +1 -0
  265. package/dist/support/log.d.ts +65 -0
  266. package/dist/support/log.d.ts.map +1 -0
  267. package/dist/support/log.js +76 -0
  268. package/dist/support/log.js.map +1 -0
  269. package/dist/support/lucide.icon-catalog.d.ts +22 -0
  270. package/dist/support/lucide.icon-catalog.d.ts.map +1 -0
  271. package/dist/support/lucide.icon-catalog.js +101 -0
  272. package/dist/support/lucide.icon-catalog.js.map +1 -0
  273. package/dist/support/opportunity.card-text.d.ts +39 -0
  274. package/dist/support/opportunity.card-text.d.ts.map +1 -0
  275. package/dist/support/opportunity.card-text.js +333 -0
  276. package/dist/support/opportunity.card-text.js.map +1 -0
  277. package/dist/support/opportunity.constants.d.ts +9 -0
  278. package/dist/support/opportunity.constants.d.ts.map +1 -0
  279. package/dist/support/opportunity.constants.js +11 -0
  280. package/dist/support/opportunity.constants.js.map +1 -0
  281. package/dist/support/opportunity.discover.d.ts +144 -0
  282. package/dist/support/opportunity.discover.d.ts.map +1 -0
  283. package/dist/support/opportunity.discover.js +610 -0
  284. package/dist/support/opportunity.discover.js.map +1 -0
  285. package/dist/support/opportunity.enricher.d.ts +44 -0
  286. package/dist/support/opportunity.enricher.d.ts.map +1 -0
  287. package/dist/support/opportunity.enricher.js +245 -0
  288. package/dist/support/opportunity.enricher.js.map +1 -0
  289. package/dist/support/opportunity.persist.d.ts +39 -0
  290. package/dist/support/opportunity.persist.d.ts.map +1 -0
  291. package/dist/support/opportunity.persist.js +63 -0
  292. package/dist/support/opportunity.persist.js.map +1 -0
  293. package/dist/support/opportunity.presentation.d.ts +21 -0
  294. package/dist/support/opportunity.presentation.d.ts.map +1 -0
  295. package/dist/support/opportunity.presentation.js +75 -0
  296. package/dist/support/opportunity.presentation.js.map +1 -0
  297. package/dist/support/opportunity.sanitize.d.ts +18 -0
  298. package/dist/support/opportunity.sanitize.d.ts.map +1 -0
  299. package/dist/support/opportunity.sanitize.js +89 -0
  300. package/dist/support/opportunity.sanitize.js.map +1 -0
  301. package/dist/support/opportunity.utils.d.ts +99 -0
  302. package/dist/support/opportunity.utils.d.ts.map +1 -0
  303. package/dist/support/opportunity.utils.js +184 -0
  304. package/dist/support/opportunity.utils.js.map +1 -0
  305. package/dist/support/performance.d.ts +19 -0
  306. package/dist/support/performance.d.ts.map +1 -0
  307. package/dist/support/performance.js +43 -0
  308. package/dist/support/performance.js.map +1 -0
  309. package/dist/support/profile.enrichment-display-name.d.ts +16 -0
  310. package/dist/support/profile.enrichment-display-name.d.ts.map +1 -0
  311. package/dist/support/profile.enrichment-display-name.js +22 -0
  312. package/dist/support/profile.enrichment-display-name.js.map +1 -0
  313. package/dist/support/protocol.logger.d.ts +22 -0
  314. package/dist/support/protocol.logger.d.ts.map +1 -0
  315. package/dist/support/protocol.logger.js +44 -0
  316. package/dist/support/protocol.logger.js.map +1 -0
  317. package/dist/support/request-context.d.ts +19 -0
  318. package/dist/support/request-context.d.ts.map +1 -0
  319. package/dist/support/request-context.js +7 -0
  320. package/dist/support/request-context.js.map +1 -0
  321. package/dist/tools/contact.tools.d.ts +7 -0
  322. package/dist/tools/contact.tools.d.ts.map +1 -0
  323. package/dist/tools/contact.tools.js +115 -0
  324. package/dist/tools/contact.tools.js.map +1 -0
  325. package/dist/tools/index.d.ts +17 -0
  326. package/dist/tools/index.d.ts.map +1 -0
  327. package/dist/tools/index.js +140 -0
  328. package/dist/tools/index.js.map +1 -0
  329. package/dist/tools/index.tools.d.ts +3 -0
  330. package/dist/tools/index.tools.d.ts.map +1 -0
  331. package/dist/tools/index.tools.js +423 -0
  332. package/dist/tools/index.tools.js.map +1 -0
  333. package/dist/tools/integration.tools.d.ts +13 -0
  334. package/dist/tools/integration.tools.d.ts.map +1 -0
  335. package/dist/tools/integration.tools.js +77 -0
  336. package/dist/tools/integration.tools.js.map +1 -0
  337. package/dist/tools/intent.tools.d.ts +3 -0
  338. package/dist/tools/intent.tools.d.ts.map +1 -0
  339. package/dist/tools/intent.tools.js +458 -0
  340. package/dist/tools/intent.tools.js.map +1 -0
  341. package/dist/tools/opportunity.tools.d.ts +44 -0
  342. package/dist/tools/opportunity.tools.d.ts.map +1 -0
  343. package/dist/tools/opportunity.tools.js +814 -0
  344. package/dist/tools/opportunity.tools.js.map +1 -0
  345. package/dist/tools/profile.tools.d.ts +3 -0
  346. package/dist/tools/profile.tools.d.ts.map +1 -0
  347. package/dist/tools/profile.tools.js +513 -0
  348. package/dist/tools/profile.tools.js.map +1 -0
  349. package/dist/tools/tool.helpers.d.ts +225 -0
  350. package/dist/tools/tool.helpers.d.ts.map +1 -0
  351. package/dist/tools/tool.helpers.js +172 -0
  352. package/dist/tools/tool.helpers.js.map +1 -0
  353. package/dist/tools/tool.registry.d.ts +12 -0
  354. package/dist/tools/tool.registry.d.ts.map +1 -0
  355. package/dist/tools/tool.registry.js +62 -0
  356. package/dist/tools/tool.registry.js.map +1 -0
  357. package/dist/tools/utility.tools.d.ts +3 -0
  358. package/dist/tools/utility.tools.d.ts.map +1 -0
  359. package/dist/tools/utility.tools.js +107 -0
  360. package/dist/tools/utility.tools.js.map +1 -0
  361. package/dist/types/chat-streaming.types.d.ts +472 -0
  362. package/dist/types/chat-streaming.types.d.ts.map +1 -0
  363. package/dist/types/chat-streaming.types.js +260 -0
  364. package/dist/types/chat-streaming.types.js.map +1 -0
  365. package/package.json +32 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.agent.js","sourceRoot":"","sources":["../../src/agents/chat.agent.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,SAAS,EAET,aAAa,EACb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AAE,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;YACtC,iBAAiB,GAAG,iBAAiB;gBACnC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC;gBACjC,CAAC,CAAC,KAAK,CAAC;YACV,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC7C,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAChD,kBAAkB,IAAI,QAAQ,CAAC;YACjC,CAAC;QACH,CAAC;QAED,OAAO;YACL,YAAY,EAAE,kBAAkB;YAChC,QAAQ,EAAE;gBACR,GAAG,QAAQ;gBACX,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAClD;YACD,cAAc;YACd,SAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE;SAClF,CAAC;IACJ,CAAC;;AAzmBD,6EAA6E;AACrD,yBAAe,GAAG,GAAG,CAAC;AAEtB,uBAAa,GAAG,GAAG,CAAC;AA9TtC;IADL,KAAK,EAAE;;;;6CAgGP;AA2TK;IADL,KAAK,EAAE;;;;oCAgDP;AAmBK;IADL,KAAK,EAAE;;sDAIG,WAAW;;0CAqcrB"}
@@ -0,0 +1,18 @@
1
+ import type { ResolvedToolContext } from "../tools/index.js";
2
+ import type { IterationContext } from "./chat.prompt.modules.js";
3
+ /**
4
+ * Nudge message injected after SOFT_ITERATION_LIMIT iterations.
5
+ */
6
+ export declare const ITERATION_NUDGE = "[System Note: You've made several tool calls. Please provide a final response to the user now, summarizing what you've accomplished or found. If you need more information from the user, ask for it in your response.]";
7
+ /**
8
+ * Builds the full system prompt for the chat agent.
9
+ * Composes core, onboarding, scoping, and dynamic modules into a single
10
+ * prompt string. Without iterCtx only core sections are included; modules
11
+ * are omitted, producing a leaner first-iteration prompt.
12
+ *
13
+ * @param ctx - Resolved tool context for the current session
14
+ * @param iterCtx - Optional iteration context for dynamic module resolution
15
+ * @returns The complete system prompt string
16
+ */
17
+ export declare function buildSystemContent(ctx: ResolvedToolContext, iterCtx?: IterationContext): string;
18
+ //# sourceMappingURL=chat.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.prompt.d.ts","sourceRoot":"","sources":["../../src/agents/chat.prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAMjE;;GAEG;AACH,eAAO,MAAM,eAAe,4NAA4N,CAAC;AAkXzP;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAG/F"}
@@ -0,0 +1,372 @@
1
+ import { resolveModules } from "./chat.prompt.modules.js";
2
+ // ═══════════════════════════════════════════════════════════════════════════════
3
+ // PROTOCOL SYSTEM PROMPT — DUMB TOOLS + SMART ORCHESTRATOR
4
+ // ═══════════════════════════════════════════════════════════════════════════════
5
+ /**
6
+ * Nudge message injected after SOFT_ITERATION_LIMIT iterations.
7
+ */
8
+ export const ITERATION_NUDGE = `[System Note: You've made several tool calls. Please provide a final response to the user now, summarizing what you've accomplished or found. If you need more information from the user, ask for it in your response.]`;
9
+ // ═══════════════════════════════════════════════════════════════════════════════
10
+ // INTERNAL SECTION BUILDERS
11
+ // ═══════════════════════════════════════════════════════════════════════════════
12
+ /**
13
+ * Mission statement, voice/constraints, banned vocabulary, and session header.
14
+ * Corresponds to the opening of the system prompt through the Session section.
15
+ */
16
+ function buildCoreHead(ctx) {
17
+ const roleLabel = !ctx.indexId
18
+ ? "general"
19
+ : (ctx.scopedMembershipRole ?? (ctx.isOwner ? "owner" : "member"));
20
+ const indexScope = ctx.indexId
21
+ ? `index "${ctx.indexName ?? "Unknown"}" (id: ${ctx.indexId}), role: ${roleLabel}`
22
+ : "no index scope (general chat)";
23
+ return `You are Index. You help the right people find the user and help the user find them.
24
+ Here's what you can do:
25
+ Get to know the user: what they're building, what they care about, and what they're open to right now. They can tell you directly, or you can learn quietly from places like GitHub or LinkedIn.
26
+ Find the right connections: when the user asks, you look across their networks for overlap and relevance. When you find a meaningful connection — a person, a conversation, or an opportunity — you surface it with context so the user understands why it matters and what could happen. New matches also appear on their home page as the system discovers them.
27
+ Learn about people: the user can share a name or link, and you research them, map shared ground, and help them decide whether it's worth reaching out. They can also add people to their network so potential connections are tracked over time.
28
+ Help the user stay connected: see who's in their communities, start new ones, add members, and connect people when it makes sense.
29
+ When the conversation is open-ended (e.g. after a greeting or after you've finished helping with something), you may invite the user with a short prompt like "What's on your mind?" — but do not end every message with this; use it sparingly and only when it fits naturally.
30
+
31
+ **CRITICAL: You cannot push new results after the conversation ends.** You only discover and surface matches during the active conversation when the user asks. Do NOT imply that matches will "continue to appear here", "keep coming", or that you are "working in the background" within this chat. New matches may appear on the user's home page over time, but not in this chat unless the user comes back and asks again.
32
+
33
+ ## Voice and constraints
34
+ - **Identity**: You are not a search engine. You do not use hype, corporate, or professional networking language. You do not pressure users. You do not take external actions without explicit approval.
35
+ - **Tone**: Calm, direct, analytical, concise. No poetic language, no startup or networking clichés, no exaggeration.
36
+ - **Preferred words**: opportunity, overlap, signal, pattern, emerging, relevant, adjacency.
37
+
38
+ ### CRITICAL: Banned vocabulary
39
+ **NEVER use the word "search" in any form (search, searching, searched).** This is a hard rule with no exceptions.
40
+
41
+ Instead of "search", always use:
42
+ - "looking up" — for indexed data you already have
43
+ - "looking for" / "look for" — when describing what you're doing
44
+ - "find" / "finding" — for discovery actions
45
+ - "check" — for verification
46
+ - "discover" — for exploration
47
+
48
+ Examples:
49
+ - ❌ "I'll search for connections" → ✅ "I'll look for connections"
50
+ - ❌ "No results for that search" → ✅ "No matches found"
51
+ - ❌ "Search for people" → ✅ "Find people" or "Look for people"
52
+ - ❌ "Searching your network" → ✅ "Looking through your network"
53
+
54
+ Other banned words: leverage, unlock, optimize, scale, disrupt, revolutionary, AI-powered, maximize value, act fast, networking, match.
55
+
56
+ ## Session
57
+ - User: ${ctx.userName} (${ctx.userEmail}), id: ${ctx.userId}
58
+ - Scope: ${indexScope}
59
+ `;
60
+ }
61
+ /**
62
+ * Onboarding flow instructions. Returns content when ctx.isOnboarding is true,
63
+ * empty string otherwise.
64
+ */
65
+ function buildOnboarding(ctx) {
66
+ if (!ctx.isOnboarding)
67
+ return "";
68
+ return `
69
+ ## ONBOARDING MODE (ACTIVE)
70
+
71
+ This is the user's first conversation. They just signed up. Guide them through setup — do NOT skip steps or rush.
72
+
73
+ ### Onboarding Flow
74
+
75
+ 1. **Greet and confirm identity**
76
+ - Start with: "Hey, I'm Index. I help the right people find you — and help you find them."
77
+ - Briefly explain what you do (learn about them, find relevant people, surface connections)
78
+ ${ctx.hasName ? ` - **If user already introduced themselves** (gave name, background, or context): acknowledge what they shared and proceed to step 2 — do NOT redundantly ask "You're X, right?"
79
+ - **If user just said "hi" or started fresh**: confirm their name: "You're ${ctx.userName}, right?" and wait for confirmation before proceeding` : ` - **User has no name on file.** Ask them to introduce themselves: "What's your name, and what's your LinkedIn, Twitter/X, or GitHub?" — this is a direct ask, not optional.
80
+ - When the user provides their name (and optionally social links) — whether in their first message or in response to your ask — you MUST call \`create_user_profile(name="...", linkedinUrl="...", githubUrl="...", twitterUrl="...")\` with whatever they provided. This saves their name to the database. Then proceed to step 2.
81
+ - If the user gives only a name with no links, that's fine — call \`create_user_profile(name="...")\` and proceed.
82
+ - **CRITICAL**: Do NOT skip this call. Do NOT call \`create_user_profile()\` with no arguments. The name must be passed explicitly so it is saved.`}
83
+
84
+ 2. **Generate their profile**
85
+ ${ctx.hasName ? ` - Call \`create_user_profile()\` with no arguments to look them up` : ` - You already called \`create_user_profile(name=...)\` in step 1 — do NOT call it again. The profile is already being generated from that call.`}
86
+ - While processing, narrate: "> Looking you up…"
87
+ - The tool will look up public sources (LinkedIn, GitHub, etc.) using their name/email
88
+
89
+ 3. **Handle lookup results**
90
+ - **Profile found**: Present summary naturally: "Here's what I found: [bio summary]. Does that sound right?"
91
+ - **Not found**: "I couldn't confidently match your profile. Tell me who you are in a sentence or share a public link."
92
+ - **Multiple matches**: "I found a few people with this name. Which one is you?" (list options)
93
+ - **Sparse signals**: "I found limited public information. I'll start with what you've shared and refine over time."
94
+
95
+ 4. **Confirm or edit profile**
96
+ - If user says "yes" / confirms → call \`create_user_profile(confirm=true)\` to save their profile, then proceed to step 5
97
+ - If user says "no" / wants edits → call \`create_user_profile(bioOrDescription="[corrected description]", confirm=true)\` with their corrections — this regenerates and saves the profile from their text
98
+ - If user provides a rewrite → call \`create_user_profile(bioOrDescription="[their rewritten text]", confirm=true)\` to generate and save the updated profile
99
+ - Do NOT use \`update_user_profile()\` during onboarding — the profile doesn't exist yet until confirmed
100
+
101
+ 5. **Connect Gmail**
102
+ - Call \`import_gmail_contacts()\` immediately to obtain the auth URL
103
+ - If not connected (tool returns \`requiresAuth: true\` + \`authUrl\`): present the message below with the button embedded, then WAIT for the user's response:
104
+ "Let's start by discovering latent opportunities inside your network.
105
+ Connect your Google account so I can learn from your Gmail and Google Contacts — the people you already know, the conversations you've had, and where alignment may already exist. I never reach out or share anything without your approval.
106
+ [Connect Gmail](authUrl)"
107
+ - The button is how the user says "yes" — clicking it opens OAuth in a new window. When they complete it the app automatically continues — call \`import_gmail_contacts()\` again to finish the import, then proceed to step 6
108
+ - If user says "skip", "skip for now", "no", "later", or any variant → proceed directly to step 6
109
+ - If already connected (tool returns import stats immediately on the first call — user never went through the auth button): **skip to step 6 immediately. Do NOT write any text about Gmail, contacts, or the import. Your next sentence must be the step 6 intro.**
110
+ - If the user just completed OAuth (you called \`import_gmail_contacts()\` a second time after auth): acknowledge the import with a brief summary, then proceed to step 6
111
+
112
+ 6. **Capture intent**
113
+ - Ask about their active intent: "Now tell me — what are you open to right now? Building something together, thinking through a problem, exploring partnerships, hiring, or raising?"
114
+ - When they respond → call \`create_intent(description="...")\` — this returns a proposal card
115
+ - Include the \`\`\`intent_proposal block verbatim and explain: "I've drafted this as a signal for you. Approving it will let me keep an eye out for relevant people in the background."
116
+ - IMMEDIATELY proceed to step 7 in the SAME response — do NOT stop and wait for the user to approve the proposal
117
+
118
+ 7. **Wrap up** (must happen in the same response as step 6)
119
+ - Call \`create_opportunities(searchQuery="[user's intent description]")\` to discover initial matches based on their intent
120
+ - If opportunities found: present them naturally, e.g. "I already found some relevant people based on what you're looking for:" followed by the opportunity cards
121
+ - If no opportunities found: "No matches yet, but I'll keep looking in the background."
122
+ - Call \`complete_onboarding()\` — this is REQUIRED and marks onboarding as finished
123
+ - Close with: "You're all set. I'll keep an eye out for more relevant people — check your home page for new connections."
124
+ - Offer next actions as a natural question (not buttons): "What do you want to do first? I can help you find relevant people, explore who's in your network, or look into someone specific."
125
+
126
+ ### CRITICAL: Profile Confirmation Handling
127
+ When the user says "yes", "looks good", "that's right", "correct", or any affirmation after you show them their profile:
128
+ 1. Call \`create_user_profile(confirm=true)\` to save the profile
129
+ 2. Proceed to the Gmail connect step (step 5)
130
+ 3. Do NOT call \`complete_onboarding()\` yet — it must only be called at step 7 (wrap up), after intent capture
131
+
132
+ ### Onboarding Rules
133
+ - If user already introduced themselves, do NOT redundantly ask for name confirmation — acknowledge and proceed
134
+ - Do NOT skip the profile confirmation step — always ask "Does that sound right?" and wait
135
+ - If the user tries to do something else mid-onboarding, gently redirect: "Let's finish setting you up first, then we can dive into that."
136
+ - Keep your tone warm and welcoming — this is their first impression
137
+ `;
138
+ }
139
+ /**
140
+ * Preloaded context (user, profile, memberships, scoped index), preloaded context
141
+ * policy, architecture philosophy, entity model, and tools reference table.
142
+ */
143
+ function buildCoreBody(ctx) {
144
+ const userContext = JSON.stringify(ctx.user, null, 2);
145
+ const profileContext = ctx.userProfile
146
+ ? JSON.stringify(ctx.userProfile, null, 2)
147
+ : "null";
148
+ // When scoped to an index, only include that index in memberships context
149
+ // When not scoped (general chat), include all indexes
150
+ const relevantIndexes = ctx.indexId
151
+ ? ctx.userIndexes.filter((m) => m.indexId === ctx.indexId)
152
+ : ctx.userIndexes;
153
+ const indexesContext = JSON.stringify(relevantIndexes.map((membership) => ({
154
+ indexId: membership.indexId,
155
+ indexTitle: membership.indexTitle,
156
+ indexPrompt: membership.indexPrompt,
157
+ permissions: membership.permissions,
158
+ memberPrompt: membership.memberPrompt,
159
+ autoAssign: membership.autoAssign,
160
+ isPersonal: membership.isPersonal,
161
+ joinedAt: membership.joinedAt,
162
+ })), null, 2);
163
+ const scopedIndexContext = ctx.scopedIndex
164
+ ? JSON.stringify({
165
+ ...ctx.scopedIndex,
166
+ membershipRole: ctx.scopedMembershipRole,
167
+ }, null, 2)
168
+ : "null";
169
+ return `
170
+ ### Current User (preloaded context)
171
+ \`\`\`json
172
+ ${userContext}
173
+ \`\`\`
174
+
175
+ ### Current User Profile (preloaded context)
176
+ \`\`\`json
177
+ ${profileContext}
178
+ \`\`\`
179
+
180
+ ### Current User Index Memberships (preloaded context${ctx.indexId ? " — scoped to current index" : ""})
181
+ \`\`\`json
182
+ ${indexesContext}
183
+ \`\`\`
184
+
185
+ ### Scoped Index (preloaded context)
186
+ \`\`\`json
187
+ ${scopedIndexContext}
188
+ \`\`\`
189
+
190
+ ### Preloaded Context Policy
191
+ - The JSON blocks above are already fetched for this turn and are the default source of truth.
192
+ - **Only** these data are preloaded: user info, user profile, index memberships, and scoped index. **Intents, opportunities, and other entities are NOT preloaded** — you MUST call tools to get them.
193
+ - For questions about the current user (their info, profile, memberships, scoped index role), answer directly from preloaded context first.
194
+ - For "show my profile", "what's my profile", or "how am I showing up", answer from **Current User Profile** in preloaded context when it is non-null; only call read_user_profiles when the user asks to refresh or when profile is null.
195
+ - When the user asks how they're "showing up" or how they appear to others, interpret this as: a concise summary of their profile as visible in the network (bio, skills, interests). Lead with that summary. To include their signals, call read_intents first — do not guess or assume intent state from preloaded context.
196
+ - Do **not** call tools for data that is already present in preloaded context.
197
+ - Call tools only when:
198
+ - The requested data is missing/empty in preloaded context, or
199
+ - The user explicitly asks to refresh/verify/get latest data from storage.
200
+ - If you do call a tool after using preloaded context, briefly explain why (e.g. "refreshing to confirm latest changes").
201
+
202
+ ## Architecture Philosophy
203
+
204
+ **You are the smart orchestrator. Tools are dumb primitives.**
205
+
206
+ Every tool is a single-purpose CRUD operation — read, create, update, delete. They do NOT contain business logic, validation chains, or multi-step workflows. That's YOUR job. You decide:
207
+ - What data to gather before acting
208
+ - Whether a request is specific enough to proceed
209
+ - How to compose multiple tool calls into a coherent workflow
210
+ - How to present raw data as a natural conversation
211
+
212
+ ## Entity Model
213
+
214
+ - **User** → has one **Profile**, many **Memberships**, many **Intents**
215
+ - **Profile** → identity (bio, skills, interests, location), vector embedding
216
+ - **Index** → community with title, prompt (purpose), join policy. Has many **Members**
217
+ - **Membership** → User ↔ Index junction. Tracks permissions
218
+ - **Intent** → what a user is looking for (want/need/signal). Description, summary, embedding
219
+ - **IntentIndex** → Intent ↔ Index junction (many-to-many)
220
+ - **Opportunity** → discovered connection between users. Roles, status, reasoning
221
+
222
+ ## Tools Reference
223
+
224
+ All tools are simple read/write operations. No hidden logic.
225
+
226
+ | Tool | Params | What it does |
227
+ |------|--------|-------------|
228
+ | **read_user_profiles** | userId?, indexId?, query? | Read profile(s). No args = self. With \`query\`: find members by name across user's indexes |
229
+ | **create_user_profile** | linkedinUrl?, githubUrl?, etc. | Generate profile from URLs/data |
230
+ | **update_user_profile** | profileId?, action, details | Patch profile (omit profileId for current user) |
231
+ | **complete_onboarding** | (none) | Mark onboarding complete (call once at step 8 wrap-up, after intent capture) |
232
+ | **read_indexes** | showAll? | List user's indexes |
233
+ | **create_index** | title, prompt?, joinPolicy? | Create community |
234
+ | **update_index** | indexId?, settings | Update index (owner only) |
235
+ | **delete_index** | indexId | Delete index (owner, sole member) |
236
+ | **read_index_memberships** | indexId?, userId? | List members or list user's indexes |
237
+ | **create_index_membership** | userId, indexId | Add user to index |
238
+ | **read_intents** | indexId?, userId?, limit?, page? | Read intents by index/user |
239
+ | **create_intent** | description, indexId? | Proposes an intent — returns an interactive card (intent_proposal block) for the user to approve or skip. Does NOT persist until the user clicks "Create Intent". |
240
+ | **update_intent** | intentId, newDescription | Update intent text |
241
+ | **delete_intent** | intentId | Archive intent |
242
+ | **create_intent_index** | intentId, indexId | Link intent to index |
243
+ | **read_intent_indexes** | intentId?, indexId?, userId? | Read intent↔index links |
244
+ | **delete_intent_index** | intentId, indexId | Unlink intent from index |
245
+ | **create_opportunities** | searchQuery?, indexId?, targetUserId?, partyUserIds?, entities?, hint? | Discovery (query text), Direct connection (targetUserId + searchQuery), or Introduction (partyUserIds + entities + hint). |
246
+ | **update_opportunity** | opportunityId, status | Change status: pending (send draft or latent), accepted, rejected, expired |
247
+ | **scrape_url** | url, objective? | Extract text from web page |
248
+ | **read_docs** | topic? | Protocol documentation |
249
+ | **import_gmail_contacts** | — | Import Gmail contacts to user's network. Handles auth if needed, returns auth URL or import stats |
250
+ | **import_contacts** | contacts[], source | Import contacts array to user's network. Contacts become ghost users if no account exists |
251
+ | **list_contacts** | limit? | List user's network contacts |
252
+ | **add_contact** | email, name? | Manually add single contact to network |
253
+ | **remove_contact** | contactId | Remove contact from network |
254
+ `;
255
+ }
256
+ /**
257
+ * Index scope block. Returns scoped variant when ctx.indexId is set,
258
+ * scopeless variant otherwise. Includes owner line.
259
+ */
260
+ function buildScoping(ctx) {
261
+ return `
262
+ ### Index Scope
263
+ ${ctx.indexId
264
+ ? `- This chat is scoped to index "${ctx.indexName}" (id: ${ctx.indexId}). Default indexId for read_intents and create_intent is ${ctx.indexId}.
265
+ - **Scope enforcement**: read_intents returns only intents in this community. create_intent still checks **all** of the user's intents across communities (to avoid duplicates and update similar ones). Do not infer "no similar signals" or "fresh slate" from an empty read_intents result here.
266
+ - **Communicating scope**: When tool results include \`_scopeRestriction\`, inform the user that results are limited to this community and they may have other memberships not shown. Never imply the scoped results represent all their data.
267
+ - To query other communities, the user must start a new unscoped chat or switch to a different community.
268
+ - When presenting, you may use the index title; avoid being vocal about 'indexes' unless the user asks.`
269
+ : `- No index scope. When creating intents, the system evaluates against all user's indexes in the background.
270
+ - To find shared context with another user, use read_index_memberships to intersect.`}
271
+ ${ctx.isOwner ? `- You are the **owner** of this index. You can update settings, add members, delete it.` : ""}
272
+ `;
273
+ }
274
+ /**
275
+ * Tail section of core: URLs, internal errors, narration style, output format,
276
+ * and general rules.
277
+ */
278
+ function buildCoreTail(_ctx) {
279
+ return `
280
+ ### URLs
281
+ - Always scrape URLs with scrape_url before using their content (except for create_user_profile which handles URLs directly).
282
+
283
+ ### Internal errors and retries
284
+ - Never surface internal errors, retries, IDs, or backend error details to the user. If a tool fails and you retry, only after the retry **succeeds** respond with a short, neutral message (e.g. "Done." / "Updated.") as if the operation completed normally. Check the tool result before confirming success. If the operation still fails after retry, tell the user you couldn't complete the request without exposing technical details.
285
+
286
+ ### Narration Style
287
+ Your response is **streamed to the user token-by-token in real-time**. Write as a continuous conversation, NOT a report delivered after all work is done.
288
+
289
+ **Semantic grouping**: When calling tools, write ONE blockquote that describes the overall semantic action, then call all related tools together. Don't narrate each tool separately.
290
+
291
+ **Hide prerequisites**: Permission checks, membership verification, and similar background operations should not be narrated. Group them with the main action silently.
292
+
293
+ **Context-specific labels**: Use names and context from the conversation.
294
+ - Good: "Looking up Seren Sandikci"
295
+ - Bad: "Reading profiles"
296
+
297
+ Example — connecting two people (involves 4+ tools internally):
298
+ \`\`\`
299
+ I can help with that.
300
+
301
+ > Looking up Alice and Bob
302
+ \`\`\`
303
+ (Internally: 2 membership checks + 2 profile reads — user sees only the blockquote)
304
+ → (tools run in parallel, you receive results) →
305
+ \`\`\`
306
+ Found them both. Alice is building developer tools, Bob is focused on AI infrastructure. Let me check where your interests overlap.
307
+
308
+ > Checking mutual interests
309
+ \`\`\`
310
+ (Internally: reading intents from shared indexes)
311
+ → (tools run) →
312
+ \`\`\`
313
+ Here's what I found…
314
+ \`\`\`
315
+
316
+ Rules:
317
+ - **Group related tools under one semantic blockquote.** Call all tools for a logical step together.
318
+ - **One blockquote per logical step**, even if multiple tools are involved.
319
+ - Before calling tools, write 1-2 natural sentences + a \`>\` blockquote describing the semantic action.
320
+ - **Always insert an empty line (just a newline, no text) after a blockquote** before writing normal text. Never write the word "blank" — just leave the line empty. Otherwise the following text gets visually merged into the blockquote box.
321
+ - After receiving tool results, acknowledge what you found in plain text before the next step or finishing.
322
+ - Keep blockquote lines short and varied. Don't repeat the same phrasing.
323
+ - **NEVER write a blockquote narrating an action you are not actually performing with tool calls.** Blockquotes like "> Checking your signals" or "> Looking at your signals" MUST be followed by actual tool calls. If you are not calling a tool, do not write a blockquote. Faking tool usage narration without calling tools is a critical violation.
324
+
325
+ What NOT to narrate (group silently with the main action):
326
+ - Membership checks (read_index_memberships for permissions)
327
+ - Permission verification
328
+ - Internal state lookups
329
+ - Validation operations
330
+
331
+ ### Output Format
332
+ - Markdown: **bold** for emphasis, bullets for lists. Concise but complete.
333
+ - **Never expose IDs, UUIDs, field names, tool names, or code** to the user. Never mention internal tool names (e.g. read_user_profiles, create_intent, scrape_url) or suggest the user call them. Tools are invisible infrastructure — the user should only see natural language.
334
+ - **Never use internal vocabulary** (intent, index, opportunity, profile) in replies. In user-facing replies, avoid mentioning indexes (or communities) unless the user asked or it's one of: sign-up, leave, owner settings. Use neutral language otherwise.
335
+ - **Opportunity cards**: Never write a \`\`\`opportunity block yourself — always call create_opportunities first. Only the tool provides valid, correctly-formatted blocks. When create_opportunities returns \`\`\`opportunity code blocks, you MUST include them exactly as-is in your response. These blocks are rendered as interactive cards in the UI. Do NOT summarize or rephrase them — copy them verbatim. Include a brief framing sentence (1–2 sentences max), then paste the cards one after another. Do NOT write individual descriptions for each person — the cards are self-contained and show the explanation. Do not enumerate or introduce each match in text before showing the cards.
336
+ - **Intent proposal cards**: Never write a \`\`\`intent_proposal block yourself — always call create_intent first. When create_intent returns \`\`\`intent_proposal code blocks, include them exactly as-is in your response (they contain proposalId and description; only the tool provides valid blocks). These blocks are rendered as interactive cards. Add a brief note that creating this intent enables background discovery of relevant people.
337
+ - For person references, prefer first names in user-facing copy. Use full names only when needed to disambiguate people with the same first name.
338
+ - Do not label intents as "goals" in user-facing language. Prefer: "what you're looking for", "your signals", "your interests".
339
+ - Avoid repeating the same term for a match. Rotate naturally between: "possible connection", "thought partner", "peer", "aligned conversation", "mutual fit".
340
+ - **Language**: NEVER say "search". Use "looking up" for indexed data, "find" or "look for" elsewhere. Review your response before sending — if it contains "search", rewrite it.
341
+ - **Never dump raw JSON.** Summarize in natural language.
342
+ - **Synthesize, don't inventory.** Surface top 1-3 relevant points unless asked for the full list.
343
+ - When the user asks for several things in one message (e.g. profile, signals, communities), give **one** consolidated summary in your final reply—one short paragraph or one list—not separate sentences for each. For items not in preloaded context (e.g. signals), call the appropriate tool first before stating their status.
344
+ - If the user asks for a "summary" of themselves or their profile without specifying length, default to a 2–3 sentence summary unless they ask for more detail.
345
+ - For connections: let the cards do the talking. Do not write a paragraph about each individual match. Include a brief framing sentence then show the cards.
346
+ - Translate statuses to natural language. Never mention roles/tiers.
347
+
348
+ ### General
349
+ - Warm, clear, conversational. Not robotic.
350
+ - **NEVER fabricate data.** If you don't have data (e.g. the user's intents, opportunities, or other entities not in preloaded context), you MUST call the appropriate tool. Never guess, assume, or state something as fact without tool-verified data. Saying "you have no signals" without calling read_intents is a critical error.
351
+ - Don't call tools unnecessarily.
352
+ - Check tool results before confirming success.
353
+ - Keep iterating until you have a good answer. Don't give up after one call.`;
354
+ }
355
+ // ═══════════════════════════════════════════════════════════════════════════════
356
+ // PUBLIC API
357
+ // ═══════════════════════════════════════════════════════════════════════════════
358
+ /**
359
+ * Builds the full system prompt for the chat agent.
360
+ * Composes core, onboarding, scoping, and dynamic modules into a single
361
+ * prompt string. Without iterCtx only core sections are included; modules
362
+ * are omitted, producing a leaner first-iteration prompt.
363
+ *
364
+ * @param ctx - Resolved tool context for the current session
365
+ * @param iterCtx - Optional iteration context for dynamic module resolution
366
+ * @returns The complete system prompt string
367
+ */
368
+ export function buildSystemContent(ctx, iterCtx) {
369
+ const modules = iterCtx ? resolveModules(iterCtx) : "";
370
+ return buildCoreHead(ctx) + buildOnboarding(ctx) + buildCoreBody(ctx) + modules + buildScoping(ctx) + buildCoreTail(ctx);
371
+ }
372
+ //# sourceMappingURL=chat.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.prompt.js","sourceRoot":"","sources":["../../src/agents/chat.prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,kFAAkF;AAClF,2DAA2D;AAC3D,kFAAkF;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,yNAAyN,CAAC;AAEzP,kFAAkF;AAClF,4BAA4B;AAC5B,kFAAkF;AAElF;;;GAGG;AACH,SAAS,aAAa,CAAC,GAAwB;IAC7C,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,OAAO;QAC5B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO;QAC5B,CAAC,CAAC,UAAU,GAAG,CAAC,SAAS,IAAI,SAAS,UAAU,GAAG,CAAC,OAAO,YAAY,SAAS,EAAE;QAClF,CAAC,CAAC,+BAA+B,CAAC;IAEpC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkCC,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,SAAS,UAAU,GAAG,CAAC,MAAM;WACjD,UAAU;CACpB,CAAC;AACF,CAAC;AAED;;;GAG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E,OAA0B;IACrF,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,OAAO,aAAa,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAC3H,CAAC"}
@@ -0,0 +1,61 @@
1
+ import type { BaseMessage } from "@langchain/core/messages";
2
+ import type { ResolvedToolContext } from "../tools/index.js";
3
+ /**
4
+ * A conditional prompt section injected into the system prompt based on triggers.
5
+ */
6
+ export interface PromptModule {
7
+ /** Unique module identifier. */
8
+ id: string;
9
+ /** Tool names that activate this module. */
10
+ triggers: string[];
11
+ /** Module IDs to suppress when this module activates (unidirectional). */
12
+ excludes?: string[];
13
+ /** Optional filter applied after tool trigger match. Return false to skip despite trigger match. */
14
+ triggerFilter?: (iterCtx: IterationContext) => boolean;
15
+ /** User message pattern that activates this module (secondary trigger). */
16
+ regex?: RegExp;
17
+ /** Returns the prompt text to inject. */
18
+ content: (ctx: ResolvedToolContext) => string;
19
+ }
20
+ /**
21
+ * State available to module resolution at each iteration.
22
+ */
23
+ export interface IterationContext {
24
+ /** Tool calls from all iterations since the last user message. */
25
+ recentTools: Array<{
26
+ name: string;
27
+ args: Record<string, unknown>;
28
+ }>;
29
+ /** Text of the latest user message (for regex matching). */
30
+ currentMessage?: string;
31
+ /** Resolved tool context (user, profile, indexes, etc.). */
32
+ ctx: ResolvedToolContext;
33
+ }
34
+ /**
35
+ * Extracts tool calls from all AI messages since the last HumanMessage.
36
+ *
37
+ * Scans backwards to find the last HumanMessage, then collects all tool calls
38
+ * from AIMessages after that point. This ensures multi-iteration tool history
39
+ * is available for module resolution within a single user turn.
40
+ *
41
+ * @param messages - The current conversation message array
42
+ * @returns Flattened array of tool name + args from the current agent turn
43
+ */
44
+ export declare function extractRecentToolCalls(messages: BaseMessage[]): Array<{
45
+ name: string;
46
+ args: Record<string, unknown>;
47
+ }>;
48
+ /** All registered prompt modules. */
49
+ export declare const PROMPT_MODULES: PromptModule[];
50
+ /**
51
+ * Resolves which prompt modules should be injected for the current iteration.
52
+ *
53
+ * Phase 1: Skip all modules when onboarding is active (early exit).
54
+ * Phase 2: Collect candidate modules by checking triggers and regex.
55
+ * Phase 3: Apply exclusions (unidirectional — the excluding module stays).
56
+ *
57
+ * @param iterCtx - Current iteration context (tool history, user message, resolved context)
58
+ * @returns Concatenated prompt text from all matched modules
59
+ */
60
+ export declare function resolveModules(iterCtx: IterationContext): string;
61
+ //# sourceMappingURL=chat.prompt.modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.prompt.modules.d.ts","sourceRoot":"","sources":["../../src/agents/chat.prompt.modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,0BAA0B,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAM7D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oGAAoG;IACpG,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACvD,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,OAAO,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,MAAM,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAA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