@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/hosted-route.js
CHANGED
|
@@ -6896,6 +6896,21 @@ function createSchemaClient(config = {}) {
|
|
|
6896
6896
|
}
|
|
6897
6897
|
|
|
6898
6898
|
// ../sdk/src/clientHelpers.ts
|
|
6899
|
+
function normalizeCustomNamespace(namespace) {
|
|
6900
|
+
return namespace.trim() || "custom";
|
|
6901
|
+
}
|
|
6902
|
+
function normalizeCustomToolPayload(input) {
|
|
6903
|
+
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
6904
|
+
}
|
|
6905
|
+
function resolveCustomToolFullName(name) {
|
|
6906
|
+
return name.includes(".") ? name : `custom.${name}`;
|
|
6907
|
+
}
|
|
6908
|
+
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
6909
|
+
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
6910
|
+
}
|
|
6911
|
+
function buildBeliefsArchivePayload(input) {
|
|
6912
|
+
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
6913
|
+
}
|
|
6899
6914
|
function asNodeArray(data) {
|
|
6900
6915
|
const rows = asListItems(data, "nodes");
|
|
6901
6916
|
if (rows.length > 0) {
|
|
@@ -7273,7 +7288,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
7273
7288
|
}
|
|
7274
7289
|
|
|
7275
7290
|
// ../sdk/src/version.ts
|
|
7276
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
7291
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
|
|
7277
7292
|
|
|
7278
7293
|
// ../sdk/src/workflowClient.ts
|
|
7279
7294
|
function normalizeLensQuery(value) {
|
|
@@ -7794,11 +7809,11 @@ function createLucernClient(config = {}) {
|
|
|
7794
7809
|
}
|
|
7795
7810
|
}
|
|
7796
7811
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
7797
|
-
const payload =
|
|
7812
|
+
const payload = normalizeCustomToolPayload(input);
|
|
7798
7813
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
7799
7814
|
};
|
|
7800
7815
|
const getCustomNamespace = (namespace) => {
|
|
7801
|
-
const normalized = namespace
|
|
7816
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
7802
7817
|
const cached = customNamespaceCache.get(normalized);
|
|
7803
7818
|
if (cached) {
|
|
7804
7819
|
return cached;
|
|
@@ -8258,10 +8273,7 @@ function createLucernClient(config = {}) {
|
|
|
8258
8273
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
8259
8274
|
},
|
|
8260
8275
|
refine(nodeId, textOrInput, rationale) {
|
|
8261
|
-
const payload =
|
|
8262
|
-
text: textOrInput.text,
|
|
8263
|
-
rationale: textOrInput.rationale
|
|
8264
|
-
};
|
|
8276
|
+
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
8265
8277
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
8266
8278
|
},
|
|
8267
8279
|
updateConfidence(nodeId, input) {
|
|
@@ -8299,7 +8311,7 @@ function createLucernClient(config = {}) {
|
|
|
8299
8311
|
}).then(exposeGatewayData);
|
|
8300
8312
|
},
|
|
8301
8313
|
archive(nodeId, input) {
|
|
8302
|
-
const payload =
|
|
8314
|
+
const payload = buildBeliefsArchivePayload(input);
|
|
8303
8315
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
8304
8316
|
},
|
|
8305
8317
|
list(args) {
|
|
@@ -9339,7 +9351,7 @@ function createLucernClient(config = {}) {
|
|
|
9339
9351
|
list: listRegisteredCustomTools,
|
|
9340
9352
|
clear: clearRegisteredCustomTools,
|
|
9341
9353
|
invoke(name, input = {}) {
|
|
9342
|
-
const fullName = name
|
|
9354
|
+
const fullName = resolveCustomToolFullName(name);
|
|
9343
9355
|
return invokeCustomTool(fullName, input);
|
|
9344
9356
|
},
|
|
9345
9357
|
namespace: getCustomNamespace
|
|
@@ -20826,17 +20838,44 @@ z.object({
|
|
|
20826
20838
|
message: "SL invariant b+d+u=1 violated at API boundary"
|
|
20827
20839
|
}
|
|
20828
20840
|
);
|
|
20829
|
-
|
|
20841
|
+
|
|
20842
|
+
// ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
|
|
20843
|
+
var NODE_TYPES = [
|
|
20844
|
+
"decision",
|
|
20830
20845
|
"belief",
|
|
20831
|
-
"evidence",
|
|
20832
20846
|
"question",
|
|
20833
|
-
"
|
|
20847
|
+
"theme",
|
|
20848
|
+
"deal",
|
|
20834
20849
|
"topic",
|
|
20850
|
+
"claim",
|
|
20851
|
+
"evidence",
|
|
20852
|
+
"synthesis",
|
|
20853
|
+
"answer",
|
|
20854
|
+
"atomic_fact",
|
|
20855
|
+
"excerpt",
|
|
20856
|
+
"source",
|
|
20857
|
+
"company",
|
|
20858
|
+
"person",
|
|
20859
|
+
"investor",
|
|
20860
|
+
"function",
|
|
20861
|
+
"value_chain"
|
|
20862
|
+
];
|
|
20863
|
+
new Set(NODE_TYPES);
|
|
20864
|
+
|
|
20865
|
+
// ../contracts/src/types/graph-ref.ts
|
|
20866
|
+
var GRAPH_REF_EXTRA_NODE_TYPES = [
|
|
20835
20867
|
"edge",
|
|
20836
20868
|
"ontology",
|
|
20837
20869
|
"lens",
|
|
20838
20870
|
"contradiction"
|
|
20839
|
-
]
|
|
20871
|
+
];
|
|
20872
|
+
var GRAPH_REF_NODE_TYPES = [
|
|
20873
|
+
...NODE_TYPES,
|
|
20874
|
+
...GRAPH_REF_EXTRA_NODE_TYPES
|
|
20875
|
+
];
|
|
20876
|
+
var EpistemicNodeTypeSchema = z.enum(
|
|
20877
|
+
GRAPH_REF_NODE_TYPES
|
|
20878
|
+
);
|
|
20840
20879
|
var GraphRefSchema = z.discriminatedUnion("kind", [
|
|
20841
20880
|
z.object({
|
|
20842
20881
|
kind: z.literal("epistemic_node"),
|
|
@@ -20884,33 +20923,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
|
|
|
20884
20923
|
}
|
|
20885
20924
|
|
|
20886
20925
|
// ../contracts/src/manifests/edge-policy-manifest.data.ts
|
|
20926
|
+
var publicEpistemicNodeEdgePolicy = (edgeType) => ({
|
|
20927
|
+
edgeType,
|
|
20928
|
+
fromKinds: ["epistemic_node"],
|
|
20929
|
+
toKinds: ["epistemic_node"],
|
|
20930
|
+
description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
|
|
20931
|
+
});
|
|
20887
20932
|
var edgePolicyManifest = {
|
|
20888
|
-
policies:
|
|
20889
|
-
{
|
|
20890
|
-
edgeType: "evidence_derived_from_evidence",
|
|
20891
|
-
fromKinds: ["epistemic_node"],
|
|
20892
|
-
fromNodeTypes: ["evidence"],
|
|
20893
|
-
toKinds: ["epistemic_node"],
|
|
20894
|
-
toNodeTypes: ["evidence"],
|
|
20895
|
-
description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
|
|
20896
|
-
},
|
|
20897
|
-
{
|
|
20898
|
-
edgeType: "evidence_supports_belief",
|
|
20899
|
-
fromKinds: ["epistemic_node"],
|
|
20900
|
-
fromNodeTypes: ["evidence"],
|
|
20901
|
-
toKinds: ["epistemic_node"],
|
|
20902
|
-
toNodeTypes: ["belief"],
|
|
20903
|
-
description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
|
|
20904
|
-
},
|
|
20905
|
-
{
|
|
20906
|
-
edgeType: "evidence_supports_question",
|
|
20907
|
-
fromKinds: ["epistemic_node"],
|
|
20908
|
-
fromNodeTypes: ["evidence"],
|
|
20909
|
-
toKinds: ["epistemic_node"],
|
|
20910
|
-
toNodeTypes: ["question"],
|
|
20911
|
-
description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
|
|
20912
|
-
}
|
|
20913
|
-
]
|
|
20933
|
+
policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
|
|
20914
20934
|
};
|
|
20915
20935
|
|
|
20916
20936
|
// ../contracts/src/tenant-client.contract.ts
|
|
@@ -22363,12 +22383,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
|
|
|
22363
22383
|
compactRecord4({
|
|
22364
22384
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
22365
22385
|
toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
|
|
22366
|
-
edgeType: "
|
|
22386
|
+
edgeType: "informs",
|
|
22367
22387
|
globalId: input.globalId ?? `edge:${String(
|
|
22368
22388
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
22369
22389
|
)}:${String(
|
|
22370
22390
|
input.beliefNodeId ?? input.beliefId ?? input.targetId
|
|
22371
|
-
)}:
|
|
22391
|
+
)}:informs`,
|
|
22372
22392
|
weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
|
|
22373
22393
|
context: input.rationale ?? input.context,
|
|
22374
22394
|
skipLayerValidation: true,
|
|
@@ -22381,12 +22401,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
|
|
|
22381
22401
|
compactRecord4({
|
|
22382
22402
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
22383
22403
|
toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
|
|
22384
|
-
edgeType: "
|
|
22404
|
+
edgeType: "responds_to",
|
|
22385
22405
|
globalId: input.globalId ?? `edge:${String(
|
|
22386
22406
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
22387
22407
|
)}:${String(
|
|
22388
22408
|
input.questionId ?? input.questionNodeId ?? input.targetId
|
|
22389
|
-
)}:
|
|
22409
|
+
)}:responds_to`,
|
|
22390
22410
|
weight: input.impactScore ?? input.weight,
|
|
22391
22411
|
context: input.rationale ?? input.context,
|
|
22392
22412
|
skipLayerValidation: true,
|
|
@@ -23891,10 +23911,13 @@ var tasksContracts = [
|
|
|
23891
23911
|
}
|
|
23892
23912
|
})
|
|
23893
23913
|
];
|
|
23914
|
+
var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
|
|
23915
|
+
(policy) => policy.edgeType
|
|
23916
|
+
);
|
|
23894
23917
|
var createEdgeArgs = z.object({
|
|
23895
23918
|
from: GraphRefSchema,
|
|
23896
23919
|
to: GraphRefSchema,
|
|
23897
|
-
edgeType: z.
|
|
23920
|
+
edgeType: z.enum(CREATE_EDGE_TYPES),
|
|
23898
23921
|
globalId: z.string().optional(),
|
|
23899
23922
|
weight: z.number().optional(),
|
|
23900
23923
|
confidence: z.number().optional(),
|
|
@@ -28223,7 +28246,7 @@ function createLucernStandaloneMcpServer(options) {
|
|
|
28223
28246
|
});
|
|
28224
28247
|
const server = new McpServer({
|
|
28225
28248
|
name: "lucern-mcp",
|
|
28226
|
-
version: "0.3.0-alpha.
|
|
28249
|
+
version: "0.3.0-alpha.9"
|
|
28227
28250
|
});
|
|
28228
28251
|
registerTools(server, runtime);
|
|
28229
28252
|
const resources = registerResources(server, runtime, observationStore);
|