@indexnetwork/protocol 4.3.3-rc.308.1 → 4.3.4-rc.309.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.
Files changed (69) hide show
  1. package/dist/chat/chat.agent.d.ts.map +1 -1
  2. package/dist/chat/chat.agent.js +11 -1
  3. package/dist/chat/chat.agent.js.map +1 -1
  4. package/dist/chat/chat.graph.d.ts +16 -0
  5. package/dist/chat/chat.graph.d.ts.map +1 -1
  6. package/dist/chat/chat.graph.js +5 -2
  7. package/dist/chat/chat.graph.js.map +1 -1
  8. package/dist/chat/chat.prompt.d.ts.map +1 -1
  9. package/dist/chat/chat.prompt.js +19 -12
  10. package/dist/chat/chat.prompt.js.map +1 -1
  11. package/dist/chat/chat.state.d.ts +6 -3
  12. package/dist/chat/chat.state.d.ts.map +1 -1
  13. package/dist/chat/chat.state.js +12 -3
  14. package/dist/chat/chat.state.js.map +1 -1
  15. package/dist/chat/chat.streamer.d.ts +5 -0
  16. package/dist/chat/chat.streamer.d.ts.map +1 -1
  17. package/dist/chat/chat.streamer.js +13 -4
  18. package/dist/chat/chat.streamer.js.map +1 -1
  19. package/dist/enrichment/enrichment.tools.d.ts.map +1 -1
  20. package/dist/enrichment/enrichment.tools.js +16 -19
  21. package/dist/enrichment/enrichment.tools.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/intent/intent.graph.d.ts.map +1 -1
  27. package/dist/intent/intent.state.d.ts +1 -1
  28. package/dist/intent/intent.state.js +1 -1
  29. package/dist/intent/intent.state.js.map +1 -1
  30. package/dist/intent/intent.tools.d.ts.map +1 -1
  31. package/dist/intent/intent.tools.js +60 -43
  32. package/dist/intent/intent.tools.js.map +1 -1
  33. package/dist/mcp/mcp.server.d.ts +3 -5
  34. package/dist/mcp/mcp.server.d.ts.map +1 -1
  35. package/dist/mcp/mcp.server.js +7 -16
  36. package/dist/mcp/mcp.server.js.map +1 -1
  37. package/dist/negotiation/negotiation.tools.d.ts.map +1 -1
  38. package/dist/negotiation/negotiation.tools.js +11 -7
  39. package/dist/negotiation/negotiation.tools.js.map +1 -1
  40. package/dist/network/network.tools.d.ts.map +1 -1
  41. package/dist/network/network.tools.js +50 -38
  42. package/dist/network/network.tools.js.map +1 -1
  43. package/dist/opportunity/opportunity.graph.js +1 -1
  44. package/dist/opportunity/opportunity.graph.js.map +1 -1
  45. package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
  46. package/dist/opportunity/opportunity.tools.js +25 -29
  47. package/dist/opportunity/opportunity.tools.js.map +1 -1
  48. package/dist/questioner/questioner.tools.d.ts +1 -1
  49. package/dist/questioner/questioner.tools.d.ts.map +1 -1
  50. package/dist/questioner/questioner.tools.js +4 -5
  51. package/dist/questioner/questioner.tools.js.map +1 -1
  52. package/dist/shared/agent/tool.factory.d.ts.map +1 -1
  53. package/dist/shared/agent/tool.factory.js +9 -10
  54. package/dist/shared/agent/tool.factory.js.map +1 -1
  55. package/dist/shared/agent/tool.registry.js +1 -1
  56. package/dist/shared/agent/tool.registry.js.map +1 -1
  57. package/dist/shared/agent/tool.scope.d.ts +12 -0
  58. package/dist/shared/agent/tool.scope.d.ts.map +1 -1
  59. package/dist/shared/agent/tool.scope.js +14 -0
  60. package/dist/shared/agent/tool.scope.js.map +1 -1
  61. package/dist/shared/interfaces/auth.interface.d.ts +3 -3
  62. package/dist/shared/interfaces/auth.interface.js.map +1 -1
  63. package/dist/shared/interfaces/discovery-run.interface.d.ts +1 -1
  64. package/dist/shared/interfaces/discovery-run.interface.d.ts.map +1 -1
  65. package/dist/shared/interfaces/discovery-run.interface.js.map +1 -1
  66. package/dist/shared/interfaces/enrichment-run.interface.d.ts +1 -1
  67. package/dist/shared/interfaces/enrichment-run.interface.d.ts.map +1 -1
  68. package/dist/shared/interfaces/enrichment-run.interface.js.map +1 -1
  69. package/package.json +1 -1
@@ -1 +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AAgB,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAKnH,YAAY,EAAE,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
@@ -16,7 +16,7 @@
16
16
  export { createChatTools } from "./shared/agent/tool.factory.js";
17
17
  export { getModelName } from "./shared/agent/model.config.js";
18
18
  export { ChatContextAccessError, resolveChatContext } from "./shared/agent/tool.helpers.js";
19
- export { deriveAllowedNetworkIds, deriveDiscoveryNetworkIds, hasNetworkScope, scopeFromNetworkId, } from "./shared/agent/tool.scope.js";
19
+ export { deriveAllowedNetworkIds, deriveDiscoveryNetworkIds, focusedNetworkId, focusedNetworkLabel, hasNetworkScope, scopeFromNetworkId, } from "./shared/agent/tool.scope.js";
20
20
  export { requestContext } from "./shared/observability/request-context.js";
21
21
  export { setTimingWrapper } from "./shared/observability/performance.js";
22
22
  export { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from "./shared/agent/tool.runtime.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;AACnE,+EAA+E;AAC/E,iFAAiF;AACjF,gFAAgF;AAEhF,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,g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AM,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 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.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AC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAE5N,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,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 +1 @@
1
- {"version":3,"file":"intent.graph.d.ts","sourceRoot":"/","sources":["intent/intent.graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAIhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAmE7E;;GAEG;AACH,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ,CAAC;IACjB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,iBAAiB,CAAC;gBAHlB,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,CAAC,EAAE,kBAAkB,YAAA,EAC7B,WAAW,CAAC,EAAE,gBAAgB,YAAA,EAC9B,iBAAiB,CAAC,EAAE,mBAAmB,YAAA;IAG1C,WAAW;;;;;;;;;;;;;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0BADoB,CAAC;4BACtB,CAAC;;;;;;;;;;;0BADoB,CAAC;4BACtB,CAAC;;;;;;;;;;CA2xBZ"}
@@ -157,7 +157,7 @@ export declare const IntentGraphState: import("@langchain/langgraph").Annotation
157
157
  * For read mode: the set of index IDs the caller's agent can reach.
158
158
  * When set and neither networkId nor queryUserId is provided, the graph
159
159
  * returns the caller's own intents across all indexes in this set (scope-aware
160
- * default path). Populated by the tool layer from context.indexScope.
160
+ * default path). Derived by the tool layer from the scope envelope plus memberships.
161
161
  */
162
162
  indexScope: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
163
163
  /**
@@ -140,7 +140,7 @@ export const IntentGraphState = Annotation.Root({
140
140
  * For read mode: the set of index IDs the caller's agent can reach.
141
141
  * When set and neither networkId nor queryUserId is provided, the graph
142
142
  * returns the caller's own intents across all indexes in this set (scope-aware
143
- * default path). Populated by the tool layer from context.indexScope.
143
+ * default path). Derived by the tool layer from the scope envelope plus memberships.
144
144
  */
145
145
  indexScope: Annotation({
146
146
  reducer: (_curr, next) => next,
@@ -1 +1 @@
1
- {"version":3,"file":"intent.state.js","sourceRoot":"/","sources":["intent/intent.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAkClD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC;IAC9C,qCAAqC;IAErC;;;OAGG;IACH,MAAM,EAAE,CAAA,UAAkB,CAAA;IAE1B;;OAEG;IACH,WAAW,EAAE,CAAA,UAAkB,CAAA;IAE/B;;;OAGG;IACH,YAAY,EAAE,CAAA,UAA8B,CAAA;IAE5C;;;;;OAKG;IACH,mBAAmB,EAAE,UAAU,CAA4B;QACzD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAA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BAA2B;IAE3B;;;;;OAKG;IACH,UAAU,EAAE,UAAU,CAAuB;QAC3C,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;QAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;IAEF;;;OAGG;IACH,WAAW,EAAE,UAAU,CAAqB;QAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;IAEF;;;OAGG;IACH,cAAc,EAAE,UAAU,CAAU;QAClC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;KACrB,CAAC;IAEF;;OAEG;IACH,UAAU,EAAE,UAAU,CAYP;QACb,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;QAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { Annotation } from \"@langchain/langgraph\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { InferredIntent } from \"./intent.inferrer.js\";\nimport { SemanticVerifierOutput } from \"./intent.verifier.js\";\nimport { IntentReconcilerOutput } from \"./intent.reconciler.js\";\nimport type { DebugMetaAgent } from '../chat/chat-streaming.types.js';\nimport type { ToolScopeType } from '../shared/agent/tool.scope.js';\n\n/**\n * Extended InferredIntent that includes verification results.\n * We attach the verification output directly to the intent object\n * as it flows through the graph.\n */\nexport type VerifiedIntent = InferredIntent & {\n verification?: SemanticVerifierOutput;\n score?: number; // Calculated min(authority, sincerity, clarity)\n};\n\n/**\n * Result of executing a single reconciler action.\n */\nexport interface ExecutionResult {\n /** The action type that was executed */\n actionType: 'create' | 'update' | 'expire';\n /** Whether the action succeeded */\n success: boolean;\n /** The intent ID (created/updated/archived) */\n intentId?: string;\n /** Final payload (sanitized, for create/update) */\n payload?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * The Graph State using LangGraph Annotations.\n * This acts as the central bus for data flowing through our graph.\n */\nexport const IntentGraphState = Annotation.Root({\n // --- Inputs (Required at start) ---\n\n /**\n * The unique identifier of the user whose intents are being processed.\n * Required for database operations.\n */\n userId: Annotation<string>,\n\n /**\n * The user's profile context (Identity, Narrative, etc.)\n */\n userProfile: Annotation<string>,\n\n /**\n * Explicit input content (e.g., user message).\n * Optional - graph might run on implicit only.\n */\n inputContent: Annotation<string | undefined>,\n\n /**\n * Conversation history for context-aware intent inference.\n * Used to resolve anaphoric references (\"that intent\", \"this goal\").\n * Limited to recent messages (typically last 10) for token efficiency.\n * Optional - if not provided, intent inference uses only inputContent.\n */\n conversationContext: Annotation<BaseMessage[] | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * Operation mode controls graph flow and determines which nodes execute.\n * - 'create': Full pipeline (prep → inference → verification → reconciliation → execution)\n * - 'update': Skip verification if no new intents (prep → inference → reconciliation → execution)\n * - 'delete': Skip inference and verification (prep → reconciliation → execution)\n * - 'read': Fast path (prep → queryNode → END) — reads intents without LLM calls\n * - 'propose': Inference + verification only, stops before reconciliation (no DB writes)\n *\n * Defaults to 'create' for backward compatibility.\n */\n operationMode: Annotation<'create' | 'update' | 'delete' | 'read' | 'propose'>({\n reducer: (curr, next) => next ?? curr,\n default: () => 'create' as const,\n }),\n\n /**\n * For update/delete operations, specifies which intent IDs to target.\n * Optional - used when modifying or removing specific intents.\n */\n targetIntentIds: Annotation<string[] | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * Optional index scope (index ID). Used for linking created intents to an index\n * and for scoping read operations. Prep always fetches ALL user intents via\n * getActiveIntents(userId) regardless of index scope (for global dedup/reconciliation).\n */\n networkId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** Focused request scope type for write-side assignment and follow-up queues. */\n scopeType: Annotation<ToolScopeType | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** Focused request scope id. When scopeType is `network`, this is the focused network id. */\n scopeId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n // --- Populated by Graph (Prep Node) ---\n\n /**\n * The formatted string of currently active intents.\n * Always populated by prep via getActiveIntents(userId).\n */\n activeIntents: Annotation<string>({\n reducer: (curr, next) => next,\n default: () => \"\",\n }),\n\n // --- Intermediate State ---\n\n /**\n * List of raw intents extracted from text.\n */\n inferredIntents: Annotation<InferredIntent[]>({\n reducer: (curr, next) => next, // Overwrite with new inference\n default: () => [],\n }),\n\n /**\n * List of intents that have passed semantic verification.\n * Invalid intents are filtered out before reaching this state.\n */\n verifiedIntents: Annotation<VerifiedIntent[]>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n // --- Output ---\n\n /**\n * Final actions to be performed on the DB (Create, Update, Expire).\n */\n actions: Annotation<IntentReconcilerOutput['actions']>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n /**\n * Results of executing actions against the database.\n * Populated by executorNode after actions are persisted.\n */\n executionResults: Annotation<ExecutionResult[]>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n // --- Error State ---\n\n /**\n * If set, indicates a fatal error that should short-circuit the graph to END.\n * Populated by prep when a precondition fails (e.g. missing profile).\n */\n error: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n // --- Trace Output ---\n\n /**\n * Accumulated trace entries from each graph node.\n * Used for observability: surfaces internal processing steps (inference,\n * verification with Felicity scores, reconciliation) to the frontend.\n */\n trace: Annotation<Array<{ node: string; detail?: string; data?: Record<string, unknown> }>>({\n reducer: (curr, next) => [...curr, ...(next || [])],\n default: () => [],\n }),\n\n /** Timing records for each agent invocation within this graph run. */\n agentTimings: Annotation<DebugMetaAgent[]>({\n reducer: (acc, val) => [...acc, ...val],\n default: () => [],\n }),\n\n // --- Read Mode Fields ---\n\n /**\n * For read mode: the set of index IDs the caller's agent can reach.\n * When set and neither networkId nor queryUserId is provided, the graph\n * returns the caller's own intents across all indexes in this set (scope-aware\n * default path). Populated by the tool layer from context.indexScope.\n */\n indexScope: Annotation<string[] | undefined>({\n reducer: (_curr, next) => next,\n default: () => undefined,\n }),\n\n /**\n * For read mode: filter intents by a specific user when reading in an index.\n * When omitted and index-scoped, returns all intents in the index.\n */\n queryUserId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * For read mode: when true, return all of the current user's intents\n * ignoring index scope. Used before create_intent to detect duplicates.\n */\n allUserIntents: Annotation<boolean>({\n reducer: (curr, next) => next ?? curr,\n default: () => false,\n }),\n\n /**\n * Output of read mode: queried intents with count and optional metadata.\n */\n readResult: Annotation<{\n count: number;\n intents: Array<{\n id: string;\n description: string;\n summary: string | null;\n createdAt: Date;\n userId?: string;\n userName?: string | null;\n }>;\n message?: string;\n networkId?: string;\n } | undefined>({\n reducer: (curr, next) => next,\n default: () => undefined,\n }),\n});\n"]}
1
+ {"version":3,"file":"intent.state.js","sourceRoot":"/","sources":["intent/intent.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAkClD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC;IAC9C,qCAAqC;IAErC;;;OAGG;IACH,MAAM,EAAE,CAAA,UAAkB,CAAA;IAE1B;;OAEG;IACH,WAAW,EAAE,CAAA,UAAkB,CAAA;IAE/B;;;OAGG;IACH,YAAY,EAAE,CAAA,UAA8B,CAAA;IAE5C;;;;;OAKG;IACH,mBAAmB,EAAE,UAAU,CAA4B;QACzD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,I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,CAAC,EAAE;KAClB,CAAC;IAEF,2BAA2B;IAE3B;;;;;OAKG;IACH,UAAU,EAAE,UAAU,CAAuB;QAC3C,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;QAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;IAEF;;;OAGG;IACH,WAAW,EAAE,UAAU,CAAqB;QAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;IAEF;;;OAGG;IACH,cAAc,EAAE,UAAU,CAAU;QAClC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;KACrB,CAAC;IAEF;;OAEG;IACH,UAAU,EAAE,UAAU,CAYP;QACb,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;QAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { Annotation } from \"@langchain/langgraph\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { InferredIntent } from \"./intent.inferrer.js\";\nimport { SemanticVerifierOutput } from \"./intent.verifier.js\";\nimport { IntentReconcilerOutput } from \"./intent.reconciler.js\";\nimport type { DebugMetaAgent } from '../chat/chat-streaming.types.js';\nimport type { ToolScopeType } from '../shared/agent/tool.scope.js';\n\n/**\n * Extended InferredIntent that includes verification results.\n * We attach the verification output directly to the intent object\n * as it flows through the graph.\n */\nexport type VerifiedIntent = InferredIntent & {\n verification?: SemanticVerifierOutput;\n score?: number; // Calculated min(authority, sincerity, clarity)\n};\n\n/**\n * Result of executing a single reconciler action.\n */\nexport interface ExecutionResult {\n /** The action type that was executed */\n actionType: 'create' | 'update' | 'expire';\n /** Whether the action succeeded */\n success: boolean;\n /** The intent ID (created/updated/archived) */\n intentId?: string;\n /** Final payload (sanitized, for create/update) */\n payload?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * The Graph State using LangGraph Annotations.\n * This acts as the central bus for data flowing through our graph.\n */\nexport const IntentGraphState = Annotation.Root({\n // --- Inputs (Required at start) ---\n\n /**\n * The unique identifier of the user whose intents are being processed.\n * Required for database operations.\n */\n userId: Annotation<string>,\n\n /**\n * The user's profile context (Identity, Narrative, etc.)\n */\n userProfile: Annotation<string>,\n\n /**\n * Explicit input content (e.g., user message).\n * Optional - graph might run on implicit only.\n */\n inputContent: Annotation<string | undefined>,\n\n /**\n * Conversation history for context-aware intent inference.\n * Used to resolve anaphoric references (\"that intent\", \"this goal\").\n * Limited to recent messages (typically last 10) for token efficiency.\n * Optional - if not provided, intent inference uses only inputContent.\n */\n conversationContext: Annotation<BaseMessage[] | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * Operation mode controls graph flow and determines which nodes execute.\n * - 'create': Full pipeline (prep → inference → verification → reconciliation → execution)\n * - 'update': Skip verification if no new intents (prep → inference → reconciliation → execution)\n * - 'delete': Skip inference and verification (prep → reconciliation → execution)\n * - 'read': Fast path (prep → queryNode → END) — reads intents without LLM calls\n * - 'propose': Inference + verification only, stops before reconciliation (no DB writes)\n *\n * Defaults to 'create' for backward compatibility.\n */\n operationMode: Annotation<'create' | 'update' | 'delete' | 'read' | 'propose'>({\n reducer: (curr, next) => next ?? curr,\n default: () => 'create' as const,\n }),\n\n /**\n * For update/delete operations, specifies which intent IDs to target.\n * Optional - used when modifying or removing specific intents.\n */\n targetIntentIds: Annotation<string[] | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * Optional index scope (index ID). Used for linking created intents to an index\n * and for scoping read operations. Prep always fetches ALL user intents via\n * getActiveIntents(userId) regardless of index scope (for global dedup/reconciliation).\n */\n networkId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** Focused request scope type for write-side assignment and follow-up queues. */\n scopeType: Annotation<ToolScopeType | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** Focused request scope id. When scopeType is `network`, this is the focused network id. */\n scopeId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n // --- Populated by Graph (Prep Node) ---\n\n /**\n * The formatted string of currently active intents.\n * Always populated by prep via getActiveIntents(userId).\n */\n activeIntents: Annotation<string>({\n reducer: (curr, next) => next,\n default: () => \"\",\n }),\n\n // --- Intermediate State ---\n\n /**\n * List of raw intents extracted from text.\n */\n inferredIntents: Annotation<InferredIntent[]>({\n reducer: (curr, next) => next, // Overwrite with new inference\n default: () => [],\n }),\n\n /**\n * List of intents that have passed semantic verification.\n * Invalid intents are filtered out before reaching this state.\n */\n verifiedIntents: Annotation<VerifiedIntent[]>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n // --- Output ---\n\n /**\n * Final actions to be performed on the DB (Create, Update, Expire).\n */\n actions: Annotation<IntentReconcilerOutput['actions']>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n /**\n * Results of executing actions against the database.\n * Populated by executorNode after actions are persisted.\n */\n executionResults: Annotation<ExecutionResult[]>({\n reducer: (curr, next) => next,\n default: () => [],\n }),\n\n // --- Error State ---\n\n /**\n * If set, indicates a fatal error that should short-circuit the graph to END.\n * Populated by prep when a precondition fails (e.g. missing profile).\n */\n error: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n // --- Trace Output ---\n\n /**\n * Accumulated trace entries from each graph node.\n * Used for observability: surfaces internal processing steps (inference,\n * verification with Felicity scores, reconciliation) to the frontend.\n */\n trace: Annotation<Array<{ node: string; detail?: string; data?: Record<string, unknown> }>>({\n reducer: (curr, next) => [...curr, ...(next || [])],\n default: () => [],\n }),\n\n /** Timing records for each agent invocation within this graph run. */\n agentTimings: Annotation<DebugMetaAgent[]>({\n reducer: (acc, val) => [...acc, ...val],\n default: () => [],\n }),\n\n // --- Read Mode Fields ---\n\n /**\n * For read mode: the set of index IDs the caller's agent can reach.\n * When set and neither networkId nor queryUserId is provided, the graph\n * returns the caller's own intents across all indexes in this set (scope-aware\n * default path). Derived by the tool layer from the scope envelope plus memberships.\n */\n indexScope: Annotation<string[] | undefined>({\n reducer: (_curr, next) => next,\n default: () => undefined,\n }),\n\n /**\n * For read mode: filter intents by a specific user when reading in an index.\n * When omitted and index-scoped, returns all intents in the index.\n */\n queryUserId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /**\n * For read mode: when true, return all of the current user's intents\n * ignoring index scope. Used before create_intent to detect duplicates.\n */\n allUserIntents: Annotation<boolean>({\n reducer: (curr, next) => next ?? curr,\n default: () => false,\n }),\n\n /**\n * Output of read mode: queried intents with count and optional metadata.\n */\n readResult: Annotation<{\n count: number;\n intents: Array<{\n id: string;\n description: string;\n summary: string | null;\n createdAt: Date;\n userId?: string;\n userName?: string | null;\n }>;\n message?: string;\n networkId?: string;\n } | undefined>({\n reducer: (curr, next) => next,\n default: () => undefined,\n }),\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"intent.tools.d.ts","sourceRoot":"/","sources":["intent/intent.tools.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AA4D5E,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,qDAorBvE"}
1
+ {"version":3,"file":"intent.tools.d.ts","sourceRoot":"/","sources":["intent/intent.tools.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AA8D5E,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,qDAssBvE"}
@@ -4,6 +4,7 @@ import { protocolLogger } from "../shared/observability/protocol.logger.js";
4
4
  import { traceGraph } from "../shared/observability/trace.js";
5
5
  import { success, error, UUID_REGEX } from "../shared/agent/tool.helpers.js";
6
6
  import { invokeWithAbortSignal } from "../shared/agent/model-signal.js";
7
+ import { deriveAllowedNetworkIds, focusedNetworkId, focusedNetworkLabel } from "../shared/agent/tool.scope.js";
7
8
  const logger = protocolLogger("ChatTools:Intent");
8
9
  /**
9
10
  * Sanitize JSON string for use inside a markdown code fence (```). Escapes backticks
@@ -14,11 +15,12 @@ function sanitizeJsonForCodeFence(json) {
14
15
  }
15
16
  /** When context is index-scoped, verifies the caller is still a member of that index. Returns error message or null. */
16
17
  async function ensureScopedMembership(context, systemDb) {
17
- if (!context.networkId)
18
+ const scopedNetworkId = focusedNetworkId(context);
19
+ if (!scopedNetworkId)
18
20
  return null;
19
- const isMember = await systemDb.isNetworkMember(context.networkId, context.userId);
21
+ const isMember = await systemDb.isNetworkMember(scopedNetworkId, context.userId);
20
22
  if (!isMember) {
21
- return `This chat is scoped to ${context.indexName ?? 'this index'}. You are no longer a member of this community.`;
23
+ return `This chat is scoped to ${focusedNetworkLabel(context)}. You are no longer a member of this community.`;
22
24
  }
23
25
  return null;
24
26
  }
@@ -79,6 +81,8 @@ export function createIntentTools(defineTool, deps) {
79
81
  if (scopeErr)
80
82
  return error(scopeErr);
81
83
  // Distinguish "explicit network browse" from "implicit scope-aware read"
84
+ const scopedNetworkId = focusedNetworkId(context);
85
+ const scopedIndexLabel = focusedNetworkLabel(context);
82
86
  const explicitNetworkId = query.networkId?.trim();
83
87
  const explicitUserId = query.userId?.trim();
84
88
  // Validate explicit networkId format
@@ -86,25 +90,24 @@ export function createIntentTools(defineTool, deps) {
86
90
  return error("Invalid network ID format.");
87
91
  }
88
92
  // Strict scope enforcement: in a scoped chat, the only allowed explicit
89
- // networkId is context.networkId itself. The chat's focus is the bound
90
- // network; cross-network browse must happen in a separate (unscoped)
91
- // chat or a chat scoped to that other network.
92
- if (context.networkId && explicitNetworkId && explicitNetworkId !== context.networkId) {
93
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only read intents from this community.`);
93
+ // networkId is the envelope's scoped network. Cross-network browse must
94
+ // happen in a separate unscoped chat or a chat scoped to that network.
95
+ if (scopedNetworkId && explicitNetworkId && explicitNetworkId !== scopedNetworkId) {
96
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only read intents from this community.`);
94
97
  }
95
98
  // Cross-user read in scoped chat: target user must be a member of the scoped index
96
- if (context.networkId && explicitUserId && explicitUserId !== context.userId) {
97
- const isInScopedIndex = await deps.systemDb.isNetworkMember(context.networkId, explicitUserId);
99
+ if (scopedNetworkId && explicitUserId && explicitUserId !== context.userId) {
100
+ const isInScopedIndex = await deps.systemDb.isNetworkMember(scopedNetworkId, explicitUserId);
98
101
  if (!isInScopedIndex) {
99
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only read intents from members of this community.`);
102
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only read intents from members of this community.`);
100
103
  }
101
104
  }
102
105
  // Cross-user global read is disallowed without an index scope
103
- if (!explicitNetworkId && !context.networkId && explicitUserId && explicitUserId !== context.userId) {
106
+ if (!explicitNetworkId && !scopedNetworkId && explicitUserId && explicitUserId !== context.userId) {
104
107
  return error("Cannot read another user's global intents. Use networkId to scope to a shared network.");
105
108
  }
106
109
  // Membership check for explicit cross-network reads in unscoped chats
107
- if (!context.networkId && explicitNetworkId) {
110
+ if (!scopedNetworkId && explicitNetworkId) {
108
111
  const callerIsMember = await deps.systemDb.isNetworkMember(explicitNetworkId, context.userId);
109
112
  if (!callerIsMember) {
110
113
  return error("You can only read intents from indexes you are a member of.");
@@ -126,10 +129,10 @@ export function createIntentTools(defineTool, deps) {
126
129
  if (explicitUserId)
127
130
  graphInput.queryUserId = explicitUserId;
128
131
  }
129
- else if (explicitUserId && context.networkId) {
132
+ else if (explicitUserId && scopedNetworkId) {
130
133
  // Scoped chat + userId: implicit network is the chat's bound network.
131
134
  // Membership of the target user was verified above.
132
- graphInput.networkId = context.networkId;
135
+ graphInput.networkId = scopedNetworkId;
133
136
  graphInput.queryUserId = explicitUserId;
134
137
  }
135
138
  else if (explicitUserId) {
@@ -137,9 +140,13 @@ export function createIntentTools(defineTool, deps) {
137
140
  graphInput.queryUserId = explicitUserId;
138
141
  graphInput.allUserIntents = true;
139
142
  }
140
- else if (context.indexScope && context.indexScope.length > 0 && context.networkId) {
143
+ else if (scopedNetworkId) {
141
144
  // Scoped chat, implicit read: caller-only across reachable indexes.
142
- graphInput.indexScope = context.indexScope;
145
+ graphInput.indexScope = deriveAllowedNetworkIds({
146
+ memberships: context.userNetworks,
147
+ scopeType: 'network',
148
+ scopeId: scopedNetworkId,
149
+ });
143
150
  }
144
151
  else {
145
152
  // Unscoped, implicit read: caller's global intents.
@@ -209,13 +216,15 @@ export function createIntentTools(defineTool, deps) {
209
216
  if (!query.description?.trim()) {
210
217
  return error("Description is required.");
211
218
  }
219
+ const scopedNetworkId = focusedNetworkId(context);
220
+ const scopedIndexLabel = focusedNetworkLabel(context);
212
221
  // Strict scope enforcement
213
- if (context.networkId && query.networkId?.trim() && query.networkId.trim() !== context.networkId) {
214
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only create intents in this community.`);
222
+ if (scopedNetworkId && query.networkId?.trim() && query.networkId.trim() !== scopedNetworkId) {
223
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only create intents in this community.`);
215
224
  }
216
- const effectiveIndexId = context.networkId || query.networkId?.trim() || undefined;
217
- const scopeEnvelope = context.scopeType && context.scopeId
218
- ? { scopeType: context.scopeType, scopeId: context.scopeId }
225
+ const effectiveIndexId = scopedNetworkId || query.networkId?.trim() || undefined;
226
+ const scopeEnvelope = scopedNetworkId
227
+ ? { scopeType: 'network', scopeId: scopedNetworkId }
219
228
  : {};
220
229
  // Fetch profile (the intent graph needs it for inference)
221
230
  const _profileGraphStart1 = Date.now();
@@ -375,12 +384,14 @@ export function createIntentTools(defineTool, deps) {
375
384
  if (intent.archivedAt) {
376
385
  return error("This intent is archived and cannot be updated. Create a new intent instead.");
377
386
  }
387
+ const scopedNetworkId = focusedNetworkId(context);
388
+ const scopedIndexLabel = focusedNetworkLabel(context);
378
389
  // Strict scope enforcement: when chat is index-scoped, verify intent is linked to that index
379
- if (context.networkId) {
390
+ if (scopedNetworkId) {
380
391
  const db = deps.userDb;
381
392
  const intentNetworks = await db.getNetworkIdsForIntent(intentId);
382
- if (!intentNetworks.includes(context.networkId)) {
383
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only update intents linked to this community.`);
393
+ if (!intentNetworks.includes(scopedNetworkId)) {
394
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only update intents linked to this community.`);
384
395
  }
385
396
  }
386
397
  const _profileGraphStart2 = Date.now();
@@ -396,8 +407,7 @@ export function createIntentTools(defineTool, deps) {
396
407
  operationMode: 'update',
397
408
  inputContent: query.description,
398
409
  targetIntentIds: [intentId],
399
- ...(context.networkId && { networkId: context.networkId }),
400
- ...(context.scopeType && context.scopeId ? { scopeType: context.scopeType, scopeId: context.scopeId } : {}),
410
+ ...(scopedNetworkId && { networkId: scopedNetworkId, scopeType: 'network', scopeId: scopedNetworkId }),
401
411
  }));
402
412
  const _intentGraphMs2 = Date.now() - _intentGraphStart2;
403
413
  if (result.executionResults?.some((r) => !r.success)) {
@@ -440,12 +450,14 @@ export function createIntentTools(defineTool, deps) {
440
450
  if (!intent || intent.userId !== context.userId) {
441
451
  return error("Intent not found or you can only delete your own intents.");
442
452
  }
453
+ const scopedNetworkId = focusedNetworkId(context);
454
+ const scopedIndexLabel = focusedNetworkLabel(context);
443
455
  // Strict scope enforcement: when chat is index-scoped, verify intent is linked to that index
444
- if (context.networkId) {
456
+ if (scopedNetworkId) {
445
457
  const db = deps.userDb;
446
458
  const intentNetworks = await db.getNetworkIdsForIntent(intentId);
447
- if (!intentNetworks.includes(context.networkId)) {
448
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only delete intents linked to this community.`);
459
+ if (!intentNetworks.includes(scopedNetworkId)) {
460
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only delete intents linked to this community.`);
449
461
  }
450
462
  }
451
463
  const _deleteIntentGraphStart = Date.now();
@@ -454,8 +466,7 @@ export function createIntentTools(defineTool, deps) {
454
466
  userProfile: "",
455
467
  operationMode: 'delete',
456
468
  targetIntentIds: [intentId],
457
- ...(context.networkId && { networkId: context.networkId }),
458
- ...(context.scopeType && context.scopeId ? { scopeType: context.scopeType, scopeId: context.scopeId } : {}),
469
+ ...(scopedNetworkId && { networkId: scopedNetworkId, scopeType: 'network', scopeId: scopedNetworkId }),
459
470
  }));
460
471
  const _deleteIntentGraphMs = Date.now() - _deleteIntentGraphStart;
461
472
  if (result.executionResults?.some((r) => !r.success)) {
@@ -485,14 +496,16 @@ export function createIntentTools(defineTool, deps) {
485
496
  const scopeErr = await ensureScopedMembership(context, deps.systemDb);
486
497
  if (scopeErr)
487
498
  return error(scopeErr);
499
+ const scopedNetworkId = focusedNetworkId(context);
500
+ const scopedIndexLabel = focusedNetworkLabel(context);
488
501
  const intentId = query.intentId?.trim() ?? "";
489
- const networkId = query.networkId?.trim() || context.networkId || "";
502
+ const networkId = query.networkId?.trim() || scopedNetworkId || "";
490
503
  if (!UUID_REGEX.test(intentId) || !UUID_REGEX.test(networkId)) {
491
504
  return error("Invalid ID format. Both must be UUIDs.");
492
505
  }
493
506
  // Strict scope enforcement: when chat is index-scoped, only allow linking to that index
494
- if (context.networkId && networkId !== context.networkId) {
495
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only link intents to this community.`);
507
+ if (scopedNetworkId && networkId !== scopedNetworkId) {
508
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only link intents to this community.`);
496
509
  }
497
510
  const _createIntentIndexGraphStart = Date.now();
498
511
  const result = await traceGraph("intent_network", () => invokeWithAbortSignal(graphs.intentIndex, {
@@ -537,8 +550,10 @@ export function createIntentTools(defineTool, deps) {
537
550
  const scopeErr = await ensureScopedMembership(context, deps.systemDb);
538
551
  if (scopeErr)
539
552
  return error(scopeErr);
553
+ const scopedNetworkId = focusedNetworkId(context);
554
+ const scopedIndexLabel = focusedNetworkLabel(context);
540
555
  const intentId = query.intentId?.trim() || undefined;
541
- let networkId = query.networkId?.trim() || context.networkId || undefined;
556
+ let networkId = query.networkId?.trim() || scopedNetworkId || undefined;
542
557
  const queryUserId = query.userId?.trim() || undefined;
543
558
  if (intentId && !UUID_REGEX.test(intentId)) {
544
559
  return error("Invalid intent ID format.");
@@ -550,14 +565,14 @@ export function createIntentTools(defineTool, deps) {
550
565
  return error("Provide networkId or intentId.");
551
566
  }
552
567
  // Strict scope enforcement: when chat is index-scoped, only allow querying that index
553
- if (context.networkId && networkId && networkId !== context.networkId) {
554
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only read intent links from this community.`);
568
+ if (scopedNetworkId && networkId && networkId !== scopedNetworkId) {
569
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only read intent links from this community.`);
555
570
  }
556
571
  // When only intentId is provided, enforce scope - don't reveal all linked indexes
557
572
  if (intentId && !networkId) {
558
- if (context.networkId) {
573
+ if (scopedNetworkId) {
559
574
  // When scoped, only check if intent is linked to the scoped index
560
- networkId = context.networkId;
575
+ networkId = scopedNetworkId;
561
576
  }
562
577
  else {
563
578
  // When unscoped, still don't reveal all indexes - require explicit networkId
@@ -597,14 +612,16 @@ export function createIntentTools(defineTool, deps) {
597
612
  const scopeErr = await ensureScopedMembership(context, deps.systemDb);
598
613
  if (scopeErr)
599
614
  return error(scopeErr);
615
+ const scopedNetworkId = focusedNetworkId(context);
616
+ const scopedIndexLabel = focusedNetworkLabel(context);
600
617
  const intentId = query.intentId?.trim() ?? "";
601
- const networkId = query.networkId?.trim() || context.networkId || "";
618
+ const networkId = query.networkId?.trim() || scopedNetworkId || "";
602
619
  if (!UUID_REGEX.test(intentId) || !UUID_REGEX.test(networkId)) {
603
620
  return error("Invalid ID format. Both must be UUIDs.");
604
621
  }
605
622
  // Strict scope enforcement: when chat is index-scoped, only allow unlinking from that index
606
- if (context.networkId && networkId !== context.networkId) {
607
- return error(`This chat is scoped to ${context.indexName ?? 'this index'}. You can only unlink intents from this community.`);
623
+ if (scopedNetworkId && networkId !== scopedNetworkId) {
624
+ return error(`This chat is scoped to ${scopedIndexLabel}. You can only unlink intents from this community.`);
608
625
  }
609
626
  const _deleteIntentIndexGraphStart = Date.now();
610
627
  const result = await traceGraph("intent_network", () => invokeWithAbortSignal(graphs.intentIndex, {