@lucern/mcp 0.3.0-alpha.15 → 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.
- package/README.md +2 -1
- package/dist/cli.js +205 -72
- package/dist/cli.js.map +1 -1
- package/dist/gateway.js +763 -136
- package/dist/gateway.js.map +1 -1
- package/dist/hosted-route.js +203 -66
- package/dist/hosted-route.js.map +1 -1
- package/dist/index.js +205 -72
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +33 -43
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -8
package/dist/runtime.js
CHANGED
|
@@ -987,6 +987,7 @@ defineTable({
|
|
|
987
987
|
shape: z.object({
|
|
988
988
|
"tenantId": idOf("tenants"),
|
|
989
989
|
"workspaceId": idOf("workspaces").optional(),
|
|
990
|
+
"environment": z.enum(["dev", "staging", "prod"]).optional(),
|
|
990
991
|
"keyPrefix": z.enum(["luc", "stk"]),
|
|
991
992
|
"keyHash": z.string(),
|
|
992
993
|
"keyHint": z.string(),
|
|
@@ -1014,7 +1015,7 @@ defineTable({
|
|
|
1014
1015
|
shape: z.object({
|
|
1015
1016
|
"tenantId": idOf("tenants").optional(),
|
|
1016
1017
|
"apiKeyId": idOf("apiKeys").optional(),
|
|
1017
|
-
"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"]),
|
|
1018
|
+
"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"]),
|
|
1018
1019
|
"actorClerkId": z.string(),
|
|
1019
1020
|
"details": z.any().optional(),
|
|
1020
1021
|
"createdAt": z.number()
|
|
@@ -7143,7 +7144,7 @@ function compactRecord2(input) {
|
|
|
7143
7144
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
7144
7145
|
);
|
|
7145
7146
|
}
|
|
7146
|
-
|
|
7147
|
+
defineProjection({
|
|
7147
7148
|
contractName: "list_beliefs",
|
|
7148
7149
|
inputSchema: listBeliefsInputSchema,
|
|
7149
7150
|
project: (input) => compactRecord2({
|
|
@@ -9721,7 +9722,7 @@ var IDENTITY_WHOAMI = {
|
|
|
9721
9722
|
response: {
|
|
9722
9723
|
description: "Canonical identity summary for the current session",
|
|
9723
9724
|
fields: {
|
|
9724
|
-
principalId: "string \u2014 canonical
|
|
9725
|
+
principalId: "string \u2014 canonical principal identifier; for humans this is the Clerk user_... ID",
|
|
9725
9726
|
principalType: "string \u2014 human, service, agent, group, or external_viewer",
|
|
9726
9727
|
tenantId: "string | undefined \u2014 resolved tenant scope",
|
|
9727
9728
|
workspaceId: "string | undefined \u2014 resolved workspace scope",
|
|
@@ -9735,7 +9736,7 @@ var IDENTITY_WHOAMI = {
|
|
|
9735
9736
|
};
|
|
9736
9737
|
var RESOLVE_INTERACTIVE_PRINCIPAL = {
|
|
9737
9738
|
name: "resolve_interactive_principal",
|
|
9738
|
-
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
|
|
9739
|
+
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.",
|
|
9739
9740
|
parameters: {
|
|
9740
9741
|
clerkId: {
|
|
9741
9742
|
type: "string",
|
|
@@ -9758,7 +9759,7 @@ var RESOLVE_INTERACTIVE_PRINCIPAL = {
|
|
|
9758
9759
|
response: {
|
|
9759
9760
|
description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
|
|
9760
9761
|
fields: {
|
|
9761
|
-
principalId: "string \u2014 canonical
|
|
9762
|
+
principalId: "string \u2014 canonical Clerk user_... ID for human sessions",
|
|
9762
9763
|
principalType: "string \u2014 human, service, agent, group, or external_viewer",
|
|
9763
9764
|
clerkId: "string \u2014 authenticated Clerk subject alias",
|
|
9764
9765
|
tenantId: "string \u2014 resolved tenant scope",
|
|
@@ -10586,7 +10587,7 @@ var MANAGE_WRITE_POLICY = {
|
|
|
10586
10587
|
},
|
|
10587
10588
|
role: {
|
|
10588
10589
|
type: "string",
|
|
10589
|
-
description: "Role to set policy for (required for 'set'). E.g. 'agent:internal'
|
|
10590
|
+
description: "Role to set policy for (required for 'set'). E.g. 'agent:internal' or a Permit role key such as 'workspace_admin'."
|
|
10590
10591
|
},
|
|
10591
10592
|
permission: {
|
|
10592
10593
|
type: "string",
|
|
@@ -12516,11 +12517,8 @@ var identityContracts = [
|
|
|
12516
12517
|
sdkNamespace: "identity",
|
|
12517
12518
|
sdkMethod: "whoami",
|
|
12518
12519
|
summary: "Describe the current gateway principal.",
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
functionName: "whoami",
|
|
12522
|
-
kind: "query",
|
|
12523
|
-
inputProjection: withPrincipal
|
|
12520
|
+
gateway: {
|
|
12521
|
+
handler: "identity.whoami"
|
|
12524
12522
|
}
|
|
12525
12523
|
}),
|
|
12526
12524
|
surfaceContract({
|
|
@@ -12540,7 +12538,7 @@ var identityContracts = [
|
|
|
12540
12538
|
providerProjectId: z.string().min(1).optional()
|
|
12541
12539
|
}),
|
|
12542
12540
|
convex: {
|
|
12543
|
-
module: "
|
|
12541
|
+
module: "platform",
|
|
12544
12542
|
functionName: "resolveInteractivePrincipal",
|
|
12545
12543
|
kind: "query"
|
|
12546
12544
|
}
|
|
@@ -12624,15 +12622,6 @@ var beliefLookupInput = (input) => compactRecord4({
|
|
|
12624
12622
|
var beliefNodeInput = (input) => compactRecord4({
|
|
12625
12623
|
nodeId: input.nodeId ?? input.id ?? input.beliefId
|
|
12626
12624
|
});
|
|
12627
|
-
var beliefTopicInput = (input) => {
|
|
12628
|
-
const parsed = listBeliefsProjection.inputSchema.safeParse(input);
|
|
12629
|
-
if (!parsed.success) {
|
|
12630
|
-
throw new Error(
|
|
12631
|
-
`list_beliefs projection input rejected: ${parsed.error.message}`
|
|
12632
|
-
);
|
|
12633
|
-
}
|
|
12634
|
-
return compactRecord4(listBeliefsProjection.project(parsed.data));
|
|
12635
|
-
};
|
|
12636
12625
|
var createBeliefInput = (input, context) => {
|
|
12637
12626
|
return withUserId(
|
|
12638
12627
|
compactRecord4({
|
|
@@ -12721,11 +12710,8 @@ var beliefsContracts = [
|
|
|
12721
12710
|
sdkNamespace: "beliefs",
|
|
12722
12711
|
sdkMethod: "listBeliefs",
|
|
12723
12712
|
summary: "List beliefs for a topic.",
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
functionName: "getByTopic",
|
|
12727
|
-
kind: "query",
|
|
12728
|
-
inputProjection: beliefTopicInput
|
|
12713
|
+
gateway: {
|
|
12714
|
+
handler: "beliefs.list"
|
|
12729
12715
|
},
|
|
12730
12716
|
args: listBeliefsInputSchema
|
|
12731
12717
|
}),
|
|
@@ -12910,12 +12896,6 @@ var evidenceIdInput = (input) => compactRecord4({
|
|
|
12910
12896
|
insightId: input.insightId,
|
|
12911
12897
|
nodeId: input.nodeId ?? input.id ?? input.evidenceId
|
|
12912
12898
|
});
|
|
12913
|
-
var evidenceTopicInput = (input) => compactRecord4({
|
|
12914
|
-
topicId: input.topicId,
|
|
12915
|
-
status: input.status,
|
|
12916
|
-
userId: input.userId,
|
|
12917
|
-
limit: input.limit
|
|
12918
|
-
});
|
|
12919
12899
|
var createEvidenceInput = (input, context) => {
|
|
12920
12900
|
const parsed = createEvidenceProjection.inputSchema.safeParse(input);
|
|
12921
12901
|
if (!parsed.success) {
|
|
@@ -13046,11 +13026,8 @@ var evidenceContracts = [
|
|
|
13046
13026
|
sdkNamespace: "evidence",
|
|
13047
13027
|
sdkMethod: "listEvidence",
|
|
13048
13028
|
summary: "List evidence for a topic.",
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
functionName: "getByTopic",
|
|
13052
|
-
kind: "query",
|
|
13053
|
-
inputProjection: evidenceTopicInput
|
|
13029
|
+
gateway: {
|
|
13030
|
+
handler: "evidence.list"
|
|
13054
13031
|
}
|
|
13055
13032
|
}),
|
|
13056
13033
|
surfaceContract({
|
|
@@ -13285,11 +13262,8 @@ var questionsContracts = [
|
|
|
13285
13262
|
sdkNamespace: "questions",
|
|
13286
13263
|
sdkMethod: "listQuestions",
|
|
13287
13264
|
summary: "List questions for a topic.",
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
functionName: "getByTopic",
|
|
13291
|
-
kind: "query",
|
|
13292
|
-
inputProjection: questionTopicInput
|
|
13265
|
+
gateway: {
|
|
13266
|
+
handler: "questions.list"
|
|
13293
13267
|
}
|
|
13294
13268
|
}),
|
|
13295
13269
|
surfaceContract({
|
|
@@ -14394,6 +14368,19 @@ var worktreeEvidenceSignalInputSchema = z.object({
|
|
|
14394
14368
|
progress: z.string().optional().describe("Collection progress note for the signal."),
|
|
14395
14369
|
notes: z.string().optional().describe("Additional evidence collection notes.")
|
|
14396
14370
|
}).passthrough().describe("Evidence signal embedded in the worktree plan.");
|
|
14371
|
+
var worktreeDocCompanionTargetSchema = z.object({
|
|
14372
|
+
docPath: z.string().describe(
|
|
14373
|
+
"Repo-relative path to a documentation file the worktree promises to update."
|
|
14374
|
+
),
|
|
14375
|
+
sectionAnchor: z.string().optional().describe(
|
|
14376
|
+
"Markdown heading anchor (e.g. '## Function-surface manifest') that scopes the promised update."
|
|
14377
|
+
),
|
|
14378
|
+
reason: z.string().describe(
|
|
14379
|
+
"Why this doc section must be updated for the worktree to be complete."
|
|
14380
|
+
)
|
|
14381
|
+
}).passthrough().describe(
|
|
14382
|
+
"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."
|
|
14383
|
+
);
|
|
14397
14384
|
var worktreeDecisionGateInputSchema = z.object({
|
|
14398
14385
|
goCriteria: z.array(z.string()).describe("Criteria that must hold for the worktree to proceed."),
|
|
14399
14386
|
noGoSignals: z.array(z.string()).describe("Signals that stop or redirect the worktree."),
|
|
@@ -14426,6 +14413,9 @@ var addWorktreeArgs = z.object({
|
|
|
14426
14413
|
keyQuestions: z.array(worktreeKeyQuestionInputSchema).optional().describe("Inline key questions captured as part of the worktree plan."),
|
|
14427
14414
|
evidenceSignals: z.array(worktreeEvidenceSignalInputSchema).optional().describe("Evidence signals the worktree needs to collect or validate."),
|
|
14428
14415
|
decisionGate: worktreeDecisionGateInputSchema.optional(),
|
|
14416
|
+
docCompanionTargets: z.array(worktreeDocCompanionTargetSchema).optional().describe(
|
|
14417
|
+
"Doc sections the worktree promises to update at PR time. Enforced by pr-gate-reviewer (Lock 3)."
|
|
14418
|
+
),
|
|
14429
14419
|
goCriteria: z.array(z.string()).optional().describe("Shorthand go criteria used to build decisionGate."),
|
|
14430
14420
|
noGoSignals: z.array(z.string()).optional().describe("Shorthand no-go signals used to build decisionGate."),
|
|
14431
14421
|
proofArtifacts: z.array(z.unknown()).optional().describe("Expected proof artifacts required to close the worktree."),
|
|
@@ -19217,7 +19207,7 @@ async function resolveBeliefTopicId(ctx, beliefId) {
|
|
|
19217
19207
|
if (!normalizedBeliefId) {
|
|
19218
19208
|
return void 0;
|
|
19219
19209
|
}
|
|
19220
|
-
return fetchRecordTopicId(ctx, api.
|
|
19210
|
+
return fetchRecordTopicId(ctx, api.beliefs.getById, {
|
|
19221
19211
|
beliefId: normalizedBeliefId,
|
|
19222
19212
|
nodeId: normalizedBeliefId
|
|
19223
19213
|
});
|