@indexnetwork/protocol 66.0.0-rc.608.1 → 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.
@@ -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. */
54
- export declare function isRadarPresentationCacheable(card: Pick<RadarCardItem, 'presentationPending' | '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 {};