@lucern/contracts 1.0.10 → 1.0.12

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 (112) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/function-registry/beliefs.d.ts +1 -1
  3. package/dist/function-registry/beliefs.js +79 -0
  4. package/dist/function-registry/beliefs.js.map +1 -1
  5. package/dist/function-registry/coding.d.ts +1 -1
  6. package/dist/function-registry/coding.js +79 -0
  7. package/dist/function-registry/coding.js.map +1 -1
  8. package/dist/function-registry/context.d.ts +44 -4
  9. package/dist/function-registry/context.js +101 -0
  10. package/dist/function-registry/context.js.map +1 -1
  11. package/dist/function-registry/contracts.d.ts +1 -1
  12. package/dist/function-registry/contracts.js +79 -0
  13. package/dist/function-registry/contracts.js.map +1 -1
  14. package/dist/function-registry/coordination.d.ts +1 -1
  15. package/dist/function-registry/coordination.js +79 -0
  16. package/dist/function-registry/coordination.js.map +1 -1
  17. package/dist/function-registry/edges.d.ts +1 -1
  18. package/dist/function-registry/edges.js +79 -0
  19. package/dist/function-registry/edges.js.map +1 -1
  20. package/dist/function-registry/evidence.d.ts +1 -1
  21. package/dist/function-registry/evidence.js +144 -24
  22. package/dist/function-registry/evidence.js.map +1 -1
  23. package/dist/function-registry/graph.d.ts +1 -1
  24. package/dist/function-registry/graph.js +81 -4
  25. package/dist/function-registry/graph.js.map +1 -1
  26. package/dist/function-registry/helpers.js +79 -0
  27. package/dist/function-registry/helpers.js.map +1 -1
  28. package/dist/function-registry/identity.d.ts +1 -1
  29. package/dist/function-registry/identity.js +79 -0
  30. package/dist/function-registry/identity.js.map +1 -1
  31. package/dist/function-registry/index.js +79 -0
  32. package/dist/function-registry/index.js.map +1 -1
  33. package/dist/function-registry/judgments.d.ts +1 -1
  34. package/dist/function-registry/judgments.js +79 -0
  35. package/dist/function-registry/judgments.js.map +1 -1
  36. package/dist/function-registry/legacy.d.ts +1 -1
  37. package/dist/function-registry/legacy.js +79 -0
  38. package/dist/function-registry/legacy.js.map +1 -1
  39. package/dist/function-registry/lenses.d.ts +1 -1
  40. package/dist/function-registry/lenses.js +79 -0
  41. package/dist/function-registry/lenses.js.map +1 -1
  42. package/dist/function-registry/manifest.d.ts +2 -2
  43. package/dist/function-registry/manifest.js +1 -0
  44. package/dist/function-registry/manifest.js.map +1 -1
  45. package/dist/function-registry/nodes.d.ts +1 -1
  46. package/dist/function-registry/nodes.js +79 -0
  47. package/dist/function-registry/nodes.js.map +1 -1
  48. package/dist/function-registry/ontologies.d.ts +1 -1
  49. package/dist/function-registry/ontologies.js +79 -0
  50. package/dist/function-registry/ontologies.js.map +1 -1
  51. package/dist/function-registry/pipeline.d.ts +1 -1
  52. package/dist/function-registry/pipeline.js +79 -0
  53. package/dist/function-registry/pipeline.js.map +1 -1
  54. package/dist/function-registry/questions.d.ts +1 -1
  55. package/dist/function-registry/questions.js +79 -0
  56. package/dist/function-registry/questions.js.map +1 -1
  57. package/dist/function-registry/tasks.d.ts +1 -1
  58. package/dist/function-registry/tasks.js +79 -0
  59. package/dist/function-registry/tasks.js.map +1 -1
  60. package/dist/function-registry/topics.d.ts +1 -1
  61. package/dist/function-registry/topics.js +81 -4
  62. package/dist/function-registry/topics.js.map +1 -1
  63. package/dist/function-registry/types.d.ts +1 -1
  64. package/dist/function-registry/worktrees.d.ts +1 -1
  65. package/dist/function-registry/worktrees.js +79 -0
  66. package/dist/function-registry/worktrees.js.map +1 -1
  67. package/dist/generated/infisicalRuntimeEnv.js +536 -1
  68. package/dist/generated/infisicalRuntimeEnv.js.map +1 -1
  69. package/dist/index.d.ts +2 -1
  70. package/dist/index.js +831 -4
  71. package/dist/index.js.map +1 -1
  72. package/dist/infisical-runtime.base.d.ts +42 -1
  73. package/dist/infisical-runtime.base.js +50 -1
  74. package/dist/infisical-runtime.base.js.map +1 -1
  75. package/dist/infisical-runtime.contract.d.ts +102 -0
  76. package/dist/infisical-runtime.contract.js +170 -1
  77. package/dist/infisical-runtime.contract.js.map +1 -1
  78. package/dist/infisical-runtime.platform-secrets.d.ts +102 -0
  79. package/dist/infisical-runtime.platform-secrets.js +120 -0
  80. package/dist/infisical-runtime.platform-secrets.js.map +1 -1
  81. package/dist/infisical-runtime.tenant-secrets.js.map +1 -1
  82. package/dist/manifests/infisical-runtime-manifest.d.ts +144 -1
  83. package/dist/manifests/infisical-runtime-manifest.js +170 -1
  84. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  85. package/dist/projections/check-convex-args-shape.js +60 -2
  86. package/dist/projections/check-convex-args-shape.js.map +1 -1
  87. package/dist/projections/create-evidence.projection.js +60 -2
  88. package/dist/projections/create-evidence.projection.js.map +1 -1
  89. package/dist/projections/index.js +60 -2
  90. package/dist/projections/index.js.map +1 -1
  91. package/dist/proof-attestation.json +1 -1
  92. package/dist/schemas/manifest.d.ts +20 -20
  93. package/dist/schemas/tables/kernel/platform.d.ts +4 -4
  94. package/dist/sdk-tools.contract.js +78 -0
  95. package/dist/sdk-tools.contract.js.map +1 -1
  96. package/dist/sdk-tools.contract.registry.js +78 -0
  97. package/dist/sdk-tools.contract.registry.js.map +1 -1
  98. package/dist/sdk-tools.contract.values.js +78 -0
  99. package/dist/sdk-tools.contract.values.js.map +1 -1
  100. package/dist/tool-contracts.context-orientation.d.ts +5 -0
  101. package/dist/tool-contracts.context-orientation.js +56 -0
  102. package/dist/tool-contracts.context-orientation.js.map +1 -0
  103. package/dist/tool-contracts.d.ts +1 -0
  104. package/dist/tool-contracts.js +79 -1
  105. package/dist/tool-contracts.js.map +1 -1
  106. package/dist/tool-contracts.questions-listing.js +24 -0
  107. package/dist/tool-contracts.questions-listing.js.map +1 -1
  108. package/dist/{tool-contracts.values-DjctSW7S.d.ts → tool-contracts.values-BhxfrXS5.d.ts} +3 -1
  109. package/dist/tool-contracts.values.d.ts +1 -0
  110. package/dist/tool-contracts.values.js +79 -1
  111. package/dist/tool-contracts.values.js.map +1 -1
  112. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -795,6 +795,7 @@ __export(tool_contracts_values_exports, {
795
795
  LIST_TASKS: () => LIST_TASKS,
796
796
  LIST_TOPICS: () => LIST_TOPICS,
797
797
  LIST_WORKTREES: () => LIST_WORKTREES,
798
+ LUCERN_ORIENT: () => LUCERN_ORIENT,
798
799
  MANAGE_WRITE_POLICY: () => MANAGE_WRITE_POLICY,
799
800
  MATCH_ENTITY_TYPE: () => MATCH_ENTITY_TYPE,
800
801
  MATERIALIZE_TOPIC_GRAPH: () => MATERIALIZE_TOPIC_GRAPH,
@@ -2410,6 +2411,59 @@ var REMOVE_LENS_FROM_TOPIC = {
2410
2411
  tier: "workhorse"
2411
2412
  };
2412
2413
 
2414
+ // src/tool-contracts.context-orientation.ts
2415
+ var LUCERN_ORIENT = {
2416
+ name: "lucern_orient",
2417
+ description: "Load the Lucern reasoning grammar before operating. Like `git help` plus a repository CONTRIBUTING guide for reasoning state - teaches the git-shaped model of topics, campaigns, lanes, worktrees, beliefs, questions, evidence, receipts, gates, and merges.",
2418
+ parameters: {
2419
+ audience: {
2420
+ type: "string",
2421
+ description: "Audience for the primer: agent, human, operator, or developer.",
2422
+ enum: ["agent", "human", "operator", "developer"]
2423
+ },
2424
+ depth: {
2425
+ type: "string",
2426
+ description: "Orientation depth: quick, standard, or deep.",
2427
+ enum: ["quick", "standard", "deep"]
2428
+ },
2429
+ situation: {
2430
+ type: "string",
2431
+ description: "Optional task or query context used to tailor suggested next calls."
2432
+ },
2433
+ includeExamples: {
2434
+ type: "boolean",
2435
+ description: "Whether to include concrete tool-call examples."
2436
+ },
2437
+ includeToolMap: {
2438
+ type: "boolean",
2439
+ description: "Whether to include situation-to-tool routing guidance."
2440
+ },
2441
+ includeFuture: {
2442
+ type: "boolean",
2443
+ description: "Whether to include future exemplar, gauntlet, and training-data capabilities."
2444
+ }
2445
+ },
2446
+ required: [],
2447
+ response: {
2448
+ description: "Canonical operator primer for Lucern's git-shaped reasoning substrate.",
2449
+ fields: {
2450
+ schemaVersion: "string - lucern_orientation.v1",
2451
+ canonicalMentalModel: "object - concise model of Lucern as git-shaped reasoning state",
2452
+ workflow: "array - recommended branch -> investigate -> prove gate -> merge workflow",
2453
+ grammarMap: "array - primitive-to-git-analogy map for topics, campaigns, worktrees, beliefs, questions, evidence, edges, contradictions, and gates",
2454
+ firstMoves: "array - recommended first tools for a cold-start agent",
2455
+ receiptRules: "array - how to interpret candidateCounts, broadening, coverageWarning, and noDefaultGlobalScan",
2456
+ safetyRules: "array - mutation and completion rules that preserve reasoning lineage",
2457
+ toolMap: "array | undefined - situation-to-tool routing map when requested",
2458
+ examples: "array | undefined - concrete tool-call examples when requested",
2459
+ suggestedNextCalls: "array - safe next tool calls for the current situation"
2460
+ }
2461
+ },
2462
+ ownerModule: "reasoning-kernel",
2463
+ ontologyPrimitive: "graph",
2464
+ tier: "showcase"
2465
+ };
2466
+
2413
2467
  // src/tool-contracts.ontology.ts
2414
2468
  var MANAGE_WRITE_POLICY = {
2415
2469
  name: "manage_write_policy",
@@ -4919,10 +4973,34 @@ var COMPILE_CONTEXT = {
4919
4973
  type: "string",
4920
4974
  description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
4921
4975
  },
4976
+ campaign: {
4977
+ type: "number",
4978
+ description: "Optional campaign dimension seed. When supplied without topicId, the compiler fans out across all carrier topics for that campaign instead of resolving a single topic."
4979
+ },
4980
+ lane: {
4981
+ type: "string",
4982
+ description: "Optional lane dimension seed. When supplied without topicId, the compiler reads all matching worktrees and their carrier topics."
4983
+ },
4984
+ status: {
4985
+ type: "string",
4986
+ description: "Optional state/status dimension seed for worktrees and graph rows."
4987
+ },
4988
+ principalId: {
4989
+ type: "string",
4990
+ description: "Optional principal seed for work authored, touched, or owned by a human, agent, group, or service principal."
4991
+ },
4992
+ workspaceId: {
4993
+ type: "string",
4994
+ description: "Optional workspace seed used by hosted MCP and SDK clients when compiling tenant-scoped context."
4995
+ },
4922
4996
  budget: {
4923
4997
  type: "number",
4924
4998
  description: "Token budget for prompt injection planning"
4925
4999
  },
5000
+ tokenBudget: {
5001
+ type: "number",
5002
+ description: "Compatibility alias for budget. External MCP clients may send tokenBudget when requesting prompt injection planning."
5003
+ },
4926
5004
  ranking: {
4927
5005
  type: "string",
4928
5006
  description: "Ranking profile for context ordering",
@@ -5613,6 +5691,7 @@ var MCP_TOOL_CONTRACTS = {
5613
5691
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
5614
5692
  identity_whoami: IDENTITY_WHOAMI,
5615
5693
  resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
5694
+ lucern_orient: LUCERN_ORIENT,
5616
5695
  compile_context: COMPILE_CONTEXT,
5617
5696
  record_scope_learning: RECORD_SCOPE_LEARNING,
5618
5697
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -14271,6 +14350,55 @@ var INFISICAL_RUNTIME_PATHS = [
14271
14350
  }
14272
14351
  ]
14273
14352
  },
14353
+ {
14354
+ id: "platform-permit",
14355
+ secretPath: "/platform/permit",
14356
+ description: "Permit runtime configuration for policy enforcement and embedded Permit Elements.",
14357
+ variables: [
14358
+ {
14359
+ name: "LUCERN_PERMIT_ELEMENTS_ENV_ID",
14360
+ required: false,
14361
+ secret: false,
14362
+ public: false,
14363
+ description: "Permit environment id used by Lucern web to authenticate embedded Permit Elements."
14364
+ },
14365
+ {
14366
+ name: "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
14367
+ required: false,
14368
+ secret: false,
14369
+ public: false,
14370
+ description: "Optional Clerk JWT template name for Permit Elements frontendOnly login."
14371
+ },
14372
+ {
14373
+ name: "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
14374
+ required: false,
14375
+ secret: false,
14376
+ public: false,
14377
+ description: "Permit Elements dashboard iframe URL for user and group management."
14378
+ },
14379
+ {
14380
+ name: "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
14381
+ required: false,
14382
+ secret: false,
14383
+ public: false,
14384
+ description: "Permit Elements dashboard iframe URL for audit logs."
14385
+ },
14386
+ {
14387
+ name: "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
14388
+ required: false,
14389
+ secret: false,
14390
+ public: false,
14391
+ description: "Permit Elements dashboard iframe URL for access requests."
14392
+ },
14393
+ {
14394
+ name: "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
14395
+ required: false,
14396
+ secret: false,
14397
+ public: false,
14398
+ description: "Permit Elements dashboard iframe URL for approval management."
14399
+ }
14400
+ ]
14401
+ },
14274
14402
  {
14275
14403
  id: "platform-operator-credentials",
14276
14404
  secretPath: "/platform/runtime",
@@ -14305,7 +14433,7 @@ var INFISICAL_RUNTIME_SURFACES = [
14305
14433
  {
14306
14434
  id: "lucern-web",
14307
14435
  delivery: "vercel_sync",
14308
- sourcePathIds: ["platform-auth", "platform-runtime"],
14436
+ sourcePathIds: ["platform-auth", "platform-runtime", "platform-permit"],
14309
14437
  consumer: "apps/web on Vercel project lucern",
14310
14438
  description: "Lucern web consumes Clerk and runtime config via Infisical-to-Vercel syncs."
14311
14439
  },
@@ -15035,6 +15163,126 @@ var PLATFORM_SECRET_DEFINITIONS = [
15035
15163
  ],
15036
15164
  description: "Optional Permit API URL override."
15037
15165
  },
15166
+ {
15167
+ id: "platform.permit.elements-env-id",
15168
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_ENV_ID",
15169
+ owner: "lucern_platform",
15170
+ scope: "environment",
15171
+ sourcePath: "/platform/permit",
15172
+ environmentPolicy: "environment_specific",
15173
+ required: false,
15174
+ secret: false,
15175
+ public: false,
15176
+ consumers: ["lucern-web"],
15177
+ destinations: [
15178
+ {
15179
+ kind: "vercel",
15180
+ target: "lucern",
15181
+ environmentPolicy: "environment_specific"
15182
+ }
15183
+ ],
15184
+ description: "Permit environment id used by Lucern web to authenticate embedded Permit Elements."
15185
+ },
15186
+ {
15187
+ id: "platform.permit.elements-jwt-template",
15188
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
15189
+ owner: "lucern_platform",
15190
+ scope: "environment",
15191
+ sourcePath: "/platform/permit",
15192
+ environmentPolicy: "environment_specific",
15193
+ required: false,
15194
+ secret: false,
15195
+ public: false,
15196
+ consumers: ["lucern-web"],
15197
+ destinations: [
15198
+ {
15199
+ kind: "vercel",
15200
+ target: "lucern",
15201
+ environmentPolicy: "environment_specific"
15202
+ }
15203
+ ],
15204
+ description: "Optional Clerk JWT template name used for Permit Elements frontendOnly login. Defaults to permit-elements."
15205
+ },
15206
+ {
15207
+ id: "platform.permit.elements-user-management-url",
15208
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
15209
+ owner: "lucern_platform",
15210
+ scope: "environment",
15211
+ sourcePath: "/platform/permit",
15212
+ environmentPolicy: "environment_specific",
15213
+ required: false,
15214
+ secret: false,
15215
+ public: false,
15216
+ consumers: ["lucern-web"],
15217
+ destinations: [
15218
+ {
15219
+ kind: "vercel",
15220
+ target: "lucern",
15221
+ environmentPolicy: "environment_specific"
15222
+ }
15223
+ ],
15224
+ description: "Permit Elements dashboard iframe URL for the User Management element."
15225
+ },
15226
+ {
15227
+ id: "platform.permit.elements-audit-logs-url",
15228
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
15229
+ owner: "lucern_platform",
15230
+ scope: "environment",
15231
+ sourcePath: "/platform/permit",
15232
+ environmentPolicy: "environment_specific",
15233
+ required: false,
15234
+ secret: false,
15235
+ public: false,
15236
+ consumers: ["lucern-web"],
15237
+ destinations: [
15238
+ {
15239
+ kind: "vercel",
15240
+ target: "lucern",
15241
+ environmentPolicy: "environment_specific"
15242
+ }
15243
+ ],
15244
+ description: "Permit Elements dashboard iframe URL for the Audit Logs element."
15245
+ },
15246
+ {
15247
+ id: "platform.permit.elements-access-request-url",
15248
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
15249
+ owner: "lucern_platform",
15250
+ scope: "environment",
15251
+ sourcePath: "/platform/permit",
15252
+ environmentPolicy: "environment_specific",
15253
+ required: false,
15254
+ secret: false,
15255
+ public: false,
15256
+ consumers: ["lucern-web"],
15257
+ destinations: [
15258
+ {
15259
+ kind: "vercel",
15260
+ target: "lucern",
15261
+ environmentPolicy: "environment_specific"
15262
+ }
15263
+ ],
15264
+ description: "Permit Elements dashboard iframe URL for the Access Request element."
15265
+ },
15266
+ {
15267
+ id: "platform.permit.elements-approvals-url",
15268
+ canonicalName: "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
15269
+ owner: "lucern_platform",
15270
+ scope: "environment",
15271
+ sourcePath: "/platform/permit",
15272
+ environmentPolicy: "environment_specific",
15273
+ required: false,
15274
+ secret: false,
15275
+ public: false,
15276
+ consumers: ["lucern-web"],
15277
+ destinations: [
15278
+ {
15279
+ kind: "vercel",
15280
+ target: "lucern",
15281
+ environmentPolicy: "environment_specific"
15282
+ }
15283
+ ],
15284
+ description: "Permit Elements dashboard iframe URL for the Approval Management element."
15285
+ },
15038
15286
  {
15039
15287
  id: "platform.ci.infisical-bootstrap-client-id",
15040
15288
  canonicalName: "INFISICAL_BOOTSTRAP_CLIENT_ID",
@@ -17782,6 +18030,12 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
17782
18030
  "LUCERN_PACK_KEY",
17783
18031
  "LUCERN_PERMIT_API_KEY",
17784
18032
  "LUCERN_PERMIT_API_URL",
18033
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
18034
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
18035
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
18036
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID",
18037
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
18038
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
17785
18039
  "LUCERN_PERMIT_PDP_URL",
17786
18040
  "LUCERN_PERMIT_WEBHOOK_SECRET",
17787
18041
  "LUCERN_PROD_DEPLOY_KEY",
@@ -18063,6 +18317,12 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
18063
18317
  "LUCERN_PACK_KEY",
18064
18318
  "LUCERN_PERMIT_API_KEY",
18065
18319
  "LUCERN_PERMIT_API_URL",
18320
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
18321
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
18322
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
18323
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID",
18324
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
18325
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
18066
18326
  "LUCERN_PERMIT_PDP_URL",
18067
18327
  "LUCERN_PERMIT_WEBHOOK_SECRET",
18068
18328
  "LUCERN_PROD_DEPLOY_KEY",
@@ -21242,6 +21502,180 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
21242
21502
  ],
21243
21503
  "description": "Optional Permit API URL override."
21244
21504
  },
21505
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL": {
21506
+ "secretId": "platform.permit.elements-access-request-url",
21507
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
21508
+ "envNames": [
21509
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
21510
+ ],
21511
+ "aliases": [],
21512
+ "writeNames": [
21513
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
21514
+ ],
21515
+ "required": false,
21516
+ "secret": false,
21517
+ "public": false,
21518
+ "sourcePath": "/platform/permit",
21519
+ "environmentPolicy": "environment_specific",
21520
+ "consumers": [
21521
+ "lucern-web"
21522
+ ],
21523
+ "destinations": [
21524
+ {
21525
+ "kind": "vercel",
21526
+ "target": "lucern",
21527
+ "writeNames": [
21528
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
21529
+ ]
21530
+ }
21531
+ ],
21532
+ "description": "Permit Elements dashboard iframe URL for the Access Request element. Permit Elements dashboard iframe URL for access requests."
21533
+ },
21534
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL": {
21535
+ "secretId": "platform.permit.elements-approvals-url",
21536
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
21537
+ "envNames": [
21538
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
21539
+ ],
21540
+ "aliases": [],
21541
+ "writeNames": [
21542
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
21543
+ ],
21544
+ "required": false,
21545
+ "secret": false,
21546
+ "public": false,
21547
+ "sourcePath": "/platform/permit",
21548
+ "environmentPolicy": "environment_specific",
21549
+ "consumers": [
21550
+ "lucern-web"
21551
+ ],
21552
+ "destinations": [
21553
+ {
21554
+ "kind": "vercel",
21555
+ "target": "lucern",
21556
+ "writeNames": [
21557
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
21558
+ ]
21559
+ }
21560
+ ],
21561
+ "description": "Permit Elements dashboard iframe URL for the Approval Management element. Permit Elements dashboard iframe URL for approval management."
21562
+ },
21563
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL": {
21564
+ "secretId": "platform.permit.elements-audit-logs-url",
21565
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
21566
+ "envNames": [
21567
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
21568
+ ],
21569
+ "aliases": [],
21570
+ "writeNames": [
21571
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
21572
+ ],
21573
+ "required": false,
21574
+ "secret": false,
21575
+ "public": false,
21576
+ "sourcePath": "/platform/permit",
21577
+ "environmentPolicy": "environment_specific",
21578
+ "consumers": [
21579
+ "lucern-web"
21580
+ ],
21581
+ "destinations": [
21582
+ {
21583
+ "kind": "vercel",
21584
+ "target": "lucern",
21585
+ "writeNames": [
21586
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
21587
+ ]
21588
+ }
21589
+ ],
21590
+ "description": "Permit Elements dashboard iframe URL for the Audit Logs element. Permit Elements dashboard iframe URL for audit logs."
21591
+ },
21592
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID": {
21593
+ "secretId": "platform.permit.elements-env-id",
21594
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ENV_ID",
21595
+ "envNames": [
21596
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
21597
+ ],
21598
+ "aliases": [],
21599
+ "writeNames": [
21600
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
21601
+ ],
21602
+ "required": false,
21603
+ "secret": false,
21604
+ "public": false,
21605
+ "sourcePath": "/platform/permit",
21606
+ "environmentPolicy": "environment_specific",
21607
+ "consumers": [
21608
+ "lucern-web"
21609
+ ],
21610
+ "destinations": [
21611
+ {
21612
+ "kind": "vercel",
21613
+ "target": "lucern",
21614
+ "writeNames": [
21615
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
21616
+ ]
21617
+ }
21618
+ ],
21619
+ "description": "Permit environment id used by Lucern web to authenticate embedded Permit Elements."
21620
+ },
21621
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE": {
21622
+ "secretId": "platform.permit.elements-jwt-template",
21623
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
21624
+ "envNames": [
21625
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
21626
+ ],
21627
+ "aliases": [],
21628
+ "writeNames": [
21629
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
21630
+ ],
21631
+ "required": false,
21632
+ "secret": false,
21633
+ "public": false,
21634
+ "sourcePath": "/platform/permit",
21635
+ "environmentPolicy": "environment_specific",
21636
+ "consumers": [
21637
+ "lucern-web"
21638
+ ],
21639
+ "destinations": [
21640
+ {
21641
+ "kind": "vercel",
21642
+ "target": "lucern",
21643
+ "writeNames": [
21644
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
21645
+ ]
21646
+ }
21647
+ ],
21648
+ "description": "Optional Clerk JWT template name used for Permit Elements frontendOnly login. Defaults to permit-elements. Optional Clerk JWT template name for Permit Elements frontendOnly login."
21649
+ },
21650
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL": {
21651
+ "secretId": "platform.permit.elements-user-management-url",
21652
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
21653
+ "envNames": [
21654
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
21655
+ ],
21656
+ "aliases": [],
21657
+ "writeNames": [
21658
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
21659
+ ],
21660
+ "required": false,
21661
+ "secret": false,
21662
+ "public": false,
21663
+ "sourcePath": "/platform/permit",
21664
+ "environmentPolicy": "environment_specific",
21665
+ "consumers": [
21666
+ "lucern-web"
21667
+ ],
21668
+ "destinations": [
21669
+ {
21670
+ "kind": "vercel",
21671
+ "target": "lucern",
21672
+ "writeNames": [
21673
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
21674
+ ]
21675
+ }
21676
+ ],
21677
+ "description": "Permit Elements dashboard iframe URL for the User Management element. Permit Elements dashboard iframe URL for user and group management."
21678
+ },
21245
21679
  "LUCERN_PERMIT_PDP_URL": {
21246
21680
  "secretId": "platform.permit.pdp-url",
21247
21681
  "canonicalName": "LUCERN_PERMIT_PDP_URL",
@@ -24238,6 +24672,12 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
24238
24672
  "PERMIT_API_KEY": "LUCERN_PERMIT_API_KEY",
24239
24673
  "LUCERN_PERMIT_API_URL": "LUCERN_PERMIT_API_URL",
24240
24674
  "PERMIT_API_URL": "LUCERN_PERMIT_API_URL",
24675
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL": "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
24676
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL": "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
24677
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL": "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
24678
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID": "LUCERN_PERMIT_ELEMENTS_ENV_ID",
24679
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE": "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
24680
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL": "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
24241
24681
  "LUCERN_PERMIT_PDP_URL": "LUCERN_PERMIT_PDP_URL",
24242
24682
  "PERMIT_PDP_URL": "LUCERN_PERMIT_PDP_URL",
24243
24683
  "LUCERN_PERMIT_WEBHOOK_SECRET": "LUCERN_PERMIT_WEBHOOK_SECRET",
@@ -24356,7 +24796,8 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
24356
24796
  "description": "Lucern web consumes Clerk and runtime config via Infisical-to-Vercel syncs.",
24357
24797
  "sourcePathIds": [
24358
24798
  "platform-auth",
24359
- "platform-runtime"
24799
+ "platform-runtime",
24800
+ "platform-permit"
24360
24801
  ],
24361
24802
  "variables": [
24362
24803
  {
@@ -24564,6 +25005,174 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
24564
25005
  "destinations": [],
24565
25006
  "description": "Browser login origin used when it differs from the API."
24566
25007
  },
25008
+ {
25009
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
25010
+ "envNames": [
25011
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
25012
+ ],
25013
+ "aliases": [],
25014
+ "writeNames": [
25015
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
25016
+ ],
25017
+ "required": false,
25018
+ "secret": false,
25019
+ "public": false,
25020
+ "sourcePath": "/platform/permit",
25021
+ "environmentPolicy": "environment_specific",
25022
+ "consumers": [
25023
+ "lucern-web"
25024
+ ],
25025
+ "destinations": [
25026
+ {
25027
+ "kind": "vercel",
25028
+ "target": "lucern",
25029
+ "writeNames": [
25030
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
25031
+ ]
25032
+ }
25033
+ ],
25034
+ "description": "Permit Elements dashboard iframe URL for access requests. Permit Elements dashboard iframe URL for the Access Request element."
25035
+ },
25036
+ {
25037
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
25038
+ "envNames": [
25039
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
25040
+ ],
25041
+ "aliases": [],
25042
+ "writeNames": [
25043
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
25044
+ ],
25045
+ "required": false,
25046
+ "secret": false,
25047
+ "public": false,
25048
+ "sourcePath": "/platform/permit",
25049
+ "environmentPolicy": "environment_specific",
25050
+ "consumers": [
25051
+ "lucern-web"
25052
+ ],
25053
+ "destinations": [
25054
+ {
25055
+ "kind": "vercel",
25056
+ "target": "lucern",
25057
+ "writeNames": [
25058
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
25059
+ ]
25060
+ }
25061
+ ],
25062
+ "description": "Permit Elements dashboard iframe URL for approval management. Permit Elements dashboard iframe URL for the Approval Management element."
25063
+ },
25064
+ {
25065
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
25066
+ "envNames": [
25067
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
25068
+ ],
25069
+ "aliases": [],
25070
+ "writeNames": [
25071
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
25072
+ ],
25073
+ "required": false,
25074
+ "secret": false,
25075
+ "public": false,
25076
+ "sourcePath": "/platform/permit",
25077
+ "environmentPolicy": "environment_specific",
25078
+ "consumers": [
25079
+ "lucern-web"
25080
+ ],
25081
+ "destinations": [
25082
+ {
25083
+ "kind": "vercel",
25084
+ "target": "lucern",
25085
+ "writeNames": [
25086
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
25087
+ ]
25088
+ }
25089
+ ],
25090
+ "description": "Permit Elements dashboard iframe URL for audit logs. Permit Elements dashboard iframe URL for the Audit Logs element."
25091
+ },
25092
+ {
25093
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ENV_ID",
25094
+ "envNames": [
25095
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
25096
+ ],
25097
+ "aliases": [],
25098
+ "writeNames": [
25099
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
25100
+ ],
25101
+ "required": false,
25102
+ "secret": false,
25103
+ "public": false,
25104
+ "sourcePath": "/platform/permit",
25105
+ "environmentPolicy": "environment_specific",
25106
+ "consumers": [
25107
+ "lucern-web"
25108
+ ],
25109
+ "destinations": [
25110
+ {
25111
+ "kind": "vercel",
25112
+ "target": "lucern",
25113
+ "writeNames": [
25114
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
25115
+ ]
25116
+ }
25117
+ ],
25118
+ "description": "Permit environment id used by Lucern web to authenticate embedded Permit Elements."
25119
+ },
25120
+ {
25121
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
25122
+ "envNames": [
25123
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
25124
+ ],
25125
+ "aliases": [],
25126
+ "writeNames": [
25127
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
25128
+ ],
25129
+ "required": false,
25130
+ "secret": false,
25131
+ "public": false,
25132
+ "sourcePath": "/platform/permit",
25133
+ "environmentPolicy": "environment_specific",
25134
+ "consumers": [
25135
+ "lucern-web"
25136
+ ],
25137
+ "destinations": [
25138
+ {
25139
+ "kind": "vercel",
25140
+ "target": "lucern",
25141
+ "writeNames": [
25142
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
25143
+ ]
25144
+ }
25145
+ ],
25146
+ "description": "Optional Clerk JWT template name for Permit Elements frontendOnly login. Optional Clerk JWT template name used for Permit Elements frontendOnly login. Defaults to permit-elements."
25147
+ },
25148
+ {
25149
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
25150
+ "envNames": [
25151
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
25152
+ ],
25153
+ "aliases": [],
25154
+ "writeNames": [
25155
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
25156
+ ],
25157
+ "required": false,
25158
+ "secret": false,
25159
+ "public": false,
25160
+ "sourcePath": "/platform/permit",
25161
+ "environmentPolicy": "environment_specific",
25162
+ "consumers": [
25163
+ "lucern-web"
25164
+ ],
25165
+ "destinations": [
25166
+ {
25167
+ "kind": "vercel",
25168
+ "target": "lucern",
25169
+ "writeNames": [
25170
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
25171
+ ]
25172
+ }
25173
+ ],
25174
+ "description": "Permit Elements dashboard iframe URL for user and group management. Permit Elements dashboard iframe URL for the User Management element."
25175
+ },
24567
25176
  {
24568
25177
  "canonicalName": "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY",
24569
25178
  "envNames": [
@@ -42808,6 +43417,180 @@ var GENERATED_INFISICAL_RUNTIME_ENV = {
42808
43417
  ],
42809
43418
  "description": "Lucern runtime environment label."
42810
43419
  },
43420
+ {
43421
+ "secretId": "platform.permit.elements-access-request-url",
43422
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL",
43423
+ "envNames": [
43424
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
43425
+ ],
43426
+ "aliases": [],
43427
+ "writeNames": [
43428
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
43429
+ ],
43430
+ "required": false,
43431
+ "secret": false,
43432
+ "public": false,
43433
+ "sourcePath": "/platform/permit",
43434
+ "environmentPolicy": "environment_specific",
43435
+ "consumers": [
43436
+ "lucern-web"
43437
+ ],
43438
+ "destinations": [
43439
+ {
43440
+ "kind": "vercel",
43441
+ "target": "lucern",
43442
+ "writeNames": [
43443
+ "LUCERN_PERMIT_ELEMENTS_ACCESS_REQUEST_URL"
43444
+ ]
43445
+ }
43446
+ ],
43447
+ "description": "Permit Elements dashboard iframe URL for the Access Request element."
43448
+ },
43449
+ {
43450
+ "secretId": "platform.permit.elements-approvals-url",
43451
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL",
43452
+ "envNames": [
43453
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
43454
+ ],
43455
+ "aliases": [],
43456
+ "writeNames": [
43457
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
43458
+ ],
43459
+ "required": false,
43460
+ "secret": false,
43461
+ "public": false,
43462
+ "sourcePath": "/platform/permit",
43463
+ "environmentPolicy": "environment_specific",
43464
+ "consumers": [
43465
+ "lucern-web"
43466
+ ],
43467
+ "destinations": [
43468
+ {
43469
+ "kind": "vercel",
43470
+ "target": "lucern",
43471
+ "writeNames": [
43472
+ "LUCERN_PERMIT_ELEMENTS_APPROVALS_URL"
43473
+ ]
43474
+ }
43475
+ ],
43476
+ "description": "Permit Elements dashboard iframe URL for the Approval Management element."
43477
+ },
43478
+ {
43479
+ "secretId": "platform.permit.elements-audit-logs-url",
43480
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL",
43481
+ "envNames": [
43482
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
43483
+ ],
43484
+ "aliases": [],
43485
+ "writeNames": [
43486
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
43487
+ ],
43488
+ "required": false,
43489
+ "secret": false,
43490
+ "public": false,
43491
+ "sourcePath": "/platform/permit",
43492
+ "environmentPolicy": "environment_specific",
43493
+ "consumers": [
43494
+ "lucern-web"
43495
+ ],
43496
+ "destinations": [
43497
+ {
43498
+ "kind": "vercel",
43499
+ "target": "lucern",
43500
+ "writeNames": [
43501
+ "LUCERN_PERMIT_ELEMENTS_AUDIT_LOGS_URL"
43502
+ ]
43503
+ }
43504
+ ],
43505
+ "description": "Permit Elements dashboard iframe URL for the Audit Logs element."
43506
+ },
43507
+ {
43508
+ "secretId": "platform.permit.elements-env-id",
43509
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_ENV_ID",
43510
+ "envNames": [
43511
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
43512
+ ],
43513
+ "aliases": [],
43514
+ "writeNames": [
43515
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
43516
+ ],
43517
+ "required": false,
43518
+ "secret": false,
43519
+ "public": false,
43520
+ "sourcePath": "/platform/permit",
43521
+ "environmentPolicy": "environment_specific",
43522
+ "consumers": [
43523
+ "lucern-web"
43524
+ ],
43525
+ "destinations": [
43526
+ {
43527
+ "kind": "vercel",
43528
+ "target": "lucern",
43529
+ "writeNames": [
43530
+ "LUCERN_PERMIT_ELEMENTS_ENV_ID"
43531
+ ]
43532
+ }
43533
+ ],
43534
+ "description": "Permit environment id used by Lucern web to authenticate embedded Permit Elements."
43535
+ },
43536
+ {
43537
+ "secretId": "platform.permit.elements-jwt-template",
43538
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE",
43539
+ "envNames": [
43540
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
43541
+ ],
43542
+ "aliases": [],
43543
+ "writeNames": [
43544
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
43545
+ ],
43546
+ "required": false,
43547
+ "secret": false,
43548
+ "public": false,
43549
+ "sourcePath": "/platform/permit",
43550
+ "environmentPolicy": "environment_specific",
43551
+ "consumers": [
43552
+ "lucern-web"
43553
+ ],
43554
+ "destinations": [
43555
+ {
43556
+ "kind": "vercel",
43557
+ "target": "lucern",
43558
+ "writeNames": [
43559
+ "LUCERN_PERMIT_ELEMENTS_JWT_TEMPLATE"
43560
+ ]
43561
+ }
43562
+ ],
43563
+ "description": "Optional Clerk JWT template name used for Permit Elements frontendOnly login. Defaults to permit-elements."
43564
+ },
43565
+ {
43566
+ "secretId": "platform.permit.elements-user-management-url",
43567
+ "canonicalName": "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL",
43568
+ "envNames": [
43569
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
43570
+ ],
43571
+ "aliases": [],
43572
+ "writeNames": [
43573
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
43574
+ ],
43575
+ "required": false,
43576
+ "secret": false,
43577
+ "public": false,
43578
+ "sourcePath": "/platform/permit",
43579
+ "environmentPolicy": "environment_specific",
43580
+ "consumers": [
43581
+ "lucern-web"
43582
+ ],
43583
+ "destinations": [
43584
+ {
43585
+ "kind": "vercel",
43586
+ "target": "lucern",
43587
+ "writeNames": [
43588
+ "LUCERN_PERMIT_ELEMENTS_USER_MANAGEMENT_URL"
43589
+ ]
43590
+ }
43591
+ ],
43592
+ "description": "Permit Elements dashboard iframe URL for the User Management element."
43593
+ },
42811
43594
  {
42812
43595
  "secretId": "platform.clerk.publishable",
42813
43596
  "canonicalName": "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY",
@@ -47750,15 +48533,57 @@ function isRecord(value) {
47750
48533
  function recordValue(value) {
47751
48534
  return isRecord(value) ? value : {};
47752
48535
  }
48536
+ function normalizeTopicIdForKernel(topicId) {
48537
+ const normalized = topicId?.trim();
48538
+ if (!normalized) {
48539
+ return void 0;
48540
+ }
48541
+ try {
48542
+ const decoded = decodePrefixedId(normalized);
48543
+ return decoded.prefix === "top" ? decoded.value : normalized;
48544
+ } catch {
48545
+ return normalized;
48546
+ }
48547
+ }
48548
+ function normalizeWorktreeId(value) {
48549
+ const normalized = value?.trim();
48550
+ if (!normalized) {
48551
+ return void 0;
48552
+ }
48553
+ if (normalized.startsWith("wt_")) {
48554
+ return normalized.slice("wt_".length);
48555
+ }
48556
+ return normalized;
48557
+ }
48558
+ function targetKind(targetId) {
48559
+ const normalized = targetId?.trim();
48560
+ if (!normalized) {
48561
+ return "unknown";
48562
+ }
48563
+ if (normalized.startsWith("wt_") || /^tn[a-z0-9]+$/i.test(normalized)) {
48564
+ return "worktree";
48565
+ }
48566
+ if (normalized.startsWith("que_")) {
48567
+ return "question";
48568
+ }
48569
+ if (normalized.startsWith("bel_")) {
48570
+ return "belief";
48571
+ }
48572
+ return "unknown";
48573
+ }
47753
48574
  var createEvidenceProjection = defineProjection({
47754
48575
  contractName: "create_evidence",
47755
48576
  inputSchema: createEvidenceInputSchema,
47756
48577
  project: (input) => {
47757
48578
  const text = input.text ?? input.canonicalText;
47758
48579
  const weight = typeof input.weight === "number" ? input.weight : void 0;
48580
+ const target = input.targetId ?? input.targetNodeId;
48581
+ const kind = targetKind(target);
48582
+ const linkedWorktreeId = kind === "worktree" ? normalizeWorktreeId(target) : void 0;
48583
+ const linkedBeliefNodeId = input.linkedBeliefNodeId ?? (kind === "belief" || kind === "unknown" ? input.targetNodeId ?? input.targetId : void 0);
47759
48584
  return compactRecord({
47760
48585
  projectId: input.projectId,
47761
- topicId: input.topicId,
48586
+ topicId: normalizeTopicIdForKernel(input.topicId),
47762
48587
  text,
47763
48588
  title: input.title ?? text,
47764
48589
  content: input.content ?? text,
@@ -47777,11 +48602,13 @@ var createEvidenceProjection = defineProjection({
47777
48602
  source: input.source,
47778
48603
  targetId: input.targetId,
47779
48604
  targetNodeId: input.targetNodeId,
48605
+ targetKind: kind === "unknown" ? void 0 : kind,
48606
+ linkedWorktreeId,
47780
48607
  weight,
47781
48608
  reasoning: input.reasoning,
47782
48609
  rationale: input.rationale
47783
48610
  }),
47784
- linkedBeliefNodeId: input.linkedBeliefNodeId ?? input.targetNodeId ?? input.targetId,
48611
+ linkedBeliefNodeId,
47785
48612
  evidenceRelation: input.evidenceRelation ?? (weight === void 0 ? void 0 : weight < 0 ? "contradicts" : "supports"),
47786
48613
  confidence: input.confidence ?? (weight === void 0 ? void 0 : Math.min(1, Math.max(0, Math.abs(weight)))),
47787
48614
  rationale: input.rationale,