@lucern/events 0.3.0-alpha.4 → 0.3.0-alpha.5
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/index.js
CHANGED
|
@@ -26,6 +26,487 @@ function matchesAnyEventPattern(eventType, patterns) {
|
|
|
26
26
|
return patterns.some((pattern) => matchesEventPattern(eventType, pattern));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// ../contracts/src/graph-intelligence.contract.ts
|
|
30
|
+
var GRAPH_INTELLIGENCE_MODE_TOOL_NAMES = {
|
|
31
|
+
core: [
|
|
32
|
+
"get_graph_structure_analysis",
|
|
33
|
+
"get_topic_coverage",
|
|
34
|
+
"get_graph_gaps",
|
|
35
|
+
"list_beliefs",
|
|
36
|
+
"list_questions",
|
|
37
|
+
"search_evidence"
|
|
38
|
+
],
|
|
39
|
+
bias: [
|
|
40
|
+
"get_graph_structure_analysis",
|
|
41
|
+
"detect_confirmation_bias",
|
|
42
|
+
"find_contradictions",
|
|
43
|
+
"search_evidence",
|
|
44
|
+
"list_beliefs"
|
|
45
|
+
],
|
|
46
|
+
stress: [
|
|
47
|
+
"get_graph_structure_analysis",
|
|
48
|
+
"get_graph_gaps",
|
|
49
|
+
"find_contradictions",
|
|
50
|
+
"get_falsification_questions",
|
|
51
|
+
"list_beliefs",
|
|
52
|
+
"list_questions"
|
|
53
|
+
],
|
|
54
|
+
operational: [
|
|
55
|
+
"get_topic_coverage",
|
|
56
|
+
"get_graph_gaps",
|
|
57
|
+
"list_beliefs",
|
|
58
|
+
"list_questions",
|
|
59
|
+
"search_evidence"
|
|
60
|
+
],
|
|
61
|
+
alpha: [
|
|
62
|
+
"get_graph_structure_analysis",
|
|
63
|
+
"detect_confirmation_bias",
|
|
64
|
+
"find_contradictions",
|
|
65
|
+
"search_beliefs",
|
|
66
|
+
"search_evidence"
|
|
67
|
+
],
|
|
68
|
+
semantic: [
|
|
69
|
+
"get_graph_structure_analysis",
|
|
70
|
+
"search_beliefs",
|
|
71
|
+
"search_evidence",
|
|
72
|
+
"traverse_graph",
|
|
73
|
+
"query_lineage",
|
|
74
|
+
"get_graph_neighborhood"
|
|
75
|
+
],
|
|
76
|
+
evidence: [
|
|
77
|
+
"get_graph_structure_analysis",
|
|
78
|
+
"get_topic_coverage",
|
|
79
|
+
"search_evidence",
|
|
80
|
+
"get_falsification_questions",
|
|
81
|
+
"find_contradictions"
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
var byMode = (mode) => GRAPH_INTELLIGENCE_MODE_TOOL_NAMES[mode];
|
|
85
|
+
var GRAPH_INTELLIGENCE_QUERIES = [
|
|
86
|
+
{
|
|
87
|
+
id: "confirmation-bias",
|
|
88
|
+
categoryId: "problems",
|
|
89
|
+
mode: "bias",
|
|
90
|
+
name: "Find Confirmation Bias",
|
|
91
|
+
description: "Find beliefs supported mainly by confirming evidence.",
|
|
92
|
+
prompt: "Find beliefs where supporting evidence overwhelms challenging evidence. Prioritize high-conviction beliefs with few defeaters.",
|
|
93
|
+
highlightStrategy: "bias-risk",
|
|
94
|
+
riskLevel: "high"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "contradiction-map",
|
|
98
|
+
categoryId: "problems",
|
|
99
|
+
mode: "stress",
|
|
100
|
+
name: "Map Contradictions",
|
|
101
|
+
description: "Surface direct and indirect contradiction clusters.",
|
|
102
|
+
prompt: "Map the graph's contradiction clusters and explain which tensions matter most.",
|
|
103
|
+
highlightStrategy: "contradictions",
|
|
104
|
+
riskLevel: "high"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "weak-evidence",
|
|
108
|
+
categoryId: "problems",
|
|
109
|
+
mode: "stress",
|
|
110
|
+
name: "Weak Evidence Chains",
|
|
111
|
+
description: "Find important claims with thin or indirect evidence.",
|
|
112
|
+
prompt: "Find high-importance beliefs whose evidence support is thin, indirect, stale, or low quality.",
|
|
113
|
+
highlightStrategy: "weak-support",
|
|
114
|
+
riskLevel: "medium"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "single-source",
|
|
118
|
+
categoryId: "problems",
|
|
119
|
+
mode: "bias",
|
|
120
|
+
name: "Single-Source Risk",
|
|
121
|
+
description: "Find claims overly dependent on one source or source type.",
|
|
122
|
+
prompt: "Identify beliefs that rely on a single source, one methodology, or one repeated perspective.",
|
|
123
|
+
highlightStrategy: "source-concentration",
|
|
124
|
+
riskLevel: "medium"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "untested-assumptions",
|
|
128
|
+
categoryId: "problems",
|
|
129
|
+
mode: "stress",
|
|
130
|
+
name: "Untested Assumptions",
|
|
131
|
+
description: "Find load-bearing assumptions without falsification paths.",
|
|
132
|
+
prompt: "Find assumptions that appear load-bearing but do not have direct testing questions or falsification evidence.",
|
|
133
|
+
highlightStrategy: "untested",
|
|
134
|
+
riskLevel: "high"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "load-bearing-beliefs",
|
|
138
|
+
categoryId: "problems",
|
|
139
|
+
mode: "stress",
|
|
140
|
+
name: "Load-Bearing Beliefs",
|
|
141
|
+
description: "Find central beliefs whose failure would affect many claims.",
|
|
142
|
+
prompt: "Find the beliefs with the largest downstream impact if they are wrong.",
|
|
143
|
+
highlightStrategy: "load-bearing",
|
|
144
|
+
riskLevel: "high"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "cascade-analysis",
|
|
148
|
+
categoryId: "problems",
|
|
149
|
+
mode: "stress",
|
|
150
|
+
name: "Cascade Analysis",
|
|
151
|
+
description: "Trace what changes if a belief is weakened or invalidated.",
|
|
152
|
+
prompt: "Analyze likely downstream cascades if the most central or uncertain beliefs are weakened.",
|
|
153
|
+
highlightStrategy: "cascade",
|
|
154
|
+
riskLevel: "high"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "unanswered-questions",
|
|
158
|
+
categoryId: "gaps",
|
|
159
|
+
mode: "operational",
|
|
160
|
+
name: "Unanswered Questions",
|
|
161
|
+
description: "Find important open questions that block confidence.",
|
|
162
|
+
prompt: "Identify the most important unanswered questions and explain which beliefs they block.",
|
|
163
|
+
highlightStrategy: "open-questions"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: "thin-themes",
|
|
167
|
+
categoryId: "gaps",
|
|
168
|
+
mode: "operational",
|
|
169
|
+
name: "Thin Themes",
|
|
170
|
+
description: "Find topics with shallow belief or evidence coverage.",
|
|
171
|
+
prompt: "Find themes that look underdeveloped relative to their role in the graph.",
|
|
172
|
+
highlightStrategy: "thin-themes"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "missing-evidence",
|
|
176
|
+
categoryId: "gaps",
|
|
177
|
+
mode: "stress",
|
|
178
|
+
name: "Missing Evidence",
|
|
179
|
+
description: "Find beliefs that need specific missing evidence.",
|
|
180
|
+
prompt: "Find the most valuable missing evidence needed to strengthen or falsify the graph.",
|
|
181
|
+
highlightStrategy: "missing-evidence"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "isolated-clusters",
|
|
185
|
+
categoryId: "gaps",
|
|
186
|
+
mode: "operational",
|
|
187
|
+
name: "Isolated Clusters",
|
|
188
|
+
description: "Find clusters not connected to the broader graph.",
|
|
189
|
+
prompt: "Find isolated graph clusters and recommend bridge questions or bridge evidence.",
|
|
190
|
+
highlightStrategy: "isolated-clusters"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "source-contribution",
|
|
194
|
+
categoryId: "gaps",
|
|
195
|
+
mode: "evidence",
|
|
196
|
+
name: "Source Contribution",
|
|
197
|
+
description: "Assess how source mix shapes the graph.",
|
|
198
|
+
prompt: "Assess whether the source mix is balanced enough for the graph's strongest claims.",
|
|
199
|
+
highlightStrategy: "source-mix"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: "stale-beliefs",
|
|
203
|
+
categoryId: "gaps",
|
|
204
|
+
mode: "operational",
|
|
205
|
+
name: "Stale Beliefs",
|
|
206
|
+
description: "Find beliefs that need review because they are old or stale.",
|
|
207
|
+
prompt: "Find beliefs that should be revisited because they are stale, unsupported by recent evidence, or contradicted by newer context.",
|
|
208
|
+
highlightStrategy: "staleness"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: "assumption-pyramid",
|
|
212
|
+
categoryId: "reasoning",
|
|
213
|
+
mode: "operational",
|
|
214
|
+
name: "Assumption Pyramid",
|
|
215
|
+
description: "Show which conclusions rest on which assumptions.",
|
|
216
|
+
prompt: "Build an assumption pyramid from the graph: foundational assumptions, intermediate claims, and top-level conclusions.",
|
|
217
|
+
highlightStrategy: "assumptions"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "converging-evidence",
|
|
221
|
+
categoryId: "reasoning",
|
|
222
|
+
mode: "evidence",
|
|
223
|
+
name: "Converging Evidence",
|
|
224
|
+
description: "Find claims supported by independent evidence streams.",
|
|
225
|
+
prompt: "Find beliefs with genuinely independent converging evidence and explain why they are robust.",
|
|
226
|
+
highlightStrategy: "convergence"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "weakest-links",
|
|
230
|
+
categoryId: "reasoning",
|
|
231
|
+
mode: "stress",
|
|
232
|
+
name: "Weakest Links",
|
|
233
|
+
description: "Find the weakest links in important reasoning chains.",
|
|
234
|
+
prompt: "Find the weakest links in important reasoning chains and explain how to test them.",
|
|
235
|
+
highlightStrategy: "weak-links",
|
|
236
|
+
riskLevel: "medium"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "challenged-beliefs",
|
|
240
|
+
categoryId: "reasoning",
|
|
241
|
+
mode: "stress",
|
|
242
|
+
name: "Challenged Beliefs",
|
|
243
|
+
description: "Find beliefs with active challenges or defeaters.",
|
|
244
|
+
prompt: "Find beliefs with active challenges, contradiction edges, or unresolved defeaters.",
|
|
245
|
+
highlightStrategy: "challenged"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: "contrarian-map",
|
|
249
|
+
categoryId: "strategic",
|
|
250
|
+
mode: "alpha",
|
|
251
|
+
name: "Contrarian Map",
|
|
252
|
+
description: "Find non-consensus beliefs and where they are grounded.",
|
|
253
|
+
prompt: "Find the graph's strongest contrarian or non-consensus beliefs and explain their support.",
|
|
254
|
+
highlightStrategy: "contrarian"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: "irreversibility-audit",
|
|
258
|
+
categoryId: "strategic",
|
|
259
|
+
mode: "stress",
|
|
260
|
+
name: "Irreversibility Audit",
|
|
261
|
+
description: "Find irreversible bets and assumptions behind them.",
|
|
262
|
+
prompt: "Audit irreversible decisions or beliefs and identify what must be true before acting.",
|
|
263
|
+
highlightStrategy: "irreversible",
|
|
264
|
+
riskLevel: "high"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "pre-mortem",
|
|
268
|
+
categoryId: "strategic",
|
|
269
|
+
mode: "stress",
|
|
270
|
+
name: "Pre-Mortem",
|
|
271
|
+
description: "Explain how the graph could be wrong.",
|
|
272
|
+
prompt: "Run a pre-mortem: assume the current thesis fails and identify the most plausible failure paths.",
|
|
273
|
+
highlightStrategy: "failure-paths",
|
|
274
|
+
riskLevel: "high"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: "devils-advocate",
|
|
278
|
+
categoryId: "strategic",
|
|
279
|
+
mode: "stress",
|
|
280
|
+
name: "Devil's Advocate",
|
|
281
|
+
description: "Generate the strongest critique of the graph.",
|
|
282
|
+
prompt: "Produce the strongest evidence-grounded critique of the current graph and its main thesis.",
|
|
283
|
+
highlightStrategy: "critique"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: "falsification-map",
|
|
287
|
+
categoryId: "strategic",
|
|
288
|
+
mode: "stress",
|
|
289
|
+
name: "Falsification Map",
|
|
290
|
+
description: "Find the cheapest tests that would disprove key beliefs.",
|
|
291
|
+
prompt: "Map the cheapest, clearest falsification tests for the graph's key claims.",
|
|
292
|
+
highlightStrategy: "falsification",
|
|
293
|
+
riskLevel: "high"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
id: "prediction-tracker",
|
|
297
|
+
categoryId: "strategic",
|
|
298
|
+
mode: "evidence",
|
|
299
|
+
name: "Prediction Tracker",
|
|
300
|
+
description: "Find beliefs that imply measurable predictions.",
|
|
301
|
+
prompt: "Find beliefs that imply measurable predictions and suggest tracking signals.",
|
|
302
|
+
highlightStrategy: "predictions"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "belief-pagerank",
|
|
306
|
+
categoryId: "deep",
|
|
307
|
+
mode: "semantic",
|
|
308
|
+
name: "Belief PageRank",
|
|
309
|
+
description: "Identify structurally central beliefs.",
|
|
310
|
+
prompt: "Use graph centrality to identify the most structurally important beliefs.",
|
|
311
|
+
highlightStrategy: "centrality"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
id: "underdetermination",
|
|
315
|
+
categoryId: "deep",
|
|
316
|
+
mode: "semantic",
|
|
317
|
+
name: "Underdetermination",
|
|
318
|
+
description: "Find places where evidence supports multiple explanations.",
|
|
319
|
+
prompt: "Find places where the same evidence could support multiple incompatible explanations.",
|
|
320
|
+
highlightStrategy: "underdetermination"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: "confidence-propagation",
|
|
324
|
+
categoryId: "deep",
|
|
325
|
+
mode: "semantic",
|
|
326
|
+
name: "Confidence Propagation",
|
|
327
|
+
description: "Assess how uncertainty moves through the graph.",
|
|
328
|
+
prompt: "Explain how uncertainty propagates from weak or contested beliefs through downstream conclusions.",
|
|
329
|
+
highlightStrategy: "confidence-flow"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: "argument-depth",
|
|
333
|
+
categoryId: "deep",
|
|
334
|
+
mode: "evidence",
|
|
335
|
+
name: "Argument Depth",
|
|
336
|
+
description: "Assess reasoning depth and chain quality.",
|
|
337
|
+
prompt: "Assess reasoning depth: where claims are shallow, deeply supported, or overextended.",
|
|
338
|
+
highlightStrategy: "depth"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "information-edge",
|
|
342
|
+
categoryId: "deep",
|
|
343
|
+
mode: "alpha",
|
|
344
|
+
name: "Information Edge",
|
|
345
|
+
description: "Find differentiated evidence or signals.",
|
|
346
|
+
prompt: "Find evidence, sources, or beliefs that could represent differentiated information edge.",
|
|
347
|
+
highlightStrategy: "information-edge"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: "thesis-summary",
|
|
351
|
+
categoryId: "browse",
|
|
352
|
+
mode: "semantic",
|
|
353
|
+
name: "Thesis Summary",
|
|
354
|
+
description: "Summarize the graph's core thesis and support.",
|
|
355
|
+
prompt: "Summarize the graph's core thesis, strongest support, weakest support, and open questions.",
|
|
356
|
+
highlightStrategy: "summary"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "theme-deep-dive",
|
|
360
|
+
categoryId: "browse",
|
|
361
|
+
mode: "semantic",
|
|
362
|
+
name: "Theme Deep Dive",
|
|
363
|
+
description: "Deep dive into a named theme.",
|
|
364
|
+
prompt: "Deep dive into {input}. Explain the key beliefs, evidence, contradictions, and open questions.",
|
|
365
|
+
inputType: "theme",
|
|
366
|
+
highlightStrategy: "theme"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: "belief-detail",
|
|
370
|
+
categoryId: "browse",
|
|
371
|
+
mode: "semantic",
|
|
372
|
+
name: "Belief Detail",
|
|
373
|
+
description: "Explain one belief and its graph neighborhood.",
|
|
374
|
+
prompt: "Explain {input} and its support, challenges, related beliefs, and downstream implications.",
|
|
375
|
+
inputType: "belief",
|
|
376
|
+
highlightStrategy: "belief"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: "strongest-beliefs",
|
|
380
|
+
categoryId: "browse",
|
|
381
|
+
mode: "operational",
|
|
382
|
+
name: "Strongest Beliefs",
|
|
383
|
+
description: "Find the graph's strongest current beliefs.",
|
|
384
|
+
prompt: "Find the strongest current beliefs and explain why each one deserves confidence.",
|
|
385
|
+
highlightStrategy: "strongest"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: "cross-theme-connection",
|
|
389
|
+
categoryId: "browse",
|
|
390
|
+
mode: "semantic",
|
|
391
|
+
name: "Cross-Theme Connections",
|
|
392
|
+
description: "Find bridges between themes.",
|
|
393
|
+
prompt: "Find meaningful connections across themes and explain which bridge beliefs matter.",
|
|
394
|
+
highlightStrategy: "bridges"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
id: "research-velocity",
|
|
398
|
+
categoryId: "browse",
|
|
399
|
+
mode: "operational",
|
|
400
|
+
name: "Research Velocity",
|
|
401
|
+
description: "Summarize recent graph movement and momentum.",
|
|
402
|
+
prompt: "Assess research velocity: what changed recently, where progress is fastest, and what is stuck.",
|
|
403
|
+
highlightStrategy: "velocity"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
id: "search",
|
|
407
|
+
categoryId: "browse",
|
|
408
|
+
mode: "semantic",
|
|
409
|
+
name: "Graph Search",
|
|
410
|
+
description: "Search the graph with semantic context.",
|
|
411
|
+
prompt: "Search the graph for {input}. Return the most relevant beliefs, evidence, and questions.",
|
|
412
|
+
inputType: "search",
|
|
413
|
+
highlightStrategy: "search"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: "expert-coverage",
|
|
417
|
+
categoryId: "browse",
|
|
418
|
+
mode: "semantic",
|
|
419
|
+
name: "Expert Coverage",
|
|
420
|
+
description: "Assess coverage from expert/source perspectives.",
|
|
421
|
+
prompt: "Assess whether the graph has enough expert, primary, and dissenting coverage.",
|
|
422
|
+
highlightStrategy: "expert-coverage"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "value-chain-map",
|
|
426
|
+
categoryId: "browse",
|
|
427
|
+
mode: "semantic",
|
|
428
|
+
name: "Value Chain Map",
|
|
429
|
+
description: "Map entities, dependencies, and value-chain logic.",
|
|
430
|
+
prompt: "Map the value chain implied by this graph: entities, dependencies, pressure points, and missing links.",
|
|
431
|
+
highlightStrategy: "value-chain"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: "meeting-brief",
|
|
435
|
+
categoryId: "prep",
|
|
436
|
+
mode: "semantic",
|
|
437
|
+
name: "Meeting Brief",
|
|
438
|
+
description: "Prepare a meeting brief from graph context.",
|
|
439
|
+
prompt: "Prepare a concise meeting brief using the graph: thesis, open questions, risks, and recommended asks.",
|
|
440
|
+
highlightStrategy: "brief"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
id: "open-questions-entity",
|
|
444
|
+
categoryId: "prep",
|
|
445
|
+
mode: "semantic",
|
|
446
|
+
name: "Entity Open Questions",
|
|
447
|
+
description: "Find open questions about a specific entity.",
|
|
448
|
+
prompt: "Find the most important open questions about {input} and the beliefs those questions would unlock.",
|
|
449
|
+
inputType: "entity",
|
|
450
|
+
highlightStrategy: "entity-questions"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
id: "company-context",
|
|
454
|
+
categoryId: "prep",
|
|
455
|
+
mode: "semantic",
|
|
456
|
+
name: "Company Context",
|
|
457
|
+
description: "Summarize graph context about a company.",
|
|
458
|
+
prompt: "Summarize what the graph knows about {input}: thesis relevance, evidence, risks, and open questions.",
|
|
459
|
+
inputType: "company",
|
|
460
|
+
highlightStrategy: "company"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
id: "company-theme-fit",
|
|
464
|
+
categoryId: "prep",
|
|
465
|
+
mode: "semantic",
|
|
466
|
+
name: "Company Theme Fit",
|
|
467
|
+
description: "Assess how a company fits graph themes.",
|
|
468
|
+
prompt: "Assess how {input} fits the graph's themes and where the fit is weak or uncertain.",
|
|
469
|
+
inputType: "company",
|
|
470
|
+
highlightStrategy: "fit"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: "company-comparison",
|
|
474
|
+
categoryId: "prep",
|
|
475
|
+
mode: "semantic",
|
|
476
|
+
name: "Company Comparison",
|
|
477
|
+
description: "Compare companies through graph context.",
|
|
478
|
+
prompt: "Compare {input} using graph beliefs, evidence, risks, and open questions.",
|
|
479
|
+
inputType: "company-list",
|
|
480
|
+
highlightStrategy: "comparison"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: "questions-to-ask",
|
|
484
|
+
categoryId: "prep",
|
|
485
|
+
mode: "operational",
|
|
486
|
+
name: "Questions to Ask",
|
|
487
|
+
description: "Generate high-signal questions from graph gaps.",
|
|
488
|
+
prompt: "Generate the highest-signal questions to ask next, grounded in current graph gaps.",
|
|
489
|
+
highlightStrategy: "questions"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: "beliefs-to-test",
|
|
493
|
+
categoryId: "prep",
|
|
494
|
+
mode: "stress",
|
|
495
|
+
name: "Beliefs to Test",
|
|
496
|
+
description: "Prioritize beliefs that should be tested next.",
|
|
497
|
+
prompt: "Prioritize the beliefs that should be tested next and explain the cheapest test for each.",
|
|
498
|
+
highlightStrategy: "tests",
|
|
499
|
+
riskLevel: "medium"
|
|
500
|
+
}
|
|
501
|
+
];
|
|
502
|
+
GRAPH_INTELLIGENCE_QUERIES.map((query) => {
|
|
503
|
+
const definition = query;
|
|
504
|
+
return {
|
|
505
|
+
...definition,
|
|
506
|
+
tools: definition.tools ?? byMode(definition.mode)
|
|
507
|
+
};
|
|
508
|
+
});
|
|
509
|
+
|
|
29
510
|
// ../contracts/src/events.contract.ts
|
|
30
511
|
var DOMAIN_EVENT_VERSION = "1.0";
|
|
31
512
|
var EVENT_RETENTION_DEFAULT_DAYS = 30;
|
|
@@ -176,7 +657,10 @@ function idOf(table) {
|
|
|
176
657
|
return schema;
|
|
177
658
|
}
|
|
178
659
|
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"]);
|
|
179
|
-
var
|
|
660
|
+
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"];
|
|
661
|
+
var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
|
|
662
|
+
z.enum(EDGE_TYPE_VALUES);
|
|
663
|
+
var STORAGE_EDGE_TYPE = z.enum(STORAGE_EDGE_TYPE_VALUES);
|
|
180
664
|
var TOPIC_STATUS = z.enum(["active", "archived", "watching"]);
|
|
181
665
|
var TOPIC_VISIBILITY = z.enum(["private", "team", "firm", "external", "public"]);
|
|
182
666
|
defineTable({
|
|
@@ -1661,7 +2145,7 @@ defineTable({
|
|
|
1661
2145
|
"toNodeId": z.string().optional(),
|
|
1662
2146
|
"sourceGlobalId": z.string().optional(),
|
|
1663
2147
|
"targetGlobalId": z.string().optional(),
|
|
1664
|
-
"edgeType":
|
|
2148
|
+
"edgeType": STORAGE_EDGE_TYPE,
|
|
1665
2149
|
"edgeTier": z.string().optional(),
|
|
1666
2150
|
"domainNamespace": z.string().optional(),
|
|
1667
2151
|
"constraint": z.string().optional(),
|
|
@@ -4432,6 +4916,128 @@ var edgePolicyManifest = {
|
|
|
4432
4916
|
}
|
|
4433
4917
|
]
|
|
4434
4918
|
};
|
|
4919
|
+
|
|
4920
|
+
// ../contracts/src/tenant-client.contract.ts
|
|
4921
|
+
var TENANT_CLIENT_INSTALLABLE_PACKAGES = [
|
|
4922
|
+
{
|
|
4923
|
+
packageName: "@lucern/access-control",
|
|
4924
|
+
role: "runtime_entrypoint",
|
|
4925
|
+
directTenantImport: true
|
|
4926
|
+
},
|
|
4927
|
+
{
|
|
4928
|
+
packageName: "@lucern/agent",
|
|
4929
|
+
role: "platform_runtime",
|
|
4930
|
+
directTenantImport: false
|
|
4931
|
+
},
|
|
4932
|
+
{
|
|
4933
|
+
packageName: "@lucern/auth",
|
|
4934
|
+
role: "sdk_dependency",
|
|
4935
|
+
directTenantImport: false
|
|
4936
|
+
},
|
|
4937
|
+
{
|
|
4938
|
+
packageName: "@lucern/cli",
|
|
4939
|
+
role: "developer_tool",
|
|
4940
|
+
directTenantImport: false
|
|
4941
|
+
},
|
|
4942
|
+
{
|
|
4943
|
+
packageName: "@lucern/client-core",
|
|
4944
|
+
role: "sdk_dependency",
|
|
4945
|
+
directTenantImport: false
|
|
4946
|
+
},
|
|
4947
|
+
{
|
|
4948
|
+
packageName: "@lucern/confidence",
|
|
4949
|
+
role: "sdk_dependency",
|
|
4950
|
+
directTenantImport: false
|
|
4951
|
+
},
|
|
4952
|
+
{
|
|
4953
|
+
packageName: "@lucern/config",
|
|
4954
|
+
role: "configuration",
|
|
4955
|
+
directTenantImport: false
|
|
4956
|
+
},
|
|
4957
|
+
{
|
|
4958
|
+
packageName: "@lucern/contracts",
|
|
4959
|
+
role: "contract_entrypoint",
|
|
4960
|
+
directTenantImport: true
|
|
4961
|
+
},
|
|
4962
|
+
{
|
|
4963
|
+
packageName: "@lucern/control-plane",
|
|
4964
|
+
role: "platform_runtime",
|
|
4965
|
+
directTenantImport: false
|
|
4966
|
+
},
|
|
4967
|
+
{
|
|
4968
|
+
packageName: "@lucern/developer-kit",
|
|
4969
|
+
role: "developer_tool",
|
|
4970
|
+
directTenantImport: false
|
|
4971
|
+
},
|
|
4972
|
+
{
|
|
4973
|
+
packageName: "@lucern/events",
|
|
4974
|
+
role: "sdk_dependency",
|
|
4975
|
+
directTenantImport: false
|
|
4976
|
+
},
|
|
4977
|
+
{
|
|
4978
|
+
packageName: "@lucern/graph-primitives",
|
|
4979
|
+
role: "sdk_dependency",
|
|
4980
|
+
directTenantImport: false
|
|
4981
|
+
},
|
|
4982
|
+
{
|
|
4983
|
+
packageName: "@lucern/identity",
|
|
4984
|
+
role: "component_runtime",
|
|
4985
|
+
directTenantImport: false
|
|
4986
|
+
},
|
|
4987
|
+
{
|
|
4988
|
+
packageName: "@lucern/mcp",
|
|
4989
|
+
role: "runtime_entrypoint",
|
|
4990
|
+
directTenantImport: true
|
|
4991
|
+
},
|
|
4992
|
+
{
|
|
4993
|
+
packageName: "@lucern/pack-host",
|
|
4994
|
+
role: "platform_runtime",
|
|
4995
|
+
directTenantImport: false
|
|
4996
|
+
},
|
|
4997
|
+
{
|
|
4998
|
+
packageName: "@lucern/pack-installer",
|
|
4999
|
+
role: "developer_tool",
|
|
5000
|
+
directTenantImport: false
|
|
5001
|
+
},
|
|
5002
|
+
{
|
|
5003
|
+
packageName: "@lucern/proof-compiler",
|
|
5004
|
+
role: "developer_tool",
|
|
5005
|
+
directTenantImport: false
|
|
5006
|
+
},
|
|
5007
|
+
{
|
|
5008
|
+
packageName: "@lucern/react",
|
|
5009
|
+
role: "runtime_entrypoint",
|
|
5010
|
+
directTenantImport: true
|
|
5011
|
+
},
|
|
5012
|
+
{
|
|
5013
|
+
packageName: "@lucern/reasoning-kernel",
|
|
5014
|
+
role: "component_runtime",
|
|
5015
|
+
directTenantImport: false
|
|
5016
|
+
},
|
|
5017
|
+
{
|
|
5018
|
+
packageName: "@lucern/sdk",
|
|
5019
|
+
role: "runtime_entrypoint",
|
|
5020
|
+
directTenantImport: true
|
|
5021
|
+
},
|
|
5022
|
+
{
|
|
5023
|
+
packageName: "@lucern/server-core",
|
|
5024
|
+
role: "platform_runtime",
|
|
5025
|
+
directTenantImport: false
|
|
5026
|
+
},
|
|
5027
|
+
{
|
|
5028
|
+
packageName: "@lucern/testing",
|
|
5029
|
+
role: "test_support",
|
|
5030
|
+
directTenantImport: false
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
packageName: "@lucern/types",
|
|
5034
|
+
role: "contract_entrypoint",
|
|
5035
|
+
directTenantImport: true
|
|
5036
|
+
}
|
|
5037
|
+
];
|
|
5038
|
+
TENANT_CLIENT_INSTALLABLE_PACKAGES.map(
|
|
5039
|
+
(entry) => entry.packageName
|
|
5040
|
+
);
|
|
4435
5041
|
z.object({
|
|
4436
5042
|
manifestVersion: z.literal("1.0.0"),
|
|
4437
5043
|
rules: z.array(
|
|
@@ -5917,6 +6523,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
|
|
|
5917
6523
|
ontologyPrimitive: "graph",
|
|
5918
6524
|
tier: "showcase"
|
|
5919
6525
|
};
|
|
6526
|
+
var LIST_GRAPH_INTELLIGENCE_QUERIES = {
|
|
6527
|
+
name: "list_graph_intelligence_queries",
|
|
6528
|
+
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.",
|
|
6529
|
+
parameters: {
|
|
6530
|
+
categoryId: {
|
|
6531
|
+
type: "string",
|
|
6532
|
+
description: "Optional category filter, such as problems or strategic"
|
|
6533
|
+
},
|
|
6534
|
+
mode: {
|
|
6535
|
+
type: "string",
|
|
6536
|
+
description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6537
|
+
}
|
|
6538
|
+
},
|
|
6539
|
+
required: [],
|
|
6540
|
+
response: {
|
|
6541
|
+
description: "Graph Intelligence query catalog and mode-to-tool mapping",
|
|
6542
|
+
fields: {
|
|
6543
|
+
categories: "array \u2014 query categories",
|
|
6544
|
+
queries: "array \u2014 query definitions with prompt templates and tools",
|
|
6545
|
+
quickQueries: "array \u2014 recommended one-click query presets",
|
|
6546
|
+
publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
|
|
6547
|
+
}
|
|
6548
|
+
},
|
|
6549
|
+
ownerModule: "graph-intelligence",
|
|
6550
|
+
ontologyPrimitive: "graph",
|
|
6551
|
+
tier: "showcase"
|
|
6552
|
+
};
|
|
6553
|
+
var RUN_GRAPH_INTELLIGENCE_QUERY = {
|
|
6554
|
+
name: "run_graph_intelligence_query",
|
|
6555
|
+
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.",
|
|
6556
|
+
parameters: {
|
|
6557
|
+
topicId: { type: "string", description: "Topic to analyze" },
|
|
6558
|
+
queryId: {
|
|
6559
|
+
type: "string",
|
|
6560
|
+
description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
|
|
6561
|
+
},
|
|
6562
|
+
prompt: {
|
|
6563
|
+
type: "string",
|
|
6564
|
+
description: "Optional custom prompt for custom analysis runs"
|
|
6565
|
+
},
|
|
6566
|
+
input: {
|
|
6567
|
+
type: "string",
|
|
6568
|
+
description: "Optional entity, theme, belief, company, or search text for input-driven queries"
|
|
6569
|
+
},
|
|
6570
|
+
mode: {
|
|
6571
|
+
type: "string",
|
|
6572
|
+
description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
|
|
6573
|
+
},
|
|
6574
|
+
limit: {
|
|
6575
|
+
type: "number",
|
|
6576
|
+
description: "Maximum graph context rows to return"
|
|
6577
|
+
}
|
|
6578
|
+
},
|
|
6579
|
+
required: ["topicId"],
|
|
6580
|
+
response: {
|
|
6581
|
+
description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
|
|
6582
|
+
fields: {
|
|
6583
|
+
query: "object \u2014 selected query definition",
|
|
6584
|
+
prompt: "string \u2014 resolved prompt template",
|
|
6585
|
+
toolPlan: "array \u2014 public tools and args the model can call next",
|
|
6586
|
+
analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
|
|
6587
|
+
context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
|
|
6588
|
+
}
|
|
6589
|
+
},
|
|
6590
|
+
ownerModule: "graph-intelligence",
|
|
6591
|
+
ontologyPrimitive: "graph",
|
|
6592
|
+
tier: "showcase"
|
|
6593
|
+
};
|
|
5920
6594
|
var GET_FALSIFICATION_QUESTIONS = {
|
|
5921
6595
|
name: "get_falsification_questions",
|
|
5922
6596
|
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.",
|
|
@@ -8492,6 +9166,8 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
8492
9166
|
// Graph intelligence (showcase)
|
|
8493
9167
|
detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
|
|
8494
9168
|
get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
|
|
9169
|
+
list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
|
|
9170
|
+
run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
|
|
8495
9171
|
get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
|
|
8496
9172
|
// Evidence operations (workhorse)
|
|
8497
9173
|
search_evidence: SEARCH_EVIDENCE,
|
|
@@ -8674,6 +9350,8 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
|
8674
9350
|
"traverse_graph",
|
|
8675
9351
|
"get_graph_neighborhood",
|
|
8676
9352
|
"get_graph_structure_analysis",
|
|
9353
|
+
"list_graph_intelligence_queries",
|
|
9354
|
+
"run_graph_intelligence_query",
|
|
8677
9355
|
"find_contradictions",
|
|
8678
9356
|
"flag_contradiction",
|
|
8679
9357
|
"detect_confirmation_bias",
|
|
@@ -11294,6 +11972,15 @@ var edgesContracts = [
|
|
|
11294
11972
|
args: queryLineageArgs
|
|
11295
11973
|
})
|
|
11296
11974
|
];
|
|
11975
|
+
var graphIntelligenceQueryModes = [
|
|
11976
|
+
"core",
|
|
11977
|
+
"bias",
|
|
11978
|
+
"stress",
|
|
11979
|
+
"operational",
|
|
11980
|
+
"alpha",
|
|
11981
|
+
"semantic",
|
|
11982
|
+
"evidence"
|
|
11983
|
+
];
|
|
11297
11984
|
var traversalLayerSchema = z.enum([
|
|
11298
11985
|
"L4",
|
|
11299
11986
|
"L3",
|
|
@@ -11327,6 +12014,22 @@ var graphNeighborhoodArgs = z.object({
|
|
|
11327
12014
|
topicId: z.string().optional().describe("Topic scope for edge lookup."),
|
|
11328
12015
|
limit: z.number().optional().describe("Maximum edges to return.")
|
|
11329
12016
|
});
|
|
12017
|
+
var graphIntelligenceModeSchema = z.enum([
|
|
12018
|
+
graphIntelligenceQueryModes[0],
|
|
12019
|
+
...graphIntelligenceQueryModes.slice(1)
|
|
12020
|
+
]);
|
|
12021
|
+
var graphIntelligenceCatalogArgs = z.object({
|
|
12022
|
+
categoryId: z.string().optional().describe("Optional query category filter."),
|
|
12023
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional Graph Intelligence query mode filter.")
|
|
12024
|
+
});
|
|
12025
|
+
var graphIntelligenceRunArgs = z.object({
|
|
12026
|
+
topicId: z.string().describe("Topic to analyze."),
|
|
12027
|
+
queryId: z.string().optional().describe("Catalog query ID to run, such as pre-mortem."),
|
|
12028
|
+
prompt: z.string().optional().describe("Custom prompt when queryId is omitted or overridden."),
|
|
12029
|
+
input: z.string().optional().describe("Optional entity, theme, belief, company, or search text."),
|
|
12030
|
+
mode: graphIntelligenceModeSchema.optional().describe("Optional query mode override for custom prompts."),
|
|
12031
|
+
limit: z.number().optional().describe("Maximum graph context rows to return.")
|
|
12032
|
+
});
|
|
11330
12033
|
var flagContradictionArgs = z.object({
|
|
11331
12034
|
beliefA: z.string().describe("First belief in tension."),
|
|
11332
12035
|
beliefB: z.string().describe("Second belief in tension."),
|
|
@@ -11432,6 +12135,38 @@ var graphContracts = [
|
|
|
11432
12135
|
kind: "query"
|
|
11433
12136
|
}
|
|
11434
12137
|
}),
|
|
12138
|
+
surfaceContract({
|
|
12139
|
+
name: "list_graph_intelligence_queries",
|
|
12140
|
+
kind: "query",
|
|
12141
|
+
domain: "graph",
|
|
12142
|
+
surfaceClass: "platform_public",
|
|
12143
|
+
path: "/graph-intelligence/queries",
|
|
12144
|
+
sdkNamespace: "graphAnalysis",
|
|
12145
|
+
sdkMethod: "listGraphIntelligenceQueries",
|
|
12146
|
+
summary: "List Graph Intelligence query catalog entries.",
|
|
12147
|
+
convex: {
|
|
12148
|
+
module: "contextCompiler",
|
|
12149
|
+
functionName: "listGraphIntelligenceQueries",
|
|
12150
|
+
kind: "query"
|
|
12151
|
+
},
|
|
12152
|
+
args: graphIntelligenceCatalogArgs
|
|
12153
|
+
}),
|
|
12154
|
+
surfaceContract({
|
|
12155
|
+
name: "run_graph_intelligence_query",
|
|
12156
|
+
kind: "query",
|
|
12157
|
+
domain: "graph",
|
|
12158
|
+
surfaceClass: "platform_public",
|
|
12159
|
+
path: "/graph-intelligence/run",
|
|
12160
|
+
sdkNamespace: "graphAnalysis",
|
|
12161
|
+
sdkMethod: "runGraphIntelligenceQuery",
|
|
12162
|
+
summary: "Run a Graph Intelligence query against a topic graph.",
|
|
12163
|
+
convex: {
|
|
12164
|
+
module: "contextCompiler",
|
|
12165
|
+
functionName: "runGraphIntelligenceQuery",
|
|
12166
|
+
kind: "query"
|
|
12167
|
+
},
|
|
12168
|
+
args: graphIntelligenceRunArgs
|
|
12169
|
+
}),
|
|
11435
12170
|
surfaceContract({
|
|
11436
12171
|
name: "find_contradictions",
|
|
11437
12172
|
kind: "query",
|