@lucern/mcp 0.3.0-alpha.8 → 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/cli.js +68 -45
- package/dist/cli.js.map +1 -1
- package/dist/gateway.js +46 -35
- package/dist/gateway.js.map +1 -1
- package/dist/hosted-route.js +68 -45
- package/dist/hosted-route.js.map +1 -1
- package/dist/index.js +68 -45
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +46 -35
- package/dist/runtime.js.map +1 -1
- package/package.json +6 -6
package/dist/cli.js
CHANGED
|
@@ -5106,17 +5106,44 @@ z.object({
|
|
|
5106
5106
|
message: "SL invariant b+d+u=1 violated at API boundary"
|
|
5107
5107
|
}
|
|
5108
5108
|
);
|
|
5109
|
-
|
|
5109
|
+
|
|
5110
|
+
// ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
|
|
5111
|
+
var NODE_TYPES = [
|
|
5112
|
+
"decision",
|
|
5110
5113
|
"belief",
|
|
5111
|
-
"evidence",
|
|
5112
5114
|
"question",
|
|
5113
|
-
"
|
|
5115
|
+
"theme",
|
|
5116
|
+
"deal",
|
|
5114
5117
|
"topic",
|
|
5118
|
+
"claim",
|
|
5119
|
+
"evidence",
|
|
5120
|
+
"synthesis",
|
|
5121
|
+
"answer",
|
|
5122
|
+
"atomic_fact",
|
|
5123
|
+
"excerpt",
|
|
5124
|
+
"source",
|
|
5125
|
+
"company",
|
|
5126
|
+
"person",
|
|
5127
|
+
"investor",
|
|
5128
|
+
"function",
|
|
5129
|
+
"value_chain"
|
|
5130
|
+
];
|
|
5131
|
+
new Set(NODE_TYPES);
|
|
5132
|
+
|
|
5133
|
+
// ../contracts/src/types/graph-ref.ts
|
|
5134
|
+
var GRAPH_REF_EXTRA_NODE_TYPES = [
|
|
5115
5135
|
"edge",
|
|
5116
5136
|
"ontology",
|
|
5117
5137
|
"lens",
|
|
5118
5138
|
"contradiction"
|
|
5119
|
-
]
|
|
5139
|
+
];
|
|
5140
|
+
var GRAPH_REF_NODE_TYPES = [
|
|
5141
|
+
...NODE_TYPES,
|
|
5142
|
+
...GRAPH_REF_EXTRA_NODE_TYPES
|
|
5143
|
+
];
|
|
5144
|
+
var EpistemicNodeTypeSchema = z.enum(
|
|
5145
|
+
GRAPH_REF_NODE_TYPES
|
|
5146
|
+
);
|
|
5120
5147
|
var GraphRefSchema = z.discriminatedUnion("kind", [
|
|
5121
5148
|
z.object({
|
|
5122
5149
|
kind: z.literal("epistemic_node"),
|
|
@@ -5164,33 +5191,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
|
|
|
5164
5191
|
}
|
|
5165
5192
|
|
|
5166
5193
|
// ../contracts/src/manifests/edge-policy-manifest.data.ts
|
|
5194
|
+
var publicEpistemicNodeEdgePolicy = (edgeType) => ({
|
|
5195
|
+
edgeType,
|
|
5196
|
+
fromKinds: ["epistemic_node"],
|
|
5197
|
+
toKinds: ["epistemic_node"],
|
|
5198
|
+
description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
|
|
5199
|
+
});
|
|
5167
5200
|
var edgePolicyManifest = {
|
|
5168
|
-
policies:
|
|
5169
|
-
{
|
|
5170
|
-
edgeType: "evidence_derived_from_evidence",
|
|
5171
|
-
fromKinds: ["epistemic_node"],
|
|
5172
|
-
fromNodeTypes: ["evidence"],
|
|
5173
|
-
toKinds: ["epistemic_node"],
|
|
5174
|
-
toNodeTypes: ["evidence"],
|
|
5175
|
-
description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
|
|
5176
|
-
},
|
|
5177
|
-
{
|
|
5178
|
-
edgeType: "evidence_supports_belief",
|
|
5179
|
-
fromKinds: ["epistemic_node"],
|
|
5180
|
-
fromNodeTypes: ["evidence"],
|
|
5181
|
-
toKinds: ["epistemic_node"],
|
|
5182
|
-
toNodeTypes: ["belief"],
|
|
5183
|
-
description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
|
|
5184
|
-
},
|
|
5185
|
-
{
|
|
5186
|
-
edgeType: "evidence_supports_question",
|
|
5187
|
-
fromKinds: ["epistemic_node"],
|
|
5188
|
-
fromNodeTypes: ["evidence"],
|
|
5189
|
-
toKinds: ["epistemic_node"],
|
|
5190
|
-
toNodeTypes: ["question"],
|
|
5191
|
-
description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
|
|
5192
|
-
}
|
|
5193
|
-
]
|
|
5201
|
+
policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
|
|
5194
5202
|
};
|
|
5195
5203
|
|
|
5196
5204
|
// ../contracts/src/tenant-client.contract.ts
|
|
@@ -10925,12 +10933,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
|
|
|
10925
10933
|
compactRecord4({
|
|
10926
10934
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
10927
10935
|
toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
|
|
10928
|
-
edgeType: "
|
|
10936
|
+
edgeType: "informs",
|
|
10929
10937
|
globalId: input.globalId ?? `edge:${String(
|
|
10930
10938
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
10931
10939
|
)}:${String(
|
|
10932
10940
|
input.beliefNodeId ?? input.beliefId ?? input.targetId
|
|
10933
|
-
)}:
|
|
10941
|
+
)}:informs`,
|
|
10934
10942
|
weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
|
|
10935
10943
|
context: input.rationale ?? input.context,
|
|
10936
10944
|
skipLayerValidation: true,
|
|
@@ -10943,12 +10951,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
|
|
|
10943
10951
|
compactRecord4({
|
|
10944
10952
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
10945
10953
|
toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
|
|
10946
|
-
edgeType: "
|
|
10954
|
+
edgeType: "responds_to",
|
|
10947
10955
|
globalId: input.globalId ?? `edge:${String(
|
|
10948
10956
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
10949
10957
|
)}:${String(
|
|
10950
10958
|
input.questionId ?? input.questionNodeId ?? input.targetId
|
|
10951
|
-
)}:
|
|
10959
|
+
)}:responds_to`,
|
|
10952
10960
|
weight: input.impactScore ?? input.weight,
|
|
10953
10961
|
context: input.rationale ?? input.context,
|
|
10954
10962
|
skipLayerValidation: true,
|
|
@@ -12453,10 +12461,13 @@ var tasksContracts = [
|
|
|
12453
12461
|
}
|
|
12454
12462
|
})
|
|
12455
12463
|
];
|
|
12464
|
+
var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
|
|
12465
|
+
(policy) => policy.edgeType
|
|
12466
|
+
);
|
|
12456
12467
|
var createEdgeArgs = z.object({
|
|
12457
12468
|
from: GraphRefSchema,
|
|
12458
12469
|
to: GraphRefSchema,
|
|
12459
|
-
edgeType: z.
|
|
12470
|
+
edgeType: z.enum(CREATE_EDGE_TYPES),
|
|
12460
12471
|
globalId: z.string().optional(),
|
|
12461
12472
|
weight: z.number().optional(),
|
|
12462
12473
|
confidence: z.number().optional(),
|
|
@@ -21312,6 +21323,21 @@ function createSchemaClient(config = {}) {
|
|
|
21312
21323
|
}
|
|
21313
21324
|
|
|
21314
21325
|
// ../sdk/src/clientHelpers.ts
|
|
21326
|
+
function normalizeCustomNamespace(namespace) {
|
|
21327
|
+
return namespace.trim() || "custom";
|
|
21328
|
+
}
|
|
21329
|
+
function normalizeCustomToolPayload(input) {
|
|
21330
|
+
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
21331
|
+
}
|
|
21332
|
+
function resolveCustomToolFullName(name) {
|
|
21333
|
+
return name.includes(".") ? name : `custom.${name}`;
|
|
21334
|
+
}
|
|
21335
|
+
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
21336
|
+
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
21337
|
+
}
|
|
21338
|
+
function buildBeliefsArchivePayload(input) {
|
|
21339
|
+
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
21340
|
+
}
|
|
21315
21341
|
function asNodeArray(data) {
|
|
21316
21342
|
const rows = asListItems(data, "nodes");
|
|
21317
21343
|
if (rows.length > 0) {
|
|
@@ -21689,7 +21715,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
21689
21715
|
}
|
|
21690
21716
|
|
|
21691
21717
|
// ../sdk/src/version.ts
|
|
21692
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
21718
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
|
|
21693
21719
|
|
|
21694
21720
|
// ../sdk/src/workflowClient.ts
|
|
21695
21721
|
function normalizeLensQuery(value) {
|
|
@@ -22210,11 +22236,11 @@ function createLucernClient(config = {}) {
|
|
|
22210
22236
|
}
|
|
22211
22237
|
}
|
|
22212
22238
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
22213
|
-
const payload =
|
|
22239
|
+
const payload = normalizeCustomToolPayload(input);
|
|
22214
22240
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
22215
22241
|
};
|
|
22216
22242
|
const getCustomNamespace = (namespace) => {
|
|
22217
|
-
const normalized = namespace
|
|
22243
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
22218
22244
|
const cached = customNamespaceCache.get(normalized);
|
|
22219
22245
|
if (cached) {
|
|
22220
22246
|
return cached;
|
|
@@ -22674,10 +22700,7 @@ function createLucernClient(config = {}) {
|
|
|
22674
22700
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
22675
22701
|
},
|
|
22676
22702
|
refine(nodeId, textOrInput, rationale) {
|
|
22677
|
-
const payload =
|
|
22678
|
-
text: textOrInput.text,
|
|
22679
|
-
rationale: textOrInput.rationale
|
|
22680
|
-
};
|
|
22703
|
+
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
22681
22704
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
22682
22705
|
},
|
|
22683
22706
|
updateConfidence(nodeId, input) {
|
|
@@ -22715,7 +22738,7 @@ function createLucernClient(config = {}) {
|
|
|
22715
22738
|
}).then(exposeGatewayData);
|
|
22716
22739
|
},
|
|
22717
22740
|
archive(nodeId, input) {
|
|
22718
|
-
const payload =
|
|
22741
|
+
const payload = buildBeliefsArchivePayload(input);
|
|
22719
22742
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
22720
22743
|
},
|
|
22721
22744
|
list(args) {
|
|
@@ -23755,7 +23778,7 @@ function createLucernClient(config = {}) {
|
|
|
23755
23778
|
list: listRegisteredCustomTools,
|
|
23756
23779
|
clear: clearRegisteredCustomTools,
|
|
23757
23780
|
invoke(name, input = {}) {
|
|
23758
|
-
const fullName = name
|
|
23781
|
+
const fullName = resolveCustomToolFullName(name);
|
|
23759
23782
|
return invokeCustomTool(fullName, input);
|
|
23760
23783
|
},
|
|
23761
23784
|
namespace: getCustomNamespace
|
|
@@ -28534,7 +28557,7 @@ function createLucernStandaloneMcpServer(options) {
|
|
|
28534
28557
|
});
|
|
28535
28558
|
const server = new McpServer({
|
|
28536
28559
|
name: "lucern-mcp",
|
|
28537
|
-
version: "0.3.0-alpha.
|
|
28560
|
+
version: "0.3.0-alpha.9"
|
|
28538
28561
|
});
|
|
28539
28562
|
registerTools(server, runtime);
|
|
28540
28563
|
const resources = registerResources(server, runtime, observationStore);
|