@lucern/contracts 0.3.0-alpha.12 → 0.3.0-alpha.13

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.
Files changed (128) hide show
  1. package/dist/auth-context.contract.js +13 -1
  2. package/dist/auth-context.contract.js.map +1 -1
  3. package/dist/auth-session.contract.js +13 -1
  4. package/dist/auth-session.contract.js.map +1 -1
  5. package/dist/auth.contract.d.ts +1 -1
  6. package/dist/auth.contract.js +13 -1
  7. package/dist/auth.contract.js.map +1 -1
  8. package/dist/component-boundary.contract.js +1 -0
  9. package/dist/component-boundary.contract.js.map +1 -1
  10. package/dist/function-registry/beliefs.d.ts +10 -10
  11. package/dist/function-registry/beliefs.js +53 -2
  12. package/dist/function-registry/beliefs.js.map +1 -1
  13. package/dist/function-registry/coding.d.ts +6 -6
  14. package/dist/function-registry/coding.js +53 -2
  15. package/dist/function-registry/coding.js.map +1 -1
  16. package/dist/function-registry/context.d.ts +3 -3
  17. package/dist/function-registry/context.js +53 -2
  18. package/dist/function-registry/context.js.map +1 -1
  19. package/dist/function-registry/contracts.d.ts +3 -3
  20. package/dist/function-registry/contracts.js +53 -2
  21. package/dist/function-registry/contracts.js.map +1 -1
  22. package/dist/function-registry/coordination.d.ts +9 -9
  23. package/dist/function-registry/coordination.js +53 -2
  24. package/dist/function-registry/coordination.js.map +1 -1
  25. package/dist/function-registry/edges.d.ts +6 -6
  26. package/dist/function-registry/edges.js +53 -2
  27. package/dist/function-registry/edges.js.map +1 -1
  28. package/dist/function-registry/evidence.d.ts +8 -8
  29. package/dist/function-registry/evidence.js +53 -2
  30. package/dist/function-registry/evidence.js.map +1 -1
  31. package/dist/function-registry/graph.d.ts +15 -15
  32. package/dist/function-registry/graph.js +53 -2
  33. package/dist/function-registry/graph.js.map +1 -1
  34. package/dist/function-registry/helpers.d.ts +2 -2
  35. package/dist/function-registry/helpers.js +53 -2
  36. package/dist/function-registry/helpers.js.map +1 -1
  37. package/dist/function-registry/identity.d.ts +56 -16
  38. package/dist/function-registry/identity.js +75 -4
  39. package/dist/function-registry/identity.js.map +1 -1
  40. package/dist/function-registry/index.d.ts +1 -1
  41. package/dist/function-registry/index.js +53 -2
  42. package/dist/function-registry/index.js.map +1 -1
  43. package/dist/function-registry/judgments.d.ts +2 -2
  44. package/dist/function-registry/judgments.js +53 -2
  45. package/dist/function-registry/judgments.js.map +1 -1
  46. package/dist/function-registry/legacy.d.ts +1 -1
  47. package/dist/function-registry/legacy.js +53 -2
  48. package/dist/function-registry/legacy.js.map +1 -1
  49. package/dist/function-registry/lenses.d.ts +4 -4
  50. package/dist/function-registry/lenses.js +53 -2
  51. package/dist/function-registry/lenses.js.map +1 -1
  52. package/dist/function-registry/manifest.d.ts +3 -3
  53. package/dist/function-registry/manifest.js +1 -0
  54. package/dist/function-registry/manifest.js.map +1 -1
  55. package/dist/function-registry/nodes.d.ts +8 -8
  56. package/dist/function-registry/nodes.js +53 -2
  57. package/dist/function-registry/nodes.js.map +1 -1
  58. package/dist/function-registry/ontologies.d.ts +11 -11
  59. package/dist/function-registry/ontologies.js +53 -2
  60. package/dist/function-registry/ontologies.js.map +1 -1
  61. package/dist/function-registry/pipeline.d.ts +3 -3
  62. package/dist/function-registry/pipeline.js +53 -2
  63. package/dist/function-registry/pipeline.js.map +1 -1
  64. package/dist/function-registry/questions.d.ts +12 -12
  65. package/dist/function-registry/questions.js +53 -2
  66. package/dist/function-registry/questions.js.map +1 -1
  67. package/dist/function-registry/tasks.d.ts +4 -4
  68. package/dist/function-registry/tasks.js +53 -2
  69. package/dist/function-registry/tasks.js.map +1 -1
  70. package/dist/function-registry/topics.d.ts +7 -7
  71. package/dist/function-registry/topics.js +53 -2
  72. package/dist/function-registry/topics.js.map +1 -1
  73. package/dist/function-registry/types.d.ts +2 -2
  74. package/dist/function-registry/worktrees.d.ts +11 -11
  75. package/dist/function-registry/worktrees.js +53 -2
  76. package/dist/function-registry/worktrees.js.map +1 -1
  77. package/dist/generated/convexSchemas.js +2 -1
  78. package/dist/generated/convexSchemas.js.map +1 -1
  79. package/dist/generated/infisicalRuntimeEnv.js +111 -0
  80. package/dist/generated/infisicalRuntimeEnv.js.map +1 -1
  81. package/dist/generated/schema-manifest.json +88 -3
  82. package/dist/generated/tableOwnership.d.ts +2 -1
  83. package/dist/generated/tableOwnership.js +2 -0
  84. package/dist/generated/tableOwnership.js.map +1 -1
  85. package/dist/generated/tier-expectations.json +6 -3
  86. package/dist/index.d.ts +2 -2
  87. package/dist/index.js +290 -20
  88. package/dist/index.js.map +1 -1
  89. package/dist/infisical-runtime.contract.d.ts +18 -0
  90. package/dist/infisical-runtime.contract.js +21 -0
  91. package/dist/infisical-runtime.contract.js.map +1 -1
  92. package/dist/manifests/infisical-runtime-manifest.d.ts +18 -0
  93. package/dist/manifests/infisical-runtime-manifest.js +21 -0
  94. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  95. package/dist/manifests/tenant-client-manifest.d.ts +8 -3
  96. package/dist/manifests/tenant-client-manifest.js +18 -1
  97. package/dist/manifests/tenant-client-manifest.js.map +1 -1
  98. package/dist/permit-principal-projection.contract.js +2 -3
  99. package/dist/permit-principal-projection.contract.js.map +1 -1
  100. package/dist/proof-attestation.json +1 -1
  101. package/dist/schemas/index.js +33 -0
  102. package/dist/schemas/index.js.map +1 -1
  103. package/dist/schemas/manifest.d.ts +75 -0
  104. package/dist/schemas/manifest.js +33 -0
  105. package/dist/schemas/manifest.js.map +1 -1
  106. package/dist/schemas/tables/controlPlane/accessControl.js +3 -0
  107. package/dist/schemas/tables/controlPlane/accessControl.js.map +1 -1
  108. package/dist/schemas/tables/kernel/events.d.ts +21 -0
  109. package/dist/schemas/tables/kernel/events.js +43 -0
  110. package/dist/schemas/tables/kernel/events.js.map +1 -0
  111. package/dist/{sdk-tools.contract-BNklQDfB.d.ts → sdk-tools.contract-CKmSsrZ2.d.ts} +1 -1
  112. package/dist/sdk-tools.contract.d.ts +2 -2
  113. package/dist/sdk-tools.contract.js +45 -1
  114. package/dist/sdk-tools.contract.js.map +1 -1
  115. package/dist/tenant-bootstrap-seed.contract.d.ts +22 -2
  116. package/dist/tenant-bootstrap-seed.contract.js +15 -2
  117. package/dist/tenant-bootstrap-seed.contract.js.map +1 -1
  118. package/dist/tenant-bootstrap-seed.defaults.d.ts +1 -1
  119. package/dist/tenant-bootstrap-seed.defaults.js +30 -12
  120. package/dist/tenant-bootstrap-seed.defaults.js.map +1 -1
  121. package/dist/tenant-client.contract.d.ts +8 -3
  122. package/dist/tenant-client.contract.js +18 -1
  123. package/dist/tenant-client.contract.js.map +1 -1
  124. package/dist/{tool-contracts-BevD9Ho2.d.ts → tool-contracts-C_xvM9q2.d.ts} +4 -2
  125. package/dist/tool-contracts.d.ts +1 -1
  126. package/dist/tool-contracts.js +46 -2
  127. package/dist/tool-contracts.js.map +1 -1
  128. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod';
1
+ import { z } from 'zod';
2
2
 
3
3
  /**
4
4
  * MCP Tool Contract Definitions
@@ -115,14 +115,14 @@ declare const identityContracts: readonly [{
115
115
  };
116
116
  auth: {
117
117
  scopes: string[];
118
- allowedPrincipalTypes: ("user" | "service" | "agent")[];
118
+ allowedPrincipalTypes: ("user" | "service" | "agent" | "group" | "external_viewer")[];
119
119
  };
120
120
  convex: FunctionConvexTarget | undefined;
121
121
  gateway: FunctionGatewayTarget | undefined;
122
- args: zod.ZodTypeAny;
123
- returns: zod.ZodTypeAny;
124
- input: zod.ZodTypeAny;
125
- output: zod.ZodTypeAny;
122
+ args: z.ZodTypeAny;
123
+ returns: z.ZodTypeAny;
124
+ input: z.ZodTypeAny;
125
+ output: z.ZodTypeAny;
126
126
  openapi: {
127
127
  summary: string;
128
128
  tags: string[];
@@ -155,14 +155,14 @@ declare const identityContracts: readonly [{
155
155
  };
156
156
  auth: {
157
157
  scopes: string[];
158
- allowedPrincipalTypes: ("user" | "service" | "agent")[];
158
+ allowedPrincipalTypes: ("user" | "service" | "agent" | "group" | "external_viewer")[];
159
159
  };
160
160
  convex: FunctionConvexTarget | undefined;
161
161
  gateway: FunctionGatewayTarget | undefined;
162
- args: zod.ZodTypeAny;
163
- returns: zod.ZodTypeAny;
164
- input: zod.ZodTypeAny;
165
- output: zod.ZodTypeAny;
162
+ args: z.ZodTypeAny;
163
+ returns: z.ZodTypeAny;
164
+ input: z.ZodTypeAny;
165
+ output: z.ZodTypeAny;
166
166
  openapi: {
167
167
  summary: string;
168
168
  tags: string[];
@@ -195,14 +195,54 @@ declare const identityContracts: readonly [{
195
195
  };
196
196
  auth: {
197
197
  scopes: string[];
198
- allowedPrincipalTypes: ("user" | "service" | "agent")[];
198
+ allowedPrincipalTypes: ("user" | "service" | "agent" | "group" | "external_viewer")[];
199
199
  };
200
200
  convex: FunctionConvexTarget | undefined;
201
201
  gateway: FunctionGatewayTarget | undefined;
202
- args: zod.ZodTypeAny;
203
- returns: zod.ZodTypeAny;
204
- input: zod.ZodTypeAny;
205
- output: zod.ZodTypeAny;
202
+ args: z.ZodTypeAny;
203
+ returns: z.ZodTypeAny;
204
+ input: z.ZodTypeAny;
205
+ output: z.ZodTypeAny;
206
+ openapi: {
207
+ summary: string;
208
+ tags: string[];
209
+ };
210
+ }, {
211
+ name: string;
212
+ kind: FunctionKind;
213
+ idempotent: FunctionIdempotency;
214
+ effects: readonly FunctionEffect[];
215
+ invariants: readonly string[] | undefined;
216
+ surfaceIntent: FunctionSurfaceIntent;
217
+ domain: string;
218
+ surfaceClass: SurfaceClass;
219
+ surfaces: FunctionSurfaceMap;
220
+ replacedBy: string | undefined;
221
+ rest: {
222
+ method: "GET" | "POST" | "PATCH" | "DELETE";
223
+ path: string;
224
+ };
225
+ sdk: {
226
+ namespace: string;
227
+ method: string;
228
+ };
229
+ mcp: {
230
+ exposed: boolean;
231
+ toolName: string;
232
+ } & McpToolContract & {
233
+ exposed: boolean;
234
+ toolName: string;
235
+ };
236
+ auth: {
237
+ scopes: string[];
238
+ allowedPrincipalTypes: ("user" | "service" | "agent" | "group" | "external_viewer")[];
239
+ };
240
+ convex: FunctionConvexTarget | undefined;
241
+ gateway: FunctionGatewayTarget | undefined;
242
+ args: z.ZodTypeAny;
243
+ returns: z.ZodTypeAny;
244
+ input: z.ZodTypeAny;
245
+ output: z.ZodTypeAny;
206
246
  openapi: {
207
247
  summary: string;
208
248
  tags: string[];
@@ -2328,7 +2328,7 @@ var IDENTITY_WHOAMI = {
2328
2328
  description: "Canonical identity summary for the current session",
2329
2329
  fields: {
2330
2330
  principalId: "string \u2014 canonical federated principal identifier",
2331
- principalType: "string \u2014 human, service, or agent",
2331
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2332
2332
  tenantId: "string | undefined \u2014 resolved tenant scope",
2333
2333
  workspaceId: "string | undefined \u2014 resolved workspace scope",
2334
2334
  scopes: "string[] | undefined \u2014 granted scopes for this session",
@@ -2339,6 +2339,49 @@ var IDENTITY_WHOAMI = {
2339
2339
  ontologyPrimitive: "identity",
2340
2340
  tier: "workhorse"
2341
2341
  };
2342
+ var RESOLVE_INTERACTIVE_PRINCIPAL = {
2343
+ name: "resolve_interactive_principal",
2344
+ 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.",
2345
+ parameters: {
2346
+ clerkId: {
2347
+ type: "string",
2348
+ description: "Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record."
2349
+ },
2350
+ tenantId: {
2351
+ type: "string",
2352
+ description: "Optional tenant scope. Omit only when the Clerk alias is globally unambiguous."
2353
+ },
2354
+ workspaceId: {
2355
+ type: "string",
2356
+ description: "Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred."
2357
+ },
2358
+ providerProjectId: {
2359
+ type: "string",
2360
+ description: "Optional Clerk project or provider instance id for tenants with multiple identity providers."
2361
+ }
2362
+ },
2363
+ required: ["clerkId"],
2364
+ response: {
2365
+ description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
2366
+ fields: {
2367
+ principalId: "string \u2014 canonical Lucern principal identifier",
2368
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2369
+ clerkId: "string \u2014 authenticated Clerk subject alias",
2370
+ tenantId: "string \u2014 resolved tenant scope",
2371
+ workspaceId: "string | null \u2014 resolved workspace scope",
2372
+ roles: "string[] \u2014 effective Permit roles",
2373
+ scopes: "string[] \u2014 effective scopes derived from Permit/control-plane projection",
2374
+ groupIds: "string[] \u2014 active Permit group memberships",
2375
+ principalStatus: "string \u2014 active, invited, suspended, disabled, revoked, or missing",
2376
+ tenantStatus: "string \u2014 projected tenant resource status",
2377
+ workspaceStatus: "string \u2014 projected workspace resource status",
2378
+ permit: "object \u2014 Permit subject, tenant, and optional workspace tuple"
2379
+ }
2380
+ },
2381
+ ownerModule: "control-plane",
2382
+ ontologyPrimitive: "identity",
2383
+ tier: "workhorse"
2384
+ };
2342
2385
  var COMPILE_CONTEXT = {
2343
2386
  name: "compile_context",
2344
2387
  description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
@@ -4241,6 +4284,7 @@ var MCP_TOOL_CONTRACTS = {
4241
4284
  update_worktree_targets: UPDATE_WORKTREE_TARGETS,
4242
4285
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
4243
4286
  identity_whoami: IDENTITY_WHOAMI,
4287
+ resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
4244
4288
  compile_context: COMPILE_CONTEXT,
4245
4289
  record_scope_learning: RECORD_SCOPE_LEARNING,
4246
4290
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -4358,6 +4402,7 @@ function entries(names, surfaceClass, surfaceIntent, surfaces, rationale) {
4358
4402
  var MCP_CORE_OPERATION_NAMES = [
4359
4403
  "compile_context",
4360
4404
  "identity_whoami",
4405
+ "resolve_interactive_principal",
4361
4406
  "check_permission",
4362
4407
  "filter_by_permission",
4363
4408
  "create_belief",
@@ -4895,7 +4940,13 @@ function surfaceContract(args) {
4895
4940
  scopes: args.scopes ?? [
4896
4941
  args.kind === "query" ? `${args.domain}.read` : `${args.domain}.write`
4897
4942
  ],
4898
- allowedPrincipalTypes: ["user", "service", "agent"]
4943
+ allowedPrincipalTypes: [
4944
+ "user",
4945
+ "service",
4946
+ "agent",
4947
+ "group",
4948
+ "external_viewer"
4949
+ ]
4899
4950
  },
4900
4951
  convex: args.convex,
4901
4952
  gateway: args.gateway,
@@ -4909,8 +4960,6 @@ function surfaceContract(args) {
4909
4960
  }
4910
4961
  });
4911
4962
  }
4912
-
4913
- // src/function-registry/identity.ts
4914
4963
  var withPrincipal = (input, context) => ({
4915
4964
  ...input,
4916
4965
  tenantId: input.tenantId ?? context.tenantId,
@@ -4936,6 +4985,28 @@ var identityContracts = [
4936
4985
  inputProjection: withPrincipal
4937
4986
  }
4938
4987
  }),
4988
+ surfaceContract({
4989
+ name: "resolve_interactive_principal",
4990
+ kind: "query",
4991
+ domain: "controlPlane",
4992
+ surfaceClass: "platform_public",
4993
+ method: "POST",
4994
+ path: "/control-plane/identity/resolve-interactive-principal",
4995
+ sdkNamespace: "controlPlane.identity",
4996
+ sdkMethod: "resolveInteractivePrincipal",
4997
+ summary: "Resolve an authenticated Clerk user into a Permit-backed Lucern principal context.",
4998
+ args: z.object({
4999
+ clerkId: z.string().min(1),
5000
+ tenantId: z.string().min(1).optional(),
5001
+ workspaceId: z.string().min(1).optional(),
5002
+ providerProjectId: z.string().min(1).optional()
5003
+ }),
5004
+ convex: {
5005
+ module: "identity",
5006
+ functionName: "resolveInteractivePrincipal",
5007
+ kind: "query"
5008
+ }
5009
+ }),
4939
5010
  surfaceContract({
4940
5011
  name: "check_permission",
4941
5012
  kind: "query",