@lucern/mcp 0.3.0-alpha.16 → 0.3.0-alpha.17

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.
@@ -2208,7 +2208,7 @@ function normalizeCanonicalPrincipalIdentity(input, options = {}) {
2208
2208
  })) {
2209
2209
  throw new LucernAccessControlError(
2210
2210
  "clerk_alias_unrecognized",
2211
- "Observed Clerk user id is not attached to the canonical Lucern principal."
2211
+ "Observed Clerk user id does not match the canonical human principal id."
2212
2212
  );
2213
2213
  }
2214
2214
  return {
@@ -7810,7 +7810,7 @@ function createToolRegistryClient(config = {}) {
7810
7810
  }
7811
7811
 
7812
7812
  // ../sdk/src/version.ts
7813
- var LUCERN_SDK_VERSION = "0.3.0-alpha.16";
7813
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.17";
7814
7814
 
7815
7815
  // ../sdk/src/workflowClient.ts
7816
7816
  function normalizeLensQuery(value) {
@@ -11504,7 +11504,7 @@ var SESSION_LIFECYCLE_STATUSES = [
11504
11504
  "revoked"
11505
11505
  ];
11506
11506
  function inferSessionPrincipalType(principalId) {
11507
- if (principalId.startsWith("user:")) {
11507
+ if (/^user_[A-Za-z0-9]+$/.test(principalId)) {
11508
11508
  return "human";
11509
11509
  }
11510
11510
  if (principalId.startsWith("agent:")) {
@@ -13987,7 +13987,7 @@ var IDENTITY_WHOAMI = {
13987
13987
  response: {
13988
13988
  description: "Canonical identity summary for the current session",
13989
13989
  fields: {
13990
- principalId: "string \u2014 canonical federated principal identifier",
13990
+ principalId: "string \u2014 canonical principal identifier; for humans this is the Clerk user_... ID",
13991
13991
  principalType: "string \u2014 human, service, agent, group, or external_viewer",
13992
13992
  tenantId: "string | undefined \u2014 resolved tenant scope",
13993
13993
  workspaceId: "string | undefined \u2014 resolved workspace scope",
@@ -14001,7 +14001,7 @@ var IDENTITY_WHOAMI = {
14001
14001
  };
14002
14002
  var RESOLVE_INTERACTIVE_PRINCIPAL = {
14003
14003
  name: "resolve_interactive_principal",
14004
- description: "Read the Permit-backed Lucern principal context for an authenticated Clerk user. Like `git config --get user.email` plus the repository ACL \u2014 resolves the identity alias into the canonical authorization subject.",
14004
+ description: "Read the Permit-backed Lucern principal context for an authenticated Clerk user. Like `git config --get user.email` plus the repository ACL \u2014 resolves the Clerk subject into tenant/workspace authorization context.",
14005
14005
  parameters: {
14006
14006
  clerkId: {
14007
14007
  type: "string",
@@ -14024,7 +14024,7 @@ var RESOLVE_INTERACTIVE_PRINCIPAL = {
14024
14024
  response: {
14025
14025
  description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
14026
14026
  fields: {
14027
- principalId: "string \u2014 canonical Lucern principal identifier",
14027
+ principalId: "string \u2014 canonical Clerk user_... ID for human sessions",
14028
14028
  principalType: "string \u2014 human, service, agent, group, or external_viewer",
14029
14029
  clerkId: "string \u2014 authenticated Clerk subject alias",
14030
14030
  tenantId: "string \u2014 resolved tenant scope",
@@ -14852,7 +14852,7 @@ var MANAGE_WRITE_POLICY = {
14852
14852
  },
14853
14853
  role: {
14854
14854
  type: "string",
14855
- description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
14855
+ description: "Role to set policy for (required for 'set'). E.g. 'agent:internal' or a Permit role key such as 'workspace_admin'."
14856
14856
  },
14857
14857
  permission: {
14858
14858
  type: "string",
@@ -17933,7 +17933,7 @@ defineTable({
17933
17933
  shape: z.object({
17934
17934
  "tenantId": idOf("tenants").optional(),
17935
17935
  "apiKeyId": idOf("apiKeys").optional(),
17936
- "action": z.enum(["key_created", "key_revoked", "key_expired", "key_used", "tenant_secret_created", "tenant_secret_rotated", "tenant_secret_revoked", "tenant_slot_binding_upserted", "tenant_slot_binding_revoked", "proxy_token_minted", "proxy_token_lease_issued", "proxy_token_lease_renewed", "proxy_token_lease_revoked", "proxy_request_recorded", "tenant_created", "tenant_updated", "tenant_suspended", "tenant_archived", "tenant_reactivated", "principal_created", "principal_updated", "principal_suspended", "principal_identity_alias_upserted", "principal_identity_alias_revoked", "membership_created", "membership_updated", "membership_revoked", "group_created", "group_updated", "group_deleted", "group_member_added", "group_member_removed", "workspace_created", "workspace_updated", "workspace_archived", "workspace_deployment_set", "workspace_deployment_removed", "deployment_host_registered", "deployment_host_revoked", "service_key_created", "service_key_rotated", "service_key_revoked", "service_key_used", "service_key_auth_failed", "session_created", "session_validated", "session_revoked", "session_cascade_revoked", "session_expired", "sandbox_created", "sandbox_secret_injected", "sandbox_execution_started", "sandbox_execution_completed", "sandbox_limit_violated", "policy_created", "policy_updated", "policy_enforced", "policy_archived", "permit_sync_enqueued", "permit_sync_succeeded", "permit_sync_failed", "permit_sync_skipped", "agent_registered", "agent_updated", "tool_registered", "tool_updated", "pack_entitled", "pack_installed", "pack_enabled", "pack_disabled", "pack_entitlement_revoked", "pack_upgraded", "pack_upgrade_committed", "pack_upgrade_rolled_back", "pack_group_assigned", "pack_group_unassigned", "methodology_pack_created", "methodology_pack_updated", "methodology_pack_assigned", "methodology_pack_removed", "pack_assigned_to_group", "pack_revoked_from_group", "pack_ontology_materialized", "pack_ontology_topic_bound", "cutover_flag_set", "cutover_flag_cleared"]),
17936
+ "action": z.enum(["key_created", "key_revoked", "key_expired", "key_used", "tenant_secret_created", "tenant_secret_rotated", "tenant_secret_revoked", "tenant_slot_binding_upserted", "tenant_slot_binding_revoked", "proxy_token_minted", "proxy_token_lease_issued", "proxy_token_lease_renewed", "proxy_token_lease_revoked", "proxy_request_recorded", "tenant_created", "tenant_updated", "tenant_suspended", "tenant_archived", "tenant_reactivated", "tenant_clerk_organization_linked", "principal_created", "principal_updated", "principal_suspended", "principal_identity_alias_upserted", "principal_identity_alias_revoked", "membership_created", "membership_updated", "membership_revoked", "group_created", "group_updated", "group_deleted", "group_member_added", "group_member_removed", "workspace_created", "workspace_updated", "workspace_archived", "workspace_deployment_set", "workspace_deployment_removed", "deployment_host_registered", "deployment_host_revoked", "service_key_created", "service_key_rotated", "service_key_revoked", "service_key_used", "service_key_auth_failed", "session_created", "session_validated", "session_revoked", "session_cascade_revoked", "session_expired", "sandbox_created", "sandbox_secret_injected", "sandbox_execution_started", "sandbox_execution_completed", "sandbox_limit_violated", "policy_created", "policy_updated", "policy_enforced", "policy_archived", "permit_sync_enqueued", "permit_sync_succeeded", "permit_sync_failed", "permit_sync_skipped", "agent_registered", "agent_updated", "tool_registered", "tool_updated", "pack_entitled", "pack_installed", "pack_enabled", "pack_disabled", "pack_entitlement_revoked", "pack_upgraded", "pack_upgrade_committed", "pack_upgrade_rolled_back", "pack_group_assigned", "pack_group_unassigned", "methodology_pack_created", "methodology_pack_updated", "methodology_pack_assigned", "methodology_pack_removed", "pack_assigned_to_group", "pack_revoked_from_group", "pack_ontology_materialized", "pack_ontology_topic_bound", "cutover_flag_set", "cutover_flag_cleared"]),
17937
17937
  "actorClerkId": z.string(),
17938
17938
  "details": z.any().optional(),
17939
17939
  "createdAt": z.number()
@@ -23144,6 +23144,21 @@ var INFISICAL_RUNTIME_PATHS = [
23144
23144
  }
23145
23145
  ]
23146
23146
  },
23147
+ {
23148
+ id: "platform-operator-credentials",
23149
+ secretPath: "/platform/runtime",
23150
+ description: "Lucern-owned operator credential material for local CLI, MCP, and SDK sessions.",
23151
+ variables: [
23152
+ {
23153
+ name: "LUCERN_API_KEY",
23154
+ required: false,
23155
+ secret: true,
23156
+ public: false,
23157
+ aliases: ["LUCERN_KEY"],
23158
+ description: "Lucern-owned operator API key for gateway calls from trusted local tooling."
23159
+ }
23160
+ ]
23161
+ },
23147
23162
  {
23148
23163
  id: "tenant-shared-install",
23149
23164
  secretPath: TENANT_CLIENT_INSTALL_TOKEN_INFISICAL_PATH,
@@ -23179,7 +23194,7 @@ var INFISICAL_RUNTIME_SURFACES = [
23179
23194
  id: "lucern-sdk",
23180
23195
  packageName: "@lucern/sdk",
23181
23196
  delivery: "runtime_fetch",
23182
- sourcePathIds: ["platform-runtime"],
23197
+ sourcePathIds: ["platform-runtime", "platform-operator-credentials"],
23183
23198
  consumer: "server-side SDK operator contexts with a scoped Infisical identity",
23184
23199
  description: "SDK exposes the runtime Infisical resolver used by clients that have machine identity credentials."
23185
23200
  },
@@ -23188,7 +23203,7 @@ var INFISICAL_RUNTIME_SURFACES = [
23188
23203
  packageName: "@lucern/cli",
23189
23204
  delivery: "runtime_fetch",
23190
23205
  fallback: "device_auth",
23191
- sourcePathIds: ["platform-runtime"],
23206
+ sourcePathIds: ["platform-runtime", "platform-operator-credentials"],
23192
23207
  consumer: "developer/operator CLI processes",
23193
23208
  description: "CLI hydrates runtime defaults from Infisical when configured, then authenticates users through Lucern device login."
23194
23209
  },
@@ -23197,7 +23212,7 @@ var INFISICAL_RUNTIME_SURFACES = [
23197
23212
  packageName: "@lucern/mcp",
23198
23213
  delivery: "runtime_fetch",
23199
23214
  fallback: "device_auth",
23200
- sourcePathIds: ["platform-runtime"],
23215
+ sourcePathIds: ["platform-runtime", "platform-operator-credentials"],
23201
23216
  consumer: "MCP server/client processes",
23202
23217
  description: "MCP hydrates runtime defaults through the SDK resolver and remains a Lucern client, not a platform secret owner."
23203
23218
  },
@@ -25678,9 +25693,33 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
25678
25693
  "consumer": "server-side SDK operator contexts with a scoped Infisical identity",
25679
25694
  "description": "SDK exposes the runtime Infisical resolver used by clients that have machine identity credentials.",
25680
25695
  "sourcePathIds": [
25681
- "platform-runtime"
25696
+ "platform-runtime",
25697
+ "platform-operator-credentials"
25682
25698
  ],
25683
25699
  "variables": [
25700
+ {
25701
+ "canonicalName": "LUCERN_API_KEY",
25702
+ "envNames": [
25703
+ "LUCERN_API_KEY",
25704
+ "LUCERN_KEY"
25705
+ ],
25706
+ "aliases": [
25707
+ "LUCERN_KEY"
25708
+ ],
25709
+ "writeNames": [
25710
+ "LUCERN_API_KEY"
25711
+ ],
25712
+ "required": false,
25713
+ "secret": true,
25714
+ "public": false,
25715
+ "sourcePath": "/platform/runtime",
25716
+ "environmentPolicy": "environment_specific",
25717
+ "consumers": [
25718
+ "lucern-sdk"
25719
+ ],
25720
+ "destinations": [],
25721
+ "description": "Lucern-owned operator API key for gateway calls from trusted local tooling."
25722
+ },
25684
25723
  {
25685
25724
  "canonicalName": "LUCERN_API_URL",
25686
25725
  "envNames": [
@@ -25781,9 +25820,57 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
25781
25820
  "consumer": "developer/operator CLI processes",
25782
25821
  "description": "CLI hydrates runtime defaults from Infisical when configured, then authenticates users through Lucern device login.",
25783
25822
  "sourcePathIds": [
25784
- "platform-runtime"
25823
+ "platform-runtime",
25824
+ "platform-operator-credentials"
25785
25825
  ],
25786
25826
  "variables": [
25827
+ {
25828
+ "canonicalName": "LUCERN_API_KEY",
25829
+ "envNames": [
25830
+ "LUCERN_API_KEY",
25831
+ "LUCERN_KEY"
25832
+ ],
25833
+ "aliases": [
25834
+ "LUCERN_KEY"
25835
+ ],
25836
+ "writeNames": [
25837
+ "LUCERN_API_KEY"
25838
+ ],
25839
+ "required": false,
25840
+ "secret": true,
25841
+ "public": false,
25842
+ "sourcePath": "/platform/runtime",
25843
+ "environmentPolicy": "environment_specific",
25844
+ "consumers": [
25845
+ "lucern-cli",
25846
+ "lucern-mcp",
25847
+ "lucern-repo-ci"
25848
+ ],
25849
+ "destinations": [
25850
+ {
25851
+ "kind": "runtime_fetch",
25852
+ "target": "lucern-cli-mcp-sdk",
25853
+ "writeNames": [
25854
+ "LUCERN_API_KEY"
25855
+ ]
25856
+ },
25857
+ {
25858
+ "kind": "operator_local",
25859
+ "target": "lucern-repo",
25860
+ "writeNames": [
25861
+ "LUCERN_API_KEY"
25862
+ ]
25863
+ },
25864
+ {
25865
+ "kind": "github_actions",
25866
+ "target": "LucernAI/lucern",
25867
+ "writeNames": [
25868
+ "LUCERN_API_KEY"
25869
+ ]
25870
+ }
25871
+ ],
25872
+ "description": "Lucern-owned operator API key for gateway calls from trusted local tooling. Lucern-owned operator API key for trusted CLI/MCP/CI calls. Source it from /platform/runtime; do not persist it into local user credential files."
25873
+ },
25787
25874
  {
25788
25875
  "canonicalName": "LUCERN_API_URL",
25789
25876
  "envNames": [
@@ -26122,7 +26209,8 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
26122
26209
  "consumer": "MCP server/client processes",
26123
26210
  "description": "MCP hydrates runtime defaults through the SDK resolver and remains a Lucern client, not a platform secret owner.",
26124
26211
  "sourcePathIds": [
26125
- "platform-runtime"
26212
+ "platform-runtime",
26213
+ "platform-operator-credentials"
26126
26214
  ],
26127
26215
  "variables": [
26128
26216
  {
@@ -26210,6 +26298,53 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
26210
26298
  ],
26211
26299
  "description": "Lucern-owned Clerk backend secret. Never route to tenant-owned apps unless that tenant is Lucern itself."
26212
26300
  },
26301
+ {
26302
+ "canonicalName": "LUCERN_API_KEY",
26303
+ "envNames": [
26304
+ "LUCERN_API_KEY",
26305
+ "LUCERN_KEY"
26306
+ ],
26307
+ "aliases": [
26308
+ "LUCERN_KEY"
26309
+ ],
26310
+ "writeNames": [
26311
+ "LUCERN_API_KEY"
26312
+ ],
26313
+ "required": false,
26314
+ "secret": true,
26315
+ "public": false,
26316
+ "sourcePath": "/platform/runtime",
26317
+ "environmentPolicy": "environment_specific",
26318
+ "consumers": [
26319
+ "lucern-cli",
26320
+ "lucern-mcp",
26321
+ "lucern-repo-ci"
26322
+ ],
26323
+ "destinations": [
26324
+ {
26325
+ "kind": "runtime_fetch",
26326
+ "target": "lucern-cli-mcp-sdk",
26327
+ "writeNames": [
26328
+ "LUCERN_API_KEY"
26329
+ ]
26330
+ },
26331
+ {
26332
+ "kind": "operator_local",
26333
+ "target": "lucern-repo",
26334
+ "writeNames": [
26335
+ "LUCERN_API_KEY"
26336
+ ]
26337
+ },
26338
+ {
26339
+ "kind": "github_actions",
26340
+ "target": "LucernAI/lucern",
26341
+ "writeNames": [
26342
+ "LUCERN_API_KEY"
26343
+ ]
26344
+ }
26345
+ ],
26346
+ "description": "Lucern-owned operator API key for gateway calls from trusted local tooling. Lucern-owned operator API key for trusted CLI/MCP/CI calls. Source it from /platform/runtime; do not persist it into local user credential files."
26347
+ },
26213
26348
  {
26214
26349
  "canonicalName": "LUCERN_API_URL",
26215
26350
  "envNames": [
@@ -29430,6 +29565,19 @@ var worktreeEvidenceSignalInputSchema = z.object({
29430
29565
  progress: z.string().optional().describe("Collection progress note for the signal."),
29431
29566
  notes: z.string().optional().describe("Additional evidence collection notes.")
29432
29567
  }).passthrough().describe("Evidence signal embedded in the worktree plan.");
29568
+ var worktreeDocCompanionTargetSchema = z.object({
29569
+ docPath: z.string().describe(
29570
+ "Repo-relative path to a documentation file the worktree promises to update."
29571
+ ),
29572
+ sectionAnchor: z.string().optional().describe(
29573
+ "Markdown heading anchor (e.g. '## Function-surface manifest') that scopes the promised update."
29574
+ ),
29575
+ reason: z.string().describe(
29576
+ "Why this doc section must be updated for the worktree to be complete."
29577
+ )
29578
+ }).passthrough().describe(
29579
+ "Intent-driven docs companion target. pr-gate-reviewer verifies that the PR actually touches each declared (docPath, sectionAnchor). Distinct from the touch-driven docs-loop. See docs/development/docs-sync-discipline.md Lock 3."
29580
+ );
29433
29581
  var worktreeDecisionGateInputSchema = z.object({
29434
29582
  goCriteria: z.array(z.string()).describe("Criteria that must hold for the worktree to proceed."),
29435
29583
  noGoSignals: z.array(z.string()).describe("Signals that stop or redirect the worktree."),
@@ -29462,6 +29610,9 @@ var addWorktreeArgs = z.object({
29462
29610
  keyQuestions: z.array(worktreeKeyQuestionInputSchema).optional().describe("Inline key questions captured as part of the worktree plan."),
29463
29611
  evidenceSignals: z.array(worktreeEvidenceSignalInputSchema).optional().describe("Evidence signals the worktree needs to collect or validate."),
29464
29612
  decisionGate: worktreeDecisionGateInputSchema.optional(),
29613
+ docCompanionTargets: z.array(worktreeDocCompanionTargetSchema).optional().describe(
29614
+ "Doc sections the worktree promises to update at PR time. Enforced by pr-gate-reviewer (Lock 3)."
29615
+ ),
29465
29616
  goCriteria: z.array(z.string()).optional().describe("Shorthand go criteria used to build decisionGate."),
29466
29617
  noGoSignals: z.array(z.string()).optional().describe("Shorthand no-go signals used to build decisionGate."),
29467
29618
  proofArtifacts: z.array(z.unknown()).optional().describe("Expected proof artifacts required to close the worktree."),
@@ -34644,7 +34795,7 @@ function createLucernStandaloneMcpServer(options) {
34644
34795
  });
34645
34796
  const server = new McpServer({
34646
34797
  name: "lucern-mcp",
34647
- version: "0.3.0-alpha.16"
34798
+ version: "0.3.0-alpha.17"
34648
34799
  });
34649
34800
  registerTools(server, runtime);
34650
34801
  const resources = registerResources(server, runtime, observationStore);