@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,87 +0,0 @@
1
- import { Annotation } from '@langchain/langgraph';
2
- /**
3
- * Radar Graph State (Annotation-based).
4
- * Flow: loadOpportunities → checkPresenterCache → [generateCardText if misses]
5
- * → cachePresenterResults → normalizeItems.
6
- */
7
- export const RadarGraphState = Annotation.Root({
8
- userId: Annotation({
9
- reducer: (curr, next) => next ?? curr,
10
- default: () => '',
11
- }),
12
- networkId: Annotation({
13
- reducer: (curr, next) => next ?? curr,
14
- default: () => undefined,
15
- }),
16
- scopeType: Annotation({
17
- reducer: (curr, next) => next ?? curr,
18
- default: () => undefined,
19
- }),
20
- scopeId: Annotation({
21
- reducer: (curr, next) => next ?? curr,
22
- default: () => undefined,
23
- }),
24
- limit: Annotation({
25
- reducer: (curr, next) => next ?? curr,
26
- default: () => 50,
27
- }),
28
- /** When true, bypass the presenter Redis cache. */
29
- noCache: Annotation({
30
- reducer: (curr, next) => next ?? curr,
31
- default: () => false,
32
- }),
33
- /**
34
- * Presentation depth. 'full' (default) runs the presenter LLM for cache
35
- * misses. 'skeleton' skips it: uncached cards come back with resolved
36
- * identity (name/avatar/status) and `presentationPending: true`, cached
37
- * cards come back complete.
38
- */
39
- presentation: Annotation({
40
- reducer: (curr, next) => next ?? curr,
41
- default: () => 'full',
42
- }),
43
- /** Optional status filter. When undefined, the graph uses `DEFAULT_RADAR_STATUSES`. */
44
- statuses: Annotation({
45
- reducer: (curr, next) => next ?? curr,
46
- default: () => undefined,
47
- }),
48
- /** Raw opportunities visible to the viewer (after visibility filter). */
49
- opportunities: Annotation({
50
- reducer: (curr, next) => next ?? curr,
51
- default: () => [],
52
- }),
53
- /** Cards with presenter output and narrator chip. */
54
- cards: Annotation({
55
- reducer: (curr, next) => next ?? curr,
56
- default: () => [],
57
- }),
58
- /** Final items for response (internal fields stripped). */
59
- items: Annotation({
60
- reducer: (curr, next) => next ?? curr,
61
- default: () => [],
62
- }),
63
- /** Presenter results retrieved from cache (opportunityId → RadarCardItem). */
64
- cachedCards: Annotation({
65
- reducer: (curr, next) => next ?? curr,
66
- default: () => new Map(),
67
- }),
68
- /** Opportunities that had no cache hit and need presenter generation. */
69
- uncachedOpportunities: Annotation({
70
- reducer: (curr, next) => next ?? curr,
71
- default: () => [],
72
- }),
73
- error: Annotation({
74
- reducer: (curr, next) => next ?? curr,
75
- default: () => undefined,
76
- }),
77
- /** Meta for response (e.g. totalOpportunities). */
78
- meta: Annotation({
79
- reducer: (curr, next) => next ?? curr,
80
- default: () => ({ totalOpportunities: 0 }),
81
- }),
82
- /** Timing records for each agent invocation within this graph run. */
83
- agentTimings: Annotation({
84
- reducer: (acc, val) => [...acc, ...val],
85
- default: () => [],
86
- }),
87
- });