@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/cli.js +152 -100
- package/dist/cli.js.map +1 -1
- package/dist/gateway.js +51 -40
- package/dist/gateway.js.map +1 -1
- package/dist/hosted-route.js +145 -98
- package/dist/hosted-route.js.map +1 -1
- package/dist/index.js +152 -100
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +65 -44
- package/dist/runtime.js.map +1 -1
- package/package.json +6 -6
package/dist/hosted-route.js
CHANGED
|
@@ -4425,50 +4425,55 @@ function cleanNumber(value) {
|
|
|
4425
4425
|
function cleanBoolean(value) {
|
|
4426
4426
|
return typeof value === "boolean" ? value : void 0;
|
|
4427
4427
|
}
|
|
4428
|
-
function buildCompileContextRequest(
|
|
4429
|
-
const
|
|
4430
|
-
const
|
|
4428
|
+
function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
|
|
4429
|
+
const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
|
|
4430
|
+
const payload = {};
|
|
4431
|
+
const topicId = typeof topicIdOrInput === "string" ? cleanString4(topicIdOrInput) : cleanString4(effectiveInput.topicId);
|
|
4432
|
+
if (topicId) {
|
|
4433
|
+
payload.topicId = topicId;
|
|
4434
|
+
}
|
|
4435
|
+
const query5 = cleanString4(effectiveInput.query);
|
|
4431
4436
|
if (query5) {
|
|
4432
4437
|
payload.query = query5;
|
|
4433
4438
|
}
|
|
4434
|
-
const budget = cleanNumber(
|
|
4439
|
+
const budget = cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);
|
|
4435
4440
|
if (budget !== void 0) {
|
|
4436
4441
|
payload.budget = budget;
|
|
4437
4442
|
}
|
|
4438
|
-
const ranking = cleanString4(
|
|
4443
|
+
const ranking = cleanString4(effectiveInput.ranking) ?? cleanString4(effectiveInput.rankingProfile);
|
|
4439
4444
|
if (ranking) {
|
|
4440
4445
|
payload.ranking = ranking;
|
|
4441
4446
|
}
|
|
4442
|
-
const limit = cleanNumber(
|
|
4447
|
+
const limit = cleanNumber(effectiveInput.limit);
|
|
4443
4448
|
if (limit !== void 0) {
|
|
4444
4449
|
payload.limit = limit;
|
|
4445
4450
|
}
|
|
4446
|
-
const maxDepth = cleanNumber(
|
|
4451
|
+
const maxDepth = cleanNumber(effectiveInput.maxDepth);
|
|
4447
4452
|
if (maxDepth !== void 0) {
|
|
4448
4453
|
payload.maxDepth = maxDepth;
|
|
4449
4454
|
}
|
|
4450
|
-
const includeEntities = cleanBoolean(
|
|
4455
|
+
const includeEntities = cleanBoolean(effectiveInput.includeEntities);
|
|
4451
4456
|
if (includeEntities !== void 0) {
|
|
4452
4457
|
payload.includeEntities = includeEntities;
|
|
4453
4458
|
}
|
|
4454
|
-
const mode = cleanString4(
|
|
4459
|
+
const mode = cleanString4(effectiveInput.mode);
|
|
4455
4460
|
if (mode) {
|
|
4456
4461
|
payload.mode = mode;
|
|
4457
4462
|
}
|
|
4458
|
-
const includeFailures = cleanBoolean(
|
|
4463
|
+
const includeFailures = cleanBoolean(effectiveInput.includeFailures);
|
|
4459
4464
|
if (includeFailures !== void 0) {
|
|
4460
4465
|
payload.includeFailures = includeFailures;
|
|
4461
4466
|
}
|
|
4462
|
-
const worktreeId = cleanString4(
|
|
4467
|
+
const worktreeId = cleanString4(effectiveInput.worktreeId);
|
|
4463
4468
|
if (worktreeId) {
|
|
4464
4469
|
payload.worktreeId = worktreeId;
|
|
4465
4470
|
}
|
|
4466
|
-
const sessionId = cleanString4(
|
|
4471
|
+
const sessionId = cleanString4(effectiveInput.sessionId);
|
|
4467
4472
|
if (sessionId) {
|
|
4468
4473
|
payload.sessionId = sessionId;
|
|
4469
4474
|
}
|
|
4470
|
-
if (Array.isArray(
|
|
4471
|
-
payload.packWeightOverrides =
|
|
4475
|
+
if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
|
|
4476
|
+
payload.packWeightOverrides = effectiveInput.packWeightOverrides;
|
|
4472
4477
|
}
|
|
4473
4478
|
return {
|
|
4474
4479
|
path: "/api/platform/v1/context/compile",
|
|
@@ -4480,13 +4485,20 @@ function createContextClient(config = {}) {
|
|
|
4480
4485
|
const gateway = createGatewayRequestClient(config);
|
|
4481
4486
|
return {
|
|
4482
4487
|
/**
|
|
4483
|
-
* Compile a focused reasoning context pack
|
|
4484
|
-
* @param
|
|
4488
|
+
* Compile a focused reasoning context pack.
|
|
4489
|
+
* @param topicIdOrInput - Optional topic ID, or compile input for query-first resolution.
|
|
4485
4490
|
* @param input - Optional compile parameters (query, budget, ranking, etc.).
|
|
4486
4491
|
* @returns The compiled context payload with beliefs, questions, and evidence.
|
|
4487
4492
|
*/
|
|
4488
|
-
async compile(
|
|
4489
|
-
const request = buildCompileContextRequest(
|
|
4493
|
+
async compile(topicIdOrInput = {}, input = {}) {
|
|
4494
|
+
const request = buildCompileContextRequest(topicIdOrInput, input);
|
|
4495
|
+
return gateway.request({
|
|
4496
|
+
...request,
|
|
4497
|
+
body: request.body
|
|
4498
|
+
});
|
|
4499
|
+
},
|
|
4500
|
+
async compileByQuery(input = {}) {
|
|
4501
|
+
const request = buildCompileContextRequest(input);
|
|
4490
4502
|
return gateway.request({
|
|
4491
4503
|
...request,
|
|
4492
4504
|
body: request.body
|
|
@@ -6884,6 +6896,21 @@ function createSchemaClient(config = {}) {
|
|
|
6884
6896
|
}
|
|
6885
6897
|
|
|
6886
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
|
+
}
|
|
6887
6914
|
function asNodeArray(data) {
|
|
6888
6915
|
const rows = asListItems(data, "nodes");
|
|
6889
6916
|
if (rows.length > 0) {
|
|
@@ -7261,7 +7288,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
7261
7288
|
}
|
|
7262
7289
|
|
|
7263
7290
|
// ../sdk/src/version.ts
|
|
7264
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
7291
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
|
|
7265
7292
|
|
|
7266
7293
|
// ../sdk/src/workflowClient.ts
|
|
7267
7294
|
function normalizeLensQuery(value) {
|
|
@@ -7782,11 +7809,11 @@ function createLucernClient(config = {}) {
|
|
|
7782
7809
|
}
|
|
7783
7810
|
}
|
|
7784
7811
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
7785
|
-
const payload =
|
|
7812
|
+
const payload = normalizeCustomToolPayload(input);
|
|
7786
7813
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
7787
7814
|
};
|
|
7788
7815
|
const getCustomNamespace = (namespace) => {
|
|
7789
|
-
const normalized = namespace
|
|
7816
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
7790
7817
|
const cached = customNamespaceCache.get(normalized);
|
|
7791
7818
|
if (cached) {
|
|
7792
7819
|
return cached;
|
|
@@ -8246,10 +8273,7 @@ function createLucernClient(config = {}) {
|
|
|
8246
8273
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
8247
8274
|
},
|
|
8248
8275
|
refine(nodeId, textOrInput, rationale) {
|
|
8249
|
-
const payload =
|
|
8250
|
-
text: textOrInput.text,
|
|
8251
|
-
rationale: textOrInput.rationale
|
|
8252
|
-
};
|
|
8276
|
+
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
8253
8277
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
8254
8278
|
},
|
|
8255
8279
|
updateConfidence(nodeId, input) {
|
|
@@ -8287,7 +8311,7 @@ function createLucernClient(config = {}) {
|
|
|
8287
8311
|
}).then(exposeGatewayData);
|
|
8288
8312
|
},
|
|
8289
8313
|
archive(nodeId, input) {
|
|
8290
|
-
const payload =
|
|
8314
|
+
const payload = buildBeliefsArchivePayload(input);
|
|
8291
8315
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
8292
8316
|
},
|
|
8293
8317
|
list(args) {
|
|
@@ -9327,7 +9351,7 @@ function createLucernClient(config = {}) {
|
|
|
9327
9351
|
list: listRegisteredCustomTools,
|
|
9328
9352
|
clear: clearRegisteredCustomTools,
|
|
9329
9353
|
invoke(name, input = {}) {
|
|
9330
|
-
const fullName = name
|
|
9354
|
+
const fullName = resolveCustomToolFullName(name);
|
|
9331
9355
|
return invokeCustomTool(fullName, input);
|
|
9332
9356
|
},
|
|
9333
9357
|
namespace: getCustomNamespace
|
|
@@ -9426,50 +9450,55 @@ function cleanNumber2(value) {
|
|
|
9426
9450
|
function cleanBoolean2(value) {
|
|
9427
9451
|
return typeof value === "boolean" ? value : void 0;
|
|
9428
9452
|
}
|
|
9429
|
-
function buildCompileContextRequest2(
|
|
9430
|
-
const
|
|
9431
|
-
const
|
|
9453
|
+
function buildCompileContextRequest2(topicIdOrInput = {}, input = {}) {
|
|
9454
|
+
const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
|
|
9455
|
+
const payload = {};
|
|
9456
|
+
const topicId = typeof topicIdOrInput === "string" ? cleanString6(topicIdOrInput) : cleanString6(effectiveInput.topicId);
|
|
9457
|
+
if (topicId) {
|
|
9458
|
+
payload.topicId = topicId;
|
|
9459
|
+
}
|
|
9460
|
+
const query5 = cleanString6(effectiveInput.query);
|
|
9432
9461
|
if (query5) {
|
|
9433
9462
|
payload.query = query5;
|
|
9434
9463
|
}
|
|
9435
|
-
const budget = cleanNumber2(
|
|
9464
|
+
const budget = cleanNumber2(effectiveInput.budget) ?? cleanNumber2(effectiveInput.tokenBudget);
|
|
9436
9465
|
if (budget !== void 0) {
|
|
9437
9466
|
payload.budget = budget;
|
|
9438
9467
|
}
|
|
9439
|
-
const ranking = cleanString6(
|
|
9468
|
+
const ranking = cleanString6(effectiveInput.ranking) ?? cleanString6(effectiveInput.rankingProfile);
|
|
9440
9469
|
if (ranking) {
|
|
9441
9470
|
payload.ranking = ranking;
|
|
9442
9471
|
}
|
|
9443
|
-
const limit = cleanNumber2(
|
|
9472
|
+
const limit = cleanNumber2(effectiveInput.limit);
|
|
9444
9473
|
if (limit !== void 0) {
|
|
9445
9474
|
payload.limit = limit;
|
|
9446
9475
|
}
|
|
9447
|
-
const maxDepth = cleanNumber2(
|
|
9476
|
+
const maxDepth = cleanNumber2(effectiveInput.maxDepth);
|
|
9448
9477
|
if (maxDepth !== void 0) {
|
|
9449
9478
|
payload.maxDepth = maxDepth;
|
|
9450
9479
|
}
|
|
9451
|
-
const includeEntities = cleanBoolean2(
|
|
9480
|
+
const includeEntities = cleanBoolean2(effectiveInput.includeEntities);
|
|
9452
9481
|
if (includeEntities !== void 0) {
|
|
9453
9482
|
payload.includeEntities = includeEntities;
|
|
9454
9483
|
}
|
|
9455
|
-
const mode = cleanString6(
|
|
9484
|
+
const mode = cleanString6(effectiveInput.mode);
|
|
9456
9485
|
if (mode) {
|
|
9457
9486
|
payload.mode = mode;
|
|
9458
9487
|
}
|
|
9459
|
-
const includeFailures = cleanBoolean2(
|
|
9488
|
+
const includeFailures = cleanBoolean2(effectiveInput.includeFailures);
|
|
9460
9489
|
if (includeFailures !== void 0) {
|
|
9461
9490
|
payload.includeFailures = includeFailures;
|
|
9462
9491
|
}
|
|
9463
|
-
const worktreeId = cleanString6(
|
|
9492
|
+
const worktreeId = cleanString6(effectiveInput.worktreeId);
|
|
9464
9493
|
if (worktreeId) {
|
|
9465
9494
|
payload.worktreeId = worktreeId;
|
|
9466
9495
|
}
|
|
9467
|
-
const sessionId = cleanString6(
|
|
9496
|
+
const sessionId = cleanString6(effectiveInput.sessionId);
|
|
9468
9497
|
if (sessionId) {
|
|
9469
9498
|
payload.sessionId = sessionId;
|
|
9470
9499
|
}
|
|
9471
|
-
if (Array.isArray(
|
|
9472
|
-
payload.packWeightOverrides =
|
|
9500
|
+
if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
|
|
9501
|
+
payload.packWeightOverrides = effectiveInput.packWeightOverrides;
|
|
9473
9502
|
}
|
|
9474
9503
|
return {
|
|
9475
9504
|
path: "/api/platform/v1/context/compile",
|
|
@@ -9479,8 +9508,12 @@ function buildCompileContextRequest2(topicId, input = {}) {
|
|
|
9479
9508
|
}
|
|
9480
9509
|
function createContextFacade(config) {
|
|
9481
9510
|
return {
|
|
9482
|
-
compile(
|
|
9483
|
-
const request = buildCompileContextRequest2(
|
|
9511
|
+
compile(topicIdOrInput = {}, input = {}) {
|
|
9512
|
+
const request = buildCompileContextRequest2(topicIdOrInput, input);
|
|
9513
|
+
return config.transport.request(request);
|
|
9514
|
+
},
|
|
9515
|
+
compileByQuery(input = {}) {
|
|
9516
|
+
const request = buildCompileContextRequest2(input);
|
|
9484
9517
|
return config.transport.request(request);
|
|
9485
9518
|
}
|
|
9486
9519
|
};
|
|
@@ -13119,15 +13152,15 @@ var IDENTITY_WHOAMI = {
|
|
|
13119
13152
|
};
|
|
13120
13153
|
var COMPILE_CONTEXT = {
|
|
13121
13154
|
name: "compile_context",
|
|
13122
|
-
description: "Compile a focused reasoning context
|
|
13155
|
+
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.",
|
|
13123
13156
|
parameters: {
|
|
13124
13157
|
topicId: {
|
|
13125
13158
|
type: "string",
|
|
13126
|
-
description: "
|
|
13159
|
+
description: "Optional topic scope ID. Omit to resolve the topic from query."
|
|
13127
13160
|
},
|
|
13128
13161
|
query: {
|
|
13129
13162
|
type: "string",
|
|
13130
|
-
description: "
|
|
13163
|
+
description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
|
|
13131
13164
|
},
|
|
13132
13165
|
budget: {
|
|
13133
13166
|
type: "number",
|
|
@@ -13151,7 +13184,7 @@ var COMPILE_CONTEXT = {
|
|
|
13151
13184
|
description: "Include related ontological entities in the compiled result"
|
|
13152
13185
|
}
|
|
13153
13186
|
},
|
|
13154
|
-
required: [
|
|
13187
|
+
required: [],
|
|
13155
13188
|
response: {
|
|
13156
13189
|
description: "Compiled context pack for the requested topic",
|
|
13157
13190
|
fields: {
|
|
@@ -20805,17 +20838,44 @@ z.object({
|
|
|
20805
20838
|
message: "SL invariant b+d+u=1 violated at API boundary"
|
|
20806
20839
|
}
|
|
20807
20840
|
);
|
|
20808
|
-
|
|
20841
|
+
|
|
20842
|
+
// ../contracts/src/schema-helpers/spine/tables/epistemicNodes.ts
|
|
20843
|
+
var NODE_TYPES = [
|
|
20844
|
+
"decision",
|
|
20809
20845
|
"belief",
|
|
20810
|
-
"evidence",
|
|
20811
20846
|
"question",
|
|
20812
|
-
"
|
|
20847
|
+
"theme",
|
|
20848
|
+
"deal",
|
|
20813
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 = [
|
|
20814
20867
|
"edge",
|
|
20815
20868
|
"ontology",
|
|
20816
20869
|
"lens",
|
|
20817
20870
|
"contradiction"
|
|
20818
|
-
]
|
|
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
|
+
);
|
|
20819
20879
|
var GraphRefSchema = z.discriminatedUnion("kind", [
|
|
20820
20880
|
z.object({
|
|
20821
20881
|
kind: z.literal("epistemic_node"),
|
|
@@ -20863,33 +20923,14 @@ function assertEdgePolicyAllowed(manifest, edgeType, from, to) {
|
|
|
20863
20923
|
}
|
|
20864
20924
|
|
|
20865
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
|
+
});
|
|
20866
20932
|
var edgePolicyManifest = {
|
|
20867
|
-
policies:
|
|
20868
|
-
{
|
|
20869
|
-
edgeType: "evidence_derived_from_evidence",
|
|
20870
|
-
fromKinds: ["epistemic_node"],
|
|
20871
|
-
fromNodeTypes: ["evidence"],
|
|
20872
|
-
toKinds: ["epistemic_node"],
|
|
20873
|
-
toNodeTypes: ["evidence"],
|
|
20874
|
-
description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
|
|
20875
|
-
},
|
|
20876
|
-
{
|
|
20877
|
-
edgeType: "evidence_supports_belief",
|
|
20878
|
-
fromKinds: ["epistemic_node"],
|
|
20879
|
-
fromNodeTypes: ["evidence"],
|
|
20880
|
-
toKinds: ["epistemic_node"],
|
|
20881
|
-
toNodeTypes: ["belief"],
|
|
20882
|
-
description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
|
|
20883
|
-
},
|
|
20884
|
-
{
|
|
20885
|
-
edgeType: "evidence_supports_question",
|
|
20886
|
-
fromKinds: ["epistemic_node"],
|
|
20887
|
-
fromNodeTypes: ["evidence"],
|
|
20888
|
-
toKinds: ["epistemic_node"],
|
|
20889
|
-
toNodeTypes: ["question"],
|
|
20890
|
-
description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
|
|
20891
|
-
}
|
|
20892
|
-
]
|
|
20933
|
+
policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
|
|
20893
20934
|
};
|
|
20894
20935
|
|
|
20895
20936
|
// ../contracts/src/tenant-client.contract.ts
|
|
@@ -21876,7 +21917,7 @@ var contextContracts = [
|
|
|
21876
21917
|
path: "/context/compile",
|
|
21877
21918
|
sdkNamespace: "context",
|
|
21878
21919
|
sdkMethod: "compileContext",
|
|
21879
|
-
summary: "Compile a focused reasoning context
|
|
21920
|
+
summary: "Compile a focused reasoning context, resolving topic from query when omitted.",
|
|
21880
21921
|
convex: {
|
|
21881
21922
|
module: "contextCompiler",
|
|
21882
21923
|
functionName: "compile",
|
|
@@ -22342,12 +22383,12 @@ var linkEvidenceToBeliefEdgeInput = (input, context) => withCreatedBy(
|
|
|
22342
22383
|
compactRecord4({
|
|
22343
22384
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
22344
22385
|
toNodeId: input.beliefNodeId ?? input.beliefId ?? input.targetId,
|
|
22345
|
-
edgeType: "
|
|
22386
|
+
edgeType: "informs",
|
|
22346
22387
|
globalId: input.globalId ?? `edge:${String(
|
|
22347
22388
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
22348
22389
|
)}:${String(
|
|
22349
22390
|
input.beliefNodeId ?? input.beliefId ?? input.targetId
|
|
22350
|
-
)}:
|
|
22391
|
+
)}:informs`,
|
|
22351
22392
|
weight: typeof input.weight === "number" ? input.weight : input.type === "contradicting" ? -1 : 1,
|
|
22352
22393
|
context: input.rationale ?? input.context,
|
|
22353
22394
|
skipLayerValidation: true,
|
|
@@ -22360,12 +22401,12 @@ var linkEvidenceToQuestionEdgeInput = (input, context) => withCreatedBy(
|
|
|
22360
22401
|
compactRecord4({
|
|
22361
22402
|
fromNodeId: input.insightId ?? input.evidenceNodeId ?? input.evidenceId,
|
|
22362
22403
|
toNodeId: input.questionId ?? input.questionNodeId ?? input.targetId,
|
|
22363
|
-
edgeType: "
|
|
22404
|
+
edgeType: "responds_to",
|
|
22364
22405
|
globalId: input.globalId ?? `edge:${String(
|
|
22365
22406
|
input.insightId ?? input.evidenceNodeId ?? input.evidenceId
|
|
22366
22407
|
)}:${String(
|
|
22367
22408
|
input.questionId ?? input.questionNodeId ?? input.targetId
|
|
22368
|
-
)}:
|
|
22409
|
+
)}:responds_to`,
|
|
22369
22410
|
weight: input.impactScore ?? input.weight,
|
|
22370
22411
|
context: input.rationale ?? input.context,
|
|
22371
22412
|
skipLayerValidation: true,
|
|
@@ -23870,10 +23911,13 @@ var tasksContracts = [
|
|
|
23870
23911
|
}
|
|
23871
23912
|
})
|
|
23872
23913
|
];
|
|
23914
|
+
var CREATE_EDGE_TYPES = edgePolicyManifest.policies.map(
|
|
23915
|
+
(policy) => policy.edgeType
|
|
23916
|
+
);
|
|
23873
23917
|
var createEdgeArgs = z.object({
|
|
23874
23918
|
from: GraphRefSchema,
|
|
23875
23919
|
to: GraphRefSchema,
|
|
23876
|
-
edgeType: z.
|
|
23920
|
+
edgeType: z.enum(CREATE_EDGE_TYPES),
|
|
23877
23921
|
globalId: z.string().optional(),
|
|
23878
23922
|
weight: z.number().optional(),
|
|
23879
23923
|
confidence: z.number().optional(),
|
|
@@ -26343,24 +26387,27 @@ function readResultString(value, key) {
|
|
|
26343
26387
|
}
|
|
26344
26388
|
function createContextHandlers(context) {
|
|
26345
26389
|
const compiler = createContextClient(context.sdkConfig);
|
|
26390
|
+
const functionSurface = createFunctionSurfaceClient(context.sdkConfig);
|
|
26346
26391
|
return {
|
|
26347
26392
|
compile_context: contractToHandler(
|
|
26348
26393
|
MCP_TOOL_CONTRACTS.compile_context,
|
|
26349
26394
|
async (params) => {
|
|
26350
|
-
const topicId = readTopicId4(params
|
|
26351
|
-
const
|
|
26352
|
-
|
|
26353
|
-
{
|
|
26354
|
-
|
|
26355
|
-
|
|
26356
|
-
|
|
26357
|
-
|
|
26358
|
-
|
|
26359
|
-
|
|
26360
|
-
|
|
26361
|
-
|
|
26362
|
-
|
|
26363
|
-
|
|
26395
|
+
const topicId = readTopicId4(params);
|
|
26396
|
+
const query5 = readString3(params, "query");
|
|
26397
|
+
const input = {
|
|
26398
|
+
...query5 ? { query: query5 } : {},
|
|
26399
|
+
...readNumber2(params, "budget") !== void 0 ? { budget: readNumber2(params, "budget") } : {},
|
|
26400
|
+
...readString3(params, "ranking") ? {
|
|
26401
|
+
ranking: readString3(params, "ranking")
|
|
26402
|
+
} : {},
|
|
26403
|
+
...readNumber2(params, "limit") !== void 0 ? { limit: readNumber2(params, "limit") } : {},
|
|
26404
|
+
...readNumber2(params, "maxDepth") !== void 0 ? { maxDepth: readNumber2(params, "maxDepth") } : {},
|
|
26405
|
+
...readBoolean(params, "includeEntities") !== void 0 ? { includeEntities: readBoolean(params, "includeEntities") } : {}
|
|
26406
|
+
};
|
|
26407
|
+
if (!topicId && !query5) {
|
|
26408
|
+
throw new Error("[compile_context] query is required when topicId is omitted.");
|
|
26409
|
+
}
|
|
26410
|
+
const response = topicId ? await compiler.compile(topicId, input) : await functionSurface.compileContext(input);
|
|
26364
26411
|
writeLocalLucernContext({
|
|
26365
26412
|
topicId: readResultString(response.data, "topicId") ?? topicId,
|
|
26366
26413
|
topicName: readResultString(response.data, "topicName"),
|
|
@@ -28199,7 +28246,7 @@ function createLucernStandaloneMcpServer(options) {
|
|
|
28199
28246
|
});
|
|
28200
28247
|
const server = new McpServer({
|
|
28201
28248
|
name: "lucern-mcp",
|
|
28202
|
-
version: "0.3.0-alpha.
|
|
28249
|
+
version: "0.3.0-alpha.9"
|
|
28203
28250
|
});
|
|
28204
28251
|
registerTools(server, runtime);
|
|
28205
28252
|
const resources = registerResources(server, runtime, observationStore);
|