@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 CHANGED
@@ -11,7 +11,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
11
11
  import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
12
12
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
13
13
  import * as graphIntel_star from '@lucern/reasoning-kernel/graphIntel';
14
- import { resolveInfisicalSecretFromBinding, SecretResolverError } from '@lucern/secrets';
14
+ import { resolveInfisicalSecretFromBinding, requestBrokeredInfisicalSecret, SecretResolverError } from '@lucern/secrets';
15
15
 
16
16
  var __defProp = Object.defineProperty;
17
17
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1170,6 +1170,7 @@ defineTable({
1170
1170
  shape: z.object({
1171
1171
  "tenantId": idOf("tenants"),
1172
1172
  "workspaceId": idOf("workspaces").optional(),
1173
+ "environment": z.enum(["dev", "staging", "prod"]).optional(),
1173
1174
  "keyPrefix": z.enum(["luc", "stk"]),
1174
1175
  "keyHash": z.string(),
1175
1176
  "keyHint": z.string(),
@@ -6481,6 +6482,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6481
6482
  vercelProjectName: "ai-chatbot-diao",
6482
6483
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6483
6484
  vercelProjectId: "prj_PihFw8kohSSw14nZs9YQV3xVo517",
6485
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6484
6486
  repository: {
6485
6487
  owner: "stack-vc",
6486
6488
  name: "front-end"
@@ -6501,6 +6503,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6501
6503
  vercelProjectName: "stackos",
6502
6504
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6503
6505
  vercelProjectId: "prj_rXLAL0Z6v9p1fasKbomby6GI7kau",
6506
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6504
6507
  repository: {
6505
6508
  owner: "stack-vc",
6506
6509
  name: "stackos"
@@ -6521,6 +6524,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6521
6524
  vercelProjectName: "stackos-engineering-graph",
6522
6525
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6523
6526
  vercelProjectId: "prj_zAU0Zn9GkbHjHI63dxW4vLpmoqTJ",
6527
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6524
6528
  repository: {
6525
6529
  owner: "stack-vc",
6526
6530
  name: "stackos-engineering-graph"
@@ -6541,6 +6545,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6541
6545
  vercelProjectName: "lucern-graph",
6542
6546
  vercelTeamId: "team_vTHxxs8GAoAFUe6RWMlYt7fY",
6543
6547
  vercelProjectId: "prj_KJ8EKV8vGM5xURpqmwTwmECEGPgQ",
6548
+ vercelWriterTokenEnv: "LUCERN_VERCEL_TOKEN",
6544
6549
  repository: {
6545
6550
  owner: "LucernAI",
6546
6551
  name: "lucern-graph"
@@ -10210,7 +10215,7 @@ function compactRecord2(input) {
10210
10215
  Object.entries(input).filter(([, value]) => value !== void 0)
10211
10216
  );
10212
10217
  }
10213
- var listBeliefsProjection = defineProjection({
10218
+ defineProjection({
10214
10219
  contractName: "list_beliefs",
10215
10220
  inputSchema: listBeliefsInputSchema,
10216
10221
  project: (input) => compactRecord2({
@@ -15526,11 +15531,8 @@ var identityContracts = [
15526
15531
  sdkNamespace: "identity",
15527
15532
  sdkMethod: "whoami",
15528
15533
  summary: "Describe the current gateway principal.",
15529
- convex: {
15530
- module: "identity",
15531
- functionName: "whoami",
15532
- kind: "query",
15533
- inputProjection: withPrincipal
15534
+ gateway: {
15535
+ handler: "identity.whoami"
15534
15536
  }
15535
15537
  }),
15536
15538
  surfaceContract({
@@ -15550,7 +15552,7 @@ var identityContracts = [
15550
15552
  providerProjectId: z.string().min(1).optional()
15551
15553
  }),
15552
15554
  convex: {
15553
- module: "identity",
15555
+ module: "platform",
15554
15556
  functionName: "resolveInteractivePrincipal",
15555
15557
  kind: "query"
15556
15558
  }
@@ -15634,15 +15636,6 @@ var beliefLookupInput = (input) => compactRecord4({
15634
15636
  var beliefNodeInput = (input) => compactRecord4({
15635
15637
  nodeId: input.nodeId ?? input.id ?? input.beliefId
15636
15638
  });
15637
- var beliefTopicInput = (input) => {
15638
- const parsed = listBeliefsProjection.inputSchema.safeParse(input);
15639
- if (!parsed.success) {
15640
- throw new Error(
15641
- `list_beliefs projection input rejected: ${parsed.error.message}`
15642
- );
15643
- }
15644
- return compactRecord4(listBeliefsProjection.project(parsed.data));
15645
- };
15646
15639
  var createBeliefInput = (input, context) => {
15647
15640
  return withUserId(
15648
15641
  compactRecord4({
@@ -15731,11 +15724,8 @@ var beliefsContracts = [
15731
15724
  sdkNamespace: "beliefs",
15732
15725
  sdkMethod: "listBeliefs",
15733
15726
  summary: "List beliefs for a topic.",
15734
- convex: {
15735
- module: "beliefs",
15736
- functionName: "getByTopic",
15737
- kind: "query",
15738
- inputProjection: beliefTopicInput
15727
+ gateway: {
15728
+ handler: "beliefs.list"
15739
15729
  },
15740
15730
  args: listBeliefsInputSchema
15741
15731
  }),
@@ -15920,12 +15910,6 @@ var evidenceIdInput = (input) => compactRecord4({
15920
15910
  insightId: input.insightId,
15921
15911
  nodeId: input.nodeId ?? input.id ?? input.evidenceId
15922
15912
  });
15923
- var evidenceTopicInput = (input) => compactRecord4({
15924
- topicId: input.topicId,
15925
- status: input.status,
15926
- userId: input.userId,
15927
- limit: input.limit
15928
- });
15929
15913
  var createEvidenceInput = (input, context) => {
15930
15914
  const parsed = createEvidenceProjection.inputSchema.safeParse(input);
15931
15915
  if (!parsed.success) {
@@ -16056,11 +16040,8 @@ var evidenceContracts = [
16056
16040
  sdkNamespace: "evidence",
16057
16041
  sdkMethod: "listEvidence",
16058
16042
  summary: "List evidence for a topic.",
16059
- convex: {
16060
- module: "evidence",
16061
- functionName: "getByTopic",
16062
- kind: "query",
16063
- inputProjection: evidenceTopicInput
16043
+ gateway: {
16044
+ handler: "evidence.list"
16064
16045
  }
16065
16046
  }),
16066
16047
  surfaceContract({
@@ -16295,11 +16276,8 @@ var questionsContracts = [
16295
16276
  sdkNamespace: "questions",
16296
16277
  sdkMethod: "listQuestions",
16297
16278
  summary: "List questions for a topic.",
16298
- convex: {
16299
- module: "questions",
16300
- functionName: "getByTopic",
16301
- kind: "query",
16302
- inputProjection: questionTopicInput
16279
+ gateway: {
16280
+ handler: "questions.list"
16303
16281
  }
16304
16282
  }),
16305
16283
  surfaceContract({
@@ -17802,6 +17780,19 @@ var createTaskArgs = z.object({
17802
17780
  tags: z.array(z.string()).optional().describe("Free-form tags."),
17803
17781
  metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
17804
17782
  });
17783
+ var updateTaskArgs = z.object({
17784
+ taskId: z.string().describe("Task to update."),
17785
+ title: z.string().optional().describe("Updated task title."),
17786
+ description: z.string().optional().describe("Updated task description."),
17787
+ priority: taskPrioritySchema.optional().describe("Updated priority."),
17788
+ status: taskStatusSchema2.optional().describe("Updated status."),
17789
+ linkedWorktreeId: z.string().optional().describe("Worktree this task belongs to."),
17790
+ linkedBeliefId: z.string().optional().describe("Belief this task supports."),
17791
+ linkedQuestionId: z.string().optional().describe("Question this task addresses."),
17792
+ assigneeId: z.string().optional().describe("Principal assigned to the task."),
17793
+ blockedReason: z.string().optional().describe("Reason the task is blocked or deferred."),
17794
+ metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
17795
+ });
17805
17796
  var createTaskInput = (input) => compactRecord4({
17806
17797
  title: input.title,
17807
17798
  topicId: input.topicId,
@@ -17888,7 +17879,8 @@ var tasksContracts = [
17888
17879
  kind: "mutation",
17889
17880
  inputProjection: taskInput
17890
17881
  },
17891
- gateway: { handler: "tasks.update" }
17882
+ gateway: { handler: "tasks.update" },
17883
+ args: updateTaskArgs
17892
17884
  }),
17893
17885
  surfaceContract({
17894
17886
  name: "complete_task",
@@ -20729,6 +20721,7 @@ __export(src_exports, {
20729
20721
  randomIdempotencyKey: () => randomIdempotencyKey,
20730
20722
  readInfisicalRuntimeBootstrap: () => readInfisicalRuntimeBootstrap,
20731
20723
  registerCustomTool: () => registerCustomTool,
20724
+ requestBrokeredInfisicalSecret: () => requestBrokeredInfisicalSecret,
20732
20725
  resolveDeliveryFailureStatus: () => resolveDeliveryFailureStatus,
20733
20726
  resolveInfisicalSecretFromBinding: () => resolveInfisicalSecretFromBinding,
20734
20727
  resolveText: () => resolveText,
@@ -21121,13 +21114,31 @@ function mergeHeaderRecord(base, addition) {
21121
21114
  }
21122
21115
  return Object.fromEntries(headers.entries());
21123
21116
  }
21117
+ function cleanHeaderValue(value) {
21118
+ const normalized = value?.trim();
21119
+ return normalized ? normalized : void 0;
21120
+ }
21124
21121
  function createGatewayRequestClient(config = {}) {
21125
21122
  const fetchImpl = config.fetchImpl ?? fetch;
21126
21123
  const baseUrl = config.baseUrl?.replace(/\/+$/, "") ?? "";
21127
21124
  const maxRetries = config.maxRetries ?? 2;
21128
21125
  const requestIdFactory = config.requestIdFactory ?? (() => generatePortableRequestId());
21129
21126
  async function resolveAuthHeaders2() {
21130
- const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
21127
+ const provided = config.getAuthHeaders ? await config.getAuthHeaders() : {};
21128
+ const headers = new Headers(provided);
21129
+ const setIfAbsent = (name, value) => {
21130
+ const normalized = cleanHeaderValue(value);
21131
+ if (normalized && !headers.has(name)) {
21132
+ headers.set(name, normalized);
21133
+ }
21134
+ };
21135
+ setIfAbsent("x-lucern-key", config.apiKey);
21136
+ setIfAbsent("x-lucern-session-token", config.userToken);
21137
+ setIfAbsent("x-lucern-environment", config.environment);
21138
+ setIfAbsent("x-lucern-clerk-id", config.clerkId);
21139
+ setIfAbsent("x-lucern-user-id", config.userId ?? config.clerkId);
21140
+ setIfAbsent("x-lucern-deployment-host", config.deploymentHost);
21141
+ const base = Object.fromEntries(headers.entries());
21131
21142
  const authContextInput = await resolveConfiguredAuthContext(
21132
21143
  config.authContext
21133
21144
  );
@@ -24579,6 +24590,8 @@ function createTasksFacade(config = {}) {
24579
24590
  description: input.description,
24580
24591
  priority: input.priority,
24581
24592
  status: input.status,
24593
+ assigneeId: input.assigneeId,
24594
+ blockedReason: input.blockedReason,
24582
24595
  linkedBeliefId: input.linkedBeliefId,
24583
24596
  linkedQuestionId: input.linkedQuestionId,
24584
24597
  linkedWorktreeId: input.linkedWorktreeId,
@@ -28021,7 +28034,7 @@ function createToolRegistryClient(config = {}) {
28021
28034
  }
28022
28035
 
28023
28036
  // ../sdk/src/version.ts
28024
- var LUCERN_SDK_VERSION = "0.3.0-alpha.14";
28037
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.16";
28025
28038
 
28026
28039
  // ../sdk/src/workflowClient.ts
28027
28040
  function normalizeLensQuery(value) {
@@ -28429,6 +28442,12 @@ function toGatewayConfig(config) {
28429
28442
  return {
28430
28443
  baseUrl: config.baseUrl,
28431
28444
  fetchImpl: config.fetchImpl,
28445
+ apiKey: config.apiKey,
28446
+ userToken: config.userToken,
28447
+ environment: config.environment,
28448
+ clerkId: config.clerkId,
28449
+ userId: config.userId,
28450
+ deploymentHost: config.deploymentHost,
28432
28451
  maxRetries: config.maxRetries,
28433
28452
  timeoutMs: config.timeoutMs,
28434
28453
  timeoutMsByMethod: config.timeoutMsByMethod,
@@ -28437,19 +28456,7 @@ function toGatewayConfig(config) {
28437
28456
  onResponse: config.onResponse,
28438
28457
  authContext: config.authContext,
28439
28458
  requireCanonicalAuthContext: config.requireCanonicalAuthContext,
28440
- getAuthHeaders: async () => {
28441
- const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
28442
- if (config.apiKey && !base["x-lucern-key"] && !base.Authorization) {
28443
- base["x-lucern-key"] = config.apiKey;
28444
- }
28445
- if (config.userToken && !base["x-lucern-session-token"]) {
28446
- base["x-lucern-session-token"] = config.userToken;
28447
- }
28448
- if (config.environment && !base["x-lucern-environment"]) {
28449
- base["x-lucern-environment"] = config.environment;
28450
- }
28451
- return base;
28452
- }
28459
+ getAuthHeaders: config.getAuthHeaders
28453
28460
  };
28454
28461
  }
28455
28462
  function exposeGatewayData(response) {
@@ -34948,7 +34955,7 @@ function createLucernStandaloneMcpServer(options) {
34948
34955
  });
34949
34956
  const server = new McpServer({
34950
34957
  name: "lucern-mcp",
34951
- version: "0.3.0-alpha.14"
34958
+ version: "0.3.0-alpha.16"
34952
34959
  });
34953
34960
  registerTools(server, runtime);
34954
34961
  const resources = registerResources(server, runtime, observationStore);