@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,938 @@
|
|
|
1
|
+
import { StateGraph, START, END } from "@langchain/langgraph";
|
|
2
|
+
import { IntentGraphState } from "../domain/intent.state.js";
|
|
3
|
+
import { ExplicitIntentInferrer } from "./intent.inferrer.js";
|
|
4
|
+
import { SemanticVerifier } from "./intent.verifier.js";
|
|
5
|
+
import { DEFAULT_SPECIFICITY_WARNING } from "../domain/signal.specificity.js";
|
|
6
|
+
import { IntentReconciler } from "./intent.reconciler.js";
|
|
7
|
+
import { getAbortSignalConfig } from "../../shared/agent/model-signal.js";
|
|
8
|
+
import { protocolLogger } from "../../shared/observability/protocol.logger.js";
|
|
9
|
+
import { timed } from "../../shared/observability/performance.js";
|
|
10
|
+
import { requestContext } from "../../shared/observability/request-context.js";
|
|
11
|
+
const logger = protocolLogger("IntentGraphFactory");
|
|
12
|
+
/**
|
|
13
|
+
* Enforce write-mode constraints on reconciler output before any action can
|
|
14
|
+
* reach persistence. Update mode is deliberately fail-closed: only updates
|
|
15
|
+
* whose id is one of the caller-provided targets survive.
|
|
16
|
+
*/
|
|
17
|
+
export function enforceIntentActionBoundary(operationMode, targetIntentIds, actions) {
|
|
18
|
+
if (operationMode !== 'update')
|
|
19
|
+
return actions;
|
|
20
|
+
const targets = new Set(targetIntentIds ?? []);
|
|
21
|
+
return actions.filter((action) => action.type === 'update' && targets.has(action.id));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the only action permitted for an explicit update. This path is
|
|
25
|
+
* intentionally deterministic: semantic reconciliation may shape create
|
|
26
|
+
* operations, but it may not redirect an update away from its supplied target.
|
|
27
|
+
*/
|
|
28
|
+
export function buildExplicitUpdateActions(targetIntentIds, activeIntentIds, candidates) {
|
|
29
|
+
if (targetIntentIds?.length !== 1 || !activeIntentIds.includes(targetIntentIds[0])) {
|
|
30
|
+
return {
|
|
31
|
+
actions: [],
|
|
32
|
+
failure: {
|
|
33
|
+
category: 'update_target_boundary',
|
|
34
|
+
message: 'Explicit update requires exactly one active intent owned by the caller.',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (candidates.length !== 1) {
|
|
39
|
+
return {
|
|
40
|
+
actions: [],
|
|
41
|
+
failure: {
|
|
42
|
+
category: 'reconciliation_boundary',
|
|
43
|
+
message: 'Explicit update must resolve to exactly one verified intent.',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const candidate = candidates[0];
|
|
48
|
+
return {
|
|
49
|
+
actions: [{
|
|
50
|
+
type: 'update',
|
|
51
|
+
id: targetIntentIds[0],
|
|
52
|
+
payload: candidate.description,
|
|
53
|
+
score: candidate.score ?? null,
|
|
54
|
+
reasoning: candidate.reasoning ?? 'Explicit user-confirmed update',
|
|
55
|
+
intentMode: candidate.verification?.referential_anchor ? 'REFERENTIAL' : 'ATTRIBUTIVE',
|
|
56
|
+
}],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const MAX_PERMISSIBLE_ENTROPY = 0.75;
|
|
60
|
+
const MIN_CLEAR_INTENT_SCORE = 40;
|
|
61
|
+
const GENERIC_JOB_PHRASE = /\b(?:a|any|some)\s+job\b/i;
|
|
62
|
+
const inferRoleFromContextText = (text) => {
|
|
63
|
+
const normalized = text.toLowerCase();
|
|
64
|
+
if (/\b(engineer|developer)\b/.test(normalized))
|
|
65
|
+
return "software engineering";
|
|
66
|
+
if (/\b(designer|ux|ui)\b/.test(normalized))
|
|
67
|
+
return "product design";
|
|
68
|
+
if (/\b(marketing|marketer|growth)\b/.test(normalized))
|
|
69
|
+
return "marketing";
|
|
70
|
+
if (/\b(product manager|product)\b/.test(normalized))
|
|
71
|
+
return "product management";
|
|
72
|
+
if (/\b(data scientist|machine learning|ml|ai)\b/.test(normalized))
|
|
73
|
+
return "AI/ML";
|
|
74
|
+
if (/\b(sales|account executive|business development)\b/.test(normalized))
|
|
75
|
+
return "sales";
|
|
76
|
+
return null;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Derive a job-role qualifier from the user's global user_context paragraph
|
|
80
|
+
* (the identity text that replaced the legacy profile projection). Role is
|
|
81
|
+
* inferred from the free text; the old structured skills/interests extraction
|
|
82
|
+
* is gone with the removed profile fields.
|
|
83
|
+
*/
|
|
84
|
+
const buildJobQualifierFromContext = (contextText) => {
|
|
85
|
+
const roleHint = inferRoleFromContextText(contextText ?? "");
|
|
86
|
+
return roleHint ? `${roleHint} role` : null;
|
|
87
|
+
};
|
|
88
|
+
const enrichVagueIntentWithContext = (description, userContext) => {
|
|
89
|
+
const trimmed = description?.trim();
|
|
90
|
+
if (!trimmed)
|
|
91
|
+
return description;
|
|
92
|
+
const isGenericJobRequest = GENERIC_JOB_PHRASE.test(trimmed) ||
|
|
93
|
+
/\b(?:find|get|look(?:ing)?\s+for|want)\s+(?:to\s+)?(?:find\s+)?job\b/i.test(trimmed);
|
|
94
|
+
if (!isGenericJobRequest)
|
|
95
|
+
return description;
|
|
96
|
+
const qualifier = buildJobQualifierFromContext(userContext);
|
|
97
|
+
if (!qualifier)
|
|
98
|
+
return description;
|
|
99
|
+
const enriched = trimmed
|
|
100
|
+
.replace(/\ba job\b/i, `a ${qualifier}`)
|
|
101
|
+
.replace(/\bjob\b/i, `${qualifier}`)
|
|
102
|
+
.replace(/\s{2,}/g, " ")
|
|
103
|
+
.trim();
|
|
104
|
+
return enriched.length > 0 ? enriched : description;
|
|
105
|
+
};
|
|
106
|
+
const isVague = (description, entropy, clarity) => {
|
|
107
|
+
if (GENERIC_JOB_PHRASE.test(description))
|
|
108
|
+
return true;
|
|
109
|
+
if (entropy > MAX_PERMISSIBLE_ENTROPY)
|
|
110
|
+
return true;
|
|
111
|
+
if (clarity < MIN_CLEAR_INTENT_SCORE)
|
|
112
|
+
return true;
|
|
113
|
+
return false;
|
|
114
|
+
};
|
|
115
|
+
const getSpecificityWarning = (verdict) => {
|
|
116
|
+
const warning = verdict.specificity_warning?.trim();
|
|
117
|
+
return warning && warning.length > 0 ? warning : DEFAULT_SPECIFICITY_WARNING;
|
|
118
|
+
};
|
|
119
|
+
const toSpeechActType = (classification) => {
|
|
120
|
+
if (classification === "COMMISSIVE" || classification === "DIRECTIVE")
|
|
121
|
+
return classification;
|
|
122
|
+
return null;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Factory class to build and compile the Intent Processing Graph.
|
|
126
|
+
*/
|
|
127
|
+
export class IntentGraphFactory {
|
|
128
|
+
constructor(database, embedder, intentQueue, questionerEnqueue, agents) {
|
|
129
|
+
this.database = database;
|
|
130
|
+
this.embedder = embedder;
|
|
131
|
+
this.intentQueue = intentQueue;
|
|
132
|
+
this.questionerEnqueue = questionerEnqueue;
|
|
133
|
+
this.agents = agents;
|
|
134
|
+
}
|
|
135
|
+
createGraph() {
|
|
136
|
+
// Instantiate Agents (Nodes)
|
|
137
|
+
const inferrer = this.agents?.inferrer ?? new ExplicitIntentInferrer();
|
|
138
|
+
const verifier = this.agents?.verifier ?? new SemanticVerifier();
|
|
139
|
+
const reconciler = this.agents?.reconciler ?? new IntentReconciler();
|
|
140
|
+
// --- NODE DEFINITIONS ---
|
|
141
|
+
/**
|
|
142
|
+
* Node 0: Prep
|
|
143
|
+
* Always fetches ALL of the user's active intents from the DB via getActiveIntents(userId).
|
|
144
|
+
* This ensures reconciliation can detect duplicates and modifications globally,
|
|
145
|
+
* regardless of network scope.
|
|
146
|
+
*/
|
|
147
|
+
const prepNode = async (state) => {
|
|
148
|
+
return timed("IntentGraph.prep", async () => {
|
|
149
|
+
logger.verbose("Starting preparation phase", {
|
|
150
|
+
operationMode: state.operationMode,
|
|
151
|
+
hasContent: !!state.inputContent,
|
|
152
|
+
targetIntentIds: state.targetIntentIds,
|
|
153
|
+
networkId: state.networkId,
|
|
154
|
+
});
|
|
155
|
+
// Gate: write operations require an existing profile
|
|
156
|
+
if (state.operationMode !== 'read') {
|
|
157
|
+
const profile = await this.database.getProfile(state.userId);
|
|
158
|
+
if (!profile) {
|
|
159
|
+
const msg = "You need to create a profile before creating intents. Please set up your profile first.";
|
|
160
|
+
logger.error("Prep failed: no profile for user", { userId: state.userId });
|
|
161
|
+
return { error: msg };
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const activeIntents = await this.database.getActiveIntents(state.userId);
|
|
165
|
+
const formattedActiveIntents = activeIntents
|
|
166
|
+
.map(i => `ID: ${i.id}, Description: ${i.payload}, Summary: ${i.summary || 'N/A'}`)
|
|
167
|
+
.join('\n') || "No active intents.";
|
|
168
|
+
logger.verbose("Fetched active intents", {
|
|
169
|
+
count: activeIntents.length,
|
|
170
|
+
operationMode: state.operationMode
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
activeIntents: formattedActiveIntents,
|
|
174
|
+
activeIntentIds: activeIntents.map((intent) => intent.id),
|
|
175
|
+
trace: [{
|
|
176
|
+
node: "prep",
|
|
177
|
+
detail: `Fetched ${activeIntents.length} active intent(s)`,
|
|
178
|
+
}],
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Node 1: Inference
|
|
184
|
+
* Extracts intents from raw content.
|
|
185
|
+
* Phase 4: Uses operation mode to control behavior and determine if node should execute.
|
|
186
|
+
* Phase 5: Passes conversation context for anaphoric resolution.
|
|
187
|
+
*/
|
|
188
|
+
const inferenceNode = async (state) => {
|
|
189
|
+
return timed("IntentGraph.inference", async () => {
|
|
190
|
+
logger.verbose("Starting inference", {
|
|
191
|
+
operationMode: state.operationMode,
|
|
192
|
+
hasContent: !!state.inputContent,
|
|
193
|
+
contentPreview: state.inputContent?.substring(0, 50),
|
|
194
|
+
hasConversationContext: !!state.conversationContext,
|
|
195
|
+
conversationMessagesCount: state.conversationContext?.length || 0
|
|
196
|
+
});
|
|
197
|
+
const agentTimingsAccum = [];
|
|
198
|
+
// Phase 4: Control profile fallback based on operation mode
|
|
199
|
+
// Only allow for create operations without explicit content
|
|
200
|
+
const allowProfileFallback = state.operationMode === 'create' && !state.inputContent;
|
|
201
|
+
// Cast operationMode: 'read' and 'propose' map to 'create' for the inferrer
|
|
202
|
+
// (inference node is never called in read mode; propose behaves like create for inference)
|
|
203
|
+
const inferrerMode = (state.operationMode === 'read' || state.operationMode === 'propose') ? 'create' : state.operationMode;
|
|
204
|
+
const _traceEmitterInferrer = requestContext.getStore()?.traceEmitter;
|
|
205
|
+
const inferrerStart = Date.now();
|
|
206
|
+
_traceEmitterInferrer?.({ type: "agent_start", name: "intent-inferrer" });
|
|
207
|
+
const result = await inferrer.invoke(state.inputContent || null, state.userProfile, {
|
|
208
|
+
allowProfileFallback,
|
|
209
|
+
operationMode: inferrerMode,
|
|
210
|
+
conversationContext: state.conversationContext // Phase 5: Pass conversation history
|
|
211
|
+
});
|
|
212
|
+
agentTimingsAccum.push({ name: 'intent.inferrer', durationMs: Date.now() - inferrerStart });
|
|
213
|
+
_traceEmitterInferrer?.({ type: "agent_end", name: "intent-inferrer", durationMs: Date.now() - inferrerStart, summary: result.intents.length > 0 ? `Extracted ${result.intents.length} intent(s)` : "intent-inferrer completed" });
|
|
214
|
+
logger.verbose("Inference complete", {
|
|
215
|
+
inferredCount: result.intents.length,
|
|
216
|
+
operationMode: state.operationMode
|
|
217
|
+
});
|
|
218
|
+
const descriptions = result.intents.map(i => i.description).slice(0, 3);
|
|
219
|
+
const truncated = result.intents.length > 3 ? `... +${result.intents.length - 3} more` : "";
|
|
220
|
+
return {
|
|
221
|
+
inferredIntents: result.intents,
|
|
222
|
+
agentTimings: agentTimingsAccum,
|
|
223
|
+
trace: [{
|
|
224
|
+
node: "inference",
|
|
225
|
+
detail: result.intents.length === 0
|
|
226
|
+
? "No intents extracted"
|
|
227
|
+
: `Extracted ${result.intents.length}: ${descriptions.map(d => `"${d.slice(0, 50)}${d.length > 50 ? '...' : ''}"`).join(", ")}${truncated}`,
|
|
228
|
+
}],
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Node 2: Verification (Map-Reduce / Parallel)
|
|
234
|
+
* Verifies each inferred intent in parallel.
|
|
235
|
+
* Phase 4: Can be skipped for delete operations and updates with no new intents.
|
|
236
|
+
*/
|
|
237
|
+
const verificationNode = async (state) => {
|
|
238
|
+
return timed("IntentGraph.verification", async () => {
|
|
239
|
+
const intents = state.inferredIntents;
|
|
240
|
+
logger.verbose("Starting verification", {
|
|
241
|
+
operationMode: state.operationMode,
|
|
242
|
+
intentCount: intents.length
|
|
243
|
+
});
|
|
244
|
+
if (intents.length === 0) {
|
|
245
|
+
logger.verbose("No intents to verify");
|
|
246
|
+
return { verifiedIntents: [], agentTimings: [] };
|
|
247
|
+
}
|
|
248
|
+
logger.verbose('Verifying intents in parallel', { count: intents.length });
|
|
249
|
+
const agentTimingsAccum = [];
|
|
250
|
+
// Parallel Execution
|
|
251
|
+
const verificationResults = await Promise.all(intents.map(async (intent) => {
|
|
252
|
+
try {
|
|
253
|
+
let description = intent.description;
|
|
254
|
+
const _traceEmitterVerifier = requestContext.getStore()?.traceEmitter;
|
|
255
|
+
const verifierStart1 = Date.now();
|
|
256
|
+
_traceEmitterVerifier?.({ type: "agent_start", name: "intent-verifier" });
|
|
257
|
+
let verdict = await verifier.invoke(description, state.userProfile);
|
|
258
|
+
agentTimingsAccum.push({ name: 'intent.verifier', durationMs: Date.now() - verifierStart1 });
|
|
259
|
+
_traceEmitterVerifier?.({ type: "agent_end", name: "intent-verifier", durationMs: Date.now() - verifierStart1, summary: `Verified: ${verdict.classification}` });
|
|
260
|
+
if (isVague(description, verdict.semantic_entropy, verdict.felicity_scores.clarity)) {
|
|
261
|
+
// Role-hint enrichment for vague job intents reads the global
|
|
262
|
+
// user_context paragraph instead of the structured profile fields.
|
|
263
|
+
const roleHintContext = (await this.database.getUserContext(state.userId, null))?.text ?? '';
|
|
264
|
+
const enrichedDescription = enrichVagueIntentWithContext(description, roleHintContext);
|
|
265
|
+
if (enrichedDescription !== description) {
|
|
266
|
+
logger.verbose("Enriched vague intent using profile context", {
|
|
267
|
+
before: description,
|
|
268
|
+
after: enrichedDescription,
|
|
269
|
+
});
|
|
270
|
+
const _traceEmitterVerifier2 = requestContext.getStore()?.traceEmitter;
|
|
271
|
+
const verifierStart2 = Date.now();
|
|
272
|
+
_traceEmitterVerifier2?.({ type: "agent_start", name: "intent-verifier" });
|
|
273
|
+
const enrichedVerdict = await verifier.invoke(enrichedDescription, state.userProfile);
|
|
274
|
+
agentTimingsAccum.push({ name: 'intent.verifier', durationMs: Date.now() - verifierStart2 });
|
|
275
|
+
_traceEmitterVerifier2?.({ type: "agent_end", name: "intent-verifier", durationMs: Date.now() - verifierStart2, summary: `Verified (enriched): ${enrichedVerdict.classification}` });
|
|
276
|
+
const becameClear = enrichedVerdict.semantic_entropy < verdict.semantic_entropy ||
|
|
277
|
+
enrichedVerdict.felicity_scores.clarity > verdict.felicity_scores.clarity;
|
|
278
|
+
if (becameClear) {
|
|
279
|
+
description = enrichedDescription;
|
|
280
|
+
verdict = enrichedVerdict;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// Filter Logic: Must be a Commissive, Directive, or Declaration
|
|
285
|
+
const VALID_TYPES = ['COMMISSIVE', 'DIRECTIVE', 'DECLARATION'];
|
|
286
|
+
if (!VALID_TYPES.includes(verdict.classification)) {
|
|
287
|
+
logger.warn('Dropping intent', { description, classification: verdict.classification });
|
|
288
|
+
return {
|
|
289
|
+
failure: {
|
|
290
|
+
category: 'non_actionable',
|
|
291
|
+
classification: verdict.classification,
|
|
292
|
+
referentialBreadth: verdict.referential_breadth,
|
|
293
|
+
message: `Description was classified as ${verdict.classification}, not an actionable goal.`,
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (isVague(description, verdict.semantic_entropy, verdict.felicity_scores.clarity)) {
|
|
298
|
+
logger.warn('Dropping vague intent after verification', {
|
|
299
|
+
description,
|
|
300
|
+
entropy: verdict.semantic_entropy,
|
|
301
|
+
clarity: verdict.felicity_scores.clarity,
|
|
302
|
+
});
|
|
303
|
+
return {
|
|
304
|
+
failure: {
|
|
305
|
+
category: 'vague_or_invalid',
|
|
306
|
+
classification: verdict.classification,
|
|
307
|
+
referentialBreadth: verdict.referential_breadth,
|
|
308
|
+
message: 'Description failed clarity or semantic-entropy requirements.',
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
if (state.operationMode === 'create' && verdict.referential_breadth === 'broad') {
|
|
313
|
+
logger.warn('Dropping broad attributive intent before persistence', {
|
|
314
|
+
description,
|
|
315
|
+
referentialBreadth: verdict.referential_breadth,
|
|
316
|
+
missingSelectionalConstraints: verdict.missing_selectional_constraints,
|
|
317
|
+
warning: getSpecificityWarning(verdict),
|
|
318
|
+
});
|
|
319
|
+
return {
|
|
320
|
+
failure: {
|
|
321
|
+
category: 'vague_or_invalid',
|
|
322
|
+
classification: verdict.classification,
|
|
323
|
+
referentialBreadth: verdict.referential_breadth,
|
|
324
|
+
message: getSpecificityWarning(verdict),
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
// Calculate Score
|
|
329
|
+
const score = Math.min(verdict.felicity_scores.authority, verdict.felicity_scores.sincerity, verdict.felicity_scores.clarity);
|
|
330
|
+
// Return enriched intent
|
|
331
|
+
return {
|
|
332
|
+
intent: {
|
|
333
|
+
...intent,
|
|
334
|
+
description,
|
|
335
|
+
verification: verdict,
|
|
336
|
+
score,
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
catch (e) {
|
|
341
|
+
logger.error('Error verifying intent', { description: intent.description, error: e });
|
|
342
|
+
return {
|
|
343
|
+
failure: {
|
|
344
|
+
category: 'verification_failure',
|
|
345
|
+
message: e instanceof Error ? e.message : 'Intent verification failed unexpectedly.',
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}));
|
|
350
|
+
const verified = verificationResults.flatMap((result) => 'intent' in result ? [result.intent] : []);
|
|
351
|
+
const validationFailures = verificationResults.flatMap((result) => 'failure' in result ? [result.failure] : []);
|
|
352
|
+
logger.verbose(`Verification complete`, {
|
|
353
|
+
passed: verified.length,
|
|
354
|
+
total: intents.length,
|
|
355
|
+
operationMode: state.operationMode
|
|
356
|
+
});
|
|
357
|
+
// Build trace entries with Felicity scores for each verified intent
|
|
358
|
+
const traceEntries = verified.map(v => {
|
|
359
|
+
const fs = v.verification?.felicity_scores;
|
|
360
|
+
const entropy = v.verification?.semantic_entropy;
|
|
361
|
+
const classification = v.verification?.classification;
|
|
362
|
+
const referentialBreadth = v.verification?.referential_breadth;
|
|
363
|
+
return {
|
|
364
|
+
node: "verification",
|
|
365
|
+
detail: `"${v.description.slice(0, 40)}${v.description.length > 40 ? '...' : ''}" → ${classification}${referentialBreadth ? ` (${referentialBreadth} referential breadth)` : ''}`,
|
|
366
|
+
data: fs ? {
|
|
367
|
+
clarity: fs.clarity,
|
|
368
|
+
authority: fs.authority,
|
|
369
|
+
sincerity: fs.sincerity,
|
|
370
|
+
entropy: entropy != null ? Math.round(entropy * 100) / 100 : undefined,
|
|
371
|
+
referentialBreadth,
|
|
372
|
+
missingSelectionalConstraints: v.verification?.missing_selectional_constraints,
|
|
373
|
+
specificityWarning: v.verification?.specificity_warning ?? undefined,
|
|
374
|
+
classification,
|
|
375
|
+
score: v.score,
|
|
376
|
+
} : undefined,
|
|
377
|
+
};
|
|
378
|
+
});
|
|
379
|
+
// Add summary trace if some intents were filtered out
|
|
380
|
+
const dropped = intents.length - verified.length;
|
|
381
|
+
if (dropped > 0) {
|
|
382
|
+
traceEntries.unshift({
|
|
383
|
+
node: "verification",
|
|
384
|
+
detail: `Verified ${verified.length}/${intents.length} (${dropped} filtered as invalid)`,
|
|
385
|
+
data: undefined,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
else if (verified.length > 0) {
|
|
389
|
+
traceEntries.unshift({
|
|
390
|
+
node: "verification",
|
|
391
|
+
detail: `Verified ${verified.length} intent(s)`,
|
|
392
|
+
data: undefined,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
return { verifiedIntents: verified, validationFailures, agentTimings: agentTimingsAccum, trace: traceEntries };
|
|
396
|
+
});
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Node 3: Reconciliation
|
|
400
|
+
* Decides on final actions (Create, Update, Expire).
|
|
401
|
+
* Phase 4: Handles delete operations directly without LLM reconciliation.
|
|
402
|
+
*/
|
|
403
|
+
const reconciliationNode = async (state) => {
|
|
404
|
+
return timed("IntentGraph.reconciliation", async () => {
|
|
405
|
+
logger.verbose("Starting reconciliation", {
|
|
406
|
+
operationMode: state.operationMode,
|
|
407
|
+
verifiedIntentCount: state.verifiedIntents.length,
|
|
408
|
+
targetIntentIds: state.targetIntentIds
|
|
409
|
+
});
|
|
410
|
+
const agentTimingsAccum = [];
|
|
411
|
+
// Phase 4: Handle delete operations directly
|
|
412
|
+
if (state.operationMode === 'delete') {
|
|
413
|
+
if (!state.targetIntentIds || state.targetIntentIds.length === 0) {
|
|
414
|
+
logger.warn("Delete mode with no target IDs");
|
|
415
|
+
return {
|
|
416
|
+
actions: [],
|
|
417
|
+
agentTimings: agentTimingsAccum,
|
|
418
|
+
trace: [{ node: "reconciler", detail: "Delete mode with no target IDs" }],
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
logger.verbose("Delete mode - generating expire actions", {
|
|
422
|
+
targetIds: state.targetIntentIds
|
|
423
|
+
});
|
|
424
|
+
const actions = state.targetIntentIds.map(id => ({
|
|
425
|
+
type: 'expire',
|
|
426
|
+
id,
|
|
427
|
+
reasoning: 'User requested deletion'
|
|
428
|
+
}));
|
|
429
|
+
return {
|
|
430
|
+
actions,
|
|
431
|
+
agentTimings: agentTimingsAccum,
|
|
432
|
+
trace: [{
|
|
433
|
+
node: "reconciler",
|
|
434
|
+
detail: `Actions: expire=${actions.length}`,
|
|
435
|
+
}],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
// Standard reconciliation for create/update operations
|
|
439
|
+
const candidates = state.verifiedIntents;
|
|
440
|
+
if (candidates.length === 0) {
|
|
441
|
+
logger.verbose("No verified intents to reconcile");
|
|
442
|
+
return {
|
|
443
|
+
actions: [],
|
|
444
|
+
agentTimings: agentTimingsAccum,
|
|
445
|
+
trace: [{ node: "reconciler", detail: "No intents to reconcile" }],
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
if (state.operationMode === 'update') {
|
|
449
|
+
const explicitUpdate = buildExplicitUpdateActions(state.targetIntentIds, state.activeIntentIds, candidates);
|
|
450
|
+
return {
|
|
451
|
+
actions: explicitUpdate.actions,
|
|
452
|
+
validationFailures: explicitUpdate.failure
|
|
453
|
+
? [...state.validationFailures, explicitUpdate.failure]
|
|
454
|
+
: state.validationFailures,
|
|
455
|
+
agentTimings: agentTimingsAccum,
|
|
456
|
+
trace: [{
|
|
457
|
+
node: 'reconciler',
|
|
458
|
+
detail: explicitUpdate.failure
|
|
459
|
+
? `Explicit update rejected: ${explicitUpdate.failure.category}`
|
|
460
|
+
: `Explicit update bound to target ${state.targetIntentIds?.[0]}`,
|
|
461
|
+
}],
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
// Format candidates for the Reconciler Prompt
|
|
465
|
+
const formattedCandidates = candidates.map(c => `- [${c.type.toUpperCase()}] "${c.description}" (Confidence: ${c.confidence}, Score: ${c.score})\n` +
|
|
466
|
+
` Reasoning: ${c.reasoning}\n` +
|
|
467
|
+
` Verification: ${c.verification?.classification} (Flags: ${c.verification?.flags.join(', ') || 'None'})`).join('\n');
|
|
468
|
+
logger.verbose("Invoking reconciler agent", {
|
|
469
|
+
candidateCount: candidates.length,
|
|
470
|
+
operationMode: state.operationMode
|
|
471
|
+
});
|
|
472
|
+
const _traceEmitterReconciler = requestContext.getStore()?.traceEmitter;
|
|
473
|
+
const reconcilerStart = Date.now();
|
|
474
|
+
_traceEmitterReconciler?.({ type: "agent_start", name: "intent-reconciler" });
|
|
475
|
+
const result = await reconciler.invoke(formattedCandidates, state.activeIntents);
|
|
476
|
+
agentTimingsAccum.push({ name: 'intent.reconciler', durationMs: Date.now() - reconcilerStart });
|
|
477
|
+
_traceEmitterReconciler?.({ type: "agent_end", name: "intent-reconciler", durationMs: Date.now() - reconcilerStart, summary: `Reconciled ${result.actions.length} action(s)` });
|
|
478
|
+
const actions = enforceIntentActionBoundary(state.operationMode, state.targetIntentIds, result.actions);
|
|
479
|
+
logger.verbose("Reconciliation complete", {
|
|
480
|
+
actionCount: actions.length,
|
|
481
|
+
droppedActionCount: result.actions.length - actions.length,
|
|
482
|
+
operationMode: state.operationMode
|
|
483
|
+
});
|
|
484
|
+
// Count actions by type after enforcing the operation boundary.
|
|
485
|
+
const counts = { create: 0, update: 0, expire: 0 };
|
|
486
|
+
for (const a of actions) {
|
|
487
|
+
if (a.type in counts)
|
|
488
|
+
counts[a.type]++;
|
|
489
|
+
}
|
|
490
|
+
return {
|
|
491
|
+
actions,
|
|
492
|
+
agentTimings: agentTimingsAccum,
|
|
493
|
+
trace: [{
|
|
494
|
+
node: "reconciler",
|
|
495
|
+
detail: `Actions: create=${counts.create}, update=${counts.update}, expire=${counts.expire}`,
|
|
496
|
+
}],
|
|
497
|
+
};
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
/** Strip URLs and "More details at [url]" from intent payloads before persisting. */
|
|
501
|
+
const sanitizePayload = (payload) => {
|
|
502
|
+
if (!payload || typeof payload !== "string")
|
|
503
|
+
return payload;
|
|
504
|
+
const out = payload
|
|
505
|
+
.replace(/\s*More details at\s*:?\s*https?:\/\/[^\s"'<>)\]]+/gi, "")
|
|
506
|
+
.replace(/\s*See\s+https?:\/\/[^\s"'<>)\]]+\s+for\s+more[^.]*\.?/gi, "")
|
|
507
|
+
.replace(/https?:\/\/[^\s"'<>)\]]+/g, "")
|
|
508
|
+
.replace(/\s{2,}/g, " ")
|
|
509
|
+
.trim();
|
|
510
|
+
return out.replace(/[.,;]\s*$/, "").trim() || payload;
|
|
511
|
+
};
|
|
512
|
+
/**
|
|
513
|
+
* Generate a flat embedding for an intent payload, swallowing failures so
|
|
514
|
+
* persistence can continue without an embedding. `intentId` is logging-only
|
|
515
|
+
* (present for updates, absent for creates).
|
|
516
|
+
*/
|
|
517
|
+
const generateIntentEmbedding = async (sanitizedPayload, intentId) => {
|
|
518
|
+
if (!this.embedder)
|
|
519
|
+
return undefined;
|
|
520
|
+
try {
|
|
521
|
+
const embedding = await this.embedder.generate(sanitizedPayload, undefined, getAbortSignalConfig());
|
|
522
|
+
const flatEmbedding = Array.isArray(embedding?.[0])
|
|
523
|
+
? embedding[0]
|
|
524
|
+
: embedding;
|
|
525
|
+
logger.verbose("Generated embedding for intent", {
|
|
526
|
+
...(intentId ? { intentId } : {}),
|
|
527
|
+
dimensions: flatEmbedding?.length,
|
|
528
|
+
});
|
|
529
|
+
return flatEmbedding;
|
|
530
|
+
}
|
|
531
|
+
catch (embErr) {
|
|
532
|
+
logger.error("Failed to generate embedding for intent (continuing without)", {
|
|
533
|
+
...(intentId ? { intentId } : {}),
|
|
534
|
+
error: embErr,
|
|
535
|
+
});
|
|
536
|
+
return undefined;
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
/**
|
|
540
|
+
* Node 4: Executor
|
|
541
|
+
* Executes reconciler actions against the database.
|
|
542
|
+
*/
|
|
543
|
+
const executorNode = async (state) => {
|
|
544
|
+
return timed("IntentGraph.executor", async () => {
|
|
545
|
+
const actions = enforceIntentActionBoundary(state.operationMode, state.targetIntentIds, state.actions ?? []);
|
|
546
|
+
if (actions.length === 0) {
|
|
547
|
+
return { executionResults: [] };
|
|
548
|
+
}
|
|
549
|
+
logger.verbose('Executing actions', { count: actions.length });
|
|
550
|
+
const results = [];
|
|
551
|
+
const scopeEnvelope = state.scopeType && state.scopeId
|
|
552
|
+
? { scopeType: state.scopeType, scopeId: state.scopeId }
|
|
553
|
+
: {};
|
|
554
|
+
const verifiedIntentByPayload = new Map();
|
|
555
|
+
for (const verifiedIntent of state.verifiedIntents) {
|
|
556
|
+
verifiedIntentByPayload.set(verifiedIntent.description, verifiedIntent);
|
|
557
|
+
verifiedIntentByPayload.set(sanitizePayload(verifiedIntent.description), verifiedIntent);
|
|
558
|
+
}
|
|
559
|
+
for (const action of actions) {
|
|
560
|
+
const actionType = action.type.toLowerCase();
|
|
561
|
+
try {
|
|
562
|
+
if (actionType === 'create') {
|
|
563
|
+
const createAction = action;
|
|
564
|
+
const sanitizedPayload = sanitizePayload(createAction.payload);
|
|
565
|
+
const matchedVerifiedIntent = verifiedIntentByPayload.get(createAction.payload) ||
|
|
566
|
+
verifiedIntentByPayload.get(sanitizedPayload);
|
|
567
|
+
// Generate embedding for the intent payload
|
|
568
|
+
const flatEmbedding = await generateIntentEmbedding(sanitizedPayload);
|
|
569
|
+
const created = await this.database.createIntent({
|
|
570
|
+
userId: state.userId,
|
|
571
|
+
payload: sanitizedPayload,
|
|
572
|
+
confidence: createAction.score ? createAction.score / 100 : 1.0,
|
|
573
|
+
inferenceType: 'explicit',
|
|
574
|
+
sourceType: 'discovery_form',
|
|
575
|
+
embedding: flatEmbedding,
|
|
576
|
+
semanticEntropy: createAction.semanticEntropy ??
|
|
577
|
+
matchedVerifiedIntent?.verification?.semantic_entropy ??
|
|
578
|
+
null,
|
|
579
|
+
referentialAnchor: createAction.referentialAnchor ??
|
|
580
|
+
matchedVerifiedIntent?.verification?.referential_anchor ??
|
|
581
|
+
null,
|
|
582
|
+
felicityAuthority: matchedVerifiedIntent?.verification?.felicity_scores.authority ?? null,
|
|
583
|
+
felicitySincerity: matchedVerifiedIntent?.verification?.felicity_scores.sincerity ?? null,
|
|
584
|
+
felicityClarity: matchedVerifiedIntent?.verification?.felicity_scores.clarity ?? null,
|
|
585
|
+
intentMode: createAction.intentMode ?? null,
|
|
586
|
+
speechActType: toSpeechActType(matchedVerifiedIntent?.verification?.classification),
|
|
587
|
+
});
|
|
588
|
+
results.push({ actionType: 'create', success: true, intentId: created.id, payload: sanitizedPayload });
|
|
589
|
+
logger.verbose('Created intent', { intentId: created.id });
|
|
590
|
+
this.intentQueue?.addGenerateHydeJob({
|
|
591
|
+
intentId: created.id,
|
|
592
|
+
userId: state.userId,
|
|
593
|
+
...scopeEnvelope,
|
|
594
|
+
}).catch((err) => logger.error('Failed to enqueue intent HyDE job', { intentId: created.id, error: err }));
|
|
595
|
+
if (this.questionerEnqueue) {
|
|
596
|
+
const userContext = (await this.database.getUserContext(state.userId, null))?.text ?? '';
|
|
597
|
+
this.questionerEnqueue({
|
|
598
|
+
mode: 'intent',
|
|
599
|
+
userId: state.userId,
|
|
600
|
+
sourceType: 'intent',
|
|
601
|
+
sourceId: created.id,
|
|
602
|
+
...scopeEnvelope,
|
|
603
|
+
context: {
|
|
604
|
+
intentId: created.id,
|
|
605
|
+
payload: sanitizedPayload,
|
|
606
|
+
userContext,
|
|
607
|
+
},
|
|
608
|
+
}).catch((err) => logger.error('Failed to enqueue intent question generation', { intentId: created.id, error: err }));
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
else if (actionType === 'update') {
|
|
612
|
+
const updateAction = action;
|
|
613
|
+
const sanitizedPayload = sanitizePayload(updateAction.payload);
|
|
614
|
+
const matchedVerifiedIntent = verifiedIntentByPayload.get(updateAction.payload) ||
|
|
615
|
+
verifiedIntentByPayload.get(sanitizedPayload);
|
|
616
|
+
// Regenerate embedding for the updated payload
|
|
617
|
+
const flatEmbedding = await generateIntentEmbedding(sanitizedPayload, updateAction.id);
|
|
618
|
+
const updated = await this.database.updateIntent(updateAction.id, {
|
|
619
|
+
payload: sanitizedPayload,
|
|
620
|
+
embedding: flatEmbedding,
|
|
621
|
+
semanticEntropy: matchedVerifiedIntent?.verification?.semantic_entropy ??
|
|
622
|
+
null,
|
|
623
|
+
referentialAnchor: matchedVerifiedIntent?.verification?.referential_anchor ??
|
|
624
|
+
null,
|
|
625
|
+
felicityAuthority: matchedVerifiedIntent?.verification?.felicity_scores.authority ?? null,
|
|
626
|
+
felicitySincerity: matchedVerifiedIntent?.verification?.felicity_scores.sincerity ?? null,
|
|
627
|
+
felicityClarity: matchedVerifiedIntent?.verification?.felicity_scores.clarity ?? null,
|
|
628
|
+
intentMode: updateAction.intentMode ?? null,
|
|
629
|
+
speechActType: toSpeechActType(matchedVerifiedIntent?.verification?.classification),
|
|
630
|
+
...(state.expectedIntentFingerprint !== undefined ? {
|
|
631
|
+
expectedIntentFingerprint: state.expectedIntentFingerprint,
|
|
632
|
+
expectedIntentUserId: state.userId,
|
|
633
|
+
} : {}),
|
|
634
|
+
});
|
|
635
|
+
results.push({
|
|
636
|
+
actionType: 'update',
|
|
637
|
+
success: !!updated,
|
|
638
|
+
intentId: updateAction.id,
|
|
639
|
+
payload: sanitizedPayload,
|
|
640
|
+
error: updated ? undefined : 'Intent not found'
|
|
641
|
+
});
|
|
642
|
+
logger.verbose('Updated intent', { intentId: updateAction.id });
|
|
643
|
+
if (updated) {
|
|
644
|
+
this.intentQueue?.addGenerateHydeJob({
|
|
645
|
+
intentId: updateAction.id,
|
|
646
|
+
userId: state.userId,
|
|
647
|
+
...scopeEnvelope,
|
|
648
|
+
}).catch((err) => logger.error('Failed to enqueue intent HyDE job', { intentId: updateAction.id, error: err }));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
else if (actionType === 'expire') {
|
|
652
|
+
const expireAction = action;
|
|
653
|
+
const result = await this.database.archiveIntent(expireAction.id);
|
|
654
|
+
results.push({
|
|
655
|
+
actionType: 'expire',
|
|
656
|
+
success: result.success,
|
|
657
|
+
intentId: expireAction.id,
|
|
658
|
+
error: result.error
|
|
659
|
+
});
|
|
660
|
+
logger.verbose('Archived intent', { intentId: expireAction.id });
|
|
661
|
+
if (result.success) {
|
|
662
|
+
this.intentQueue?.addDeleteHydeJob({ intentId: expireAction.id }).catch((err) => logger.error('Failed to enqueue intent HyDE delete job', { intentId: expireAction.id, error: err }));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
catch (error) {
|
|
667
|
+
logger.error('Failed to execute action', { actionType: action.type, error });
|
|
668
|
+
results.push({
|
|
669
|
+
actionType,
|
|
670
|
+
success: false,
|
|
671
|
+
intentId: 'id' in action ? action.id : undefined,
|
|
672
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return { executionResults: results };
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
// --- QUERY NODE (Read Mode) ---
|
|
680
|
+
/**
|
|
681
|
+
* Node: Query
|
|
682
|
+
* Fast-path read node — fetches intents from DB based on scope.
|
|
683
|
+
* Handles: global user intents, network-scoped (all or filtered by user).
|
|
684
|
+
* No LLM calls; no inference/verification/reconciliation.
|
|
685
|
+
*/
|
|
686
|
+
const queryNode = async (state) => {
|
|
687
|
+
return timed("IntentGraph.query", async () => {
|
|
688
|
+
logger.verbose("Starting query (read mode)", {
|
|
689
|
+
userId: state.userId,
|
|
690
|
+
networkId: state.networkId,
|
|
691
|
+
queryUserId: state.queryUserId,
|
|
692
|
+
allUserIntents: state.allUserIntents,
|
|
693
|
+
});
|
|
694
|
+
try {
|
|
695
|
+
// Scope-aware default: caller's intents across all reachable networks.
|
|
696
|
+
// Triggered when the tool layer passed indexScope and did not pick a
|
|
697
|
+
// specific networkId or queryUserId — i.e. "my intents" in a chat
|
|
698
|
+
// where the agent's reach is more than one index.
|
|
699
|
+
if (!state.queryUserId &&
|
|
700
|
+
!state.networkId &&
|
|
701
|
+
state.indexScope &&
|
|
702
|
+
state.indexScope.length > 0) {
|
|
703
|
+
const intents = await this.database.getActiveIntentsAcrossIndexes(state.userId, state.indexScope);
|
|
704
|
+
if (intents.length === 0) {
|
|
705
|
+
return {
|
|
706
|
+
readResult: {
|
|
707
|
+
count: 0,
|
|
708
|
+
intents: [],
|
|
709
|
+
message: "You don't have any active intents yet. Share what you're looking for.",
|
|
710
|
+
},
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
return {
|
|
714
|
+
readResult: {
|
|
715
|
+
count: intents.length,
|
|
716
|
+
intents: intents.map((i) => ({
|
|
717
|
+
id: i.id,
|
|
718
|
+
description: i.payload,
|
|
719
|
+
summary: i.summary,
|
|
720
|
+
createdAt: i.createdAt,
|
|
721
|
+
})),
|
|
722
|
+
},
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
// When allUserIntents is true, ignore network scope and return all
|
|
726
|
+
const effectiveIndexId = state.allUserIntents ? undefined : state.networkId;
|
|
727
|
+
if (effectiveIndexId) {
|
|
728
|
+
// Verify membership
|
|
729
|
+
const isMember = await this.database.isNetworkMember(effectiveIndexId, state.userId);
|
|
730
|
+
if (!isMember) {
|
|
731
|
+
return {
|
|
732
|
+
readResult: {
|
|
733
|
+
count: 0,
|
|
734
|
+
intents: [],
|
|
735
|
+
message: "Index not found or you are not a member.",
|
|
736
|
+
},
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
// Network-scoped read
|
|
740
|
+
if (!state.queryUserId) {
|
|
741
|
+
// All intents in the index (any member can see)
|
|
742
|
+
const intents = await this.database.getNetworkIntentsForMember(effectiveIndexId, state.userId, { limit: 50, offset: 0 });
|
|
743
|
+
if (intents.length === 0) {
|
|
744
|
+
return {
|
|
745
|
+
readResult: {
|
|
746
|
+
count: 0,
|
|
747
|
+
intents: [],
|
|
748
|
+
message: "No intents in this network yet.",
|
|
749
|
+
networkId: effectiveIndexId,
|
|
750
|
+
},
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
return {
|
|
754
|
+
readResult: {
|
|
755
|
+
count: intents.length,
|
|
756
|
+
networkId: effectiveIndexId,
|
|
757
|
+
intents: intents.map((i) => ({
|
|
758
|
+
id: i.id,
|
|
759
|
+
description: i.payload,
|
|
760
|
+
summary: i.summary,
|
|
761
|
+
createdAt: i.createdAt,
|
|
762
|
+
userId: i.userId,
|
|
763
|
+
userName: i.userName,
|
|
764
|
+
})),
|
|
765
|
+
},
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
// Specific user's intents in the index
|
|
769
|
+
const effectiveUserId = state.queryUserId;
|
|
770
|
+
const intents = await this.database.getIntentsInIndexForMember(effectiveUserId, effectiveIndexId);
|
|
771
|
+
if (intents.length === 0) {
|
|
772
|
+
return {
|
|
773
|
+
readResult: {
|
|
774
|
+
count: 0,
|
|
775
|
+
intents: [],
|
|
776
|
+
message: effectiveUserId === state.userId
|
|
777
|
+
? "You don't have any intents in this network yet."
|
|
778
|
+
: "No intents for that user in this network.",
|
|
779
|
+
networkId: effectiveIndexId,
|
|
780
|
+
},
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
const user = await this.database.getUser(effectiveUserId);
|
|
784
|
+
const userName = user?.name ?? null;
|
|
785
|
+
return {
|
|
786
|
+
readResult: {
|
|
787
|
+
count: intents.length,
|
|
788
|
+
networkId: effectiveIndexId,
|
|
789
|
+
intents: intents.map((i) => ({
|
|
790
|
+
id: i.id,
|
|
791
|
+
description: i.payload,
|
|
792
|
+
summary: i.summary,
|
|
793
|
+
createdAt: i.createdAt,
|
|
794
|
+
userId: effectiveUserId,
|
|
795
|
+
userName,
|
|
796
|
+
})),
|
|
797
|
+
},
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
// Global (no network scope): return user's own active intents
|
|
801
|
+
const intents = await this.database.getActiveIntents(state.userId);
|
|
802
|
+
if (intents.length === 0) {
|
|
803
|
+
return {
|
|
804
|
+
readResult: {
|
|
805
|
+
count: 0,
|
|
806
|
+
intents: [],
|
|
807
|
+
message: "You don't have any active intents yet. Share what you're looking for.",
|
|
808
|
+
},
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
return {
|
|
812
|
+
readResult: {
|
|
813
|
+
count: intents.length,
|
|
814
|
+
intents: intents.map((i) => ({
|
|
815
|
+
id: i.id,
|
|
816
|
+
description: i.payload,
|
|
817
|
+
summary: i.summary,
|
|
818
|
+
createdAt: i.createdAt,
|
|
819
|
+
})),
|
|
820
|
+
},
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
catch (err) {
|
|
824
|
+
logger.error("Query node failed", { error: err });
|
|
825
|
+
return {
|
|
826
|
+
readResult: {
|
|
827
|
+
count: 0,
|
|
828
|
+
intents: [],
|
|
829
|
+
message: "Failed to fetch intents. Please try again.",
|
|
830
|
+
},
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
};
|
|
835
|
+
// --- CONDITIONAL ROUTING FUNCTIONS ---
|
|
836
|
+
/**
|
|
837
|
+
* After prep: read mode → query; otherwise decide inference vs reconciler by operation mode.
|
|
838
|
+
*/
|
|
839
|
+
const afterPrepRoute = (state) => {
|
|
840
|
+
if (state.error) {
|
|
841
|
+
logger.warn('Prep failed with error, short-circuiting to END', { error: state.error });
|
|
842
|
+
return '__end__';
|
|
843
|
+
}
|
|
844
|
+
if (state.operationMode === 'read') {
|
|
845
|
+
logger.verbose('Read mode - routing to query (fast path)');
|
|
846
|
+
return 'query';
|
|
847
|
+
}
|
|
848
|
+
return shouldRunInference(state);
|
|
849
|
+
};
|
|
850
|
+
/**
|
|
851
|
+
* Determines if inference should run based on operation mode.
|
|
852
|
+
* Delete operations skip inference entirely and go straight to reconciliation.
|
|
853
|
+
*/
|
|
854
|
+
const shouldRunInference = (state) => {
|
|
855
|
+
if (state.operationMode === 'delete') {
|
|
856
|
+
logger.verbose('Delete mode - skipping inference, routing to reconciliation');
|
|
857
|
+
return 'reconciler';
|
|
858
|
+
}
|
|
859
|
+
logger.verbose('Running inference', {
|
|
860
|
+
operationMode: state.operationMode
|
|
861
|
+
});
|
|
862
|
+
return 'inference';
|
|
863
|
+
};
|
|
864
|
+
/**
|
|
865
|
+
* Determines if verification should run based on operation mode and inferred intents.
|
|
866
|
+
* Skips verification for:
|
|
867
|
+
* - Operations with no inferred intents
|
|
868
|
+
* - Can be extended to skip for update operations with no new intents
|
|
869
|
+
*/
|
|
870
|
+
const shouldRunVerification = (state) => {
|
|
871
|
+
if (state.inferredIntents.length === 0) {
|
|
872
|
+
if (state.operationMode === 'propose') {
|
|
873
|
+
logger.verbose('Propose mode with no inferred intents - exiting early');
|
|
874
|
+
return '__end__';
|
|
875
|
+
}
|
|
876
|
+
logger.verbose('No intents to verify - skipping verification, routing to reconciliation');
|
|
877
|
+
return 'reconciler';
|
|
878
|
+
}
|
|
879
|
+
if (state.operationMode === 'update') {
|
|
880
|
+
logger.verbose('Update mode with new intents - running verification');
|
|
881
|
+
return 'verification';
|
|
882
|
+
}
|
|
883
|
+
if (state.operationMode === 'create') {
|
|
884
|
+
logger.verbose('Create mode - running verification');
|
|
885
|
+
return 'verification';
|
|
886
|
+
}
|
|
887
|
+
// Default to verification for safety
|
|
888
|
+
logger.verbose('Default routing to verification');
|
|
889
|
+
return 'verification';
|
|
890
|
+
};
|
|
891
|
+
// --- GRAPH ASSEMBLY WITH CONDITIONAL EDGES (PHASE 4) ---
|
|
892
|
+
const workflow = new StateGraph(IntentGraphState)
|
|
893
|
+
.addNode("prep", prepNode)
|
|
894
|
+
.addNode("query", queryNode)
|
|
895
|
+
.addNode("inference", inferenceNode)
|
|
896
|
+
.addNode("verification", verificationNode)
|
|
897
|
+
.addNode("reconciler", reconciliationNode)
|
|
898
|
+
.addNode("executor", executorNode)
|
|
899
|
+
// Flow paths:
|
|
900
|
+
// - READ: prep → query → END (fast path, no LLM calls)
|
|
901
|
+
// - CREATE: prep → inference → verification → reconciler → executor → END
|
|
902
|
+
// - UPDATE: prep → inference → reconciliation → executor → END (skips verification if no new intents)
|
|
903
|
+
// - DELETE: prep → reconciliation → executor → END (skips inference and verification)
|
|
904
|
+
// - PROPOSE: prep → inference → verification → END (no reconciliation/execution, no DB writes)
|
|
905
|
+
.addEdge(START, "prep")
|
|
906
|
+
// After prep: read mode → query; else inference or reconciler
|
|
907
|
+
.addConditionalEdges("prep", afterPrepRoute, {
|
|
908
|
+
query: "query",
|
|
909
|
+
inference: "inference",
|
|
910
|
+
reconciler: "reconciler",
|
|
911
|
+
__end__: END,
|
|
912
|
+
})
|
|
913
|
+
// Query (read mode) always ends
|
|
914
|
+
.addEdge("query", END)
|
|
915
|
+
// After inference: decide if we need verification (skip if no intents)
|
|
916
|
+
.addConditionalEdges("inference", shouldRunVerification, {
|
|
917
|
+
verification: "verification",
|
|
918
|
+
reconciler: "reconciler",
|
|
919
|
+
__end__: END,
|
|
920
|
+
})
|
|
921
|
+
// After verification: propose mode exits early; others continue to reconciliation
|
|
922
|
+
.addConditionalEdges("verification", (state) => {
|
|
923
|
+
if (state.operationMode === 'propose') {
|
|
924
|
+
logger.verbose('Propose mode - stopping after verification, skipping reconciliation');
|
|
925
|
+
return '__end__';
|
|
926
|
+
}
|
|
927
|
+
return 'reconciler';
|
|
928
|
+
}, {
|
|
929
|
+
reconciler: "reconciler",
|
|
930
|
+
__end__: END,
|
|
931
|
+
})
|
|
932
|
+
// Reconciliation always goes to executor
|
|
933
|
+
.addEdge("reconciler", "executor")
|
|
934
|
+
// Executor is always the end
|
|
935
|
+
.addEdge("executor", END);
|
|
936
|
+
return workflow.compile();
|
|
937
|
+
}
|
|
938
|
+
}
|