@lucern/events 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/dist/types.js CHANGED
@@ -777,6 +777,7 @@ defineTable({
777
777
  shape: z.object({
778
778
  "tenantId": idOf("tenants"),
779
779
  "workspaceId": idOf("workspaces").optional(),
780
+ "environment": z.enum(["dev", "staging", "prod"]).optional(),
780
781
  "keyPrefix": z.enum(["luc", "stk"]),
781
782
  "keyHash": z.string(),
782
783
  "keyHint": z.string(),
@@ -804,7 +805,7 @@ defineTable({
804
805
  shape: z.object({
805
806
  "tenantId": idOf("tenants").optional(),
806
807
  "apiKeyId": idOf("apiKeys").optional(),
807
- "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"]),
808
+ "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"]),
808
809
  "actorClerkId": z.string(),
809
810
  "details": z.any().optional(),
810
811
  "createdAt": z.number()
@@ -6933,7 +6934,7 @@ function compactRecord2(input) {
6933
6934
  Object.entries(input).filter(([, value]) => value !== void 0)
6934
6935
  );
6935
6936
  }
6936
- var listBeliefsProjection = defineProjection({
6937
+ defineProjection({
6937
6938
  contractName: "list_beliefs",
6938
6939
  inputSchema: listBeliefsInputSchema,
6939
6940
  project: (input) => compactRecord2({
@@ -9442,7 +9443,7 @@ var IDENTITY_WHOAMI = {
9442
9443
  response: {
9443
9444
  description: "Canonical identity summary for the current session",
9444
9445
  fields: {
9445
- principalId: "string \u2014 canonical federated principal identifier",
9446
+ principalId: "string \u2014 canonical principal identifier; for humans this is the Clerk user_... ID",
9446
9447
  principalType: "string \u2014 human, service, agent, group, or external_viewer",
9447
9448
  tenantId: "string | undefined \u2014 resolved tenant scope",
9448
9449
  workspaceId: "string | undefined \u2014 resolved workspace scope",
@@ -9456,7 +9457,7 @@ var IDENTITY_WHOAMI = {
9456
9457
  };
9457
9458
  var RESOLVE_INTERACTIVE_PRINCIPAL = {
9458
9459
  name: "resolve_interactive_principal",
9459
- 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.",
9460
+ 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.",
9460
9461
  parameters: {
9461
9462
  clerkId: {
9462
9463
  type: "string",
@@ -9479,7 +9480,7 @@ var RESOLVE_INTERACTIVE_PRINCIPAL = {
9479
9480
  response: {
9480
9481
  description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
9481
9482
  fields: {
9482
- principalId: "string \u2014 canonical Lucern principal identifier",
9483
+ principalId: "string \u2014 canonical Clerk user_... ID for human sessions",
9483
9484
  principalType: "string \u2014 human, service, agent, group, or external_viewer",
9484
9485
  clerkId: "string \u2014 authenticated Clerk subject alias",
9485
9486
  tenantId: "string \u2014 resolved tenant scope",
@@ -10307,7 +10308,7 @@ var MANAGE_WRITE_POLICY = {
10307
10308
  },
10308
10309
  role: {
10309
10310
  type: "string",
10310
- description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
10311
+ description: "Role to set policy for (required for 'set'). E.g. 'agent:internal' or a Permit role key such as 'workspace_admin'."
10311
10312
  },
10312
10313
  permission: {
10313
10314
  type: "string",
@@ -12237,11 +12238,8 @@ var identityContracts = [
12237
12238
  sdkNamespace: "identity",
12238
12239
  sdkMethod: "whoami",
12239
12240
  summary: "Describe the current gateway principal.",
12240
- convex: {
12241
- module: "identity",
12242
- functionName: "whoami",
12243
- kind: "query",
12244
- inputProjection: withPrincipal
12241
+ gateway: {
12242
+ handler: "identity.whoami"
12245
12243
  }
12246
12244
  }),
12247
12245
  surfaceContract({
@@ -12261,7 +12259,7 @@ var identityContracts = [
12261
12259
  providerProjectId: z.string().min(1).optional()
12262
12260
  }),
12263
12261
  convex: {
12264
- module: "identity",
12262
+ module: "platform",
12265
12263
  functionName: "resolveInteractivePrincipal",
12266
12264
  kind: "query"
12267
12265
  }
@@ -12345,15 +12343,6 @@ var beliefLookupInput = (input) => compactRecord4({
12345
12343
  var beliefNodeInput = (input) => compactRecord4({
12346
12344
  nodeId: input.nodeId ?? input.id ?? input.beliefId
12347
12345
  });
12348
- var beliefTopicInput = (input) => {
12349
- const parsed = listBeliefsProjection.inputSchema.safeParse(input);
12350
- if (!parsed.success) {
12351
- throw new Error(
12352
- `list_beliefs projection input rejected: ${parsed.error.message}`
12353
- );
12354
- }
12355
- return compactRecord4(listBeliefsProjection.project(parsed.data));
12356
- };
12357
12346
  var createBeliefInput = (input, context) => {
12358
12347
  return withUserId(
12359
12348
  compactRecord4({
@@ -12442,11 +12431,8 @@ var beliefsContracts = [
12442
12431
  sdkNamespace: "beliefs",
12443
12432
  sdkMethod: "listBeliefs",
12444
12433
  summary: "List beliefs for a topic.",
12445
- convex: {
12446
- module: "beliefs",
12447
- functionName: "getByTopic",
12448
- kind: "query",
12449
- inputProjection: beliefTopicInput
12434
+ gateway: {
12435
+ handler: "beliefs.list"
12450
12436
  },
12451
12437
  args: listBeliefsInputSchema
12452
12438
  }),
@@ -12631,12 +12617,6 @@ var evidenceIdInput = (input) => compactRecord4({
12631
12617
  insightId: input.insightId,
12632
12618
  nodeId: input.nodeId ?? input.id ?? input.evidenceId
12633
12619
  });
12634
- var evidenceTopicInput = (input) => compactRecord4({
12635
- topicId: input.topicId,
12636
- status: input.status,
12637
- userId: input.userId,
12638
- limit: input.limit
12639
- });
12640
12620
  var createEvidenceInput = (input, context) => {
12641
12621
  const parsed = createEvidenceProjection.inputSchema.safeParse(input);
12642
12622
  if (!parsed.success) {
@@ -12767,11 +12747,8 @@ var evidenceContracts = [
12767
12747
  sdkNamespace: "evidence",
12768
12748
  sdkMethod: "listEvidence",
12769
12749
  summary: "List evidence for a topic.",
12770
- convex: {
12771
- module: "evidence",
12772
- functionName: "getByTopic",
12773
- kind: "query",
12774
- inputProjection: evidenceTopicInput
12750
+ gateway: {
12751
+ handler: "evidence.list"
12775
12752
  }
12776
12753
  }),
12777
12754
  surfaceContract({
@@ -13006,11 +12983,8 @@ var questionsContracts = [
13006
12983
  sdkNamespace: "questions",
13007
12984
  sdkMethod: "listQuestions",
13008
12985
  summary: "List questions for a topic.",
13009
- convex: {
13010
- module: "questions",
13011
- functionName: "getByTopic",
13012
- kind: "query",
13013
- inputProjection: questionTopicInput
12986
+ gateway: {
12987
+ handler: "questions.list"
13014
12988
  }
13015
12989
  }),
13016
12990
  surfaceContract({
@@ -14115,6 +14089,19 @@ var worktreeEvidenceSignalInputSchema = z.object({
14115
14089
  progress: z.string().optional().describe("Collection progress note for the signal."),
14116
14090
  notes: z.string().optional().describe("Additional evidence collection notes.")
14117
14091
  }).passthrough().describe("Evidence signal embedded in the worktree plan.");
14092
+ var worktreeDocCompanionTargetSchema = z.object({
14093
+ docPath: z.string().describe(
14094
+ "Repo-relative path to a documentation file the worktree promises to update."
14095
+ ),
14096
+ sectionAnchor: z.string().optional().describe(
14097
+ "Markdown heading anchor (e.g. '## Function-surface manifest') that scopes the promised update."
14098
+ ),
14099
+ reason: z.string().describe(
14100
+ "Why this doc section must be updated for the worktree to be complete."
14101
+ )
14102
+ }).passthrough().describe(
14103
+ "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."
14104
+ );
14118
14105
  var worktreeDecisionGateInputSchema = z.object({
14119
14106
  goCriteria: z.array(z.string()).describe("Criteria that must hold for the worktree to proceed."),
14120
14107
  noGoSignals: z.array(z.string()).describe("Signals that stop or redirect the worktree."),
@@ -14147,6 +14134,9 @@ var addWorktreeArgs = z.object({
14147
14134
  keyQuestions: z.array(worktreeKeyQuestionInputSchema).optional().describe("Inline key questions captured as part of the worktree plan."),
14148
14135
  evidenceSignals: z.array(worktreeEvidenceSignalInputSchema).optional().describe("Evidence signals the worktree needs to collect or validate."),
14149
14136
  decisionGate: worktreeDecisionGateInputSchema.optional(),
14137
+ docCompanionTargets: z.array(worktreeDocCompanionTargetSchema).optional().describe(
14138
+ "Doc sections the worktree promises to update at PR time. Enforced by pr-gate-reviewer (Lock 3)."
14139
+ ),
14150
14140
  goCriteria: z.array(z.string()).optional().describe("Shorthand go criteria used to build decisionGate."),
14151
14141
  noGoSignals: z.array(z.string()).optional().describe("Shorthand no-go signals used to build decisionGate."),
14152
14142
  proofArtifacts: z.array(z.unknown()).optional().describe("Expected proof artifacts required to close the worktree."),