@indexnetwork/protocol 21.0.0-rc.486.1 → 21.0.0-rc.488.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/dist/agents/{ports/agent.dispatcher.port.d.ts → agent.dispatcher.port.d.ts} +2 -2
- package/dist/agents/agent.module.d.ts +19 -0
- package/dist/agents/agent.module.js +11 -0
- package/dist/agents/{ports/agent.repository.port.d.ts → agent.repository.port.d.ts} +1 -1
- package/dist/agents/{application/agent.tools.d.ts → agent.tools.d.ts} +2 -2
- package/dist/agents/{application/agent.tools.js → agent.tools.js} +2 -2
- package/dist/chat/chat-streaming.types.d.ts +1 -1
- package/dist/chat/chat.agent.d.ts +1 -1
- package/dist/chat/negotiator.prompt.d.ts +1 -1
- package/dist/chat/negotiator.prompt.js +1 -1
- package/dist/contacts/contact.module.d.ts +8 -0
- package/dist/contacts/contact.module.js +6 -0
- package/dist/contacts/{ports/contact.repository.port.d.ts → contact.repository.port.d.ts} +2 -2
- package/dist/contacts/{ports/contact.repository.port.js → contact.repository.port.js} +1 -1
- package/dist/contacts/{application/contact.tools.d.ts → contact.tools.d.ts} +3 -3
- package/dist/contacts/{application/contact.tools.js → contact.tools.js} +3 -3
- package/dist/contacts/{ports/contact.tools.port.d.ts → contact.tools.port.d.ts} +2 -3
- package/dist/contacts/{ports/contact.tools.port.js → contact.tools.port.js} +2 -3
- package/dist/contacts/{domain/contact.types.d.ts → contact.types.d.ts} +2 -2
- package/dist/contacts/contact.types.js +8 -0
- package/dist/contexts/context.module.d.ts +13 -0
- package/dist/contexts/context.module.js +12 -0
- package/dist/contexts/{ports/participant-context.tools.port.d.ts → context.tools.port.d.ts} +1 -1
- package/dist/discovery/hyde.graph.d.ts +1 -1
- package/dist/discovery/hyde.state.d.ts +1 -1
- package/dist/enrichment/enrichment.graph.d.ts +1 -1
- package/dist/enrichment/enrichment.state.d.ts +1 -1
- package/dist/enrichment/enrichment.tools.context-read.d.ts +1 -1
- package/dist/enrichment/enrichment.tools.context-write.d.ts +1 -1
- package/dist/enrichment/enrichment.tools.d.ts +1 -1
- package/dist/enrichment/enrichment.tools.helpers.d.ts +1 -1
- package/dist/index.d.ts +86 -86
- package/dist/index.js +61 -61
- package/dist/intents/graph/intent.graph.d.ts +1 -1
- package/dist/intents/graph/intent.graph.infer.d.ts +1 -1
- package/dist/intents/graph/intent.graph.reconcile.d.ts +1 -1
- package/dist/intents/graph/intent.graph.shared.d.ts +1 -1
- package/dist/intents/graph/intent.graph.state.d.ts +1 -1
- package/dist/intents/intent.module.d.ts +1 -1
- package/dist/maintenance/maintenance.graph.js +3 -3
- package/dist/mcp/mcp.server.js +1 -1
- package/dist/negotiations/{application/insight.generator.js → insight.generator.js} +4 -4
- package/dist/negotiations/{application/negotiation.agent.d.ts → negotiation.agent.d.ts} +6 -6
- package/dist/negotiations/{application/negotiation.agent.js → negotiation.agent.js} +9 -9
- package/dist/negotiations/negotiation.attribution.d.ts +1 -1
- package/dist/negotiations/{application/negotiation.candidates.d.ts → negotiation.candidates.d.ts} +5 -5
- package/dist/negotiations/{application/negotiation.candidates.js → negotiation.candidates.js} +1 -1
- package/dist/negotiations/{domain/negotiation.consultation-policy.d.ts → negotiation.consultation-policy.d.ts} +2 -2
- package/dist/negotiations/{application/negotiation.detail-reader.d.ts → negotiation.detail-reader.d.ts} +5 -5
- package/dist/negotiations/{application/negotiation.detail-reader.js → negotiation.detail-reader.js} +3 -3
- package/dist/negotiations/{application/negotiation.graph.d.ts → negotiation.graph.d.ts} +81 -81
- package/dist/negotiations/{application/negotiation.graph.finalize.js → negotiation.graph.finalize.js} +4 -4
- package/dist/negotiations/{application/negotiation.graph.init.d.ts → negotiation.graph.init.d.ts} +8 -8
- package/dist/negotiations/{application/negotiation.graph.init.js → negotiation.graph.init.js} +5 -5
- package/dist/negotiations/{application/negotiation.graph.js → negotiation.graph.js} +4 -4
- package/dist/negotiations/{application/negotiation.graph.screen.d.ts → negotiation.graph.screen.d.ts} +1 -1
- package/dist/negotiations/{application/negotiation.graph.screen.js → negotiation.graph.screen.js} +2 -2
- package/dist/negotiations/{application/negotiation.graph.shared.d.ts → negotiation.graph.shared.d.ts} +13 -13
- package/dist/negotiations/{application/negotiation.graph.shared.js → negotiation.graph.shared.js} +2 -2
- package/dist/negotiations/{application/negotiation.graph.turn.d.ts → negotiation.graph.turn.d.ts} +2 -2
- package/dist/negotiations/{application/negotiation.graph.turn.js → negotiation.graph.turn.js} +6 -6
- package/dist/negotiations/{domain/negotiation.hermes-contract.d.ts → negotiation.hermes-contract.d.ts} +1 -1
- package/dist/negotiations/{domain/negotiation.lifecycle-narration.d.ts → negotiation.lifecycle-narration.d.ts} +1 -1
- package/dist/negotiations/negotiation.module.d.ts +28 -0
- package/dist/negotiations/negotiation.module.js +19 -0
- package/dist/negotiations/{domain/negotiation.protocol.d.ts → negotiation.protocol.d.ts} +1 -1
- package/dist/negotiations/{domain/negotiation.protocol.js → negotiation.protocol.js} +1 -1
- package/dist/negotiations/{domain/negotiation.question-safety.js → negotiation.question-safety.js} +1 -1
- package/dist/negotiations/{application/negotiation.reflect.d.ts → negotiation.reflect.d.ts} +3 -3
- package/dist/negotiations/{application/negotiation.reflect.js → negotiation.reflect.js} +5 -5
- package/dist/negotiations/{application/negotiation.screen.d.ts → negotiation.screen.d.ts} +8 -8
- package/dist/negotiations/{application/negotiation.screen.js → negotiation.screen.js} +7 -7
- package/dist/negotiations/{domain/negotiation.state.d.ts → negotiation.state.d.ts} +2 -2
- package/dist/negotiations/{domain/negotiation.state.js → negotiation.state.js} +1 -1
- package/dist/negotiations/{application/negotiation.summarizer.d.ts → negotiation.summarizer.d.ts} +2 -2
- package/dist/negotiations/{application/negotiation.summarizer.js → negotiation.summarizer.js} +4 -4
- package/dist/negotiations/{application/negotiation.tools.d.ts → negotiation.tools.d.ts} +3 -3
- package/dist/negotiations/{application/negotiation.tools.js → negotiation.tools.js} +9 -9
- package/dist/negotiations/{ports/negotiation.tools.port.d.ts → negotiation.tools.port.d.ts} +4 -4
- package/dist/networks/indexer.graph.d.ts +1 -1
- package/dist/networks/indexer.state.d.ts +1 -1
- package/dist/opportunities/{application/delivery-card.cache.d.ts → delivery-card.cache.d.ts} +2 -2
- package/dist/opportunities/{application/delivery-card.cache.js → delivery-card.cache.js} +2 -2
- package/dist/opportunities/discriminator/discriminator.adjustments.d.ts +1 -1
- package/dist/opportunities/discriminator/discriminator.push.d.ts +1 -1
- package/dist/opportunities/discriminator/discriminator.question.d.ts +1 -1
- package/dist/opportunities/{application/negotiation-context.loader.d.ts → negotiation-context.loader.d.ts} +2 -2
- package/dist/opportunities/{application/negotiation-context.loader.js → negotiation-context.loader.js} +1 -1
- package/dist/opportunities/{domain/negotiation-summary.builder.d.ts → negotiation-summary.builder.d.ts} +2 -2
- package/dist/opportunities/{domain/opportunity.actor.d.ts → opportunity.actor.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.discovery-negotiation-summary.d.ts → opportunity.discovery-negotiation-summary.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.discovery-negotiation-summary.js → opportunity.discovery-negotiation-summary.js} +3 -3
- package/dist/opportunities/{application/opportunity.enricher.d.ts → opportunity.enricher.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.enricher.js → opportunity.enricher.js} +2 -2
- package/dist/opportunities/{application/opportunity.evaluator.d.ts → opportunity.evaluator.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.evaluator.js → opportunity.evaluator.js} +7 -7
- package/dist/opportunities/{domain/opportunity.evidence.d.ts → opportunity.evidence.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.existing-negotiation.d.ts → opportunity.existing-negotiation.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.existing-negotiation.js → opportunity.existing-negotiation.js} +1 -1
- package/dist/opportunities/{application/opportunity.feed-selection.d.ts → opportunity.feed-selection.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.feed-selection.js → opportunity.feed-selection.js} +1 -1
- package/dist/opportunities/{application/opportunity.graph.d.ts → opportunity.graph.d.ts} +130 -130
- package/dist/opportunities/{application/opportunity.graph.discovery-strategies.d.ts → opportunity.graph.discovery-strategies.d.ts} +5 -5
- package/dist/opportunities/{application/opportunity.graph.discovery-strategies.js → opportunity.graph.discovery-strategies.js} +5 -5
- package/dist/opportunities/{application/opportunity.graph.discovery.d.ts → opportunity.graph.discovery.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.graph.discovery.js → opportunity.graph.discovery.js} +6 -6
- package/dist/opportunities/{application/opportunity.graph.evaluation.d.ts → opportunity.graph.evaluation.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.graph.evaluation.js → opportunity.graph.evaluation.js} +8 -8
- package/dist/opportunities/{application/opportunity.graph.js → opportunity.graph.js} +13 -13
- package/dist/opportunities/{application/opportunity.graph.modes.d.ts → opportunity.graph.modes.d.ts} +37 -37
- package/dist/opportunities/{application/opportunity.graph.modes.js → opportunity.graph.modes.js} +9 -9
- package/dist/opportunities/{application/opportunity.graph.negotiate.d.ts → opportunity.graph.negotiate.d.ts} +4 -4
- package/dist/opportunities/{application/opportunity.graph.negotiate.js → opportunity.graph.negotiate.js} +6 -6
- package/dist/opportunities/{application/opportunity.graph.persist-node.d.ts → opportunity.graph.persist-node.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.graph.persist-node.js → opportunity.graph.persist-node.js} +9 -9
- package/dist/opportunities/{application/opportunity.graph.prep.d.ts → opportunity.graph.prep.d.ts} +4 -4
- package/dist/opportunities/{application/opportunity.graph.prep.js → opportunity.graph.prep.js} +6 -6
- package/dist/opportunities/{application/opportunity.graph.shared.d.ts → opportunity.graph.shared.d.ts} +28 -28
- package/dist/opportunities/{application/opportunity.graph.shared.js → opportunity.graph.shared.js} +4 -4
- package/dist/opportunities/{application/opportunity.introducer.js → opportunity.introducer.js} +1 -1
- package/dist/opportunities/{application/opportunity.lifecycle.d.ts → opportunity.lifecycle.d.ts} +1 -1
- package/dist/opportunities/{index.d.ts → opportunity.module.d.ts} +24 -24
- package/dist/opportunities/{index.js → opportunity.module.js} +16 -16
- package/dist/opportunities/{application/opportunity.newborn-stamping.d.ts → opportunity.newborn-stamping.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.owner-provenance.d.ts → opportunity.owner-provenance.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.pending-questions.d.ts → opportunity.pending-questions.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.pending-questions.js → opportunity.pending-questions.js} +1 -1
- package/dist/opportunities/{application/opportunity.persist.d.ts → opportunity.persist.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.persist.js → opportunity.persist.js} +3 -3
- package/dist/opportunities/{application/opportunity.persistence-admission.d.ts → opportunity.persistence-admission.d.ts} +1 -1
- package/dist/opportunities/{application/opportunity.presentation.d.ts → opportunity.presentation.d.ts} +3 -3
- package/dist/opportunities/{application/opportunity.presentation.js → opportunity.presentation.js} +6 -6
- package/dist/opportunities/{domain/opportunity.state.d.ts → opportunity.state.d.ts} +6 -6
- package/dist/opportunities/{application/opportunity.tools.cards.d.ts → opportunity.tools.cards.d.ts} +4 -4
- package/dist/opportunities/{application/opportunity.tools.cards.js → opportunity.tools.cards.js} +2 -2
- package/dist/opportunities/{application/opportunity.tools.d.ts → opportunity.tools.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.tools.js → opportunity.tools.js} +7 -7
- package/dist/opportunities/{application/opportunity.tools.list.d.ts → opportunity.tools.list.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.tools.list.js → opportunity.tools.list.js} +4 -4
- package/dist/opportunities/{ports/opportunity.tools.port.d.ts → opportunity.tools.port.d.ts} +2 -2
- package/dist/opportunities/{application/opportunity.update-admission.d.ts → opportunity.update-admission.d.ts} +1 -1
- package/dist/opportunities/{domain/opportunity.utils.d.ts → opportunity.utils.d.ts} +3 -3
- package/dist/opportunities/{domain/opportunity.utils.js → opportunity.utils.js} +3 -3
- package/dist/opportunities/radar/radar.graph.d.ts +2 -2
- package/dist/opportunities/radar/radar.graph.js +6 -6
- package/dist/opportunities/radar/radar.health.js +1 -1
- package/dist/opportunities/radar/radar.state.d.ts +1 -1
- package/dist/premises/premise.graph.d.ts +1 -1
- package/dist/premises/premise.state.d.ts +1 -1
- package/dist/premises/premise.tools.d.ts +1 -1
- package/dist/questions/question.input.d.ts +1 -1
- package/dist/questions/question.input.js +1 -1
- package/dist/questions/question.presets.js +1 -1
- package/dist/shared/agent/tool.factory.d.ts +1 -1
- package/dist/shared/agent/tool.factory.js +9 -9
- package/dist/shared/agent/tool.helpers.d.ts +4 -4
- package/dist/shared/agent/tool.registry.d.ts +1 -1
- package/dist/shared/agent/tool.registry.js +5 -5
- package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +1 -1
- package/package.json +1 -1
- package/dist/agents/application/index.d.ts +0 -23
- package/dist/agents/application/index.js +0 -24
- package/dist/agents/domain/index.d.ts +0 -19
- package/dist/agents/domain/index.js +0 -1
- package/dist/agents/index.d.ts +0 -21
- package/dist/agents/index.js +0 -11
- package/dist/agents/ports/index.d.ts +0 -27
- package/dist/agents/ports/index.js +0 -25
- package/dist/contacts/application/index.d.ts +0 -10
- package/dist/contacts/application/index.js +0 -10
- package/dist/contacts/domain/contact.types.js +0 -8
- package/dist/contacts/domain/index.d.ts +0 -12
- package/dist/contacts/index.d.ts +0 -9
- package/dist/contacts/index.js +0 -8
- package/dist/contacts/ports/index.d.ts +0 -19
- package/dist/contacts/ports/index.js +0 -18
- package/dist/contexts/application/index.d.ts +0 -72
- package/dist/contexts/application/index.js +0 -82
- package/dist/contexts/domain/index.d.ts +0 -67
- package/dist/contexts/domain/index.js +0 -68
- package/dist/contexts/index.d.ts +0 -13
- package/dist/contexts/index.js +0 -12
- package/dist/contexts/ports/index.d.ts +0 -37
- package/dist/contexts/ports/index.js +0 -34
- package/dist/contexts/ports/participant-context.tools.port.js +0 -1
- package/dist/negotiations/application/index.d.ts +0 -48
- package/dist/negotiations/application/index.js +0 -49
- package/dist/negotiations/domain/index.d.ts +0 -56
- package/dist/negotiations/domain/index.js +0 -57
- package/dist/negotiations/index.d.ts +0 -12
- package/dist/negotiations/index.js +0 -9
- package/dist/negotiations/ports/index.d.ts +0 -16
- package/dist/negotiations/ports/index.js +0 -16
- package/dist/opportunities/application/index.d.ts +0 -59
- package/dist/opportunities/application/index.js +0 -64
- package/dist/opportunities/domain/index.d.ts +0 -51
- package/dist/opportunities/domain/index.js +0 -48
- package/dist/opportunities/ports/index.d.ts +0 -5
- package/dist/opportunities/ports/index.js +0 -1
- /package/dist/agents/{ports/agent.dispatcher.port.js → agent.dispatcher.port.js} +0 -0
- /package/dist/agents/{ports/agent.repository.port.js → agent.repository.port.js} +0 -0
- /package/dist/agents/{ports/agent.tools.port.d.ts → agent.tools.port.d.ts} +0 -0
- /package/dist/agents/{ports/agent.tools.port.js → agent.tools.port.js} +0 -0
- /package/dist/agents/{domain/agent.types.d.ts → agent.types.d.ts} +0 -0
- /package/dist/agents/{domain/agent.types.js → agent.types.js} +0 -0
- /package/dist/{contacts/domain/index.js → contexts/context.tools.port.js} +0 -0
- /package/dist/negotiations/{application/insight.generator.d.ts → insight.generator.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.consultation-policy.js → negotiation.consultation-policy.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.deadlock.contracts.d.ts → negotiation.deadlock.contracts.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.deadlock.contracts.js → negotiation.deadlock.contracts.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.deadlock.d.ts → negotiation.deadlock.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.deadlock.js → negotiation.deadlock.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.expected-speaker.d.ts → negotiation.expected-speaker.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.expected-speaker.js → negotiation.expected-speaker.js} +0 -0
- /package/dist/negotiations/{application/negotiation.graph.finalize.d.ts → negotiation.graph.finalize.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.hermes-contract.js → negotiation.hermes-contract.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.intent-snapshot-provenance.d.ts → negotiation.intent-snapshot-provenance.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.intent-snapshot-provenance.js → negotiation.intent-snapshot-provenance.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.lifecycle-narration.js → negotiation.lifecycle-narration.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.memory.d.ts → negotiation.memory.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.memory.js → negotiation.memory.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.question-safety.d.ts → negotiation.question-safety.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.screen.contracts.d.ts → negotiation.screen.contracts.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.screen.contracts.js → negotiation.screen.contracts.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.stance.contracts.d.ts → negotiation.stance.contracts.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.stance.contracts.js → negotiation.stance.contracts.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.task-lock-policy.d.ts → negotiation.task-lock-policy.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.task-lock-policy.js → negotiation.task-lock-policy.js} +0 -0
- /package/dist/negotiations/{ports/negotiation.tools.port.js → negotiation.tools.port.js} +0 -0
- /package/dist/negotiations/{domain/negotiation.turn-cap.d.ts → negotiation.turn-cap.d.ts} +0 -0
- /package/dist/negotiations/{domain/negotiation.turn-cap.js → negotiation.turn-cap.js} +0 -0
- /package/dist/opportunities/{domain/negotiation-summary.builder.js → negotiation-summary.builder.js} +0 -0
- /package/dist/opportunities/{domain/opportunity.actor.js → opportunity.actor.js} +0 -0
- /package/dist/opportunities/{domain/opportunity.evidence.js → opportunity.evidence.js} +0 -0
- /package/dist/opportunities/{application/opportunity.introducer-feature.d.ts → opportunity.introducer-feature.d.ts} +0 -0
- /package/dist/opportunities/{application/opportunity.introducer-feature.js → opportunity.introducer-feature.js} +0 -0
- /package/dist/opportunities/{application/opportunity.introducer.d.ts → opportunity.introducer.d.ts} +0 -0
- /package/dist/opportunities/{domain/opportunity.labels.d.ts → opportunity.labels.d.ts} +0 -0
- /package/dist/opportunities/{domain/opportunity.labels.js → opportunity.labels.js} +0 -0
- /package/dist/opportunities/{application/opportunity.lifecycle.js → opportunity.lifecycle.js} +0 -0
- /package/dist/opportunities/{application/opportunity.newborn-stamping.js → opportunity.newborn-stamping.js} +0 -0
- /package/dist/opportunities/{application/opportunity.owner-approval.d.ts → opportunity.owner-approval.d.ts} +0 -0
- /package/dist/opportunities/{application/opportunity.owner-approval.js → opportunity.owner-approval.js} +0 -0
- /package/dist/opportunities/{application/opportunity.owner-provenance.js → opportunity.owner-provenance.js} +0 -0
- /package/dist/opportunities/{application/opportunity.persistence-admission.js → opportunity.persistence-admission.js} +0 -0
- /package/dist/opportunities/{domain/opportunity.state.js → opportunity.state.js} +0 -0
- /package/dist/opportunities/{ports/opportunity.tools.port.js → opportunity.tools.port.js} +0 -0
- /package/dist/opportunities/{application/opportunity.update-admission.js → opportunity.update-admission.js} +0 -0
- /package/dist/questions/{index.d.ts → question.module.d.ts} +0 -0
- /package/dist/questions/{index.js → question.module.js} +0 -0
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* locals. They now take an explicit {@link DiscoveryStrategyContext} so each
|
|
7
7
|
* strategy reads on its own.
|
|
8
8
|
*/
|
|
9
|
-
import type { Id } from '
|
|
10
|
-
import type { CandidateMatch } from '
|
|
11
|
-
import type { LensEmbedding } from '
|
|
12
|
-
import { discoveryProfileSource } from '
|
|
13
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
9
|
+
import type { Id } from '../shared/interfaces/database.interface.js';
|
|
10
|
+
import type { CandidateMatch } from './opportunity.state.js';
|
|
11
|
+
import type { LensEmbedding } from '../shared/interfaces/embedder.interface.js';
|
|
12
|
+
import { discoveryProfileSource } from './discovery.env.js';
|
|
13
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
14
14
|
/** Corpus gating passed through to the embedder on every HyDE search. */
|
|
15
15
|
export interface DiscoveryCorpusGating {
|
|
16
16
|
readonly intents: boolean;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* locals. They now take an explicit {@link DiscoveryStrategyContext} so each
|
|
7
7
|
* strategy reads on its own.
|
|
8
8
|
*/
|
|
9
|
-
import { getModelName } from '
|
|
10
|
-
import { selectHydeDocumentsForGeneration, getHydeGenerationMode } from '
|
|
11
|
-
import { mergeOpportunityEvidence, withCandidateEvidence, withMatchedStrategies } from '
|
|
12
|
-
import { discoveryProfileMatchingEnabled, discoveryProfileSource, discoveryIntentMatchingEnabled } from '
|
|
13
|
-
import { buildDiscovererContext, discoveryLog, getSourcePremiseDiscoveryLimit, PREMISE_MATCH_LIMIT_PER_SOURCE } from
|
|
9
|
+
import { getModelName } from '../shared/agent/model.config.js';
|
|
10
|
+
import { selectHydeDocumentsForGeneration, getHydeGenerationMode } from '../discovery/index.js';
|
|
11
|
+
import { mergeOpportunityEvidence, withCandidateEvidence, withMatchedStrategies } from './opportunity.evidence.js';
|
|
12
|
+
import { discoveryProfileMatchingEnabled, discoveryProfileSource, discoveryIntentMatchingEnabled } from './discovery.env.js';
|
|
13
|
+
import { buildDiscovererContext, discoveryLog, getSourcePremiseDiscoveryLimit, PREMISE_MATCH_LIMIT_PER_SOURCE } from "./opportunity.graph.shared.js";
|
|
14
14
|
/**
|
|
15
15
|
* Query-driven HyDE retrieval: generate hypothetical documents from the search
|
|
16
16
|
* text, then search every target network with the resulting lens embeddings.
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* context-sourced path, and the intent/query HyDE path. The retrieval
|
|
6
6
|
* strategies themselves live in `opportunity.graph.discovery-strategies.ts`.
|
|
7
7
|
*/
|
|
8
|
-
import type { Id } from '
|
|
9
|
-
import type { CandidateMatch } from '
|
|
10
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
8
|
+
import type { Id } from '../shared/interfaces/database.interface.js';
|
|
9
|
+
import type { CandidateMatch } from './opportunity.state.js';
|
|
10
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
11
11
|
/** Trace entries accumulate in the order the frontend renders them. */
|
|
12
12
|
type TraceEntry = {
|
|
13
13
|
node: string;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* context-sourced path, and the intent/query HyDE path. The retrieval
|
|
6
6
|
* strategies themselves live in `opportunity.graph.discovery-strategies.ts`.
|
|
7
7
|
*/
|
|
8
|
-
import { getModelName } from '
|
|
9
|
-
import { timed } from '
|
|
10
|
-
import { withCandidateEvidence } from '
|
|
11
|
-
import { discoveryIntentMatchingEnabled, discoveryProfileMatchingEnabled, discoveryProfileSource } from '
|
|
12
|
-
import { buildDiscovererContext, discoveryLog } from
|
|
13
|
-
import { auxiliaryStrategyTraces, collectHydeResults, computeLensStats, mergeStrategyCandidates, runAuxiliaryStrategies, runQueryHydeDiscovery, toLensEmbeddings } from
|
|
8
|
+
import { getModelName } from '../shared/agent/model.config.js';
|
|
9
|
+
import { timed } from '../shared/observability/performance.js';
|
|
10
|
+
import { withCandidateEvidence } from './opportunity.evidence.js';
|
|
11
|
+
import { discoveryIntentMatchingEnabled, discoveryProfileMatchingEnabled, discoveryProfileSource } from './discovery.env.js';
|
|
12
|
+
import { buildDiscovererContext, discoveryLog } from "./opportunity.graph.shared.js";
|
|
13
|
+
import { auxiliaryStrategyTraces, collectHydeResults, computeLensStats, mergeStrategyCandidates, runAuxiliaryStrategies, runQueryHydeDiscovery, toLensEmbeddings } from "./opportunity.graph.discovery-strategies.js";
|
|
14
14
|
// Search limits - fixed values for candidate retrieval
|
|
15
15
|
// (The options.limit controls final output, not search pool)
|
|
16
16
|
const LIMIT_PER_STRATEGY = 30;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Evaluation builds an entity bundle from the discoverer plus the top candidates,
|
|
5
5
|
* asks the evaluator to score them, and maps the verdicts back onto graph state.
|
|
6
6
|
*/
|
|
7
|
-
import type { DebugMetaAgent } from '
|
|
8
|
-
import type { CandidateMatch, EvaluatedOpportunity } from '
|
|
9
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
7
|
+
import type { DebugMetaAgent } from '../agents/agent.module.js';
|
|
8
|
+
import type { CandidateMatch, EvaluatedOpportunity } from './opportunity.state.js';
|
|
9
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
10
10
|
/**
|
|
11
11
|
* Node 3: Evaluation (Entity bundle)
|
|
12
12
|
* Builds entity bundle from source + candidates, invokes entity-bundle evaluator, maps to EvaluatedOpportunity with networkId from entities.
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* Evaluation builds an entity bundle from the discoverer plus the top candidates,
|
|
5
5
|
* asks the evaluator to score them, and maps the verdicts back onto graph state.
|
|
6
6
|
*/
|
|
7
|
-
import { OpportunityEvaluator } from
|
|
8
|
-
import { getModelName } from '
|
|
9
|
-
import { timed } from '
|
|
10
|
-
import { requestContext } from '
|
|
11
|
-
import { getAbortSignalConfig } from '
|
|
12
|
-
import { mergeOpportunityEvidence } from '
|
|
13
|
-
import { DISCOVERY_EVALUATOR_MIN_SCORE_DEFAULT } from '
|
|
14
|
-
import { buildEvaluatorEvidenceKey, buildNetworkContexts, evaluationLog, getRejectionCooldownMs, networkMembershipPairKey, rankingLog, REJECTION_COOLDOWN_SIMILARITY_PENALTY, safeOpportunityGraphError } from
|
|
7
|
+
import { OpportunityEvaluator } from "./opportunity.evaluator.js";
|
|
8
|
+
import { getModelName } from '../shared/agent/model.config.js';
|
|
9
|
+
import { timed } from '../shared/observability/performance.js';
|
|
10
|
+
import { requestContext } from '../shared/observability/request-context.js';
|
|
11
|
+
import { getAbortSignalConfig } from '../shared/agent/model-signal.js';
|
|
12
|
+
import { mergeOpportunityEvidence } from './opportunity.evidence.js';
|
|
13
|
+
import { DISCOVERY_EVALUATOR_MIN_SCORE_DEFAULT } from './discovery.env.js';
|
|
14
|
+
import { buildEvaluatorEvidenceKey, buildNetworkContexts, evaluationLog, getRejectionCooldownMs, networkMembershipPairKey, rankingLog, REJECTION_COOLDOWN_SIMILARITY_PENALTY, safeOpportunityGraphError } from "./opportunity.graph.shared.js";
|
|
15
15
|
/** Batch size for one evaluator call. Larger batches time out. */
|
|
16
16
|
const EVAL_BATCH_SIZE = 25;
|
|
17
17
|
/**
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
* Constructor injects Database, Embedder, and compiled HyDE graph.
|
|
20
20
|
*/
|
|
21
21
|
import { StateGraph, START, END } from '@langchain/langgraph';
|
|
22
|
-
import { OpportunityGraphState } from '
|
|
23
|
-
import { OpportunityEvaluator } from
|
|
24
|
-
import { discoveryEvaluatorMinScore, discoveryMinSimilarity, validateDiscoveryEvaluatorMinScore, validateDiscoveryMinSimilarity } from '
|
|
25
|
-
import { routingLog, withNodeTrace } from
|
|
26
|
-
import { prepNode, prepTraceSummary, resolveNode, resolveTraceSummary, scopeNode, scopeTraceSummary } from
|
|
27
|
-
import { discoveryNode, discoveryTraceSummary } from
|
|
28
|
-
import { evaluationNode, rankingNode, rankingTraceSummary } from
|
|
29
|
-
import { persistNode, persistTraceSummary } from
|
|
30
|
-
import { negotiateNode } from
|
|
31
|
-
export { buildPrioritizedNegotiationIntents } from
|
|
32
|
-
export { buildDiscovererContext, safeOpportunityGraphError, } from
|
|
33
|
-
import { approveIntroduction, createIntroduction, deleteOpportunity, negotiateExisting, readOpportunities, sendOpportunity, updateOpportunityStatus } from
|
|
34
|
-
export { approveIntroduction, createIntroduction, deleteOpportunity, evaluateIntroduction, negotiateExisting, readOpportunities, sendOpportunity, updateOpportunityStatus, validateIntroduction, } from
|
|
22
|
+
import { OpportunityGraphState } from './opportunity.state.js';
|
|
23
|
+
import { OpportunityEvaluator } from "./opportunity.evaluator.js";
|
|
24
|
+
import { discoveryEvaluatorMinScore, discoveryMinSimilarity, validateDiscoveryEvaluatorMinScore, validateDiscoveryMinSimilarity } from './discovery.env.js';
|
|
25
|
+
import { routingLog, withNodeTrace } from "./opportunity.graph.shared.js";
|
|
26
|
+
import { prepNode, prepTraceSummary, resolveNode, resolveTraceSummary, scopeNode, scopeTraceSummary } from "./opportunity.graph.prep.js";
|
|
27
|
+
import { discoveryNode, discoveryTraceSummary } from "./opportunity.graph.discovery.js";
|
|
28
|
+
import { evaluationNode, rankingNode, rankingTraceSummary } from "./opportunity.graph.evaluation.js";
|
|
29
|
+
import { persistNode, persistTraceSummary } from "./opportunity.graph.persist-node.js";
|
|
30
|
+
import { negotiateNode } from "./opportunity.graph.negotiate.js";
|
|
31
|
+
export { buildPrioritizedNegotiationIntents } from "./opportunity.existing-negotiation.js";
|
|
32
|
+
export { buildDiscovererContext, safeOpportunityGraphError, } from "./opportunity.graph.shared.js";
|
|
33
|
+
import { approveIntroduction, createIntroduction, deleteOpportunity, negotiateExisting, readOpportunities, sendOpportunity, updateOpportunityStatus } from "./opportunity.graph.modes.js";
|
|
34
|
+
export { approveIntroduction, createIntroduction, deleteOpportunity, evaluateIntroduction, negotiateExisting, readOpportunities, sendOpportunity, updateOpportunityStatus, validateIntroduction, } from "./opportunity.graph.modes.js";
|
|
35
35
|
/**
|
|
36
36
|
* Factory class to build and compile the Opportunity Graph.
|
|
37
37
|
* Uses dependency injection for testability.
|
package/dist/opportunities/{application/opportunity.graph.modes.d.ts → opportunity.graph.modes.d.ts}
RENAMED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* Each returns the same shape the corresponding node returned, so callers read
|
|
10
10
|
* `readResult` / `mutationResult` exactly as before.
|
|
11
11
|
*/
|
|
12
|
-
import type { Id, NegotiationContinuationReceipt } from '
|
|
13
|
-
import type { DebugMetaAgent } from '
|
|
14
|
-
import type { EvaluatedOpportunity, EvaluatedOpportunityActor } from '
|
|
15
|
-
import type { EvaluatorEntity } from
|
|
16
|
-
import type { OpportunityMutationResult } from
|
|
17
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
12
|
+
import type { Id, NegotiationContinuationReceipt } from '../shared/interfaces/database.interface.js';
|
|
13
|
+
import type { DebugMetaAgent } from '../agents/agent.module.js';
|
|
14
|
+
import type { EvaluatedOpportunity, EvaluatedOpportunityActor } from './opportunity.state.js';
|
|
15
|
+
import type { EvaluatorEntity } from "./opportunity.evaluator.js";
|
|
16
|
+
import type { OpportunityMutationResult } from "./opportunity.lifecycle.js";
|
|
17
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
18
18
|
/** Identifies the caller and the opportunity every mutation mode acts on. */
|
|
19
19
|
export interface OpportunityMutationRequest {
|
|
20
20
|
userId: Id<'users'>;
|
|
@@ -41,7 +41,7 @@ export declare function readOpportunities(deps: Pick<OpportunityGraphDeps, 'data
|
|
|
41
41
|
connectedWith: string[];
|
|
42
42
|
suggestedBy: string | null;
|
|
43
43
|
reasoning: string;
|
|
44
|
-
status: import("
|
|
44
|
+
status: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
45
45
|
category: string;
|
|
46
46
|
confidence: number | null;
|
|
47
47
|
source: string | null;
|
|
@@ -127,12 +127,12 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
127
127
|
introductionContext?: undefined;
|
|
128
128
|
options?: undefined;
|
|
129
129
|
} | {
|
|
130
|
-
opportunities: import("
|
|
130
|
+
opportunities: import("../shared/interfaces/database.entities.js").Opportunity[];
|
|
131
131
|
existingBetweenActors: {
|
|
132
132
|
candidateUserId: Id<"users">;
|
|
133
133
|
networkId: Id<"networks">;
|
|
134
134
|
existingOpportunityId?: Id<"opportunities">;
|
|
135
|
-
existingStatus?: import("
|
|
135
|
+
existingStatus?: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
136
136
|
reason?: "same_trigger_recent_duplicate" | "pair_active_negotiation" | "final_atomic_conflict";
|
|
137
137
|
existingTriggerIntentId?: string;
|
|
138
138
|
}[];
|
|
@@ -205,12 +205,12 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
205
205
|
introductionContext?: undefined;
|
|
206
206
|
options?: undefined;
|
|
207
207
|
} | {
|
|
208
|
-
opportunities: import("
|
|
208
|
+
opportunities: import("../shared/interfaces/database.entities.js").Opportunity[];
|
|
209
209
|
existingBetweenActors: {
|
|
210
210
|
candidateUserId: Id<"users">;
|
|
211
211
|
networkId: Id<"networks">;
|
|
212
212
|
existingOpportunityId?: Id<"opportunities">;
|
|
213
|
-
existingStatus?: import("
|
|
213
|
+
existingStatus?: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
214
214
|
reason?: "same_trigger_recent_duplicate" | "pair_active_negotiation" | "final_atomic_conflict";
|
|
215
215
|
existingTriggerIntentId?: string;
|
|
216
216
|
}[];
|
|
@@ -277,10 +277,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
277
277
|
createdByName: string | undefined;
|
|
278
278
|
};
|
|
279
279
|
options: {
|
|
280
|
-
initialStatus: import("
|
|
281
|
-
negotiationContinuation?: import("
|
|
280
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
281
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
282
282
|
limit?: number;
|
|
283
|
-
lenses?: import("
|
|
283
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
284
284
|
hydeDescription?: string;
|
|
285
285
|
existingOpportunities?: string;
|
|
286
286
|
conversationId?: string;
|
|
@@ -308,10 +308,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
308
308
|
createdByName: string | undefined;
|
|
309
309
|
};
|
|
310
310
|
options: {
|
|
311
|
-
initialStatus: import("
|
|
312
|
-
negotiationContinuation?: import("
|
|
311
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
312
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
313
313
|
limit?: number;
|
|
314
|
-
lenses?: import("
|
|
314
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
315
315
|
hydeDescription?: string;
|
|
316
316
|
existingOpportunities?: string;
|
|
317
317
|
conversationId?: string;
|
|
@@ -319,12 +319,12 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
319
319
|
};
|
|
320
320
|
agentTimings: DebugMetaAgent[];
|
|
321
321
|
} | {
|
|
322
|
-
opportunities: import("
|
|
322
|
+
opportunities: import("../shared/interfaces/database.entities.js").Opportunity[];
|
|
323
323
|
existingBetweenActors: {
|
|
324
324
|
candidateUserId: Id<"users">;
|
|
325
325
|
networkId: Id<"networks">;
|
|
326
326
|
existingOpportunityId?: Id<"opportunities">;
|
|
327
|
-
existingStatus?: import("
|
|
327
|
+
existingStatus?: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
328
328
|
reason?: "same_trigger_recent_duplicate" | "pair_active_negotiation" | "final_atomic_conflict";
|
|
329
329
|
existingTriggerIntentId?: string;
|
|
330
330
|
}[];
|
|
@@ -367,10 +367,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
367
367
|
createdByName: string | undefined;
|
|
368
368
|
};
|
|
369
369
|
options: {
|
|
370
|
-
initialStatus: import("
|
|
371
|
-
negotiationContinuation?: import("
|
|
370
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
371
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
372
372
|
limit?: number;
|
|
373
|
-
lenses?: import("
|
|
373
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
374
374
|
hydeDescription?: string;
|
|
375
375
|
existingOpportunities?: string;
|
|
376
376
|
conversationId?: string;
|
|
@@ -398,10 +398,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
398
398
|
createdByName: string | undefined;
|
|
399
399
|
};
|
|
400
400
|
options: {
|
|
401
|
-
initialStatus: import("
|
|
402
|
-
negotiationContinuation?: import("
|
|
401
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
402
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
403
403
|
limit?: number;
|
|
404
|
-
lenses?: import("
|
|
404
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
405
405
|
hydeDescription?: string;
|
|
406
406
|
existingOpportunities?: string;
|
|
407
407
|
conversationId?: string;
|
|
@@ -427,10 +427,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
427
427
|
createdByName: string | undefined;
|
|
428
428
|
};
|
|
429
429
|
options: {
|
|
430
|
-
initialStatus: import("
|
|
431
|
-
negotiationContinuation?: import("
|
|
430
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
431
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
432
432
|
limit?: number;
|
|
433
|
-
lenses?: import("
|
|
433
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
434
434
|
hydeDescription?: string;
|
|
435
435
|
existingOpportunities?: string;
|
|
436
436
|
conversationId?: string;
|
|
@@ -448,10 +448,10 @@ export declare function createIntroduction(deps: OpportunityGraphDeps, request:
|
|
|
448
448
|
createdByName: string | undefined;
|
|
449
449
|
};
|
|
450
450
|
options: {
|
|
451
|
-
initialStatus: import("
|
|
452
|
-
negotiationContinuation?: import("
|
|
451
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
452
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
453
453
|
limit?: number;
|
|
454
|
-
lenses?: import("
|
|
454
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
455
455
|
hydeDescription?: string;
|
|
456
456
|
existingOpportunities?: string;
|
|
457
457
|
conversationId?: string;
|
|
@@ -499,10 +499,10 @@ export declare function evaluateIntroduction(deps: Pick<OpportunityGraphDeps, 'd
|
|
|
499
499
|
createdByName: string | undefined;
|
|
500
500
|
};
|
|
501
501
|
options: {
|
|
502
|
-
initialStatus: import("
|
|
503
|
-
negotiationContinuation?: import("
|
|
502
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
503
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
504
504
|
limit?: number;
|
|
505
|
-
lenses?: import("
|
|
505
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
506
506
|
hydeDescription?: string;
|
|
507
507
|
existingOpportunities?: string;
|
|
508
508
|
conversationId?: string;
|
|
@@ -523,10 +523,10 @@ export declare function evaluateIntroduction(deps: Pick<OpportunityGraphDeps, 'd
|
|
|
523
523
|
createdByName: string | undefined;
|
|
524
524
|
};
|
|
525
525
|
options: {
|
|
526
|
-
initialStatus: import("
|
|
527
|
-
negotiationContinuation?: import("
|
|
526
|
+
initialStatus: import("../shared/interfaces/database.entities.js").OpportunityStatus;
|
|
527
|
+
negotiationContinuation?: import("../shared/interfaces/database.negotiation.js").NegotiationContinuationExecution;
|
|
528
528
|
limit?: number;
|
|
529
|
-
lenses?: import("
|
|
529
|
+
lenses?: import("../discovery/lens.inferrer.js").Lens[];
|
|
530
530
|
hydeDescription?: string;
|
|
531
531
|
existingOpportunities?: string;
|
|
532
532
|
conversationId?: string;
|
package/dist/opportunities/{application/opportunity.graph.modes.js → opportunity.graph.modes.js}
RENAMED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
* Each returns the same shape the corresponding node returned, so callers read
|
|
10
10
|
* `readResult` / `mutationResult` exactly as before.
|
|
11
11
|
*/
|
|
12
|
-
import { timed } from '
|
|
13
|
-
import { requestContext } from '
|
|
14
|
-
import { getAbortSignalConfig } from '
|
|
15
|
-
import { safeFallbackSummary } from
|
|
16
|
-
import { AMBIENT_PARK_WINDOW_MS, negotiateCandidates } from '
|
|
17
|
-
import { approveOpportunityIntroduction, deleteOpportunityLifecycle, sendOpportunityLifecycle, updateOpportunityLifecycle } from
|
|
18
|
-
import { negotiateExistingOpportunity } from
|
|
19
|
-
import { buildNetworkContexts, deleteLog, introEvaluationLog, introValidationLog, negotiateExistingLog, readLog, sendLog, updateLog } from
|
|
20
|
-
import { persistNode } from
|
|
12
|
+
import { timed } from '../shared/observability/performance.js';
|
|
13
|
+
import { requestContext } from '../shared/observability/request-context.js';
|
|
14
|
+
import { getAbortSignalConfig } from '../shared/agent/model-signal.js';
|
|
15
|
+
import { safeFallbackSummary } from "./opportunity.presentation.js";
|
|
16
|
+
import { AMBIENT_PARK_WINDOW_MS, negotiateCandidates } from '../negotiations/negotiation.module.js';
|
|
17
|
+
import { approveOpportunityIntroduction, deleteOpportunityLifecycle, sendOpportunityLifecycle, updateOpportunityLifecycle } from "./opportunity.lifecycle.js";
|
|
18
|
+
import { negotiateExistingOpportunity } from "./opportunity.existing-negotiation.js";
|
|
19
|
+
import { buildNetworkContexts, deleteLog, introEvaluationLog, introValidationLog, negotiateExistingLog, readLog, sendLog, updateLog } from "./opportunity.graph.shared.js";
|
|
20
|
+
import { persistNode } from "./opportunity.graph.persist-node.js";
|
|
21
21
|
/**
|
|
22
22
|
* Read mode: list opportunities for the user, optionally filtered by networkId.
|
|
23
23
|
* Fast path — no LLM calls.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* timeout/turn_cap → 'stalled'
|
|
9
9
|
* Status updates land in the DB; in-memory state.opportunities is not mutated.
|
|
10
10
|
*/
|
|
11
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
11
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
12
12
|
/**
|
|
13
13
|
* Node 3b: Negotiate (post-persist)
|
|
14
14
|
*/
|
|
@@ -49,7 +49,7 @@ export declare function negotiateNode(state: OpportunityState, deps: Opportunity
|
|
|
49
49
|
}[];
|
|
50
50
|
seedAssessmentScore?: number | undefined;
|
|
51
51
|
}[];
|
|
52
|
-
discoverySummary: import("
|
|
52
|
+
discoverySummary: import("../shared/schemas/discovery-question.schema.js").DiscoverySummary;
|
|
53
53
|
} | {
|
|
54
54
|
trace: ({
|
|
55
55
|
node: string;
|
|
@@ -94,7 +94,7 @@ export declare function negotiateNode(state: OpportunityState, deps: Opportunity
|
|
|
94
94
|
}[];
|
|
95
95
|
seedAssessmentScore?: number | undefined;
|
|
96
96
|
}[];
|
|
97
|
-
discoverySummary: import("
|
|
97
|
+
discoverySummary: import("../shared/schemas/discovery-question.schema.js").DiscoverySummary;
|
|
98
98
|
} | {
|
|
99
99
|
trace: {
|
|
100
100
|
node: string;
|
|
@@ -105,5 +105,5 @@ export declare function negotiateNode(state: OpportunityState, deps: Opportunity
|
|
|
105
105
|
};
|
|
106
106
|
}[];
|
|
107
107
|
discoveryNegotiations: never[];
|
|
108
|
-
discoverySummary: import("
|
|
108
|
+
discoverySummary: import("../shared/schemas/discovery-question.schema.js").DiscoverySummary;
|
|
109
109
|
}>;
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* timeout/turn_cap → 'stalled'
|
|
9
9
|
* Status updates land in the DB; in-memory state.opportunities is not mutated.
|
|
10
10
|
*/
|
|
11
|
-
import { requestContext } from '
|
|
12
|
-
import { AMBIENT_PARK_WINDOW_MS, negotiateCandidates } from '
|
|
13
|
-
import { buildDiscoverySummary, toDiscoveryNegotiation } from '
|
|
14
|
-
import { resolveOpportunityActorIntent } from '
|
|
15
|
-
import { buildPrioritizedNegotiationIntents, negotiationIncludesOtherIntents } from
|
|
16
|
-
import { logger, negotiateLog } from
|
|
11
|
+
import { requestContext } from '../shared/observability/request-context.js';
|
|
12
|
+
import { AMBIENT_PARK_WINDOW_MS, negotiateCandidates } from '../negotiations/negotiation.module.js';
|
|
13
|
+
import { buildDiscoverySummary, toDiscoveryNegotiation } from './negotiation-summary.builder.js';
|
|
14
|
+
import { resolveOpportunityActorIntent } from './opportunity.actor.js';
|
|
15
|
+
import { buildPrioritizedNegotiationIntents, negotiationIncludesOtherIntents } from "./opportunity.existing-negotiation.js";
|
|
16
|
+
import { logger, negotiateLog } from "./opportunity.graph.shared.js";
|
|
17
17
|
/** Distinguishes "the budget timer won the race" from a real negotiation result. */
|
|
18
18
|
const NEGOTIATE_TIMER_SENTINEL = Symbol('negotiate-timer-sentinel');
|
|
19
19
|
/**
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* upgraded, or suppressed before any row is written; only what survives that
|
|
8
8
|
* gate reaches `persistOpportunities`.
|
|
9
9
|
*/
|
|
10
|
-
import type { Id, Opportunity, OpportunityStatus } from '
|
|
11
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
10
|
+
import type { Id, Opportunity, OpportunityStatus } from '../shared/interfaces/database.interface.js';
|
|
11
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
12
12
|
/** A pairing that was not persisted because an opportunity already covers it. */
|
|
13
13
|
type ExistingBetweenActor = {
|
|
14
14
|
candidateUserId: Id<'users'>;
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* upgraded, or suppressed before any row is written; only what survives that
|
|
8
8
|
* gate reaches `persistOpportunities`.
|
|
9
9
|
*/
|
|
10
|
-
import { timed } from '
|
|
11
|
-
import { validateOpportunityActors } from '
|
|
12
|
-
import { hasUnsupportedOpportunityClaim } from '
|
|
13
|
-
import { normalizeOpportunityActorIntent } from '
|
|
14
|
-
import { persistOpportunities } from
|
|
15
|
-
import { INTRODUCER_DISCOVERY_SOURCE } from
|
|
16
|
-
import { stampEligibleNewbornOpportunities } from
|
|
17
|
-
import { admitOpportunityPersistence, createEligibleOpportunityStatusUpdater } from
|
|
18
|
-
import { belongsToOwnedIntent, DEDUP_WINDOW_MS, isActiveNegotiationTaskFresh, persistDedupLog, persistLog, persistPathLog, triggerForOwner } from
|
|
10
|
+
import { timed } from '../shared/observability/performance.js';
|
|
11
|
+
import { validateOpportunityActors } from './opportunity.utils.js';
|
|
12
|
+
import { hasUnsupportedOpportunityClaim } from '../shared/utils/claim-safety.js';
|
|
13
|
+
import { normalizeOpportunityActorIntent } from './opportunity.actor.js';
|
|
14
|
+
import { persistOpportunities } from "./opportunity.persist.js";
|
|
15
|
+
import { INTRODUCER_DISCOVERY_SOURCE } from "./opportunity.introducer.js";
|
|
16
|
+
import { stampEligibleNewbornOpportunities } from "./opportunity.newborn-stamping.js";
|
|
17
|
+
import { admitOpportunityPersistence, createEligibleOpportunityStatusUpdater } from "./opportunity.persistence-admission.js";
|
|
18
|
+
import { belongsToOwnedIntent, DEDUP_WINDOW_MS, isActiveNegotiationTaskFresh, persistDedupLog, persistLog, persistPathLog, triggerForOwner } from "./opportunity.graph.shared.js";
|
|
19
19
|
/**
|
|
20
20
|
* Only skip 'draft' (chat-only) opportunities during dedup.
|
|
21
21
|
* 'latent' must NOT be skipped — background discovery creates latent opportunities,
|
package/dist/opportunities/{application/opportunity.graph.prep.d.ts → opportunity.graph.prep.d.ts}
RENAMED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Each stage is a top-level function taking the graph state and an explicit
|
|
5
5
|
* dependency bag. `opportunity.graph.ts` wires them into the StateGraph.
|
|
6
6
|
*/
|
|
7
|
-
import type { Id } from '
|
|
8
|
-
import type { DebugMetaAgent } from '
|
|
9
|
-
import type { IndexedIntent, TargetNetwork } from '
|
|
10
|
-
import { type OpportunityGraphDeps, type OpportunityState } from
|
|
7
|
+
import type { Id } from '../shared/interfaces/database.interface.js';
|
|
8
|
+
import type { DebugMetaAgent } from '../agents/agent.module.js';
|
|
9
|
+
import type { IndexedIntent, TargetNetwork } from './opportunity.state.js';
|
|
10
|
+
import { type OpportunityGraphDeps, type OpportunityState } from "./opportunity.graph.shared.js";
|
|
11
11
|
/**
|
|
12
12
|
* Node 0: Prep
|
|
13
13
|
* Fetches user's network memberships and validates requirements.
|
package/dist/opportunities/{application/opportunity.graph.prep.js → opportunity.graph.prep.js}
RENAMED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* Each stage is a top-level function taking the graph state and an explicit
|
|
5
5
|
* dependency bag. `opportunity.graph.ts` wires them into the StateGraph.
|
|
6
6
|
*/
|
|
7
|
-
import { Intents } from '
|
|
8
|
-
import { withCallLogging } from '
|
|
9
|
-
import { timed } from '
|
|
10
|
-
import { requestContext } from '
|
|
11
|
-
import { discoveryProfileMatchingEnabled, discoveryProfileSource } from '
|
|
12
|
-
import { prepLog, scopeLog, resolveLog } from
|
|
7
|
+
import { Intents } from '../intents/intent.module.js';
|
|
8
|
+
import { withCallLogging } from '../shared/observability/protocol.logger.js';
|
|
9
|
+
import { timed } from '../shared/observability/performance.js';
|
|
10
|
+
import { requestContext } from '../shared/observability/request-context.js';
|
|
11
|
+
import { discoveryProfileMatchingEnabled, discoveryProfileSource } from './discovery.env.js';
|
|
12
|
+
import { prepLog, scopeLog, resolveLog } from "./opportunity.graph.shared.js";
|
|
13
13
|
/**
|
|
14
14
|
* Node 0: Prep
|
|
15
15
|
* Fetches user's network memberships and validates requirements.
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
* one of them needs: the dependency bag, the loggers, the trace wrapper, and the
|
|
9
9
|
* small pure helpers.
|
|
10
10
|
*/
|
|
11
|
-
import type { Id } from '
|
|
12
|
-
import { OpportunityGraphState, type IndexedIntent, type SourceProfileData, type CandidateMatch } from '
|
|
13
|
-
import type { CandidateProfile, EvaluatorEntity, EvaluatorInput } from
|
|
14
|
-
import type { OpportunityGraphDatabase, Opportunity } from '
|
|
15
|
-
import type { Embedder } from '
|
|
16
|
-
import type { NegotiationGraphLike } from '
|
|
17
|
-
import type { AgentDispatcher } from '
|
|
18
|
-
import type { QueueOpportunityNotificationFn } from
|
|
19
|
-
import type { StampNewbornOpportunitiesFn } from
|
|
11
|
+
import type { Id } from '../shared/interfaces/database.interface.js';
|
|
12
|
+
import { OpportunityGraphState, type IndexedIntent, type SourceProfileData, type CandidateMatch } from './opportunity.state.js';
|
|
13
|
+
import type { CandidateProfile, EvaluatorEntity, EvaluatorInput } from "./opportunity.evaluator.js";
|
|
14
|
+
import type { OpportunityGraphDatabase, Opportunity } from '../shared/interfaces/database.interface.js';
|
|
15
|
+
import type { Embedder } from '../shared/interfaces/embedder.interface.js';
|
|
16
|
+
import type { NegotiationGraphLike } from '../negotiations/negotiation.module.js';
|
|
17
|
+
import type { AgentDispatcher } from '../shared/interfaces/agent-dispatcher.interface.js';
|
|
18
|
+
import type { QueueOpportunityNotificationFn } from "./opportunity.lifecycle.js";
|
|
19
|
+
import type { StampNewbornOpportunitiesFn } from "./opportunity.newborn-stamping.js";
|
|
20
20
|
/** The graph's channel state, as every node sees it. */
|
|
21
21
|
export type OpportunityState = typeof OpportunityGraphState.State;
|
|
22
22
|
/** Optional evaluator for testing (avoids LLM calls). */
|
|
@@ -99,25 +99,25 @@ export interface OpportunityGraphDeps {
|
|
|
99
99
|
retrievalMinSimilarity: number;
|
|
100
100
|
evaluatorMinScore: number;
|
|
101
101
|
}
|
|
102
|
-
export declare const logger: import("
|
|
103
|
-
export declare const prepLog: import("
|
|
104
|
-
export declare const scopeLog: import("
|
|
105
|
-
export declare const resolveLog: import("
|
|
106
|
-
export declare const discoveryLog: import("
|
|
107
|
-
export declare const evaluationLog: import("
|
|
108
|
-
export declare const negotiateLog: import("
|
|
109
|
-
export declare const rankingLog: import("
|
|
110
|
-
export declare const introValidationLog: import("
|
|
111
|
-
export declare const introEvaluationLog: import("
|
|
112
|
-
export declare const persistLog: import("
|
|
113
|
-
export declare const persistPathLog: import("
|
|
114
|
-
export declare const persistDedupLog: import("
|
|
115
|
-
export declare const readLog: import("
|
|
116
|
-
export declare const updateLog: import("
|
|
117
|
-
export declare const deleteLog: import("
|
|
118
|
-
export declare const sendLog: import("
|
|
119
|
-
export declare const negotiateExistingLog: import("
|
|
120
|
-
export declare const routingLog: import("
|
|
102
|
+
export declare const logger: import("../shared/observability/log.js").LoggerWithSource;
|
|
103
|
+
export declare const prepLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
104
|
+
export declare const scopeLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
105
|
+
export declare const resolveLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
106
|
+
export declare const discoveryLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
107
|
+
export declare const evaluationLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
108
|
+
export declare const negotiateLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
109
|
+
export declare const rankingLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
110
|
+
export declare const introValidationLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
111
|
+
export declare const introEvaluationLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
112
|
+
export declare const persistLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
113
|
+
export declare const persistPathLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
114
|
+
export declare const persistDedupLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
115
|
+
export declare const readLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
116
|
+
export declare const updateLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
117
|
+
export declare const deleteLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
118
|
+
export declare const sendLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
119
|
+
export declare const negotiateExistingLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
120
|
+
export declare const routingLog: import("../shared/observability/log.js").LoggerWithSource;
|
|
121
121
|
/**
|
|
122
122
|
* Error text can include provider response bodies, URLs, and credentials. Keep
|
|
123
123
|
* observability useful by retaining only a conservative error class at this
|
package/dist/opportunities/{application/opportunity.graph.shared.js → opportunity.graph.shared.js}
RENAMED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* one of them needs: the dependency bag, the loggers, the trace wrapper, and the
|
|
9
9
|
* small pure helpers.
|
|
10
10
|
*/
|
|
11
|
-
import { ASK_USER_LOCK_SLACK_MS, askUserAnswerWindowMs } from '
|
|
12
|
-
import { protocolLogger } from '
|
|
13
|
-
import { renderNetworkContext } from '
|
|
14
|
-
import { requestContext } from '
|
|
11
|
+
import { ASK_USER_LOCK_SLACK_MS, askUserAnswerWindowMs } from '../negotiations/negotiation.module.js';
|
|
12
|
+
import { protocolLogger } from '../shared/observability/protocol.logger.js';
|
|
13
|
+
import { renderNetworkContext } from '../shared/network/metadata.renderer.js';
|
|
14
|
+
import { requestContext } from '../shared/observability/request-context.js';
|
|
15
15
|
export const logger = protocolLogger('OpportunityGraph');
|
|
16
16
|
export const prepLog = protocolLogger('OpportunityGraph:Prep');
|
|
17
17
|
export const scopeLog = protocolLogger('OpportunityGraph:Scope');
|
package/dist/opportunities/{application/opportunity.introducer.js → opportunity.introducer.js}
RENAMED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* HyDE discovery for each, creating latent introducer opportunities that
|
|
7
7
|
* the user (as introducer) must approve before parties see them.
|
|
8
8
|
*/
|
|
9
|
-
import { protocolLogger } from '
|
|
9
|
+
import { protocolLogger } from '../shared/observability/protocol.logger.js';
|
|
10
10
|
const logger = protocolLogger('IntroducerDiscovery');
|
|
11
11
|
/** Maximum contacts to evaluate per maintenance cycle. */
|
|
12
12
|
export const MAX_CONTACTS_PER_CYCLE = 5;
|
package/dist/opportunities/{application/opportunity.lifecycle.d.ts → opportunity.lifecycle.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Opportunity, OpportunityActor, OpportunityGraphDatabase } from '
|
|
1
|
+
import type { Opportunity, OpportunityActor, OpportunityGraphDatabase } from '../shared/interfaces/database.interface.js';
|
|
2
2
|
/** The mutation result shape returned by opportunity lifecycle graph nodes. */
|
|
3
3
|
export interface OpportunityMutationResult {
|
|
4
4
|
success: boolean;
|