@lucern/mcp 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/gateway.js CHANGED
@@ -11,6 +11,487 @@ function requireActorPrincipalId(authContext) {
11
11
  }
12
12
  throw new Error("Access denied: federated principal context required.");
13
13
  }
14
+
15
+ // ../contracts/src/graph-intelligence.contract.ts
16
+ var GRAPH_INTELLIGENCE_MODE_TOOL_NAMES = {
17
+ core: [
18
+ "get_graph_structure_analysis",
19
+ "get_topic_coverage",
20
+ "get_graph_gaps",
21
+ "list_beliefs",
22
+ "list_questions",
23
+ "search_evidence"
24
+ ],
25
+ bias: [
26
+ "get_graph_structure_analysis",
27
+ "detect_confirmation_bias",
28
+ "find_contradictions",
29
+ "search_evidence",
30
+ "list_beliefs"
31
+ ],
32
+ stress: [
33
+ "get_graph_structure_analysis",
34
+ "get_graph_gaps",
35
+ "find_contradictions",
36
+ "get_falsification_questions",
37
+ "list_beliefs",
38
+ "list_questions"
39
+ ],
40
+ operational: [
41
+ "get_topic_coverage",
42
+ "get_graph_gaps",
43
+ "list_beliefs",
44
+ "list_questions",
45
+ "search_evidence"
46
+ ],
47
+ alpha: [
48
+ "get_graph_structure_analysis",
49
+ "detect_confirmation_bias",
50
+ "find_contradictions",
51
+ "search_beliefs",
52
+ "search_evidence"
53
+ ],
54
+ semantic: [
55
+ "get_graph_structure_analysis",
56
+ "search_beliefs",
57
+ "search_evidence",
58
+ "traverse_graph",
59
+ "query_lineage",
60
+ "get_graph_neighborhood"
61
+ ],
62
+ evidence: [
63
+ "get_graph_structure_analysis",
64
+ "get_topic_coverage",
65
+ "search_evidence",
66
+ "get_falsification_questions",
67
+ "find_contradictions"
68
+ ]
69
+ };
70
+ var byMode = (mode) => GRAPH_INTELLIGENCE_MODE_TOOL_NAMES[mode];
71
+ var GRAPH_INTELLIGENCE_QUERIES = [
72
+ {
73
+ id: "confirmation-bias",
74
+ categoryId: "problems",
75
+ mode: "bias",
76
+ name: "Find Confirmation Bias",
77
+ description: "Find beliefs supported mainly by confirming evidence.",
78
+ prompt: "Find beliefs where supporting evidence overwhelms challenging evidence. Prioritize high-conviction beliefs with few defeaters.",
79
+ highlightStrategy: "bias-risk",
80
+ riskLevel: "high"
81
+ },
82
+ {
83
+ id: "contradiction-map",
84
+ categoryId: "problems",
85
+ mode: "stress",
86
+ name: "Map Contradictions",
87
+ description: "Surface direct and indirect contradiction clusters.",
88
+ prompt: "Map the graph's contradiction clusters and explain which tensions matter most.",
89
+ highlightStrategy: "contradictions",
90
+ riskLevel: "high"
91
+ },
92
+ {
93
+ id: "weak-evidence",
94
+ categoryId: "problems",
95
+ mode: "stress",
96
+ name: "Weak Evidence Chains",
97
+ description: "Find important claims with thin or indirect evidence.",
98
+ prompt: "Find high-importance beliefs whose evidence support is thin, indirect, stale, or low quality.",
99
+ highlightStrategy: "weak-support",
100
+ riskLevel: "medium"
101
+ },
102
+ {
103
+ id: "single-source",
104
+ categoryId: "problems",
105
+ mode: "bias",
106
+ name: "Single-Source Risk",
107
+ description: "Find claims overly dependent on one source or source type.",
108
+ prompt: "Identify beliefs that rely on a single source, one methodology, or one repeated perspective.",
109
+ highlightStrategy: "source-concentration",
110
+ riskLevel: "medium"
111
+ },
112
+ {
113
+ id: "untested-assumptions",
114
+ categoryId: "problems",
115
+ mode: "stress",
116
+ name: "Untested Assumptions",
117
+ description: "Find load-bearing assumptions without falsification paths.",
118
+ prompt: "Find assumptions that appear load-bearing but do not have direct testing questions or falsification evidence.",
119
+ highlightStrategy: "untested",
120
+ riskLevel: "high"
121
+ },
122
+ {
123
+ id: "load-bearing-beliefs",
124
+ categoryId: "problems",
125
+ mode: "stress",
126
+ name: "Load-Bearing Beliefs",
127
+ description: "Find central beliefs whose failure would affect many claims.",
128
+ prompt: "Find the beliefs with the largest downstream impact if they are wrong.",
129
+ highlightStrategy: "load-bearing",
130
+ riskLevel: "high"
131
+ },
132
+ {
133
+ id: "cascade-analysis",
134
+ categoryId: "problems",
135
+ mode: "stress",
136
+ name: "Cascade Analysis",
137
+ description: "Trace what changes if a belief is weakened or invalidated.",
138
+ prompt: "Analyze likely downstream cascades if the most central or uncertain beliefs are weakened.",
139
+ highlightStrategy: "cascade",
140
+ riskLevel: "high"
141
+ },
142
+ {
143
+ id: "unanswered-questions",
144
+ categoryId: "gaps",
145
+ mode: "operational",
146
+ name: "Unanswered Questions",
147
+ description: "Find important open questions that block confidence.",
148
+ prompt: "Identify the most important unanswered questions and explain which beliefs they block.",
149
+ highlightStrategy: "open-questions"
150
+ },
151
+ {
152
+ id: "thin-themes",
153
+ categoryId: "gaps",
154
+ mode: "operational",
155
+ name: "Thin Themes",
156
+ description: "Find topics with shallow belief or evidence coverage.",
157
+ prompt: "Find themes that look underdeveloped relative to their role in the graph.",
158
+ highlightStrategy: "thin-themes"
159
+ },
160
+ {
161
+ id: "missing-evidence",
162
+ categoryId: "gaps",
163
+ mode: "stress",
164
+ name: "Missing Evidence",
165
+ description: "Find beliefs that need specific missing evidence.",
166
+ prompt: "Find the most valuable missing evidence needed to strengthen or falsify the graph.",
167
+ highlightStrategy: "missing-evidence"
168
+ },
169
+ {
170
+ id: "isolated-clusters",
171
+ categoryId: "gaps",
172
+ mode: "operational",
173
+ name: "Isolated Clusters",
174
+ description: "Find clusters not connected to the broader graph.",
175
+ prompt: "Find isolated graph clusters and recommend bridge questions or bridge evidence.",
176
+ highlightStrategy: "isolated-clusters"
177
+ },
178
+ {
179
+ id: "source-contribution",
180
+ categoryId: "gaps",
181
+ mode: "evidence",
182
+ name: "Source Contribution",
183
+ description: "Assess how source mix shapes the graph.",
184
+ prompt: "Assess whether the source mix is balanced enough for the graph's strongest claims.",
185
+ highlightStrategy: "source-mix"
186
+ },
187
+ {
188
+ id: "stale-beliefs",
189
+ categoryId: "gaps",
190
+ mode: "operational",
191
+ name: "Stale Beliefs",
192
+ description: "Find beliefs that need review because they are old or stale.",
193
+ prompt: "Find beliefs that should be revisited because they are stale, unsupported by recent evidence, or contradicted by newer context.",
194
+ highlightStrategy: "staleness"
195
+ },
196
+ {
197
+ id: "assumption-pyramid",
198
+ categoryId: "reasoning",
199
+ mode: "operational",
200
+ name: "Assumption Pyramid",
201
+ description: "Show which conclusions rest on which assumptions.",
202
+ prompt: "Build an assumption pyramid from the graph: foundational assumptions, intermediate claims, and top-level conclusions.",
203
+ highlightStrategy: "assumptions"
204
+ },
205
+ {
206
+ id: "converging-evidence",
207
+ categoryId: "reasoning",
208
+ mode: "evidence",
209
+ name: "Converging Evidence",
210
+ description: "Find claims supported by independent evidence streams.",
211
+ prompt: "Find beliefs with genuinely independent converging evidence and explain why they are robust.",
212
+ highlightStrategy: "convergence"
213
+ },
214
+ {
215
+ id: "weakest-links",
216
+ categoryId: "reasoning",
217
+ mode: "stress",
218
+ name: "Weakest Links",
219
+ description: "Find the weakest links in important reasoning chains.",
220
+ prompt: "Find the weakest links in important reasoning chains and explain how to test them.",
221
+ highlightStrategy: "weak-links",
222
+ riskLevel: "medium"
223
+ },
224
+ {
225
+ id: "challenged-beliefs",
226
+ categoryId: "reasoning",
227
+ mode: "stress",
228
+ name: "Challenged Beliefs",
229
+ description: "Find beliefs with active challenges or defeaters.",
230
+ prompt: "Find beliefs with active challenges, contradiction edges, or unresolved defeaters.",
231
+ highlightStrategy: "challenged"
232
+ },
233
+ {
234
+ id: "contrarian-map",
235
+ categoryId: "strategic",
236
+ mode: "alpha",
237
+ name: "Contrarian Map",
238
+ description: "Find non-consensus beliefs and where they are grounded.",
239
+ prompt: "Find the graph's strongest contrarian or non-consensus beliefs and explain their support.",
240
+ highlightStrategy: "contrarian"
241
+ },
242
+ {
243
+ id: "irreversibility-audit",
244
+ categoryId: "strategic",
245
+ mode: "stress",
246
+ name: "Irreversibility Audit",
247
+ description: "Find irreversible bets and assumptions behind them.",
248
+ prompt: "Audit irreversible decisions or beliefs and identify what must be true before acting.",
249
+ highlightStrategy: "irreversible",
250
+ riskLevel: "high"
251
+ },
252
+ {
253
+ id: "pre-mortem",
254
+ categoryId: "strategic",
255
+ mode: "stress",
256
+ name: "Pre-Mortem",
257
+ description: "Explain how the graph could be wrong.",
258
+ prompt: "Run a pre-mortem: assume the current thesis fails and identify the most plausible failure paths.",
259
+ highlightStrategy: "failure-paths",
260
+ riskLevel: "high"
261
+ },
262
+ {
263
+ id: "devils-advocate",
264
+ categoryId: "strategic",
265
+ mode: "stress",
266
+ name: "Devil's Advocate",
267
+ description: "Generate the strongest critique of the graph.",
268
+ prompt: "Produce the strongest evidence-grounded critique of the current graph and its main thesis.",
269
+ highlightStrategy: "critique"
270
+ },
271
+ {
272
+ id: "falsification-map",
273
+ categoryId: "strategic",
274
+ mode: "stress",
275
+ name: "Falsification Map",
276
+ description: "Find the cheapest tests that would disprove key beliefs.",
277
+ prompt: "Map the cheapest, clearest falsification tests for the graph's key claims.",
278
+ highlightStrategy: "falsification",
279
+ riskLevel: "high"
280
+ },
281
+ {
282
+ id: "prediction-tracker",
283
+ categoryId: "strategic",
284
+ mode: "evidence",
285
+ name: "Prediction Tracker",
286
+ description: "Find beliefs that imply measurable predictions.",
287
+ prompt: "Find beliefs that imply measurable predictions and suggest tracking signals.",
288
+ highlightStrategy: "predictions"
289
+ },
290
+ {
291
+ id: "belief-pagerank",
292
+ categoryId: "deep",
293
+ mode: "semantic",
294
+ name: "Belief PageRank",
295
+ description: "Identify structurally central beliefs.",
296
+ prompt: "Use graph centrality to identify the most structurally important beliefs.",
297
+ highlightStrategy: "centrality"
298
+ },
299
+ {
300
+ id: "underdetermination",
301
+ categoryId: "deep",
302
+ mode: "semantic",
303
+ name: "Underdetermination",
304
+ description: "Find places where evidence supports multiple explanations.",
305
+ prompt: "Find places where the same evidence could support multiple incompatible explanations.",
306
+ highlightStrategy: "underdetermination"
307
+ },
308
+ {
309
+ id: "confidence-propagation",
310
+ categoryId: "deep",
311
+ mode: "semantic",
312
+ name: "Confidence Propagation",
313
+ description: "Assess how uncertainty moves through the graph.",
314
+ prompt: "Explain how uncertainty propagates from weak or contested beliefs through downstream conclusions.",
315
+ highlightStrategy: "confidence-flow"
316
+ },
317
+ {
318
+ id: "argument-depth",
319
+ categoryId: "deep",
320
+ mode: "evidence",
321
+ name: "Argument Depth",
322
+ description: "Assess reasoning depth and chain quality.",
323
+ prompt: "Assess reasoning depth: where claims are shallow, deeply supported, or overextended.",
324
+ highlightStrategy: "depth"
325
+ },
326
+ {
327
+ id: "information-edge",
328
+ categoryId: "deep",
329
+ mode: "alpha",
330
+ name: "Information Edge",
331
+ description: "Find differentiated evidence or signals.",
332
+ prompt: "Find evidence, sources, or beliefs that could represent differentiated information edge.",
333
+ highlightStrategy: "information-edge"
334
+ },
335
+ {
336
+ id: "thesis-summary",
337
+ categoryId: "browse",
338
+ mode: "semantic",
339
+ name: "Thesis Summary",
340
+ description: "Summarize the graph's core thesis and support.",
341
+ prompt: "Summarize the graph's core thesis, strongest support, weakest support, and open questions.",
342
+ highlightStrategy: "summary"
343
+ },
344
+ {
345
+ id: "theme-deep-dive",
346
+ categoryId: "browse",
347
+ mode: "semantic",
348
+ name: "Theme Deep Dive",
349
+ description: "Deep dive into a named theme.",
350
+ prompt: "Deep dive into {input}. Explain the key beliefs, evidence, contradictions, and open questions.",
351
+ inputType: "theme",
352
+ highlightStrategy: "theme"
353
+ },
354
+ {
355
+ id: "belief-detail",
356
+ categoryId: "browse",
357
+ mode: "semantic",
358
+ name: "Belief Detail",
359
+ description: "Explain one belief and its graph neighborhood.",
360
+ prompt: "Explain {input} and its support, challenges, related beliefs, and downstream implications.",
361
+ inputType: "belief",
362
+ highlightStrategy: "belief"
363
+ },
364
+ {
365
+ id: "strongest-beliefs",
366
+ categoryId: "browse",
367
+ mode: "operational",
368
+ name: "Strongest Beliefs",
369
+ description: "Find the graph's strongest current beliefs.",
370
+ prompt: "Find the strongest current beliefs and explain why each one deserves confidence.",
371
+ highlightStrategy: "strongest"
372
+ },
373
+ {
374
+ id: "cross-theme-connection",
375
+ categoryId: "browse",
376
+ mode: "semantic",
377
+ name: "Cross-Theme Connections",
378
+ description: "Find bridges between themes.",
379
+ prompt: "Find meaningful connections across themes and explain which bridge beliefs matter.",
380
+ highlightStrategy: "bridges"
381
+ },
382
+ {
383
+ id: "research-velocity",
384
+ categoryId: "browse",
385
+ mode: "operational",
386
+ name: "Research Velocity",
387
+ description: "Summarize recent graph movement and momentum.",
388
+ prompt: "Assess research velocity: what changed recently, where progress is fastest, and what is stuck.",
389
+ highlightStrategy: "velocity"
390
+ },
391
+ {
392
+ id: "search",
393
+ categoryId: "browse",
394
+ mode: "semantic",
395
+ name: "Graph Search",
396
+ description: "Search the graph with semantic context.",
397
+ prompt: "Search the graph for {input}. Return the most relevant beliefs, evidence, and questions.",
398
+ inputType: "search",
399
+ highlightStrategy: "search"
400
+ },
401
+ {
402
+ id: "expert-coverage",
403
+ categoryId: "browse",
404
+ mode: "semantic",
405
+ name: "Expert Coverage",
406
+ description: "Assess coverage from expert/source perspectives.",
407
+ prompt: "Assess whether the graph has enough expert, primary, and dissenting coverage.",
408
+ highlightStrategy: "expert-coverage"
409
+ },
410
+ {
411
+ id: "value-chain-map",
412
+ categoryId: "browse",
413
+ mode: "semantic",
414
+ name: "Value Chain Map",
415
+ description: "Map entities, dependencies, and value-chain logic.",
416
+ prompt: "Map the value chain implied by this graph: entities, dependencies, pressure points, and missing links.",
417
+ highlightStrategy: "value-chain"
418
+ },
419
+ {
420
+ id: "meeting-brief",
421
+ categoryId: "prep",
422
+ mode: "semantic",
423
+ name: "Meeting Brief",
424
+ description: "Prepare a meeting brief from graph context.",
425
+ prompt: "Prepare a concise meeting brief using the graph: thesis, open questions, risks, and recommended asks.",
426
+ highlightStrategy: "brief"
427
+ },
428
+ {
429
+ id: "open-questions-entity",
430
+ categoryId: "prep",
431
+ mode: "semantic",
432
+ name: "Entity Open Questions",
433
+ description: "Find open questions about a specific entity.",
434
+ prompt: "Find the most important open questions about {input} and the beliefs those questions would unlock.",
435
+ inputType: "entity",
436
+ highlightStrategy: "entity-questions"
437
+ },
438
+ {
439
+ id: "company-context",
440
+ categoryId: "prep",
441
+ mode: "semantic",
442
+ name: "Company Context",
443
+ description: "Summarize graph context about a company.",
444
+ prompt: "Summarize what the graph knows about {input}: thesis relevance, evidence, risks, and open questions.",
445
+ inputType: "company",
446
+ highlightStrategy: "company"
447
+ },
448
+ {
449
+ id: "company-theme-fit",
450
+ categoryId: "prep",
451
+ mode: "semantic",
452
+ name: "Company Theme Fit",
453
+ description: "Assess how a company fits graph themes.",
454
+ prompt: "Assess how {input} fits the graph's themes and where the fit is weak or uncertain.",
455
+ inputType: "company",
456
+ highlightStrategy: "fit"
457
+ },
458
+ {
459
+ id: "company-comparison",
460
+ categoryId: "prep",
461
+ mode: "semantic",
462
+ name: "Company Comparison",
463
+ description: "Compare companies through graph context.",
464
+ prompt: "Compare {input} using graph beliefs, evidence, risks, and open questions.",
465
+ inputType: "company-list",
466
+ highlightStrategy: "comparison"
467
+ },
468
+ {
469
+ id: "questions-to-ask",
470
+ categoryId: "prep",
471
+ mode: "operational",
472
+ name: "Questions to Ask",
473
+ description: "Generate high-signal questions from graph gaps.",
474
+ prompt: "Generate the highest-signal questions to ask next, grounded in current graph gaps.",
475
+ highlightStrategy: "questions"
476
+ },
477
+ {
478
+ id: "beliefs-to-test",
479
+ categoryId: "prep",
480
+ mode: "stress",
481
+ name: "Beliefs to Test",
482
+ description: "Prioritize beliefs that should be tested next.",
483
+ prompt: "Prioritize the beliefs that should be tested next and explain the cheapest test for each.",
484
+ highlightStrategy: "tests",
485
+ riskLevel: "medium"
486
+ }
487
+ ];
488
+ GRAPH_INTELLIGENCE_QUERIES.map((query) => {
489
+ const definition = query;
490
+ return {
491
+ ...definition,
492
+ tools: definition.tools ?? byMode(definition.mode)
493
+ };
494
+ });
14
495
  function inferActorType(args) {
15
496
  if (args.sessionType === "agent") {
16
497
  return "agent";
@@ -62,7 +543,10 @@ function idOf(table) {
62
543
  return schema;
63
544
  }
64
545
  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"]);
65
- var EDGE_TYPE = z.enum(["supports", "informs", "depends_on", "extracted_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"]);
546
+ 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"];
547
+ var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
548
+ z.enum(EDGE_TYPE_VALUES);
549
+ var STORAGE_EDGE_TYPE = z.enum(STORAGE_EDGE_TYPE_VALUES);
66
550
  var TOPIC_STATUS = z.enum(["active", "archived", "watching"]);
67
551
  var TOPIC_VISIBILITY = z.enum(["private", "team", "firm", "external", "public"]);
68
552
  defineTable({
@@ -1547,7 +2031,7 @@ defineTable({
1547
2031
  "toNodeId": z.string().optional(),
1548
2032
  "sourceGlobalId": z.string().optional(),
1549
2033
  "targetGlobalId": z.string().optional(),
1550
- "edgeType": EDGE_TYPE,
2034
+ "edgeType": STORAGE_EDGE_TYPE,
1551
2035
  "edgeTier": z.string().optional(),
1552
2036
  "domainNamespace": z.string().optional(),
1553
2037
  "constraint": z.string().optional(),
@@ -4318,6 +4802,128 @@ var edgePolicyManifest = {
4318
4802
  }
4319
4803
  ]
4320
4804
  };
4805
+
4806
+ // ../contracts/src/tenant-client.contract.ts
4807
+ var TENANT_CLIENT_INSTALLABLE_PACKAGES = [
4808
+ {
4809
+ packageName: "@lucern/access-control",
4810
+ role: "runtime_entrypoint",
4811
+ directTenantImport: true
4812
+ },
4813
+ {
4814
+ packageName: "@lucern/agent",
4815
+ role: "platform_runtime",
4816
+ directTenantImport: false
4817
+ },
4818
+ {
4819
+ packageName: "@lucern/auth",
4820
+ role: "sdk_dependency",
4821
+ directTenantImport: false
4822
+ },
4823
+ {
4824
+ packageName: "@lucern/cli",
4825
+ role: "developer_tool",
4826
+ directTenantImport: false
4827
+ },
4828
+ {
4829
+ packageName: "@lucern/client-core",
4830
+ role: "sdk_dependency",
4831
+ directTenantImport: false
4832
+ },
4833
+ {
4834
+ packageName: "@lucern/confidence",
4835
+ role: "sdk_dependency",
4836
+ directTenantImport: false
4837
+ },
4838
+ {
4839
+ packageName: "@lucern/config",
4840
+ role: "configuration",
4841
+ directTenantImport: false
4842
+ },
4843
+ {
4844
+ packageName: "@lucern/contracts",
4845
+ role: "contract_entrypoint",
4846
+ directTenantImport: true
4847
+ },
4848
+ {
4849
+ packageName: "@lucern/control-plane",
4850
+ role: "platform_runtime",
4851
+ directTenantImport: false
4852
+ },
4853
+ {
4854
+ packageName: "@lucern/developer-kit",
4855
+ role: "developer_tool",
4856
+ directTenantImport: false
4857
+ },
4858
+ {
4859
+ packageName: "@lucern/events",
4860
+ role: "sdk_dependency",
4861
+ directTenantImport: false
4862
+ },
4863
+ {
4864
+ packageName: "@lucern/graph-primitives",
4865
+ role: "sdk_dependency",
4866
+ directTenantImport: false
4867
+ },
4868
+ {
4869
+ packageName: "@lucern/identity",
4870
+ role: "component_runtime",
4871
+ directTenantImport: false
4872
+ },
4873
+ {
4874
+ packageName: "@lucern/mcp",
4875
+ role: "runtime_entrypoint",
4876
+ directTenantImport: true
4877
+ },
4878
+ {
4879
+ packageName: "@lucern/pack-host",
4880
+ role: "platform_runtime",
4881
+ directTenantImport: false
4882
+ },
4883
+ {
4884
+ packageName: "@lucern/pack-installer",
4885
+ role: "developer_tool",
4886
+ directTenantImport: false
4887
+ },
4888
+ {
4889
+ packageName: "@lucern/proof-compiler",
4890
+ role: "developer_tool",
4891
+ directTenantImport: false
4892
+ },
4893
+ {
4894
+ packageName: "@lucern/react",
4895
+ role: "runtime_entrypoint",
4896
+ directTenantImport: true
4897
+ },
4898
+ {
4899
+ packageName: "@lucern/reasoning-kernel",
4900
+ role: "component_runtime",
4901
+ directTenantImport: false
4902
+ },
4903
+ {
4904
+ packageName: "@lucern/sdk",
4905
+ role: "runtime_entrypoint",
4906
+ directTenantImport: true
4907
+ },
4908
+ {
4909
+ packageName: "@lucern/server-core",
4910
+ role: "platform_runtime",
4911
+ directTenantImport: false
4912
+ },
4913
+ {
4914
+ packageName: "@lucern/testing",
4915
+ role: "test_support",
4916
+ directTenantImport: false
4917
+ },
4918
+ {
4919
+ packageName: "@lucern/types",
4920
+ role: "contract_entrypoint",
4921
+ directTenantImport: true
4922
+ }
4923
+ ];
4924
+ TENANT_CLIENT_INSTALLABLE_PACKAGES.map(
4925
+ (entry) => entry.packageName
4926
+ );
4321
4927
  z.object({
4322
4928
  manifestVersion: z.literal("1.0.0"),
4323
4929
  rules: z.array(
@@ -5803,6 +6409,74 @@ var GET_GRAPH_STRUCTURE_ANALYSIS = {
5803
6409
  ontologyPrimitive: "graph",
5804
6410
  tier: "showcase"
5805
6411
  };
6412
+ var LIST_GRAPH_INTELLIGENCE_QUERIES = {
6413
+ name: "list_graph_intelligence_queries",
6414
+ 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.",
6415
+ parameters: {
6416
+ categoryId: {
6417
+ type: "string",
6418
+ description: "Optional category filter, such as problems or strategic"
6419
+ },
6420
+ mode: {
6421
+ type: "string",
6422
+ description: "Optional mode filter: core, bias, stress, operational, alpha, semantic, or evidence"
6423
+ }
6424
+ },
6425
+ required: [],
6426
+ response: {
6427
+ description: "Graph Intelligence query catalog and mode-to-tool mapping",
6428
+ fields: {
6429
+ categories: "array \u2014 query categories",
6430
+ queries: "array \u2014 query definitions with prompt templates and tools",
6431
+ quickQueries: "array \u2014 recommended one-click query presets",
6432
+ publicToolNamesByMode: "object \u2014 public tool names available to each Graph Intelligence mode"
6433
+ }
6434
+ },
6435
+ ownerModule: "graph-intelligence",
6436
+ ontologyPrimitive: "graph",
6437
+ tier: "showcase"
6438
+ };
6439
+ var RUN_GRAPH_INTELLIGENCE_QUERY = {
6440
+ name: "run_graph_intelligence_query",
6441
+ 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.",
6442
+ parameters: {
6443
+ topicId: { type: "string", description: "Topic to analyze" },
6444
+ queryId: {
6445
+ type: "string",
6446
+ description: "Graph Intelligence query ID, such as confirmation-bias, pre-mortem, or thesis-summary"
6447
+ },
6448
+ prompt: {
6449
+ type: "string",
6450
+ description: "Optional custom prompt for custom analysis runs"
6451
+ },
6452
+ input: {
6453
+ type: "string",
6454
+ description: "Optional entity, theme, belief, company, or search text for input-driven queries"
6455
+ },
6456
+ mode: {
6457
+ type: "string",
6458
+ description: "Optional mode override: core, bias, stress, operational, alpha, semantic, or evidence"
6459
+ },
6460
+ limit: {
6461
+ type: "number",
6462
+ description: "Maximum graph context rows to return"
6463
+ }
6464
+ },
6465
+ required: ["topicId"],
6466
+ response: {
6467
+ description: "Graph Intelligence query result bundle ready for model or prompt-library synthesis",
6468
+ fields: {
6469
+ query: "object \u2014 selected query definition",
6470
+ prompt: "string \u2014 resolved prompt template",
6471
+ toolPlan: "array \u2014 public tools and args the model can call next",
6472
+ analysis: "object \u2014 structure, coverage, gap, and confirmation-bias analysis",
6473
+ context: "object \u2014 sampled beliefs, questions, evidence, edges, and contradictions"
6474
+ }
6475
+ },
6476
+ ownerModule: "graph-intelligence",
6477
+ ontologyPrimitive: "graph",
6478
+ tier: "showcase"
6479
+ };
5806
6480
  var GET_FALSIFICATION_QUESTIONS = {
5807
6481
  name: "get_falsification_questions",
5808
6482
  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.",
@@ -8378,6 +9052,8 @@ var MCP_TOOL_CONTRACTS = {
8378
9052
  // Graph intelligence (showcase)
8379
9053
  detect_confirmation_bias: DETECT_CONFIRMATION_BIAS,
8380
9054
  get_graph_structure_analysis: GET_GRAPH_STRUCTURE_ANALYSIS,
9055
+ list_graph_intelligence_queries: LIST_GRAPH_INTELLIGENCE_QUERIES,
9056
+ run_graph_intelligence_query: RUN_GRAPH_INTELLIGENCE_QUERY,
8381
9057
  get_falsification_questions: GET_FALSIFICATION_QUESTIONS,
8382
9058
  // Evidence operations (workhorse)
8383
9059
  search_evidence: SEARCH_EVIDENCE,
@@ -8560,6 +9236,8 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
8560
9236
  "traverse_graph",
8561
9237
  "get_graph_neighborhood",
8562
9238
  "get_graph_structure_analysis",
9239
+ "list_graph_intelligence_queries",
9240
+ "run_graph_intelligence_query",
8563
9241
  "find_contradictions",
8564
9242
  "flag_contradiction",
8565
9243
  "detect_confirmation_bias",
@@ -11180,6 +11858,15 @@ var edgesContracts = [
11180
11858
  args: queryLineageArgs
11181
11859
  })
11182
11860
  ];
11861
+ var graphIntelligenceQueryModes = [
11862
+ "core",
11863
+ "bias",
11864
+ "stress",
11865
+ "operational",
11866
+ "alpha",
11867
+ "semantic",
11868
+ "evidence"
11869
+ ];
11183
11870
  var traversalLayerSchema = z.enum([
11184
11871
  "L4",
11185
11872
  "L3",
@@ -11213,6 +11900,22 @@ var graphNeighborhoodArgs = z.object({
11213
11900
  topicId: z.string().optional().describe("Topic scope for edge lookup."),
11214
11901
  limit: z.number().optional().describe("Maximum edges to return.")
11215
11902
  });
11903
+ var graphIntelligenceModeSchema = z.enum([
11904
+ graphIntelligenceQueryModes[0],
11905
+ ...graphIntelligenceQueryModes.slice(1)
11906
+ ]);
11907
+ var graphIntelligenceCatalogArgs = z.object({
11908
+ categoryId: z.string().optional().describe("Optional query category filter."),
11909
+ mode: graphIntelligenceModeSchema.optional().describe("Optional Graph Intelligence query mode filter.")
11910
+ });
11911
+ var graphIntelligenceRunArgs = z.object({
11912
+ topicId: z.string().describe("Topic to analyze."),
11913
+ queryId: z.string().optional().describe("Catalog query ID to run, such as pre-mortem."),
11914
+ prompt: z.string().optional().describe("Custom prompt when queryId is omitted or overridden."),
11915
+ input: z.string().optional().describe("Optional entity, theme, belief, company, or search text."),
11916
+ mode: graphIntelligenceModeSchema.optional().describe("Optional query mode override for custom prompts."),
11917
+ limit: z.number().optional().describe("Maximum graph context rows to return.")
11918
+ });
11216
11919
  var flagContradictionArgs = z.object({
11217
11920
  beliefA: z.string().describe("First belief in tension."),
11218
11921
  beliefB: z.string().describe("Second belief in tension."),
@@ -11318,6 +12021,38 @@ var graphContracts = [
11318
12021
  kind: "query"
11319
12022
  }
11320
12023
  }),
12024
+ surfaceContract({
12025
+ name: "list_graph_intelligence_queries",
12026
+ kind: "query",
12027
+ domain: "graph",
12028
+ surfaceClass: "platform_public",
12029
+ path: "/graph-intelligence/queries",
12030
+ sdkNamespace: "graphAnalysis",
12031
+ sdkMethod: "listGraphIntelligenceQueries",
12032
+ summary: "List Graph Intelligence query catalog entries.",
12033
+ convex: {
12034
+ module: "contextCompiler",
12035
+ functionName: "listGraphIntelligenceQueries",
12036
+ kind: "query"
12037
+ },
12038
+ args: graphIntelligenceCatalogArgs
12039
+ }),
12040
+ surfaceContract({
12041
+ name: "run_graph_intelligence_query",
12042
+ kind: "query",
12043
+ domain: "graph",
12044
+ surfaceClass: "platform_public",
12045
+ path: "/graph-intelligence/run",
12046
+ sdkNamespace: "graphAnalysis",
12047
+ sdkMethod: "runGraphIntelligenceQuery",
12048
+ summary: "Run a Graph Intelligence query against a topic graph.",
12049
+ convex: {
12050
+ module: "contextCompiler",
12051
+ functionName: "runGraphIntelligenceQuery",
12052
+ kind: "query"
12053
+ },
12054
+ args: graphIntelligenceRunArgs
12055
+ }),
11321
12056
  surfaceContract({
11322
12057
  name: "find_contradictions",
11323
12058
  kind: "query",