@lucern/mcp 0.3.0-alpha.7 → 0.3.0-alpha.9

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
@@ -4716,17 +4716,44 @@ z.object({
4716
4716
  message: "SL invariant b+d+u=1 violated at API boundary"
4717
4717
  }
4718
4718
  );
4719
- var EpistemicNodeTypeSchema = z.enum([
4719
+
4720
+ // ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
4721
+ var NODE_TYPES = [
4722
+ "decision",
4720
4723
  "belief",
4721
- "evidence",
4722
4724
  "question",
4723
- "answer",
4725
+ "theme",
4726
+ "deal",
4724
4727
  "topic",
4728
+ "claim",
4729
+ "evidence",
4730
+ "synthesis",
4731
+ "answer",
4732
+ "atomic_fact",
4733
+ "excerpt",
4734
+ "source",
4735
+ "company",
4736
+ "person",
4737
+ "investor",
4738
+ "function",
4739
+ "value_chain"
4740
+ ];
4741
+ new Set(NODE_TYPES);
4742
+
4743
+ // ../contracts/src/types/graph-ref.ts
4744
+ var GRAPH_REF_EXTRA_NODE_TYPES = [
4725
4745
  "edge",
4726
4746
  "ontology",
4727
4747
  "lens",
4728
4748
  "contradiction"
4729
- ]);
4749
+ ];
4750
+ var GRAPH_REF_NODE_TYPES = [
4751
+ ...NODE_TYPES,
4752
+ ...GRAPH_REF_EXTRA_NODE_TYPES
4753
+ ];
4754
+ var EpistemicNodeTypeSchema = z.enum(
4755
+ GRAPH_REF_NODE_TYPES
4756
+ );
4730
4757
  var GraphRefSchema = z.discriminatedUnion("kind", [
4731
4758
  z.object({
4732
4759
  kind: z.literal("epistemic_node"),
@@ -4774,33 +4801,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
4774
4801
  }
4775
4802
 
4776
4803
  // ../contracts/src/manifests/edge-policy-manifest.data.ts
4804
+ var publicEpistemicNodeEdgePolicy = (edgeType) => ({
4805
+ edgeType,
4806
+ fromKinds: ["epistemic_node"],
4807
+ toKinds: ["epistemic_node"],
4808
+ description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
4809
+ });
4777
4810
  var edgePolicyManifest = {
4778
- policies: [
4779
- {
4780
- edgeType: "evidence_derived_from_evidence",
4781
- fromKinds: ["epistemic_node"],
4782
- fromNodeTypes: ["evidence"],
4783
- toKinds: ["epistemic_node"],
4784
- toNodeTypes: ["evidence"],
4785
- description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
4786
- },
4787
- {
4788
- edgeType: "evidence_supports_belief",
4789
- fromKinds: ["epistemic_node"],
4790
- fromNodeTypes: ["evidence"],
4791
- toKinds: ["epistemic_node"],
4792
- toNodeTypes: ["belief"],
4793
- description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
4794
- },
4795
- {
4796
- edgeType: "evidence_supports_question",
4797
- fromKinds: ["epistemic_node"],
4798
- fromNodeTypes: ["evidence"],
4799
- toKinds: ["epistemic_node"],
4800
- toNodeTypes: ["question"],
4801
- description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
4802
- }
4803
- ]
4811
+ policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
4804
4812
  };
4805
4813
 
4806
4814
  // ../contracts/src/tenant-client.contract.ts
@@ -7356,15 +7364,15 @@ var IDENTITY_WHOAMI = {
7356
7364
  };
7357
7365
  var COMPILE_CONTEXT = {
7358
7366
  name: "compile_context",
7359
- description: "Compile a focused reasoning context for a topic. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
7367
+ description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
7360
7368
  parameters: {
7361
7369
  topicId: {
7362
7370
  type: "string",
7363
- description: "Topic scope ID to compile"
7371
+ description: "Optional topic scope ID. Omit to resolve the topic from query."
7364
7372
  },
7365
7373
  query: {
7366
7374
  type: "string",
7367
- description: "Optional focus query used to rank context items"
7375
+ description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
7368
7376
  },
7369
7377
  budget: {
7370
7378
  type: "number",
@@ -7388,7 +7396,7 @@ var COMPILE_CONTEXT = {
7388
7396
  description: "Include related ontological entities in the compiled result"
7389
7397
  }
7390
7398
  },
7391
- required: ["topicId"],
7399
+ required: [],
7392
7400
  response: {
7393
7401
  description: "Compiled context pack for the requested topic",
7394
7402
  fields: {
@@ -9887,7 +9895,7 @@ var contextContracts = [
9887
9895
  path: "/context/compile",
9888
9896
  sdkNamespace: "context",
9889
9897
  sdkMethod: "compileContext",
9890
- summary: "Compile a focused reasoning context for a topic.",
9898
+ summary: "Compile a focused reasoning context, resolving topic from query when omitted.",
9891
9899
  convex: {
9892
9900
  module: "contextCompiler",
9893
9901
  functionName: "compile",
@@ -10353,12 +10361,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
10353
10361
  compactRecord4({
10354
10362
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10355
10363
  toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
10356
- edgeType: "evidence_supports_belief",
10364
+ edgeType: "informs",
10357
10365
  globalId: input.globalId ?? `edge:${String(
10358
10366
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10359
10367
  )}:${String(
10360
10368
  input.beliefNodeId ?? input.beliefId ?? input.targetId
10361
- )}:evidence_supports_belief`,
10369
+ )}:informs`,
10362
10370
  weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
10363
10371
  context: input.rationale ?? input.context,
10364
10372
  skipLayerValidation: true,
@@ -10371,12 +10379,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
10371
10379
  compactRecord4({
10372
10380
  fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
10373
10381
  toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
10374
- edgeType: "evidence_supports_question",
10382
+ edgeType: "responds_to",
10375
10383
  globalId: input.globalId ?? `edge:${String(
10376
10384
  input.insightId ?? input.evidenceNodeId ?? input.evidenceId
10377
10385
  )}:${String(
10378
10386
  input.questionId ?? input.questionNodeId ?? input.targetId
10379
- )}:evidence_supports_question`,
10387
+ )}:responds_to`,
10380
10388
  weight: input.impactScore ?? input.weight,
10381
10389
  context: input.rationale ?? input.context,
10382
10390
  skipLayerValidation: true,
@@ -11881,10 +11889,13 @@ var tasksContracts = [
11881
11889
  }
11882
11890
  })
11883
11891
  ];
11892
+ var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
11893
+ (policy) => policy.edgeType
11894
+ );
11884
11895
  var createEdgeArgs = z.object({
11885
11896
  from: GraphRefSchema,
11886
11897
  to: GraphRefSchema,
11887
- edgeType: z.string(),
11898
+ edgeType: z.enum(CREATE_EDGE_TYPES),
11888
11899
  globalId: z.string().optional(),
11889
11900
  weight: z.number().optional(),
11890
11901
  confidence: z.number().optional(),