@indexnetwork/protocol 65.0.0 → 66.0.0-rc.609.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 (26) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/IMPLEMENTATION.md +11 -12
  3. package/STABILITY.md +0 -1
  4. package/dist/index.d.ts +5 -7
  5. package/dist/index.js +3 -6
  6. package/dist/internal/opportunities/opportunity.cards.d.ts +78 -0
  7. package/dist/internal/opportunities/opportunity.cards.js +165 -0
  8. package/dist/internal/opportunities/opportunity.graph.modes.d.ts +0 -1
  9. package/dist/internal/opportunities/opportunity.graph.modes.js +0 -5
  10. package/dist/internal/opportunities/opportunity.labels.d.ts +0 -2
  11. package/dist/internal/opportunities/opportunity.labels.js +0 -2
  12. package/dist/internal/opportunities/opportunity.presentation.d.ts +21 -185
  13. package/dist/internal/opportunities/opportunity.presentation.js +35 -651
  14. package/dist/internal/opportunities/opportunity.utils.d.ts +0 -42
  15. package/dist/internal/opportunities/opportunity.utils.js +0 -102
  16. package/dist/platform/database/capabilities.d.ts +2 -2
  17. package/dist/platform/database/entities.d.ts +1 -1
  18. package/package.json +1 -1
  19. package/dist/internal/opportunities/opportunity.feed-selection.d.ts +0 -24
  20. package/dist/internal/opportunities/opportunity.feed-selection.js +0 -40
  21. package/dist/internal/opportunities/radar/radar.graph.d.ts +0 -230
  22. package/dist/internal/opportunities/radar/radar.graph.js +0 -537
  23. package/dist/internal/opportunities/radar/radar.state.d.ts +0 -88
  24. package/dist/internal/opportunities/radar/radar.state.js +0 -87
  25. package/dist/internal/shared/utils/claim-safety.d.ts +0 -24
  26. package/dist/internal/shared/utils/claim-safety.js +0 -88
@@ -46,11 +46,6 @@ export declare function isActionableForViewer(actors: Array<{
46
46
  }>, status: string, viewerId: string, committedActorIds?: readonly string[]): boolean;
47
47
  /** Feed category for home composition. */
48
48
  export type FeedCategory = 'connection' | 'expired';
49
- /** Soft targets for radar composition. */
50
- export declare const RADAR_SOFT_TARGETS: {
51
- readonly connection: 5;
52
- readonly expired: 2;
53
- };
54
49
  /**
55
50
  * Classify an actionable opportunity into a feed category.
56
51
  * Assumes the opportunity already passed isActionableForViewer or is expired.
@@ -66,40 +61,3 @@ export declare function classifyOpportunity(opp: {
66
61
  }>;
67
62
  status: string;
68
63
  }, _viewerId: string): FeedCategory;
69
- /**
70
- * Select opportunities for the radar using soft composition targets.
71
- * Fills each category up to its target, then redistributes unused slots
72
- * to categories that have more items available. Preserves input order.
73
- *
74
- * @param opportunities - Pre-sorted opportunities (by confidence/recency)
75
- * @param viewerId - The viewing user's ID
76
- * @returns Composition-balanced subset
77
- */
78
- export declare function selectByComposition<T extends {
79
- actors: Array<{
80
- userId: string;
81
- role: string;
82
- }>;
83
- status: string;
84
- }>(opportunities: T[], viewerId: string): T[];
85
- /**
86
- * Deduplicate opportunities so each counterpart appears at most once.
87
- * Keeps the opportunity with the highest interpretation.confidence per
88
- * counterpart userId. On ties, the first encountered wins (stable).
89
- *
90
- * Counterpart = first actor whose userId !== viewerId.
91
- * Opportunities without a derivable counterpart pass through undeduped.
92
- *
93
- * @param opportunities - Pre-sorted opportunities (e.g. by confidence/recency)
94
- * @param viewerId - The viewing user's ID
95
- * @returns Deduped subset preserving original input order among winners
96
- */
97
- export declare function deduplicateByPerson<T extends {
98
- actors: Array<{
99
- userId: string;
100
- role: string;
101
- }>;
102
- interpretation?: {
103
- confidence?: number;
104
- } | null;
105
- }>(opportunities: T[], viewerId: string): T[];
@@ -1,6 +1,3 @@
1
- import { log } from '../shared/observability/log.js';
2
- const logger = log.graph.from('SelectByComposition');
3
- const dedupeByPersonLog = log.graph.from('DeduplicateByPerson');
4
1
  /**
5
2
  * Validates opportunity actors.
6
3
  *
@@ -51,14 +48,6 @@ export function isActionableForViewer(actors, status, viewerId, committedActorId
51
48
  return false;
52
49
  return !committedActorIds.includes(viewerId);
53
50
  }
54
- /** Soft targets for radar composition. */
55
- export const RADAR_SOFT_TARGETS = {
56
- // 3 + 2 in a second category before that category was removed. The slots move to
57
- // connections rather than shrinking the feed: the total a radar can hold is
58
- // unchanged, and connections are the only kind of card left.
59
- connection: 5,
60
- expired: 2,
61
- };
62
51
  /**
63
52
  * Classify an actionable opportunity into a feed category.
64
53
  * Assumes the opportunity already passed isActionableForViewer or is expired.
@@ -72,94 +61,3 @@ export function classifyOpportunity(opp, _viewerId) {
72
61
  return 'expired';
73
62
  return 'connection';
74
63
  }
75
- /**
76
- * Select opportunities for the radar using soft composition targets.
77
- * Fills each category up to its target, then redistributes unused slots
78
- * to categories that have more items available. Preserves input order.
79
- *
80
- * @param opportunities - Pre-sorted opportunities (by confidence/recency)
81
- * @param viewerId - The viewing user's ID
82
- * @returns Composition-balanced subset
83
- */
84
- export function selectByComposition(opportunities, viewerId) {
85
- const buckets = { connection: [], expired: [] };
86
- for (const opp of opportunities) {
87
- buckets[classifyOpportunity(opp, viewerId)].push(opp);
88
- }
89
- const targets = {
90
- connection: RADAR_SOFT_TARGETS.connection,
91
- expired: RADAR_SOFT_TARGETS.expired,
92
- };
93
- // First pass: fill each category up to its target.
94
- const selected = {
95
- connection: buckets.connection.slice(0, targets.connection),
96
- expired: buckets.expired.slice(0, targets.expired),
97
- };
98
- // Second pass: redistribute unused slots, connection before expired.
99
- let unusedSlots = (targets.connection + targets.expired)
100
- - (selected.connection.length + selected.expired.length);
101
- for (const category of ['connection', 'expired']) {
102
- if (unusedSlots <= 0)
103
- break;
104
- const remaining = buckets[category].slice(selected[category].length);
105
- const take = Math.min(remaining.length, unusedSlots);
106
- selected[category].push(...remaining.slice(0, take));
107
- unusedSlots -= take;
108
- }
109
- // Within each category, preserve original input order.
110
- const indexMap = new Map(opportunities.map((opp, i) => [opp, i]));
111
- const sortByOriginal = (a, b) => (indexMap.get(a) ?? 0) - (indexMap.get(b) ?? 0);
112
- selected.connection.sort(sortByOriginal);
113
- selected.expired.sort(sortByOriginal);
114
- logger.info('Selected opportunities by composition', {
115
- input: opportunities.length,
116
- buckets: { connection: buckets.connection.length, expired: buckets.expired.length },
117
- selected: { connection: selected.connection.length, expired: selected.expired.length },
118
- });
119
- return [...selected.connection, ...selected.expired];
120
- }
121
- /**
122
- * Deduplicate opportunities so each counterpart appears at most once.
123
- * Keeps the opportunity with the highest interpretation.confidence per
124
- * counterpart userId. On ties, the first encountered wins (stable).
125
- *
126
- * Counterpart = first actor whose userId !== viewerId.
127
- * Opportunities without a derivable counterpart pass through undeduped.
128
- *
129
- * @param opportunities - Pre-sorted opportunities (e.g. by confidence/recency)
130
- * @param viewerId - The viewing user's ID
131
- * @returns Deduped subset preserving original input order among winners
132
- */
133
- export function deduplicateByPerson(opportunities, viewerId) {
134
- const bestByCounterpart = new Map();
135
- const noCounterpart = [];
136
- for (let i = 0; i < opportunities.length; i++) {
137
- const opp = opportunities[i];
138
- const counterpart = opp.actors.find((a) => a.userId !== viewerId);
139
- if (!counterpart) {
140
- noCounterpart.push({ opp, index: i });
141
- continue;
142
- }
143
- const key = counterpart.userId;
144
- const existing = bestByCounterpart.get(key);
145
- if (!existing) {
146
- bestByCounterpart.set(key, { opp, index: i });
147
- continue;
148
- }
149
- const newConf = opp.interpretation?.confidence ?? -1;
150
- const oldConf = existing.opp.interpretation?.confidence ?? -1;
151
- if (newConf > oldConf) {
152
- bestByCounterpart.set(key, { opp, index: i });
153
- }
154
- }
155
- const all = [...bestByCounterpart.values(), ...noCounterpart];
156
- all.sort((a, b) => a.index - b.index);
157
- const result = all.map((entry) => entry.opp);
158
- if (result.length < opportunities.length) {
159
- dedupeByPersonLog.info('Deduped opportunities by person', {
160
- input: opportunities.length,
161
- output: result.length,
162
- });
163
- }
164
- return result;
165
- }
@@ -51,9 +51,9 @@ export type IntentNetworkGraphDatabase = Pick<Database, 'getIntentForIndexing' |
51
51
  */
52
52
  export type NetworkMembershipGraphDatabase = Pick<Database, 'isNetworkMember' | 'isNetworkOwner' | 'getNetworkWithPermissions' | 'addMemberToNetwork' | 'removeMemberFromNetwork' | 'getNetworkMembersForMember'>;
53
53
  /**
54
- * Database interface for Radar Graph (opportunity radar view).
54
+ * Database interface for opportunity cards.
55
55
  * Load opportunities, enrich with profile/network, and support presenter context.
56
56
  *
57
57
  * Access layer: UserDatabase (own opportunities and profile)
58
58
  */
59
- export type RadarGraphDatabase = Pick<Database, 'getOpportunitiesForUser' | 'getOpportunity' | 'getProfile' | 'getActiveIntents' | 'getNetwork' | 'getUser'> & NegotiationContextDatabase;
59
+ export type OpportunityCardsDatabase = Pick<Database, 'getOpportunitiesForUser' | 'getOpportunity' | 'getProfile' | 'getActiveIntents' | 'getNetwork' | 'getUser'> & NegotiationContextDatabase;
@@ -485,6 +485,6 @@ export interface OpportunityQueryOptions {
485
485
  actorUserId?: string;
486
486
  limit?: number;
487
487
  offset?: number;
488
- /** When set, include draft opportunities for this chat session. When unset, exclude all draft opportunities (e.g. radar view, API). */
488
+ /** When set, include draft opportunities for this chat session. When unset, exclude all draft opportunities (e.g. opportunity cards, API). */
489
489
  conversationId?: string;
490
490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "65.0.0",
3
+ "version": "66.0.0-rc.609.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,24 +0,0 @@
1
- import type { CompositeDatabase, Opportunity } from '../../platform/database.js';
2
- export interface OpportunityFeedSelectionInput {
3
- reader: Pick<CompositeDatabase, 'getOpportunitiesForUser'>;
4
- viewerId: string;
5
- networkId?: string;
6
- intentScope: {
7
- scopeType?: 'intent';
8
- scopeId?: string;
9
- };
10
- displayLimit: number;
11
- warn: (message: string, data: Record<string, unknown>) => void;
12
- }
13
- export interface OpportunityFeedSelection {
14
- opportunities: Opportunity[];
15
- dedupedCount: number;
16
- skippedIds: string[];
17
- fetchedCount: number;
18
- }
19
- /**
20
- * Selects actionable opportunities for the chat/feed surface. The caller actor
21
- * check is deliberately the first post-read filter so non-actor rows cannot
22
- * affect selection or downstream profile/presentation reads.
23
- */
24
- export declare function selectOpportunityFeed(args: OpportunityFeedSelectionInput): Promise<OpportunityFeedSelection>;
@@ -1,40 +0,0 @@
1
- import { deduplicateByPerson, selectByComposition } from './opportunity.utils.js';
2
- const ACTIONABLE_FEED_STATUSES = ['pending'];
3
- const FEED_FETCH_LIMIT = 30;
4
- /**
5
- * Selects actionable opportunities for the chat/feed surface. The caller actor
6
- * check is deliberately the first post-read filter so non-actor rows cannot
7
- * affect selection or downstream profile/presentation reads.
8
- */
9
- export async function selectOpportunityFeed(args) {
10
- const fetched = await args.reader.getOpportunitiesForUser(args.viewerId, {
11
- networkId: args.networkId,
12
- ...args.intentScope,
13
- statuses: ACTIONABLE_FEED_STATUSES,
14
- limit: FEED_FETCH_LIMIT,
15
- });
16
- const skippedIds = [];
17
- const callerScoped = fetched.filter((opportunity) => {
18
- if (opportunity.actors.some((actor) => actor.userId === args.viewerId))
19
- return true;
20
- args.warn('Opportunity feed: skipping opportunity where caller is not an actor', {
21
- opportunityId: opportunity.id,
22
- viewerId: args.viewerId,
23
- actorUserIds: opportunity.actors
24
- .map((actor) => actor.userId)
25
- .filter((userId) => typeof userId === 'string'),
26
- });
27
- skippedIds.push(opportunity.id);
28
- return false;
29
- });
30
- const deduped = deduplicateByPerson(callerScoped, args.viewerId);
31
- const selected = deduped.length > 0
32
- ? selectByComposition(deduped, args.viewerId)
33
- : deduped;
34
- return {
35
- opportunities: selected.slice(0, args.displayLimit),
36
- dedupedCount: deduped.length,
37
- skippedIds,
38
- fetchedCount: fetched.length,
39
- };
40
- }
@@ -1,230 +0,0 @@
1
- /**
2
- * Radar Graph: Build the opportunity radar view — a flat, presenter-texted
3
- * list of opportunity cards for a viewer, optionally scoped to one intent.
4
- *
5
- * Flow:
6
- * loadOpportunities → checkPresenterCache → [generateCardText if misses]
7
- * → cachePresenterResults → normalizeItems
8
- *
9
- * Uses OpportunityPresenter for card text and caches presenter results via
10
- * OpportunityCache. Responses are a flat `items` array; clients bucket by
11
- * lifecycle status themselves.
12
- */
13
- import type { RadarGraphDatabase, OpportunityStatus } from '../../../platform/database.js';
14
- import type { OpportunityCache } from '../../../platform/discovery/cache.js';
15
- import { RadarGraphState, type RadarCardItem, type RadarResponseItem } from './radar.state.js';
16
- import { OpportunityPresenter } from '../opportunity.presentation.js';
17
- import type { DebugMetaAgent } from "../../../protocol/core.js";
18
- /** Database must satisfy both RadarGraphDatabase and presenter context (getProfile, getActiveIntents, getNetwork, getUser). */
19
- type RadarGraphDb = RadarGraphDatabase;
20
- export type RadarGraphInvokeInput = {
21
- userId: string;
22
- networkId?: string;
23
- scopeType?: 'intent';
24
- scopeId?: string;
25
- limit?: number;
26
- noCache?: boolean;
27
- /**
28
- * 'skeleton' returns immediately without LLM work: cached cards complete,
29
- * uncached cards with identity fields only + `presentationPending: true`.
30
- * Meant as the fast first phase of a two-phase fetch — follow up with a
31
- * full request to fill in the text.
32
- */
33
- presentation?: 'full' | 'skeleton';
34
- /**
35
- * When set, filter loaded opportunities to these lifecycle statuses. Defaults to `DEFAULT_RADAR_STATUSES`.
36
- * Explicit statuses switch the graph to "lifecycle view" mode: terminal/internal
37
- * statuses pass through (only latent/pending stay gated by viewer actionability),
38
- * ordering is newest-first, and composition capping is skipped.
39
- */
40
- statuses?: OpportunityStatus[];
41
- };
42
- export type RadarGraphInvokeResult = {
43
- items: RadarResponseItem[];
44
- meta: {
45
- totalOpportunities: number;
46
- };
47
- error?: string;
48
- };
49
- /** Default radar statuses: the lifecycle stages a viewer can act on today. */
50
- export declare const DEFAULT_RADAR_STATUSES: OpportunityStatus[];
51
- /** Full status enumeration. Pass this to `RadarGraphInvokeInput.statuses` to restore pre-Issue-3 (unfiltered) behavior. */
52
- export declare const ALL_OPPORTUNITY_STATUSES: OpportunityStatus[];
53
- /** Pure cache policy for presenter cards; degraded current-request copy retries later. */
54
- export declare function isRadarPresentationCacheable(card: Pick<RadarCardItem, 'presentationPending' | '_presentationFallback' | 'name'>, status: OpportunityStatus | undefined): boolean;
55
- /**
56
- * Strip leading narrator name from remark when the UI already prepends "Name: " to the chip.
57
- * Avoids duplication like "Yankı Ekin Yüksel: Yankı Ekin Yüksel introduced you two..."
58
- * Repeats until no leading name (handles "Name: Name rest").
59
- */
60
- export declare function stripLeadingNarratorName(remark: string, narratorName: string): string;
61
- /** The graph's channel state, as every node sees it. */
62
- export type RadarState = typeof RadarGraphState.State;
63
- /** Everything the radar nodes reach for. */
64
- export interface RadarGraphDeps {
65
- database: RadarGraphDb;
66
- cache: OpportunityCache;
67
- /** Card-copy presenter, shared across the run. */
68
- presenter: OpportunityPresenter;
69
- }
70
- export declare class RadarGraphFactory {
71
- /** Resolved dependency bag shared by every node. */
72
- readonly deps: RadarGraphDeps;
73
- constructor(database: RadarGraphDb, cache: OpportunityCache);
74
- createGraph(): import("@langchain/langgraph").CompiledStateGraph<{
75
- userId: string;
76
- networkId: string | undefined;
77
- scopeType: "intent" | undefined;
78
- scopeId: string | undefined;
79
- limit: number;
80
- noCache: boolean;
81
- presentation: "full" | "skeleton";
82
- statuses: OpportunityStatus[] | undefined;
83
- opportunities: import("../../../platform/database.js").Opportunity[];
84
- cards: RadarCardItem[];
85
- items: RadarResponseItem[];
86
- cachedCards: Map<string, RadarCardItem>;
87
- uncachedOpportunities: import("../../../platform/database.js").Opportunity[];
88
- error: string | undefined;
89
- meta: {
90
- totalOpportunities: number;
91
- };
92
- agentTimings: DebugMetaAgent[];
93
- }, {
94
- userId?: string | import("@langchain/langgraph").OverwriteValue<string> | undefined;
95
- networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
96
- scopeType?: "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined;
97
- scopeId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
98
- limit?: number | import("@langchain/langgraph").OverwriteValue<number> | undefined;
99
- noCache?: boolean | import("@langchain/langgraph").OverwriteValue<boolean> | undefined;
100
- presentation?: "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton"> | undefined;
101
- statuses?: OpportunityStatus[] | import("@langchain/langgraph").OverwriteValue<OpportunityStatus[] | undefined> | undefined;
102
- opportunities?: import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]> | undefined;
103
- cards?: RadarCardItem[] | import("@langchain/langgraph").OverwriteValue<RadarCardItem[]> | undefined;
104
- items?: RadarResponseItem[] | import("@langchain/langgraph").OverwriteValue<RadarResponseItem[]> | undefined;
105
- cachedCards?: Map<string, RadarCardItem> | import("@langchain/langgraph").OverwriteValue<Map<string, RadarCardItem>> | undefined;
106
- uncachedOpportunities?: import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]> | undefined;
107
- error?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
108
- meta?: {
109
- totalOpportunities: number;
110
- } | import("@langchain/langgraph").OverwriteValue<{
111
- totalOpportunities: number;
112
- }> | undefined;
113
- agentTimings?: DebugMetaAgent[] | import("@langchain/langgraph").OverwriteValue<DebugMetaAgent[]> | undefined;
114
- }, "__start__" | "loadOpportunities" | "checkPresenterCache" | "generateCardText" | "cachePresenterResults" | "normalizeItems", {
115
- userId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
116
- networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
117
- scopeType: import("@langchain/langgraph").BaseChannel<"intent" | undefined, "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined, unknown>;
118
- scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
119
- limit: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
120
- noCache: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
121
- presentation: import("@langchain/langgraph").BaseChannel<"full" | "skeleton", "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton">, unknown>;
122
- statuses: import("@langchain/langgraph").BaseChannel<OpportunityStatus[] | undefined, OpportunityStatus[] | import("@langchain/langgraph").OverwriteValue<OpportunityStatus[] | undefined> | undefined, unknown>;
123
- opportunities: import("@langchain/langgraph").BaseChannel<import("../../../platform/database.js").Opportunity[], import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]>, unknown>;
124
- cards: import("@langchain/langgraph").BaseChannel<RadarCardItem[], RadarCardItem[] | import("@langchain/langgraph").OverwriteValue<RadarCardItem[]>, unknown>;
125
- items: import("@langchain/langgraph").BaseChannel<RadarResponseItem[], RadarResponseItem[] | import("@langchain/langgraph").OverwriteValue<RadarResponseItem[]>, unknown>;
126
- cachedCards: import("@langchain/langgraph").BaseChannel<Map<string, RadarCardItem>, Map<string, RadarCardItem> | import("@langchain/langgraph").OverwriteValue<Map<string, RadarCardItem>>, unknown>;
127
- uncachedOpportunities: import("@langchain/langgraph").BaseChannel<import("../../../platform/database.js").Opportunity[], import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]>, unknown>;
128
- error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
129
- meta: import("@langchain/langgraph").BaseChannel<{
130
- totalOpportunities: number;
131
- }, {
132
- totalOpportunities: number;
133
- } | import("@langchain/langgraph").OverwriteValue<{
134
- totalOpportunities: number;
135
- }>, unknown>;
136
- agentTimings: import("@langchain/langgraph").BaseChannel<DebugMetaAgent[], DebugMetaAgent[] | import("@langchain/langgraph").OverwriteValue<DebugMetaAgent[]>, unknown>;
137
- }, {
138
- userId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
139
- networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
140
- scopeType: import("@langchain/langgraph").BaseChannel<"intent" | undefined, "intent" | import("@langchain/langgraph").OverwriteValue<"intent" | undefined> | undefined, unknown>;
141
- scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
142
- limit: import("@langchain/langgraph").BaseChannel<number, number | import("@langchain/langgraph").OverwriteValue<number>, unknown>;
143
- noCache: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
144
- presentation: import("@langchain/langgraph").BaseChannel<"full" | "skeleton", "full" | "skeleton" | import("@langchain/langgraph").OverwriteValue<"full" | "skeleton">, unknown>;
145
- statuses: import("@langchain/langgraph").BaseChannel<OpportunityStatus[] | undefined, OpportunityStatus[] | import("@langchain/langgraph").OverwriteValue<OpportunityStatus[] | undefined> | undefined, unknown>;
146
- opportunities: import("@langchain/langgraph").BaseChannel<import("../../../platform/database.js").Opportunity[], import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]>, unknown>;
147
- cards: import("@langchain/langgraph").BaseChannel<RadarCardItem[], RadarCardItem[] | import("@langchain/langgraph").OverwriteValue<RadarCardItem[]>, unknown>;
148
- items: import("@langchain/langgraph").BaseChannel<RadarResponseItem[], RadarResponseItem[] | import("@langchain/langgraph").OverwriteValue<RadarResponseItem[]>, unknown>;
149
- cachedCards: import("@langchain/langgraph").BaseChannel<Map<string, RadarCardItem>, Map<string, RadarCardItem> | import("@langchain/langgraph").OverwriteValue<Map<string, RadarCardItem>>, unknown>;
150
- uncachedOpportunities: import("@langchain/langgraph").BaseChannel<import("../../../platform/database.js").Opportunity[], import("../../../platform/database.js").Opportunity[] | import("@langchain/langgraph").OverwriteValue<import("../../../platform/database.js").Opportunity[]>, unknown>;
151
- error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
152
- meta: import("@langchain/langgraph").BaseChannel<{
153
- totalOpportunities: number;
154
- }, {
155
- totalOpportunities: number;
156
- } | import("@langchain/langgraph").OverwriteValue<{
157
- totalOpportunities: number;
158
- }>, unknown>;
159
- agentTimings: import("@langchain/langgraph").BaseChannel<DebugMetaAgent[], DebugMetaAgent[] | import("@langchain/langgraph").OverwriteValue<DebugMetaAgent[]>, unknown>;
160
- }, import("@langchain/langgraph").StateDefinition, {
161
- loadOpportunities: {
162
- error: string;
163
- opportunities?: undefined;
164
- } | {
165
- opportunities: import("../../../platform/database.js").Opportunity[];
166
- error?: undefined;
167
- } | {
168
- error: string;
169
- opportunities: never[];
170
- };
171
- checkPresenterCache: {
172
- cachedCards: Map<any, any>;
173
- uncachedOpportunities: import("../../../platform/database.js").Opportunity[];
174
- };
175
- generateCardText: {
176
- cards: RadarCardItem[];
177
- agentTimings: DebugMetaAgent[];
178
- meta: {
179
- totalOpportunities: number;
180
- };
181
- };
182
- cachePresenterResults: {
183
- cards: RadarCardItem[];
184
- meta: {
185
- totalOpportunities: number;
186
- };
187
- };
188
- normalizeItems: {
189
- items: RadarResponseItem[];
190
- meta: {
191
- totalOpportunities: number;
192
- };
193
- };
194
- }, unknown, unknown, []>;
195
- }
196
- export declare function loadOpportunitiesNode(state: RadarState, deps: RadarGraphDeps): Promise<{
197
- error: string;
198
- opportunities?: undefined;
199
- } | {
200
- opportunities: import("../../../platform/database.js").Opportunity[];
201
- error?: undefined;
202
- } | {
203
- error: string;
204
- opportunities: never[];
205
- }>;
206
- export declare function checkPresenterCacheNode(state: RadarState, deps: RadarGraphDeps): Promise<{
207
- cachedCards: Map<any, any>;
208
- uncachedOpportunities: import("../../../platform/database.js").Opportunity[];
209
- }>;
210
- export declare function shouldGenerateCards(state: RadarState, _deps: RadarGraphDeps): string;
211
- export declare function generateCardTextNode(state: RadarState, deps: RadarGraphDeps): Promise<{
212
- cards: RadarCardItem[];
213
- agentTimings: DebugMetaAgent[];
214
- meta: {
215
- totalOpportunities: number;
216
- };
217
- }>;
218
- export declare function cachePresenterResultsNode(state: RadarState, deps: RadarGraphDeps): Promise<{
219
- cards: RadarCardItem[];
220
- meta: {
221
- totalOpportunities: number;
222
- };
223
- }>;
224
- export declare function normalizeItemsNode(state: RadarState): Promise<{
225
- items: RadarResponseItem[];
226
- meta: {
227
- totalOpportunities: number;
228
- };
229
- }>;
230
- export {};