@indexnetwork/protocol 4.3.7-rc.316.1 → 4.3.7-rc.317.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/index.d.ts CHANGED
@@ -109,7 +109,9 @@ export type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWith
109
109
  export { persistOpportunities } from "./opportunity/opportunity.persist.js";
110
110
  export { presentOpportunity } from "./opportunity/opportunity.presentation.js";
111
111
  export type { UserInfo } from "./opportunity/opportunity.presentation.js";
112
- export { stripUuids, stripIntroducerMentions } from "./opportunity/opportunity.presentation.js";
112
+ export { stripUuids, stripIntroducerMentions, truncateAtBoundary } from "./opportunity/opportunity.presentation.js";
113
+ export { safeFallbackSummary, getSafePresentationOrSkip, SAFE_FALLBACK_MAX_CHARS, DEFAULT_FALLBACK_HEADLINE, DEFAULT_FALLBACK_ACTION, DEFAULT_EMPTY_FALLBACK_TEXT } from "./opportunity/opportunity.safe-presentation.js";
114
+ export type { SafeFallbackOptions, SafePresentation, SafePresentationOptions, SafePresentationSource } from "./opportunity/opportunity.safe-presentation.js";
113
115
  export { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from "./opportunity/delivery-card.cache.js";
114
116
  export { createToolRegistry } from "./shared/agent/tool.registry.js";
115
117
  export { createAgentTools } from './agent/agent.tools.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,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AE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAChJ,YAAY,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI/E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
package/dist/index.js CHANGED
@@ -72,7 +72,8 @@ export { computeFeedHealth } from "./opportunity/feed/feed.health.js";
72
72
  export { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from "./opportunity/opportunity.introducer.js";
73
73
  export { persistOpportunities } from "./opportunity/opportunity.persist.js";
74
74
  export { presentOpportunity } from "./opportunity/opportunity.presentation.js";
75
- export { stripUuids, stripIntroducerMentions } from "./opportunity/opportunity.presentation.js";
75
+ export { stripUuids, stripIntroducerMentions, truncateAtBoundary } from "./opportunity/opportunity.presentation.js";
76
+ export { safeFallbackSummary, getSafePresentationOrSkip, SAFE_FALLBACK_MAX_CHARS, DEFAULT_FALLBACK_HEADLINE, DEFAULT_FALLBACK_ACTION, DEFAULT_EMPTY_FALLBACK_TEXT } from "./opportunity/opportunity.safe-presentation.js";
76
77
  export { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL } from "./opportunity/delivery-card.cache.js";
77
78
  // ─── Tools ────────────────────────────────────────────────────────────────────
78
79
  export { createToolRegistry } from "./shared/agent/tool.registry.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,4DAA4D;AAC5D,gFAAgF;AAChF,+EAA+E;AAC/E,qDAAqD;AACrD,EAAE;AACF,yDAAyD;AACzD,2EAA2E;AAC3E,mEAAmE;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,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAwD,MAAM,sCAAsC,CAAC;AAEnK,iFAAiF;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEpI,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AASvE,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// =============================================================================\n// @indexnetwork/protocol — public API barrel\n//\n// This file is the ONLY supported entry point. Deep imports\n// (\"@indexnetwork/protocol/src/...\") are not part of the contract and may break\n// in any release. Every symbol is re-exported explicitly (no wildcards) so the\n// surface is reviewable and changes are intentional.\n//\n// Stability tiers are defined in STABILITY.md. In short:\n// • Stable — Interfaces, Graph factories, Agents, createChatTools,\n// the tool/runtime helpers, and shared schemas.\n// • Experimental — Sections marked @experimental below (advanced graph state\n// types and internal helpers); may change in a minor release.\n// =============================================================================\n\n// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport {\n deriveAllowedNetworkIds,\n deriveDiscoveryNetworkIds,\n focusedNetworkId,\n focusedNetworkLabel,\n hasNetworkScope,\n scopeFromNetworkId,\n} from \"./shared/agent/tool.scope.js\";\nexport type { ToolScopeEnvelope, ToolScopeType, ScopeMembership, DeriveNetworkScopeInput } from \"./shared/agent/tool.scope.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type { McpAuthResolver } from \"./shared/interfaces/auth.interface.js\";\nexport type { Cache, CacheOptions, HydeCache, OpportunityCache } from \"./shared/interfaces/cache.interface.js\";\nexport type { ChatSessionReader, ChatSessionDetail, ChatSessionSummary } from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type { ContactServiceAdapter, ContactEntry, ContactImportResult, ContactInput, ContactResult, ContactSearchResult } from \"./shared/interfaces/contact.interface.js\";\nexport type {\n ChatGraphCompositeDatabase, UserDatabase, SystemDatabase, Database,\n OpportunityGraphDatabase, OpportunityControllerDatabase, HomeGraphDatabase,\n IntentGraphDatabase, IntentNetworkGraphDatabase, NetworkGraphDatabase, NetworkMembershipGraphDatabase,\n HydeGraphDatabase, EnrichmentGraphDatabase, PremiseGraphDatabase, NegotiationGraphDatabase,\n NegotiationQueries, NegotiationUserAnswer,\n Opportunity, OpportunityActor, OpportunityContext, OpportunityDetection, OpportunityInterpretation,\n OpportunityQueryOptions, OpportunitySignal, OpportunityStatus,\n ActiveIntent, CreatedIntent, CreateIntentData, UpdateIntentData, IntentRecord, SimilarIntent, SimilarIntentSearchOptions,\n IndexedIntentDetails, IndexMemberDetails, AssignmentNetworkMembership, NetworkAssignmentContext, NetworkMembership, OwnedIndex,\n CreateHydeDocumentData, HydeDocument, HydeSourceType, CreateOpportunityData,\n PremiseAnalysis, PremiseAssertion, PremiseProvenance, PremiseRecord, PremiseValidity,\n OnboardingPrivacyState, OnboardingProfileSeed, OnboardingState, PrivacyConsentDecision, PrivacyConsentSource,\n UpdateIndexSettingsData, UserRecord, UserSocial, ArchiveResult, Id,\n} from \"./shared/interfaces/database.interface.js\";\nexport type {\n Embedder, EmbeddingGenerator, EmbeddingGenerateOptions,\n VectorStore, VectorStoreOption, VectorSearchResult,\n HydeCandidate, HydeSearchOptions, LensEmbedding,\n} from \"./shared/interfaces/embedder.interface.js\";\nexport type { ProfileEnricher, EnrichmentRequest, EnrichmentResult } from \"./shared/interfaces/enrichment.interface.js\";\nexport type { IntegrationAdapter, IntegrationConnection, IntegrationSession, IntegrationSessionOptions, ToolActionResponse } from \"./shared/interfaces/integration.interface.js\";\nexport type { IntentGraphQueue } from \"./shared/interfaces/queue.interface.js\";\nexport type { Scraper, ExtractUrlContentOptions } from \"./shared/interfaces/scraper.interface.js\";\nexport type { Storage } from \"./shared/interfaces/storage.interface.js\";\nexport type { DeliveryLedger, DeliveredOpportunityRow } from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type { MintConnectLink, ConnectLinkKind } from \"./shared/interfaces/connect-link.interface.js\";\nexport type {\n DiscoveryRunStore, DiscoveryRunQueue, DiscoveryRunInput, CreateDiscoveryRunInput,\n DiscoveryRunRecord, DiscoveryRunStatus,\n} from \"./shared/interfaces/discovery-run.interface.js\";\nexport type {\n EnrichmentRunStore, EnrichmentRunQueue, EnrichmentRunInput, CreateEnrichmentRunInput,\n UpdateUserEnrichmentRunInput, PreviewUserEnrichmentRunInput,\n EnrichmentRunRecord, EnrichmentRunStatus, EnrichmentRunOperation,\n} from \"./shared/interfaces/enrichment-run.interface.js\";\nexport type { NegotiationTimeoutQueue } from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionMode, type QuestionDetection, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { UserIdentitySchema, type UserIdentity } from \"./shared/schemas/identity.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, AssignmentScopeMembership, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport { EnrichmentGraphFactory } from \"./enrichment/enrichment.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createEnrichmentTools } from \"./enrichment/enrichment.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions } from \"./opportunity/opportunity.presentation.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentAllowedNetworkIds, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n// @experimental — internal graph-state shapes; may change in a minor release.\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,4DAA4D;AAC5D,gFAAgF;AAChF,+EAA+E;AAC/E,qDAAqD;AACrD,EAAE;AACF,yDAAyD;AACzD,2EAA2E;AAC3E,mEAAmE;AACnE,+EAA+E;AAC/E,iFAAiF;AACjF,gFAAgF;AAEhF,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAI9D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAcrI,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAyCrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,iFAAiF;AAEjF,OAAO,EAAE,uBAAuB,EAA0B,MAAM,yCAAyC,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE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AC;AASvE,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// =============================================================================\n// @indexnetwork/protocol — public API barrel\n//\n// This file is the ONLY supported entry point. Deep imports\n// (\"@indexnetwork/protocol/src/...\") are not part of the contract and may break\n// in any release. Every symbol is re-exported explicitly (no wildcards) so the\n// surface is reviewable and changes are intentional.\n//\n// Stability tiers are defined in STABILITY.md. In short:\n// • Stable — Interfaces, Graph factories, Agents, createChatTools,\n// the tool/runtime helpers, and shared schemas.\n// • Experimental — Sections marked @experimental below (advanced graph state\n// types and internal helpers); may change in a minor release.\n// =============================================================================\n\n// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport {\n deriveAllowedNetworkIds,\n deriveDiscoveryNetworkIds,\n focusedNetworkId,\n focusedNetworkLabel,\n hasNetworkScope,\n scopeFromNetworkId,\n} from \"./shared/agent/tool.scope.js\";\nexport type { ToolScopeEnvelope, ToolScopeType, ScopeMembership, DeriveNetworkScopeInput } from \"./shared/agent/tool.scope.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type { McpAuthResolver } from \"./shared/interfaces/auth.interface.js\";\nexport type { Cache, CacheOptions, HydeCache, OpportunityCache } from \"./shared/interfaces/cache.interface.js\";\nexport type { ChatSessionReader, ChatSessionDetail, ChatSessionSummary } from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type { ContactServiceAdapter, ContactEntry, ContactImportResult, ContactInput, ContactResult, ContactSearchResult } from \"./shared/interfaces/contact.interface.js\";\nexport type {\n ChatGraphCompositeDatabase, UserDatabase, SystemDatabase, Database,\n OpportunityGraphDatabase, OpportunityControllerDatabase, HomeGraphDatabase,\n IntentGraphDatabase, IntentNetworkGraphDatabase, NetworkGraphDatabase, NetworkMembershipGraphDatabase,\n HydeGraphDatabase, EnrichmentGraphDatabase, PremiseGraphDatabase, NegotiationGraphDatabase,\n NegotiationQueries, NegotiationUserAnswer,\n Opportunity, OpportunityActor, OpportunityContext, OpportunityDetection, OpportunityInterpretation,\n OpportunityQueryOptions, OpportunitySignal, OpportunityStatus,\n ActiveIntent, CreatedIntent, CreateIntentData, UpdateIntentData, IntentRecord, SimilarIntent, SimilarIntentSearchOptions,\n IndexedIntentDetails, IndexMemberDetails, AssignmentNetworkMembership, NetworkAssignmentContext, NetworkMembership, OwnedIndex,\n CreateHydeDocumentData, HydeDocument, HydeSourceType, CreateOpportunityData,\n PremiseAnalysis, PremiseAssertion, PremiseProvenance, PremiseRecord, PremiseValidity,\n OnboardingPrivacyState, OnboardingProfileSeed, OnboardingState, PrivacyConsentDecision, PrivacyConsentSource,\n UpdateIndexSettingsData, UserRecord, UserSocial, ArchiveResult, Id,\n} from \"./shared/interfaces/database.interface.js\";\nexport type {\n Embedder, EmbeddingGenerator, EmbeddingGenerateOptions,\n VectorStore, VectorStoreOption, VectorSearchResult,\n HydeCandidate, HydeSearchOptions, LensEmbedding,\n} from \"./shared/interfaces/embedder.interface.js\";\nexport type { ProfileEnricher, EnrichmentRequest, EnrichmentResult } from \"./shared/interfaces/enrichment.interface.js\";\nexport type { IntegrationAdapter, IntegrationConnection, IntegrationSession, IntegrationSessionOptions, ToolActionResponse } from \"./shared/interfaces/integration.interface.js\";\nexport type { IntentGraphQueue } from \"./shared/interfaces/queue.interface.js\";\nexport type { Scraper, ExtractUrlContentOptions } from \"./shared/interfaces/scraper.interface.js\";\nexport type { Storage } from \"./shared/interfaces/storage.interface.js\";\nexport type { DeliveryLedger, DeliveredOpportunityRow } from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type { MintConnectLink, ConnectLinkKind } from \"./shared/interfaces/connect-link.interface.js\";\nexport type {\n DiscoveryRunStore, DiscoveryRunQueue, DiscoveryRunInput, CreateDiscoveryRunInput,\n DiscoveryRunRecord, DiscoveryRunStatus,\n} from \"./shared/interfaces/discovery-run.interface.js\";\nexport type {\n EnrichmentRunStore, EnrichmentRunQueue, EnrichmentRunInput, CreateEnrichmentRunInput,\n UpdateUserEnrichmentRunInput, PreviewUserEnrichmentRunInput,\n EnrichmentRunRecord, EnrichmentRunStatus, EnrichmentRunOperation,\n} from \"./shared/interfaces/enrichment-run.interface.js\";\nexport type { NegotiationTimeoutQueue } from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionMode, type QuestionDetection, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { UserIdentitySchema, type UserIdentity } from \"./shared/schemas/identity.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, AssignmentScopeMembership, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport { EnrichmentGraphFactory } from \"./enrichment/enrichment.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createEnrichmentTools } from \"./enrichment/enrichment.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions, truncateAtBoundary } from \"./opportunity/opportunity.presentation.js\";\nexport { safeFallbackSummary, getSafePresentationOrSkip, SAFE_FALLBACK_MAX_CHARS, DEFAULT_FALLBACK_HEADLINE, DEFAULT_FALLBACK_ACTION, DEFAULT_EMPTY_FALLBACK_TEXT } from \"./opportunity/opportunity.safe-presentation.js\";\nexport type { SafeFallbackOptions, SafePresentation, SafePresentationOptions, SafePresentationSource } from \"./opportunity/opportunity.safe-presentation.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentAllowedNetworkIds, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n// @experimental — internal graph-state shapes; may change in a minor release.\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"feed.graph.d.ts","sourceRoot":"/","sources":["opportunity/feed/feed.graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAA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wBAAwB,EAAE,iBAAiB,EAEhC,CAAC;AAczB;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAarF;AA4ED,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ;IAAe,OAAO,CAAC,KAAK;gBAApC,QAAQ,EAAE,WAAW,EAAU,KAAK,EAAE,gBAAgB;IAE1E,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4iBZ"}
@@ -17,6 +17,7 @@ import { HomeCategorizerAgent } from './feed.categorizer.js';
17
17
  import { canUserSeeOpportunity, isActionableForViewer, selectByComposition } from '../opportunity.utils.js';
18
18
  import { resolveHomeSectionIcon } from '../../shared/ui/lucide.icon-catalog.js';
19
19
  import { getPrimaryActionLabel, SECONDARY_ACTION_LABEL } from '../opportunity.labels.js';
20
+ import { safeFallbackSummary } from '../opportunity.safe-presentation.js';
20
21
  import { protocolLogger } from '../../shared/observability/protocol.logger.js';
21
22
  import { timed } from '../../shared/observability/performance.js';
22
23
  import { requestContext } from "../../shared/observability/request-context.js";
@@ -336,9 +337,15 @@ export class HomeGraphFactory {
336
337
  userName = profileName;
337
338
  }
338
339
  const userAvatar = otherUser?.avatar ?? null;
339
- const reasoningSnippet = (typeof opportunity.interpretation?.reasoning === 'string'
340
- ? opportunity.interpretation.reasoning.replace(/\s+/g, ' ').trim().slice(0, MAX_REASONING_SNIPPET_LENGTH)
341
- : '') || 'A promising connection.';
340
+ // Shared sanitization standard (UUID strip, viewer-centric rewrite,
341
+ // boundary truncation) — raw reasoning must never render verbatim.
342
+ const reasoningSnippet = safeFallbackSummary(typeof opportunity.interpretation?.reasoning === 'string'
343
+ ? opportunity.interpretation.reasoning
344
+ : '', {
345
+ counterpartName: userName !== 'Unknown' ? userName : undefined,
346
+ maxChars: MAX_REASONING_SNIPPET_LENGTH,
347
+ emptyText: 'A promising connection.',
348
+ });
342
349
  // Build secondParty for introducer arrow layout (the party that isn't the display counterpart)
343
350
  let secondPartyData;
344
351
  if (isIntroducer && introducerCounterparts.length > 1 && otherActor) {
@@ -359,7 +366,7 @@ export class HomeGraphFactory {
359
366
  userId: otherActor?.userId ?? '',
360
367
  name: userName,
361
368
  avatar: userAvatar,
362
- mainText: reasoningSnippet.slice(0, 300),
369
+ mainText: reasoningSnippet,
363
370
  cta: isIntroducer
364
371
  ? (isPendingIntroducerFallback ? 'Share this introduction to get things started.' : 'Take a look and decide if this is a good match.')
365
372
  : 'Take a look and decide whether to reach out.',
@@ -1 +1 @@
1
- {"version":3,"file":"feed.graph.js","sourceRoot":"/","sources":["opportunity/feed/feed.graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAI9D,OAAO,EAAE,cAAc,EAAuF,MAAM,iBAAiB,CAAC;AACtI,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAA0B,MAAM,6BAA6B,CAAC;AACnH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5G,OAAO,EAAE,sBAAsB,EAA6B,MAAM,wCAAwC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE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:\n * loadOpportunities → checkPresenterCache → [generateCardText if misses] → cachePresenterResults\n * → checkCategorizerCache → [categorizeDynamically if miss] → cacheCategorizerResults → normalizeAndSort\n *\n * Uses OpportunityPresenter for card text and an LLM to categorize cards into dynamic sections\n * with titles and Lucide icon names. Caches presenter and categorizer results via OpportunityCache.\n */\n\nimport { createHash } from 'crypto';\n\nimport { StateGraph, START, END } from '@langchain/langgraph';\n\nimport type { HomeGraphDatabase, OpportunityStatus } from '../../shared/interfaces/database.interface.js';\nimport type { OpportunityCache } from '../../shared/interfaces/cache.interface.js';\nimport { HomeGraphState, type HomeCardItem, type HomeSection, type HomeSectionProposal, type HomeSectionItem } from './feed.state.js';\nimport { OpportunityPresenter, gatherPresenterContext, type PresenterDatabase } from '../opportunity.presenter.js';\nimport { loadNegotiationContext } from '../negotiation-context.loader.js';\nimport { HomeCategorizerAgent } from './feed.categorizer.js';\nimport { canUserSeeOpportunity, isActionableForViewer, selectByComposition } from '../opportunity.utils.js';\nimport { resolveHomeSectionIcon, DEFAULT_HOME_SECTION_ICON } from '../../shared/ui/lucide.icon-catalog.js';\nimport { getPrimaryActionLabel, SECONDARY_ACTION_LABEL } from '../opportunity.labels.js';\nimport type { DebugMetaAgent } from '../../chat/chat-streaming.types.js';\nimport { protocolLogger } from '../../shared/observability/protocol.logger.js';\nimport { timed } from '../../shared/observability/performance.js';\nimport { requestContext } from \"../../shared/observability/request-context.js\";\n\nconst logger = protocolLogger('HomeGraph');\n\n/** Database must satisfy both HomeGraphDatabase and presenter context (getProfile, getActiveIntents, getNetwork, getUser). */\ntype HomeGraphDb = HomeGraphDatabase;\n\nexport type HomeGraphInvokeInput = {\n userId: string;\n networkId?: string;\n scopeType?: 'intent';\n scopeId?: string;\n limit?: number;\n noCache?: boolean;\n /** When set, filter loaded opportunities to these lifecycle statuses. Defaults to `DEFAULT_HOME_STATUSES`. */\n statuses?: OpportunityStatus[];\n};\n\nexport type HomeGraphInvokeResult = {\n sections: HomeSection[];\n meta: { totalOpportunities: number; totalSections: number };\n error?: string;\n};\n\n/** Default home-feed statuses: the lifecycle stages a viewer can act on today. */\nexport const DEFAULT_HOME_STATUSES: OpportunityStatus[] = ['latent', 'pending'];\n\n// Exhaustive registry — keys must cover every OpportunityStatus union member.\n// Adding a new status to OpportunityStatus without adding a key here is a TS error,\n// which is the whole point: prevents ALL_OPPORTUNITY_STATUSES from silently drifting.\nconst OPPORTUNITY_STATUS_REGISTRY: Record<OpportunityStatus, true> = {\n latent: true,\n draft: true,\n negotiating: true,\n pending: true,\n stalled: true,\n accepted: true,\n rejected: true,\n expired: true,\n};\n\n/** Full status enumeration. Pass this to `HomeGraphInvokeInput.statuses` to restore pre-Issue-3 (unfiltered) behavior. */\nexport const ALL_OPPORTUNITY_STATUSES: OpportunityStatus[] = Object.keys(\n OPPORTUNITY_STATUS_REGISTRY,\n) as OpportunityStatus[];\n\nconst MAX_ITEMS_PER_SECTION = 20;\nconst PRESENTATION_CONCURRENCY = 50;\nconst MAX_REASONING_SNIPPET_LENGTH = 240;\nconst HOME_CACHE_TTL = 24 * 60 * 60; // 24 hours in seconds\n\n/** Redis key for the categorizer cache, derived from the user and the ordered opportunity-id set. */\nfunction buildCategorizerCacheKey(userId: string, cards: HomeCardItem[]): string {\n const oppIds = cards.map((c) => c.opportunityId).join(',');\n const hash = createHash('sha256').update(oppIds).digest('hex').slice(0, 16);\n return `home:categories:${userId}:${hash}`;\n}\n\n/**\n * Strip leading narrator name from remark when the UI already prepends \"Name: \" to the chip.\n * Avoids duplication like \"Yankı Ekin Yüksel: Yankı Ekin Yüksel introduced you two...\"\n * Repeats until no leading name (handles \"Name: Name rest\").\n */\nexport function stripLeadingNarratorName(remark: string, narratorName: string): string {\n let t = remark.trim();\n if (!t || !narratorName.trim()) return remark;\n const name = narratorName.trim();\n const nameLower = name.toLowerCase();\n for (;;) {\n const lower = t.toLowerCase();\n if (!lower.startsWith(nameLower)) break;\n const rest = t.slice(name.length).replace(/^\\s*[:,\\-–—]\\s*/i, '').trim();\n if (rest.length === 0 || rest === t) break;\n t = rest;\n }\n return t;\n}\n\n/** Normalize timestamp for sorting; returns numeric ms or 0 for invalid/missing. */\nconst safeParseDate = (value: unknown): number => {\n if (value == null) return 0;\n if (value instanceof Date) {\n const t = value.getTime();\n return Number.isFinite(t) ? t : 0;\n }\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value === 'string') {\n const t = new Date(value).getTime();\n return Number.isFinite(t) ? t : 0;\n }\n return 0;\n};\n\n/** Confidence score for sorting (interpretation.confidence or opportunity.confidence). */\nconst getConfidence = (opp: typeof HomeGraphState.State['opportunities'][number]): number => {\n const fromInterp = opp.interpretation?.confidence;\n if (typeof fromInterp === 'number' && !Number.isNaN(fromInterp)) return fromInterp;\n if (typeof fromInterp === 'string') {\n const n = parseFloat(fromInterp);\n if (!Number.isNaN(n)) return n;\n }\n const fromRow = opp.confidence;\n if (typeof fromRow === 'number' && !Number.isNaN(fromRow)) return fromRow;\n if (typeof fromRow === 'string') {\n const n = parseFloat(fromRow);\n if (!Number.isNaN(n)) return n;\n }\n return 0;\n};\n\n/** Unique non-introducer, non-viewer userIds for an opportunity (actors can repeat). */\nconst getUniqueCounterpartUserIds = (\n opp: typeof HomeGraphState.State['opportunities'][number],\n viewerId: string\n): Set<string> => {\n const ids = new Set<string>();\n for (const a of opp.actors) {\n if (a.role !== 'introducer' && a.userId !== viewerId && a.userId) {\n ids.add(a.userId);\n }\n }\n return ids;\n};\n\nconst pickDisplayCounterpartActor = (\n opportunity: typeof HomeGraphState.State['opportunities'][number],\n viewerId: string\n): { userId: string; role: string } | null => {\n const candidates = opportunity.actors.filter(\n (actor) => actor.userId !== viewerId && actor.role !== 'introducer'\n );\n if (candidates.length === 0) {\n return null;\n }\n\n // Prefer direct counterpart roles when available, then stable sort by user id.\n const rolePriority = new Map<string, number>([\n ['patient', 0],\n ['party', 1],\n ['agent', 2],\n ['peer', 3],\n ]);\n\n const sorted = [...candidates].sort((a, b) => {\n const aPriority = rolePriority.get(a.role) ?? 99;\n const bPriority = rolePriority.get(b.role) ?? 99;\n if (aPriority !== bPriority) return aPriority - bPriority;\n return a.userId.localeCompare(b.userId);\n });\n return sorted[0] ?? null;\n};\n\nexport class HomeGraphFactory {\n constructor(private database: HomeGraphDb, private cache: OpportunityCache) {}\n\n createGraph() {\n const presenter = new OpportunityPresenter();\n const categorizer = new HomeCategorizerAgent();\n\n const loadOpportunitiesNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.loadOpportunities\", async () => {\n if (!state.userId) {\n return { error: 'userId is required' };\n }\n try {\n // Minimum of 50 ensures enough candidates across all feed categories\n // (connection, connector-flow, expired) for selectByComposition to fill\n // its soft targets, even after visibility filtering and dedup.\n const fetchLimit = Math.min(150, Math.max(50, state.limit * 3));\n const statuses = state.statuses ?? DEFAULT_HOME_STATUSES;\n const options: { limit?: number; networkId?: string; scopeType?: 'intent'; scopeId?: string; statuses?: OpportunityStatus[] } = {\n limit: fetchLimit,\n statuses,\n };\n if (state.networkId) options.networkId = state.networkId;\n if (state.scopeType === 'intent' && state.scopeId) {\n options.scopeType = 'intent';\n options.scopeId = state.scopeId;\n }\n // Do not pass conversationId: home view excludes draft opportunities (chat-only drafts).\n const raw = await this.database.getOpportunitiesForUser(state.userId, options);\n const visible = raw.filter((opp) =>\n canUserSeeOpportunity(opp.actors, opp.status, state.userId)\n );\n const visibleForFeed = visible.filter((opp) =>\n isActionableForViewer(opp.actors, opp.status, state.userId)\n );\n const sorted = [...visibleForFeed].sort((a, b) => {\n // Connections before connector-flow so dedup claims counterpart IDs\n // for direct connections first — prevents introducer cards from\n // shadowing a user's own connection opportunities.\n const aIsIntroducer = a.actors.some((ac) => ac.userId === state.userId && ac.role === 'introducer');\n const bIsIntroducer = b.actors.some((ac) => ac.userId === state.userId && ac.role === 'introducer');\n if (aIsIntroducer !== bIsIntroducer) return aIsIntroducer ? 1 : -1;\n const confA = getConfidence(a);\n const confB = getConfidence(b);\n if (confB !== confA) return confB - confA;\n const aTime = safeParseDate(a.updatedAt);\n const bTime = safeParseDate(b.updatedAt);\n return bTime - aTime;\n });\n const seenUserIds = new Set<string>();\n const deduped = sorted.filter((opp) => {\n const counterpartIds = getUniqueCounterpartUserIds(opp, state.userId);\n const hasOverlap = [...counterpartIds].some((id) => seenUserIds.has(id));\n if (hasOverlap) return false;\n for (const id of counterpartIds) seenUserIds.add(id);\n return true;\n });\n const opportunities = selectByComposition(deduped, state.userId);\n return { opportunities };\n } catch (e) {\n logger.error('HomeGraph loadOpportunities failed', { error: e });\n return { error: 'Failed to load opportunities', opportunities: [] };\n }\n });\n };\n\n const checkPresenterCacheNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.checkPresenterCache\", async () => {\n const { opportunities, userId } = state;\n if (opportunities.length === 0) {\n return { cachedCards: new Map(), uncachedOpportunities: [] };\n }\n\n if (state.noCache) {\n logger.verbose('[HomeGraph:checkPresenterCache] noCache=true, skipping cache');\n return { cachedCards: new Map(), uncachedOpportunities: opportunities };\n }\n\n try {\n // Negotiating cards are templated (no LLM call) and their text\n // depends on the live turn count, which changes between requests\n // without changing the opportunity status. Skip cache entirely\n // for them so each render reflects the current turn.\n //\n // For all other statuses, include status in the key so status\n // transitions (e.g. negotiating → pending) don't serve stale cards.\n const cacheable = opportunities.filter((opp) => opp.status !== 'negotiating');\n const liveNegotiating = opportunities.filter((opp) => opp.status === 'negotiating');\n\n const keys = cacheable.map(\n (opp) => `home:card:${opp.id}:${opp.status}:${userId}`\n );\n const results = keys.length > 0 ? await this.cache.mget<HomeCardItem>(keys) : [];\n\n const cachedCards = new Map<string, HomeCardItem>();\n const uncachedOpportunities: typeof opportunities = [...liveNegotiating];\n\n for (let i = 0; i < cacheable.length; i++) {\n const cached = results[i];\n if (cached) {\n const originalIndex = opportunities.indexOf(cacheable[i]);\n cachedCards.set(cacheable[i].id, { ...cached, _cardIndex: originalIndex });\n } else {\n uncachedOpportunities.push(cacheable[i]);\n }\n }\n\n logger.verbose('[HomeGraph:checkPresenterCache]', {\n total: opportunities.length,\n cacheHits: cachedCards.size,\n cacheMisses: uncachedOpportunities.length,\n });\n\n return { cachedCards, uncachedOpportunities };\n } catch (e) {\n logger.warn('[HomeGraph:checkPresenterCache] cache unavailable, skipping', { error: e });\n return { cachedCards: new Map(), uncachedOpportunities: opportunities };\n }\n });\n };\n\n const shouldGenerateCards = (state: typeof HomeGraphState.State): string => {\n if (state.uncachedOpportunities.length > 0) {\n return 'generate';\n }\n logger.verbose('[HomeGraph] All presenter results cached, skipping generation');\n return 'skip';\n };\n\n const generateCardTextNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.generateCardText\", async () => {\n const opportunities = state.uncachedOpportunities.length > 0\n ? state.uncachedOpportunities\n : state.opportunities;\n logger.verbose('[HomeGraph:generateCardText] entry', { opportunitiesLength: opportunities.length, userId: state.userId });\n if (opportunities.length === 0) {\n logger.verbose('[HomeGraph:generateCardText] exit', { totalOpportunities: 0, totalSections: 0 });\n return { cards: [], agentTimings: [], meta: { totalOpportunities: 0, totalSections: 0 } };\n }\n const db = this.database as PresenterDatabase & HomeGraphDb;\n const cards: HomeCardItem[] = [];\n const relevantActorIds = new Set<string>();\n for (const opp of opportunities) {\n for (const a of opp.actors) {\n if (a.userId) relevantActorIds.add(a.userId);\n }\n }\n\n const userEntries = await Promise.all(\n Array.from(relevantActorIds).map(async (userId) => {\n try {\n const user = await this.database.getUser(userId);\n return [userId, user ?? null] as const;\n } catch {\n return [userId, null] as const;\n }\n })\n );\n const userMap = new Map(userEntries);\n\n const oppIndexMap = new Map(\n state.opportunities.map((opp, idx) => [opp.id, idx])\n );\n\n const agentTimingsAccum: DebugMetaAgent[] = [];\n\n for (let i = 0; i < opportunities.length; i += PRESENTATION_CONCURRENCY) {\n const chunk = opportunities.slice(i, i + PRESENTATION_CONCURRENCY);\n const chunkCards = await Promise.all(\n chunk.map(async (opportunity, offset) => {\n const cardIndex = oppIndexMap.get(opportunity.id) ?? (i + offset);\n const viewerActor = opportunity.actors.find((a) => a.userId === state.userId);\n const viewerRole = viewerActor?.role ?? 'party';\n const isIntroducer = viewerRole === 'introducer';\n const isPendingIntroducer = isIntroducer && opportunity.status === 'pending';\n const preferredActor = pickDisplayCounterpartActor(opportunity, state.userId)\n ?? opportunity.actors.find((a) => a.userId !== state.userId && a.role !== 'introducer');\n const actorWithProfile = opportunity.actors.find(\n (a) => a.userId !== state.userId && a.role !== 'introducer' && !!userMap.get(a.userId)\n );\n const introducer = opportunity.actors.find((a) => a.role === 'introducer');\n let otherActor = (preferredActor && userMap.get(preferredActor.userId))\n ? preferredActor\n : (actorWithProfile ?? preferredActor);\n // When the only other participant is the introducer (no separate party), use introducer as display counterpart so the card shows a name instead of \"Unknown\"\n if (!otherActor && introducer && introducer.userId !== state.userId && introducer.userId) {\n otherActor = { userId: introducer.userId, role: introducer.role };\n }\n const otherUser = otherActor ? userMap.get(otherActor.userId) ?? null : null;\n const introducerCounterparts = opportunity.actors.filter(\n (a) => a.userId !== state.userId && a.role !== 'introducer'\n );\n // Deduplicate by userId — actors array can contain multiple rows per user\n // (e.g. from different intents), which would produce repeated names.\n const uniqueCounterpartIds = [...new Set(introducerCounterparts.map((a) => a.userId))];\n const participantNames = uniqueCounterpartIds\n .map((uid) => userMap.get(uid)?.name ?? 'Unknown')\n .sort();\n // When secondPartyData will be present (2+ counterparts), use single counterpart name\n // because the frontend arrow layout renders \"card.name → secondParty.name\".\n // Using the joined \"A ↔ B\" format here would produce redundant \"A ↔ B → B\".\n // Only use the joined format when there is a single counterpart (no arrow layout).\n const willHaveSecondParty = isIntroducer && uniqueCounterpartIds.length > 1;\n let userName = isIntroducer && participantNames.length > 0 && !willHaveSecondParty\n ? participantNames.join(' ↔ ')\n : (otherUser?.name ?? 'Unknown');\n // Fallback to profile identity name when users.name is missing (e.g. profile has display name, users row does not)\n if ((userName === 'Unknown' || !userName?.trim()) && otherActor?.userId && db.getProfile) {\n const profile = await db.getProfile(otherActor.userId).catch((err) => {\n logger.debug('[HomeGraph] getProfile fallback failed', { otherActorUserId: otherActor.userId, error: err });\n return null;\n });\n const profileName = profile?.identity?.name?.trim();\n if (profileName) userName = profileName;\n }\n const userAvatar = otherUser?.avatar ?? null;\n const reasoningSnippet =\n (typeof opportunity.interpretation?.reasoning === 'string'\n ? opportunity.interpretation.reasoning.replace(/\\s+/g, ' ').trim().slice(0, MAX_REASONING_SNIPPET_LENGTH)\n : '') || 'A promising connection.';\n\n // Build secondParty for introducer arrow layout (the party that isn't the display counterpart)\n let secondPartyData: { name: string; avatar?: string | null; userId?: string } | undefined;\n if (isIntroducer && introducerCounterparts.length > 1 && otherActor) {\n const secondActor = introducerCounterparts.find((a) => a.userId !== otherActor.userId);\n if (secondActor) {\n const secondUser = userMap.get(secondActor.userId) ?? null;\n secondPartyData = {\n name: secondUser?.name ?? 'Unknown',\n avatar: secondUser?.avatar ?? null,\n userId: secondActor.userId,\n };\n }\n }\n\n const isCounterpartGhost = otherUser?.isGhost ?? false;\n const isPendingIntroducerFallback = isIntroducer && opportunity.status !== 'latent';\n const fallbackCard = (): HomeCardItem => ({\n opportunityId: opportunity.id,\n userId: otherActor?.userId ?? '',\n name: userName,\n avatar: userAvatar,\n mainText: reasoningSnippet.slice(0, 300),\n cta: isIntroducer\n ? (isPendingIntroducerFallback ? 'Share this introduction to get things started.' : 'Take a look and decide if this is a good match.')\n : 'Take a look and decide whether to reach out.',\n primaryActionLabel: getPrimaryActionLabel(viewerRole),\n secondaryActionLabel: SECONDARY_ACTION_LABEL,\n mutualIntentsLabel: isIntroducer ? 'Connector match' : 'Shared interests',\n narratorChip: isIntroducer\n ? { name: 'You', text: 'Worth a look.', userId: state.userId }\n : { name: 'Index', text: 'Worth a look.' },\n viewerRole,\n isGhost: isCounterpartGhost,\n ...(secondPartyData ? { secondParty: secondPartyData } : {}),\n _cardIndex: cardIndex,\n });\n\n try {\n const [ctx, negotiationContext] = await Promise.all([\n gatherPresenterContext(\n db,\n opportunity,\n state.userId,\n otherActor?.userId,\n ),\n loadNegotiationContext(db, opportunity.id, opportunity.status),\n ]);\n const homeInput = {\n ...ctx,\n mutualIntentCount: undefined,\n opportunityStatus: opportunity.status,\n ...(negotiationContext ? { negotiationContext } : {}),\n };\n const _traceEmitterPresenter = requestContext.getStore()?.traceEmitter;\n const presenterStart = Date.now();\n _traceEmitterPresenter?.({ type: \"agent_start\", name: \"opportunity-presenter\" });\n const presentation = await presenter.presentHomeCard(homeInput);\n const _presenterDuration = Date.now() - presenterStart;\n agentTimingsAccum.push({ name: 'opportunity.presenter', durationMs: _presenterDuration });\n _traceEmitterPresenter?.({ type: \"agent_end\", name: \"opportunity-presenter\", durationMs: _presenterDuration, summary: `Presented: ${userName}` });\n let narratorChip: { name: string; text: string; avatar?: string | null; userId?: string } | undefined;\n // Only show a person as narrator when they are the introducer and not the display counterpart\n // (bad data can have same user as introducer and party, e.g. \"Amina introduced you to Amina\")\n const introducerIsCounterpart = introducer && otherActor && introducer.userId === otherActor.userId;\n if (introducer && introducer.userId !== state.userId && !introducerIsCounterpart) {\n const introUser = userMap.get(introducer.userId) ?? null;\n const narratorName = introUser?.name ?? 'Someone';\n narratorChip = {\n name: narratorName,\n text: stripLeadingNarratorName(presentation.narratorRemark, narratorName),\n avatar: introUser?.avatar ?? null,\n userId: introducer.userId,\n };\n } else if (introducer?.userId === state.userId) {\n narratorChip = { name: 'You', text: presentation.narratorRemark, userId: state.userId };\n } else {\n narratorChip = { name: 'Index', text: presentation.narratorRemark };\n }\n return {\n opportunityId: opportunity.id,\n userId: otherActor?.userId ?? '',\n name: userName,\n avatar: userAvatar,\n mainText: presentation.personalizedSummary,\n cta: presentation.suggestedAction,\n headline: presentation.headline,\n primaryActionLabel: getPrimaryActionLabel(viewerRole),\n secondaryActionLabel: SECONDARY_ACTION_LABEL,\n mutualIntentsLabel: presentation.mutualIntentsLabel,\n narratorChip,\n viewerRole,\n isGhost: isCounterpartGhost,\n ...(secondPartyData ? { secondParty: secondPartyData } : {}),\n _cardIndex: cardIndex,\n } satisfies HomeCardItem;\n } catch (e) {\n logger.warn('HomeGraph presenter failed for opportunity', { opportunityId: opportunity.id, error: e });\n return fallbackCard();\n }\n })\n );\n cards.push(...chunkCards);\n }\n logger.verbose('[HomeGraph:generateCardText] exit', { totalOpportunities: state.opportunities.length, totalSections: 0 });\n return {\n cards,\n agentTimings: agentTimingsAccum,\n meta: { totalOpportunities: state.opportunities.length, totalSections: 0 },\n };\n });\n };\n\n const cachePresenterResultsNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.cachePresenterResults\", async () => {\n const { cards, cachedCards, userId, opportunities } = state;\n\n // Only cache cards that weren't already from cache\n const newCards = cards.filter((card) => !cachedCards.has(card.opportunityId));\n const statusById = new Map(opportunities.map((opp) => [opp.id, opp.status]));\n\n try {\n await Promise.all(\n newCards.map((card) => {\n const status = statusById.get(card.opportunityId);\n // Skip persisting negotiating cards — see read-side note.\n if (!status || status === 'negotiating') return Promise.resolve();\n // Skip caching cards with unresolved names — transient DB failures\n // would persist \"Unknown\" placeholders for the full TTL.\n if (!card.name || card.name === 'Unknown') return Promise.resolve();\n return this.cache.set(\n `home:card:${card.opportunityId}:${status}:${userId}`,\n card,\n { ttl: HOME_CACHE_TTL }\n );\n })\n );\n } catch (e) {\n logger.warn('[HomeGraph:cachePresenterResults] cache write failed, continuing', { error: e });\n }\n\n // Merge cached cards into full card list\n const allCards: HomeCardItem[] = [...cards];\n for (const [oppId, cachedCard] of cachedCards) {\n if (!cards.some((c) => c.opportunityId === oppId)) {\n allCards.push(cachedCard);\n }\n }\n\n // Re-sort by _cardIndex to maintain original ordering\n allCards.sort((a, b) => a._cardIndex - b._cardIndex);\n\n logger.verbose('[HomeGraph:cachePresenterResults]', {\n newlyCached: newCards.length,\n totalCards: allCards.length,\n });\n\n return {\n cards: allCards,\n meta: { totalOpportunities: state.opportunities.length, totalSections: 0 },\n };\n });\n };\n\n const checkCategorizerCacheNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.checkCategorizerCache\", async () => {\n if (state.cards.length === 0) {\n return { categoryCacheHit: false };\n }\n\n if (state.noCache) {\n logger.verbose('[HomeGraph:checkCategorizerCache] noCache=true, skipping cache');\n return { categoryCacheHit: false };\n }\n\n try {\n const key = buildCategorizerCacheKey(state.userId, state.cards);\n\n const cached = await this.cache.get<HomeSectionProposal[]>(key);\n if (cached) {\n logger.verbose('[HomeGraph:checkCategorizerCache] cache hit');\n return { sectionProposals: cached, categoryCacheHit: true };\n }\n\n logger.verbose('[HomeGraph:checkCategorizerCache] cache miss');\n } catch (e) {\n logger.warn('[HomeGraph:checkCategorizerCache] cache unavailable, skipping', { error: e });\n }\n return { categoryCacheHit: false };\n });\n };\n\n const shouldCategorize = (state: typeof HomeGraphState.State): string => {\n if (state.categoryCacheHit) {\n logger.verbose('[HomeGraph] Categorizer results cached, skipping');\n return 'skip';\n }\n return 'categorize';\n };\n\n const categorizeDynamicallyNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.categorizeDynamically\", async () => {\n logger.verbose('[HomeGraph:categorizeDynamically] entry', { cardsLength: state.cards.length });\n if (state.cards.length === 0) {\n logger.verbose('[HomeGraph:categorizeDynamically] exit', { sectionProposalsCount: 0 });\n return { sectionProposals: [], agentTimings: [] };\n }\n const agentTimingsAccum: DebugMetaAgent[] = [];\n const categorizerInput = state.cards.map((c) => ({\n index: c._cardIndex,\n headline: c.headline,\n mainText: c.mainText,\n name: c.name,\n viewerRole: c.viewerRole === 'introducer' ? 'introducer' : undefined,\n opportunityStatus: c.viewerRole === 'introducer' ? 'pending' : undefined,\n }));\n const _traceEmitterCategorizer = requestContext.getStore()?.traceEmitter;\n const categorizerStart = Date.now();\n _traceEmitterCategorizer?.({ type: \"agent_start\", name: \"home-categorizer\" });\n const { sections } = await categorizer.categorize(categorizerInput);\n const _categorizerDuration = Date.now() - categorizerStart;\n agentTimingsAccum.push({ name: 'home.categorizer', durationMs: _categorizerDuration });\n _traceEmitterCategorizer?.({ type: \"agent_end\", name: \"home-categorizer\", durationMs: _categorizerDuration, summary: `Categorized into ${sections.length} section(s)` });\n const proposals: HomeSectionProposal[] = sections.map((s) => ({\n ...s,\n itemIndices: s.itemIndices.filter((i) => i >= 0 && i < state.cards.length),\n }));\n logger.verbose('[HomeGraph:categorizeDynamically] exit', { sectionProposalsCount: proposals.length });\n return { sectionProposals: proposals, agentTimings: agentTimingsAccum };\n });\n };\n\n const cacheCategorizerResultsNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.cacheCategorizerResults\", async () => {\n if (state.categoryCacheHit || state.sectionProposals.length === 0) {\n return {};\n }\n\n try {\n const key = buildCategorizerCacheKey(state.userId, state.cards);\n\n await this.cache.set(key, state.sectionProposals, { ttl: HOME_CACHE_TTL });\n\n logger.verbose('[HomeGraph:cacheCategorizerResults] cached', {\n sectionCount: state.sectionProposals.length,\n });\n } catch (e) {\n logger.warn('[HomeGraph:cacheCategorizerResults] cache write failed, continuing', { error: e });\n }\n\n return {};\n });\n };\n\n const normalizeAndSortNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.normalizeAndSort\", async () => {\n const cards = state.cards;\n const proposals = state.sectionProposals;\n logger.verbose('[HomeGraph:normalizeAndSort] entry', { cardsLength: cards.length, proposalsLength: proposals.length });\n if (cards.length === 0) {\n logger.verbose('[HomeGraph:normalizeAndSort] exit', { totalOpportunities: 0, totalSections: 0 });\n return { sections: [], meta: { totalOpportunities: 0, totalSections: 0 } };\n }\n const usedIndices = new Set<number>();\n const sections: HomeSection[] = proposals.map((p) => {\n const iconName = resolveHomeSectionIcon(p.iconName);\n const items: HomeSectionItem[] = p.itemIndices\n .filter((i) => i >= 0 && i < cards.length && !usedIndices.has(i))\n .slice(0, MAX_ITEMS_PER_SECTION)\n .map((i) => {\n usedIndices.add(i);\n const card = cards[i];\n const { _cardIndex, ...rest } = card;\n return rest;\n });\n return {\n id: p.id,\n title: p.title,\n subtitle: p.subtitle,\n iconName,\n items,\n };\n });\n\n // Enforce category ordering: sections with connections first, then\n // connector-flow only, then expired only. This prevents the LLM\n // categorizer from placing introducer sections before connection sections.\n const sectionCategoryPriority = (section: HomeSection): number => {\n const hasConnection = section.items.some((item) => item.viewerRole !== 'introducer');\n if (hasConnection) return 0; // mixed or connection-only sections first\n const hasConnectorFlow = section.items.some((item) => item.viewerRole === 'introducer');\n if (hasConnectorFlow) return 1; // connector-flow only sections next\n return 2; // empty or expired sections last\n };\n sections.sort((a, b) => sectionCategoryPriority(a) - sectionCategoryPriority(b));\n const meta = {\n totalOpportunities: state.opportunities.length,\n totalSections: sections.length,\n };\n logger.verbose('[HomeGraph:normalizeAndSort] exit', { totalOpportunities: meta.totalOpportunities, totalSections: meta.totalSections });\n return { sections, meta };\n });\n };\n\n const graph = new StateGraph(HomeGraphState)\n .addNode('loadOpportunities', loadOpportunitiesNode)\n .addNode('checkPresenterCache', checkPresenterCacheNode)\n .addNode('generateCardText', generateCardTextNode)\n .addNode('cachePresenterResults', cachePresenterResultsNode)\n .addNode('checkCategorizerCache', checkCategorizerCacheNode)\n .addNode('categorizeDynamically', categorizeDynamicallyNode)\n .addNode('cacheCategorizerResults', cacheCategorizerResultsNode)\n .addNode('normalizeAndSort', normalizeAndSortNode)\n .addEdge(START, 'loadOpportunities')\n .addEdge('loadOpportunities', 'checkPresenterCache')\n .addConditionalEdges('checkPresenterCache', shouldGenerateCards, {\n generate: 'generateCardText',\n skip: 'cachePresenterResults',\n })\n .addEdge('generateCardText', 'cachePresenterResults')\n .addEdge('cachePresenterResults', 'checkCategorizerCache')\n .addConditionalEdges('checkCategorizerCache', shouldCategorize, {\n categorize: 'categorizeDynamically',\n skip: 'normalizeAndSort',\n })\n .addEdge('categorizeDynamically', 'cacheCategorizerResults')\n .addEdge('cacheCategorizerResults', 'normalizeAndSort')\n .addEdge('normalizeAndSort', END);\n\n return graph.compile();\n }\n}\n"]}
1
+ {"version":3,"file":"feed.graph.js","sourceRoot":"/","sources":["opportunity/feed/feed.graph.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,yBAAyB,EAAE,2BAA2B,CAAC;aAC/D,OAAO,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;aACjD,OAAO,CAAC,KAAK,EAAE,mBAAmB,CAAC;aACnC,OAAO,CAAC,mBAAmB,EAAE,qBAAqB,CAAC;aACnD,mBAAmB,CAAC,qBAAqB,EAAE,mBAAmB,EAAE;YAC/D,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,uBAAuB;SAC9B,CAAC;aACD,OAAO,CAAC,kBAAkB,EAAE,uBAAuB,CAAC;aACpD,OAAO,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;aACzD,mBAAmB,CAAC,uBAAuB,EAAE,gBAAgB,EAAE;YAC9D,UAAU,EAAE,uBAAuB;YACnC,IAAI,EAAE,kBAAkB;SACzB,CAAC;aACD,OAAO,CAAC,uBAAuB,EAAE,yBAAyB,CAAC;aAC3D,OAAO,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;aACtD,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/**\n * Home Graph: Build the opportunity home view with dynamic sections.\n *\n * Independent of ChatGraph. Flow:\n * loadOpportunities → checkPresenterCache → [generateCardText if misses] → cachePresenterResults\n * → checkCategorizerCache → [categorizeDynamically if miss] → cacheCategorizerResults → normalizeAndSort\n *\n * Uses OpportunityPresenter for card text and an LLM to categorize cards into dynamic sections\n * with titles and Lucide icon names. Caches presenter and categorizer results via OpportunityCache.\n */\n\nimport { createHash } from 'crypto';\n\nimport { StateGraph, START, END } from '@langchain/langgraph';\n\nimport type { HomeGraphDatabase, OpportunityStatus } from '../../shared/interfaces/database.interface.js';\nimport type { OpportunityCache } from '../../shared/interfaces/cache.interface.js';\nimport { HomeGraphState, type HomeCardItem, type HomeSection, type HomeSectionProposal, type HomeSectionItem } from './feed.state.js';\nimport { OpportunityPresenter, gatherPresenterContext, type PresenterDatabase } from '../opportunity.presenter.js';\nimport { loadNegotiationContext } from '../negotiation-context.loader.js';\nimport { HomeCategorizerAgent } from './feed.categorizer.js';\nimport { canUserSeeOpportunity, isActionableForViewer, selectByComposition } from '../opportunity.utils.js';\nimport { resolveHomeSectionIcon, DEFAULT_HOME_SECTION_ICON } from '../../shared/ui/lucide.icon-catalog.js';\nimport { getPrimaryActionLabel, SECONDARY_ACTION_LABEL } from '../opportunity.labels.js';\nimport { safeFallbackSummary } from '../opportunity.safe-presentation.js';\nimport type { DebugMetaAgent } from '../../chat/chat-streaming.types.js';\nimport { protocolLogger } from '../../shared/observability/protocol.logger.js';\nimport { timed } from '../../shared/observability/performance.js';\nimport { requestContext } from \"../../shared/observability/request-context.js\";\n\nconst logger = protocolLogger('HomeGraph');\n\n/** Database must satisfy both HomeGraphDatabase and presenter context (getProfile, getActiveIntents, getNetwork, getUser). */\ntype HomeGraphDb = HomeGraphDatabase;\n\nexport type HomeGraphInvokeInput = {\n userId: string;\n networkId?: string;\n scopeType?: 'intent';\n scopeId?: string;\n limit?: number;\n noCache?: boolean;\n /** When set, filter loaded opportunities to these lifecycle statuses. Defaults to `DEFAULT_HOME_STATUSES`. */\n statuses?: OpportunityStatus[];\n};\n\nexport type HomeGraphInvokeResult = {\n sections: HomeSection[];\n meta: { totalOpportunities: number; totalSections: number };\n error?: string;\n};\n\n/** Default home-feed statuses: the lifecycle stages a viewer can act on today. */\nexport const DEFAULT_HOME_STATUSES: OpportunityStatus[] = ['latent', 'pending'];\n\n// Exhaustive registry — keys must cover every OpportunityStatus union member.\n// Adding a new status to OpportunityStatus without adding a key here is a TS error,\n// which is the whole point: prevents ALL_OPPORTUNITY_STATUSES from silently drifting.\nconst OPPORTUNITY_STATUS_REGISTRY: Record<OpportunityStatus, true> = {\n latent: true,\n draft: true,\n negotiating: true,\n pending: true,\n stalled: true,\n accepted: true,\n rejected: true,\n expired: true,\n};\n\n/** Full status enumeration. Pass this to `HomeGraphInvokeInput.statuses` to restore pre-Issue-3 (unfiltered) behavior. */\nexport const ALL_OPPORTUNITY_STATUSES: OpportunityStatus[] = Object.keys(\n OPPORTUNITY_STATUS_REGISTRY,\n) as OpportunityStatus[];\n\nconst MAX_ITEMS_PER_SECTION = 20;\nconst PRESENTATION_CONCURRENCY = 50;\nconst MAX_REASONING_SNIPPET_LENGTH = 240;\nconst HOME_CACHE_TTL = 24 * 60 * 60; // 24 hours in seconds\n\n/** Redis key for the categorizer cache, derived from the user and the ordered opportunity-id set. */\nfunction buildCategorizerCacheKey(userId: string, cards: HomeCardItem[]): string {\n const oppIds = cards.map((c) => c.opportunityId).join(',');\n const hash = createHash('sha256').update(oppIds).digest('hex').slice(0, 16);\n return `home:categories:${userId}:${hash}`;\n}\n\n/**\n * Strip leading narrator name from remark when the UI already prepends \"Name: \" to the chip.\n * Avoids duplication like \"Yankı Ekin Yüksel: Yankı Ekin Yüksel introduced you two...\"\n * Repeats until no leading name (handles \"Name: Name rest\").\n */\nexport function stripLeadingNarratorName(remark: string, narratorName: string): string {\n let t = remark.trim();\n if (!t || !narratorName.trim()) return remark;\n const name = narratorName.trim();\n const nameLower = name.toLowerCase();\n for (;;) {\n const lower = t.toLowerCase();\n if (!lower.startsWith(nameLower)) break;\n const rest = t.slice(name.length).replace(/^\\s*[:,\\-–—]\\s*/i, '').trim();\n if (rest.length === 0 || rest === t) break;\n t = rest;\n }\n return t;\n}\n\n/** Normalize timestamp for sorting; returns numeric ms or 0 for invalid/missing. */\nconst safeParseDate = (value: unknown): number => {\n if (value == null) return 0;\n if (value instanceof Date) {\n const t = value.getTime();\n return Number.isFinite(t) ? t : 0;\n }\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value === 'string') {\n const t = new Date(value).getTime();\n return Number.isFinite(t) ? t : 0;\n }\n return 0;\n};\n\n/** Confidence score for sorting (interpretation.confidence or opportunity.confidence). */\nconst getConfidence = (opp: typeof HomeGraphState.State['opportunities'][number]): number => {\n const fromInterp = opp.interpretation?.confidence;\n if (typeof fromInterp === 'number' && !Number.isNaN(fromInterp)) return fromInterp;\n if (typeof fromInterp === 'string') {\n const n = parseFloat(fromInterp);\n if (!Number.isNaN(n)) return n;\n }\n const fromRow = opp.confidence;\n if (typeof fromRow === 'number' && !Number.isNaN(fromRow)) return fromRow;\n if (typeof fromRow === 'string') {\n const n = parseFloat(fromRow);\n if (!Number.isNaN(n)) return n;\n }\n return 0;\n};\n\n/** Unique non-introducer, non-viewer userIds for an opportunity (actors can repeat). */\nconst getUniqueCounterpartUserIds = (\n opp: typeof HomeGraphState.State['opportunities'][number],\n viewerId: string\n): Set<string> => {\n const ids = new Set<string>();\n for (const a of opp.actors) {\n if (a.role !== 'introducer' && a.userId !== viewerId && a.userId) {\n ids.add(a.userId);\n }\n }\n return ids;\n};\n\nconst pickDisplayCounterpartActor = (\n opportunity: typeof HomeGraphState.State['opportunities'][number],\n viewerId: string\n): { userId: string; role: string } | null => {\n const candidates = opportunity.actors.filter(\n (actor) => actor.userId !== viewerId && actor.role !== 'introducer'\n );\n if (candidates.length === 0) {\n return null;\n }\n\n // Prefer direct counterpart roles when available, then stable sort by user id.\n const rolePriority = new Map<string, number>([\n ['patient', 0],\n ['party', 1],\n ['agent', 2],\n ['peer', 3],\n ]);\n\n const sorted = [...candidates].sort((a, b) => {\n const aPriority = rolePriority.get(a.role) ?? 99;\n const bPriority = rolePriority.get(b.role) ?? 99;\n if (aPriority !== bPriority) return aPriority - bPriority;\n return a.userId.localeCompare(b.userId);\n });\n return sorted[0] ?? null;\n};\n\nexport class HomeGraphFactory {\n constructor(private database: HomeGraphDb, private cache: OpportunityCache) {}\n\n createGraph() {\n const presenter = new OpportunityPresenter();\n const categorizer = new HomeCategorizerAgent();\n\n const loadOpportunitiesNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.loadOpportunities\", async () => {\n if (!state.userId) {\n return { error: 'userId is required' };\n }\n try {\n // Minimum of 50 ensures enough candidates across all feed categories\n // (connection, connector-flow, expired) for selectByComposition to fill\n // its soft targets, even after visibility filtering and dedup.\n const fetchLimit = Math.min(150, Math.max(50, state.limit * 3));\n const statuses = state.statuses ?? DEFAULT_HOME_STATUSES;\n const options: { limit?: number; networkId?: string; scopeType?: 'intent'; scopeId?: string; statuses?: OpportunityStatus[] } = {\n limit: fetchLimit,\n statuses,\n };\n if (state.networkId) options.networkId = state.networkId;\n if (state.scopeType === 'intent' && state.scopeId) {\n options.scopeType = 'intent';\n options.scopeId = state.scopeId;\n }\n // Do not pass conversationId: home view excludes draft opportunities (chat-only drafts).\n const raw = await this.database.getOpportunitiesForUser(state.userId, options);\n const visible = raw.filter((opp) =>\n canUserSeeOpportunity(opp.actors, opp.status, state.userId)\n );\n const visibleForFeed = visible.filter((opp) =>\n isActionableForViewer(opp.actors, opp.status, state.userId)\n );\n const sorted = [...visibleForFeed].sort((a, b) => {\n // Connections before connector-flow so dedup claims counterpart IDs\n // for direct connections first — prevents introducer cards from\n // shadowing a user's own connection opportunities.\n const aIsIntroducer = a.actors.some((ac) => ac.userId === state.userId && ac.role === 'introducer');\n const bIsIntroducer = b.actors.some((ac) => ac.userId === state.userId && ac.role === 'introducer');\n if (aIsIntroducer !== bIsIntroducer) return aIsIntroducer ? 1 : -1;\n const confA = getConfidence(a);\n const confB = getConfidence(b);\n if (confB !== confA) return confB - confA;\n const aTime = safeParseDate(a.updatedAt);\n const bTime = safeParseDate(b.updatedAt);\n return bTime - aTime;\n });\n const seenUserIds = new Set<string>();\n const deduped = sorted.filter((opp) => {\n const counterpartIds = getUniqueCounterpartUserIds(opp, state.userId);\n const hasOverlap = [...counterpartIds].some((id) => seenUserIds.has(id));\n if (hasOverlap) return false;\n for (const id of counterpartIds) seenUserIds.add(id);\n return true;\n });\n const opportunities = selectByComposition(deduped, state.userId);\n return { opportunities };\n } catch (e) {\n logger.error('HomeGraph loadOpportunities failed', { error: e });\n return { error: 'Failed to load opportunities', opportunities: [] };\n }\n });\n };\n\n const checkPresenterCacheNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.checkPresenterCache\", async () => {\n const { opportunities, userId } = state;\n if (opportunities.length === 0) {\n return { cachedCards: new Map(), uncachedOpportunities: [] };\n }\n\n if (state.noCache) {\n logger.verbose('[HomeGraph:checkPresenterCache] noCache=true, skipping cache');\n return { cachedCards: new Map(), uncachedOpportunities: opportunities };\n }\n\n try {\n // Negotiating cards are templated (no LLM call) and their text\n // depends on the live turn count, which changes between requests\n // without changing the opportunity status. Skip cache entirely\n // for them so each render reflects the current turn.\n //\n // For all other statuses, include status in the key so status\n // transitions (e.g. negotiating → pending) don't serve stale cards.\n const cacheable = opportunities.filter((opp) => opp.status !== 'negotiating');\n const liveNegotiating = opportunities.filter((opp) => opp.status === 'negotiating');\n\n const keys = cacheable.map(\n (opp) => `home:card:${opp.id}:${opp.status}:${userId}`\n );\n const results = keys.length > 0 ? await this.cache.mget<HomeCardItem>(keys) : [];\n\n const cachedCards = new Map<string, HomeCardItem>();\n const uncachedOpportunities: typeof opportunities = [...liveNegotiating];\n\n for (let i = 0; i < cacheable.length; i++) {\n const cached = results[i];\n if (cached) {\n const originalIndex = opportunities.indexOf(cacheable[i]);\n cachedCards.set(cacheable[i].id, { ...cached, _cardIndex: originalIndex });\n } else {\n uncachedOpportunities.push(cacheable[i]);\n }\n }\n\n logger.verbose('[HomeGraph:checkPresenterCache]', {\n total: opportunities.length,\n cacheHits: cachedCards.size,\n cacheMisses: uncachedOpportunities.length,\n });\n\n return { cachedCards, uncachedOpportunities };\n } catch (e) {\n logger.warn('[HomeGraph:checkPresenterCache] cache unavailable, skipping', { error: e });\n return { cachedCards: new Map(), uncachedOpportunities: opportunities };\n }\n });\n };\n\n const shouldGenerateCards = (state: typeof HomeGraphState.State): string => {\n if (state.uncachedOpportunities.length > 0) {\n return 'generate';\n }\n logger.verbose('[HomeGraph] All presenter results cached, skipping generation');\n return 'skip';\n };\n\n const generateCardTextNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.generateCardText\", async () => {\n const opportunities = state.uncachedOpportunities.length > 0\n ? state.uncachedOpportunities\n : state.opportunities;\n logger.verbose('[HomeGraph:generateCardText] entry', { opportunitiesLength: opportunities.length, userId: state.userId });\n if (opportunities.length === 0) {\n logger.verbose('[HomeGraph:generateCardText] exit', { totalOpportunities: 0, totalSections: 0 });\n return { cards: [], agentTimings: [], meta: { totalOpportunities: 0, totalSections: 0 } };\n }\n const db = this.database as PresenterDatabase & HomeGraphDb;\n const cards: HomeCardItem[] = [];\n const relevantActorIds = new Set<string>();\n for (const opp of opportunities) {\n for (const a of opp.actors) {\n if (a.userId) relevantActorIds.add(a.userId);\n }\n }\n\n const userEntries = await Promise.all(\n Array.from(relevantActorIds).map(async (userId) => {\n try {\n const user = await this.database.getUser(userId);\n return [userId, user ?? null] as const;\n } catch {\n return [userId, null] as const;\n }\n })\n );\n const userMap = new Map(userEntries);\n\n const oppIndexMap = new Map(\n state.opportunities.map((opp, idx) => [opp.id, idx])\n );\n\n const agentTimingsAccum: DebugMetaAgent[] = [];\n\n for (let i = 0; i < opportunities.length; i += PRESENTATION_CONCURRENCY) {\n const chunk = opportunities.slice(i, i + PRESENTATION_CONCURRENCY);\n const chunkCards = await Promise.all(\n chunk.map(async (opportunity, offset) => {\n const cardIndex = oppIndexMap.get(opportunity.id) ?? (i + offset);\n const viewerActor = opportunity.actors.find((a) => a.userId === state.userId);\n const viewerRole = viewerActor?.role ?? 'party';\n const isIntroducer = viewerRole === 'introducer';\n const isPendingIntroducer = isIntroducer && opportunity.status === 'pending';\n const preferredActor = pickDisplayCounterpartActor(opportunity, state.userId)\n ?? opportunity.actors.find((a) => a.userId !== state.userId && a.role !== 'introducer');\n const actorWithProfile = opportunity.actors.find(\n (a) => a.userId !== state.userId && a.role !== 'introducer' && !!userMap.get(a.userId)\n );\n const introducer = opportunity.actors.find((a) => a.role === 'introducer');\n let otherActor = (preferredActor && userMap.get(preferredActor.userId))\n ? preferredActor\n : (actorWithProfile ?? preferredActor);\n // When the only other participant is the introducer (no separate party), use introducer as display counterpart so the card shows a name instead of \"Unknown\"\n if (!otherActor && introducer && introducer.userId !== state.userId && introducer.userId) {\n otherActor = { userId: introducer.userId, role: introducer.role };\n }\n const otherUser = otherActor ? userMap.get(otherActor.userId) ?? null : null;\n const introducerCounterparts = opportunity.actors.filter(\n (a) => a.userId !== state.userId && a.role !== 'introducer'\n );\n // Deduplicate by userId — actors array can contain multiple rows per user\n // (e.g. from different intents), which would produce repeated names.\n const uniqueCounterpartIds = [...new Set(introducerCounterparts.map((a) => a.userId))];\n const participantNames = uniqueCounterpartIds\n .map((uid) => userMap.get(uid)?.name ?? 'Unknown')\n .sort();\n // When secondPartyData will be present (2+ counterparts), use single counterpart name\n // because the frontend arrow layout renders \"card.name → secondParty.name\".\n // Using the joined \"A ↔ B\" format here would produce redundant \"A ↔ B → B\".\n // Only use the joined format when there is a single counterpart (no arrow layout).\n const willHaveSecondParty = isIntroducer && uniqueCounterpartIds.length > 1;\n let userName = isIntroducer && participantNames.length > 0 && !willHaveSecondParty\n ? participantNames.join(' ↔ ')\n : (otherUser?.name ?? 'Unknown');\n // Fallback to profile identity name when users.name is missing (e.g. profile has display name, users row does not)\n if ((userName === 'Unknown' || !userName?.trim()) && otherActor?.userId && db.getProfile) {\n const profile = await db.getProfile(otherActor.userId).catch((err) => {\n logger.debug('[HomeGraph] getProfile fallback failed', { otherActorUserId: otherActor.userId, error: err });\n return null;\n });\n const profileName = profile?.identity?.name?.trim();\n if (profileName) userName = profileName;\n }\n const userAvatar = otherUser?.avatar ?? null;\n // Shared sanitization standard (UUID strip, viewer-centric rewrite,\n // boundary truncation) — raw reasoning must never render verbatim.\n const reasoningSnippet = safeFallbackSummary(\n typeof opportunity.interpretation?.reasoning === 'string'\n ? opportunity.interpretation.reasoning\n : '',\n {\n counterpartName: userName !== 'Unknown' ? userName : undefined,\n maxChars: MAX_REASONING_SNIPPET_LENGTH,\n emptyText: 'A promising connection.',\n },\n );\n\n // Build secondParty for introducer arrow layout (the party that isn't the display counterpart)\n let secondPartyData: { name: string; avatar?: string | null; userId?: string } | undefined;\n if (isIntroducer && introducerCounterparts.length > 1 && otherActor) {\n const secondActor = introducerCounterparts.find((a) => a.userId !== otherActor.userId);\n if (secondActor) {\n const secondUser = userMap.get(secondActor.userId) ?? null;\n secondPartyData = {\n name: secondUser?.name ?? 'Unknown',\n avatar: secondUser?.avatar ?? null,\n userId: secondActor.userId,\n };\n }\n }\n\n const isCounterpartGhost = otherUser?.isGhost ?? false;\n const isPendingIntroducerFallback = isIntroducer && opportunity.status !== 'latent';\n const fallbackCard = (): HomeCardItem => ({\n opportunityId: opportunity.id,\n userId: otherActor?.userId ?? '',\n name: userName,\n avatar: userAvatar,\n mainText: reasoningSnippet,\n cta: isIntroducer\n ? (isPendingIntroducerFallback ? 'Share this introduction to get things started.' : 'Take a look and decide if this is a good match.')\n : 'Take a look and decide whether to reach out.',\n primaryActionLabel: getPrimaryActionLabel(viewerRole),\n secondaryActionLabel: SECONDARY_ACTION_LABEL,\n mutualIntentsLabel: isIntroducer ? 'Connector match' : 'Shared interests',\n narratorChip: isIntroducer\n ? { name: 'You', text: 'Worth a look.', userId: state.userId }\n : { name: 'Index', text: 'Worth a look.' },\n viewerRole,\n isGhost: isCounterpartGhost,\n ...(secondPartyData ? { secondParty: secondPartyData } : {}),\n _cardIndex: cardIndex,\n });\n\n try {\n const [ctx, negotiationContext] = await Promise.all([\n gatherPresenterContext(\n db,\n opportunity,\n state.userId,\n otherActor?.userId,\n ),\n loadNegotiationContext(db, opportunity.id, opportunity.status),\n ]);\n const homeInput = {\n ...ctx,\n mutualIntentCount: undefined,\n opportunityStatus: opportunity.status,\n ...(negotiationContext ? { negotiationContext } : {}),\n };\n const _traceEmitterPresenter = requestContext.getStore()?.traceEmitter;\n const presenterStart = Date.now();\n _traceEmitterPresenter?.({ type: \"agent_start\", name: \"opportunity-presenter\" });\n const presentation = await presenter.presentHomeCard(homeInput);\n const _presenterDuration = Date.now() - presenterStart;\n agentTimingsAccum.push({ name: 'opportunity.presenter', durationMs: _presenterDuration });\n _traceEmitterPresenter?.({ type: \"agent_end\", name: \"opportunity-presenter\", durationMs: _presenterDuration, summary: `Presented: ${userName}` });\n let narratorChip: { name: string; text: string; avatar?: string | null; userId?: string } | undefined;\n // Only show a person as narrator when they are the introducer and not the display counterpart\n // (bad data can have same user as introducer and party, e.g. \"Amina introduced you to Amina\")\n const introducerIsCounterpart = introducer && otherActor && introducer.userId === otherActor.userId;\n if (introducer && introducer.userId !== state.userId && !introducerIsCounterpart) {\n const introUser = userMap.get(introducer.userId) ?? null;\n const narratorName = introUser?.name ?? 'Someone';\n narratorChip = {\n name: narratorName,\n text: stripLeadingNarratorName(presentation.narratorRemark, narratorName),\n avatar: introUser?.avatar ?? null,\n userId: introducer.userId,\n };\n } else if (introducer?.userId === state.userId) {\n narratorChip = { name: 'You', text: presentation.narratorRemark, userId: state.userId };\n } else {\n narratorChip = { name: 'Index', text: presentation.narratorRemark };\n }\n return {\n opportunityId: opportunity.id,\n userId: otherActor?.userId ?? '',\n name: userName,\n avatar: userAvatar,\n mainText: presentation.personalizedSummary,\n cta: presentation.suggestedAction,\n headline: presentation.headline,\n primaryActionLabel: getPrimaryActionLabel(viewerRole),\n secondaryActionLabel: SECONDARY_ACTION_LABEL,\n mutualIntentsLabel: presentation.mutualIntentsLabel,\n narratorChip,\n viewerRole,\n isGhost: isCounterpartGhost,\n ...(secondPartyData ? { secondParty: secondPartyData } : {}),\n _cardIndex: cardIndex,\n } satisfies HomeCardItem;\n } catch (e) {\n logger.warn('HomeGraph presenter failed for opportunity', { opportunityId: opportunity.id, error: e });\n return fallbackCard();\n }\n })\n );\n cards.push(...chunkCards);\n }\n logger.verbose('[HomeGraph:generateCardText] exit', { totalOpportunities: state.opportunities.length, totalSections: 0 });\n return {\n cards,\n agentTimings: agentTimingsAccum,\n meta: { totalOpportunities: state.opportunities.length, totalSections: 0 },\n };\n });\n };\n\n const cachePresenterResultsNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.cachePresenterResults\", async () => {\n const { cards, cachedCards, userId, opportunities } = state;\n\n // Only cache cards that weren't already from cache\n const newCards = cards.filter((card) => !cachedCards.has(card.opportunityId));\n const statusById = new Map(opportunities.map((opp) => [opp.id, opp.status]));\n\n try {\n await Promise.all(\n newCards.map((card) => {\n const status = statusById.get(card.opportunityId);\n // Skip persisting negotiating cards — see read-side note.\n if (!status || status === 'negotiating') return Promise.resolve();\n // Skip caching cards with unresolved names — transient DB failures\n // would persist \"Unknown\" placeholders for the full TTL.\n if (!card.name || card.name === 'Unknown') return Promise.resolve();\n return this.cache.set(\n `home:card:${card.opportunityId}:${status}:${userId}`,\n card,\n { ttl: HOME_CACHE_TTL }\n );\n })\n );\n } catch (e) {\n logger.warn('[HomeGraph:cachePresenterResults] cache write failed, continuing', { error: e });\n }\n\n // Merge cached cards into full card list\n const allCards: HomeCardItem[] = [...cards];\n for (const [oppId, cachedCard] of cachedCards) {\n if (!cards.some((c) => c.opportunityId === oppId)) {\n allCards.push(cachedCard);\n }\n }\n\n // Re-sort by _cardIndex to maintain original ordering\n allCards.sort((a, b) => a._cardIndex - b._cardIndex);\n\n logger.verbose('[HomeGraph:cachePresenterResults]', {\n newlyCached: newCards.length,\n totalCards: allCards.length,\n });\n\n return {\n cards: allCards,\n meta: { totalOpportunities: state.opportunities.length, totalSections: 0 },\n };\n });\n };\n\n const checkCategorizerCacheNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.checkCategorizerCache\", async () => {\n if (state.cards.length === 0) {\n return { categoryCacheHit: false };\n }\n\n if (state.noCache) {\n logger.verbose('[HomeGraph:checkCategorizerCache] noCache=true, skipping cache');\n return { categoryCacheHit: false };\n }\n\n try {\n const key = buildCategorizerCacheKey(state.userId, state.cards);\n\n const cached = await this.cache.get<HomeSectionProposal[]>(key);\n if (cached) {\n logger.verbose('[HomeGraph:checkCategorizerCache] cache hit');\n return { sectionProposals: cached, categoryCacheHit: true };\n }\n\n logger.verbose('[HomeGraph:checkCategorizerCache] cache miss');\n } catch (e) {\n logger.warn('[HomeGraph:checkCategorizerCache] cache unavailable, skipping', { error: e });\n }\n return { categoryCacheHit: false };\n });\n };\n\n const shouldCategorize = (state: typeof HomeGraphState.State): string => {\n if (state.categoryCacheHit) {\n logger.verbose('[HomeGraph] Categorizer results cached, skipping');\n return 'skip';\n }\n return 'categorize';\n };\n\n const categorizeDynamicallyNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.categorizeDynamically\", async () => {\n logger.verbose('[HomeGraph:categorizeDynamically] entry', { cardsLength: state.cards.length });\n if (state.cards.length === 0) {\n logger.verbose('[HomeGraph:categorizeDynamically] exit', { sectionProposalsCount: 0 });\n return { sectionProposals: [], agentTimings: [] };\n }\n const agentTimingsAccum: DebugMetaAgent[] = [];\n const categorizerInput = state.cards.map((c) => ({\n index: c._cardIndex,\n headline: c.headline,\n mainText: c.mainText,\n name: c.name,\n viewerRole: c.viewerRole === 'introducer' ? 'introducer' : undefined,\n opportunityStatus: c.viewerRole === 'introducer' ? 'pending' : undefined,\n }));\n const _traceEmitterCategorizer = requestContext.getStore()?.traceEmitter;\n const categorizerStart = Date.now();\n _traceEmitterCategorizer?.({ type: \"agent_start\", name: \"home-categorizer\" });\n const { sections } = await categorizer.categorize(categorizerInput);\n const _categorizerDuration = Date.now() - categorizerStart;\n agentTimingsAccum.push({ name: 'home.categorizer', durationMs: _categorizerDuration });\n _traceEmitterCategorizer?.({ type: \"agent_end\", name: \"home-categorizer\", durationMs: _categorizerDuration, summary: `Categorized into ${sections.length} section(s)` });\n const proposals: HomeSectionProposal[] = sections.map((s) => ({\n ...s,\n itemIndices: s.itemIndices.filter((i) => i >= 0 && i < state.cards.length),\n }));\n logger.verbose('[HomeGraph:categorizeDynamically] exit', { sectionProposalsCount: proposals.length });\n return { sectionProposals: proposals, agentTimings: agentTimingsAccum };\n });\n };\n\n const cacheCategorizerResultsNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.cacheCategorizerResults\", async () => {\n if (state.categoryCacheHit || state.sectionProposals.length === 0) {\n return {};\n }\n\n try {\n const key = buildCategorizerCacheKey(state.userId, state.cards);\n\n await this.cache.set(key, state.sectionProposals, { ttl: HOME_CACHE_TTL });\n\n logger.verbose('[HomeGraph:cacheCategorizerResults] cached', {\n sectionCount: state.sectionProposals.length,\n });\n } catch (e) {\n logger.warn('[HomeGraph:cacheCategorizerResults] cache write failed, continuing', { error: e });\n }\n\n return {};\n });\n };\n\n const normalizeAndSortNode = async (state: typeof HomeGraphState.State) => {\n return timed(\"HomeGraph.normalizeAndSort\", async () => {\n const cards = state.cards;\n const proposals = state.sectionProposals;\n logger.verbose('[HomeGraph:normalizeAndSort] entry', { cardsLength: cards.length, proposalsLength: proposals.length });\n if (cards.length === 0) {\n logger.verbose('[HomeGraph:normalizeAndSort] exit', { totalOpportunities: 0, totalSections: 0 });\n return { sections: [], meta: { totalOpportunities: 0, totalSections: 0 } };\n }\n const usedIndices = new Set<number>();\n const sections: HomeSection[] = proposals.map((p) => {\n const iconName = resolveHomeSectionIcon(p.iconName);\n const items: HomeSectionItem[] = p.itemIndices\n .filter((i) => i >= 0 && i < cards.length && !usedIndices.has(i))\n .slice(0, MAX_ITEMS_PER_SECTION)\n .map((i) => {\n usedIndices.add(i);\n const card = cards[i];\n const { _cardIndex, ...rest } = card;\n return rest;\n });\n return {\n id: p.id,\n title: p.title,\n subtitle: p.subtitle,\n iconName,\n items,\n };\n });\n\n // Enforce category ordering: sections with connections first, then\n // connector-flow only, then expired only. This prevents the LLM\n // categorizer from placing introducer sections before connection sections.\n const sectionCategoryPriority = (section: HomeSection): number => {\n const hasConnection = section.items.some((item) => item.viewerRole !== 'introducer');\n if (hasConnection) return 0; // mixed or connection-only sections first\n const hasConnectorFlow = section.items.some((item) => item.viewerRole === 'introducer');\n if (hasConnectorFlow) return 1; // connector-flow only sections next\n return 2; // empty or expired sections last\n };\n sections.sort((a, b) => sectionCategoryPriority(a) - sectionCategoryPriority(b));\n const meta = {\n totalOpportunities: state.opportunities.length,\n totalSections: sections.length,\n };\n logger.verbose('[HomeGraph:normalizeAndSort] exit', { totalOpportunities: meta.totalOpportunities, totalSections: meta.totalSections });\n return { sections, meta };\n });\n };\n\n const graph = new StateGraph(HomeGraphState)\n .addNode('loadOpportunities', loadOpportunitiesNode)\n .addNode('checkPresenterCache', checkPresenterCacheNode)\n .addNode('generateCardText', generateCardTextNode)\n .addNode('cachePresenterResults', cachePresenterResultsNode)\n .addNode('checkCategorizerCache', checkCategorizerCacheNode)\n .addNode('categorizeDynamically', categorizeDynamicallyNode)\n .addNode('cacheCategorizerResults', cacheCategorizerResultsNode)\n .addNode('normalizeAndSort', normalizeAndSortNode)\n .addEdge(START, 'loadOpportunities')\n .addEdge('loadOpportunities', 'checkPresenterCache')\n .addConditionalEdges('checkPresenterCache', shouldGenerateCards, {\n generate: 'generateCardText',\n skip: 'cachePresenterResults',\n })\n .addEdge('generateCardText', 'cachePresenterResults')\n .addEdge('cachePresenterResults', 'checkCategorizerCache')\n .addConditionalEdges('checkCategorizerCache', shouldCategorize, {\n categorize: 'categorizeDynamically',\n skip: 'normalizeAndSort',\n })\n .addEdge('categorizeDynamically', 'cacheCategorizerResults')\n .addEdge('cacheCategorizerResults', 'normalizeAndSort')\n .addEdge('normalizeAndSort', END);\n\n return graph.compile();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"opportunity.discover.d.ts","sourceRoot":"/","sources":["opportunity/opportunity.discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAe,0BAA0B,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACtH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAGrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,oBAAo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IAC1F,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,iFAAiF;IACjF,UAAU,CAAC,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,mFAAmF;IACnF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,kEAAkE;IAClE,uBAAuB,CAAC,EAAE;QACxB,SAAS,EAAE,aAAa,GAAG,UAAU,CAAC;QACtC,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,gBAAgB,EAAE,CAAC;QAC/B,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAoXD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,cAAc,CAAC,CAiUzB;AA0OD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,gBAAgB,EAAE,wBAAwB,CAAC;IAC3C,QAAQ,EAAE,0BAA0B,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,OAAO,CAAC,cAAc,CAAC,CAgI1B"}
@@ -10,7 +10,8 @@
10
10
  */
11
11
  import { gatherPresenterContext } from "./opportunity.presenter.js";
12
12
  import { MINIMAL_MAIN_TEXT_MAX_CHARS, getPrimaryActionLabel, SECONDARY_ACTION_LABEL } from "./opportunity.labels.js";
13
- import { viewerCentricCardSummary, narratorRemarkFromReasoning } from "./opportunity.presentation.js";
13
+ import { narratorRemarkFromReasoning } from "./opportunity.presentation.js";
14
+ import { safeFallbackSummary } from "./opportunity.safe-presentation.js";
14
15
  import { protocolLogger, withCallLogging } from "../shared/observability/protocol.logger.js";
15
16
  import { buildFallbackDigest } from "../negotiation/negotiation.summarizer.js";
16
17
  import { traceAgent, tracePhase } from "../shared/observability/trace.js";
@@ -199,7 +200,14 @@ async function enrichOpportunities(input) {
199
200
  }
200
201
  }
201
202
  const isCounterpartGhost = isGhostByUserId.get(item.candidateUserId) ?? false;
202
- const personalizedSummary = viewerCentricCardSummary(reasoning, name, MINIMAL_MAIN_TEXT_MAX_CHARS, viewerName, introducerName);
203
+ // Shared sanitization standard see opportunity.safe-presentation.ts.
204
+ const personalizedSummary = safeFallbackSummary(reasoning, {
205
+ counterpartName: name,
206
+ viewerName,
207
+ introducerName,
208
+ maxChars: MINIMAL_MAIN_TEXT_MAX_CHARS,
209
+ emptyText: "A suggested connection.",
210
+ });
203
211
  return {
204
212
  headline: viewerIsIntroducer && secondPartyName
205
213
  ? `${name} → ${secondPartyName}`