@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/index.js CHANGED
@@ -12,7 +12,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
12
12
  import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
13
13
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
14
14
  import * as graphIntel_star from '@lucern/reasoning-kernel/graphIntel';
15
- import { resolveInfisicalSecretFromBinding, SecretResolverError } from '@lucern/secrets';
15
+ import { resolveInfisicalSecretFromBinding, requestBrokeredInfisicalSecret, SecretResolverError } from '@lucern/secrets';
16
16
  import 'crypto';
17
17
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
18
18
  import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
@@ -1342,6 +1342,7 @@ defineTable({
1342
1342
  shape: z.object({
1343
1343
  "tenantId": idOf("tenants"),
1344
1344
  "workspaceId": idOf("workspaces").optional(),
1345
+ "environment": z.enum(["dev", "staging", "prod"]).optional(),
1345
1346
  "keyPrefix": z.enum(["luc", "stk"]),
1346
1347
  "keyHash": z.string(),
1347
1348
  "keyHint": z.string(),
@@ -6653,6 +6654,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6653
6654
  vercelProjectName: "ai-chatbot-diao",
6654
6655
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6655
6656
  vercelProjectId: "prj_PihFw8kohSSw14nZs9YQV3xVo517",
6657
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6656
6658
  repository: {
6657
6659
  owner: "stack-vc",
6658
6660
  name: "front-end"
@@ -6673,6 +6675,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6673
6675
  vercelProjectName: "stackos",
6674
6676
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6675
6677
  vercelProjectId: "prj_rXLAL0Z6v9p1fasKbomby6GI7kau",
6678
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6676
6679
  repository: {
6677
6680
  owner: "stack-vc",
6678
6681
  name: "stackos"
@@ -6693,6 +6696,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6693
6696
  vercelProjectName: "stackos-engineering-graph",
6694
6697
  vercelTeamId: "team_mZBKwvXSSu7qxrWdg2go29sK",
6695
6698
  vercelProjectId: "prj_zAU0Zn9GkbHjHI63dxW4vLpmoqTJ",
6699
+ vercelWriterTokenEnv: "STACK_VERCEL_TOKEN",
6696
6700
  repository: {
6697
6701
  owner: "stack-vc",
6698
6702
  name: "stackos-engineering-graph"
@@ -6713,6 +6717,7 @@ var INFISICAL_TENANT_SOFTWARE_SYSTEMS = [
6713
6717
  vercelProjectName: "lucern-graph",
6714
6718
  vercelTeamId: "team_vTHxxs8GAoAFUe6RWMlYt7fY",
6715
6719
  vercelProjectId: "prj_KJ8EKV8vGM5xURpqmwTwmECEGPgQ",
6720
+ vercelWriterTokenEnv: "LUCERN_VERCEL_TOKEN",
6716
6721
  repository: {
6717
6722
  owner: "LucernAI",
6718
6723
  name: "lucern-graph"
@@ -10382,7 +10387,7 @@ function compactRecord2(input) {
10382
10387
  Object.entries(input).filter(([, value]) => value !== void 0)
10383
10388
  );
10384
10389
  }
10385
- var listBeliefsProjection = defineProjection({
10390
+ defineProjection({
10386
10391
  contractName: "list_beliefs",
10387
10392
  inputSchema: listBeliefsInputSchema,
10388
10393
  project: (input) => compactRecord2({
@@ -15698,11 +15703,8 @@ var identityContracts = [
15698
15703
  sdkNamespace: "identity",
15699
15704
  sdkMethod: "whoami",
15700
15705
  summary: "Describe the current gateway principal.",
15701
- convex: {
15702
- module: "identity",
15703
- functionName: "whoami",
15704
- kind: "query",
15705
- inputProjection: withPrincipal
15706
+ gateway: {
15707
+ handler: "identity.whoami"
15706
15708
  }
15707
15709
  }),
15708
15710
  surfaceContract({
@@ -15722,7 +15724,7 @@ var identityContracts = [
15722
15724
  providerProjectId: z.string().min(1).optional()
15723
15725
  }),
15724
15726
  convex: {
15725
- module: "identity",
15727
+ module: "platform",
15726
15728
  functionName: "resolveInteractivePrincipal",
15727
15729
  kind: "query"
15728
15730
  }
@@ -15806,15 +15808,6 @@ var beliefLookupInput = (input) => compactRecord4({
15806
15808
  var beliefNodeInput = (input) => compactRecord4({
15807
15809
  nodeId: input.nodeId ?? input.id ?? input.beliefId
15808
15810
  });
15809
- var beliefTopicInput = (input) => {
15810
- const parsed = listBeliefsProjection.inputSchema.safeParse(input);
15811
- if (!parsed.success) {
15812
- throw new Error(
15813
- `list_beliefs projection input rejected: ${parsed.error.message}`
15814
- );
15815
- }
15816
- return compactRecord4(listBeliefsProjection.project(parsed.data));
15817
- };
15818
15811
  var createBeliefInput = (input, context) => {
15819
15812
  return withUserId(
15820
15813
  compactRecord4({
@@ -15903,11 +15896,8 @@ var beliefsContracts = [
15903
15896
  sdkNamespace: "beliefs",
15904
15897
  sdkMethod: "listBeliefs",
15905
15898
  summary: "List beliefs for a topic.",
15906
- convex: {
15907
- module: "beliefs",
15908
- functionName: "getByTopic",
15909
- kind: "query",
15910
- inputProjection: beliefTopicInput
15899
+ gateway: {
15900
+ handler: "beliefs.list"
15911
15901
  },
15912
15902
  args: listBeliefsInputSchema
15913
15903
  }),
@@ -16092,12 +16082,6 @@ var evidenceIdInput = (input) => compactRecord4({
16092
16082
  insightId: input.insightId,
16093
16083
  nodeId: input.nodeId ?? input.id ?? input.evidenceId
16094
16084
  });
16095
- var evidenceTopicInput = (input) => compactRecord4({
16096
- topicId: input.topicId,
16097
- status: input.status,
16098
- userId: input.userId,
16099
- limit: input.limit
16100
- });
16101
16085
  var createEvidenceInput = (input, context) => {
16102
16086
  const parsed = createEvidenceProjection.inputSchema.safeParse(input);
16103
16087
  if (!parsed.success) {
@@ -16228,11 +16212,8 @@ var evidenceContracts = [
16228
16212
  sdkNamespace: "evidence",
16229
16213
  sdkMethod: "listEvidence",
16230
16214
  summary: "List evidence for a topic.",
16231
- convex: {
16232
- module: "evidence",
16233
- functionName: "getByTopic",
16234
- kind: "query",
16235
- inputProjection: evidenceTopicInput
16215
+ gateway: {
16216
+ handler: "evidence.list"
16236
16217
  }
16237
16218
  }),
16238
16219
  surfaceContract({
@@ -16467,11 +16448,8 @@ var questionsContracts = [
16467
16448
  sdkNamespace: "questions",
16468
16449
  sdkMethod: "listQuestions",
16469
16450
  summary: "List questions for a topic.",
16470
- convex: {
16471
- module: "questions",
16472
- functionName: "getByTopic",
16473
- kind: "query",
16474
- inputProjection: questionTopicInput
16451
+ gateway: {
16452
+ handler: "questions.list"
16475
16453
  }
16476
16454
  }),
16477
16455
  surfaceContract({
@@ -17974,6 +17952,19 @@ var createTaskArgs = z.object({
17974
17952
  tags: z.array(z.string()).optional().describe("Free-form tags."),
17975
17953
  metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
17976
17954
  });
17955
+ var updateTaskArgs = z.object({
17956
+ taskId: z.string().describe("Task to update."),
17957
+ title: z.string().optional().describe("Updated task title."),
17958
+ description: z.string().optional().describe("Updated task description."),
17959
+ priority: taskPrioritySchema.optional().describe("Updated priority."),
17960
+ status: taskStatusSchema2.optional().describe("Updated status."),
17961
+ linkedWorktreeId: z.string().optional().describe("Worktree this task belongs to."),
17962
+ linkedBeliefId: z.string().optional().describe("Belief this task supports."),
17963
+ linkedQuestionId: z.string().optional().describe("Question this task addresses."),
17964
+ assigneeId: z.string().optional().describe("Principal assigned to the task."),
17965
+ blockedReason: z.string().optional().describe("Reason the task is blocked or deferred."),
17966
+ metadata: z.record(z.unknown()).optional().describe("Structured task metadata for handoff context and routing hints.")
17967
+ });
17977
17968
  var createTaskInput = (input) => compactRecord4({
17978
17969
  title: input.title,
17979
17970
  topicId: input.topicId,
@@ -18060,7 +18051,8 @@ var tasksContracts = [
18060
18051
  kind: "mutation",
18061
18052
  inputProjection: taskInput
18062
18053
  },
18063
- gateway: { handler: "tasks.update" }
18054
+ gateway: { handler: "tasks.update" },
18055
+ args: updateTaskArgs
18064
18056
  }),
18065
18057
  surfaceContract({
18066
18058
  name: "complete_task",
@@ -20854,6 +20846,7 @@ __export(src_exports, {
20854
20846
  randomIdempotencyKey: () => randomIdempotencyKey,
20855
20847
  readInfisicalRuntimeBootstrap: () => readInfisicalRuntimeBootstrap,
20856
20848
  registerCustomTool: () => registerCustomTool,
20849
+ requestBrokeredInfisicalSecret: () => requestBrokeredInfisicalSecret,
20857
20850
  resolveDeliveryFailureStatus: () => resolveDeliveryFailureStatus,
20858
20851
  resolveInfisicalSecretFromBinding: () => resolveInfisicalSecretFromBinding,
20859
20852
  resolveText: () => resolveText,
@@ -21246,13 +21239,31 @@ function mergeHeaderRecord(base, addition) {
21246
21239
  }
21247
21240
  return Object.fromEntries(headers.entries());
21248
21241
  }
21242
+ function cleanHeaderValue(value) {
21243
+ const normalized = value?.trim();
21244
+ return normalized ? normalized : void 0;
21245
+ }
21249
21246
  function createGatewayRequestClient(config = {}) {
21250
21247
  const fetchImpl = config.fetchImpl ?? fetch;
21251
21248
  const baseUrl = config.baseUrl?.replace(/\/+$/, "") ?? "";
21252
21249
  const maxRetries = config.maxRetries ?? 2;
21253
21250
  const requestIdFactory = config.requestIdFactory ?? (() => generatePortableRequestId());
21254
21251
  async function resolveAuthHeaders2() {
21255
- const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
21252
+ const provided = config.getAuthHeaders ? await config.getAuthHeaders() : {};
21253
+ const headers = new Headers(provided);
21254
+ const setIfAbsent = (name, value) => {
21255
+ const normalized = cleanHeaderValue(value);
21256
+ if (normalized && !headers.has(name)) {
21257
+ headers.set(name, normalized);
21258
+ }
21259
+ };
21260
+ setIfAbsent("x-lucern-key", config.apiKey);
21261
+ setIfAbsent("x-lucern-session-token", config.userToken);
21262
+ setIfAbsent("x-lucern-environment", config.environment);
21263
+ setIfAbsent("x-lucern-clerk-id", config.clerkId);
21264
+ setIfAbsent("x-lucern-user-id", config.userId ?? config.clerkId);
21265
+ setIfAbsent("x-lucern-deployment-host", config.deploymentHost);
21266
+ const base = Object.fromEntries(headers.entries());
21256
21267
  const authContextInput = await resolveConfiguredAuthContext(
21257
21268
  config.authContext
21258
21269
  );
@@ -24704,6 +24715,8 @@ function createTasksFacade(config = {}) {
24704
24715
  description: input.description,
24705
24716
  priority: input.priority,
24706
24717
  status: input.status,
24718
+ assigneeId: input.assigneeId,
24719
+ blockedReason: input.blockedReason,
24707
24720
  linkedBeliefId: input.linkedBeliefId,
24708
24721
  linkedQuestionId: input.linkedQuestionId,
24709
24722
  linkedWorktreeId: input.linkedWorktreeId,
@@ -28146,7 +28159,7 @@ function createToolRegistryClient(config = {}) {
28146
28159
  }
28147
28160
 
28148
28161
  // ../sdk/src/version.ts
28149
- var LUCERN_SDK_VERSION = "0.3.0-alpha.14";
28162
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.16";
28150
28163
 
28151
28164
  // ../sdk/src/workflowClient.ts
28152
28165
  function normalizeLensQuery(value) {
@@ -28554,6 +28567,12 @@ function toGatewayConfig(config) {
28554
28567
  return {
28555
28568
  baseUrl: config.baseUrl,
28556
28569
  fetchImpl: config.fetchImpl,
28570
+ apiKey: config.apiKey,
28571
+ userToken: config.userToken,
28572
+ environment: config.environment,
28573
+ clerkId: config.clerkId,
28574
+ userId: config.userId,
28575
+ deploymentHost: config.deploymentHost,
28557
28576
  maxRetries: config.maxRetries,
28558
28577
  timeoutMs: config.timeoutMs,
28559
28578
  timeoutMsByMethod: config.timeoutMsByMethod,
@@ -28562,19 +28581,7 @@ function toGatewayConfig(config) {
28562
28581
  onResponse: config.onResponse,
28563
28582
  authContext: config.authContext,
28564
28583
  requireCanonicalAuthContext: config.requireCanonicalAuthContext,
28565
- getAuthHeaders: async () => {
28566
- const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
28567
- if (config.apiKey && !base["x-lucern-key"] && !base.Authorization) {
28568
- base["x-lucern-key"] = config.apiKey;
28569
- }
28570
- if (config.userToken && !base["x-lucern-session-token"]) {
28571
- base["x-lucern-session-token"] = config.userToken;
28572
- }
28573
- if (config.environment && !base["x-lucern-environment"]) {
28574
- base["x-lucern-environment"] = config.environment;
28575
- }
28576
- return base;
28577
- }
28584
+ getAuthHeaders: config.getAuthHeaders
28578
28585
  };
28579
28586
  }
28580
28587
  function exposeGatewayData(response) {
@@ -34973,7 +34980,7 @@ function createLucernStandaloneMcpServer(options) {
34973
34980
  });
34974
34981
  const server = new McpServer({
34975
34982
  name: "lucern-mcp",
34976
- version: "0.3.0-alpha.14"
34983
+ version: "0.3.0-alpha.16"
34977
34984
  });
34978
34985
  registerTools(server, runtime);
34979
34986
  const resources = registerResources(server, runtime, observationStore);