@indexnetwork/protocol 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/chat.agent.d.ts +218 -0
- package/dist/agents/chat.agent.d.ts.map +1 -0
- package/dist/agents/chat.agent.js +884 -0
- package/dist/agents/chat.agent.js.map +1 -0
- package/dist/agents/chat.prompt.d.ts +18 -0
- package/dist/agents/chat.prompt.d.ts.map +1 -0
- package/dist/agents/chat.prompt.js +372 -0
- package/dist/agents/chat.prompt.js.map +1 -0
- package/dist/agents/chat.prompt.modules.d.ts +61 -0
- package/dist/agents/chat.prompt.modules.d.ts.map +1 -0
- package/dist/agents/chat.prompt.modules.js +366 -0
- package/dist/agents/chat.prompt.modules.js.map +1 -0
- package/dist/agents/chat.title.generator.d.ts +20 -0
- package/dist/agents/chat.title.generator.d.ts.map +1 -0
- package/dist/agents/chat.title.generator.js +66 -0
- package/dist/agents/chat.title.generator.js.map +1 -0
- package/dist/agents/home.categorizer.d.ts +28 -0
- package/dist/agents/home.categorizer.d.ts.map +1 -0
- package/dist/agents/home.categorizer.js +170 -0
- package/dist/agents/home.categorizer.js.map +1 -0
- package/dist/agents/hyde.generator.d.ts +27 -0
- package/dist/agents/hyde.generator.d.ts.map +1 -0
- package/dist/agents/hyde.generator.js +75 -0
- package/dist/agents/hyde.generator.js.map +1 -0
- package/dist/agents/hyde.strategies.d.ts +17 -0
- package/dist/agents/hyde.strategies.d.ts.map +1 -0
- package/dist/agents/hyde.strategies.js +29 -0
- package/dist/agents/hyde.strategies.js.map +1 -0
- package/dist/agents/intent.clarifier.d.ts +29 -0
- package/dist/agents/intent.clarifier.d.ts.map +1 -0
- package/dist/agents/intent.clarifier.js +186 -0
- package/dist/agents/intent.clarifier.js.map +1 -0
- package/dist/agents/intent.indexer.d.ts +77 -0
- package/dist/agents/intent.indexer.d.ts.map +1 -0
- package/dist/agents/intent.indexer.js +164 -0
- package/dist/agents/intent.indexer.js.map +1 -0
- package/dist/agents/intent.inferrer.d.ts +95 -0
- package/dist/agents/intent.inferrer.d.ts.map +1 -0
- package/dist/agents/intent.inferrer.js +238 -0
- package/dist/agents/intent.inferrer.js.map +1 -0
- package/dist/agents/intent.reconciler.d.ts +106 -0
- package/dist/agents/intent.reconciler.d.ts.map +1 -0
- package/dist/agents/intent.reconciler.js +184 -0
- package/dist/agents/intent.reconciler.js.map +1 -0
- package/dist/agents/intent.verifier.d.ts +97 -0
- package/dist/agents/intent.verifier.d.ts.map +1 -0
- package/dist/agents/intent.verifier.js +234 -0
- package/dist/agents/intent.verifier.js.map +1 -0
- package/dist/agents/invite.generator.d.ts +47 -0
- package/dist/agents/invite.generator.d.ts.map +1 -0
- package/dist/agents/invite.generator.js +56 -0
- package/dist/agents/invite.generator.js.map +1 -0
- package/dist/agents/lens.inferrer.d.ts +37 -0
- package/dist/agents/lens.inferrer.d.ts.map +1 -0
- package/dist/agents/lens.inferrer.js +98 -0
- package/dist/agents/lens.inferrer.js.map +1 -0
- package/dist/agents/model.config.d.ts +120 -0
- package/dist/agents/model.config.d.ts.map +1 -0
- package/dist/agents/model.config.js +76 -0
- package/dist/agents/model.config.js.map +1 -0
- package/dist/agents/negotiation.insights.generator.d.ts +32 -0
- package/dist/agents/negotiation.insights.generator.d.ts.map +1 -0
- package/dist/agents/negotiation.insights.generator.js +105 -0
- package/dist/agents/negotiation.insights.generator.js.map +1 -0
- package/dist/agents/negotiation.proposer.d.ts +26 -0
- package/dist/agents/negotiation.proposer.d.ts.map +1 -0
- package/dist/agents/negotiation.proposer.js +67 -0
- package/dist/agents/negotiation.proposer.js.map +1 -0
- package/dist/agents/negotiation.responder.d.ts +26 -0
- package/dist/agents/negotiation.responder.d.ts.map +1 -0
- package/dist/agents/negotiation.responder.js +71 -0
- package/dist/agents/negotiation.responder.js.map +1 -0
- package/dist/agents/opportunity.evaluator.d.ts +253 -0
- package/dist/agents/opportunity.evaluator.d.ts.map +1 -0
- package/dist/agents/opportunity.evaluator.js +413 -0
- package/dist/agents/opportunity.evaluator.js.map +1 -0
- package/dist/agents/opportunity.presenter.d.ts +115 -0
- package/dist/agents/opportunity.presenter.d.ts.map +1 -0
- package/dist/agents/opportunity.presenter.js +524 -0
- package/dist/agents/opportunity.presenter.js.map +1 -0
- package/dist/agents/profile.generator.d.ts +67 -0
- package/dist/agents/profile.generator.d.ts.map +1 -0
- package/dist/agents/profile.generator.js +97 -0
- package/dist/agents/profile.generator.js.map +1 -0
- package/dist/agents/profile.hyde.generator.d.ts +43 -0
- package/dist/agents/profile.hyde.generator.d.ts.map +1 -0
- package/dist/agents/profile.hyde.generator.js +113 -0
- package/dist/agents/profile.hyde.generator.js.map +1 -0
- package/dist/agents/suggestion.generator.d.ts +24 -0
- package/dist/agents/suggestion.generator.d.ts.map +1 -0
- package/dist/agents/suggestion.generator.js +96 -0
- package/dist/agents/suggestion.generator.js.map +1 -0
- package/dist/graphs/chat.graph.d.ts +312 -0
- package/dist/graphs/chat.graph.d.ts.map +1 -0
- package/dist/graphs/chat.graph.js +267 -0
- package/dist/graphs/chat.graph.js.map +1 -0
- package/dist/graphs/home.graph.d.ts +180 -0
- package/dist/graphs/home.graph.d.ts.map +1 -0
- package/dist/graphs/home.graph.js +598 -0
- package/dist/graphs/home.graph.js.map +1 -0
- package/dist/graphs/hyde.graph.d.ts +110 -0
- package/dist/graphs/hyde.graph.d.ts.map +1 -0
- package/dist/graphs/hyde.graph.js +235 -0
- package/dist/graphs/hyde.graph.js.map +1 -0
- package/dist/graphs/index.graph.d.ts +620 -0
- package/dist/graphs/index.graph.d.ts.map +1 -0
- package/dist/graphs/index.graph.js +226 -0
- package/dist/graphs/index.graph.js.map +1 -0
- package/dist/graphs/index_membership.graph.d.ts +250 -0
- package/dist/graphs/index_membership.graph.d.ts.map +1 -0
- package/dist/graphs/index_membership.graph.js +204 -0
- package/dist/graphs/index_membership.graph.js.map +1 -0
- package/dist/graphs/intent.graph.d.ts +490 -0
- package/dist/graphs/intent.graph.d.ts.map +1 -0
- package/dist/graphs/intent.graph.js +787 -0
- package/dist/graphs/intent.graph.js.map +1 -0
- package/dist/graphs/intent_index.graph.d.ts +396 -0
- package/dist/graphs/intent_index.graph.d.ts.map +1 -0
- package/dist/graphs/intent_index.graph.js +331 -0
- package/dist/graphs/intent_index.graph.js.map +1 -0
- package/dist/graphs/maintenance.graph.d.ts +177 -0
- package/dist/graphs/maintenance.graph.d.ts.map +1 -0
- package/dist/graphs/maintenance.graph.js +173 -0
- package/dist/graphs/maintenance.graph.js.map +1 -0
- package/dist/graphs/negotiation.graph.d.ts +819 -0
- package/dist/graphs/negotiation.graph.d.ts.map +1 -0
- package/dist/graphs/negotiation.graph.js +255 -0
- package/dist/graphs/negotiation.graph.js.map +1 -0
- package/dist/graphs/opportunity.graph.d.ts +1082 -0
- package/dist/graphs/opportunity.graph.d.ts.map +1 -0
- package/dist/graphs/opportunity.graph.js +2534 -0
- package/dist/graphs/opportunity.graph.js.map +1 -0
- package/dist/graphs/profile.graph.d.ts +617 -0
- package/dist/graphs/profile.graph.d.ts.map +1 -0
- package/dist/graphs/profile.graph.js +839 -0
- package/dist/graphs/profile.graph.js.map +1 -0
- package/dist/graphs/tests/chat.graph.mocks.d.ts +104 -0
- package/dist/graphs/tests/chat.graph.mocks.d.ts.map +1 -0
- package/dist/graphs/tests/chat.graph.mocks.js +225 -0
- package/dist/graphs/tests/chat.graph.mocks.js.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/auth.interface.d.ts +15 -0
- package/dist/interfaces/auth.interface.d.ts.map +1 -0
- package/dist/interfaces/auth.interface.js +2 -0
- package/dist/interfaces/auth.interface.js.map +1 -0
- package/dist/interfaces/cache.interface.d.ts +43 -0
- package/dist/interfaces/cache.interface.d.ts.map +1 -0
- package/dist/interfaces/cache.interface.js +6 -0
- package/dist/interfaces/cache.interface.js.map +1 -0
- package/dist/interfaces/chat-session.interface.d.ts +11 -0
- package/dist/interfaces/chat-session.interface.d.ts.map +1 -0
- package/dist/interfaces/chat-session.interface.js +2 -0
- package/dist/interfaces/chat-session.interface.js.map +1 -0
- package/dist/interfaces/contact.interface.d.ts +48 -0
- package/dist/interfaces/contact.interface.d.ts.map +1 -0
- package/dist/interfaces/contact.interface.js +2 -0
- package/dist/interfaces/contact.interface.js.map +1 -0
- package/dist/interfaces/database.interface.d.ts +1495 -0
- package/dist/interfaces/database.interface.d.ts.map +1 -0
- package/dist/interfaces/database.interface.js +2 -0
- package/dist/interfaces/database.interface.js.map +1 -0
- package/dist/interfaces/embedder.interface.d.ts +85 -0
- package/dist/interfaces/embedder.interface.d.ts.map +1 -0
- package/dist/interfaces/embedder.interface.js +5 -0
- package/dist/interfaces/embedder.interface.js.map +1 -0
- package/dist/interfaces/enrichment.interface.d.ts +40 -0
- package/dist/interfaces/enrichment.interface.d.ts.map +1 -0
- package/dist/interfaces/enrichment.interface.js +2 -0
- package/dist/interfaces/enrichment.interface.js.map +1 -0
- package/dist/interfaces/integration.interface.d.ts +91 -0
- package/dist/interfaces/integration.interface.d.ts.map +1 -0
- package/dist/interfaces/integration.interface.js +2 -0
- package/dist/interfaces/integration.interface.js.map +1 -0
- package/dist/interfaces/queue.interface.d.ts +17 -0
- package/dist/interfaces/queue.interface.d.ts.map +1 -0
- package/dist/interfaces/queue.interface.js +5 -0
- package/dist/interfaces/queue.interface.js.map +1 -0
- package/dist/interfaces/scraper.interface.d.ts +31 -0
- package/dist/interfaces/scraper.interface.d.ts.map +1 -0
- package/dist/interfaces/scraper.interface.js +2 -0
- package/dist/interfaces/scraper.interface.js.map +1 -0
- package/dist/interfaces/storage.interface.d.ts +46 -0
- package/dist/interfaces/storage.interface.d.ts.map +1 -0
- package/dist/interfaces/storage.interface.js +6 -0
- package/dist/interfaces/storage.interface.js.map +1 -0
- package/dist/mcp/mcp.server.d.ts +29 -0
- package/dist/mcp/mcp.server.d.ts.map +1 -0
- package/dist/mcp/mcp.server.js +171 -0
- package/dist/mcp/mcp.server.js.map +1 -0
- package/dist/states/chat.state.d.ts +126 -0
- package/dist/states/chat.state.d.ts.map +1 -0
- package/dist/states/chat.state.js +112 -0
- package/dist/states/chat.state.js.map +1 -0
- package/dist/states/home.state.d.ts +100 -0
- package/dist/states/home.state.d.ts.map +1 -0
- package/dist/states/home.state.js +74 -0
- package/dist/states/home.state.js.map +1 -0
- package/dist/states/hyde.state.d.ts +54 -0
- package/dist/states/hyde.state.d.ts.map +1 -0
- package/dist/states/hyde.state.js +66 -0
- package/dist/states/hyde.state.js.map +1 -0
- package/dist/states/index.state.d.ts +179 -0
- package/dist/states/index.state.d.ts.map +1 -0
- package/dist/states/index.state.js +56 -0
- package/dist/states/index.state.js.map +1 -0
- package/dist/states/index_membership.state.d.ts +77 -0
- package/dist/states/index_membership.state.d.ts.map +1 -0
- package/dist/states/index_membership.state.js +43 -0
- package/dist/states/index_membership.state.js.map +1 -0
- package/dist/states/intent.state.d.ts +203 -0
- package/dist/states/intent.state.d.ts.map +1 -0
- package/dist/states/intent.state.js +153 -0
- package/dist/states/intent.state.js.map +1 -0
- package/dist/states/intent_index.state.d.ts +148 -0
- package/dist/states/intent_index.state.d.ts.map +1 -0
- package/dist/states/intent_index.state.js +100 -0
- package/dist/states/intent_index.state.js.map +1 -0
- package/dist/states/maintenance.state.d.ts +36 -0
- package/dist/states/maintenance.state.d.ts.map +1 -0
- package/dist/states/maintenance.state.js +56 -0
- package/dist/states/maintenance.state.js.map +1 -0
- package/dist/states/negotiation.state.d.ts +230 -0
- package/dist/states/negotiation.state.d.ts.map +1 -0
- package/dist/states/negotiation.state.js +82 -0
- package/dist/states/negotiation.state.js.map +1 -0
- package/dist/states/opportunity.state.d.ts +300 -0
- package/dist/states/opportunity.state.d.ts.map +1 -0
- package/dist/states/opportunity.state.js +207 -0
- package/dist/states/opportunity.state.js.map +1 -0
- package/dist/states/profile.state.d.ts +172 -0
- package/dist/states/profile.state.d.ts.map +1 -0
- package/dist/states/profile.state.js +133 -0
- package/dist/states/profile.state.js.map +1 -0
- package/dist/streamers/chat.streamer.d.ts +55 -0
- package/dist/streamers/chat.streamer.d.ts.map +1 -0
- package/dist/streamers/chat.streamer.js +186 -0
- package/dist/streamers/chat.streamer.js.map +1 -0
- package/dist/streamers/index.d.ts +3 -0
- package/dist/streamers/index.d.ts.map +1 -0
- package/dist/streamers/index.js +3 -0
- package/dist/streamers/index.js.map +1 -0
- package/dist/streamers/response.streamer.d.ts +36 -0
- package/dist/streamers/response.streamer.d.ts.map +1 -0
- package/dist/streamers/response.streamer.js +46 -0
- package/dist/streamers/response.streamer.js.map +1 -0
- package/dist/support/chat.utils.d.ts +42 -0
- package/dist/support/chat.utils.d.ts.map +1 -0
- package/dist/support/chat.utils.js +89 -0
- package/dist/support/chat.utils.js.map +1 -0
- package/dist/support/debug-meta.sanitizer.d.ts +18 -0
- package/dist/support/debug-meta.sanitizer.d.ts.map +1 -0
- package/dist/support/debug-meta.sanitizer.js +82 -0
- package/dist/support/debug-meta.sanitizer.js.map +1 -0
- package/dist/support/feed.health.d.ts +32 -0
- package/dist/support/feed.health.d.ts.map +1 -0
- package/dist/support/feed.health.js +76 -0
- package/dist/support/feed.health.js.map +1 -0
- package/dist/support/introducer.discovery.d.ts +78 -0
- package/dist/support/introducer.discovery.d.ts.map +1 -0
- package/dist/support/introducer.discovery.js +101 -0
- package/dist/support/introducer.discovery.js.map +1 -0
- package/dist/support/log.d.ts +65 -0
- package/dist/support/log.d.ts.map +1 -0
- package/dist/support/log.js +76 -0
- package/dist/support/log.js.map +1 -0
- package/dist/support/lucide.icon-catalog.d.ts +22 -0
- package/dist/support/lucide.icon-catalog.d.ts.map +1 -0
- package/dist/support/lucide.icon-catalog.js +101 -0
- package/dist/support/lucide.icon-catalog.js.map +1 -0
- package/dist/support/opportunity.card-text.d.ts +39 -0
- package/dist/support/opportunity.card-text.d.ts.map +1 -0
- package/dist/support/opportunity.card-text.js +333 -0
- package/dist/support/opportunity.card-text.js.map +1 -0
- package/dist/support/opportunity.constants.d.ts +9 -0
- package/dist/support/opportunity.constants.d.ts.map +1 -0
- package/dist/support/opportunity.constants.js +11 -0
- package/dist/support/opportunity.constants.js.map +1 -0
- package/dist/support/opportunity.discover.d.ts +144 -0
- package/dist/support/opportunity.discover.d.ts.map +1 -0
- package/dist/support/opportunity.discover.js +610 -0
- package/dist/support/opportunity.discover.js.map +1 -0
- package/dist/support/opportunity.enricher.d.ts +44 -0
- package/dist/support/opportunity.enricher.d.ts.map +1 -0
- package/dist/support/opportunity.enricher.js +245 -0
- package/dist/support/opportunity.enricher.js.map +1 -0
- package/dist/support/opportunity.persist.d.ts +39 -0
- package/dist/support/opportunity.persist.d.ts.map +1 -0
- package/dist/support/opportunity.persist.js +63 -0
- package/dist/support/opportunity.persist.js.map +1 -0
- package/dist/support/opportunity.presentation.d.ts +21 -0
- package/dist/support/opportunity.presentation.d.ts.map +1 -0
- package/dist/support/opportunity.presentation.js +75 -0
- package/dist/support/opportunity.presentation.js.map +1 -0
- package/dist/support/opportunity.sanitize.d.ts +18 -0
- package/dist/support/opportunity.sanitize.d.ts.map +1 -0
- package/dist/support/opportunity.sanitize.js +89 -0
- package/dist/support/opportunity.sanitize.js.map +1 -0
- package/dist/support/opportunity.utils.d.ts +99 -0
- package/dist/support/opportunity.utils.d.ts.map +1 -0
- package/dist/support/opportunity.utils.js +184 -0
- package/dist/support/opportunity.utils.js.map +1 -0
- package/dist/support/performance.d.ts +19 -0
- package/dist/support/performance.d.ts.map +1 -0
- package/dist/support/performance.js +43 -0
- package/dist/support/performance.js.map +1 -0
- package/dist/support/profile.enrichment-display-name.d.ts +16 -0
- package/dist/support/profile.enrichment-display-name.d.ts.map +1 -0
- package/dist/support/profile.enrichment-display-name.js +22 -0
- package/dist/support/profile.enrichment-display-name.js.map +1 -0
- package/dist/support/protocol.logger.d.ts +22 -0
- package/dist/support/protocol.logger.d.ts.map +1 -0
- package/dist/support/protocol.logger.js +44 -0
- package/dist/support/protocol.logger.js.map +1 -0
- package/dist/support/request-context.d.ts +19 -0
- package/dist/support/request-context.d.ts.map +1 -0
- package/dist/support/request-context.js +7 -0
- package/dist/support/request-context.js.map +1 -0
- package/dist/tools/contact.tools.d.ts +7 -0
- package/dist/tools/contact.tools.d.ts.map +1 -0
- package/dist/tools/contact.tools.js +115 -0
- package/dist/tools/contact.tools.js.map +1 -0
- package/dist/tools/index.d.ts +17 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +140 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/index.tools.d.ts +3 -0
- package/dist/tools/index.tools.d.ts.map +1 -0
- package/dist/tools/index.tools.js +423 -0
- package/dist/tools/index.tools.js.map +1 -0
- package/dist/tools/integration.tools.d.ts +13 -0
- package/dist/tools/integration.tools.d.ts.map +1 -0
- package/dist/tools/integration.tools.js +77 -0
- package/dist/tools/integration.tools.js.map +1 -0
- package/dist/tools/intent.tools.d.ts +3 -0
- package/dist/tools/intent.tools.d.ts.map +1 -0
- package/dist/tools/intent.tools.js +458 -0
- package/dist/tools/intent.tools.js.map +1 -0
- package/dist/tools/opportunity.tools.d.ts +44 -0
- package/dist/tools/opportunity.tools.d.ts.map +1 -0
- package/dist/tools/opportunity.tools.js +814 -0
- package/dist/tools/opportunity.tools.js.map +1 -0
- package/dist/tools/profile.tools.d.ts +3 -0
- package/dist/tools/profile.tools.d.ts.map +1 -0
- package/dist/tools/profile.tools.js +513 -0
- package/dist/tools/profile.tools.js.map +1 -0
- package/dist/tools/tool.helpers.d.ts +225 -0
- package/dist/tools/tool.helpers.d.ts.map +1 -0
- package/dist/tools/tool.helpers.js +172 -0
- package/dist/tools/tool.helpers.js.map +1 -0
- package/dist/tools/tool.registry.d.ts +12 -0
- package/dist/tools/tool.registry.d.ts.map +1 -0
- package/dist/tools/tool.registry.js +62 -0
- package/dist/tools/tool.registry.js.map +1 -0
- package/dist/tools/utility.tools.d.ts +3 -0
- package/dist/tools/utility.tools.d.ts.map +1 -0
- package/dist/tools/utility.tools.js +107 -0
- package/dist/tools/utility.tools.js.map +1 -0
- package/dist/types/chat-streaming.types.d.ts +472 -0
- package/dist/types/chat-streaming.types.d.ts.map +1 -0
- package/dist/types/chat-streaming.types.js +260 -0
- package/dist/types/chat-streaming.types.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Opportunity } from '../interfaces/database.interface.js';
|
|
2
|
+
import type { FeedHealthResult } from '../support/feed.health.js';
|
|
3
|
+
/**
|
|
4
|
+
* Maintenance Graph State (Annotation-based).
|
|
5
|
+
* Flow: loadCurrentFeed → scoreFeedHealth → [conditional: rediscover | END] → logMaintenance → END
|
|
6
|
+
*/
|
|
7
|
+
export declare const MaintenanceGraphState: import("@langchain/langgraph").AnnotationRoot<{
|
|
8
|
+
userId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
9
|
+
/** Active intents for the user (used for rediscovery). */
|
|
10
|
+
activeIntents: import("@langchain/langgraph").BaseChannel<{
|
|
11
|
+
id: string;
|
|
12
|
+
payload: string;
|
|
13
|
+
}[], {
|
|
14
|
+
id: string;
|
|
15
|
+
payload: string;
|
|
16
|
+
}[] | import("@langchain/langgraph").OverwriteValue<{
|
|
17
|
+
id: string;
|
|
18
|
+
payload: string;
|
|
19
|
+
}[]>, unknown>;
|
|
20
|
+
/** Current actionable opportunities for the user. */
|
|
21
|
+
currentOpportunities: import("@langchain/langgraph").BaseChannel<Opportunity[], Opportunity[] | import("@langchain/langgraph").OverwriteValue<Opportunity[]>, unknown>;
|
|
22
|
+
/** Current expired opportunities count. */
|
|
23
|
+
expiredCount: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
24
|
+
/** Unix ms timestamp of last rediscovery for this user. */
|
|
25
|
+
lastRediscoveryAt: import("@langchain/langgraph").BaseChannel<number | null, number | import("@langchain/langgraph").OverwriteValue<number | null> | null, unknown>;
|
|
26
|
+
/** Feed health score result. */
|
|
27
|
+
healthResult: import("@langchain/langgraph").BaseChannel<FeedHealthResult | null, FeedHealthResult | import("@langchain/langgraph").OverwriteValue<FeedHealthResult | null> | null, unknown>;
|
|
28
|
+
/** Number of rediscovery jobs enqueued. */
|
|
29
|
+
rediscoveryJobsEnqueued: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
30
|
+
/** Current connector-flow opportunity count (from scoreFeedHealth). */
|
|
31
|
+
connectorFlowCount: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
32
|
+
/** Number of introducer discovery jobs enqueued. */
|
|
33
|
+
introducerDiscoveryJobsEnqueued: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
34
|
+
error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=maintenance.state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance.state.d.ts","sourceRoot":"","sources":["../../src/states/maintenance.state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;IAMhC,0DAA0D;;YACpB,MAAM;iBAAW,MAAM;;YAAvB,MAAM;iBAAW,MAAM;;YAAvB,MAAM;iBAAW,MAAM;;IAK7D,qDAAqD;;IAMrD,2CAA2C;;IAM3C,2DAA2D;;IAM3D,gCAAgC;;IAMhC,2CAA2C;;IAM3C,uEAAuE;;IAMvE,oDAAoD;;;EAUpD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Annotation } from '@langchain/langgraph';
|
|
2
|
+
/**
|
|
3
|
+
* Maintenance Graph State (Annotation-based).
|
|
4
|
+
* Flow: loadCurrentFeed → scoreFeedHealth → [conditional: rediscover | END] → logMaintenance → END
|
|
5
|
+
*/
|
|
6
|
+
export const MaintenanceGraphState = Annotation.Root({
|
|
7
|
+
userId: Annotation({
|
|
8
|
+
reducer: (curr, next) => next ?? curr,
|
|
9
|
+
default: () => '',
|
|
10
|
+
}),
|
|
11
|
+
/** Active intents for the user (used for rediscovery). */
|
|
12
|
+
activeIntents: Annotation({
|
|
13
|
+
reducer: (curr, next) => next ?? curr,
|
|
14
|
+
default: () => [],
|
|
15
|
+
}),
|
|
16
|
+
/** Current actionable opportunities for the user. */
|
|
17
|
+
currentOpportunities: Annotation({
|
|
18
|
+
reducer: (curr, next) => next ?? curr,
|
|
19
|
+
default: () => [],
|
|
20
|
+
}),
|
|
21
|
+
/** Current expired opportunities count. */
|
|
22
|
+
expiredCount: Annotation({
|
|
23
|
+
reducer: (curr, next) => next ?? curr,
|
|
24
|
+
default: () => 0,
|
|
25
|
+
}),
|
|
26
|
+
/** Unix ms timestamp of last rediscovery for this user. */
|
|
27
|
+
lastRediscoveryAt: Annotation({
|
|
28
|
+
reducer: (curr, next) => next ?? curr,
|
|
29
|
+
default: () => null,
|
|
30
|
+
}),
|
|
31
|
+
/** Feed health score result. */
|
|
32
|
+
healthResult: Annotation({
|
|
33
|
+
reducer: (curr, next) => next ?? curr,
|
|
34
|
+
default: () => null,
|
|
35
|
+
}),
|
|
36
|
+
/** Number of rediscovery jobs enqueued. */
|
|
37
|
+
rediscoveryJobsEnqueued: Annotation({
|
|
38
|
+
reducer: (curr, next) => next ?? curr,
|
|
39
|
+
default: () => 0,
|
|
40
|
+
}),
|
|
41
|
+
/** Current connector-flow opportunity count (from scoreFeedHealth). */
|
|
42
|
+
connectorFlowCount: Annotation({
|
|
43
|
+
reducer: (curr, next) => next ?? curr,
|
|
44
|
+
default: () => 0,
|
|
45
|
+
}),
|
|
46
|
+
/** Number of introducer discovery jobs enqueued. */
|
|
47
|
+
introducerDiscoveryJobsEnqueued: Annotation({
|
|
48
|
+
reducer: (curr, next) => next ?? curr,
|
|
49
|
+
default: () => 0,
|
|
50
|
+
}),
|
|
51
|
+
error: Annotation({
|
|
52
|
+
reducer: (curr, next) => next ?? curr,
|
|
53
|
+
default: () => undefined,
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=maintenance.state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance.state.js","sourceRoot":"","sources":["../../src/states/maintenance.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC,IAAI,CAAC;IACnD,MAAM,EAAE,UAAU,CAAS;QACzB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC;IAEF,0DAA0D;IAC1D,aAAa,EAAE,UAAU,CAAyC;QAChE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC;IAEF,qDAAqD;IACrD,oBAAoB,EAAE,UAAU,CAAgB;QAC9C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC;IAEF,2CAA2C;IAC3C,YAAY,EAAE,UAAU,CAAS;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,2DAA2D;IAC3D,iBAAiB,EAAE,UAAU,CAAgB;QAC3C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;IAEF,gCAAgC;IAChC,YAAY,EAAE,UAAU,CAA0B;QAChD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;IAEF,2CAA2C;IAC3C,uBAAuB,EAAE,UAAU,CAAS;QAC1C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,uEAAuE;IACvE,kBAAkB,EAAE,UAAU,CAAS;QACrC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,oDAAoD;IACpD,+BAA+B,EAAE,UAAU,CAAS;QAClD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,KAAK,EAAE,UAAU,CAAqB;QACpC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Zod schema for a single negotiation turn (DataPart payload in A2A message). */
|
|
3
|
+
export declare const NegotiationTurnSchema: z.ZodObject<{
|
|
4
|
+
action: z.ZodEnum<["propose", "accept", "reject", "counter"]>;
|
|
5
|
+
assessment: z.ZodObject<{
|
|
6
|
+
fitScore: z.ZodNumber;
|
|
7
|
+
reasoning: z.ZodString;
|
|
8
|
+
suggestedRoles: z.ZodObject<{
|
|
9
|
+
ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
10
|
+
otherUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
ownUser: "agent" | "patient" | "peer";
|
|
13
|
+
otherUser: "agent" | "patient" | "peer";
|
|
14
|
+
}, {
|
|
15
|
+
ownUser: "agent" | "patient" | "peer";
|
|
16
|
+
otherUser: "agent" | "patient" | "peer";
|
|
17
|
+
}>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
reasoning: string;
|
|
20
|
+
fitScore: number;
|
|
21
|
+
suggestedRoles: {
|
|
22
|
+
ownUser: "agent" | "patient" | "peer";
|
|
23
|
+
otherUser: "agent" | "patient" | "peer";
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
reasoning: string;
|
|
27
|
+
fitScore: number;
|
|
28
|
+
suggestedRoles: {
|
|
29
|
+
ownUser: "agent" | "patient" | "peer";
|
|
30
|
+
otherUser: "agent" | "patient" | "peer";
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
action: "propose" | "accept" | "reject" | "counter";
|
|
35
|
+
assessment: {
|
|
36
|
+
reasoning: string;
|
|
37
|
+
fitScore: number;
|
|
38
|
+
suggestedRoles: {
|
|
39
|
+
ownUser: "agent" | "patient" | "peer";
|
|
40
|
+
otherUser: "agent" | "patient" | "peer";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
action: "propose" | "accept" | "reject" | "counter";
|
|
45
|
+
assessment: {
|
|
46
|
+
reasoning: string;
|
|
47
|
+
fitScore: number;
|
|
48
|
+
suggestedRoles: {
|
|
49
|
+
ownUser: "agent" | "patient" | "peer";
|
|
50
|
+
otherUser: "agent" | "patient" | "peer";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
export type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;
|
|
55
|
+
/** Zod schema for the negotiation outcome (Artifact payload on COMPLETED task). */
|
|
56
|
+
export declare const NegotiationOutcomeSchema: z.ZodObject<{
|
|
57
|
+
hasOpportunity: z.ZodBoolean;
|
|
58
|
+
finalScore: z.ZodNumber;
|
|
59
|
+
agreedRoles: z.ZodArray<z.ZodObject<{
|
|
60
|
+
userId: z.ZodString;
|
|
61
|
+
role: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
userId: string;
|
|
64
|
+
role: "agent" | "patient" | "peer";
|
|
65
|
+
}, {
|
|
66
|
+
userId: string;
|
|
67
|
+
role: "agent" | "patient" | "peer";
|
|
68
|
+
}>, "many">;
|
|
69
|
+
reasoning: z.ZodString;
|
|
70
|
+
turnCount: z.ZodNumber;
|
|
71
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
reasoning: string;
|
|
74
|
+
hasOpportunity: boolean;
|
|
75
|
+
finalScore: number;
|
|
76
|
+
agreedRoles: {
|
|
77
|
+
userId: string;
|
|
78
|
+
role: "agent" | "patient" | "peer";
|
|
79
|
+
}[];
|
|
80
|
+
turnCount: number;
|
|
81
|
+
reason?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
reasoning: string;
|
|
84
|
+
hasOpportunity: boolean;
|
|
85
|
+
finalScore: number;
|
|
86
|
+
agreedRoles: {
|
|
87
|
+
userId: string;
|
|
88
|
+
role: "agent" | "patient" | "peer";
|
|
89
|
+
}[];
|
|
90
|
+
turnCount: number;
|
|
91
|
+
reason?: string | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;
|
|
94
|
+
/** Context each agent receives about its user. */
|
|
95
|
+
export interface UserNegotiationContext {
|
|
96
|
+
id: string;
|
|
97
|
+
intents: Array<{
|
|
98
|
+
id: string;
|
|
99
|
+
title: string;
|
|
100
|
+
description: string;
|
|
101
|
+
confidence: number;
|
|
102
|
+
}>;
|
|
103
|
+
profile: {
|
|
104
|
+
name?: string;
|
|
105
|
+
bio?: string;
|
|
106
|
+
location?: string;
|
|
107
|
+
interests?: string[];
|
|
108
|
+
skills?: string[];
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Seed assessment from the evaluator pre-filter. */
|
|
112
|
+
export interface SeedAssessment {
|
|
113
|
+
score: number;
|
|
114
|
+
reasoning: string;
|
|
115
|
+
valencyRole: string;
|
|
116
|
+
actors?: Array<{
|
|
117
|
+
userId: string;
|
|
118
|
+
role: string;
|
|
119
|
+
}>;
|
|
120
|
+
}
|
|
121
|
+
/** Typed interface for a negotiation graph's invoke signature. */
|
|
122
|
+
export interface NegotiationGraphLike {
|
|
123
|
+
invoke(input: {
|
|
124
|
+
sourceUser: UserNegotiationContext;
|
|
125
|
+
candidateUser: UserNegotiationContext;
|
|
126
|
+
indexContext: {
|
|
127
|
+
indexId: string;
|
|
128
|
+
prompt: string;
|
|
129
|
+
};
|
|
130
|
+
seedAssessment: Omit<SeedAssessment, "actors">;
|
|
131
|
+
maxTurns?: number;
|
|
132
|
+
}): Promise<{
|
|
133
|
+
outcome: NegotiationOutcome | null;
|
|
134
|
+
messages?: NegotiationMessage[];
|
|
135
|
+
}>;
|
|
136
|
+
}
|
|
137
|
+
/** A2A message record shape (matches messages table). */
|
|
138
|
+
export interface NegotiationMessage {
|
|
139
|
+
id: string;
|
|
140
|
+
senderId: string;
|
|
141
|
+
role: "agent";
|
|
142
|
+
parts: unknown[];
|
|
143
|
+
createdAt: Date;
|
|
144
|
+
}
|
|
145
|
+
/** LangGraph state annotation for the negotiation graph. */
|
|
146
|
+
export declare const NegotiationGraphState: import("@langchain/langgraph").AnnotationRoot<{
|
|
147
|
+
sourceUser: import("@langchain/langgraph").BaseChannel<UserNegotiationContext, UserNegotiationContext | import("@langchain/langgraph").OverwriteValue<UserNegotiationContext>, unknown>;
|
|
148
|
+
candidateUser: import("@langchain/langgraph").BaseChannel<UserNegotiationContext, UserNegotiationContext | import("@langchain/langgraph").OverwriteValue<UserNegotiationContext>, unknown>;
|
|
149
|
+
indexContext: import("@langchain/langgraph").BaseChannel<{
|
|
150
|
+
indexId: string;
|
|
151
|
+
prompt: string;
|
|
152
|
+
}, {
|
|
153
|
+
indexId: string;
|
|
154
|
+
prompt: string;
|
|
155
|
+
} | import("@langchain/langgraph").OverwriteValue<{
|
|
156
|
+
indexId: string;
|
|
157
|
+
prompt: string;
|
|
158
|
+
}>, unknown>;
|
|
159
|
+
seedAssessment: import("@langchain/langgraph").BaseChannel<SeedAssessment, SeedAssessment | import("@langchain/langgraph").OverwriteValue<SeedAssessment>, unknown>;
|
|
160
|
+
conversationId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
161
|
+
taskId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
162
|
+
messages: import("@langchain/langgraph").BaseChannel<NegotiationMessage[], NegotiationMessage[] | import("@langchain/langgraph").OverwriteValue<NegotiationMessage[]>, unknown>;
|
|
163
|
+
turnCount: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
164
|
+
maxTurns: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
|
|
165
|
+
currentSpeaker: import("@langchain/langgraph").BaseChannel<"source" | "candidate", "source" | "candidate" | import("@langchain/langgraph").OverwriteValue<"source" | "candidate">, unknown>;
|
|
166
|
+
lastTurn: import("@langchain/langgraph").BaseChannel<{
|
|
167
|
+
action: "propose" | "accept" | "reject" | "counter";
|
|
168
|
+
assessment: {
|
|
169
|
+
reasoning: string;
|
|
170
|
+
fitScore: number;
|
|
171
|
+
suggestedRoles: {
|
|
172
|
+
ownUser: "agent" | "patient" | "peer";
|
|
173
|
+
otherUser: "agent" | "patient" | "peer";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
} | null, {
|
|
177
|
+
action: "propose" | "accept" | "reject" | "counter";
|
|
178
|
+
assessment: {
|
|
179
|
+
reasoning: string;
|
|
180
|
+
fitScore: number;
|
|
181
|
+
suggestedRoles: {
|
|
182
|
+
ownUser: "agent" | "patient" | "peer";
|
|
183
|
+
otherUser: "agent" | "patient" | "peer";
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
} | import("@langchain/langgraph").OverwriteValue<{
|
|
187
|
+
action: "propose" | "accept" | "reject" | "counter";
|
|
188
|
+
assessment: {
|
|
189
|
+
reasoning: string;
|
|
190
|
+
fitScore: number;
|
|
191
|
+
suggestedRoles: {
|
|
192
|
+
ownUser: "agent" | "patient" | "peer";
|
|
193
|
+
otherUser: "agent" | "patient" | "peer";
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
} | null> | null, unknown>;
|
|
197
|
+
outcome: import("@langchain/langgraph").BaseChannel<{
|
|
198
|
+
reasoning: string;
|
|
199
|
+
hasOpportunity: boolean;
|
|
200
|
+
finalScore: number;
|
|
201
|
+
agreedRoles: {
|
|
202
|
+
userId: string;
|
|
203
|
+
role: "agent" | "patient" | "peer";
|
|
204
|
+
}[];
|
|
205
|
+
turnCount: number;
|
|
206
|
+
reason?: string | undefined;
|
|
207
|
+
} | null, {
|
|
208
|
+
reasoning: string;
|
|
209
|
+
hasOpportunity: boolean;
|
|
210
|
+
finalScore: number;
|
|
211
|
+
agreedRoles: {
|
|
212
|
+
userId: string;
|
|
213
|
+
role: "agent" | "patient" | "peer";
|
|
214
|
+
}[];
|
|
215
|
+
turnCount: number;
|
|
216
|
+
reason?: string | undefined;
|
|
217
|
+
} | import("@langchain/langgraph").OverwriteValue<{
|
|
218
|
+
reasoning: string;
|
|
219
|
+
hasOpportunity: boolean;
|
|
220
|
+
finalScore: number;
|
|
221
|
+
agreedRoles: {
|
|
222
|
+
userId: string;
|
|
223
|
+
role: "agent" | "patient" | "peer";
|
|
224
|
+
}[];
|
|
225
|
+
turnCount: number;
|
|
226
|
+
reason?: string | undefined;
|
|
227
|
+
} | null> | null, unknown>;
|
|
228
|
+
error: import("@langchain/langgraph").BaseChannel<string | null, string | import("@langchain/langgraph").OverwriteValue<string | null> | null, unknown>;
|
|
229
|
+
}>;
|
|
230
|
+
//# sourceMappingURL=negotiation.state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negotiation.state.d.ts","sourceRoot":"","sources":["../../src/states/negotiation.state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,mFAAmF;AACnF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvF,OAAO,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AAtB,MAAM;gBAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+C1D,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Annotation } from "@langchain/langgraph";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** Zod schema for a single negotiation turn (DataPart payload in A2A message). */
|
|
4
|
+
export const NegotiationTurnSchema = z.object({
|
|
5
|
+
action: z.enum(["propose", "accept", "reject", "counter"]),
|
|
6
|
+
assessment: z.object({
|
|
7
|
+
fitScore: z.number().min(0).max(100),
|
|
8
|
+
reasoning: z.string(),
|
|
9
|
+
suggestedRoles: z.object({
|
|
10
|
+
ownUser: z.enum(["agent", "patient", "peer"]),
|
|
11
|
+
otherUser: z.enum(["agent", "patient", "peer"]),
|
|
12
|
+
}),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
/** Zod schema for the negotiation outcome (Artifact payload on COMPLETED task). */
|
|
16
|
+
export const NegotiationOutcomeSchema = z.object({
|
|
17
|
+
hasOpportunity: z.boolean(),
|
|
18
|
+
finalScore: z.number().min(0).max(100),
|
|
19
|
+
agreedRoles: z.array(z.object({
|
|
20
|
+
userId: z.string(),
|
|
21
|
+
role: z.enum(["agent", "patient", "peer"]),
|
|
22
|
+
})),
|
|
23
|
+
reasoning: z.string(),
|
|
24
|
+
turnCount: z.number(),
|
|
25
|
+
reason: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
/** LangGraph state annotation for the negotiation graph. */
|
|
28
|
+
export const NegotiationGraphState = Annotation.Root({
|
|
29
|
+
sourceUser: Annotation({
|
|
30
|
+
reducer: (curr, next) => next ?? curr,
|
|
31
|
+
default: () => ({ id: "", intents: [], profile: {} }),
|
|
32
|
+
}),
|
|
33
|
+
candidateUser: Annotation({
|
|
34
|
+
reducer: (curr, next) => next ?? curr,
|
|
35
|
+
default: () => ({ id: "", intents: [], profile: {} }),
|
|
36
|
+
}),
|
|
37
|
+
indexContext: Annotation({
|
|
38
|
+
reducer: (curr, next) => next ?? curr,
|
|
39
|
+
default: () => ({ indexId: "", prompt: "" }),
|
|
40
|
+
}),
|
|
41
|
+
seedAssessment: Annotation({
|
|
42
|
+
reducer: (curr, next) => next ?? curr,
|
|
43
|
+
default: () => ({ score: 0, reasoning: "", valencyRole: "" }),
|
|
44
|
+
}),
|
|
45
|
+
conversationId: Annotation({
|
|
46
|
+
reducer: (curr, next) => next ?? curr,
|
|
47
|
+
default: () => "",
|
|
48
|
+
}),
|
|
49
|
+
taskId: Annotation({
|
|
50
|
+
reducer: (curr, next) => next ?? curr,
|
|
51
|
+
default: () => "",
|
|
52
|
+
}),
|
|
53
|
+
messages: Annotation({
|
|
54
|
+
reducer: (curr, next) => [...curr, ...(next || [])],
|
|
55
|
+
default: () => [],
|
|
56
|
+
}),
|
|
57
|
+
turnCount: Annotation({
|
|
58
|
+
reducer: (curr, next) => next ?? curr,
|
|
59
|
+
default: () => 0,
|
|
60
|
+
}),
|
|
61
|
+
maxTurns: Annotation({
|
|
62
|
+
reducer: (curr, next) => next ?? curr,
|
|
63
|
+
default: () => 6,
|
|
64
|
+
}),
|
|
65
|
+
currentSpeaker: Annotation({
|
|
66
|
+
reducer: (curr, next) => next ?? curr,
|
|
67
|
+
default: () => "source",
|
|
68
|
+
}),
|
|
69
|
+
lastTurn: Annotation({
|
|
70
|
+
reducer: (curr, next) => next ?? curr,
|
|
71
|
+
default: () => null,
|
|
72
|
+
}),
|
|
73
|
+
outcome: Annotation({
|
|
74
|
+
reducer: (curr, next) => next ?? curr,
|
|
75
|
+
default: () => null,
|
|
76
|
+
}),
|
|
77
|
+
error: Annotation({
|
|
78
|
+
reducer: (curr, next) => next ?? curr,
|
|
79
|
+
default: () => null,
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=negotiation.state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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