@lucern/mcp 0.3.0-alpha.14 → 0.3.0-alpha.16
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 +62 -55
- package/dist/cli.js.map +1 -1
- package/dist/gateway.js +39 -39
- package/dist/gateway.js.map +1 -1
- package/dist/hosted-route.js +62 -55
- package/dist/hosted-route.js.map +1 -1
- package/dist/index.js +62 -55
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +30 -38
- package/dist/runtime.js.map +1 -1
- package/package.json +6 -6
package/dist/hosted-route.js
CHANGED
|
@@ -4,7 +4,7 @@ import '@modelcontextprotocol/sdk/server/stdio.js';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import * as graphIntel_star from '@lucern/reasoning-kernel/graphIntel';
|
|
6
6
|
import { v } from 'convex/values';
|
|
7
|
-
import { resolveInfisicalSecretFromBinding, SecretResolverError } from '@lucern/secrets';
|
|
7
|
+
import { resolveInfisicalSecretFromBinding, requestBrokeredInfisicalSecret, SecretResolverError } from '@lucern/secrets';
|
|
8
8
|
import * as fs from 'fs';
|
|
9
9
|
import * as path from 'path';
|
|
10
10
|
|
|
@@ -497,6 +497,7 @@ __export(src_exports, {
|
|
|
497
497
|
randomIdempotencyKey: () => randomIdempotencyKey,
|
|
498
498
|
readInfisicalRuntimeBootstrap: () => readInfisicalRuntimeBootstrap,
|
|
499
499
|
registerCustomTool: () => registerCustomTool,
|
|
500
|
+
requestBrokeredInfisicalSecret: () => requestBrokeredInfisicalSecret,
|
|
500
501
|
resolveDeliveryFailureStatus: () => resolveDeliveryFailureStatus,
|
|
501
502
|
resolveInfisicalSecretFromBinding: () => resolveInfisicalSecretFromBinding,
|
|
502
503
|
resolveText: () => resolveText,
|
|
@@ -889,13 +890,31 @@ function mergeHeaderRecord(base, addition) {
|
|
|
889
890
|
}
|
|
890
891
|
return Object.fromEntries(headers.entries());
|
|
891
892
|
}
|
|
893
|
+
function cleanHeaderValue(value) {
|
|
894
|
+
const normalized = value?.trim();
|
|
895
|
+
return normalized ? normalized : void 0;
|
|
896
|
+
}
|
|
892
897
|
function createGatewayRequestClient(config = {}) {
|
|
893
898
|
const fetchImpl = config.fetchImpl ?? fetch;
|
|
894
899
|
const baseUrl = config.baseUrl?.replace(/\/+$/, "") ?? "";
|
|
895
900
|
const maxRetries = config.maxRetries ?? 2;
|
|
896
901
|
const requestIdFactory = config.requestIdFactory ?? (() => generatePortableRequestId());
|
|
897
902
|
async function resolveAuthHeaders() {
|
|
898
|
-
const
|
|
903
|
+
const provided = config.getAuthHeaders ? await config.getAuthHeaders() : {};
|
|
904
|
+
const headers = new Headers(provided);
|
|
905
|
+
const setIfAbsent = (name, value) => {
|
|
906
|
+
const normalized = cleanHeaderValue(value);
|
|
907
|
+
if (normalized && !headers.has(name)) {
|
|
908
|
+
headers.set(name, normalized);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
setIfAbsent("x-lucern-key", config.apiKey);
|
|
912
|
+
setIfAbsent("x-lucern-session-token", config.userToken);
|
|
913
|
+
setIfAbsent("x-lucern-environment", config.environment);
|
|
914
|
+
setIfAbsent("x-lucern-clerk-id", config.clerkId);
|
|
915
|
+
setIfAbsent("x-lucern-user-id", config.userId ?? config.clerkId);
|
|
916
|
+
setIfAbsent("x-lucern-deployment-host", config.deploymentHost);
|
|
917
|
+
const base = Object.fromEntries(headers.entries());
|
|
899
918
|
const authContextInput = await resolveConfiguredAuthContext(
|
|
900
919
|
config.authContext
|
|
901
920
|
);
|
|
@@ -4347,6 +4366,8 @@ function createTasksFacade(config = {}) {
|
|
|
4347
4366
|
description: input.description,
|
|
4348
4367
|
priority: input.priority,
|
|
4349
4368
|
status: input.status,
|
|
4369
|
+
assigneeId: input.assigneeId,
|
|
4370
|
+
blockedReason: input.blockedReason,
|
|
4350
4371
|
linkedBeliefId: input.linkedBeliefId,
|
|
4351
4372
|
linkedQuestionId: input.linkedQuestionId,
|
|
4352
4373
|
linkedWorktreeId: input.linkedWorktreeId,
|
|
@@ -7789,7 +7810,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
7789
7810
|
}
|
|
7790
7811
|
|
|
7791
7812
|
// ../sdk/src/version.ts
|
|
7792
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
7813
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.16";
|
|
7793
7814
|
|
|
7794
7815
|
// ../sdk/src/workflowClient.ts
|
|
7795
7816
|
function normalizeLensQuery(value) {
|
|
@@ -8197,6 +8218,12 @@ function toGatewayConfig(config) {
|
|
|
8197
8218
|
return {
|
|
8198
8219
|
baseUrl: config.baseUrl,
|
|
8199
8220
|
fetchImpl: config.fetchImpl,
|
|
8221
|
+
apiKey: config.apiKey,
|
|
8222
|
+
userToken: config.userToken,
|
|
8223
|
+
environment: config.environment,
|
|
8224
|
+
clerkId: config.clerkId,
|
|
8225
|
+
userId: config.userId,
|
|
8226
|
+
deploymentHost: config.deploymentHost,
|
|
8200
8227
|
maxRetries: config.maxRetries,
|
|
8201
8228
|
timeoutMs: config.timeoutMs,
|
|
8202
8229
|
timeoutMsByMethod: config.timeoutMsByMethod,
|
|
@@ -8205,19 +8232,7 @@ function toGatewayConfig(config) {
|
|
|
8205
8232
|
onResponse: config.onResponse,
|
|
8206
8233
|
authContext: config.authContext,
|
|
8207
8234
|
requireCanonicalAuthContext: config.requireCanonicalAuthContext,
|
|
8208
|
-
getAuthHeaders:
|
|
8209
|
-
const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
|
|
8210
|
-
if (config.apiKey && !base["x-lucern-key"] && !base.Authorization) {
|
|
8211
|
-
base["x-lucern-key"] = config.apiKey;
|
|
8212
|
-
}
|
|
8213
|
-
if (config.userToken && !base["x-lucern-session-token"]) {
|
|
8214
|
-
base["x-lucern-session-token"] = config.userToken;
|
|
8215
|
-
}
|
|
8216
|
-
if (config.environment && !base["x-lucern-environment"]) {
|
|
8217
|
-
base["x-lucern-environment"] = config.environment;
|
|
8218
|
-
}
|
|
8219
|
-
return base;
|
|
8220
|
-
}
|
|
8235
|
+
getAuthHeaders: config.getAuthHeaders
|
|
8221
8236
|
};
|
|
8222
8237
|
}
|
|
8223
8238
|
function exposeGatewayData(response) {
|
|
@@ -17890,6 +17905,7 @@ defineTable({
|
|
|
17890
17905
|
shape: z.object({
|
|
17891
17906
|
"tenantId": idOf("tenants"),
|
|
17892
17907
|
"workspaceId": idOf("workspaces").optional(),
|
|
17908
|
+
"environment": z.enum(["dev", "staging", "prod"]).optional(),
|
|
17893
17909
|
"keyPrefix": z.enum(["luc", "stk"]),
|
|
17894
17910
|
"keyHash": z.string(),
|
|
17895
17911
|
"keyHint": z.string(),
|
|
@@ -23201,6 +23217,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
|
|
|
23201
23217
|
vercelProjectName: "ai-chatbot-diao",
|
|
23202
23218
|
vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
|
|
23203
23219
|
vercelProjectId: "prj_PihFw8kohSSw14nZs9YQV3xVo517",
|
|
23220
|
+
vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
|
|
23204
23221
|
repository: {
|
|
23205
23222
|
owner: "stack-vc",
|
|
23206
23223
|
name: "front-end"
|
|
@@ -23221,6 +23238,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
|
|
|
23221
23238
|
vercelProjectName: "stackos",
|
|
23222
23239
|
vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
|
|
23223
23240
|
vercelProjectId: "prj_rXLAL0Z6v9p1fasKbomby6GI7kau",
|
|
23241
|
+
vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
|
|
23224
23242
|
repository: {
|
|
23225
23243
|
owner: "stack-vc",
|
|
23226
23244
|
name: "stackos"
|
|
@@ -23241,6 +23259,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
|
|
|
23241
23259
|
vercelProjectName: "stackos-engineering-graph",
|
|
23242
23260
|
vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
|
|
23243
23261
|
vercelProjectId: "prj_zAU0Zn9GkbHjHI63dxW4vLpmoqTJ",
|
|
23262
|
+
vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
|
|
23244
23263
|
repository: {
|
|
23245
23264
|
owner: "stack-vc",
|
|
23246
23265
|
name: "stackos-engineering-graph"
|
|
@@ -23261,6 +23280,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
|
|
|
23261
23280
|
vercelProjectName: "lucern-graph",
|
|
23262
23281
|
vercelTeamId: "team_vTHxxs8GAoAFUe6RWMlYt7fY",
|
|
23263
23282
|
vercelProjectId: "prj_KJ8EKV8vGM5xURpqmwTwmECEGPgQ",
|
|
23283
|
+
vercelWriterTokenEnv: "LUCERN_VERCEL_TOKEN",
|
|
23264
23284
|
repository: {
|
|
23265
23285
|
owner: "LucernAI",
|
|
23266
23286
|
name: "lucern-graph"
|
|
@@ -26930,7 +26950,7 @@ function compactRecord2(input) {
|
|
|
26930
26950
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
26931
26951
|
);
|
|
26932
26952
|
}
|
|
26933
|
-
|
|
26953
|
+
defineProjection({
|
|
26934
26954
|
contractName: "list_beliefs",
|
|
26935
26955
|
inputSchema: listBeliefsInputSchema,
|
|
26936
26956
|
project: (input) => compactRecord2({
|
|
@@ -27559,11 +27579,8 @@ var identityContracts = [
|
|
|
27559
27579
|
sdkNamespace: "identity",
|
|
27560
27580
|
sdkMethod: "whoami",
|
|
27561
27581
|
summary: "Describe the current gateway principal.",
|
|
27562
|
-
|
|
27563
|
-
|
|
27564
|
-
functionName: "whoami",
|
|
27565
|
-
kind: "query",
|
|
27566
|
-
inputProjection: withPrincipal
|
|
27582
|
+
gateway: {
|
|
27583
|
+
handler: "identity.whoami"
|
|
27567
27584
|
}
|
|
27568
27585
|
}),
|
|
27569
27586
|
surfaceContract({
|
|
@@ -27583,7 +27600,7 @@ var identityContracts = [
|
|
|
27583
27600
|
providerProjectId: z.string().min(1).optional()
|
|
27584
27601
|
}),
|
|
27585
27602
|
convex: {
|
|
27586
|
-
module: "
|
|
27603
|
+
module: "platform",
|
|
27587
27604
|
functionName: "resolveInteractivePrincipal",
|
|
27588
27605
|
kind: "query"
|
|
27589
27606
|
}
|
|
@@ -27667,15 +27684,6 @@ var beliefLookupInput = (input) => compactRecord4({
|
|
|
27667
27684
|
var beliefNodeInput = (input) => compactRecord4({
|
|
27668
27685
|
nodeId: input.nodeId ?? input.id ?? input.beliefId
|
|
27669
27686
|
});
|
|
27670
|
-
var beliefTopicInput = (input) => {
|
|
27671
|
-
const parsed = listBeliefsProjection.inputSchema.safeParse(input);
|
|
27672
|
-
if (!parsed.success) {
|
|
27673
|
-
throw new Error(
|
|
27674
|
-
`list_beliefs projection input rejected: ${parsed.error.message}`
|
|
27675
|
-
);
|
|
27676
|
-
}
|
|
27677
|
-
return compactRecord4(listBeliefsProjection.project(parsed.data));
|
|
27678
|
-
};
|
|
27679
27687
|
var createBeliefInput = (input, context) => {
|
|
27680
27688
|
return withUserId(
|
|
27681
27689
|
compactRecord4({
|
|
@@ -27764,11 +27772,8 @@ var beliefsContracts = [
|
|
|
27764
27772
|
sdkNamespace: "beliefs",
|
|
27765
27773
|
sdkMethod: "listBeliefs",
|
|
27766
27774
|
summary: "List beliefs for a topic.",
|
|
27767
|
-
|
|
27768
|
-
|
|
27769
|
-
functionName: "getByTopic",
|
|
27770
|
-
kind: "query",
|
|
27771
|
-
inputProjection: beliefTopicInput
|
|
27775
|
+
gateway: {
|
|
27776
|
+
handler: "beliefs.list"
|
|
27772
27777
|
},
|
|
27773
27778
|
args: listBeliefsInputSchema
|
|
27774
27779
|
}),
|
|
@@ -27953,12 +27958,6 @@ var evidenceIdInput = (input) => compactRecord4({
|
|
|
27953
27958
|
insightId: input.insightId,
|
|
27954
27959
|
nodeId: input.nodeId ?? input.id ?? input.evidenceId
|
|
27955
27960
|
});
|
|
27956
|
-
var evidenceTopicInput = (input) => compactRecord4({
|
|
27957
|
-
topicId: input.topicId,
|
|
27958
|
-
status: input.status,
|
|
27959
|
-
userId: input.userId,
|
|
27960
|
-
limit: input.limit
|
|
27961
|
-
});
|
|
27962
27961
|
var createEvidenceInput = (input, context) => {
|
|
27963
27962
|
const parsed = createEvidenceProjection.inputSchema.safeParse(input);
|
|
27964
27963
|
if (!parsed.success) {
|
|
@@ -28089,11 +28088,8 @@ var evidenceContracts = [
|
|
|
28089
28088
|
sdkNamespace: "evidence",
|
|
28090
28089
|
sdkMethod: "listEvidence",
|
|
28091
28090
|
summary: "List evidence for a topic.",
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
functionName: "getByTopic",
|
|
28095
|
-
kind: "query",
|
|
28096
|
-
inputProjection: evidenceTopicInput
|
|
28091
|
+
gateway: {
|
|
28092
|
+
handler: "evidence.list"
|
|
28097
28093
|
}
|
|
28098
28094
|
}),
|
|
28099
28095
|
surfaceContract({
|
|
@@ -28328,11 +28324,8 @@ var questionsContracts = [
|
|
|
28328
28324
|
sdkNamespace: "questions",
|
|
28329
28325
|
sdkMethod: "listQuestions",
|
|
28330
28326
|
summary: "List questions for a topic.",
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
functionName: "getByTopic",
|
|
28334
|
-
kind: "query",
|
|
28335
|
-
inputProjection: questionTopicInput
|
|
28327
|
+
gateway: {
|
|
28328
|
+
handler: "questions.list"
|
|
28336
28329
|
}
|
|
28337
28330
|
}),
|
|
28338
28331
|
surfaceContract({
|
|
@@ -29835,6 +29828,19 @@ var createTaskArgs = z.object({
|
|
|
29835
29828
|
tags: z.array(z.string()).optional().describe("Free-form tags."),
|
|
29836
29829
|
metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
|
|
29837
29830
|
});
|
|
29831
|
+
var updateTaskArgs = z.object({
|
|
29832
|
+
taskId: z.string().describe("Task to update."),
|
|
29833
|
+
title: z.string().optional().describe("Updated task title."),
|
|
29834
|
+
description: z.string().optional().describe("Updated task description."),
|
|
29835
|
+
priority: taskPrioritySchema.optional().describe("Updated priority."),
|
|
29836
|
+
status: taskStatusSchema2.optional().describe("Updated status."),
|
|
29837
|
+
linkedWorktreeId: z.string().optional().describe("Worktree this task belongs to."),
|
|
29838
|
+
linkedBeliefId: z.string().optional().describe("Belief this task supports."),
|
|
29839
|
+
linkedQuestionId: z.string().optional().describe("Question this task addresses."),
|
|
29840
|
+
assigneeId: z.string().optional().describe("Principal assigned to the task."),
|
|
29841
|
+
blockedReason: z.string().optional().describe("Reason the task is blocked or deferred."),
|
|
29842
|
+
metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
|
|
29843
|
+
});
|
|
29838
29844
|
var createTaskInput = (input) => compactRecord4({
|
|
29839
29845
|
title: input.title,
|
|
29840
29846
|
topicId: input.topicId,
|
|
@@ -29921,7 +29927,8 @@ var tasksContracts = [
|
|
|
29921
29927
|
kind: "mutation",
|
|
29922
29928
|
inputProjection: taskInput
|
|
29923
29929
|
},
|
|
29924
|
-
gateway: { handler: "tasks.update" }
|
|
29930
|
+
gateway: { handler: "tasks.update" },
|
|
29931
|
+
args: updateTaskArgs
|
|
29925
29932
|
}),
|
|
29926
29933
|
surfaceContract({
|
|
29927
29934
|
name: "complete_task",
|
|
@@ -34637,7 +34644,7 @@ function createLucernStandaloneMcpServer(options) {
|
|
|
34637
34644
|
});
|
|
34638
34645
|
const server = new McpServer({
|
|
34639
34646
|
name: "lucern-mcp",
|
|
34640
|
-
version: "0.3.0-alpha.
|
|
34647
|
+
version: "0.3.0-alpha.16"
|
|
34641
34648
|
});
|
|
34642
34649
|
registerTools(server, runtime);
|
|
34643
34650
|
const resources = registerResources(server, runtime, observationStore);
|