@indexnetwork/protocol 6.12.1-rc.404.1 → 6.13.22-rc.405.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +240 -0
- package/IMPLEMENTATION.md +20 -0
- package/STABILITY.md +4 -0
- package/dist/agent/agent.tools.d.ts +11 -3
- package/dist/agent/agent.tools.js +11 -301
- package/dist/capabilities/communities.facade.d.ts +13 -0
- package/dist/capabilities/communities.facade.js +12 -0
- package/dist/capabilities/communities.tools.port.d.ts +5 -0
- package/dist/capabilities/communities.tools.port.js +1 -0
- package/dist/capabilities/contacts.facade.d.ts +9 -0
- package/dist/capabilities/contacts.facade.js +8 -0
- package/dist/capabilities/contacts.tools.port.d.ts +9 -0
- package/dist/capabilities/contacts.tools.port.js +1 -0
- package/dist/capabilities/integrations.facade.d.ts +8 -0
- package/dist/capabilities/integrations.facade.js +7 -0
- package/dist/capabilities/integrations.tools.port.d.ts +9 -0
- package/dist/capabilities/integrations.tools.port.js +1 -0
- package/dist/capabilities/interaction-composition.facade.d.ts +10 -0
- package/dist/capabilities/interaction-composition.facade.js +9 -0
- package/dist/capabilities/negotiation.discovery.facade.d.ts +9 -0
- package/dist/capabilities/negotiation.discovery.facade.js +7 -0
- package/dist/capabilities/negotiation.facade.d.ts +23 -0
- package/dist/capabilities/negotiation.facade.js +17 -0
- package/dist/capabilities/negotiation.memory.facade.d.ts +6 -0
- package/dist/capabilities/negotiation.memory.facade.js +5 -0
- package/dist/capabilities/negotiation.questions.facade.d.ts +6 -0
- package/dist/capabilities/negotiation.questions.facade.js +5 -0
- package/dist/capabilities/negotiation.state.facade.d.ts +5 -0
- package/dist/capabilities/negotiation.state.facade.js +1 -0
- package/dist/capabilities/negotiation.summary.facade.d.ts +5 -0
- package/dist/capabilities/negotiation.summary.facade.js +5 -0
- package/dist/capabilities/negotiation.tools.port.d.ts +5 -0
- package/dist/capabilities/negotiation.tools.port.js +1 -0
- package/dist/capabilities/opportunities.facade.d.ts +50 -0
- package/dist/capabilities/opportunities.facade.js +50 -0
- package/dist/capabilities/opportunities.safety.facade.d.ts +2 -0
- package/dist/capabilities/opportunities.safety.facade.js +2 -0
- package/dist/capabilities/opportunities.tools.port.d.ts +5 -0
- package/dist/capabilities/opportunities.tools.port.js +1 -0
- package/dist/capabilities/participant-agents.debug.facade.d.ts +2 -0
- package/dist/capabilities/participant-agents.debug.facade.js +1 -0
- package/dist/capabilities/participant-agents.facade.d.ts +35 -0
- package/dist/capabilities/participant-agents.facade.js +35 -0
- package/dist/capabilities/participant-agents.tools.facade.d.ts +8 -0
- package/dist/capabilities/participant-agents.tools.facade.js +8 -0
- package/dist/capabilities/participant-agents.tools.port.d.ts +9 -0
- package/dist/capabilities/participant-agents.tools.port.js +1 -0
- package/dist/capabilities/participant-context.facade.d.ts +13 -0
- package/dist/capabilities/participant-context.facade.js +14 -0
- package/dist/capabilities/participant-context.tools.port.d.ts +9 -0
- package/dist/capabilities/participant-context.tools.port.js +1 -0
- package/dist/capabilities/questions.enqueue.facade.d.ts +5 -0
- package/dist/capabilities/questions.enqueue.facade.js +1 -0
- package/dist/capabilities/questions.facade.d.ts +8 -0
- package/dist/capabilities/questions.facade.js +7 -0
- package/dist/capabilities/questions.runtime.facade.d.ts +5 -0
- package/dist/capabilities/questions.runtime.facade.js +5 -0
- package/dist/capabilities/questions.tools.port.d.ts +5 -0
- package/dist/capabilities/questions.tools.port.js +1 -0
- package/dist/capabilities/signals.facade.d.ts +16 -0
- package/dist/capabilities/signals.facade.js +14 -0
- package/dist/capabilities/signals.indexing.facade.d.ts +12 -0
- package/dist/capabilities/signals.indexing.facade.js +11 -0
- package/dist/capabilities/signals.tools.port.d.ts +5 -0
- package/dist/capabilities/signals.tools.port.js +1 -0
- package/dist/chat/chat-streaming.types.d.ts +0 -1
- package/dist/chat/chat-streaming.types.js +1 -2
- package/dist/chat/chat.agent.d.ts +0 -1
- package/dist/chat/chat.agent.js +0 -1
- package/dist/chat/chat.graph.d.ts +0 -1
- package/dist/chat/chat.graph.js +0 -1
- package/dist/chat/chat.interrupt.classifier.d.ts +0 -1
- package/dist/chat/chat.interrupt.classifier.js +0 -1
- package/dist/chat/chat.persona.d.ts +0 -1
- package/dist/chat/chat.persona.js +0 -1
- package/dist/chat/chat.prompt.d.ts +0 -1
- package/dist/chat/chat.prompt.js +0 -1
- package/dist/chat/chat.prompt.modules.d.ts +0 -1
- package/dist/chat/chat.prompt.modules.js +0 -1
- package/dist/chat/chat.question-dedup.d.ts +0 -1
- package/dist/chat/chat.question-dedup.js +0 -1
- package/dist/chat/chat.state.d.ts +0 -1
- package/dist/chat/chat.state.js +0 -1
- package/dist/chat/chat.streamer.d.ts +0 -1
- package/dist/chat/chat.streamer.js +0 -1
- package/dist/chat/chat.suggester.d.ts +0 -1
- package/dist/chat/chat.suggester.js +0 -1
- package/dist/chat/chat.summarizer.d.ts +0 -1
- package/dist/chat/chat.summarizer.js +0 -1
- package/dist/chat/chat.title.generator.d.ts +0 -1
- package/dist/chat/chat.title.generator.js +0 -1
- package/dist/chat/chat.tools.d.ts +0 -1
- package/dist/chat/chat.tools.js +0 -1
- package/dist/chat/chat.utils.d.ts +0 -1
- package/dist/chat/chat.utils.js +0 -1
- package/dist/chat/negotiator.persona.d.ts +0 -1
- package/dist/chat/negotiator.persona.js +0 -1
- package/dist/chat/negotiator.prompt.d.ts +1 -2
- package/dist/chat/negotiator.prompt.js +1 -2
- package/dist/chat/negotiator.tools.d.ts +0 -1
- package/dist/chat/negotiator.tools.js +0 -1
- package/dist/chat/onboarding.persona.d.ts +0 -1
- package/dist/chat/onboarding.persona.js +0 -1
- package/dist/chat/onboarding.prompt.d.ts +0 -1
- package/dist/chat/onboarding.prompt.js +0 -1
- package/dist/chat/reporter.action.contracts.d.ts +36 -0
- package/dist/chat/reporter.action.contracts.js +1 -0
- package/dist/chat/reporter.action.tools.d.ts +2 -37
- package/dist/chat/reporter.action.tools.js +0 -1
- package/dist/chat/reporter.persona.d.ts +0 -1
- package/dist/chat/reporter.persona.js +0 -1
- package/dist/chat/reporter.prompt.d.ts +0 -1
- package/dist/chat/reporter.prompt.js +0 -1
- package/dist/chat/signal.persona.d.ts +0 -1
- package/dist/chat/signal.persona.js +0 -1
- package/dist/chat/signal.prompt.d.ts +0 -1
- package/dist/chat/signal.prompt.js +0 -1
- package/dist/communities/application/index.d.ts +45 -0
- package/dist/communities/application/index.js +50 -0
- package/dist/communities/application/indexer.graph.d.ts +446 -0
- package/dist/communities/application/indexer.graph.js +420 -0
- package/dist/communities/application/indexer.state.d.ts +172 -0
- package/dist/communities/application/indexer.state.js +116 -0
- package/dist/communities/application/membership.graph.d.ts +270 -0
- package/dist/communities/application/membership.graph.js +229 -0
- package/dist/communities/application/network.graph.d.ts +648 -0
- package/dist/communities/application/network.graph.js +303 -0
- package/dist/communities/application/network.recommender.d.ts +44 -0
- package/dist/communities/application/network.recommender.js +113 -0
- package/dist/communities/application/network.tools.d.ts +35 -0
- package/dist/communities/application/network.tools.js +578 -0
- package/dist/communities/domain/index.d.ts +29 -0
- package/dist/communities/domain/index.js +31 -0
- package/dist/communities/domain/membership.state.d.ts +87 -0
- package/dist/communities/domain/membership.state.js +53 -0
- package/dist/communities/domain/network.state.d.ts +192 -0
- package/dist/communities/domain/network.state.js +66 -0
- package/dist/communities/index.d.ts +14 -0
- package/dist/communities/index.js +14 -0
- package/dist/communities/ports/index.d.ts +25 -0
- package/dist/communities/ports/index.js +27 -0
- package/dist/communities/public/index.d.ts +30 -0
- package/dist/communities/public/index.js +33 -0
- package/dist/contact/contact.inviter.d.ts +7 -44
- package/dist/contact/contact.inviter.js +6 -59
- package/dist/contact/contact.tools.d.ts +7 -5
- package/dist/contact/contact.tools.js +7 -177
- package/dist/contacts/application/contact.inviter.d.ts +49 -0
- package/dist/contacts/application/contact.inviter.js +64 -0
- package/dist/contacts/application/contact.tools.d.ts +20 -0
- package/dist/contacts/application/contact.tools.js +191 -0
- package/dist/contacts/application/index.d.ts +22 -0
- package/dist/contacts/application/index.js +21 -0
- package/dist/contacts/domain/contact.types.d.ts +51 -0
- package/dist/contacts/domain/contact.types.js +10 -0
- package/dist/contacts/domain/index.d.ts +18 -0
- package/dist/contacts/domain/index.js +1 -0
- package/dist/contacts/index.d.ts +24 -0
- package/dist/contacts/index.js +24 -0
- package/dist/contacts/ports/contact.repository.port.d.ts +28 -0
- package/dist/contacts/ports/contact.repository.port.js +14 -0
- package/dist/contacts/ports/contact.tools.port.d.ts +26 -0
- package/dist/contacts/ports/contact.tools.port.js +21 -0
- package/dist/contacts/ports/index.d.ts +22 -0
- package/dist/contacts/ports/index.js +21 -0
- package/dist/contacts/public/index.d.ts +36 -0
- package/dist/contacts/public/index.js +33 -0
- package/dist/context/context.generator.d.ts +0 -1
- package/dist/context/context.generator.js +0 -1
- package/dist/enrichment/enrichment.enricher.d.ts +0 -1
- package/dist/enrichment/enrichment.enricher.js +0 -1
- package/dist/enrichment/enrichment.generator.d.ts +0 -1
- package/dist/enrichment/enrichment.generator.js +0 -1
- package/dist/enrichment/enrichment.graph.d.ts +6 -7
- package/dist/enrichment/enrichment.graph.js +0 -1
- package/dist/enrichment/enrichment.state.d.ts +2 -3
- package/dist/enrichment/enrichment.state.js +0 -1
- package/dist/enrichment/enrichment.tools.d.ts +3 -3
- package/dist/enrichment/enrichment.tools.js +0 -1
- package/dist/index.d.ts +106 -91
- package/dist/index.js +79 -71
- package/dist/integration/integration.tools.d.ts +6 -10
- package/dist/integration/integration.tools.js +6 -82
- package/dist/integrations/application/index.d.ts +14 -0
- package/dist/integrations/application/index.js +14 -0
- package/dist/integrations/application/integration.tools.d.ts +27 -0
- package/dist/integrations/application/integration.tools.js +98 -0
- package/dist/integrations/domain/index.d.ts +18 -0
- package/dist/integrations/domain/index.js +1 -0
- package/dist/integrations/domain/integration.types.d.ts +53 -0
- package/dist/integrations/domain/integration.types.js +11 -0
- package/dist/integrations/index.d.ts +27 -0
- package/dist/integrations/index.js +27 -0
- package/dist/integrations/ports/index.d.ts +28 -0
- package/dist/integrations/ports/index.js +26 -0
- package/dist/integrations/ports/integration.adapter.port.d.ts +62 -0
- package/dist/integrations/ports/integration.adapter.port.js +15 -0
- package/dist/integrations/ports/integration.importer.port.d.ts +31 -0
- package/dist/integrations/ports/integration.importer.port.js +15 -0
- package/dist/integrations/ports/integration.tools.port.d.ts +28 -0
- package/dist/integrations/ports/integration.tools.port.js +21 -0
- package/dist/integrations/public/index.d.ts +37 -0
- package/dist/integrations/public/index.js +34 -0
- package/dist/intent/intent.clarifier.d.ts +3 -52
- package/dist/intent/intent.clarifier.js +2 -202
- package/dist/intent/intent.graph.d.ts +3 -551
- package/dist/intent/intent.graph.js +3 -937
- package/dist/intent/intent.indexer.d.ts +2 -83
- package/dist/intent/intent.indexer.js +2 -171
- package/dist/intent/intent.inferrer.d.ts +2 -95
- package/dist/intent/intent.inferrer.js +2 -234
- package/dist/intent/intent.reconciler.d.ts +2 -106
- package/dist/intent/intent.reconciler.js +2 -187
- package/dist/intent/intent.specificity.d.ts +2 -3
- package/dist/intent/intent.specificity.js +2 -3
- package/dist/intent/intent.state.d.ts +8 -229
- package/dist/intent/intent.state.js +8 -189
- package/dist/intent/intent.tools.d.ts +6 -24
- package/dist/intent/intent.tools.js +4 -788
- package/dist/intent/intent.verifier.d.ts +2 -116
- package/dist/intent/intent.verifier.js +2 -263
- package/dist/maintenance/maintenance.graph.d.ts +0 -1
- package/dist/maintenance/maintenance.graph.js +0 -1
- package/dist/maintenance/maintenance.state.d.ts +0 -1
- package/dist/maintenance/maintenance.state.js +0 -1
- package/dist/mcp/elicitation.builder.d.ts +0 -1
- package/dist/mcp/elicitation.builder.js +0 -1
- package/dist/mcp/elicitation.dispatcher.d.ts +0 -1
- package/dist/mcp/elicitation.dispatcher.js +0 -1
- package/dist/mcp/mcp.server.d.ts +0 -1
- package/dist/mcp/mcp.server.js +1 -2
- package/dist/negotiation/application/index.d.ts +48 -0
- package/dist/negotiation/application/index.js +49 -0
- package/dist/negotiation/application/insight.generator.d.ts +31 -0
- package/dist/negotiation/application/insight.generator.js +105 -0
- package/dist/negotiation/application/negotiation.agent.d.ts +110 -0
- package/dist/negotiation/application/negotiation.agent.js +244 -0
- package/dist/negotiation/application/negotiation.detail-reader.d.ts +94 -0
- package/dist/negotiation/application/negotiation.detail-reader.js +91 -0
- package/dist/negotiation/application/negotiation.graph.d.ts +664 -0
- package/dist/negotiation/application/negotiation.graph.js +1393 -0
- package/dist/negotiation/application/negotiation.reflect.d.ts +194 -0
- package/dist/negotiation/application/negotiation.reflect.js +145 -0
- package/dist/negotiation/application/negotiation.screen.d.ts +78 -0
- package/dist/negotiation/application/negotiation.screen.js +108 -0
- package/dist/negotiation/application/negotiation.summarizer.d.ts +25 -0
- package/dist/negotiation/application/negotiation.summarizer.js +101 -0
- package/dist/negotiation/application/negotiation.tools.d.ts +18 -0
- package/dist/negotiation/application/negotiation.tools.js +782 -0
- package/dist/negotiation/domain/index.d.ts +48 -0
- package/dist/negotiation/domain/index.js +50 -0
- package/dist/negotiation/domain/negotiation.consultation-policy.d.ts +39 -0
- package/dist/negotiation/domain/negotiation.consultation-policy.js +68 -0
- package/dist/negotiation/domain/negotiation.deadlock.contracts.d.ts +10 -0
- package/dist/negotiation/domain/negotiation.deadlock.contracts.js +1 -0
- package/dist/negotiation/domain/negotiation.deadlock.d.ts +81 -0
- package/dist/negotiation/domain/negotiation.deadlock.js +103 -0
- package/dist/negotiation/domain/negotiation.intent-snapshot-provenance.d.ts +21 -0
- package/dist/negotiation/domain/negotiation.intent-snapshot-provenance.js +28 -0
- package/dist/negotiation/domain/negotiation.lifecycle-narration.d.ts +18 -0
- package/dist/negotiation/domain/negotiation.lifecycle-narration.js +87 -0
- package/dist/negotiation/domain/negotiation.memory.d.ts +65 -0
- package/dist/negotiation/domain/negotiation.memory.js +83 -0
- package/dist/negotiation/domain/negotiation.protocol.d.ts +536 -0
- package/dist/negotiation/domain/negotiation.protocol.js +202 -0
- package/dist/negotiation/domain/negotiation.question-safety.d.ts +25 -0
- package/dist/negotiation/domain/negotiation.question-safety.js +55 -0
- package/dist/negotiation/domain/negotiation.screen.contracts.d.ts +88 -0
- package/dist/negotiation/domain/negotiation.screen.contracts.js +58 -0
- package/dist/negotiation/domain/negotiation.state.d.ts +497 -0
- package/dist/negotiation/domain/negotiation.state.js +288 -0
- package/dist/negotiation/domain/negotiation.task-lock-policy.d.ts +10 -0
- package/dist/negotiation/domain/negotiation.task-lock-policy.js +22 -0
- package/dist/negotiation/index.d.ts +49 -0
- package/dist/negotiation/index.js +49 -0
- package/dist/negotiation/insight.generator.d.ts +3 -30
- package/dist/negotiation/insight.generator.js +3 -104
- package/dist/negotiation/negotiation.agent.d.ts +3 -109
- package/dist/negotiation/negotiation.agent.js +3 -248
- package/dist/negotiation/negotiation.attribution.d.ts +0 -1
- package/dist/negotiation/negotiation.attribution.js +0 -1
- package/dist/negotiation/negotiation.consultation-policy.d.ts +3 -38
- package/dist/negotiation/negotiation.consultation-policy.js +3 -67
- package/dist/negotiation/negotiation.deadlock.contracts.d.ts +5 -0
- package/dist/negotiation/negotiation.deadlock.contracts.js +5 -0
- package/dist/negotiation/negotiation.deadlock.d.ts +3 -94
- package/dist/negotiation/negotiation.deadlock.js +3 -101
- package/dist/negotiation/negotiation.detail-reader.d.ts +5 -0
- package/dist/negotiation/negotiation.detail-reader.js +5 -0
- package/dist/negotiation/negotiation.graph.d.ts +3 -663
- package/dist/negotiation/negotiation.graph.js +3 -1459
- package/dist/negotiation/negotiation.intent-snapshot-provenance.d.ts +5 -0
- package/dist/negotiation/negotiation.intent-snapshot-provenance.js +5 -0
- package/dist/negotiation/negotiation.lifecycle-narration.d.ts +5 -0
- package/dist/negotiation/negotiation.lifecycle-narration.js +5 -0
- package/dist/negotiation/negotiation.memory.d.ts +5 -56
- package/dist/negotiation/negotiation.memory.js +5 -69
- package/dist/negotiation/negotiation.protocol.d.ts +3 -535
- package/dist/negotiation/negotiation.protocol.js +3 -201
- package/dist/negotiation/negotiation.question-safety.d.ts +3 -24
- package/dist/negotiation/negotiation.question-safety.js +3 -54
- package/dist/negotiation/negotiation.reflect.d.ts +4 -197
- package/dist/negotiation/negotiation.reflect.js +4 -151
- package/dist/negotiation/negotiation.screen.d.ts +6 -159
- package/dist/negotiation/negotiation.screen.js +6 -152
- package/dist/negotiation/negotiation.state.d.ts +3 -495
- package/dist/negotiation/negotiation.state.js +3 -284
- package/dist/negotiation/negotiation.summarizer.d.ts +3 -24
- package/dist/negotiation/negotiation.summarizer.js +3 -100
- package/dist/negotiation/negotiation.task-lock-policy.d.ts +5 -0
- package/dist/negotiation/negotiation.task-lock-policy.js +5 -0
- package/dist/negotiation/negotiation.tools.d.ts +3 -15
- package/dist/negotiation/negotiation.tools.js +3 -946
- package/dist/negotiation/ports/index.d.ts +18 -0
- package/dist/negotiation/ports/index.js +18 -0
- package/dist/negotiation/ports/negotiation.tools.port.d.ts +18 -0
- package/dist/negotiation/ports/negotiation.tools.port.js +1 -0
- package/dist/negotiation/public/index.d.ts +58 -0
- package/dist/negotiation/public/index.js +60 -0
- package/dist/network/indexer/indexer.graph.d.ts +3 -413
- package/dist/network/indexer/indexer.graph.js +3 -375
- package/dist/network/indexer/indexer.state.d.ts +3 -149
- package/dist/network/indexer/indexer.state.js +3 -98
- package/dist/network/membership/membership.graph.d.ts +3 -248
- package/dist/network/membership/membership.graph.js +3 -202
- package/dist/network/membership/membership.state.d.ts +3 -75
- package/dist/network/membership/membership.state.js +3 -41
- package/dist/network/network.graph.d.ts +3 -629
- package/dist/network/network.graph.js +3 -267
- package/dist/network/network.recommender.d.ts +3 -40
- package/dist/network/network.recommender.js +3 -109
- package/dist/network/network.state.d.ts +3 -180
- package/dist/network/network.state.js +3 -54
- package/dist/network/network.tools.d.ts +5 -3
- package/dist/network/network.tools.js +5 -566
- package/dist/opportunity/application/delivery-card.cache.d.ts +25 -0
- package/dist/opportunity/application/delivery-card.cache.js +43 -0
- package/dist/opportunity/application/index.d.ts +63 -0
- package/dist/opportunity/application/index.js +68 -0
- package/dist/opportunity/application/negotiation-context.loader.d.ts +59 -0
- package/dist/opportunity/application/negotiation-context.loader.js +88 -0
- package/dist/opportunity/application/opportunity.card-presentation.d.ts +44 -0
- package/dist/opportunity/application/opportunity.card-presentation.js +104 -0
- package/dist/opportunity/application/opportunity.discover.d.ts +215 -0
- package/dist/opportunity/application/opportunity.discover.js +793 -0
- package/dist/opportunity/application/opportunity.discovery-continuation-finalization.d.ts +34 -0
- package/dist/opportunity/application/opportunity.discovery-continuation-finalization.js +74 -0
- package/dist/opportunity/application/opportunity.discovery-mcp-lifecycle-finalization.d.ts +44 -0
- package/dist/opportunity/application/opportunity.discovery-mcp-lifecycle-finalization.js +92 -0
- package/dist/opportunity/application/opportunity.discovery-negotiation-summary.d.ts +14 -0
- package/dist/opportunity/application/opportunity.discovery-negotiation-summary.js +46 -0
- package/dist/opportunity/application/opportunity.enricher.d.ts +71 -0
- package/dist/opportunity/application/opportunity.enricher.js +280 -0
- package/dist/opportunity/application/opportunity.evaluator.d.ts +275 -0
- package/dist/opportunity/application/opportunity.evaluator.js +459 -0
- package/dist/opportunity/application/opportunity.existing-negotiation.d.ts +77 -0
- package/dist/opportunity/application/opportunity.existing-negotiation.js +109 -0
- package/dist/opportunity/application/opportunity.feed-selection.d.ts +30 -0
- package/dist/opportunity/application/opportunity.feed-selection.js +96 -0
- package/dist/opportunity/application/opportunity.graph.d.ts +1427 -0
- package/dist/opportunity/application/opportunity.graph.js +3693 -0
- package/dist/opportunity/application/opportunity.introducer.d.ts +77 -0
- package/dist/opportunity/application/opportunity.introducer.js +99 -0
- package/dist/opportunity/application/opportunity.lifecycle.d.ts +63 -0
- package/dist/opportunity/application/opportunity.lifecycle.js +181 -0
- package/dist/opportunity/application/opportunity.newborn-stamping.d.ts +41 -0
- package/dist/opportunity/application/opportunity.newborn-stamping.js +81 -0
- package/dist/opportunity/application/opportunity.pending-questions.d.ts +33 -0
- package/dist/opportunity/application/opportunity.pending-questions.js +42 -0
- package/dist/opportunity/application/opportunity.persist.d.ts +58 -0
- package/dist/opportunity/application/opportunity.persist.js +145 -0
- package/dist/opportunity/application/opportunity.persistence-admission.d.ts +39 -0
- package/dist/opportunity/application/opportunity.persistence-admission.js +59 -0
- package/dist/opportunity/application/opportunity.presenter.d.ts +156 -0
- package/dist/opportunity/application/opportunity.presenter.js +736 -0
- package/dist/opportunity/application/opportunity.tools.d.ts +131 -0
- package/dist/opportunity/application/opportunity.tools.js +1834 -0
- package/dist/opportunity/application/opportunity.update-admission.d.ts +24 -0
- package/dist/opportunity/application/opportunity.update-admission.js +38 -0
- package/dist/opportunity/delivery-card.cache.d.ts +5 -26
- package/dist/opportunity/delivery-card.cache.js +5 -44
- package/dist/opportunity/discovery-question.helper.d.ts +3 -17
- package/dist/opportunity/discovery-question.helper.js +3 -14
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.js +0 -1
- package/dist/opportunity/discriminator/discriminator.assigner.d.ts +4 -5
- package/dist/opportunity/discriminator/discriminator.assigner.js +0 -1
- package/dist/opportunity/discriminator/discriminator.env.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.env.js +0 -1
- package/dist/opportunity/discriminator/discriminator.miner.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.miner.js +0 -1
- package/dist/opportunity/discriminator/discriminator.push.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.push.js +0 -1
- package/dist/opportunity/discriminator/discriminator.question.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.question.js +0 -1
- package/dist/opportunity/discriminator/discriminator.scorer.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.scorer.js +0 -1
- package/dist/opportunity/discriminator/discriminator.shadow.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.shadow.js +0 -1
- package/dist/opportunity/discriminator/discriminator.types.d.ts +0 -1
- package/dist/opportunity/discriminator/discriminator.types.js +0 -1
- package/dist/opportunity/domain/discovery-question.helper.d.ts +18 -0
- package/dist/opportunity/domain/discovery-question.helper.js +15 -0
- package/dist/opportunity/domain/index.d.ts +55 -0
- package/dist/opportunity/domain/index.js +52 -0
- package/dist/opportunity/domain/negotiation-summary.builder.d.ts +37 -0
- package/dist/opportunity/domain/negotiation-summary.builder.js +66 -0
- package/dist/opportunity/domain/opportunity.actor.d.ts +15 -0
- package/dist/opportunity/domain/opportunity.actor.js +39 -0
- package/dist/opportunity/domain/opportunity.claim-safety.d.ts +24 -0
- package/dist/opportunity/domain/opportunity.claim-safety.js +88 -0
- package/dist/opportunity/domain/opportunity.discovery-run-coalescing.d.ts +33 -0
- package/dist/opportunity/domain/opportunity.discovery-run-coalescing.js +33 -0
- package/dist/opportunity/domain/opportunity.discovery.contracts.d.ts +45 -0
- package/dist/opportunity/domain/opportunity.discovery.contracts.js +1 -0
- package/dist/opportunity/domain/opportunity.evidence.d.ts +21 -0
- package/dist/opportunity/domain/opportunity.evidence.js +78 -0
- package/dist/opportunity/domain/opportunity.labels.d.ts +8 -0
- package/dist/opportunity/domain/opportunity.labels.js +10 -0
- package/dist/opportunity/domain/opportunity.presentation-cache.d.ts +6 -0
- package/dist/opportunity/domain/opportunity.presentation-cache.js +14 -0
- package/dist/opportunity/domain/opportunity.presentation.d.ts +76 -0
- package/dist/opportunity/domain/opportunity.presentation.js +516 -0
- package/dist/opportunity/domain/opportunity.safe-presentation.d.ts +104 -0
- package/dist/opportunity/domain/opportunity.safe-presentation.js +102 -0
- package/dist/opportunity/domain/opportunity.state.d.ts +519 -0
- package/dist/opportunity/domain/opportunity.state.js +309 -0
- package/dist/opportunity/domain/opportunity.utils.d.ts +217 -0
- package/dist/opportunity/domain/opportunity.utils.js +395 -0
- package/dist/opportunity/feed/feed.categorizer.d.ts +0 -1
- package/dist/opportunity/feed/feed.categorizer.js +0 -1
- package/dist/opportunity/feed/feed.graph.d.ts +1 -2
- package/dist/opportunity/feed/feed.graph.js +0 -1
- package/dist/opportunity/feed/feed.health.d.ts +0 -1
- package/dist/opportunity/feed/feed.health.js +0 -1
- package/dist/opportunity/feed/feed.state.d.ts +1 -2
- package/dist/opportunity/feed/feed.state.js +0 -1
- package/dist/opportunity/index.d.ts +37 -0
- package/dist/opportunity/index.js +37 -0
- package/dist/opportunity/negotiation-context.loader.d.ts +3 -58
- package/dist/opportunity/negotiation-context.loader.js +3 -87
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.js +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.js +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.js +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.js +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.js +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.d.ts +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.js +0 -1
- package/dist/opportunity/negotiation-summary.builder.d.ts +3 -36
- package/dist/opportunity/negotiation-summary.builder.js +3 -65
- package/dist/opportunity/opportunity.actor.d.ts +3 -14
- package/dist/opportunity/opportunity.actor.js +3 -38
- package/dist/opportunity/opportunity.card-presentation.d.ts +5 -0
- package/dist/opportunity/opportunity.card-presentation.js +5 -0
- package/dist/opportunity/opportunity.claim-safety.d.ts +3 -23
- package/dist/opportunity/opportunity.claim-safety.js +3 -87
- package/dist/opportunity/opportunity.discover.d.ts +3 -218
- package/dist/opportunity/opportunity.discover.js +3 -917
- package/dist/opportunity/opportunity.discovery-continuation-finalization.d.ts +5 -0
- package/dist/opportunity/opportunity.discovery-continuation-finalization.js +5 -0
- package/dist/opportunity/opportunity.discovery-mcp-lifecycle-finalization.d.ts +5 -0
- package/dist/opportunity/opportunity.discovery-mcp-lifecycle-finalization.js +5 -0
- package/dist/opportunity/opportunity.discovery-negotiation-summary.d.ts +5 -0
- package/dist/opportunity/opportunity.discovery-negotiation-summary.js +5 -0
- package/dist/opportunity/opportunity.discovery-run-coalescing.d.ts +5 -0
- package/dist/opportunity/opportunity.discovery-run-coalescing.js +5 -0
- package/dist/opportunity/opportunity.discovery.contracts.d.ts +5 -0
- package/dist/opportunity/opportunity.discovery.contracts.js +5 -0
- package/dist/opportunity/opportunity.enricher.d.ts +3 -70
- package/dist/opportunity/opportunity.enricher.js +3 -279
- package/dist/opportunity/opportunity.evaluator.d.ts +5 -276
- package/dist/opportunity/opportunity.evaluator.js +5 -460
- package/dist/opportunity/opportunity.evidence.d.ts +5 -22
- package/dist/opportunity/opportunity.evidence.js +5 -79
- package/dist/opportunity/opportunity.existing-negotiation.d.ts +5 -0
- package/dist/opportunity/opportunity.existing-negotiation.js +5 -0
- package/dist/opportunity/opportunity.feed-selection.d.ts +5 -0
- package/dist/opportunity/opportunity.feed-selection.js +5 -0
- package/dist/opportunity/opportunity.graph.d.ts +3 -1489
- package/dist/opportunity/opportunity.graph.js +3 -4071
- package/dist/opportunity/opportunity.introducer.d.ts +3 -76
- package/dist/opportunity/opportunity.introducer.js +3 -98
- package/dist/opportunity/opportunity.labels.d.ts +5 -9
- package/dist/opportunity/opportunity.labels.js +5 -11
- package/dist/opportunity/opportunity.lifecycle.d.ts +5 -0
- package/dist/opportunity/opportunity.lifecycle.js +5 -0
- package/dist/opportunity/opportunity.newborn-stamping.d.ts +5 -0
- package/dist/opportunity/opportunity.newborn-stamping.js +5 -0
- package/dist/opportunity/opportunity.pending-questions.d.ts +3 -32
- package/dist/opportunity/opportunity.pending-questions.js +3 -41
- package/dist/opportunity/opportunity.persist.d.ts +3 -57
- package/dist/opportunity/opportunity.persist.js +3 -144
- package/dist/opportunity/opportunity.persistence-admission.d.ts +5 -0
- package/dist/opportunity/opportunity.persistence-admission.js +5 -0
- package/dist/opportunity/opportunity.presentation-cache.d.ts +5 -7
- package/dist/opportunity/opportunity.presentation-cache.js +5 -15
- package/dist/opportunity/opportunity.presentation.d.ts +3 -75
- package/dist/opportunity/opportunity.presentation.js +3 -515
- package/dist/opportunity/opportunity.presenter.d.ts +10 -155
- package/dist/opportunity/opportunity.presenter.js +10 -735
- package/dist/opportunity/opportunity.safe-presentation.d.ts +3 -103
- package/dist/opportunity/opportunity.safe-presentation.js +3 -101
- package/dist/opportunity/opportunity.state.d.ts +3 -518
- package/dist/opportunity/opportunity.state.js +3 -308
- package/dist/opportunity/opportunity.tools.d.ts +3 -157
- package/dist/opportunity/opportunity.tools.js +3 -2238
- package/dist/opportunity/opportunity.update-admission.d.ts +5 -0
- package/dist/opportunity/opportunity.update-admission.js +5 -0
- package/dist/opportunity/opportunity.utils.d.ts +3 -216
- package/dist/opportunity/opportunity.utils.js +3 -394
- package/dist/opportunity/outcome/outcome.env.d.ts +0 -1
- package/dist/opportunity/outcome/outcome.env.js +0 -1
- package/dist/opportunity/outcome/outcome.hypotheses.d.ts +0 -1
- package/dist/opportunity/outcome/outcome.hypotheses.js +0 -1
- package/dist/opportunity/outcome/outcome.shadow.d.ts +0 -1
- package/dist/opportunity/outcome/outcome.shadow.js +0 -1
- package/dist/opportunity/outcome/outcome.types.d.ts +0 -1
- package/dist/opportunity/outcome/outcome.types.js +0 -1
- package/dist/opportunity/ports/index.d.ts +5 -0
- package/dist/opportunity/ports/index.js +1 -0
- package/dist/opportunity/ports/opportunity.tools.port.d.ts +5 -0
- package/dist/opportunity/ports/opportunity.tools.port.js +1 -0
- package/dist/opportunity/public/index.d.ts +58 -0
- package/dist/opportunity/public/index.js +51 -0
- package/dist/participant-agents/application/agent.tools.d.ts +16 -0
- package/dist/participant-agents/application/agent.tools.js +313 -0
- package/dist/participant-agents/application/index.d.ts +21 -0
- package/dist/participant-agents/application/index.js +22 -0
- package/dist/participant-agents/domain/agent.types.d.ts +76 -0
- package/dist/participant-agents/domain/agent.types.js +22 -0
- package/dist/participant-agents/domain/index.d.ts +20 -0
- package/dist/participant-agents/domain/index.js +1 -0
- package/dist/participant-agents/index.d.ts +24 -0
- package/dist/participant-agents/index.js +24 -0
- package/dist/participant-agents/ports/agent.dispatcher.port.d.ts +25 -0
- package/dist/participant-agents/ports/agent.dispatcher.port.js +1 -0
- package/dist/participant-agents/ports/agent.repository.port.d.ts +118 -0
- package/dist/participant-agents/ports/agent.repository.port.js +10 -0
- package/dist/participant-agents/ports/agent.tools.port.d.ts +24 -0
- package/dist/participant-agents/ports/agent.tools.port.js +20 -0
- package/dist/participant-agents/ports/index.d.ts +29 -0
- package/dist/participant-agents/ports/index.js +27 -0
- package/dist/participant-agents/public/index.d.ts +39 -0
- package/dist/participant-agents/public/index.js +36 -0
- package/dist/participant-context/application/index.d.ts +73 -0
- package/dist/participant-context/application/index.js +83 -0
- package/dist/participant-context/domain/index.d.ts +67 -0
- package/dist/participant-context/domain/index.js +68 -0
- package/dist/participant-context/index.d.ts +16 -0
- package/dist/participant-context/index.js +16 -0
- package/dist/participant-context/ports/index.d.ts +37 -0
- package/dist/participant-context/ports/index.js +34 -0
- package/dist/participant-context/public/index.d.ts +48 -0
- package/dist/participant-context/public/index.js +55 -0
- package/dist/platform/index.d.ts +19 -0
- package/dist/platform/index.js +23 -0
- package/dist/premise/premise.analyzer.d.ts +0 -1
- package/dist/premise/premise.analyzer.js +0 -2
- package/dist/premise/premise.decomposer.d.ts +0 -1
- package/dist/premise/premise.decomposer.js +0 -2
- package/dist/premise/premise.graph.d.ts +1 -2
- package/dist/premise/premise.graph.js +0 -2
- package/dist/premise/premise.indexer.d.ts +0 -1
- package/dist/premise/premise.indexer.js +0 -2
- package/dist/premise/premise.state.d.ts +1 -2
- package/dist/premise/premise.state.js +0 -1
- package/dist/premise/premise.tools.d.ts +3 -3
- package/dist/premise/premise.tools.js +0 -2
- package/dist/public/index.d.ts +17 -0
- package/dist/public/index.js +17 -0
- package/dist/questioner/questioner.agent.d.ts +4 -27
- package/dist/questioner/questioner.agent.js +3 -133
- package/dist/questioner/questioner.ask.tool.d.ts +3 -12
- package/dist/questioner/questioner.ask.tool.js +3 -299
- package/dist/questioner/questioner.discovery.prompt.d.ts +3 -7
- package/dist/questioner/questioner.discovery.prompt.js +3 -180
- package/dist/questioner/questioner.env.d.ts +3 -57
- package/dist/questioner/questioner.env.js +3 -93
- package/dist/questioner/questioner.presets.d.ts +4 -19
- package/dist/questioner/questioner.presets.js +3 -465
- package/dist/questioner/questioner.qud.d.ts +3 -6
- package/dist/questioner/questioner.qud.js +3 -10
- package/dist/questioner/questioner.tools.d.ts +3 -15
- package/dist/questioner/questioner.tools.js +3 -186
- package/dist/questioner/questioner.types.d.ts +4 -218
- package/dist/questioner/questioner.types.js +5 -62
- package/dist/questions/application/index.d.ts +39 -0
- package/dist/questions/application/index.js +41 -0
- package/dist/questions/application/question.agent.d.ts +28 -0
- package/dist/questions/application/question.agent.js +139 -0
- package/dist/questions/application/question.ask.tool.d.ts +12 -0
- package/dist/questions/application/question.ask.tool.js +300 -0
- package/dist/questions/application/question.discovery.prompt.d.ts +8 -0
- package/dist/questions/application/question.discovery.prompt.js +181 -0
- package/dist/questions/application/question.env.d.ts +61 -0
- package/dist/questions/application/question.env.js +97 -0
- package/dist/questions/application/question.input.d.ts +237 -0
- package/dist/questions/application/question.input.js +61 -0
- package/dist/questions/application/question.presets.d.ts +24 -0
- package/dist/questions/application/question.presets.js +445 -0
- package/dist/questions/application/question.qud.d.ts +12 -0
- package/dist/questions/application/question.qud.js +16 -0
- package/dist/questions/application/question.tools.d.ts +15 -0
- package/dist/questions/application/question.tools.js +190 -0
- package/dist/questions/domain/index.d.ts +25 -0
- package/dist/questions/domain/index.js +25 -0
- package/dist/questions/domain/question.schema.d.ts +1537 -0
- package/dist/questions/domain/question.schema.js +422 -0
- package/dist/questions/index.d.ts +22 -0
- package/dist/questions/index.js +22 -0
- package/dist/questions/ports/index.d.ts +29 -0
- package/dist/questions/ports/index.js +27 -0
- package/dist/questions/ports/question.generator.port.d.ts +34 -0
- package/dist/questions/ports/question.generator.port.js +1 -0
- package/dist/questions/ports/question.persistence.port.d.ts +87 -0
- package/dist/questions/ports/question.persistence.port.js +1 -0
- package/dist/questions/ports/question.tools.port.d.ts +15 -0
- package/dist/questions/ports/question.tools.port.js +1 -0
- package/dist/questions/public/index.d.ts +47 -0
- package/dist/questions/public/index.js +49 -0
- package/dist/runtime/background/index.d.ts +14 -0
- package/dist/runtime/background/index.js +14 -0
- package/dist/runtime/foreground/composition/tool.factory.d.ts +16 -0
- package/dist/runtime/foreground/composition/tool.factory.js +224 -0
- package/dist/runtime/foreground/composition/tool.registry.d.ts +11 -0
- package/dist/runtime/foreground/composition/tool.registry.js +106 -0
- package/dist/runtime/foreground/index.d.ts +13 -0
- package/dist/runtime/foreground/index.js +13 -0
- package/dist/runtime/foreground/signals/intent.tools.d.ts +13 -0
- package/dist/runtime/foreground/signals/intent.tools.js +13 -0
- package/dist/shared/agent/model-signal.d.ts +0 -1
- package/dist/shared/agent/model-signal.js +0 -1
- package/dist/shared/agent/model.config.d.ts +0 -1
- package/dist/shared/agent/model.config.js +0 -1
- package/dist/shared/agent/tool.factory.d.ts +4 -15
- package/dist/shared/agent/tool.factory.js +4 -226
- package/dist/shared/agent/tool.helpers.d.ts +51 -12
- package/dist/shared/agent/tool.helpers.js +0 -1
- package/dist/shared/agent/tool.registry.d.ts +9 -9
- package/dist/shared/agent/tool.registry.js +9 -104
- package/dist/shared/agent/tool.runtime.d.ts +0 -1
- package/dist/shared/agent/tool.runtime.js +0 -1
- package/dist/shared/agent/tool.scope.d.ts +0 -1
- package/dist/shared/agent/tool.scope.js +0 -1
- package/dist/shared/agent/utility.tools.d.ts +5 -3
- package/dist/shared/agent/utility.tools.js +0 -1
- package/dist/shared/assignment/network-assignment.policy.d.ts +0 -1
- package/dist/shared/assignment/network-assignment.policy.js +0 -1
- package/dist/shared/hyde/hyde.documents.d.ts +0 -1
- package/dist/shared/hyde/hyde.documents.js +0 -1
- package/dist/shared/hyde/hyde.env.d.ts +0 -1
- package/dist/shared/hyde/hyde.env.js +0 -1
- package/dist/shared/hyde/hyde.frame.d.ts +4 -5
- package/dist/shared/hyde/hyde.frame.js +0 -1
- package/dist/shared/hyde/hyde.generator.d.ts +0 -1
- package/dist/shared/hyde/hyde.generator.js +0 -1
- package/dist/shared/hyde/hyde.graph.d.ts +0 -1
- package/dist/shared/hyde/hyde.graph.js +0 -1
- package/dist/shared/hyde/hyde.state.d.ts +0 -1
- package/dist/shared/hyde/hyde.state.js +0 -1
- package/dist/shared/hyde/hyde.strategies.d.ts +0 -1
- package/dist/shared/hyde/hyde.strategies.js +0 -1
- package/dist/shared/hyde/hyde.validator.d.ts +0 -1
- package/dist/shared/hyde/hyde.validator.js +0 -1
- package/dist/shared/hyde/lens.inferrer.d.ts +6 -7
- package/dist/shared/hyde/lens.inferrer.js +0 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +4 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.js +4 -1
- package/dist/shared/interfaces/agent.interface.d.ts +13 -173
- package/dist/shared/interfaces/agent.interface.js +12 -12
- package/dist/shared/interfaces/auth.interface.d.ts +0 -1
- package/dist/shared/interfaces/auth.interface.js +0 -1
- package/dist/shared/interfaces/cache.interface.d.ts +0 -1
- package/dist/shared/interfaces/cache.interface.js +0 -1
- package/dist/shared/interfaces/chat-message-writer.interface.d.ts +0 -1
- package/dist/shared/interfaces/chat-message-writer.interface.js +0 -1
- package/dist/shared/interfaces/chat-session.interface.d.ts +0 -1
- package/dist/shared/interfaces/chat-session.interface.js +0 -1
- package/dist/shared/interfaces/chat-summary.interface.d.ts +0 -1
- package/dist/shared/interfaces/chat-summary.interface.js +0 -1
- package/dist/shared/interfaces/connect-link.interface.d.ts +0 -1
- package/dist/shared/interfaces/connect-link.interface.js +0 -1
- package/dist/shared/interfaces/contact.interface.d.ts +7 -55
- package/dist/shared/interfaces/contact.interface.js +7 -1
- package/dist/shared/interfaces/database.interface.d.ts +0 -1
- package/dist/shared/interfaces/database.interface.js +0 -1
- package/dist/shared/interfaces/delivery-ledger.interface.d.ts +0 -1
- package/dist/shared/interfaces/delivery-ledger.interface.js +0 -1
- package/dist/shared/interfaces/discovery-run.interface.d.ts +2 -3
- package/dist/shared/interfaces/discovery-run.interface.js +0 -1
- package/dist/shared/interfaces/embedder.interface.d.ts +0 -1
- package/dist/shared/interfaces/embedder.interface.js +0 -1
- package/dist/shared/interfaces/enrichment-run.interface.d.ts +2 -3
- package/dist/shared/interfaces/enrichment-run.interface.js +0 -1
- package/dist/shared/interfaces/enrichment.interface.d.ts +0 -1
- package/dist/shared/interfaces/enrichment.interface.js +0 -1
- package/dist/shared/interfaces/integration.interface.d.ts +6 -88
- package/dist/shared/interfaces/integration.interface.js +7 -1
- package/dist/shared/interfaces/negotiation-events.interface.d.ts +0 -1
- package/dist/shared/interfaces/negotiation-events.interface.js +0 -1
- package/dist/shared/interfaces/negotiation-summary.interface.d.ts +0 -1
- package/dist/shared/interfaces/negotiation-summary.interface.js +0 -1
- package/dist/shared/interfaces/negotiator-memory.interface.d.ts +0 -1
- package/dist/shared/interfaces/negotiator-memory.interface.js +0 -1
- package/dist/shared/interfaces/question-generator.interface.d.ts +3 -28
- package/dist/shared/interfaces/question-generator.interface.js +0 -1
- package/dist/shared/interfaces/questioner.interface.d.ts +3 -77
- package/dist/shared/interfaces/questioner.interface.js +0 -1
- package/dist/shared/interfaces/queue.interface.d.ts +0 -1
- package/dist/shared/interfaces/queue.interface.js +0 -1
- package/dist/shared/interfaces/scraper.interface.d.ts +0 -1
- package/dist/shared/interfaces/scraper.interface.js +0 -1
- package/dist/shared/interfaces/tool-request-context.interface.d.ts +12 -0
- package/dist/shared/interfaces/tool-request-context.interface.js +1 -0
- package/dist/shared/network/metadata.renderer.d.ts +0 -1
- package/dist/shared/network/metadata.renderer.js +0 -1
- package/dist/shared/observability/debug-meta.sanitizer.d.ts +0 -1
- package/dist/shared/observability/debug-meta.sanitizer.js +0 -1
- package/dist/shared/observability/log.d.ts +0 -1
- package/dist/shared/observability/log.js +0 -1
- package/dist/shared/observability/performance.d.ts +0 -1
- package/dist/shared/observability/performance.js +0 -1
- package/dist/shared/observability/protocol.logger.d.ts +0 -1
- package/dist/shared/observability/protocol.logger.js +0 -1
- package/dist/shared/observability/request-context.d.ts +0 -1
- package/dist/shared/observability/request-context.js +0 -1
- package/dist/shared/observability/trace.d.ts +0 -1
- package/dist/shared/observability/trace.js +0 -1
- package/dist/shared/schemas/chat-context.schema.d.ts +0 -1
- package/dist/shared/schemas/chat-context.schema.js +0 -1
- package/dist/shared/schemas/discovery-question.schema.d.ts +17 -18
- package/dist/shared/schemas/discovery-question.schema.js +0 -1
- package/dist/shared/schemas/identity.schema.d.ts +0 -1
- package/dist/shared/schemas/identity.schema.js +0 -1
- package/dist/shared/schemas/mcp-auth.schema.d.ts +0 -1
- package/dist/shared/schemas/mcp-auth.schema.js +0 -1
- package/dist/shared/schemas/negotiation-digest.schema.d.ts +5 -6
- package/dist/shared/schemas/negotiation-digest.schema.js +0 -1
- package/dist/shared/schemas/negotiation-state.schema.d.ts +4 -5
- package/dist/shared/schemas/negotiation-state.schema.js +0 -1
- package/dist/shared/schemas/network-assignment.schema.d.ts +0 -1
- package/dist/shared/schemas/network-assignment.schema.js +0 -1
- package/dist/shared/schemas/pending-question.schema.d.ts +0 -1
- package/dist/shared/schemas/pending-question.schema.js +0 -1
- package/dist/shared/schemas/question.schema.d.ts +3 -1535
- package/dist/shared/schemas/question.schema.js +3 -420
- package/dist/shared/ui/lucide.icon-catalog.d.ts +0 -1
- package/dist/shared/ui/lucide.icon-catalog.js +0 -1
- package/dist/shared/utils/social-label.d.ts +0 -1
- package/dist/shared/utils/social-label.js +0 -1
- package/dist/shared/utils/telegram-handle.d.ts +0 -1
- package/dist/shared/utils/telegram-handle.js +0 -1
- package/dist/signals/application/index.d.ts +19 -0
- package/dist/signals/application/index.js +22 -0
- package/dist/signals/application/intent.clarifier.d.ts +51 -0
- package/dist/signals/application/intent.clarifier.js +201 -0
- package/dist/signals/application/intent.graph.d.ts +552 -0
- package/dist/signals/application/intent.graph.js +938 -0
- package/dist/signals/application/intent.indexer.d.ts +82 -0
- package/dist/signals/application/intent.indexer.js +170 -0
- package/dist/signals/application/intent.inferrer.d.ts +94 -0
- package/dist/signals/application/intent.inferrer.js +233 -0
- package/dist/signals/application/intent.reconciler.d.ts +105 -0
- package/dist/signals/application/intent.reconciler.js +186 -0
- package/dist/signals/application/intent.tools.d.ts +24 -0
- package/dist/signals/application/intent.tools.js +789 -0
- package/dist/signals/application/intent.verifier.d.ts +115 -0
- package/dist/signals/application/intent.verifier.js +262 -0
- package/dist/signals/domain/index.d.ts +9 -0
- package/dist/signals/domain/index.js +11 -0
- package/dist/signals/domain/intent.state.d.ts +230 -0
- package/dist/signals/domain/intent.state.js +190 -0
- package/dist/signals/domain/signal.specificity.d.ts +2 -0
- package/dist/signals/domain/signal.specificity.js +2 -0
- package/dist/signals/index.d.ts +13 -0
- package/dist/signals/index.js +13 -0
- package/dist/signals/ports/index.d.ts +15 -0
- package/dist/signals/ports/index.js +13 -0
- package/dist/signals/public/index.d.ts +15 -0
- package/dist/signals/public/index.js +16 -0
- package/package.json +14 -3
- package/dist/agent/agent.tools.d.ts.map +0 -1
- package/dist/agent/agent.tools.js.map +0 -1
- package/dist/agent/tests/fakes.d.ts +0 -25
- package/dist/agent/tests/fakes.d.ts.map +0 -1
- package/dist/agent/tests/fakes.js +0 -178
- package/dist/agent/tests/fakes.js.map +0 -1
- package/dist/chat/chat-streaming.types.d.ts.map +0 -1
- package/dist/chat/chat-streaming.types.js.map +0 -1
- package/dist/chat/chat.agent.d.ts.map +0 -1
- package/dist/chat/chat.agent.js.map +0 -1
- package/dist/chat/chat.graph.d.ts.map +0 -1
- package/dist/chat/chat.graph.js.map +0 -1
- package/dist/chat/chat.interrupt.classifier.d.ts.map +0 -1
- package/dist/chat/chat.interrupt.classifier.js.map +0 -1
- package/dist/chat/chat.persona.d.ts.map +0 -1
- package/dist/chat/chat.persona.js.map +0 -1
- package/dist/chat/chat.prompt.d.ts.map +0 -1
- package/dist/chat/chat.prompt.js.map +0 -1
- package/dist/chat/chat.prompt.modules.d.ts.map +0 -1
- package/dist/chat/chat.prompt.modules.js.map +0 -1
- package/dist/chat/chat.question-dedup.d.ts.map +0 -1
- package/dist/chat/chat.question-dedup.js.map +0 -1
- package/dist/chat/chat.state.d.ts.map +0 -1
- package/dist/chat/chat.state.js.map +0 -1
- package/dist/chat/chat.streamer.d.ts.map +0 -1
- package/dist/chat/chat.streamer.js.map +0 -1
- package/dist/chat/chat.suggester.d.ts.map +0 -1
- package/dist/chat/chat.suggester.js.map +0 -1
- package/dist/chat/chat.summarizer.d.ts.map +0 -1
- package/dist/chat/chat.summarizer.js.map +0 -1
- package/dist/chat/chat.title.generator.d.ts.map +0 -1
- package/dist/chat/chat.title.generator.js.map +0 -1
- package/dist/chat/chat.tools.d.ts.map +0 -1
- package/dist/chat/chat.tools.js.map +0 -1
- package/dist/chat/chat.utils.d.ts.map +0 -1
- package/dist/chat/chat.utils.js.map +0 -1
- package/dist/chat/negotiator.persona.d.ts.map +0 -1
- package/dist/chat/negotiator.persona.js.map +0 -1
- package/dist/chat/negotiator.prompt.d.ts.map +0 -1
- package/dist/chat/negotiator.prompt.js.map +0 -1
- package/dist/chat/negotiator.tools.d.ts.map +0 -1
- package/dist/chat/negotiator.tools.js.map +0 -1
- package/dist/chat/onboarding.persona.d.ts.map +0 -1
- package/dist/chat/onboarding.persona.js.map +0 -1
- package/dist/chat/onboarding.prompt.d.ts.map +0 -1
- package/dist/chat/onboarding.prompt.js.map +0 -1
- package/dist/chat/reporter.action.tools.d.ts.map +0 -1
- package/dist/chat/reporter.action.tools.js.map +0 -1
- package/dist/chat/reporter.persona.d.ts.map +0 -1
- package/dist/chat/reporter.persona.js.map +0 -1
- package/dist/chat/reporter.prompt.d.ts.map +0 -1
- package/dist/chat/reporter.prompt.js.map +0 -1
- package/dist/chat/signal.persona.d.ts.map +0 -1
- package/dist/chat/signal.persona.js.map +0 -1
- package/dist/chat/signal.prompt.d.ts.map +0 -1
- package/dist/chat/signal.prompt.js.map +0 -1
- package/dist/chat/tests/chat.graph.mocks.d.ts +0 -98
- package/dist/chat/tests/chat.graph.mocks.d.ts.map +0 -1
- package/dist/chat/tests/chat.graph.mocks.js +0 -225
- package/dist/chat/tests/chat.graph.mocks.js.map +0 -1
- package/dist/contact/contact.inviter.d.ts.map +0 -1
- package/dist/contact/contact.inviter.js.map +0 -1
- package/dist/contact/contact.tools.d.ts.map +0 -1
- package/dist/contact/contact.tools.js.map +0 -1
- package/dist/context/context.generator.d.ts.map +0 -1
- package/dist/context/context.generator.js.map +0 -1
- package/dist/enrichment/enrichment.enricher.d.ts.map +0 -1
- package/dist/enrichment/enrichment.enricher.js.map +0 -1
- package/dist/enrichment/enrichment.generator.d.ts.map +0 -1
- package/dist/enrichment/enrichment.generator.js.map +0 -1
- package/dist/enrichment/enrichment.graph.d.ts.map +0 -1
- package/dist/enrichment/enrichment.graph.js.map +0 -1
- package/dist/enrichment/enrichment.state.d.ts.map +0 -1
- package/dist/enrichment/enrichment.state.js.map +0 -1
- package/dist/enrichment/enrichment.tools.d.ts.map +0 -1
- package/dist/enrichment/enrichment.tools.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/integration/integration.tools.d.ts.map +0 -1
- package/dist/integration/integration.tools.js.map +0 -1
- package/dist/intent/intent.clarifier.d.ts.map +0 -1
- package/dist/intent/intent.clarifier.js.map +0 -1
- package/dist/intent/intent.graph.d.ts.map +0 -1
- package/dist/intent/intent.graph.js.map +0 -1
- package/dist/intent/intent.indexer.d.ts.map +0 -1
- package/dist/intent/intent.indexer.js.map +0 -1
- package/dist/intent/intent.inferrer.d.ts.map +0 -1
- package/dist/intent/intent.inferrer.js.map +0 -1
- package/dist/intent/intent.reconciler.d.ts.map +0 -1
- package/dist/intent/intent.reconciler.js.map +0 -1
- package/dist/intent/intent.specificity.d.ts.map +0 -1
- package/dist/intent/intent.specificity.js.map +0 -1
- package/dist/intent/intent.state.d.ts.map +0 -1
- package/dist/intent/intent.state.js.map +0 -1
- package/dist/intent/intent.tools.d.ts.map +0 -1
- package/dist/intent/intent.tools.js.map +0 -1
- package/dist/intent/intent.verifier.d.ts.map +0 -1
- package/dist/intent/intent.verifier.js.map +0 -1
- package/dist/maintenance/maintenance.graph.d.ts.map +0 -1
- package/dist/maintenance/maintenance.graph.js.map +0 -1
- package/dist/maintenance/maintenance.state.d.ts.map +0 -1
- package/dist/maintenance/maintenance.state.js.map +0 -1
- package/dist/mcp/elicitation.builder.d.ts.map +0 -1
- package/dist/mcp/elicitation.builder.js.map +0 -1
- package/dist/mcp/elicitation.dispatcher.d.ts.map +0 -1
- package/dist/mcp/elicitation.dispatcher.js.map +0 -1
- package/dist/mcp/mcp.server.d.ts.map +0 -1
- package/dist/mcp/mcp.server.js.map +0 -1
- package/dist/negotiation/insight.generator.d.ts.map +0 -1
- package/dist/negotiation/insight.generator.js.map +0 -1
- package/dist/negotiation/negotiation.agent.d.ts.map +0 -1
- package/dist/negotiation/negotiation.agent.js.map +0 -1
- package/dist/negotiation/negotiation.attribution.d.ts.map +0 -1
- package/dist/negotiation/negotiation.attribution.js.map +0 -1
- package/dist/negotiation/negotiation.consultation-policy.d.ts.map +0 -1
- package/dist/negotiation/negotiation.consultation-policy.js.map +0 -1
- package/dist/negotiation/negotiation.deadlock.d.ts.map +0 -1
- package/dist/negotiation/negotiation.deadlock.js.map +0 -1
- package/dist/negotiation/negotiation.graph.d.ts.map +0 -1
- package/dist/negotiation/negotiation.graph.js.map +0 -1
- package/dist/negotiation/negotiation.memory.d.ts.map +0 -1
- package/dist/negotiation/negotiation.memory.js.map +0 -1
- package/dist/negotiation/negotiation.protocol.d.ts.map +0 -1
- package/dist/negotiation/negotiation.protocol.js.map +0 -1
- package/dist/negotiation/negotiation.question-safety.d.ts.map +0 -1
- package/dist/negotiation/negotiation.question-safety.js.map +0 -1
- package/dist/negotiation/negotiation.reflect.d.ts.map +0 -1
- package/dist/negotiation/negotiation.reflect.js.map +0 -1
- package/dist/negotiation/negotiation.screen.d.ts.map +0 -1
- package/dist/negotiation/negotiation.screen.js.map +0 -1
- package/dist/negotiation/negotiation.state.d.ts.map +0 -1
- package/dist/negotiation/negotiation.state.js.map +0 -1
- package/dist/negotiation/negotiation.summarizer.d.ts.map +0 -1
- package/dist/negotiation/negotiation.summarizer.js.map +0 -1
- package/dist/negotiation/negotiation.tools.d.ts.map +0 -1
- package/dist/negotiation/negotiation.tools.js.map +0 -1
- package/dist/network/indexer/indexer.graph.d.ts.map +0 -1
- package/dist/network/indexer/indexer.graph.js.map +0 -1
- package/dist/network/indexer/indexer.state.d.ts.map +0 -1
- package/dist/network/indexer/indexer.state.js.map +0 -1
- package/dist/network/membership/membership.graph.d.ts.map +0 -1
- package/dist/network/membership/membership.graph.js.map +0 -1
- package/dist/network/membership/membership.state.d.ts.map +0 -1
- package/dist/network/membership/membership.state.js.map +0 -1
- package/dist/network/network.graph.d.ts.map +0 -1
- package/dist/network/network.graph.js.map +0 -1
- package/dist/network/network.recommender.d.ts.map +0 -1
- package/dist/network/network.recommender.js.map +0 -1
- package/dist/network/network.state.d.ts.map +0 -1
- package/dist/network/network.state.js.map +0 -1
- package/dist/network/network.tools.d.ts.map +0 -1
- package/dist/network/network.tools.js.map +0 -1
- package/dist/opportunity/delivery-card.cache.d.ts.map +0 -1
- package/dist/opportunity/delivery-card.cache.js.map +0 -1
- package/dist/opportunity/discovery-question.helper.d.ts.map +0 -1
- package/dist/opportunity/discovery-question.helper.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.assigner.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.assigner.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.env.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.env.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.miner.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.miner.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.push.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.push.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.question.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.question.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.scorer.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.scorer.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.shadow.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.shadow.js.map +0 -1
- package/dist/opportunity/discriminator/discriminator.types.d.ts.map +0 -1
- package/dist/opportunity/discriminator/discriminator.types.js.map +0 -1
- package/dist/opportunity/feed/feed.categorizer.d.ts.map +0 -1
- package/dist/opportunity/feed/feed.categorizer.js.map +0 -1
- package/dist/opportunity/feed/feed.graph.d.ts.map +0 -1
- package/dist/opportunity/feed/feed.graph.js.map +0 -1
- package/dist/opportunity/feed/feed.health.d.ts.map +0 -1
- package/dist/opportunity/feed/feed.health.js.map +0 -1
- package/dist/opportunity/feed/feed.state.d.ts.map +0 -1
- package/dist/opportunity/feed/feed.state.js.map +0 -1
- package/dist/opportunity/negotiation-context.loader.d.ts.map +0 -1
- package/dist/opportunity/negotiation-context.loader.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.env.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.extractor.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.miner.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.shadow.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.types.js.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.d.ts.map +0 -1
- package/dist/opportunity/negotiation-evidence/negotiation-evidence.verifier.js.map +0 -1
- package/dist/opportunity/negotiation-summary.builder.d.ts.map +0 -1
- package/dist/opportunity/negotiation-summary.builder.js.map +0 -1
- package/dist/opportunity/opportunity.actor.d.ts.map +0 -1
- package/dist/opportunity/opportunity.actor.js.map +0 -1
- package/dist/opportunity/opportunity.claim-safety.d.ts.map +0 -1
- package/dist/opportunity/opportunity.claim-safety.js.map +0 -1
- package/dist/opportunity/opportunity.discover.d.ts.map +0 -1
- package/dist/opportunity/opportunity.discover.js.map +0 -1
- package/dist/opportunity/opportunity.enricher.d.ts.map +0 -1
- package/dist/opportunity/opportunity.enricher.js.map +0 -1
- package/dist/opportunity/opportunity.evaluator.d.ts.map +0 -1
- package/dist/opportunity/opportunity.evaluator.js.map +0 -1
- package/dist/opportunity/opportunity.evidence.d.ts.map +0 -1
- package/dist/opportunity/opportunity.evidence.js.map +0 -1
- package/dist/opportunity/opportunity.graph.d.ts.map +0 -1
- package/dist/opportunity/opportunity.graph.js.map +0 -1
- package/dist/opportunity/opportunity.introducer.d.ts.map +0 -1
- package/dist/opportunity/opportunity.introducer.js.map +0 -1
- package/dist/opportunity/opportunity.labels.d.ts.map +0 -1
- package/dist/opportunity/opportunity.labels.js.map +0 -1
- package/dist/opportunity/opportunity.pending-questions.d.ts.map +0 -1
- package/dist/opportunity/opportunity.pending-questions.js.map +0 -1
- package/dist/opportunity/opportunity.persist.d.ts.map +0 -1
- package/dist/opportunity/opportunity.persist.js.map +0 -1
- package/dist/opportunity/opportunity.presentation-cache.d.ts.map +0 -1
- package/dist/opportunity/opportunity.presentation-cache.js.map +0 -1
- package/dist/opportunity/opportunity.presentation.d.ts.map +0 -1
- package/dist/opportunity/opportunity.presentation.js.map +0 -1
- package/dist/opportunity/opportunity.presenter.d.ts.map +0 -1
- package/dist/opportunity/opportunity.presenter.js.map +0 -1
- package/dist/opportunity/opportunity.safe-presentation.d.ts.map +0 -1
- package/dist/opportunity/opportunity.safe-presentation.js.map +0 -1
- package/dist/opportunity/opportunity.state.d.ts.map +0 -1
- package/dist/opportunity/opportunity.state.js.map +0 -1
- package/dist/opportunity/opportunity.tools.d.ts.map +0 -1
- package/dist/opportunity/opportunity.tools.js.map +0 -1
- package/dist/opportunity/opportunity.utils.d.ts.map +0 -1
- package/dist/opportunity/opportunity.utils.js.map +0 -1
- package/dist/opportunity/outcome/outcome.env.d.ts.map +0 -1
- package/dist/opportunity/outcome/outcome.env.js.map +0 -1
- package/dist/opportunity/outcome/outcome.hypotheses.d.ts.map +0 -1
- package/dist/opportunity/outcome/outcome.hypotheses.js.map +0 -1
- package/dist/opportunity/outcome/outcome.shadow.d.ts.map +0 -1
- package/dist/opportunity/outcome/outcome.shadow.js.map +0 -1
- package/dist/opportunity/outcome/outcome.types.d.ts.map +0 -1
- package/dist/opportunity/outcome/outcome.types.js.map +0 -1
- package/dist/premise/premise.analyzer.d.ts.map +0 -1
- package/dist/premise/premise.analyzer.js.map +0 -1
- package/dist/premise/premise.decomposer.d.ts.map +0 -1
- package/dist/premise/premise.decomposer.js.map +0 -1
- package/dist/premise/premise.graph.d.ts.map +0 -1
- package/dist/premise/premise.graph.js.map +0 -1
- package/dist/premise/premise.indexer.d.ts.map +0 -1
- package/dist/premise/premise.indexer.js.map +0 -1
- package/dist/premise/premise.state.d.ts.map +0 -1
- package/dist/premise/premise.state.js.map +0 -1
- package/dist/premise/premise.tools.d.ts.map +0 -1
- package/dist/premise/premise.tools.js.map +0 -1
- package/dist/questioner/questioner.agent.d.ts.map +0 -1
- package/dist/questioner/questioner.agent.js.map +0 -1
- package/dist/questioner/questioner.ask.tool.d.ts.map +0 -1
- package/dist/questioner/questioner.ask.tool.js.map +0 -1
- package/dist/questioner/questioner.discovery.prompt.d.ts.map +0 -1
- package/dist/questioner/questioner.discovery.prompt.js.map +0 -1
- package/dist/questioner/questioner.env.d.ts.map +0 -1
- package/dist/questioner/questioner.env.js.map +0 -1
- package/dist/questioner/questioner.presets.d.ts.map +0 -1
- package/dist/questioner/questioner.presets.js.map +0 -1
- package/dist/questioner/questioner.qud.d.ts.map +0 -1
- package/dist/questioner/questioner.qud.js.map +0 -1
- package/dist/questioner/questioner.tools.d.ts.map +0 -1
- package/dist/questioner/questioner.tools.js.map +0 -1
- package/dist/questioner/questioner.types.d.ts.map +0 -1
- package/dist/questioner/questioner.types.js.map +0 -1
- package/dist/shared/agent/model-signal.d.ts.map +0 -1
- package/dist/shared/agent/model-signal.js.map +0 -1
- package/dist/shared/agent/model.config.d.ts.map +0 -1
- package/dist/shared/agent/model.config.js.map +0 -1
- package/dist/shared/agent/tests/llm-assert.d.ts +0 -11
- package/dist/shared/agent/tests/llm-assert.d.ts.map +0 -1
- package/dist/shared/agent/tests/llm-assert.js +0 -43
- package/dist/shared/agent/tests/llm-assert.js.map +0 -1
- package/dist/shared/agent/tool.factory.d.ts.map +0 -1
- package/dist/shared/agent/tool.factory.js.map +0 -1
- package/dist/shared/agent/tool.helpers.d.ts.map +0 -1
- package/dist/shared/agent/tool.helpers.js.map +0 -1
- package/dist/shared/agent/tool.registry.d.ts.map +0 -1
- package/dist/shared/agent/tool.registry.js.map +0 -1
- package/dist/shared/agent/tool.runtime.d.ts.map +0 -1
- package/dist/shared/agent/tool.runtime.js.map +0 -1
- package/dist/shared/agent/tool.scope.d.ts.map +0 -1
- package/dist/shared/agent/tool.scope.js.map +0 -1
- package/dist/shared/agent/utility.tools.d.ts.map +0 -1
- package/dist/shared/agent/utility.tools.js.map +0 -1
- package/dist/shared/assignment/network-assignment.policy.d.ts.map +0 -1
- package/dist/shared/assignment/network-assignment.policy.js.map +0 -1
- package/dist/shared/hyde/hyde.documents.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.documents.js.map +0 -1
- package/dist/shared/hyde/hyde.env.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.env.js.map +0 -1
- package/dist/shared/hyde/hyde.frame.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.frame.js.map +0 -1
- package/dist/shared/hyde/hyde.generator.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.generator.js.map +0 -1
- package/dist/shared/hyde/hyde.graph.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.graph.js.map +0 -1
- package/dist/shared/hyde/hyde.state.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.state.js.map +0 -1
- package/dist/shared/hyde/hyde.strategies.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.strategies.js.map +0 -1
- package/dist/shared/hyde/hyde.validator.d.ts.map +0 -1
- package/dist/shared/hyde/hyde.validator.js.map +0 -1
- package/dist/shared/hyde/lens.inferrer.d.ts.map +0 -1
- package/dist/shared/hyde/lens.inferrer.js.map +0 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.js.map +0 -1
- package/dist/shared/interfaces/agent.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/agent.interface.js.map +0 -1
- package/dist/shared/interfaces/auth.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/auth.interface.js.map +0 -1
- package/dist/shared/interfaces/cache.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/cache.interface.js.map +0 -1
- package/dist/shared/interfaces/chat-message-writer.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/chat-message-writer.interface.js.map +0 -1
- package/dist/shared/interfaces/chat-session.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/chat-session.interface.js.map +0 -1
- package/dist/shared/interfaces/chat-summary.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/chat-summary.interface.js.map +0 -1
- package/dist/shared/interfaces/connect-link.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/connect-link.interface.js.map +0 -1
- package/dist/shared/interfaces/contact.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/contact.interface.js.map +0 -1
- package/dist/shared/interfaces/database.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/database.interface.js.map +0 -1
- package/dist/shared/interfaces/delivery-ledger.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/delivery-ledger.interface.js.map +0 -1
- package/dist/shared/interfaces/discovery-run.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/discovery-run.interface.js.map +0 -1
- package/dist/shared/interfaces/embedder.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/embedder.interface.js.map +0 -1
- package/dist/shared/interfaces/enrichment-run.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/enrichment-run.interface.js.map +0 -1
- package/dist/shared/interfaces/enrichment.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/enrichment.interface.js.map +0 -1
- package/dist/shared/interfaces/integration.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/integration.interface.js.map +0 -1
- package/dist/shared/interfaces/negotiation-events.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/negotiation-events.interface.js.map +0 -1
- package/dist/shared/interfaces/negotiation-summary.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/negotiation-summary.interface.js.map +0 -1
- package/dist/shared/interfaces/negotiator-memory.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/negotiator-memory.interface.js.map +0 -1
- package/dist/shared/interfaces/question-generator.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/question-generator.interface.js.map +0 -1
- package/dist/shared/interfaces/questioner.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/questioner.interface.js.map +0 -1
- package/dist/shared/interfaces/queue.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/queue.interface.js.map +0 -1
- package/dist/shared/interfaces/scraper.interface.d.ts.map +0 -1
- package/dist/shared/interfaces/scraper.interface.js.map +0 -1
- package/dist/shared/network/metadata.renderer.d.ts.map +0 -1
- package/dist/shared/network/metadata.renderer.js.map +0 -1
- package/dist/shared/observability/debug-meta.sanitizer.d.ts.map +0 -1
- package/dist/shared/observability/debug-meta.sanitizer.js.map +0 -1
- package/dist/shared/observability/log.d.ts.map +0 -1
- package/dist/shared/observability/log.js.map +0 -1
- package/dist/shared/observability/performance.d.ts.map +0 -1
- package/dist/shared/observability/performance.js.map +0 -1
- package/dist/shared/observability/protocol.logger.d.ts.map +0 -1
- package/dist/shared/observability/protocol.logger.js.map +0 -1
- package/dist/shared/observability/request-context.d.ts.map +0 -1
- package/dist/shared/observability/request-context.js.map +0 -1
- package/dist/shared/observability/trace.d.ts.map +0 -1
- package/dist/shared/observability/trace.js.map +0 -1
- package/dist/shared/schemas/chat-context.schema.d.ts.map +0 -1
- package/dist/shared/schemas/chat-context.schema.js.map +0 -1
- package/dist/shared/schemas/discovery-question.schema.d.ts.map +0 -1
- package/dist/shared/schemas/discovery-question.schema.js.map +0 -1
- package/dist/shared/schemas/identity.schema.d.ts.map +0 -1
- package/dist/shared/schemas/identity.schema.js.map +0 -1
- package/dist/shared/schemas/mcp-auth.schema.d.ts.map +0 -1
- package/dist/shared/schemas/mcp-auth.schema.js.map +0 -1
- package/dist/shared/schemas/negotiation-digest.schema.d.ts.map +0 -1
- package/dist/shared/schemas/negotiation-digest.schema.js.map +0 -1
- package/dist/shared/schemas/negotiation-state.schema.d.ts.map +0 -1
- package/dist/shared/schemas/negotiation-state.schema.js.map +0 -1
- package/dist/shared/schemas/network-assignment.schema.d.ts.map +0 -1
- package/dist/shared/schemas/network-assignment.schema.js.map +0 -1
- package/dist/shared/schemas/pending-question.schema.d.ts.map +0 -1
- package/dist/shared/schemas/pending-question.schema.js.map +0 -1
- package/dist/shared/schemas/question.schema.d.ts.map +0 -1
- package/dist/shared/schemas/question.schema.js.map +0 -1
- package/dist/shared/ui/lucide.icon-catalog.d.ts.map +0 -1
- package/dist/shared/ui/lucide.icon-catalog.js.map +0 -1
- package/dist/shared/utils/social-label.d.ts.map +0 -1
- package/dist/shared/utils/social-label.js.map +0 -1
- package/dist/shared/utils/telegram-handle.d.ts.map +0 -1
- package/dist/shared/utils/telegram-handle.js.map +0 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createStructuredModel } from "../../shared/agent/model.config.js";
|
|
3
|
+
export { NEGOTIATOR_MEMORY_KINDS } from "../domain/negotiation.memory.js";
|
|
4
|
+
export type { DistilledMemoryKind } from "../domain/negotiation.memory.js";
|
|
5
|
+
/** Hard ceiling on entries distilled per reflection pass (per side). */
|
|
6
|
+
export declare const MAX_DISTILLED_MEMORIES = 3;
|
|
7
|
+
/**
|
|
8
|
+
* One distilled memory entry as produced by the reflection LLM. The caller
|
|
9
|
+
* owns persistence: it resolves `aboutCounterparty` to a `subjectUserId`,
|
|
10
|
+
* computes the embedding, and attaches provenance `sourceRefs`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DistilledMemorySchema: z.ZodObject<{
|
|
13
|
+
kind: z.ZodEnum<["playbook", "disclosure_rule", "counterparty_dossier", "threshold"]>;
|
|
14
|
+
/** Self-contained operational statement, useful without the transcript. */
|
|
15
|
+
content: z.ZodString;
|
|
16
|
+
/** Evidence strength, 0..1. Explicit client statements score high. */
|
|
17
|
+
confidence: z.ZodNumber;
|
|
18
|
+
/**
|
|
19
|
+
* True when the entry is about the counterparty (kind should be
|
|
20
|
+
* `counterparty_dossier`); false for client-side rules and playbooks.
|
|
21
|
+
*/
|
|
22
|
+
aboutCounterparty: z.ZodBoolean;
|
|
23
|
+
/** Turn indexes (0-based, into the provided transcript) evidencing this entry. */
|
|
24
|
+
turnIndexes: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
27
|
+
confidence: number;
|
|
28
|
+
content: string;
|
|
29
|
+
aboutCounterparty: boolean;
|
|
30
|
+
turnIndexes: number[];
|
|
31
|
+
}, {
|
|
32
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
33
|
+
confidence: number;
|
|
34
|
+
content: string;
|
|
35
|
+
aboutCounterparty: boolean;
|
|
36
|
+
turnIndexes?: number[] | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
export type DistilledMemory = z.infer<typeof DistilledMemorySchema>;
|
|
39
|
+
export declare const ReflectionResultSchema: z.ZodObject<{
|
|
40
|
+
memories: z.ZodArray<z.ZodObject<{
|
|
41
|
+
kind: z.ZodEnum<["playbook", "disclosure_rule", "counterparty_dossier", "threshold"]>;
|
|
42
|
+
/** Self-contained operational statement, useful without the transcript. */
|
|
43
|
+
content: z.ZodString;
|
|
44
|
+
/** Evidence strength, 0..1. Explicit client statements score high. */
|
|
45
|
+
confidence: z.ZodNumber;
|
|
46
|
+
/**
|
|
47
|
+
* True when the entry is about the counterparty (kind should be
|
|
48
|
+
* `counterparty_dossier`); false for client-side rules and playbooks.
|
|
49
|
+
*/
|
|
50
|
+
aboutCounterparty: z.ZodBoolean;
|
|
51
|
+
/** Turn indexes (0-based, into the provided transcript) evidencing this entry. */
|
|
52
|
+
turnIndexes: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
55
|
+
confidence: number;
|
|
56
|
+
content: string;
|
|
57
|
+
aboutCounterparty: boolean;
|
|
58
|
+
turnIndexes: number[];
|
|
59
|
+
}, {
|
|
60
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
61
|
+
confidence: number;
|
|
62
|
+
content: string;
|
|
63
|
+
aboutCounterparty: boolean;
|
|
64
|
+
turnIndexes?: number[] | undefined;
|
|
65
|
+
}>, "many">;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
memories: {
|
|
68
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
69
|
+
confidence: number;
|
|
70
|
+
content: string;
|
|
71
|
+
aboutCounterparty: boolean;
|
|
72
|
+
turnIndexes: number[];
|
|
73
|
+
}[];
|
|
74
|
+
}, {
|
|
75
|
+
memories: {
|
|
76
|
+
kind: "threshold" | "playbook" | "disclosure_rule" | "counterparty_dossier";
|
|
77
|
+
confidence: number;
|
|
78
|
+
content: string;
|
|
79
|
+
aboutCounterparty: boolean;
|
|
80
|
+
turnIndexes?: number[] | undefined;
|
|
81
|
+
}[];
|
|
82
|
+
}>;
|
|
83
|
+
export type ReflectionResult = z.infer<typeof ReflectionResultSchema>;
|
|
84
|
+
/** A transcript row projected into the reflecting client's perspective. */
|
|
85
|
+
export interface ReflectionTranscriptEntry {
|
|
86
|
+
index: number;
|
|
87
|
+
speaker: "client" | "counterparty";
|
|
88
|
+
action: string;
|
|
89
|
+
message?: string;
|
|
90
|
+
reasoning?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface NegotiationReflectionInput {
|
|
93
|
+
/** The user whose negotiator is reflecting (memories land on their agent). */
|
|
94
|
+
clientUser: {
|
|
95
|
+
id: string;
|
|
96
|
+
name?: string;
|
|
97
|
+
bio?: string;
|
|
98
|
+
};
|
|
99
|
+
counterpartyUser: {
|
|
100
|
+
id: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
bio?: string;
|
|
103
|
+
};
|
|
104
|
+
/** The client's seat in this negotiation. */
|
|
105
|
+
seat: "initiator" | "counterparty";
|
|
106
|
+
outcome: {
|
|
107
|
+
hasOpportunity: boolean;
|
|
108
|
+
reasoning: string;
|
|
109
|
+
turnCount: number;
|
|
110
|
+
};
|
|
111
|
+
transcript: ReflectionTranscriptEntry[];
|
|
112
|
+
/** Network prompt for context (optional). */
|
|
113
|
+
indexContext?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ChatReflectionInput {
|
|
116
|
+
clientUser: {
|
|
117
|
+
id: string;
|
|
118
|
+
name?: string;
|
|
119
|
+
};
|
|
120
|
+
/** The negotiator DM messages, oldest first. */
|
|
121
|
+
messages: Array<{
|
|
122
|
+
role: "user" | "assistant";
|
|
123
|
+
content: string;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Payload the finalize node hands to the injected {@link ReflectEnqueueFn}.
|
|
128
|
+
* Carries user display context so the reflect worker never re-loads profiles;
|
|
129
|
+
* turn history is loaded from the conversation by the worker (payloads stay
|
|
130
|
+
* small in Redis).
|
|
131
|
+
*/
|
|
132
|
+
export interface NegotiationReflectJobData {
|
|
133
|
+
negotiationId: string;
|
|
134
|
+
conversationId: string;
|
|
135
|
+
opportunityId?: string;
|
|
136
|
+
sourceUser: {
|
|
137
|
+
id: string;
|
|
138
|
+
name?: string;
|
|
139
|
+
bio?: string;
|
|
140
|
+
};
|
|
141
|
+
candidateUser: {
|
|
142
|
+
id: string;
|
|
143
|
+
name?: string;
|
|
144
|
+
bio?: string;
|
|
145
|
+
};
|
|
146
|
+
initiatorUserId: string;
|
|
147
|
+
outcome: {
|
|
148
|
+
hasOpportunity: boolean;
|
|
149
|
+
reasoning: string;
|
|
150
|
+
turnCount: number;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Injected enqueue callback for post-negotiation reflection (P5.2). The
|
|
155
|
+
* protocol package has no BullMQ access — services/api wires this at its
|
|
156
|
+
* composition roots, exactly like `QuestionerEnqueueFn`. Called fire-and-
|
|
157
|
+
* forget from the finalize node: a reflection failure must never affect the
|
|
158
|
+
* negotiation outcome.
|
|
159
|
+
*/
|
|
160
|
+
export type ReflectEnqueueFn = (job: NegotiationReflectJobData) => Promise<void>;
|
|
161
|
+
export interface NegotiationReflectorConfig {
|
|
162
|
+
/** Hard ceiling on the reflection LLM round-trip, in ms (default 20000). */
|
|
163
|
+
timeoutMs?: number;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The memory distiller (P5.2). One structured LLM call per reflection pass,
|
|
167
|
+
* producing ≤ {@link MAX_DISTILLED_MEMORIES} private memory entries for one
|
|
168
|
+
* client's negotiator. Throws on LLM/validation failure — callers (the reflect
|
|
169
|
+
* queue worker) own the swallow-and-log policy, since reflection must never
|
|
170
|
+
* affect a negotiation outcome.
|
|
171
|
+
*/
|
|
172
|
+
export declare class NegotiationReflector {
|
|
173
|
+
private readonly timeoutMs;
|
|
174
|
+
constructor(config?: NegotiationReflectorConfig);
|
|
175
|
+
/**
|
|
176
|
+
* Distill memories from a finished negotiation, from one side's perspective.
|
|
177
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
178
|
+
*/
|
|
179
|
+
reflectNegotiation(input: NegotiationReflectionInput): Promise<DistilledMemory[]>;
|
|
180
|
+
/**
|
|
181
|
+
* Distill stated preferences/corrections from a client ↔ negotiator chat.
|
|
182
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
183
|
+
*/
|
|
184
|
+
reflectChat(input: ChatReflectionInput): Promise<DistilledMemory[]>;
|
|
185
|
+
private distill;
|
|
186
|
+
/**
|
|
187
|
+
* Raw structured-model round trip. Split out as a seam so tests can drive
|
|
188
|
+
* the schema-validation path without a live provider.
|
|
189
|
+
*/
|
|
190
|
+
protected callModel(model: ReturnType<typeof createStructuredModel>, chatMessages: Array<{
|
|
191
|
+
role: string;
|
|
192
|
+
content: string;
|
|
193
|
+
}>): Promise<unknown>;
|
|
194
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createStructuredModel } from "../../shared/agent/model.config.js";
|
|
3
|
+
import { invokeWithAbortSignal } from "../../shared/agent/model-signal.js";
|
|
4
|
+
import { protocolLogger } from "../../shared/observability/protocol.logger.js";
|
|
5
|
+
// Memory vocabulary lives in the domain layer; re-export for backward compat.
|
|
6
|
+
export { NEGOTIATOR_MEMORY_KINDS } from "../domain/negotiation.memory.js";
|
|
7
|
+
import { NEGOTIATOR_MEMORY_KINDS } from "../domain/negotiation.memory.js";
|
|
8
|
+
const reflectLog = protocolLogger("NegotiationReflector");
|
|
9
|
+
/** Hard ceiling on entries distilled per reflection pass (per side). */
|
|
10
|
+
export const MAX_DISTILLED_MEMORIES = 3;
|
|
11
|
+
/**
|
|
12
|
+
* One distilled memory entry as produced by the reflection LLM. The caller
|
|
13
|
+
* owns persistence: it resolves `aboutCounterparty` to a `subjectUserId`,
|
|
14
|
+
* computes the embedding, and attaches provenance `sourceRefs`.
|
|
15
|
+
*/
|
|
16
|
+
export const DistilledMemorySchema = z.object({
|
|
17
|
+
kind: z.enum(NEGOTIATOR_MEMORY_KINDS),
|
|
18
|
+
/** Self-contained operational statement, useful without the transcript. */
|
|
19
|
+
content: z.string().min(1),
|
|
20
|
+
/** Evidence strength, 0..1. Explicit client statements score high. */
|
|
21
|
+
confidence: z.number().min(0).max(1),
|
|
22
|
+
/**
|
|
23
|
+
* True when the entry is about the counterparty (kind should be
|
|
24
|
+
* `counterparty_dossier`); false for client-side rules and playbooks.
|
|
25
|
+
*/
|
|
26
|
+
aboutCounterparty: z.boolean(),
|
|
27
|
+
/** Turn indexes (0-based, into the provided transcript) evidencing this entry. */
|
|
28
|
+
turnIndexes: z.array(z.number().int().min(0)).default([]),
|
|
29
|
+
});
|
|
30
|
+
export const ReflectionResultSchema = z.object({
|
|
31
|
+
memories: z.array(DistilledMemorySchema).max(MAX_DISTILLED_MEMORIES),
|
|
32
|
+
});
|
|
33
|
+
const NEGOTIATION_SYSTEM_PROMPT = `You are the private post-negotiation reflection process for {clientName}'s negotiator agent. The negotiation is over; your job is to distill AT MOST ${MAX_DISTILLED_MEMORIES} durable operational memory entries that will make {clientName}'s negotiator better in FUTURE negotiations. These memories are private to {clientName}'s agent — the counterparty never sees them.
|
|
34
|
+
|
|
35
|
+
Memory kinds:
|
|
36
|
+
- "playbook": a tactic or pattern that worked or failed (e.g. "Opening with the specific shared-interest angle got engagement; generic intros stalled").
|
|
37
|
+
- "disclosure_rule": what {clientName} is or is not willing to share/commit (only when the transcript actually evidences it).
|
|
38
|
+
- "counterparty_dossier": a durable fact about the counterparty useful in future dealings with THEM specifically (set aboutCounterparty=true).
|
|
39
|
+
- "threshold": a concrete boundary observed (e.g. minimum scope, timing constraints, deal-breakers).
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
- Record ONLY what future negotiations need. No summaries, no play-by-play, no identity facts about {clientName} (their profile already covers those).
|
|
43
|
+
- Every entry MUST cite the transcript turn indexes that evidence it in turnIndexes.
|
|
44
|
+
- Each content string must be self-contained and actionable without the transcript.
|
|
45
|
+
- Set confidence by evidence strength: explicit statements ≈ 0.8-0.9, inferred patterns ≈ 0.4-0.6.
|
|
46
|
+
- aboutCounterparty=true ONLY for counterparty_dossier entries.
|
|
47
|
+
- Return an empty memories array when nothing durable was learned — most short or failed negotiations teach nothing. Do not force entries.`;
|
|
48
|
+
const CHAT_SYSTEM_PROMPT = `You are the private reflection process for {clientName}'s negotiator agent, reviewing a direct chat between {clientName} (the client) and their negotiator. Distill AT MOST ${MAX_DISTILLED_MEMORIES} durable operational memory entries capturing the client's STATED preferences, corrections, and instructions.
|
|
49
|
+
|
|
50
|
+
Memory kinds:
|
|
51
|
+
- "playbook": how the client wants negotiations approached (style, priorities).
|
|
52
|
+
- "disclosure_rule": what the client said they will or won't share/commit.
|
|
53
|
+
- "threshold": concrete boundaries the client stated (rates, scope, timing, deal-breakers).
|
|
54
|
+
|
|
55
|
+
Rules:
|
|
56
|
+
- Only distill what the CLIENT stated or clearly confirmed — never invent preferences from the negotiator's own suggestions.
|
|
57
|
+
- Do NOT produce counterparty_dossier entries; this is a client-side conversation. Always set aboutCounterparty=false.
|
|
58
|
+
- Each content string must be self-contained and actionable.
|
|
59
|
+
- turnIndexes cite 0-based indexes into the provided message list.
|
|
60
|
+
- Set confidence by how explicit the client was (direct instruction ≈ 0.9, implied preference ≈ 0.5).
|
|
61
|
+
- Return an empty memories array when the chat contains no durable guidance — casual Q&A usually doesn't.`;
|
|
62
|
+
const DEFAULT_REFLECT_TIMEOUT_MS = 20000;
|
|
63
|
+
/**
|
|
64
|
+
* The memory distiller (P5.2). One structured LLM call per reflection pass,
|
|
65
|
+
* producing ≤ {@link MAX_DISTILLED_MEMORIES} private memory entries for one
|
|
66
|
+
* client's negotiator. Throws on LLM/validation failure — callers (the reflect
|
|
67
|
+
* queue worker) own the swallow-and-log policy, since reflection must never
|
|
68
|
+
* affect a negotiation outcome.
|
|
69
|
+
*/
|
|
70
|
+
export class NegotiationReflector {
|
|
71
|
+
constructor(config) {
|
|
72
|
+
this.timeoutMs = config?.timeoutMs && Number.isFinite(config.timeoutMs) && config.timeoutMs > 0
|
|
73
|
+
? config.timeoutMs
|
|
74
|
+
: DEFAULT_REFLECT_TIMEOUT_MS;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Distill memories from a finished negotiation, from one side's perspective.
|
|
78
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
79
|
+
*/
|
|
80
|
+
async reflectNegotiation(input) {
|
|
81
|
+
const clientName = input.clientUser.name ?? "the client";
|
|
82
|
+
const counterpartyName = input.counterpartyUser.name ?? "the counterparty";
|
|
83
|
+
const systemPrompt = NEGOTIATION_SYSTEM_PROMPT.replace(/{clientName}/g, clientName);
|
|
84
|
+
const transcriptText = input.transcript.length > 0
|
|
85
|
+
? input.transcript.map((t) => {
|
|
86
|
+
const who = t.speaker === "client" ? `${clientName}'s negotiator` : `${counterpartyName}'s negotiator`;
|
|
87
|
+
const parts = [`[${t.index}] ${who} → ${t.action}`];
|
|
88
|
+
if (t.message)
|
|
89
|
+
parts.push(`message: ${t.message}`);
|
|
90
|
+
if (t.reasoning)
|
|
91
|
+
parts.push(`reasoning: ${t.reasoning}`);
|
|
92
|
+
return parts.join("\n ");
|
|
93
|
+
}).join("\n")
|
|
94
|
+
: "(no turns)";
|
|
95
|
+
const userMessage = `CLIENT: ${clientName}${input.clientUser.bio ? ` — ${input.clientUser.bio}` : ""}
|
|
96
|
+
SEAT: ${input.seat === "initiator" ? "initiator (client's negotiator reached out)" : "counterparty (client's negotiator was reached)"}
|
|
97
|
+
COUNTERPARTY: ${counterpartyName}${input.counterpartyUser.bio ? ` — ${input.counterpartyUser.bio}` : ""}
|
|
98
|
+
${input.indexContext ? `NETWORK CONTEXT: ${input.indexContext}\n` : ""}
|
|
99
|
+
OUTCOME: ${input.outcome.hasOpportunity ? "accepted" : "not accepted"} after ${input.outcome.turnCount} turn(s) — ${input.outcome.reasoning}
|
|
100
|
+
|
|
101
|
+
TRANSCRIPT:
|
|
102
|
+
${transcriptText}
|
|
103
|
+
|
|
104
|
+
Distill the durable memories (or return an empty array).`;
|
|
105
|
+
return this.distill(systemPrompt, userMessage);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Distill stated preferences/corrections from a client ↔ negotiator chat.
|
|
109
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
110
|
+
*/
|
|
111
|
+
async reflectChat(input) {
|
|
112
|
+
const clientName = input.clientUser.name ?? "the client";
|
|
113
|
+
const systemPrompt = CHAT_SYSTEM_PROMPT.replace(/{clientName}/g, clientName);
|
|
114
|
+
const chatText = input.messages
|
|
115
|
+
.map((m, i) => `[${i}] ${m.role === "user" ? clientName : "negotiator"}: ${m.content}`)
|
|
116
|
+
.join("\n");
|
|
117
|
+
const userMessage = `CHAT between ${clientName} and their negotiator (oldest first):
|
|
118
|
+
${chatText}
|
|
119
|
+
|
|
120
|
+
Distill the client's durable guidance (or return an empty array).`;
|
|
121
|
+
return this.distill(systemPrompt, userMessage);
|
|
122
|
+
}
|
|
123
|
+
async distill(systemPrompt, userMessage) {
|
|
124
|
+
const model = createStructuredModel("negotiationReflector", ReflectionResultSchema, { name: "negotiation_reflector" });
|
|
125
|
+
const result = await this.callModel(model, [
|
|
126
|
+
{ role: "system", content: systemPrompt },
|
|
127
|
+
{ role: "user", content: userMessage },
|
|
128
|
+
]);
|
|
129
|
+
const parsed = ReflectionResultSchema.safeParse(result);
|
|
130
|
+
if (!parsed.success) {
|
|
131
|
+
reflectLog.warn("Reflection output failed schema validation", {
|
|
132
|
+
issues: parsed.error.issues.map((i) => i.message).slice(0, 3),
|
|
133
|
+
});
|
|
134
|
+
throw new Error(`Reflection failed validation: ${parsed.error.issues[0]?.message ?? "unknown"}`);
|
|
135
|
+
}
|
|
136
|
+
return parsed.data.memories.slice(0, MAX_DISTILLED_MEMORIES);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Raw structured-model round trip. Split out as a seam so tests can drive
|
|
140
|
+
* the schema-validation path without a live provider.
|
|
141
|
+
*/
|
|
142
|
+
async callModel(model, chatMessages) {
|
|
143
|
+
return invokeWithAbortSignal(model, chatMessages, AbortSignal.timeout(this.timeoutMs));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createStructuredModel } from "../../shared/agent/model.config.js";
|
|
2
|
+
import type { UserNegotiationContext, SeedAssessment } from "../../shared/schemas/negotiation-state.schema.js";
|
|
3
|
+
import { type NegotiatorMemoryEntry } from "../domain/negotiation.memory.js";
|
|
4
|
+
import type { NegotiationTurn } from "../domain/negotiation.state.js";
|
|
5
|
+
import { type AttributedPriorDialogue } from "../negotiation.attribution.js";
|
|
6
|
+
export { NEGOTIATION_SCREEN_MODES, configuredScreenMode, ScreenDecisionSchema, blocksNegotiationBeforeFirstTurn, } from "../domain/negotiation.screen.contracts.js";
|
|
7
|
+
export type { NegotiationScreenMode, ScreenDecision, ScreenDecisionRecord, } from "../domain/negotiation.screen.contracts.js";
|
|
8
|
+
import type { ScreenDecision } from "../domain/negotiation.screen.contracts.js";
|
|
9
|
+
export interface NegotiationScreenerInput {
|
|
10
|
+
/** The client — the user whose negotiator is deciding whether to reach out. */
|
|
11
|
+
clientUser: UserNegotiationContext;
|
|
12
|
+
/** The counterparty the client's negotiator would be reaching out to. */
|
|
13
|
+
counterpartyUser: UserNegotiationContext;
|
|
14
|
+
/** The counterparty's `user_contexts` paragraph (empty string when absent). */
|
|
15
|
+
counterpartyContext?: string;
|
|
16
|
+
/** The explicit search query that triggered discovery (if any). */
|
|
17
|
+
discoveryQuery?: string;
|
|
18
|
+
seedAssessment: Omit<SeedAssessment, "actors">;
|
|
19
|
+
indexContext: {
|
|
20
|
+
networkId: string;
|
|
21
|
+
prompt?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Retrieved negotiator memories for the client (P5.3 read path). Rendered
|
|
25
|
+
* as a private prompt section with a memoryHints instruction. Absent/empty
|
|
26
|
+
* → the prompt is byte-identical to before.
|
|
27
|
+
*/
|
|
28
|
+
memory?: NegotiatorMemoryEntry[];
|
|
29
|
+
/**
|
|
30
|
+
* Whether this screen is for a continuation — a match against a counterparty
|
|
31
|
+
* this client already has prior dialogue with (IND-563). When set with
|
|
32
|
+
* `priorDialogue`, the gate evaluates the NEW signal on its own merits with
|
|
33
|
+
* that dialogue as context. Absent → the prompt is byte-identical to before.
|
|
34
|
+
*/
|
|
35
|
+
isContinuation?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Prior negotiation turns with this counterparty (continuations only).
|
|
38
|
+
* Rendered as read-only context so the gate can tell a materially-new signal
|
|
39
|
+
* from a rehash of an already-settled one. Never treated as this task's own
|
|
40
|
+
* outreach.
|
|
41
|
+
*/
|
|
42
|
+
priorDialogue?: NegotiationTurn[];
|
|
43
|
+
/**
|
|
44
|
+
* Attributed form of the prior dialogue (IND-569). When present it supersedes
|
|
45
|
+
* the flat `priorDialogue` list: earlier concluded opportunities and legacy
|
|
46
|
+
* unattributed turns render as labeled, separated blocks so the gate can see
|
|
47
|
+
* which prior turns belonged to OTHER opportunities. Absent → the flat
|
|
48
|
+
* `priorDialogue` rendering is used (byte-identical to before).
|
|
49
|
+
*/
|
|
50
|
+
priorDialogueAttributed?: AttributedPriorDialogue;
|
|
51
|
+
}
|
|
52
|
+
export interface NegotiationScreenerConfig {
|
|
53
|
+
/** Hard ceiling on the screen LLM round-trip, in ms (default 15000). */
|
|
54
|
+
timeoutMs?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The outreach gate (P2.1). One structured LLM call deciding
|
|
58
|
+
* `reach_out | pass` for a fresh negotiation, from the reaching client's
|
|
59
|
+
* perspective. Throws on LLM/validation failure — the screen graph node owns
|
|
60
|
+
* the fail-open policy (a failed screen never blocks the negotiation).
|
|
61
|
+
*/
|
|
62
|
+
export declare class NegotiationScreener {
|
|
63
|
+
private readonly timeoutMs;
|
|
64
|
+
constructor(config?: NegotiationScreenerConfig);
|
|
65
|
+
/**
|
|
66
|
+
* Produce a screen decision for a fresh match.
|
|
67
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
68
|
+
*/
|
|
69
|
+
invoke(input: NegotiationScreenerInput): Promise<ScreenDecision>;
|
|
70
|
+
/**
|
|
71
|
+
* Raw structured-model round trip. Split out as a seam so tests can drive
|
|
72
|
+
* the schema-validation and fail-open paths without a live provider.
|
|
73
|
+
*/
|
|
74
|
+
protected callModel(model: ReturnType<typeof createStructuredModel>, chatMessages: Array<{
|
|
75
|
+
role: string;
|
|
76
|
+
content: string;
|
|
77
|
+
}>): Promise<unknown>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createStructuredModel } from "../../shared/agent/model.config.js";
|
|
2
|
+
import { invokeWithAbortSignal } from "../../shared/agent/model-signal.js";
|
|
3
|
+
import { protocolLogger } from "../../shared/observability/protocol.logger.js";
|
|
4
|
+
import { renderNegotiatorMemorySection } from "../domain/negotiation.memory.js";
|
|
5
|
+
import { attributedDialogueIsEmpty, renderAttributedPriorDialogue } from "../negotiation.attribution.js";
|
|
6
|
+
// Re-export domain screen contracts for backward-compat consumers of this module path.
|
|
7
|
+
export { NEGOTIATION_SCREEN_MODES, configuredScreenMode, ScreenDecisionSchema, blocksNegotiationBeforeFirstTurn, } from "../domain/negotiation.screen.contracts.js";
|
|
8
|
+
import { ScreenDecisionSchema } from "../domain/negotiation.screen.contracts.js";
|
|
9
|
+
const screenLog = protocolLogger("NegotiationScreener");
|
|
10
|
+
const SYSTEM_PROMPT = `You are the outreach gate for {clientName}'s negotiator agent on a discovery network. Before any negotiation turn is exchanged, you decide whether this match is worth reaching out to on {clientName}'s behalf — their name and attention are spent with every outreach.
|
|
11
|
+
|
|
12
|
+
Network context: {networkContext}
|
|
13
|
+
|
|
14
|
+
Decide:
|
|
15
|
+
- "reach_out" when the counterparty plausibly serves {clientName}'s stated needs and a concrete, honest opening case can be made. When reaching out, set outreachAngle to the strongest specific angle for the opening message.
|
|
16
|
+
- "pass" when the match is generic, one-sided, or rests on vague overlap that would waste both parties' attention.
|
|
17
|
+
|
|
18
|
+
Rules:
|
|
19
|
+
{queryRule}
|
|
20
|
+
- Judge concrete intent alignment, not topical adjacency.
|
|
21
|
+
- Fill evidence.counterpartyPremiseFit with what (if anything) in the counterparty's context actually fits, and evidence.intentAlignment with how the intents line up. Be specific; cite the strongest signal either way.
|
|
22
|
+
- Do NOT reference internal system details like scores, pre-screens, or evaluator outputs in reasoning that could be shown to users.{negotiatorMemory}`;
|
|
23
|
+
const QUERY_RULE = `- {clientName} explicitly searched for "{discoveryQuery}". This query is the PRIMARY criterion: if the counterparty does not satisfy it, pass — background intents cannot rescue a query mismatch.`;
|
|
24
|
+
const NO_QUERY_RULE = `- No explicit search query: judge against {clientName}'s active intents.`;
|
|
25
|
+
const DEFAULT_SCREEN_TIMEOUT_MS = 15000;
|
|
26
|
+
/**
|
|
27
|
+
* The outreach gate (P2.1). One structured LLM call deciding
|
|
28
|
+
* `reach_out | pass` for a fresh negotiation, from the reaching client's
|
|
29
|
+
* perspective. Throws on LLM/validation failure — the screen graph node owns
|
|
30
|
+
* the fail-open policy (a failed screen never blocks the negotiation).
|
|
31
|
+
*/
|
|
32
|
+
export class NegotiationScreener {
|
|
33
|
+
constructor(config) {
|
|
34
|
+
this.timeoutMs = config?.timeoutMs && Number.isFinite(config.timeoutMs) && config.timeoutMs > 0
|
|
35
|
+
? config.timeoutMs
|
|
36
|
+
: DEFAULT_SCREEN_TIMEOUT_MS;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Produce a screen decision for a fresh match.
|
|
40
|
+
* @throws When the LLM call times out or returns schema-invalid output.
|
|
41
|
+
*/
|
|
42
|
+
async invoke(input) {
|
|
43
|
+
const model = createStructuredModel("negotiationScreener", ScreenDecisionSchema, { name: "negotiation_screener" });
|
|
44
|
+
const clientName = input.clientUser.profile.name ?? "your client";
|
|
45
|
+
const counterpartyName = input.counterpartyUser.profile.name ?? "the counterparty";
|
|
46
|
+
const networkContext = input.indexContext.prompt || "General discovery";
|
|
47
|
+
const queryRule = (input.discoveryQuery ? QUERY_RULE : NO_QUERY_RULE)
|
|
48
|
+
.replace(/{clientName}/g, clientName)
|
|
49
|
+
.replace(/{discoveryQuery}/g, input.discoveryQuery ?? "");
|
|
50
|
+
const systemPrompt = SYSTEM_PROMPT
|
|
51
|
+
.replace(/{clientName}/g, clientName)
|
|
52
|
+
.replace("{networkContext}", networkContext)
|
|
53
|
+
.replace("{queryRule}", queryRule)
|
|
54
|
+
.replace("{negotiatorMemory}", renderNegotiatorMemorySection(input.memory ?? [], { memoryHintsInstruction: true }));
|
|
55
|
+
const formatIntents = (intents) => intents.length > 0 ? intents.map((i) => `- ${i.title}: ${i.description}`).join("\n") : "- (none)";
|
|
56
|
+
const formatScreenTurn = (t, i) => {
|
|
57
|
+
const msgPart = t.message ? ` — ${t.message}` : "";
|
|
58
|
+
return `Turn ${i + 1}: ${t.action} — ${t.assessment.reasoning}${msgPart}`;
|
|
59
|
+
};
|
|
60
|
+
// IND-569: prefer the attributed rendering (labeled per-opportunity blocks)
|
|
61
|
+
// when the graph supplies it; otherwise fall back to the flat prior-turn list.
|
|
62
|
+
const hasAttributed = input.isContinuation
|
|
63
|
+
&& input.priorDialogueAttributed != null
|
|
64
|
+
&& !attributedDialogueIsEmpty(input.priorDialogueAttributed);
|
|
65
|
+
const flatPriorDialogue = input.isContinuation && input.priorDialogue && input.priorDialogue.length > 0
|
|
66
|
+
? input.priorDialogue
|
|
67
|
+
: [];
|
|
68
|
+
const priorDialogueBody = hasAttributed
|
|
69
|
+
? renderAttributedPriorDialogue(input.priorDialogueAttributed, formatScreenTurn)
|
|
70
|
+
: (flatPriorDialogue.length > 0 ? flatPriorDialogue.map(formatScreenTurn).join("\n") : "");
|
|
71
|
+
const priorDialogueContext = priorDialogueBody
|
|
72
|
+
? `\n\n--- Prior dialogue with ${counterpartyName} (already spoken) ---\n${priorDialogueBody}\n\nThis is a NEW signal against a counterparty ${clientName} has prior dialogue with. Some turns above may belong to OTHER, already-concluded opportunities (each block is labeled); they are background only. Judge the new signal on its own merits: if it is materially the same as what was already discussed, pass unless something concrete changed; if materially different, judge it fresh. Do NOT reach out again on generic overlap just because they spoke before.`
|
|
73
|
+
: "";
|
|
74
|
+
const userMessage = `YOUR CLIENT (${clientName}):
|
|
75
|
+
Bio: ${input.clientUser.profile.bio ?? "N/A"}
|
|
76
|
+
${input.discoveryQuery ? `Search query: "${input.discoveryQuery}"\nBackground intents (secondary to the query):` : "Active intents:"}
|
|
77
|
+
${formatIntents(input.clientUser.intents)}
|
|
78
|
+
|
|
79
|
+
COUNTERPARTY (${counterpartyName}):
|
|
80
|
+
Bio: ${input.counterpartyUser.profile.bio ?? "N/A"}
|
|
81
|
+
${input.counterpartyContext ? `Context: ${input.counterpartyContext}\n` : ""}Active intents:
|
|
82
|
+
${formatIntents(input.counterpartyUser.intents)}
|
|
83
|
+
|
|
84
|
+
Why this match was suggested: ${input.seedAssessment.reasoning}${priorDialogueContext}
|
|
85
|
+
|
|
86
|
+
Decide whether reaching out serves ${clientName}.`;
|
|
87
|
+
const chatMessages = [
|
|
88
|
+
{ role: "system", content: systemPrompt },
|
|
89
|
+
{ role: "user", content: userMessage },
|
|
90
|
+
];
|
|
91
|
+
const result = await this.callModel(model, chatMessages);
|
|
92
|
+
const parsed = ScreenDecisionSchema.safeParse(result);
|
|
93
|
+
if (!parsed.success) {
|
|
94
|
+
screenLog.warn("Screen output failed schema validation", {
|
|
95
|
+
issues: parsed.error.issues.map((i) => i.message).slice(0, 3),
|
|
96
|
+
});
|
|
97
|
+
throw new Error(`Screen decision failed validation: ${parsed.error.issues[0]?.message ?? "unknown"}`);
|
|
98
|
+
}
|
|
99
|
+
return parsed.data;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Raw structured-model round trip. Split out as a seam so tests can drive
|
|
103
|
+
* the schema-validation and fail-open paths without a live provider.
|
|
104
|
+
*/
|
|
105
|
+
async callModel(model, chatMessages) {
|
|
106
|
+
return invokeWithAbortSignal(model, chatMessages, AbortSignal.timeout(this.timeoutMs));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NegotiationSummarizer — pure LLM pass that compresses one DiscoveryNegotiation
|
|
3
|
+
* (potentially several KB of turn reasoning + outcome reasoning) into a
|
|
4
|
+
* DiscoveryNegotiationDigest (≤256 bytes structured). The digest is what the decision-
|
|
5
|
+
* question generator consumes, replacing the raw negotiation blob.
|
|
6
|
+
*
|
|
7
|
+
* Why: a 10-candidate discovery turn used to produce a 60+ KB prompt for the
|
|
8
|
+
* question generator, which stalled upstream Gemini/OpenRouter routes and
|
|
9
|
+
* dropped the connection at ~3 minutes. Per-negotiation summarization caps
|
|
10
|
+
* the question-generator input at a fixed, predictable size.
|
|
11
|
+
*/
|
|
12
|
+
import { type DiscoveryNegotiationDigest } from "../../shared/schemas/negotiation-digest.schema.js";
|
|
13
|
+
import type { DiscoveryNegotiation } from "../../shared/schemas/discovery-question.schema.js";
|
|
14
|
+
export declare class NegotiationSummarizer {
|
|
15
|
+
private model;
|
|
16
|
+
constructor();
|
|
17
|
+
summarize(negotiation: DiscoveryNegotiation, options?: {
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}): Promise<DiscoveryNegotiationDigest | null>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Deterministic fallback when the LLM summarizer fails or isn't wired. Produces
|
|
23
|
+
* a minimal but valid digest so the question generator still has *some* signal.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildFallbackDigest(n: DiscoveryNegotiation): DiscoveryNegotiationDigest;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NegotiationSummarizer — pure LLM pass that compresses one DiscoveryNegotiation
|
|
3
|
+
* (potentially several KB of turn reasoning + outcome reasoning) into a
|
|
4
|
+
* DiscoveryNegotiationDigest (≤256 bytes structured). The digest is what the decision-
|
|
5
|
+
* question generator consumes, replacing the raw negotiation blob.
|
|
6
|
+
*
|
|
7
|
+
* Why: a 10-candidate discovery turn used to produce a 60+ KB prompt for the
|
|
8
|
+
* question generator, which stalled upstream Gemini/OpenRouter routes and
|
|
9
|
+
* dropped the connection at ~3 minutes. Per-negotiation summarization caps
|
|
10
|
+
* the question-generator input at a fixed, predictable size.
|
|
11
|
+
*/
|
|
12
|
+
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
|
|
13
|
+
import { createStructuredModel } from "../../shared/agent/model.config.js";
|
|
14
|
+
import { invokeWithAbortSignal } from "../../shared/agent/model-signal.js";
|
|
15
|
+
import { protocolLogger } from "../../shared/observability/protocol.logger.js";
|
|
16
|
+
import { DiscoveryNegotiationDigestSchema } from "../../shared/schemas/negotiation-digest.schema.js";
|
|
17
|
+
const logger = protocolLogger("NegotiationSummarizer");
|
|
18
|
+
const SYSTEM_PROMPT = `You summarize one negotiation between a seeker's agent and a candidate's agent into a structured digest for downstream decision-question generation.
|
|
19
|
+
|
|
20
|
+
Output requirements (ALL fields — set optional fields to null when not applicable):
|
|
21
|
+
- counterpartyHint: copy the input field verbatim, truncated to ≤120 chars.
|
|
22
|
+
- indexContext: copy the input field verbatim, truncated to ≤120 chars.
|
|
23
|
+
- outcomeRole: "opportunity" when hasOpportunity=true, else "no-opportunity".
|
|
24
|
+
- outcomeReason: when outcomeRole="no-opportunity", set to "turn_cap" / "timeout" / "screened_out" if the input's reason matches; else "rejected" (if a turn explicitly rejected) or "stalled". When outcomeRole="opportunity", set to null. "screened_out" means the seeker's own agent chose not to reach out before any turn was exchanged — never describe it as the candidate declining or stalling.
|
|
25
|
+
- keyTake: ONE sentence (≤180 chars). Describe the decisive moment, the alignment gap, or the recurring signal — anything a question generator could use to formulate a clarifying question. NOT a generic outcome restatement. Anchor in a concrete detail from the negotiation if possible (a role mismatch, a missing input the candidate flagged, a pivot one party suggested).
|
|
26
|
+
- suggestedRoles: when both parties agreed on roles (the last turn's suggestedRoles), copy them from input. Otherwise set to null.
|
|
27
|
+
|
|
28
|
+
Do not include candidate identity, PII, names, or IDs. Reuse only counterpartyHint and indexContext as provided.`;
|
|
29
|
+
function buildUserPrompt(n) {
|
|
30
|
+
const turnLines = n.turns
|
|
31
|
+
.map((t, i) => `[${i + 1}] action=${t.action} roles=${t.suggestedRoles.ownUser}↔${t.suggestedRoles.otherUser} reasoning=${t.reasoning}`)
|
|
32
|
+
.join("\n");
|
|
33
|
+
return [
|
|
34
|
+
`counterpartyHint: ${n.counterpartyHint}`,
|
|
35
|
+
`indexContext: ${n.indexContext}`,
|
|
36
|
+
`turns (${n.turns.length}):`,
|
|
37
|
+
turnLines || "(no turns)",
|
|
38
|
+
`outcome.hasOpportunity: ${n.outcome.hasOpportunity}`,
|
|
39
|
+
`outcome.reasoning: ${n.outcome.reasoning}`,
|
|
40
|
+
n.outcome.reason ? `outcome.reason: ${n.outcome.reason}` : "",
|
|
41
|
+
]
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.join("\n");
|
|
44
|
+
}
|
|
45
|
+
export class NegotiationSummarizer {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.model = createStructuredModel("negotiationSummarizer", DiscoveryNegotiationDigestSchema, {
|
|
48
|
+
name: "negotiation_digest",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
async summarize(negotiation, options) {
|
|
52
|
+
const user = buildUserPrompt(negotiation);
|
|
53
|
+
let raw;
|
|
54
|
+
try {
|
|
55
|
+
raw = await invokeWithAbortSignal(this.model, [new SystemMessage(SYSTEM_PROMPT), new HumanMessage(user)], options?.signal);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const aborted = options?.signal?.aborted ?? false;
|
|
59
|
+
if (aborted) {
|
|
60
|
+
logger.info("NegotiationSummarizer aborted by signal", {
|
|
61
|
+
reason: options?.signal?.reason instanceof Error ? options.signal.reason.message : String(options?.signal?.reason ?? "unknown"),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
logger.warn("NegotiationSummarizer LLM call failed", {
|
|
66
|
+
error: err instanceof Error ? err.message : String(err),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const parsed = DiscoveryNegotiationDigestSchema.safeParse(raw);
|
|
72
|
+
if (!parsed.success) {
|
|
73
|
+
logger.warn("NegotiationSummarizer parse failed", { error: parsed.error.message });
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return parsed.data;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Deterministic fallback when the LLM summarizer fails or isn't wired. Produces
|
|
81
|
+
* a minimal but valid digest so the question generator still has *some* signal.
|
|
82
|
+
*/
|
|
83
|
+
export function buildFallbackDigest(n) {
|
|
84
|
+
const outcomeRole = n.outcome.hasOpportunity ? "opportunity" : "no-opportunity";
|
|
85
|
+
const lastTurn = n.turns[n.turns.length - 1];
|
|
86
|
+
const keyTakeRaw = n.outcome.reasoning && n.outcome.reasoning.trim().length > 0
|
|
87
|
+
? n.outcome.reasoning
|
|
88
|
+
: `${n.turns.length} turn(s); ended ${outcomeRole}`;
|
|
89
|
+
return {
|
|
90
|
+
counterpartyHint: n.counterpartyHint.slice(0, 120),
|
|
91
|
+
indexContext: n.indexContext.slice(0, 120),
|
|
92
|
+
outcomeRole,
|
|
93
|
+
outcomeReason: outcomeRole === "no-opportunity"
|
|
94
|
+
? (n.outcome.reason ?? "stalled")
|
|
95
|
+
: null,
|
|
96
|
+
keyTake: keyTakeRaw.slice(0, 180),
|
|
97
|
+
suggestedRoles: lastTurn?.action === "accept" && lastTurn.suggestedRoles
|
|
98
|
+
? lastTurn.suggestedRoles
|
|
99
|
+
: null,
|
|
100
|
+
};
|
|
101
|
+
}
|