@lucern/events 0.3.0-alpha.4 → 0.3.0-alpha.6
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/index.js +737 -2
- package/dist/index.js.map +1 -1
- package/dist/outbox.js +737 -2
- package/dist/outbox.js.map +1 -1
- package/dist/types.js +737 -2
- package/dist/types.js.map +1 -1
- package/dist/webhooks.js +737 -2
- package/dist/webhooks.js.map +1 -1
- package/package.json +2 -2
package/dist/webhooks.js
CHANGED
|
@@ -1,6 +1,487 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { v } from 'convex/values';
|
|
3
3
|
|
|
4
|
+
// ../contracts/src/graph-intelligence.contract.ts
|
|
5
|
+
var GRAPH_INTELLIGENCE_MODE_TOOL_NAMES = {
|
|
6
|
+
core: [
|
|
7
|
+
"get_graph_structure_analysis",
|
|
8
|
+
"get_topic_coverage",
|
|
9
|
+
"get_graph_gaps",
|
|
10
|
+
"list_beliefs",
|
|
11
|
+
"list_questions",
|
|
12
|
+
"search_evidence"
|
|
13
|
+
],
|
|
14
|
+
bias: [
|
|
15
|
+
"get_graph_structure_analysis",
|
|
16
|
+
"detect_confirmation_bias",
|
|
17
|
+
"find_contradictions",
|
|
18
|
+
"search_evidence",
|
|
19
|
+
"list_beliefs"
|
|
20
|
+
],
|
|
21
|
+
stress: [
|
|
22
|
+
"get_graph_structure_analysis",
|
|
23
|
+
"get_graph_gaps",
|
|
24
|
+
"find_contradictions",
|
|
25
|
+
"get_falsification_questions",
|
|
26
|
+
"list_beliefs",
|
|
27
|
+
"list_questions"
|
|
28
|
+
],
|
|
29
|
+
operational: [
|
|
30
|
+
"get_topic_coverage",
|
|
31
|
+
"get_graph_gaps",
|
|
32
|
+
"list_beliefs",
|
|
33
|
+
"list_questions",
|
|
34
|
+
"search_evidence"
|
|
35
|
+
],
|
|
36
|
+
alpha: [
|
|
37
|
+
"get_graph_structure_analysis",
|
|
38
|
+
"detect_confirmation_bias",
|
|
39
|
+
"find_contradictions",
|
|
40
|
+
"search_beliefs",
|
|
41
|
+
"search_evidence"
|
|
42
|
+
],
|
|
43
|
+
semantic: [
|
|
44
|
+
"get_graph_structure_analysis",
|
|
45
|
+
"search_beliefs",
|
|
46
|
+
"search_evidence",
|
|
47
|
+
"traverse_graph",
|
|
48
|
+
"query_lineage",
|
|
49
|
+
"get_graph_neighborhood"
|
|
50
|
+
],
|
|
51
|
+
evidence: [
|
|
52
|
+
"get_graph_structure_analysis",
|
|
53
|
+
"get_topic_coverage",
|
|
54
|
+
"search_evidence",
|
|
55
|
+
"get_falsification_questions",
|
|
56
|
+
"find_contradictions"
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
var byMode = (mode) => GRAPH_INTELLIGENCE_MODE_TOOL_NAMES[mode];
|
|
60
|
+
var GRAPH_INTELLIGENCE_QUERIES = [
|
|
61
|
+
{
|
|
62
|
+
id: "confirmation-bias",
|
|
63
|
+
categoryId: "problems",
|
|
64
|
+
mode: "bias",
|
|
65
|
+
name: "Find Confirmation Bias",
|
|
66
|
+
description: "Find beliefs supported mainly by confirming evidence.",
|
|
67
|
+
prompt: "Find beliefs where supporting evidence overwhelms challenging evidence. Prioritize high-conviction beliefs with few defeaters.",
|
|
68
|
+
highlightStrategy: "bias-risk",
|
|
69
|
+
riskLevel: "high"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "contradiction-map",
|
|
73
|
+
categoryId: "problems",
|
|
74
|
+
mode: "stress",
|
|
75
|
+
name: "Map Contradictions",
|
|
76
|
+
description: "Surface direct and indirect contradiction clusters.",
|
|
77
|
+
prompt: "Map the graph's contradiction clusters and explain which tensions matter most.",
|
|
78
|
+
highlightStrategy: "contradictions",
|
|
79
|
+
riskLevel: "high"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "weak-evidence",
|
|
83
|
+
categoryId: "problems",
|
|
84
|
+
mode: "stress",
|
|
85
|
+
name: "Weak Evidence Chains",
|
|
86
|
+
description: "Find important claims with thin or indirect evidence.",
|
|
87
|
+
prompt: "Find high-importance beliefs whose evidence support is thin, indirect, stale, or low quality.",
|
|
88
|
+
highlightStrategy: "weak-support",
|
|
89
|
+
riskLevel: "medium"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "single-source",
|
|
93
|
+
categoryId: "problems",
|
|
94
|
+
mode: "bias",
|
|
95
|
+
name: "Single-Source Risk",
|
|
96
|
+
description: "Find claims overly dependent on one source or source type.",
|
|
97
|
+
prompt: "Identify beliefs that rely on a single source, one methodology, or one repeated perspective.",
|
|
98
|
+
highlightStrategy: "source-concentration",
|
|
99
|
+
riskLevel: "medium"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "untested-assumptions",
|
|
103
|
+
categoryId: "problems",
|
|
104
|
+
mode: "stress",
|
|
105
|
+
name: "Untested Assumptions",
|
|
106
|
+
description: "Find load-bearing assumptions without falsification paths.",
|
|
107
|
+
prompt: "Find assumptions that appear load-bearing but do not have direct testing questions or falsification evidence.",
|
|
108
|
+
highlightStrategy: "untested",
|
|
109
|
+
riskLevel: "high"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "load-bearing-beliefs",
|
|
113
|
+
categoryId: "problems",
|
|
114
|
+
mode: "stress",
|
|
115
|
+
name: "Load-Bearing Beliefs",
|
|
116
|
+
description: "Find central beliefs whose failure would affect many claims.",
|
|
117
|
+
prompt: "Find the beliefs with the largest downstream impact if they are wrong.",
|
|
118
|
+
highlightStrategy: "load-bearing",
|
|
119
|
+
riskLevel: "high"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "cascade-analysis",
|
|
123
|
+
categoryId: "problems",
|
|
124
|
+
mode: "stress",
|
|
125
|
+
name: "Cascade Analysis",
|
|
126
|
+
description: "Trace what changes if a belief is weakened or invalidated.",
|
|
127
|
+
prompt: "Analyze likely downstream cascades if the most central or uncertain beliefs are weakened.",
|
|
128
|
+
highlightStrategy: "cascade",
|
|
129
|
+
riskLevel: "high"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "unanswered-questions",
|
|
133
|
+
categoryId: "gaps",
|
|
134
|
+
mode: "operational",
|
|
135
|
+
name: "Unanswered Questions",
|
|
136
|
+
description: "Find important open questions that block confidence.",
|
|
137
|
+
prompt: "Identify the most important unanswered questions and explain which beliefs they block.",
|
|
138
|
+
highlightStrategy: "open-questions"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "thin-themes",
|
|
142
|
+
categoryId: "gaps",
|
|
143
|
+
mode: "operational",
|
|
144
|
+
name: "Thin Themes",
|
|
145
|
+
description: "Find topics with shallow belief or evidence coverage.",
|
|
146
|
+
prompt: "Find themes that look underdeveloped relative to their role in the graph.",
|
|
147
|
+
highlightStrategy: "thin-themes"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: "missing-evidence",
|
|
151
|
+
categoryId: "gaps",
|
|
152
|
+
mode: "stress",
|
|
153
|
+
name: "Missing Evidence",
|
|
154
|
+
description: "Find beliefs that need specific missing evidence.",
|
|
155
|
+
prompt: "Find the most valuable missing evidence needed to strengthen or falsify the graph.",
|
|
156
|
+
highlightStrategy: "missing-evidence"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "isolated-clusters",
|
|
160
|
+
categoryId: "gaps",
|
|
161
|
+
mode: "operational",
|
|
162
|
+
name: "Isolated Clusters",
|
|
163
|
+
description: "Find clusters not connected to the broader graph.",
|
|
164
|
+
prompt: "Find isolated graph clusters and recommend bridge questions or bridge evidence.",
|
|
165
|
+
highlightStrategy: "isolated-clusters"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "source-contribution",
|
|
169
|
+
categoryId: "gaps",
|
|
170
|
+
mode: "evidence",
|
|
171
|
+
name: "Source Contribution",
|
|
172
|
+
description: "Assess how source mix shapes the graph.",
|
|
173
|
+
prompt: "Assess whether the source mix is balanced enough for the graph's strongest claims.",
|
|
174
|
+
highlightStrategy: "source-mix"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "stale-beliefs",
|
|
178
|
+
categoryId: "gaps",
|
|
179
|
+
mode: "operational",
|
|
180
|
+
name: "Stale Beliefs",
|
|
181
|
+
description: "Find beliefs that need review because they are old or stale.",
|
|
182
|
+
prompt: "Find beliefs that should be revisited because they are stale, unsupported by recent evidence, or contradicted by newer context.",
|
|
183
|
+
highlightStrategy: "staleness"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "assumption-pyramid",
|
|
187
|
+
categoryId: "reasoning",
|
|
188
|
+
mode: "operational",
|
|
189
|
+
name: "Assumption Pyramid",
|
|
190
|
+
description: "Show which conclusions rest on which assumptions.",
|
|
191
|
+
prompt: "Build an assumption pyramid from the graph: foundational assumptions, intermediate claims, and top-level conclusions.",
|
|
192
|
+
highlightStrategy: "assumptions"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: "converging-evidence",
|
|
196
|
+
categoryId: "reasoning",
|
|
197
|
+
mode: "evidence",
|
|
198
|
+
name: "Converging Evidence",
|
|
199
|
+
description: "Find claims supported by independent evidence streams.",
|
|
200
|
+
prompt: "Find beliefs with genuinely independent converging evidence and explain why they are robust.",
|
|
201
|
+
highlightStrategy: "convergence"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "weakest-links",
|
|
205
|
+
categoryId: "reasoning",
|
|
206
|
+
mode: "stress",
|
|
207
|
+
name: "Weakest Links",
|
|
208
|
+
description: "Find the weakest links in important reasoning chains.",
|
|
209
|
+
prompt: "Find the weakest links in important reasoning chains and explain how to test them.",
|
|
210
|
+
highlightStrategy: "weak-links",
|
|
211
|
+
riskLevel: "medium"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "challenged-beliefs",
|
|
215
|
+
categoryId: "reasoning",
|
|
216
|
+
mode: "stress",
|
|
217
|
+
name: "Challenged Beliefs",
|
|
218
|
+
description: "Find beliefs with active challenges or defeaters.",
|
|
219
|
+
prompt: "Find beliefs with active challenges, contradiction edges, or unresolved defeaters.",
|
|
220
|
+
highlightStrategy: "challenged"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "contrarian-map",
|
|
224
|
+
categoryId: "strategic",
|
|
225
|
+
mode: "alpha",
|
|
226
|
+
name: "Contrarian Map",
|
|
227
|
+
description: "Find non-consensus beliefs and where they are grounded.",
|
|
228
|
+
prompt: "Find the graph's strongest contrarian or non-consensus beliefs and explain their support.",
|
|
229
|
+
highlightStrategy: "contrarian"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "irreversibility-audit",
|
|
233
|
+
categoryId: "strategic",
|
|
234
|
+
mode: "stress",
|
|
235
|
+
name: "Irreversibility Audit",
|
|
236
|
+
description: "Find irreversible bets and assumptions behind them.",
|
|
237
|
+
prompt: "Audit irreversible decisions or beliefs and identify what must be true before acting.",
|
|
238
|
+
highlightStrategy: "irreversible",
|
|
239
|
+
riskLevel: "high"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: "pre-mortem",
|
|
243
|
+
categoryId: "strategic",
|
|
244
|
+
mode: "stress",
|
|
245
|
+
name: "Pre-Mortem",
|
|
246
|
+
description: "Explain how the graph could be wrong.",
|
|
247
|
+
prompt: "Run a pre-mortem: assume the current thesis fails and identify the most plausible failure paths.",
|
|
248
|
+
highlightStrategy: "failure-paths",
|
|
249
|
+
riskLevel: "high"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: "devils-advocate",
|
|
253
|
+
categoryId: "strategic",
|
|
254
|
+
mode: "stress",
|
|
255
|
+
name: "Devil's Advocate",
|
|
256
|
+
description: "Generate the strongest critique of the graph.",
|
|
257
|
+
prompt: "Produce the strongest evidence-grounded critique of the current graph and its main thesis.",
|
|
258
|
+
highlightStrategy: "critique"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: "falsification-map",
|
|
262
|
+
categoryId: "strategic",
|
|
263
|
+
mode: "stress",
|
|
264
|
+
name: "Falsification Map",
|
|
265
|
+
description: "Find the cheapest tests that would disprove key beliefs.",
|
|
266
|
+
prompt: "Map the cheapest, clearest falsification tests for the graph's key claims.",
|
|
267
|
+
highlightStrategy: "falsification",
|
|
268
|
+
riskLevel: "high"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: "prediction-tracker",
|
|
272
|
+
categoryId: "strategic",
|
|
273
|
+
mode: "evidence",
|
|
274
|
+
name: "Prediction Tracker",
|
|
275
|
+
description: "Find beliefs that imply measurable predictions.",
|
|
276
|
+
prompt: "Find beliefs that imply measurable predictions and suggest tracking signals.",
|
|
277
|
+
highlightStrategy: "predictions"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: "belief-pagerank",
|
|
281
|
+
categoryId: "deep",
|
|
282
|
+
mode: "semantic",
|
|
283
|
+
name: "Belief PageRank",
|
|
284
|
+
description: "Identify structurally central beliefs.",
|
|
285
|
+
prompt: "Use graph centrality to identify the most structurally important beliefs.",
|
|
286
|
+
highlightStrategy: "centrality"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: "underdetermination",
|
|
290
|
+
categoryId: "deep",
|
|
291
|
+
mode: "semantic",
|
|
292
|
+
name: "Underdetermination",
|
|
293
|
+
description: "Find places where evidence supports multiple explanations.",
|
|
294
|
+
prompt: "Find places where the same evidence could support multiple incompatible explanations.",
|
|
295
|
+
highlightStrategy: "underdetermination"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "confidence-propagation",
|
|
299
|
+
categoryId: "deep",
|
|
300
|
+
mode: "semantic",
|
|
301
|
+
name: "Confidence Propagation",
|
|
302
|
+
description: "Assess how uncertainty moves through the graph.",
|
|
303
|
+
prompt: "Explain how uncertainty propagates from weak or contested beliefs through downstream conclusions.",
|
|
304
|
+
highlightStrategy: "confidence-flow"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: "argument-depth",
|
|
308
|
+
categoryId: "deep",
|
|
309
|
+
mode: "evidence",
|
|
310
|
+
name: "Argument Depth",
|
|
311
|
+
description: "Assess reasoning depth and chain quality.",
|
|
312
|
+
prompt: "Assess reasoning depth: where claims are shallow, deeply supported, or overextended.",
|
|
313
|
+
highlightStrategy: "depth"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "information-edge",
|
|
317
|
+
categoryId: "deep",
|
|
318
|
+
mode: "alpha",
|
|
319
|
+
name: "Information Edge",
|
|
320
|
+
description: "Find differentiated evidence or signals.",
|
|
321
|
+
prompt: "Find evidence, sources, or beliefs that could represent differentiated information edge.",
|
|
322
|
+
highlightStrategy: "information-edge"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "thesis-summary",
|
|
326
|
+
categoryId: "browse",
|
|
327
|
+
mode: "semantic",
|
|
328
|
+
name: "Thesis Summary",
|
|
329
|
+
description: "Summarize the graph's core thesis and support.",
|
|
330
|
+
prompt: "Summarize the graph's core thesis, strongest support, weakest support, and open questions.",
|
|
331
|
+
highlightStrategy: "summary"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: "theme-deep-dive",
|
|
335
|
+
categoryId: "browse",
|
|
336
|
+
mode: "semantic",
|
|
337
|
+
name: "Theme Deep Dive",
|
|
338
|
+
description: "Deep dive into a named theme.",
|
|
339
|
+
prompt: "Deep dive into {input}. Explain the key beliefs, evidence, contradictions, and open questions.",
|
|
340
|
+
inputType: "theme",
|
|
341
|
+
highlightStrategy: "theme"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "belief-detail",
|
|
345
|
+
categoryId: "browse",
|
|
346
|
+
mode: "semantic",
|
|
347
|
+
name: "Belief Detail",
|
|
348
|
+
description: "Explain one belief and its graph neighborhood.",
|
|
349
|
+
prompt: "Explain {input} and its support, challenges, related beliefs, and downstream implications.",
|
|
350
|
+
inputType: "belief",
|
|
351
|
+
highlightStrategy: "belief"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "strongest-beliefs",
|
|
355
|
+
categoryId: "browse",
|
|
356
|
+
mode: "operational",
|
|
357
|
+
name: "Strongest Beliefs",
|
|
358
|
+
description: "Find the graph's strongest current beliefs.",
|
|
359
|
+
prompt: "Find the strongest current beliefs and explain why each one deserves confidence.",
|
|
360
|
+
highlightStrategy: "strongest"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "cross-theme-connection",
|
|
364
|
+
categoryId: "browse",
|
|
365
|
+
mode: "semantic",
|
|
366
|
+
name: "Cross-Theme Connections",
|
|
367
|
+
description: "Find bridges between themes.",
|
|
368
|
+
prompt: "Find meaningful connections across themes and explain which bridge beliefs matter.",
|
|
369
|
+
highlightStrategy: "bridges"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: "research-velocity",
|
|
373
|
+
categoryId: "browse",
|
|
374
|
+
mode: "operational",
|
|
375
|
+
name: "Research Velocity",
|
|
376
|
+
description: "Summarize recent graph movement and momentum.",
|
|
377
|
+
prompt: "Assess research velocity: what changed recently, where progress is fastest, and what is stuck.",
|
|
378
|
+
highlightStrategy: "velocity"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: "search",
|
|
382
|
+
categoryId: "browse",
|
|
383
|
+
mode: "semantic",
|
|
384
|
+
name: "Graph Search",
|
|
385
|
+
description: "Search the graph with semantic context.",
|
|
386
|
+
prompt: "Search the graph for {input}. Return the most relevant beliefs, evidence, and questions.",
|
|
387
|
+
inputType: "search",
|
|
388
|
+
highlightStrategy: "search"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: "expert-coverage",
|
|
392
|
+
categoryId: "browse",
|
|
393
|
+
mode: "semantic",
|
|
394
|
+
name: "Expert Coverage",
|
|
395
|
+
description: "Assess coverage from expert/source perspectives.",
|
|
396
|
+
prompt: "Assess whether the graph has enough expert, primary, and dissenting coverage.",
|
|
397
|
+
highlightStrategy: "expert-coverage"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: "value-chain-map",
|
|
401
|
+
categoryId: "browse",
|
|
402
|
+
mode: "semantic",
|
|
403
|
+
name: "Value Chain Map",
|
|
404
|
+
description: "Map entities, dependencies, and value-chain logic.",
|
|
405
|
+
prompt: "Map the value chain implied by this graph: entities, dependencies, pressure points, and missing links.",
|
|
406
|
+
highlightStrategy: "value-chain"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "meeting-brief",
|
|
410
|
+
categoryId: "prep",
|
|
411
|
+
mode: "semantic",
|
|
412
|
+
name: "Meeting Brief",
|
|
413
|
+
description: "Prepare a meeting brief from graph context.",
|
|
414
|
+
prompt: "Prepare a concise meeting brief using the graph: thesis, open questions, risks, and recommended asks.",
|
|
415
|
+
highlightStrategy: "brief"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: "open-questions-entity",
|
|
419
|
+
categoryId: "prep",
|
|
420
|
+
mode: "semantic",
|
|
421
|
+
name: "Entity Open Questions",
|
|
422
|
+
description: "Find open questions about a specific entity.",
|
|
423
|
+
prompt: "Find the most important open questions about {input} and the beliefs those questions would unlock.",
|
|
424
|
+
inputType: "entity",
|
|
425
|
+
highlightStrategy: "entity-questions"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: "company-context",
|
|
429
|
+
categoryId: "prep",
|
|
430
|
+
mode: "semantic",
|
|
431
|
+
name: "Company Context",
|
|
432
|
+
description: "Summarize graph context about a company.",
|
|
433
|
+
prompt: "Summarize what the graph knows about {input}: thesis relevance, evidence, risks, and open questions.",
|
|
434
|
+
inputType: "company",
|
|
435
|
+
highlightStrategy: "company"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: "company-theme-fit",
|
|
439
|
+
categoryId: "prep",
|
|
440
|
+
mode: "semantic",
|
|
441
|
+
name: "Company Theme Fit",
|
|
442
|
+
description: "Assess how a company fits graph themes.",
|
|
443
|
+
prompt: "Assess how {input} fits the graph's themes and where the fit is weak or uncertain.",
|
|
444
|
+
inputType: "company",
|
|
445
|
+
highlightStrategy: "fit"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: "company-comparison",
|
|
449
|
+
categoryId: "prep",
|
|
450
|
+
mode: "semantic",
|
|
451
|
+
name: "Company Comparison",
|
|
452
|
+
description: "Compare companies through graph context.",
|
|
453
|
+
prompt: "Compare {input} using graph beliefs, evidence, risks, and open questions.",
|
|
454
|
+
inputType: "company-list",
|
|
455
|
+
highlightStrategy: "comparison"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "questions-to-ask",
|
|
459
|
+
categoryId: "prep",
|
|
460
|
+
mode: "operational",
|
|
461
|
+
name: "Questions to Ask",
|
|
462
|
+
description: "Generate high-signal questions from graph gaps.",
|
|
463
|
+
prompt: "Generate the highest-signal questions to ask next, grounded in current graph gaps.",
|
|
464
|
+
highlightStrategy: "questions"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: "beliefs-to-test",
|
|
468
|
+
categoryId: "prep",
|
|
469
|
+
mode: "stress",
|
|
470
|
+
name: "Beliefs to Test",
|
|
471
|
+
description: "Prioritize beliefs that should be tested next.",
|
|
472
|
+
prompt: "Prioritize the beliefs that should be tested next and explain the cheapest test for each.",
|
|
473
|
+
highlightStrategy: "tests",
|
|
474
|
+
riskLevel: "medium"
|
|
475
|
+
}
|
|
476
|
+
];
|
|
477
|
+
GRAPH_INTELLIGENCE_QUERIES.map((query) => {
|
|
478
|
+
const definition = query;
|
|
479
|
+
return {
|
|
480
|
+
...definition,
|
|
481
|
+
tools: definition.tools ?? byMode(definition.mode)
|
|
482
|
+
};
|
|
483
|
+
});
|
|
484
|
+
|
|
4
485
|
// ../contracts/src/events.contract.ts
|
|
5
486
|
var WEBHOOK_MAX_ATTEMPTS = 5;
|
|
6
487
|
var WEBHOOK_RETRY_DELAYS_MS = [1e3, 5e3, 3e4, 3e5];
|
|
@@ -21,7 +502,10 @@ function idOf(table) {
|
|
|
21
502
|
return schema;
|
|
22
503
|
}
|
|
23
504
|
var NODE_TYPE = z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
|
|
24
|
-
var
|
|
505
|
+
var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
|
|
506
|
+
var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
|
|
507
|
+
z.enum(EDGE_TYPE_VALUES);
|
|
508
|
+
var STORAGE_EDGE_TYPE = z.enum(STORAGE_EDGE_TYPE_VALUES);
|
|
25
509
|
var TOPIC_STATUS = z.enum(["active", "archived", "watching"]);
|
|
26
510
|
var TOPIC_VISIBILITY = z.enum(["private", "team", "firm", "external", "public"]);
|
|
27
511
|
defineTable({
|
|
@@ -1506,7 +1990,7 @@ defineTable({
|
|
|
1506
1990
|
"toNodeId": z.string().optional(),
|
|
1507
1991
|
"sourceGlobalId": z.string().optional(),
|
|
1508
1992
|
"targetGlobalId": z.string().optional(),
|
|
1509
|
-
"edgeType":
|
|
1993
|
+
"edgeType": STORAGE_EDGE_TYPE,
|
|
1510
1994
|
"edgeTier": z.string().optional(),
|
|
1511
1995
|
"domainNamespace": z.string().optional(),
|
|
1512
1996
|
"constraint": z.string().optional(),
|
|
@@ -4277,6 +4761,128 @@ var edgePolicyManifest = {
|
|
|
4277
4761
|
}
|
|
4278
4762
|
]
|
|
4279
4763
|
};
|
|
4764
|
+
|
|
4765
|
+
// ../contracts/src/tenant-client.contract.ts
|
|
4766
|
+
var TENANT_CLIENT_INSTALLABLE_PACKAGES = [
|
|
4767
|
+
{
|
|
4768
|
+
packageName: "@lucern/access-control",
|
|
4769
|
+
role: "runtime_entrypoint",
|
|
4770
|
+
directTenantImport: true
|
|
4771
|
+
},
|
|
4772
|
+
{
|
|
4773
|
+
packageName: "@lucern/agent",
|
|
4774
|
+
role: "platform_runtime",
|
|
4775
|
+
directTenantImport: false
|
|
4776
|
+
},
|
|
4777
|
+
{
|
|
4778
|
+
packageName: "@lucern/auth",
|
|
4779
|
+
role: "sdk_dependency",
|
|
4780
|
+
directTenantImport: false
|
|
4781
|
+
},
|
|
4782
|
+
{
|
|
4783
|
+
packageName: "@lucern/cli",
|
|
4784
|
+
role: "developer_tool",
|
|
4785
|
+
directTenantImport: false
|
|
4786
|
+
},
|
|
4787
|
+
{
|
|
4788
|
+
packageName: "@lucern/client-core",
|
|
4789
|
+
role: "sdk_dependency",
|
|
4790
|
+
directTenantImport: false
|
|
4791
|
+
},
|
|
4792
|
+
{
|
|
4793
|
+
packageName: "@lucern/confidence",
|
|
4794
|
+
role: "sdk_dependency",
|
|
4795
|
+
directTenantImport: false
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
packageName: "@lucern/config",
|
|
4799
|
+
role: "configuration",
|
|
4800
|
+
directTenantImport: false
|
|
4801
|
+
},
|
|
4802
|
+
{
|
|
4803
|
+
packageName: "@lucern/contracts",
|
|
4804
|
+
role: "contract_entrypoint",
|
|
4805
|
+
directTenantImport: true
|
|
4806
|
+
},
|
|
4807
|
+
{
|
|
4808
|
+
packageName: "@lucern/control-plane",
|
|
4809
|
+
role: "platform_runtime",
|
|
4810
|
+
directTenantImport: false
|
|
4811
|
+
},
|
|
4812
|
+
{
|
|
4813
|
+
packageName: "@lucern/developer-kit",
|
|
4814
|
+
role: "developer_tool",
|
|
4815
|
+
directTenantImport: false
|
|
4816
|
+
},
|
|
4817
|
+
{
|
|
4818
|
+
packageName: "@lucern/events",
|
|
4819
|
+
role: "sdk_dependency",
|
|
4820
|
+
directTenantImport: false
|
|
4821
|
+
},
|
|
4822
|
+
{
|
|
4823
|
+
packageName: "@lucern/graph-primitives",
|
|
4824
|
+
role: "sdk_dependency",
|
|
4825
|
+
directTenantImport: false
|
|
4826
|
+
},
|
|
4827
|
+
{
|
|
4828
|
+
packageName: "@lucern/identity",
|
|
4829
|
+
role: "component_runtime",
|
|
4830
|
+
directTenantImport: false
|
|
4831
|
+
},
|
|
4832
|
+
{
|
|
4833
|
+
packageName: "@lucern/mcp",
|
|
4834
|
+
role: "runtime_entrypoint",
|
|
4835
|
+
directTenantImport: true
|
|
4836
|
+
},
|
|
4837
|
+
{
|
|
4838
|
+
packageName: "@lucern/pack-host",
|
|
4839
|
+
role: "platform_runtime",
|
|
4840
|
+
directTenantImport: false
|
|
4841
|
+
},
|
|
4842
|
+
{
|
|
4843
|
+
packageName: "@lucern/pack-installer",
|
|
4844
|
+
role: "developer_tool",
|
|
4845
|
+
directTenantImport: false
|
|
4846
|
+
},
|
|
4847
|
+
{
|
|
4848
|
+
packageName: "@lucern/proof-compiler",
|
|
4849
|
+
role: "developer_tool",
|
|
4850
|
+
directTenantImport: false
|
|
4851
|
+
},
|
|
4852
|
+
{
|
|
4853
|
+
packageName: "@lucern/react",
|
|
4854
|
+
role: "runtime_entrypoint",
|
|
4855
|
+
directTenantImport: true
|
|
4856
|
+
},
|
|
4857
|
+
{
|
|
4858
|
+
packageName: "@lucern/reasoning-kernel",
|
|
4859
|
+
role: "component_runtime",
|
|
4860
|
+
directTenantImport: false
|
|
4861
|
+
},
|
|
4862
|
+
{
|
|
4863
|
+
packageName: "@lucern/sdk",
|
|
4864
|
+
role: "runtime_entrypoint",
|
|
4865
|
+
directTenantImport: true
|
|
4866
|
+
},
|
|
4867
|
+
{
|
|
4868
|
+
packageName: "@lucern/server-core",
|
|
4869
|
+
role: "platform_runtime",
|
|
4870
|
+
directTenantImport: false
|
|
4871
|
+
},
|
|
4872
|
+
{
|
|
4873
|
+
packageName: "@lucern/testing",
|
|
4874
|
+
role: "test_support",
|
|
4875
|
+
directTenantImport: false
|
|
4876
|
+
},
|
|
4877
|
+
{
|
|
4878
|
+
packageName: "@lucern/types",
|
|
4879
|
+
role: "contract_entrypoint",
|
|
4880
|
+
directTenantImport: true
|
|
4881
|
+
}
|
|
4882
|
+
];
|
|
4883
|
+
TENANT_CLIENT_INSTALLABLE_PACKAGES.map(
|
|
4884
|
+
(entry) => entry.packageName
|
|
4885
|
+
);
|
|
4280
4886
|
z.object({
|
|
4281
4887
|
manifestVersion: z.literal("1.0.0"),
|
|
4282
4888
|
rules: z.array(
|
|
@@ -5762,6 +6368,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
|
|
|
5762
6368
|
ontologyPrimitive: "graph",
|
|
5763
6369
|
tier: "showcase"
|
|
5764
6370
|
};
|
|
6371
|
+
var LIST_GRAPH_INTELLIGENCE_QUERIES = {
|
|
6372
|
+
name: "list_graph_intelligence_queries",
|
|
6373
|
+
description: "List the Graph Intelligence query catalog that powers structural graph analysis experiences. Returns categories, query IDs, prompt templates, modes, and the public tool plan each query can use.",
|
|
6374
|
+
parameters: {
|
|
6375
|
+
categoryId: {
|
|
6376
|
+
type: "string",
|
|
6377
|
+
description: "Optional category filter, such as problems or strategic"
|
|
6378
|
+
},
|
|
6379
|
+
mode: {
|
|
6380
|
+
type: "string",
|
|
6381
|
+
description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6382
|
+
}
|
|
6383
|
+
},
|
|
6384
|
+
required: [],
|
|
6385
|
+
response: {
|
|
6386
|
+
description: "Graph Intelligence query catalog and mode-to-tool mapping",
|
|
6387
|
+
fields: {
|
|
6388
|
+
categories: "array \u2014 query categories",
|
|
6389
|
+
queries: "array \u2014 query definitions with prompt templates and tools",
|
|
6390
|
+
quickQueries: "array \u2014 recommended one-click query presets",
|
|
6391
|
+
publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
|
|
6392
|
+
}
|
|
6393
|
+
},
|
|
6394
|
+
ownerModule: "graph-intelligence",
|
|
6395
|
+
ontologyPrimitive: "graph",
|
|
6396
|
+
tier: "showcase"
|
|
6397
|
+
};
|
|
6398
|
+
var RUN_GRAPH_INTELLIGENCE_QUERY = {
|
|
6399
|
+
name: "run_graph_intelligence_query",
|
|
6400
|
+
description: "Run a named Graph Intelligence query against a tenant topic graph. Returns the selected query, prompt, deterministic graph-analysis bundle, graph context, and public tool plan for model synthesis.",
|
|
6401
|
+
parameters: {
|
|
6402
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
6403
|
+
queryId: {
|
|
6404
|
+
type: "string",
|
|
6405
|
+
description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
|
|
6406
|
+
},
|
|
6407
|
+
prompt: {
|
|
6408
|
+
type: "string",
|
|
6409
|
+
description: "Optional custom prompt for custom analysis runs"
|
|
6410
|
+
},
|
|
6411
|
+
input: {
|
|
6412
|
+
type: "string",
|
|
6413
|
+
description: "Optional entity, theme, belief, company, or search text for input-driven queries"
|
|
6414
|
+
},
|
|
6415
|
+
mode: {
|
|
6416
|
+
type: "string",
|
|
6417
|
+
description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6418
|
+
},
|
|
6419
|
+
limit: {
|
|
6420
|
+
type: "number",
|
|
6421
|
+
description: "Maximum graph context rows to return"
|
|
6422
|
+
}
|
|
6423
|
+
},
|
|
6424
|
+
required: ["topicId"],
|
|
6425
|
+
response: {
|
|
6426
|
+
description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
|
|
6427
|
+
fields: {
|
|
6428
|
+
query: "object \u2014 selected query definition",
|
|
6429
|
+
prompt: "string \u2014 resolved prompt template",
|
|
6430
|
+
toolPlan: "array \u2014 public tools and args the model can call next",
|
|
6431
|
+
analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
|
|
6432
|
+
context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
|
|
6433
|
+
}
|
|
6434
|
+
},
|
|
6435
|
+
ownerModule: "graph-intelligence",
|
|
6436
|
+
ontologyPrimitive: "graph",
|
|
6437
|
+
tier: "showcase"
|
|
6438
|
+
};
|
|
5765
6439
|
var GET_FALSIFICATION_QUESTIONS = {
|
|
5766
6440
|
name: "get_falsification_questions",
|
|
5767
6441
|
description: "Generate Popperian falsification questions for beliefs. Like `git test` \u2014 identifies the questions most likely to disprove current beliefs. Karl Popper as a tool: surfaces what would need to be true to invalidate each belief.",
|
|
@@ -8337,6 +9011,8 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
8337
9011
|
// Graph intelligence (showcase)
|
|
8338
9012
|
detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
|
|
8339
9013
|
get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
|
|
9014
|
+
list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
|
|
9015
|
+
run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
|
|
8340
9016
|
get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
|
|
8341
9017
|
// Evidence operations (workhorse)
|
|
8342
9018
|
search_evidence: SEARCH_EVIDENCE,
|
|
@@ -8519,6 +9195,8 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
|
8519
9195
|
"traverse_graph",
|
|
8520
9196
|
"get_graph_neighborhood",
|
|
8521
9197
|
"get_graph_structure_analysis",
|
|
9198
|
+
"list_graph_intelligence_queries",
|
|
9199
|
+
"run_graph_intelligence_query",
|
|
8522
9200
|
"find_contradictions",
|
|
8523
9201
|
"flag_contradiction",
|
|
8524
9202
|
"detect_confirmation_bias",
|
|
@@ -11139,6 +11817,15 @@ var edgesContracts = [
|
|
|
11139
11817
|
args: queryLineageArgs
|
|
11140
11818
|
})
|
|
11141
11819
|
];
|
|
11820
|
+
var graphIntelligenceQueryModes = [
|
|
11821
|
+
"core",
|
|
11822
|
+
"bias",
|
|
11823
|
+
"stress",
|
|
11824
|
+
"operational",
|
|
11825
|
+
"alpha",
|
|
11826
|
+
"semantic",
|
|
11827
|
+
"evidence"
|
|
11828
|
+
];
|
|
11142
11829
|
var traversalLayerSchema = z.enum([
|
|
11143
11830
|
"L4",
|
|
11144
11831
|
"L3",
|
|
@@ -11172,6 +11859,22 @@ var graphNeighborhoodArgs = z.object({
|
|
|
11172
11859
|
topicId: z.string().optional().describe("Topic scope for edge lookup."),
|
|
11173
11860
|
limit: z.number().optional().describe("Maximum edges to return.")
|
|
11174
11861
|
});
|
|
11862
|
+
var graphIntelligenceModeSchema = z.enum([
|
|
11863
|
+
graphIntelligenceQueryModes[0],
|
|
11864
|
+
...graphIntelligenceQueryModes.slice(1)
|
|
11865
|
+
]);
|
|
11866
|
+
var graphIntelligenceCatalogArgs = z.object({
|
|
11867
|
+
categoryId: z.string().optional().describe("Optional query category filter."),
|
|
11868
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional Graph Intelligence query mode filter.")
|
|
11869
|
+
});
|
|
11870
|
+
var graphIntelligenceRunArgs = z.object({
|
|
11871
|
+
topicId: z.string().describe("Topic to analyze."),
|
|
11872
|
+
queryId: z.string().optional().describe("Catalog query ID to run, such as pre-mortem."),
|
|
11873
|
+
prompt: z.string().optional().describe("Custom prompt when queryId is omitted or overridden."),
|
|
11874
|
+
input: z.string().optional().describe("Optional entity, theme, belief, company, or search text."),
|
|
11875
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional query mode override for custom prompts."),
|
|
11876
|
+
limit: z.number().optional().describe("Maximum graph context rows to return.")
|
|
11877
|
+
});
|
|
11175
11878
|
var flagContradictionArgs = z.object({
|
|
11176
11879
|
beliefA: z.string().describe("First belief in tension."),
|
|
11177
11880
|
beliefB: z.string().describe("Second belief in tension."),
|
|
@@ -11277,6 +11980,38 @@ var graphContracts = [
|
|
|
11277
11980
|
kind: "query"
|
|
11278
11981
|
}
|
|
11279
11982
|
}),
|
|
11983
|
+
surfaceContract({
|
|
11984
|
+
name: "list_graph_intelligence_queries",
|
|
11985
|
+
kind: "query",
|
|
11986
|
+
domain: "graph",
|
|
11987
|
+
surfaceClass: "platform_public",
|
|
11988
|
+
path: "/graph-intelligence/queries",
|
|
11989
|
+
sdkNamespace: "graphAnalysis",
|
|
11990
|
+
sdkMethod: "listGraphIntelligenceQueries",
|
|
11991
|
+
summary: "List Graph Intelligence query catalog entries.",
|
|
11992
|
+
convex: {
|
|
11993
|
+
module: "contextCompiler",
|
|
11994
|
+
functionName: "listGraphIntelligenceQueries",
|
|
11995
|
+
kind: "query"
|
|
11996
|
+
},
|
|
11997
|
+
args: graphIntelligenceCatalogArgs
|
|
11998
|
+
}),
|
|
11999
|
+
surfaceContract({
|
|
12000
|
+
name: "run_graph_intelligence_query",
|
|
12001
|
+
kind: "query",
|
|
12002
|
+
domain: "graph",
|
|
12003
|
+
surfaceClass: "platform_public",
|
|
12004
|
+
path: "/graph-intelligence/run",
|
|
12005
|
+
sdkNamespace: "graphAnalysis",
|
|
12006
|
+
sdkMethod: "runGraphIntelligenceQuery",
|
|
12007
|
+
summary: "Run a Graph Intelligence query against a topic graph.",
|
|
12008
|
+
convex: {
|
|
12009
|
+
module: "contextCompiler",
|
|
12010
|
+
functionName: "runGraphIntelligenceQuery",
|
|
12011
|
+
kind: "query"
|
|
12012
|
+
},
|
|
12013
|
+
args: graphIntelligenceRunArgs
|
|
12014
|
+
}),
|
|
11280
12015
|
surfaceContract({
|
|
11281
12016
|
name: "find_contradictions",
|
|
11282
12017
|
kind: "query",
|