@indexnetwork/protocol 14.0.0-rc.468.1 → 14.2.0-rc.470.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 +69 -0
- 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/communities/application/indexer.graph.d.ts +1 -1
- package/dist/communities/application/indexer.state.d.ts +1 -1
- package/dist/communities/application/network.tools.d.ts +1 -1
- package/dist/communities/index.d.ts +9 -0
- package/dist/communities/index.js +8 -0
- package/dist/{capabilities → communities/ports}/communities.tools.port.d.ts +1 -1
- package/dist/communities/ports/index.d.ts +2 -2
- package/dist/communities/ports/index.js +1 -1
- package/dist/contacts/application/contact.inviter.js +1 -1
- package/dist/contacts/index.d.ts +9 -0
- package/dist/contacts/index.js +8 -0
- package/dist/enrichment/enrichment.graph.d.ts +1 -1
- package/dist/enrichment/enrichment.state.d.ts +1 -1
- package/dist/enrichment/enrichment.tools.d.ts +1 -1
- package/dist/index.d.ts +125 -125
- package/dist/index.js +85 -85
- package/dist/integrations/index.d.ts +10 -0
- package/dist/integrations/index.js +8 -0
- package/dist/mcp/mcp.authorization-policy.d.ts +8 -8
- package/dist/negotiation/application/negotiation.graph.d.ts +1 -1
- package/dist/negotiation/domain/negotiation.question-safety.js +1 -1
- package/dist/negotiation/index.d.ts +12 -0
- package/dist/negotiation/index.js +9 -0
- package/dist/opportunity/application/negotiation-context.loader.d.ts +1 -1
- package/dist/opportunity/application/opportunity.card-presentation.js +1 -1
- package/dist/opportunity/application/opportunity.discovery-negotiation-summary.js +1 -1
- package/dist/opportunity/application/opportunity.evaluator.js +1 -1
- package/dist/opportunity/application/opportunity.graph.d.ts +3 -3
- package/dist/opportunity/application/opportunity.graph.js +3 -3
- package/dist/opportunity/application/opportunity.presenter.d.ts +6 -6
- package/dist/opportunity/application/opportunity.presenter.js +1 -1
- package/dist/opportunity/application/opportunity.tools.js +1 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts +1 -1
- package/dist/opportunity/discriminator/discriminator.push.d.ts +1 -1
- package/dist/opportunity/discriminator/discriminator.question.d.ts +1 -1
- package/dist/opportunity/domain/index.d.ts +1 -1
- package/dist/opportunity/domain/index.js +1 -1
- package/dist/opportunity/domain/negotiation-summary.builder.d.ts +1 -1
- package/dist/opportunity/domain/opportunity.presentation.js +1 -1
- package/dist/opportunity/domain/opportunity.safe-presentation.js +1 -1
- package/dist/opportunity/domain/opportunity.state.d.ts +1 -1
- package/dist/opportunity/index.d.ts +54 -0
- package/dist/opportunity/index.js +39 -0
- package/dist/opportunity/radar/radar.graph.d.ts +1 -1
- package/dist/opportunity/radar/radar.state.d.ts +1 -1
- package/dist/participant-agents/index.d.ts +22 -0
- package/dist/participant-agents/index.js +12 -0
- package/dist/participant-context/index.d.ts +9 -12
- package/dist/participant-context/index.js +10 -12
- package/dist/{capabilities → participant-context/ports}/participant-context.tools.port.d.ts +1 -1
- package/dist/premise/premise.graph.d.ts +1 -1
- package/dist/premise/premise.state.d.ts +1 -1
- package/dist/premise/premise.tools.d.ts +1 -1
- package/dist/questions/application/index.d.ts +1 -1
- package/dist/questions/application/index.js +1 -1
- package/dist/questions/application/question.env.d.ts +29 -0
- package/dist/questions/application/question.env.js +36 -0
- package/dist/questions/application/question.input.d.ts +1 -1
- package/dist/questions/application/question.input.js +1 -1
- package/dist/questions/application/question.presets.js +1 -1
- package/dist/questions/domain/question.schema.d.ts +3 -3
- package/dist/questions/domain/question.schema.js +2 -6
- package/dist/questions/index.d.ts +13 -0
- package/dist/questions/index.js +2 -0
- package/dist/shared/agent/tool.factory.js +13 -10
- package/dist/shared/agent/tool.registry.js +7 -7
- package/dist/shared/schemas/mcp-auth.schema.d.ts +4 -4
- package/dist/shared/schemas/underspecification.schema.d.ts +13 -0
- package/dist/shared/schemas/underspecification.schema.js +16 -0
- package/dist/signals/application/intent.clarifier.js +1 -1
- package/dist/signals/application/intent.graph.d.ts +2 -2
- package/dist/signals/application/intent.tools.d.ts +1 -1
- package/dist/signals/domain/intent.state.d.ts +1 -1
- package/dist/signals/index.d.ts +18 -0
- package/dist/signals/index.js +14 -0
- package/dist/{capabilities → signals/ports}/signals.tools.port.d.ts +1 -1
- package/package.json +1 -1
- package/dist/capabilities/communities.facade.d.ts +0 -13
- package/dist/capabilities/communities.facade.js +0 -12
- package/dist/capabilities/contacts.facade.d.ts +0 -9
- package/dist/capabilities/contacts.facade.js +0 -8
- package/dist/capabilities/integrations.facade.d.ts +0 -8
- package/dist/capabilities/integrations.facade.js +0 -7
- package/dist/capabilities/interaction-composition.facade.d.ts +0 -10
- package/dist/capabilities/interaction-composition.facade.js +0 -9
- package/dist/capabilities/negotiation.discovery.facade.d.ts +0 -9
- package/dist/capabilities/negotiation.discovery.facade.js +0 -7
- package/dist/capabilities/negotiation.facade.d.ts +0 -26
- package/dist/capabilities/negotiation.facade.js +0 -18
- package/dist/capabilities/negotiation.memory.facade.d.ts +0 -6
- package/dist/capabilities/negotiation.memory.facade.js +0 -5
- package/dist/capabilities/negotiation.questions.facade.d.ts +0 -6
- package/dist/capabilities/negotiation.questions.facade.js +0 -5
- package/dist/capabilities/negotiation.state.facade.d.ts +0 -5
- package/dist/capabilities/negotiation.state.facade.js +0 -1
- package/dist/capabilities/negotiation.summary.facade.d.ts +0 -5
- package/dist/capabilities/negotiation.summary.facade.js +0 -5
- package/dist/capabilities/opportunities.facade.d.ts +0 -56
- package/dist/capabilities/opportunities.facade.js +0 -55
- package/dist/capabilities/opportunities.safety.facade.d.ts +0 -2
- package/dist/capabilities/opportunities.safety.facade.js +0 -2
- package/dist/capabilities/participant-agents.debug.facade.d.ts +0 -2
- package/dist/capabilities/participant-agents.debug.facade.js +0 -1
- package/dist/capabilities/participant-agents.facade.d.ts +0 -34
- package/dist/capabilities/participant-agents.facade.js +0 -34
- package/dist/capabilities/participant-agents.tools.facade.d.ts +0 -8
- package/dist/capabilities/participant-agents.tools.facade.js +0 -8
- package/dist/capabilities/participant-context.facade.d.ts +0 -13
- package/dist/capabilities/participant-context.facade.js +0 -14
- package/dist/capabilities/questions.enqueue.facade.d.ts +0 -5
- package/dist/capabilities/questions.enqueue.facade.js +0 -1
- package/dist/capabilities/questions.facade.d.ts +0 -8
- package/dist/capabilities/questions.facade.js +0 -7
- package/dist/capabilities/questions.runtime.facade.d.ts +0 -5
- package/dist/capabilities/questions.runtime.facade.js +0 -5
- package/dist/capabilities/signals.facade.d.ts +0 -19
- package/dist/capabilities/signals.facade.js +0 -17
- package/dist/capabilities/signals.indexing.facade.d.ts +0 -12
- package/dist/capabilities/signals.indexing.facade.js +0 -11
- package/dist/communities/public/index.d.ts +0 -30
- package/dist/communities/public/index.js +0 -33
- package/dist/contacts/public/index.d.ts +0 -36
- package/dist/contacts/public/index.js +0 -33
- package/dist/integrations/public/index.d.ts +0 -37
- package/dist/integrations/public/index.js +0 -34
- package/dist/negotiation/public/index.d.ts +0 -63
- package/dist/negotiation/public/index.js +0 -64
- package/dist/opportunity/public/index.d.ts +0 -61
- package/dist/opportunity/public/index.js +0 -54
- package/dist/participant-agents/public/index.d.ts +0 -39
- package/dist/participant-agents/public/index.js +0 -36
- package/dist/participant-context/public/index.d.ts +0 -48
- package/dist/participant-context/public/index.js +0 -55
- package/dist/questions/public/index.d.ts +0 -47
- package/dist/questions/public/index.js +0 -49
- package/dist/signals/public/index.d.ts +0 -15
- package/dist/signals/public/index.js +0 -16
- /package/dist/{capabilities → communities/ports}/communities.tools.port.js +0 -0
- /package/dist/{capabilities → participant-context/ports}/participant-context.tools.port.js +0 -0
- /package/dist/{opportunity/domain/opportunity.claim-safety.d.ts → shared/utils/claim-safety.d.ts} +0 -0
- /package/dist/{opportunity/domain/opportunity.claim-safety.js → shared/utils/claim-safety.js} +0 -0
- /package/dist/{capabilities → signals/ports}/signals.tools.port.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opportunity — the capability's sole cross-capability surface.
|
|
3
|
+
*
|
|
4
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
5
|
+
* Supersedes the capabilities/*.facade.ts + opportunity/public/ pair; the export
|
|
6
|
+
* list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export { getOrCreateDeliveryCardBatch, } from "./application/delivery-card.cache.js";
|
|
9
|
+
export { OpportunityEvaluator, } from "./application/opportunity.evaluator.js";
|
|
10
|
+
export type { EvaluatorInput, } from "./application/opportunity.evaluator.js";
|
|
11
|
+
export { OpportunityGraphFactory, } from "./application/opportunity.graph.js";
|
|
12
|
+
export type { OpportunityGraphThresholdOverrides, } from "./application/opportunity.graph.js";
|
|
13
|
+
export { isIntroducerDiscoveryEnabled, } from "./application/opportunity.introducer-feature.js";
|
|
14
|
+
export { INTRODUCER_DISCOVERY_SOURCE, MAX_CANDIDATES_PER_CONTACT, MAX_CONTACTS_PER_CYCLE, runIntroducerDiscovery, selectContactsForDiscovery, shouldRunIntroducerDiscovery, } from "./application/opportunity.introducer.js";
|
|
15
|
+
export type { ContactWithIntents, IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, } from "./application/opportunity.introducer.js";
|
|
16
|
+
export type { StampNewbornOpportunitiesFn, StampNewbornOpportunitiesInput, } from "./application/opportunity.newborn-stamping.js";
|
|
17
|
+
export { opportunityOwnerActionForStatus, } from "./application/opportunity.owner-approval.js";
|
|
18
|
+
export type { OpportunityOwnerAction, OpportunityOwnerApprovalAttestation, OpportunityOwnerApprovalAuthority, OpportunityOwnerApprovalBinding, OpportunityOwnerApprovalChallenge, OpportunityOwnerApprovalDenialReason, OpportunityOwnerApprovalVerdict, OpportunityOwnerInteractionProvenance, OpportunityOwnerInteractionSurface, } from "./application/opportunity.owner-approval.js";
|
|
19
|
+
export { bindOwnerApprovalProvenance, } from "./application/opportunity.owner-provenance.js";
|
|
20
|
+
export { persistOpportunities, } from "./application/opportunity.persist.js";
|
|
21
|
+
export { gatherPresenterContext, OpportunityPresenter, } from "./application/opportunity.presenter.js";
|
|
22
|
+
export type { PresenterDatabase, } from "./application/opportunity.presenter.js";
|
|
23
|
+
export { createOpportunityTools, } from "./application/opportunity.tools.js";
|
|
24
|
+
export { DISCOVERY_EVALUATOR_MIN_SCORE_DEFAULT, DISCOVERY_MIN_SIMILARITY_DEFAULT, discoveryAllowedTypes, discoveryEvaluatorMinScore, discoveryIntentMatchingEnabled, discoveryMinSimilarity, discoveryProfileMatchingEnabled, discoveryProfileSource, resetDiscoveryEnvWarningsForTests, validateDiscoveryEvaluatorMinScore, validateDiscoveryMinSimilarity, } from "./discovery.env.js";
|
|
25
|
+
export type { DiscoveryMatchType, DiscoveryProfileSource, } from "./discovery.env.js";
|
|
26
|
+
export { buildPoolAdjustment, mergePoolAdjustment, planPoolAdjustments, } from "./discriminator/discriminator.adjustments.js";
|
|
27
|
+
export type { PoolAdjustment, PoolAdjustmentSignal, } from "./discriminator/discriminator.adjustments.js";
|
|
28
|
+
export { PoolDiscriminatorAssigner, } from "./discriminator/discriminator.assigner.js";
|
|
29
|
+
export type { PoolDiscriminatorAssignedAxis, PoolDiscriminatorAssignmentInput, } from "./discriminator/discriminator.assigner.js";
|
|
30
|
+
export { POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_MIN_VOI, POOL_RERUN_DEBOUNCE_MS, POOL_VISIT_MINING_DEBOUNCE_MS, poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsRanking, poolQuestionsStampNewborn, poolQuestionsVisitTrigger, } from "./discriminator/discriminator.env.js";
|
|
31
|
+
export { PoolDiscriminatorMiner, } from "./discriminator/discriminator.miner.js";
|
|
32
|
+
export { buildPoolQuestionPushMessage, poolQuestionCycleKey, } from "./discriminator/discriminator.push.js";
|
|
33
|
+
export { BOTH_MATTER_LABEL, selectQuestionDiscriminators, synthesizePoolQuestion, toQuestionDiscriminator, } from "./discriminator/discriminator.question.js";
|
|
34
|
+
export { runPoolDiscriminatorShadow, } from "./discriminator/discriminator.shadow.js";
|
|
35
|
+
export type { DiscriminatorMiningInput, MinedDiscriminator, PoolCandidate, } from "./discriminator/discriminator.types.js";
|
|
36
|
+
export { hasUnsupportedOpportunityClaim, stripUnsupportedOpportunityClaims, stripUnsupportedOpportunityClaims as stripUnsupportedOpportunityClaimsText, } from "../shared/utils/claim-safety.js";
|
|
37
|
+
export { buildCandidateEvidence, } from "./domain/opportunity.evidence.js";
|
|
38
|
+
export { getPrimaryActionLabel, } from "./domain/opportunity.labels.js";
|
|
39
|
+
export { buildApiChatCardPresentationCacheKey, buildDeliveryCardPresentationCacheKey, buildRadarCardPresentationCacheKey, } from "./domain/opportunity.presentation-cache.js";
|
|
40
|
+
export { presentOpportunity, stripUuids, truncateAtBoundary, } from "./domain/opportunity.presentation.js";
|
|
41
|
+
export type { UserInfo, } from "./domain/opportunity.presentation.js";
|
|
42
|
+
export { DEFAULT_FALLBACK_HEADLINE, safeFallbackSummary, } from "./domain/opportunity.safe-presentation.js";
|
|
43
|
+
export { canUserSeeOpportunity, classifyOpportunity, isActionableForViewer, RADAR_SOFT_TARGETS, selectByComposition, validateOpportunityActors, } from "./domain/opportunity.utils.js";
|
|
44
|
+
export { NEGOTIATION_EVIDENCE_MAX_OPPORTUNITIES, negotiationEvidenceQuestionsMode, } from "./negotiation-evidence/negotiation-evidence.env.js";
|
|
45
|
+
export { NegotiationEvidenceMiner, } from "./negotiation-evidence/negotiation-evidence.miner.js";
|
|
46
|
+
export { runNegotiationEvidenceShadow, } from "./negotiation-evidence/negotiation-evidence.shadow.js";
|
|
47
|
+
export type { RawEvidenceOutcome, RawEvidenceOwnerAnswer, RawEvidenceSegment, RawEvidenceTurn, } from "./negotiation-evidence/negotiation-evidence.types.js";
|
|
48
|
+
export { isOutcomeQuestionsActivated, OUTCOME_MAX_CANDIDATES, OUTCOME_MAX_PUBLIC_CONTEXT_CHARS, OUTCOME_MIN_INDEPENDENT_EXAMPLES, } from "./outcome/outcome.env.js";
|
|
49
|
+
export { runOutcomeShadow, } from "./outcome/outcome.shadow.js";
|
|
50
|
+
export type { OutcomeExample, OutcomeLabel, OutcomeShadowResult, } from "./outcome/outcome.types.js";
|
|
51
|
+
export type { OpportunityToolDeps, } from "./ports/index.js";
|
|
52
|
+
export { RadarGraphFactory, } from "./radar/radar.graph.js";
|
|
53
|
+
export { computeRadarHealth, } from "./radar/radar.health.js";
|
|
54
|
+
export type { RadarHealthInput, } from "./radar/radar.health.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opportunity — the capability's sole cross-capability surface.
|
|
3
|
+
*
|
|
4
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
5
|
+
* Supersedes the capabilities/*.facade.ts + opportunity/public/ pair; the export
|
|
6
|
+
* list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export { getOrCreateDeliveryCardBatch, } from "./application/delivery-card.cache.js";
|
|
9
|
+
export { OpportunityEvaluator, } from "./application/opportunity.evaluator.js";
|
|
10
|
+
export { OpportunityGraphFactory, } from "./application/opportunity.graph.js";
|
|
11
|
+
export { isIntroducerDiscoveryEnabled, } from "./application/opportunity.introducer-feature.js";
|
|
12
|
+
export { INTRODUCER_DISCOVERY_SOURCE, MAX_CANDIDATES_PER_CONTACT, MAX_CONTACTS_PER_CYCLE, runIntroducerDiscovery, selectContactsForDiscovery, shouldRunIntroducerDiscovery, } from "./application/opportunity.introducer.js";
|
|
13
|
+
export { opportunityOwnerActionForStatus, } from "./application/opportunity.owner-approval.js";
|
|
14
|
+
export { bindOwnerApprovalProvenance, } from "./application/opportunity.owner-provenance.js";
|
|
15
|
+
export { persistOpportunities, } from "./application/opportunity.persist.js";
|
|
16
|
+
export { gatherPresenterContext, OpportunityPresenter, } from "./application/opportunity.presenter.js";
|
|
17
|
+
export { createOpportunityTools, } from "./application/opportunity.tools.js";
|
|
18
|
+
export { DISCOVERY_EVALUATOR_MIN_SCORE_DEFAULT, DISCOVERY_MIN_SIMILARITY_DEFAULT, discoveryAllowedTypes, discoveryEvaluatorMinScore, discoveryIntentMatchingEnabled, discoveryMinSimilarity, discoveryProfileMatchingEnabled, discoveryProfileSource, resetDiscoveryEnvWarningsForTests, validateDiscoveryEvaluatorMinScore, validateDiscoveryMinSimilarity, } from "./discovery.env.js";
|
|
19
|
+
export { buildPoolAdjustment, mergePoolAdjustment, planPoolAdjustments, } from "./discriminator/discriminator.adjustments.js";
|
|
20
|
+
export { PoolDiscriminatorAssigner, } from "./discriminator/discriminator.assigner.js";
|
|
21
|
+
export { POOL_DISCRIMINATOR_MAX_CANDIDATES, POOL_DISCRIMINATOR_MAX_PUBLIC_CONTEXT_CHARS, POOL_DISCRIMINATOR_MIN_POOL_SIZE, POOL_QUESTION_MAX_PENDING_PER_INTENT, POOL_QUESTION_MIN_VOI, POOL_RERUN_DEBOUNCE_MS, POOL_VISIT_MINING_DEBOUNCE_MS, poolQuestionsMiningMode, poolQuestionsMode, poolQuestionsPushMode, poolQuestionsRanking, poolQuestionsStampNewborn, poolQuestionsVisitTrigger, } from "./discriminator/discriminator.env.js";
|
|
22
|
+
export { PoolDiscriminatorMiner, } from "./discriminator/discriminator.miner.js";
|
|
23
|
+
export { buildPoolQuestionPushMessage, poolQuestionCycleKey, } from "./discriminator/discriminator.push.js";
|
|
24
|
+
export { BOTH_MATTER_LABEL, selectQuestionDiscriminators, synthesizePoolQuestion, toQuestionDiscriminator, } from "./discriminator/discriminator.question.js";
|
|
25
|
+
export { runPoolDiscriminatorShadow, } from "./discriminator/discriminator.shadow.js";
|
|
26
|
+
export { hasUnsupportedOpportunityClaim, stripUnsupportedOpportunityClaims, stripUnsupportedOpportunityClaims as stripUnsupportedOpportunityClaimsText, } from "../shared/utils/claim-safety.js";
|
|
27
|
+
export { buildCandidateEvidence, } from "./domain/opportunity.evidence.js";
|
|
28
|
+
export { getPrimaryActionLabel, } from "./domain/opportunity.labels.js";
|
|
29
|
+
export { buildApiChatCardPresentationCacheKey, buildDeliveryCardPresentationCacheKey, buildRadarCardPresentationCacheKey, } from "./domain/opportunity.presentation-cache.js";
|
|
30
|
+
export { presentOpportunity, stripUuids, truncateAtBoundary, } from "./domain/opportunity.presentation.js";
|
|
31
|
+
export { DEFAULT_FALLBACK_HEADLINE, safeFallbackSummary, } from "./domain/opportunity.safe-presentation.js";
|
|
32
|
+
export { canUserSeeOpportunity, classifyOpportunity, isActionableForViewer, RADAR_SOFT_TARGETS, selectByComposition, validateOpportunityActors, } from "./domain/opportunity.utils.js";
|
|
33
|
+
export { NEGOTIATION_EVIDENCE_MAX_OPPORTUNITIES, negotiationEvidenceQuestionsMode, } from "./negotiation-evidence/negotiation-evidence.env.js";
|
|
34
|
+
export { NegotiationEvidenceMiner, } from "./negotiation-evidence/negotiation-evidence.miner.js";
|
|
35
|
+
export { runNegotiationEvidenceShadow, } from "./negotiation-evidence/negotiation-evidence.shadow.js";
|
|
36
|
+
export { isOutcomeQuestionsActivated, OUTCOME_MAX_CANDIDATES, OUTCOME_MAX_PUBLIC_CONTEXT_CHARS, OUTCOME_MIN_INDEPENDENT_EXAMPLES, } from "./outcome/outcome.env.js";
|
|
37
|
+
export { runOutcomeShadow, } from "./outcome/outcome.shadow.js";
|
|
38
|
+
export { RadarGraphFactory, } from "./radar/radar.graph.js";
|
|
39
|
+
export { computeRadarHealth, } from "./radar/radar.health.js";
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type { RadarGraphDatabase, OpportunityStatus } from '../../shared/interfaces/database.interface.js';
|
|
14
14
|
import type { OpportunityCache } from '../../shared/interfaces/cache.interface.js';
|
|
15
15
|
import { type RadarCardItem, type RadarResponseItem } from './radar.state.js';
|
|
16
|
-
import type { DebugMetaAgent } from '../../
|
|
16
|
+
import type { DebugMetaAgent } from '../../participant-agents/index.js';
|
|
17
17
|
/** Database must satisfy both RadarGraphDatabase and presenter context (getProfile, getActiveIntents, getNetwork, getUser). */
|
|
18
18
|
type RadarGraphDb = RadarGraphDatabase;
|
|
19
19
|
export type RadarGraphInvokeInput = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Opportunity, OpportunityStatus } from '../../shared/interfaces/database.interface.js';
|
|
2
|
-
import type { DebugMetaAgent } from '../../
|
|
2
|
+
import type { DebugMetaAgent } from '../../participant-agents/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Radar card item: one opportunity with full presenter-driven display contract.
|
|
5
5
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* participant-agents — the capability's sole cross-capability surface.
|
|
3
|
+
*
|
|
4
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
5
|
+
* Supersedes the capabilities/*.facade.ts + participant-agents/public/ pair; the export
|
|
6
|
+
* list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export type { DebugMetaAgent, } from "../chat/chat-streaming.types.js";
|
|
9
|
+
export { ChatGraphFactory, } from "../chat/chat.graph.js";
|
|
10
|
+
export { ChatInterruptClassifier, } from "../chat/chat.interrupt.classifier.js";
|
|
11
|
+
export type { ChatPersonaConfig, } from "../chat/chat.persona.js";
|
|
12
|
+
export { SuggestionGenerator, } from "../chat/chat.suggester.js";
|
|
13
|
+
export { ChatSummarizer, } from "../chat/chat.summarizer.js";
|
|
14
|
+
export { ChatTitleGenerator, } from "../chat/chat.title.generator.js";
|
|
15
|
+
export { createChatTools, } from "../chat/chat.tools.js";
|
|
16
|
+
export { createNegotiatorPersona, NEGOTIATOR_PERSONA_ID, } from "../chat/negotiator.persona.js";
|
|
17
|
+
export { createOnboardingTools, filterOnboardingTools, narrowOnboardingTools, ONBOARDING_PERSONA, ONBOARDING_PERSONA_ID, ONBOARDING_PROFILE_KICKOFF, ONBOARDING_TOOL_NAMES, } from "../chat/onboarding.persona.js";
|
|
18
|
+
export { createReporterTools, filterReporterTools, narrowReporterTools, REPORTER_BRIEFING_KICKOFF, REPORTER_PERSONA, REPORTER_PERSONA_ID, REPORTER_TOOL_NAMES, } from "../chat/reporter.persona.js";
|
|
19
|
+
export { createSignalTools, filterSignalTools, narrowSignalTools, SIGNAL_NEW_SIGNAL_KICKOFF, SIGNAL_PERSONA, SIGNAL_PERSONA_ID, SIGNAL_TOOL_NAMES, } from "../chat/signal.persona.js";
|
|
20
|
+
export { createAgentTools, } from "./application/index.js";
|
|
21
|
+
export { SYSTEM_AGENT_IDS, } from "./domain/index.js";
|
|
22
|
+
export type { AgentToolDeps, } from "./ports/index.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ChatGraphFactory, } from "../chat/chat.graph.js";
|
|
2
|
+
export { ChatInterruptClassifier, } from "../chat/chat.interrupt.classifier.js";
|
|
3
|
+
export { SuggestionGenerator, } from "../chat/chat.suggester.js";
|
|
4
|
+
export { ChatSummarizer, } from "../chat/chat.summarizer.js";
|
|
5
|
+
export { ChatTitleGenerator, } from "../chat/chat.title.generator.js";
|
|
6
|
+
export { createChatTools, } from "../chat/chat.tools.js";
|
|
7
|
+
export { createNegotiatorPersona, NEGOTIATOR_PERSONA_ID, } from "../chat/negotiator.persona.js";
|
|
8
|
+
export { createOnboardingTools, filterOnboardingTools, narrowOnboardingTools, ONBOARDING_PERSONA, ONBOARDING_PERSONA_ID, ONBOARDING_PROFILE_KICKOFF, ONBOARDING_TOOL_NAMES, } from "../chat/onboarding.persona.js";
|
|
9
|
+
export { createReporterTools, filterReporterTools, narrowReporterTools, REPORTER_BRIEFING_KICKOFF, REPORTER_PERSONA, REPORTER_PERSONA_ID, REPORTER_TOOL_NAMES, } from "../chat/reporter.persona.js";
|
|
10
|
+
export { createSignalTools, filterSignalTools, narrowSignalTools, SIGNAL_NEW_SIGNAL_KICKOFF, SIGNAL_PERSONA, SIGNAL_PERSONA_ID, SIGNAL_TOOL_NAMES, } from "../chat/signal.persona.js";
|
|
11
|
+
export { createAgentTools, } from "./application/index.js";
|
|
12
|
+
export { SYSTEM_AGENT_IDS, } from "./domain/index.js";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* participant-context —
|
|
2
|
+
* participant-context — the capability's sole cross-capability surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* participant-context/ports; this barrel is for cross-capability consumers
|
|
8
|
-
* that must go through the participant-context public surface.
|
|
4
|
+
* Enrichment, premises, generated participant context, and HyDE representations
|
|
5
|
+
* are one capability; only orchestration entry points and the read-model
|
|
6
|
+
* generator cross its edge.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* direct shared/hyde imports from root index.ts remain as compatibility
|
|
14
|
-
* re-exports pointing here.
|
|
8
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
9
|
+
* Supersedes the capabilities/participant-context.facade.ts + public/ pair; the
|
|
10
|
+
* export list is the union of the facades it replaces, so the contract is unchanged.
|
|
15
11
|
*/
|
|
16
|
-
export
|
|
12
|
+
export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator, HydeGraphFactory, HydeGenerator, LensInferrer, } from "./application/index.js";
|
|
13
|
+
export type { EnrichmentToolDeps, PremiseToolDeps, } from "./ports/participant-context.tools.port.js";
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* participant-context —
|
|
2
|
+
* participant-context — the capability's sole cross-capability surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* participant-context/ports; this barrel is for cross-capability consumers
|
|
8
|
-
* that must go through the participant-context public surface.
|
|
4
|
+
* Enrichment, premises, generated participant context, and HyDE representations
|
|
5
|
+
* are one capability; only orchestration entry points and the read-model
|
|
6
|
+
* generator cross its edge.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* direct shared/hyde imports from root index.ts remain as compatibility
|
|
14
|
-
* re-exports pointing here.
|
|
8
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
9
|
+
* Supersedes the capabilities/participant-context.facade.ts + public/ pair; the
|
|
10
|
+
* export list is the union of the facades it replaces, so the contract is unchanged.
|
|
15
11
|
*/
|
|
16
|
-
export
|
|
12
|
+
export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator,
|
|
13
|
+
// HyDE — participant-context technology binding
|
|
14
|
+
HydeGraphFactory, HydeGenerator, LensInferrer, } from "./application/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ToolRegistryCompositionDeps } from "
|
|
1
|
+
import type { ToolRegistryCompositionDeps } from "../../shared/agent/tool.helpers.js";
|
|
2
2
|
/** Host capabilities consumed by enrichment and premise-derived identity tools. */
|
|
3
3
|
export type EnrichmentToolDeps = Pick<ToolRegistryCompositionDeps, "userDb" | "systemDb" | "enricher" | "grantDefaultSystemPermissions" | "reportToolError" | "getUserContextText" | "enrichmentRuns" | "enrichmentRunQueue"> & {
|
|
4
4
|
graphs: Pick<ToolRegistryCompositionDeps["graphs"], "profile">;
|
|
@@ -2,7 +2,7 @@ import type { PremiseAnalyzerOutput } from "./premise.analyzer.js";
|
|
|
2
2
|
import { PremiseIndexer } from "./premise.indexer.js";
|
|
3
3
|
import type { PremiseGraphDatabase, PremiseAnalysis } from "../shared/interfaces/database.interface.js";
|
|
4
4
|
import type { Embedder } from "../shared/interfaces/embedder.interface.js";
|
|
5
|
-
import type { DebugMetaAgent } from "../
|
|
5
|
+
import type { DebugMetaAgent } from "../participant-agents/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Graph factory for premise lifecycle: create, update, and query modes.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PremiseAnalysis, PremiseRecord } from "../shared/interfaces/database.interface.js";
|
|
2
|
-
import type { DebugMetaAgent } from '../
|
|
2
|
+
import type { DebugMetaAgent } from '../participant-agents/index.js';
|
|
3
3
|
import type { ToolScopeType } from '../shared/agent/tool.scope.js';
|
|
4
4
|
export declare const PremiseGraphState: import("@langchain/langgraph").AnnotationRoot<{
|
|
5
5
|
userId: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DefineTool } from "../shared/agent/tool.helpers.js";
|
|
2
|
-
import type { PremiseToolDeps } from "../
|
|
2
|
+
import type { PremiseToolDeps } from "../participant-context/ports/participant-context.tools.port.js";
|
|
3
3
|
export declare function createPremiseTools(defineTool: DefineTool, deps: PremiseToolDeps): any[];
|
|
@@ -32,7 +32,7 @@ export { isValidQuestionerInputContract, } from "./question.input.js";
|
|
|
32
32
|
export type { QuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, IntentContext, RecoveryIntentContext, NegotiationContext, PostStallNegotiationContext, UptakeNegotiationContext, NegotiationInflightContext, ChatContext, PoolDiscoveryContext, PostStallQuestionerInput, InflightQuestionerInput, UptakeQuestionerInput, RecoveryQuestionerInput, } from "./question.input.js";
|
|
33
33
|
export { QuestionerAgent } from "./question.agent.js";
|
|
34
34
|
export type { QuestionerAgentConfig } from "./question.agent.js";
|
|
35
|
-
export { isQuestionerEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, chatQuestionWaitTimeoutMs, CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT, UPTAKE_AUTHORITY_THRESHOLD_DEFAULT, } from "./question.env.js";
|
|
35
|
+
export { isQuestionerEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, chatQuestionWaitTimeoutMs, intentQuestionDailyCap, CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT, UPTAKE_AUTHORITY_THRESHOLD_DEFAULT, INTENT_QUESTION_DAILY_CAP_DEFAULT, INTENT_QUESTION_DAILY_WINDOW_HOURS, } from "./question.env.js";
|
|
36
36
|
export { getPreset } from "./question.presets.js";
|
|
37
37
|
export type { QuestionerPreset } from "./question.presets.js";
|
|
38
38
|
export { createQuestionerTools } from "./question.tools.js";
|
|
@@ -33,7 +33,7 @@ export { isValidQuestionerInputContract, } from "./question.input.js";
|
|
|
33
33
|
// ── Agent ─────────────────────────────────────────────────────────────────────
|
|
34
34
|
export { QuestionerAgent } from "./question.agent.js";
|
|
35
35
|
// ── Env ───────────────────────────────────────────────────────────────────────
|
|
36
|
-
export { isQuestionerEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, chatQuestionWaitTimeoutMs, CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT, UPTAKE_AUTHORITY_THRESHOLD_DEFAULT, } from "./question.env.js";
|
|
36
|
+
export { isQuestionerEnabled, isUptakeGuardEnabled, uptakeAuthorityThreshold, chatQuestionWaitTimeoutMs, intentQuestionDailyCap, CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT, UPTAKE_AUTHORITY_THRESHOLD_DEFAULT, INTENT_QUESTION_DAILY_CAP_DEFAULT, INTENT_QUESTION_DAILY_WINDOW_HOURS, } from "./question.env.js";
|
|
37
37
|
// ── Presets ───────────────────────────────────────────────────────────────────
|
|
38
38
|
export { getPreset } from "./question.presets.js";
|
|
39
39
|
// ── Foreground adapter tools ──────────────────────────────────────────────────
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* authority threshold (0-100, default 70).
|
|
12
12
|
* QUESTIONER_CHAT_WAIT_TIMEOUT_MS how long the blocking ask_user_question chat
|
|
13
13
|
* tool waits for an inline answer (default 4 min).
|
|
14
|
+
* QUESTIONER_INTENT_DAILY_CAP refinement questions one intent may generate
|
|
15
|
+
* per rolling 24h, recovery + pool combined
|
|
16
|
+
* (default 2; 0 disables refinement).
|
|
14
17
|
*
|
|
15
18
|
* All reads go through this module — do not read these variables via
|
|
16
19
|
* `process.env` elsewhere. Values are read on every call (no caching) so tests
|
|
@@ -21,6 +24,25 @@
|
|
|
21
24
|
*/
|
|
22
25
|
export declare const CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT = 240000;
|
|
23
26
|
export declare const UPTAKE_AUTHORITY_THRESHOLD_DEFAULT = 70;
|
|
27
|
+
/**
|
|
28
|
+
* Refinement questions a single intent may generate per rolling window.
|
|
29
|
+
*
|
|
30
|
+
* Recovery and pool mining both re-arm when the intent text changes, and
|
|
31
|
+
* answering a refinement question is itself what changes it — so each answer
|
|
32
|
+
* buys another question and the loop ends only when the user stops replying.
|
|
33
|
+
* Measured on a dev account: 27 questions against three intents in 9.5 hours,
|
|
34
|
+
* one discriminator asked three times, while the best-scoring match had already
|
|
35
|
+
* been found after the first question.
|
|
36
|
+
*/
|
|
37
|
+
export declare const INTENT_QUESTION_DAILY_CAP_DEFAULT = 2;
|
|
38
|
+
/**
|
|
39
|
+
* Width of the budget window, in hours.
|
|
40
|
+
*
|
|
41
|
+
* Rolling rather than per-UTC-day deliberately: the observed bursts straddled
|
|
42
|
+
* midnight UTC (20:22-21:18, then 05:48-05:55), and a calendar-day budget would
|
|
43
|
+
* have granted the second burst a full fresh allowance.
|
|
44
|
+
*/
|
|
45
|
+
export declare const INTENT_QUESTION_DAILY_WINDOW_HOURS = 24;
|
|
24
46
|
/** Master switch: is any background question generation enabled? */
|
|
25
47
|
export declare function isQuestionerEnabled(): boolean;
|
|
26
48
|
/** Advisory uptake interlock. Flag-off by default and subordinate to the master switch. */
|
|
@@ -29,3 +51,10 @@ export declare function isUptakeGuardEnabled(): boolean;
|
|
|
29
51
|
export declare function uptakeAuthorityThreshold(): number;
|
|
30
52
|
/** Wait budget for the blocking ask_user_question chat tool. */
|
|
31
53
|
export declare function chatQuestionWaitTimeoutMs(): number;
|
|
54
|
+
/**
|
|
55
|
+
* Per-intent refinement budget over {@link INTENT_QUESTION_DAILY_WINDOW_HOURS}.
|
|
56
|
+
*
|
|
57
|
+
* Zero is a meaningful setting — it disables background refinement entirely
|
|
58
|
+
* without touching the master switch — so this does not reuse `positiveIntEnv`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function intentQuestionDailyCap(): number;
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* authority threshold (0-100, default 70).
|
|
12
12
|
* QUESTIONER_CHAT_WAIT_TIMEOUT_MS how long the blocking ask_user_question chat
|
|
13
13
|
* tool waits for an inline answer (default 4 min).
|
|
14
|
+
* QUESTIONER_INTENT_DAILY_CAP refinement questions one intent may generate
|
|
15
|
+
* per rolling 24h, recovery + pool combined
|
|
16
|
+
* (default 2; 0 disables refinement).
|
|
14
17
|
*
|
|
15
18
|
* All reads go through this module — do not read these variables via
|
|
16
19
|
* `process.env` elsewhere. Values are read on every call (no caching) so tests
|
|
@@ -21,6 +24,25 @@
|
|
|
21
24
|
*/
|
|
22
25
|
export const CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT = 240000;
|
|
23
26
|
export const UPTAKE_AUTHORITY_THRESHOLD_DEFAULT = 70;
|
|
27
|
+
/**
|
|
28
|
+
* Refinement questions a single intent may generate per rolling window.
|
|
29
|
+
*
|
|
30
|
+
* Recovery and pool mining both re-arm when the intent text changes, and
|
|
31
|
+
* answering a refinement question is itself what changes it — so each answer
|
|
32
|
+
* buys another question and the loop ends only when the user stops replying.
|
|
33
|
+
* Measured on a dev account: 27 questions against three intents in 9.5 hours,
|
|
34
|
+
* one discriminator asked three times, while the best-scoring match had already
|
|
35
|
+
* been found after the first question.
|
|
36
|
+
*/
|
|
37
|
+
export const INTENT_QUESTION_DAILY_CAP_DEFAULT = 2;
|
|
38
|
+
/**
|
|
39
|
+
* Width of the budget window, in hours.
|
|
40
|
+
*
|
|
41
|
+
* Rolling rather than per-UTC-day deliberately: the observed bursts straddled
|
|
42
|
+
* midnight UTC (20:22-21:18, then 05:48-05:55), and a calendar-day budget would
|
|
43
|
+
* have granted the second burst a full fresh allowance.
|
|
44
|
+
*/
|
|
45
|
+
export const INTENT_QUESTION_DAILY_WINDOW_HOURS = 24;
|
|
24
46
|
/**
|
|
25
47
|
* Parse a positive integer env var, clamped to the safe-integer range so a
|
|
26
48
|
* malformed env value cannot crash `AbortSignal.timeout` (which throws on
|
|
@@ -57,3 +79,17 @@ export function uptakeAuthorityThreshold() {
|
|
|
57
79
|
export function chatQuestionWaitTimeoutMs() {
|
|
58
80
|
return positiveIntEnv("QUESTIONER_CHAT_WAIT_TIMEOUT_MS", CHAT_QUESTION_WAIT_TIMEOUT_MS_DEFAULT);
|
|
59
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Per-intent refinement budget over {@link INTENT_QUESTION_DAILY_WINDOW_HOURS}.
|
|
84
|
+
*
|
|
85
|
+
* Zero is a meaningful setting — it disables background refinement entirely
|
|
86
|
+
* without touching the master switch — so this does not reuse `positiveIntEnv`.
|
|
87
|
+
*/
|
|
88
|
+
export function intentQuestionDailyCap() {
|
|
89
|
+
const raw = process.env.QUESTIONER_INTENT_DAILY_CAP;
|
|
90
|
+
if (!raw?.trim())
|
|
91
|
+
return INTENT_QUESTION_DAILY_CAP_DEFAULT;
|
|
92
|
+
if (!/^\d+$/.test(raw.trim()))
|
|
93
|
+
return INTENT_QUESTION_DAILY_CAP_DEFAULT;
|
|
94
|
+
return Number.parseInt(raw, 10);
|
|
95
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { ToolScopeType } from "../../shared/agent/tool.scope.js";
|
|
21
21
|
import type { NegotiationQuestionCandidate, QuestionMode, QuestionPoolDiscriminator } from "../domain/question.schema.js";
|
|
22
|
-
import type { NegotiationConsultationReason } from "../../
|
|
22
|
+
import type { NegotiationConsultationReason } from "../../negotiation/index.js";
|
|
23
23
|
/** Intent context — data needed to generate questions about an intent. */
|
|
24
24
|
export interface IntentContext {
|
|
25
25
|
intentId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, NEGOTIATION_QUESTION_GENERIC_UPTAKE_ACTIVITY } from "../../
|
|
1
|
+
import { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, NEGOTIATION_QUESTION_GENERIC_UPTAKE_ACTIVITY } from "../../negotiation/index.js";
|
|
2
2
|
/** Runtime mirror of the mode/purpose/context discriminant used at queue boundaries. */
|
|
3
3
|
export function isValidQuestionerInputContract(input) {
|
|
4
4
|
if (input.purpose === 'recovery') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QUD_UNDERSPECIFICATION_RULES } from "./question.qud.js";
|
|
2
|
-
import { consultationPromptFor } from "../../
|
|
2
|
+
import { consultationPromptFor } from "../../negotiation/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared rule block appended to every questioner system prompt. Enforces that
|
|
5
5
|
* the generated `prompt` resolves on its own — no demonstratives/anaphora that
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* IND-547: canonical question schema in the questions domain layer.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from "zod";
|
|
11
|
+
import { UnderspecificationTypeSchema, type UnderspecificationType } from "../../shared/schemas/underspecification.schema.js";
|
|
12
|
+
export { UnderspecificationTypeSchema };
|
|
11
13
|
export declare const QuestionOptionSchema: z.ZodObject<{
|
|
12
14
|
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
13
15
|
label: z.ZodString;
|
|
@@ -75,8 +77,6 @@ export declare const QuestionSchema: z.ZodObject<{
|
|
|
75
77
|
multiSelect: boolean;
|
|
76
78
|
evidence?: string | null | undefined;
|
|
77
79
|
}>;
|
|
78
|
-
/** Canonical QUD repair categories for underspecified intents/questions. */
|
|
79
|
-
export declare const UnderspecificationTypeSchema: z.ZodEnum<["missing_constituent", "missing_constraint", "open_alternative_set"]>;
|
|
80
80
|
export declare const QuestionStrategySchema: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
|
|
81
81
|
export declare const QuestionWithStrategySchema: z.ZodObject<{
|
|
82
82
|
/** ≤12 chars. Noun of the decision domain — e.g. "Stage", "Timing", "Role". */
|
|
@@ -234,7 +234,7 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
|
|
|
234
234
|
}>;
|
|
235
235
|
export type QuestionOption = z.infer<typeof QuestionOptionSchema>;
|
|
236
236
|
export type Question = z.infer<typeof QuestionSchema>;
|
|
237
|
-
export type UnderspecificationType
|
|
237
|
+
export type { UnderspecificationType };
|
|
238
238
|
export type QuestionStrategy = z.infer<typeof QuestionStrategySchema>;
|
|
239
239
|
export type QuestionWithStrategy = z.infer<typeof QuestionWithStrategySchema>;
|
|
240
240
|
export type QuestionGeneratorResponse = z.infer<typeof QuestionGeneratorResponseSchema>;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* IND-547: canonical question schema in the questions domain layer.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from "zod";
|
|
11
|
+
import { UnderspecificationTypeSchema } from "../../shared/schemas/underspecification.schema.js";
|
|
12
|
+
export { UnderspecificationTypeSchema };
|
|
11
13
|
export const QuestionOptionSchema = z.object({
|
|
12
14
|
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
13
15
|
label: z.string().min(1).max(120),
|
|
@@ -40,12 +42,6 @@ export const QuestionSchema = z.object({
|
|
|
40
42
|
*/
|
|
41
43
|
evidence: z.string().min(1).max(160).nullable().optional().transform((value) => value ?? undefined),
|
|
42
44
|
});
|
|
43
|
-
/** Canonical QUD repair categories for underspecified intents/questions. */
|
|
44
|
-
export const UnderspecificationTypeSchema = z.enum([
|
|
45
|
-
"missing_constituent",
|
|
46
|
-
"missing_constraint",
|
|
47
|
-
"open_alternative_set",
|
|
48
|
-
]);
|
|
49
45
|
export const QuestionStrategySchema = z.enum([
|
|
50
46
|
"refine_intent",
|
|
51
47
|
"surface_missing_detail",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* questions — the capability's sole cross-capability surface.
|
|
3
|
+
*
|
|
4
|
+
* Anything outside this capability imports from here and nowhere else.
|
|
5
|
+
* Supersedes the capabilities/*.facade.ts + questions/public/ pair; the export
|
|
6
|
+
* list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export type { QuestionerEnqueueFn, } from "./application/question.input.js";
|
|
9
|
+
export { createAskUserQuestionTools, createQuestionerTools, INTENT_QUESTION_DAILY_CAP_DEFAULT, INTENT_QUESTION_DAILY_WINDOW_HOURS, intentQuestionDailyCap, isQuestionerEnabled, isUptakeGuardEnabled, isValidQuestionerInputContract, QuestionerAgent, uptakeAuthorityThreshold, } from "./application/index.js";
|
|
10
|
+
export type { InflightQuestionerInput, PoolDiscoveryContext, PostStallQuestionerInput, QuestionerEnqueuePayload, QuestionerInput, RecoveryQuestionerInput, UptakeQuestionerInput, } from "./application/index.js";
|
|
11
|
+
export type { AskUserQuestionToolDeps, ChatQuestionsHost, PersistableQuestion, PersistedQuestion, QuestionerDatabase, QuestionerToolDeps, QuestionFilters, } from "./ports/index.js";
|
|
12
|
+
export { NegotiationQuestionCandidateSchema, NegotiationQuestionProvenanceSchema, UnderspecificationTypeSchema, } from "./domain/index.js";
|
|
13
|
+
export type { NegotiationQuestionCandidate, QuestionOption, NegotiationQuestionProvenance, NegotiationQuestionPurpose, Question, QuestionGenerationResult, QuestionPoolDiscriminator, QuestionPoolPush, QuestionPoolPushRequestReason, QuestionPoolPushRequestStatus, QuestionPoolSnapshot, QuestionPurpose, QuestionRecoverySnapshot, QuestionStrategy, QuestionVoidedReason, UnderspecificationType, } from "./domain/index.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createAskUserQuestionTools, createQuestionerTools, INTENT_QUESTION_DAILY_CAP_DEFAULT, INTENT_QUESTION_DAILY_WINDOW_HOURS, intentQuestionDailyCap, isQuestionerEnabled, isUptakeGuardEnabled, isValidQuestionerInputContract, QuestionerAgent, uptakeAuthorityThreshold, } from "./application/index.js";
|
|
2
|
+
export { NegotiationQuestionCandidateSchema, NegotiationQuestionProvenanceSchema, UnderspecificationTypeSchema, } from "./domain/index.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { tool } from "@langchain/core/tools";
|
|
2
2
|
import { IntentGraphFactory } from "../../signals/application/intent.graph.js";
|
|
3
3
|
import { EnrichmentGraphFactory } from "../../enrichment/enrichment.graph.js";
|
|
4
|
-
import { OpportunityGraphFactory } from "../../
|
|
4
|
+
import { OpportunityGraphFactory } from "../../opportunity/index.js";
|
|
5
5
|
import { HydeGraphFactory } from "../hyde/hyde.graph.js";
|
|
6
6
|
import { HydeGenerator } from "../hyde/hyde.generator.js";
|
|
7
7
|
import { LensInferrer } from "../hyde/lens.inferrer.js";
|
|
8
|
-
import { NetworkGraphFactory, NetworkMembershipGraphFactory, IntentNetworkGraphFactory } from "../../
|
|
8
|
+
import { NetworkGraphFactory, NetworkMembershipGraphFactory, IntentNetworkGraphFactory } from "../../communities/index.js";
|
|
9
9
|
import { IntentIndexer } from "../../signals/application/intent.indexer.js";
|
|
10
|
-
import { NegotiationGraphFactory } from "../../
|
|
10
|
+
import { NegotiationGraphFactory } from "../../negotiation/index.js";
|
|
11
11
|
import { PremiseGraphFactory } from "../../premise/premise.graph.js";
|
|
12
12
|
import { protocolLogger } from "../observability/protocol.logger.js";
|
|
13
13
|
import { resolveChatContext, error, redactSensitiveFields } from "./tool.helpers.js";
|
|
@@ -15,15 +15,18 @@ import { deriveAllowedNetworkIds, focusedIntentId, scopeFromNetworkId } from "./
|
|
|
15
15
|
import { invokeToolRuntime, toolRuntimeErrorToResult } from "./tool.runtime.js";
|
|
16
16
|
import { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
|
|
17
17
|
import { createIntentTools } from "../../signals/application/intent.tools.js";
|
|
18
|
-
import { createNetworkTools } from "../../
|
|
19
|
-
import { createOpportunityTools } from "../../
|
|
18
|
+
import { createNetworkTools } from "../../communities/index.js";
|
|
19
|
+
import { createOpportunityTools } from "../../opportunity/index.js";
|
|
20
20
|
import { createUtilityTools } from "./utility.tools.js";
|
|
21
|
-
import { createIntegrationTools } from "../../
|
|
22
|
-
import { createContactTools } from "../../
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
import { createIntegrationTools } from "../../integrations/index.js";
|
|
22
|
+
import { createContactTools } from "../../contacts/index.js";
|
|
23
|
+
// The composition root reaches the leaf directly (it is exempt from the barrel
|
|
24
|
+
// rule by design): importing participant-agents/index.js here would pull in the
|
|
25
|
+
// chat personas, which import this module back -- a runtime cycle.
|
|
26
|
+
import { createAgentTools } from "../../participant-agents/application/agent.tools.js";
|
|
27
|
+
import { createNegotiationTools } from "../../negotiation/index.js";
|
|
25
28
|
import { createPremiseTools } from "../../premise/premise.tools.js";
|
|
26
|
-
import { createQuestionerTools, createAskUserQuestionTools } from "../../
|
|
29
|
+
import { createQuestionerTools, createAskUserQuestionTools } from "../../questions/index.js";
|
|
27
30
|
import { bindOwnerApprovalProvenance } from "../../opportunity/application/opportunity.owner-provenance.js";
|
|
28
31
|
const logger = protocolLogger("ChatTools");
|
|
29
32
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { error, redactSensitiveFields } from './tool.helpers.js';
|
|
2
2
|
import { createEnrichmentTools } from '../../enrichment/enrichment.tools.js';
|
|
3
3
|
import { createIntentTools } from '../../signals/application/intent.tools.js';
|
|
4
|
-
import { createNetworkTools } from '../../
|
|
5
|
-
import { createOpportunityTools } from '../../
|
|
4
|
+
import { createNetworkTools } from '../../communities/index.js';
|
|
5
|
+
import { createOpportunityTools } from '../../opportunity/index.js';
|
|
6
6
|
import { createUtilityTools } from './utility.tools.js';
|
|
7
|
-
import { createIntegrationTools } from '../../
|
|
8
|
-
import { createContactTools } from '../../
|
|
9
|
-
import { createAgentTools } from '../../
|
|
10
|
-
import { createNegotiationTools } from '../../
|
|
7
|
+
import { createIntegrationTools } from '../../integrations/index.js';
|
|
8
|
+
import { createContactTools } from '../../contacts/index.js';
|
|
9
|
+
import { createAgentTools } from '../../participant-agents/index.js';
|
|
10
|
+
import { createNegotiationTools } from '../../negotiation/index.js';
|
|
11
11
|
import { createChatTools } from '../../chat/chat.tools.js';
|
|
12
12
|
import { createPremiseTools } from '../../premise/premise.tools.js';
|
|
13
|
-
import { createQuestionerTools } from '../../
|
|
13
|
+
import { createQuestionerTools } from '../../questions/index.js';
|
|
14
14
|
import { protocolLogger } from '../observability/protocol.logger.js';
|
|
15
15
|
import { requestContext } from '../observability/request-context.js';
|
|
16
16
|
const logger = protocolLogger('ToolRegistry');
|
|
@@ -53,32 +53,32 @@ export declare const McpResolvedIdentitySchema: z.ZodEffects<z.ZodObject<{
|
|
|
53
53
|
networkScopeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
}, "strict", z.ZodTypeAny, {
|
|
55
55
|
userId: string;
|
|
56
|
-
agentId?: string | undefined;
|
|
57
56
|
networkScopeId?: string | null | undefined;
|
|
57
|
+
agentId?: string | undefined;
|
|
58
58
|
enrollmentCapable?: boolean | undefined;
|
|
59
59
|
isDeliveryAgent?: boolean | undefined;
|
|
60
60
|
isSessionAuth?: boolean | undefined;
|
|
61
61
|
isHermesAgent?: boolean | undefined;
|
|
62
62
|
}, {
|
|
63
63
|
userId: string;
|
|
64
|
-
agentId?: string | undefined;
|
|
65
64
|
networkScopeId?: string | null | undefined;
|
|
65
|
+
agentId?: string | undefined;
|
|
66
66
|
enrollmentCapable?: boolean | undefined;
|
|
67
67
|
isDeliveryAgent?: boolean | undefined;
|
|
68
68
|
isSessionAuth?: boolean | undefined;
|
|
69
69
|
isHermesAgent?: boolean | undefined;
|
|
70
70
|
}>, {
|
|
71
71
|
userId: string;
|
|
72
|
-
agentId?: string | undefined;
|
|
73
72
|
networkScopeId?: string | null | undefined;
|
|
73
|
+
agentId?: string | undefined;
|
|
74
74
|
enrollmentCapable?: boolean | undefined;
|
|
75
75
|
isDeliveryAgent?: boolean | undefined;
|
|
76
76
|
isSessionAuth?: boolean | undefined;
|
|
77
77
|
isHermesAgent?: boolean | undefined;
|
|
78
78
|
}, {
|
|
79
79
|
userId: string;
|
|
80
|
-
agentId?: string | undefined;
|
|
81
80
|
networkScopeId?: string | null | undefined;
|
|
81
|
+
agentId?: string | undefined;
|
|
82
82
|
enrollmentCapable?: boolean | undefined;
|
|
83
83
|
isDeliveryAgent?: boolean | undefined;
|
|
84
84
|
isSessionAuth?: boolean | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical QUD repair categories for underspecified intents/questions.
|
|
4
|
+
*
|
|
5
|
+
* Shared between signals (the intent clarifier decides whether an utterance is
|
|
6
|
+
* underspecified) and questions (which records the category on the question it
|
|
7
|
+
* raises). It lives here rather than inside either capability because both need
|
|
8
|
+
* it: filing it under `questions/domain` meant the signals clarifier had to
|
|
9
|
+
* import the whole questions capability — LLM agents and tools included — to
|
|
10
|
+
* reach a three-value enum.
|
|
11
|
+
*/
|
|
12
|
+
export declare const UnderspecificationTypeSchema: z.ZodEnum<["missing_constituent", "missing_constraint", "open_alternative_set"]>;
|
|
13
|
+
export type UnderspecificationType = z.infer<typeof UnderspecificationTypeSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical QUD repair categories for underspecified intents/questions.
|
|
4
|
+
*
|
|
5
|
+
* Shared between signals (the intent clarifier decides whether an utterance is
|
|
6
|
+
* underspecified) and questions (which records the category on the question it
|
|
7
|
+
* raises). It lives here rather than inside either capability because both need
|
|
8
|
+
* it: filing it under `questions/domain` meant the signals clarifier had to
|
|
9
|
+
* import the whole questions capability — LLM agents and tools included — to
|
|
10
|
+
* reach a three-value enum.
|
|
11
|
+
*/
|
|
12
|
+
export const UnderspecificationTypeSchema = z.enum([
|
|
13
|
+
"missing_constituent",
|
|
14
|
+
"missing_constraint",
|
|
15
|
+
"open_alternative_set",
|
|
16
|
+
]);
|