@lucern/contracts 0.3.0-alpha.8 → 1.0.0

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 (261) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api-enums.contract.d.ts +5 -3
  3. package/dist/api-enums.contract.js +14 -12
  4. package/dist/api-enums.contract.js.map +1 -1
  5. package/dist/auth-context.contract.js +14 -2
  6. package/dist/auth-context.contract.js.map +1 -1
  7. package/dist/auth-session.contract.js +14 -2
  8. package/dist/auth-session.contract.js.map +1 -1
  9. package/dist/auth.contract.d.ts +1 -1
  10. package/dist/auth.contract.js +14 -2
  11. package/dist/auth.contract.js.map +1 -1
  12. package/dist/component-boundary.contract.d.ts +1 -1
  13. package/dist/component-boundary.contract.js +46 -26
  14. package/dist/component-boundary.contract.js.map +1 -1
  15. package/dist/component-host-boundary.contract.d.ts +10 -5
  16. package/dist/component-host-boundary.contract.js +10 -4
  17. package/dist/component-host-boundary.contract.js.map +1 -1
  18. package/dist/{defineTable-CBQ03FXl.d.ts → defineTable-t1wr5wgn.d.ts} +1 -1
  19. package/dist/{dsl-djCRfuWC.d.ts → dsl-DVPthQGY.d.ts} +1 -1
  20. package/dist/dsl.d.ts +2 -2
  21. package/dist/dsl.js.map +1 -1
  22. package/dist/edge-policy-manifest-Dw5IhT1L.d.ts +133 -0
  23. package/dist/function-registry/beliefs.d.ts +23 -10
  24. package/dist/function-registry/beliefs.js +467 -36
  25. package/dist/function-registry/beliefs.js.map +1 -1
  26. package/dist/function-registry/coding.d.ts +15 -6
  27. package/dist/function-registry/coding.js +531 -22
  28. package/dist/function-registry/coding.js.map +1 -1
  29. package/dist/function-registry/context.d.ts +9 -3
  30. package/dist/function-registry/context.js +464 -21
  31. package/dist/function-registry/context.js.map +1 -1
  32. package/dist/function-registry/contracts.d.ts +9 -3
  33. package/dist/function-registry/contracts.js +464 -21
  34. package/dist/function-registry/contracts.js.map +1 -1
  35. package/dist/function-registry/coordination.d.ts +21 -9
  36. package/dist/function-registry/coordination.js +464 -21
  37. package/dist/function-registry/coordination.js.map +1 -1
  38. package/dist/function-registry/edges.d.ts +167 -2
  39. package/dist/function-registry/edges.js +661 -52
  40. package/dist/function-registry/edges.js.map +1 -1
  41. package/dist/function-registry/evidence.d.ts +19 -8
  42. package/dist/function-registry/evidence.js +473 -40
  43. package/dist/function-registry/evidence.js.map +1 -1
  44. package/dist/function-registry/graph.d.ts +33 -15
  45. package/dist/function-registry/graph.js +464 -21
  46. package/dist/function-registry/graph.js.map +1 -1
  47. package/dist/function-registry/helpers.d.ts +6 -3
  48. package/dist/function-registry/helpers.js +465 -22
  49. package/dist/function-registry/helpers.js.map +1 -1
  50. package/dist/function-registry/identity.d.ts +62 -16
  51. package/dist/function-registry/identity.js +487 -27
  52. package/dist/function-registry/identity.js.map +1 -1
  53. package/dist/function-registry/index.d.ts +4 -2
  54. package/dist/function-registry/index.js +468 -22
  55. package/dist/function-registry/index.js.map +1 -1
  56. package/dist/function-registry/judgments.d.ts +7 -2
  57. package/dist/function-registry/judgments.js +464 -21
  58. package/dist/function-registry/judgments.js.map +1 -1
  59. package/dist/function-registry/legacy.d.ts +5 -1
  60. package/dist/function-registry/legacy.js +464 -21
  61. package/dist/function-registry/legacy.js.map +1 -1
  62. package/dist/function-registry/lenses.d.ts +11 -4
  63. package/dist/function-registry/lenses.js +464 -21
  64. package/dist/function-registry/lenses.js.map +1 -1
  65. package/dist/function-registry/manifest.d.ts +4 -4
  66. package/dist/function-registry/manifest.js +16 -1
  67. package/dist/function-registry/manifest.js.map +1 -1
  68. package/dist/function-registry/nodes.d.ts +412 -0
  69. package/dist/function-registry/nodes.js +5354 -0
  70. package/dist/function-registry/nodes.js.map +1 -0
  71. package/dist/function-registry/ontologies.d.ts +25 -11
  72. package/dist/function-registry/ontologies.js +464 -21
  73. package/dist/function-registry/ontologies.js.map +1 -1
  74. package/dist/function-registry/pipeline.d.ts +9 -3
  75. package/dist/function-registry/pipeline.js +464 -21
  76. package/dist/function-registry/pipeline.js.map +1 -1
  77. package/dist/function-registry/questions.d.ts +27 -12
  78. package/dist/function-registry/questions.js +466 -26
  79. package/dist/function-registry/questions.js.map +1 -1
  80. package/dist/function-registry/tasks.d.ts +11 -4
  81. package/dist/function-registry/tasks.js +497 -30
  82. package/dist/function-registry/tasks.js.map +1 -1
  83. package/dist/function-registry/topics.d.ts +93 -5
  84. package/dist/function-registry/topics.js +534 -24
  85. package/dist/function-registry/topics.js.map +1 -1
  86. package/dist/function-registry/types.d.ts +7 -3
  87. package/dist/function-registry/worktrees.d.ts +25 -11
  88. package/dist/function-registry/worktrees.js +480 -21
  89. package/dist/function-registry/worktrees.js.map +1 -1
  90. package/dist/gateway.contract.d.ts +4 -0
  91. package/dist/gateway.contract.js.map +1 -1
  92. package/dist/generated/convexSchemas.d.ts +3 -3
  93. package/dist/generated/convexSchemas.js +37 -17
  94. package/dist/generated/convexSchemas.js.map +1 -1
  95. package/dist/generated/infisicalRuntimeEnv.d.ts +70 -0
  96. package/dist/generated/infisicalRuntimeEnv.js +27585 -0
  97. package/dist/generated/infisicalRuntimeEnv.js.map +1 -0
  98. package/dist/generated/lucernGatewayEnv.d.ts +17 -0
  99. package/dist/generated/lucernGatewayEnv.js +38 -0
  100. package/dist/generated/lucernGatewayEnv.js.map +1 -0
  101. package/dist/generated/lucernWebPublicEnv.d.ts +26 -0
  102. package/dist/generated/lucernWebPublicEnv.js +32 -0
  103. package/dist/generated/lucernWebPublicEnv.js.map +1 -0
  104. package/dist/generated/lucernWebServerEnv.d.ts +33 -0
  105. package/dist/generated/lucernWebServerEnv.js +51 -0
  106. package/dist/generated/lucernWebServerEnv.js.map +1 -0
  107. package/dist/generated/schema-manifest.json +1221 -114
  108. package/dist/generated/tableOwnership.d.ts +48 -28
  109. package/dist/generated/tableOwnership.js +66 -26
  110. package/dist/generated/tableOwnership.js.map +1 -1
  111. package/dist/generated/tier-expectations.json +64 -9
  112. package/dist/{index-O09U2xHk.d.ts → index-CM1Pl_vI.d.ts} +3 -3
  113. package/dist/index.d.ts +12 -7
  114. package/dist/index.js +32892 -459
  115. package/dist/index.js.map +1 -1
  116. package/dist/infisical-runtime.contract.d.ts +1763 -6
  117. package/dist/infisical-runtime.contract.js +2994 -15
  118. package/dist/infisical-runtime.contract.js.map +1 -1
  119. package/dist/manifests/edge-policy-manifest.d.ts +1 -1
  120. package/dist/manifests/edge-policy-manifest.data.d.ts +6 -20
  121. package/dist/manifests/edge-policy-manifest.data.js +18 -26
  122. package/dist/manifests/edge-policy-manifest.data.js.map +1 -1
  123. package/dist/manifests/edge-policy-manifest.js +31 -4
  124. package/dist/manifests/edge-policy-manifest.js.map +1 -1
  125. package/dist/manifests/infisical-runtime-manifest.d.ts +1689 -6
  126. package/dist/manifests/infisical-runtime-manifest.js +2847 -12
  127. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  128. package/dist/manifests/tenant-client-manifest.d.ts +19 -14
  129. package/dist/manifests/tenant-client-manifest.js +29 -12
  130. package/dist/manifests/tenant-client-manifest.js.map +1 -1
  131. package/dist/mcp-gateway-boundary.contract.d.ts +23 -3
  132. package/dist/mcp-gateway-boundary.contract.js +2 -0
  133. package/dist/mcp-gateway-boundary.contract.js.map +1 -1
  134. package/dist/permit-principal-projection.contract.d.ts +74 -0
  135. package/dist/permit-principal-projection.contract.js +167 -0
  136. package/dist/permit-principal-projection.contract.js.map +1 -0
  137. package/dist/projections/check-convex-args-shape.js +10 -6
  138. package/dist/projections/check-convex-args-shape.js.map +1 -1
  139. package/dist/projections/create-evidence.projection.d.ts +6 -6
  140. package/dist/projections/create-evidence.projection.js +2 -3
  141. package/dist/projections/create-evidence.projection.js.map +1 -1
  142. package/dist/projections/index.d.ts +3 -3
  143. package/dist/projections/index.js +10 -6
  144. package/dist/projections/index.js.map +1 -1
  145. package/dist/projections/list-tasks.projection.d.ts +20 -8
  146. package/dist/projections/list-tasks.projection.js +8 -3
  147. package/dist/projections/list-tasks.projection.js.map +1 -1
  148. package/dist/proof-attestation.json +45 -0
  149. package/dist/schemas/component-table-manifest.d.ts +6 -6
  150. package/dist/schemas/component-table-manifest.js +2 -2
  151. package/dist/schemas/component-table-manifest.js.map +1 -1
  152. package/dist/schemas/index.d.ts +2 -2
  153. package/dist/schemas/index.js +1123 -137
  154. package/dist/schemas/index.js.map +1 -1
  155. package/dist/schemas/manifest.d.ts +2102 -132
  156. package/dist/schemas/manifest.js +1121 -135
  157. package/dist/schemas/manifest.js.map +1 -1
  158. package/dist/schemas/tables/controlPlane/accessControl.d.ts +260 -0
  159. package/dist/schemas/tables/controlPlane/accessControl.js +658 -0
  160. package/dist/schemas/tables/controlPlane/accessControl.js.map +1 -0
  161. package/dist/schemas/tables/{identity → controlPlane}/agent.d.ts +1 -1
  162. package/dist/schemas/tables/{identity → controlPlane}/agent.js +3 -3
  163. package/dist/schemas/tables/controlPlane/agent.js.map +1 -0
  164. package/dist/schemas/tables/{identity → controlPlane}/epistemic.d.ts +1 -1
  165. package/dist/schemas/tables/{identity → controlPlane}/epistemic.js +3 -3
  166. package/dist/schemas/tables/controlPlane/epistemic.js.map +1 -0
  167. package/dist/schemas/tables/{identity → controlPlane}/model.d.ts +1 -1
  168. package/dist/schemas/tables/{identity → controlPlane}/model.js +6 -6
  169. package/dist/schemas/tables/controlPlane/model.js.map +1 -0
  170. package/dist/schemas/tables/{identity → controlPlane}/platform.d.ts +1 -1
  171. package/dist/schemas/tables/{identity → controlPlane}/platform.js +18 -18
  172. package/dist/schemas/tables/controlPlane/platform.js.map +1 -0
  173. package/dist/schemas/tables/{identity → controlPlane}/project.d.ts +1 -1
  174. package/dist/schemas/tables/{identity → controlPlane}/project.js +3 -3
  175. package/dist/schemas/tables/controlPlane/project.js.map +1 -0
  176. package/dist/schemas/tables/{identity → controlPlane}/user.d.ts +1 -1
  177. package/dist/schemas/tables/{identity → controlPlane}/user.js +3 -3
  178. package/dist/schemas/tables/controlPlane/user.js.map +1 -0
  179. package/dist/schemas/tables/kernel/config.d.ts +1 -1
  180. package/dist/schemas/tables/kernel/config.js.map +1 -1
  181. package/dist/schemas/tables/kernel/coordination.d.ts +1 -1
  182. package/dist/schemas/tables/kernel/coordination.js.map +1 -1
  183. package/dist/schemas/tables/kernel/decision.d.ts +1 -1
  184. package/dist/schemas/tables/kernel/decision.js.map +1 -1
  185. package/dist/schemas/tables/kernel/embedding.d.ts +1 -1
  186. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  187. package/dist/schemas/tables/kernel/epistemic.d.ts +1 -1
  188. package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
  189. package/dist/schemas/tables/kernel/events.d.ts +21 -0
  190. package/dist/schemas/tables/kernel/events.js +43 -0
  191. package/dist/schemas/tables/kernel/events.js.map +1 -0
  192. package/dist/schemas/tables/kernel/idempotency.d.ts +1 -1
  193. package/dist/schemas/tables/kernel/idempotency.js.map +1 -1
  194. package/dist/schemas/tables/kernel/infra.d.ts +1 -1
  195. package/dist/schemas/tables/kernel/infra.js.map +1 -1
  196. package/dist/schemas/tables/kernel/intelligence.d.ts +1 -1
  197. package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
  198. package/dist/schemas/tables/kernel/lens.d.ts +1 -1
  199. package/dist/schemas/tables/kernel/lens.js.map +1 -1
  200. package/dist/schemas/tables/kernel/ontology.d.ts +1 -1
  201. package/dist/schemas/tables/kernel/ontology.js.map +1 -1
  202. package/dist/schemas/tables/kernel/platform.d.ts +1 -1
  203. package/dist/schemas/tables/kernel/platform.js.map +1 -1
  204. package/dist/schemas/tables/kernel/spine.d.ts +2 -1
  205. package/dist/schemas/tables/kernel/spine.js +1 -0
  206. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  207. package/dist/schemas/tables/kernel/task.d.ts +1 -1
  208. package/dist/schemas/tables/kernel/task.js.map +1 -1
  209. package/dist/schemas/tables/kernel/topic.d.ts +1 -1
  210. package/dist/schemas/tables/kernel/topic.js +1 -0
  211. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  212. package/dist/schemas/tables/kernel/workflow.d.ts +1 -1
  213. package/dist/schemas/tables/kernel/workflow.js.map +1 -1
  214. package/dist/schemas/tables/kernel/worktree.d.ts +17 -17
  215. package/dist/schemas/tables/kernel/worktree.js.map +1 -1
  216. package/dist/schemas/tables/mc/identity.d.ts +19 -2
  217. package/dist/schemas/tables/mc/identity.js +32 -1
  218. package/dist/schemas/tables/mc/identity.js.map +1 -1
  219. package/dist/schemas/tables/mc/methodology.d.ts +1 -1
  220. package/dist/schemas/tables/mc/methodology.js.map +1 -1
  221. package/dist/schemas/tables/mc/pack.d.ts +1 -1
  222. package/dist/schemas/tables/mc/pack.js.map +1 -1
  223. package/dist/schemas/tables/mc/policy.d.ts +2 -2
  224. package/dist/schemas/tables/mc/policy.js +1 -1
  225. package/dist/schemas/tables/mc/policy.js.map +1 -1
  226. package/dist/schemas/tables/mc/registry.d.ts +1 -1
  227. package/dist/schemas/tables/mc/registry.js.map +1 -1
  228. package/dist/schemas/tables/mc/runtime.d.ts +109 -3
  229. package/dist/schemas/tables/mc/runtime.js +330 -104
  230. package/dist/schemas/tables/mc/runtime.js.map +1 -1
  231. package/dist/schemas/tables/mc/tenant.d.ts +4 -2
  232. package/dist/schemas/tables/mc/tenant.js +3 -1
  233. package/dist/schemas/tables/mc/tenant.js.map +1 -1
  234. package/dist/schemas/tables/mc/workspace.d.ts +22 -5
  235. package/dist/schemas/tables/mc/workspace.js +34 -2
  236. package/dist/schemas/tables/mc/workspace.js.map +1 -1
  237. package/dist/{sdk-tools.contract-Ci8bkoai.d.ts → sdk-tools.contract-CKmSsrZ2.d.ts} +1 -1
  238. package/dist/sdk-tools.contract.d.ts +2 -2
  239. package/dist/sdk-tools.contract.js +417 -13
  240. package/dist/sdk-tools.contract.js.map +1 -1
  241. package/dist/tenant-bootstrap-seed.contract.d.ts +244 -56
  242. package/dist/tenant-bootstrap-seed.contract.js +139 -28
  243. package/dist/tenant-bootstrap-seed.contract.js.map +1 -1
  244. package/dist/tenant-bootstrap-seed.defaults.d.ts +2 -2
  245. package/dist/tenant-bootstrap-seed.defaults.js +31 -13
  246. package/dist/tenant-bootstrap-seed.defaults.js.map +1 -1
  247. package/dist/tenant-client.contract.d.ts +20 -15
  248. package/dist/tenant-client.contract.js +29 -12
  249. package/dist/tenant-client.contract.js.map +1 -1
  250. package/dist/{tool-contracts-B4iWhejG.d.ts → tool-contracts-C_xvM9q2.d.ts} +32 -2
  251. package/dist/tool-contracts.d.ts +1 -1
  252. package/dist/tool-contracts.js +418 -14
  253. package/dist/tool-contracts.js.map +1 -1
  254. package/package.json +22 -1
  255. package/dist/edge-policy-manifest-Byv6cQPP.d.ts +0 -132
  256. package/dist/schemas/tables/identity/agent.js.map +0 -1
  257. package/dist/schemas/tables/identity/epistemic.js.map +0 -1
  258. package/dist/schemas/tables/identity/model.js.map +0 -1
  259. package/dist/schemas/tables/identity/platform.js.map +0 -1
  260. package/dist/schemas/tables/identity/project.js.map +0 -1
  261. package/dist/schemas/tables/identity/user.js.map +0 -1
@@ -10,6 +10,8 @@ import { questionsContracts } from './questions.js';
10
10
  export { questionsContracts } from './questions.js';
11
11
  import { topicsContracts } from './topics.js';
12
12
  export { topicsContracts } from './topics.js';
13
+ import { nodesContracts } from './nodes.js';
14
+ export { nodesContracts } from './nodes.js';
13
15
  import { lensesContracts } from './lenses.js';
14
16
  export { lensesContracts } from './lenses.js';
15
17
  import { ontologiesContracts } from './ontologies.js';
@@ -38,6 +40,20 @@ import { z } from 'zod';
38
40
 
39
41
  // src/function-registry/index.ts
40
42
 
43
+ // src/types/reasoning-method.ts
44
+ var REASONING_METHODS = [
45
+ "deductive",
46
+ "inductive",
47
+ "abductive",
48
+ "analogical",
49
+ "causal",
50
+ "correlational",
51
+ "testimonial",
52
+ "statistical",
53
+ "implicit",
54
+ "pattern_match"
55
+ ];
56
+
41
57
  // src/lens-workflow.contract.ts
42
58
  var LENS_PERSPECTIVE_TYPES = [
43
59
  "investigation",
@@ -869,19 +885,23 @@ var FIND_CONTRADICTIONS = {
869
885
  };
870
886
  var CREATE_EDGE = {
871
887
  name: "create_edge",
872
- description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes. The engine enforces layer transition rules \u2014 for example, L1 \u2192 L3 direct edges are forbidden (must go through L2).",
888
+ description: "Commit a typed relationship between two nodes in the reasoning graph. Like `git commit` \u2014 an atomic write that declares a dependency between nodes. Accepts any public epistemic edge type between public graph node refs so agents can author the full spine.",
873
889
  parameters: {
874
- sourceId: {
875
- type: "string",
876
- description: "Source node of the relationship"
890
+ from: {
891
+ type: "object",
892
+ description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
877
893
  },
878
- targetId: {
879
- type: "string",
880
- description: "Target node of the relationship"
894
+ to: {
895
+ type: "object",
896
+ description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
881
897
  },
882
898
  edgeType: {
883
899
  type: "string",
884
- description: "Relationship type (informs, tests, depends_on, supersedes, etc.)"
900
+ description: "Relationship type from the public epistemic edge enum."
901
+ },
902
+ globalId: {
903
+ type: "string",
904
+ description: "Optional idempotent edge global ID."
885
905
  },
886
906
  weight: {
887
907
  type: "number",
@@ -891,10 +911,14 @@ var CREATE_EDGE = {
891
911
  reasoningMethod: {
892
912
  type: "string",
893
913
  description: "How this was determined",
894
- enum: ["deductive", "inductive", "abductive", "analogical", "empirical"]
914
+ enum: [...REASONING_METHODS]
915
+ },
916
+ metadata: {
917
+ type: "object",
918
+ description: "Optional edge metadata."
895
919
  }
896
920
  },
897
- required: ["sourceId", "targetId", "edgeType"],
921
+ required: ["from", "to", "edgeType"],
898
922
  response: {
899
923
  description: "The created edge",
900
924
  fields: {
@@ -908,6 +932,240 @@ var CREATE_EDGE = {
908
932
  ontologyPrimitive: "edge",
909
933
  tier: "showcase"
910
934
  };
935
+ var UPDATE_EDGE = {
936
+ name: "update_edge",
937
+ description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
938
+ parameters: {
939
+ edgeId: { type: "string", description: "Edge ID or global ID to update" },
940
+ weight: { type: "number", description: "Updated edge weight" },
941
+ confidence: { type: "number", description: "Updated confidence" },
942
+ context: { type: "string", description: "Updated human-readable context" },
943
+ derivationType: { type: "string", description: "Updated derivation type" },
944
+ metadata: { type: "object", description: "Updated metadata" }
945
+ },
946
+ required: ["edgeId"],
947
+ response: {
948
+ description: "Edge update result",
949
+ fields: { success: "boolean" }
950
+ },
951
+ ownerModule: "graph-primitives",
952
+ ontologyPrimitive: "edge",
953
+ tier: "workhorse"
954
+ };
955
+ var REMOVE_EDGE = {
956
+ name: "remove_edge",
957
+ description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
958
+ parameters: {
959
+ edgeId: { type: "string", description: "Edge ID or global ID to remove" }
960
+ },
961
+ required: ["edgeId"],
962
+ response: {
963
+ description: "Edge removal result",
964
+ fields: { success: "boolean" }
965
+ },
966
+ ownerModule: "graph-primitives",
967
+ ontologyPrimitive: "edge",
968
+ tier: "workhorse"
969
+ };
970
+ var REMOVE_EDGES_BETWEEN = {
971
+ name: "remove_edges_between",
972
+ description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
973
+ parameters: {
974
+ fromNodeId: { type: "string", description: "Source node ID or global ID" },
975
+ toNodeId: { type: "string", description: "Target node ID or global ID" },
976
+ edgeType: { type: "string", description: "Optional edge type filter" }
977
+ },
978
+ required: ["fromNodeId", "toNodeId"],
979
+ response: {
980
+ description: "Matched edge removal result",
981
+ fields: { deleted: "number" }
982
+ },
983
+ ownerModule: "graph-primitives",
984
+ ontologyPrimitive: "edge",
985
+ tier: "workhorse"
986
+ };
987
+ var BATCH_CREATE_EDGES = {
988
+ name: "batch_create_edges",
989
+ description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
990
+ parameters: {
991
+ edges: {
992
+ type: "array",
993
+ description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
994
+ },
995
+ skipLayerValidation: {
996
+ type: "boolean",
997
+ description: "Skip kernel layer validation for trusted materialization flows."
998
+ }
999
+ },
1000
+ required: ["edges"],
1001
+ response: {
1002
+ description: "Batch edge creation result",
1003
+ fields: {
1004
+ created: "number",
1005
+ results: "array",
1006
+ errors: "array"
1007
+ }
1008
+ },
1009
+ ownerModule: "graph-primitives",
1010
+ ontologyPrimitive: "edge",
1011
+ tier: "workhorse"
1012
+ };
1013
+ var CREATE_EPISTEMIC_NODE = {
1014
+ name: "create_epistemic_node",
1015
+ description: "Commit a generic epistemic graph node. Like `git commit` \u2014 creates a canonical node in the public spine for topics, beliefs, evidence, questions, answers, sources, and entities.",
1016
+ parameters: {
1017
+ globalId: { type: "string", description: "Optional idempotent node global ID" },
1018
+ nodeType: { type: "string", description: "Public epistemic node type" },
1019
+ canonicalText: { type: "string", description: "Canonical node text" },
1020
+ text: { type: "string", description: "Alias for canonicalText" },
1021
+ contentHash: { type: "string", description: "Optional idempotency content hash" },
1022
+ sourceType: { type: "string", description: "Source type for provenance" },
1023
+ topicId: { type: "string", description: "Optional topic scope" },
1024
+ content: { type: "string", description: "Extended content" },
1025
+ title: { type: "string", description: "Display title" },
1026
+ metadata: { type: "object", description: "Optional node metadata" }
1027
+ },
1028
+ required: ["nodeType"],
1029
+ response: {
1030
+ description: "Created node result",
1031
+ fields: {
1032
+ nodeId: "string",
1033
+ nodeGlobalId: "string",
1034
+ isDuplicate: "boolean"
1035
+ }
1036
+ },
1037
+ ownerModule: "reasoning-kernel",
1038
+ ontologyPrimitive: "graph",
1039
+ tier: "showcase"
1040
+ };
1041
+ var GET_EPISTEMIC_NODE = {
1042
+ name: "get_epistemic_node",
1043
+ description: "Read one epistemic graph node. Like `git show` \u2014 resolves a canonical spine node by ID or global ID.",
1044
+ parameters: {
1045
+ nodeId: { type: "string", description: "Node ID or global ID" }
1046
+ },
1047
+ required: ["nodeId"],
1048
+ response: {
1049
+ description: "The resolved node",
1050
+ fields: { node: "object" }
1051
+ },
1052
+ ownerModule: "reasoning-kernel",
1053
+ ontologyPrimitive: "graph",
1054
+ tier: "workhorse"
1055
+ };
1056
+ var LIST_EPISTEMIC_NODES = {
1057
+ name: "list_epistemic_nodes",
1058
+ description: "List epistemic graph nodes. Like `git ls-tree` \u2014 lists canonical spine nodes by topic, type, status, or search query.",
1059
+ parameters: {
1060
+ topicId: { type: "string", description: "Optional topic scope" },
1061
+ nodeType: { type: "string", description: "Optional node type filter" },
1062
+ status: { type: "string", description: "Optional lifecycle status" },
1063
+ searchQuery: { type: "string", description: "Optional text search query" },
1064
+ limit: { type: "number", description: "Maximum nodes to return" }
1065
+ },
1066
+ required: [],
1067
+ response: {
1068
+ description: "Matching nodes",
1069
+ fields: { nodes: "array" }
1070
+ },
1071
+ ownerModule: "reasoning-kernel",
1072
+ ontologyPrimitive: "graph",
1073
+ tier: "workhorse"
1074
+ };
1075
+ var UPDATE_EPISTEMIC_NODE = {
1076
+ name: "update_epistemic_node",
1077
+ description: "Amend an epistemic graph node. Like `git commit --amend` \u2014 updates mutable node metadata, text, status, or verification fields.",
1078
+ parameters: {
1079
+ nodeId: { type: "string", description: "Node ID or global ID" },
1080
+ canonicalText: { type: "string", description: "Updated canonical text" },
1081
+ text: { type: "string", description: "Alias for canonicalText" },
1082
+ contentHash: { type: "string", description: "Updated content hash" },
1083
+ content: { type: "string", description: "Updated content" },
1084
+ title: { type: "string", description: "Updated display title" },
1085
+ metadata: { type: "object", description: "Updated metadata" },
1086
+ confidence: { type: "number", description: "Updated confidence" },
1087
+ verificationStatus: { type: "string", description: "Updated verification status" },
1088
+ status: { type: "string", description: "Updated lifecycle status" }
1089
+ },
1090
+ required: ["nodeId"],
1091
+ response: {
1092
+ description: "Node update result",
1093
+ fields: { success: "boolean" }
1094
+ },
1095
+ ownerModule: "reasoning-kernel",
1096
+ ontologyPrimitive: "graph",
1097
+ tier: "workhorse"
1098
+ };
1099
+ var ARCHIVE_EPISTEMIC_NODE = {
1100
+ name: "archive_epistemic_node",
1101
+ description: "Archive an epistemic graph node. Like `git rm --cached` \u2014 removes a node from active traversal without hard-deleting it.",
1102
+ parameters: {
1103
+ nodeId: { type: "string", description: "Node ID or global ID" }
1104
+ },
1105
+ required: ["nodeId"],
1106
+ response: {
1107
+ description: "Archive result",
1108
+ fields: { success: "boolean", effectiveStatus: "string" }
1109
+ },
1110
+ ownerModule: "reasoning-kernel",
1111
+ ontologyPrimitive: "graph",
1112
+ tier: "workhorse"
1113
+ };
1114
+ var VERIFY_EPISTEMIC_NODE = {
1115
+ name: "verify_epistemic_node",
1116
+ description: "Record verification state on an epistemic graph node. Like `git tag` \u2014 marks the node with a reviewed verification state.",
1117
+ parameters: {
1118
+ nodeId: { type: "string", description: "Node ID or global ID" },
1119
+ verificationStatus: { type: "string", description: "Verification status" },
1120
+ confidence: { type: "number", description: "Optional confidence update" }
1121
+ },
1122
+ required: ["nodeId", "verificationStatus"],
1123
+ response: {
1124
+ description: "Verification result",
1125
+ fields: { success: "boolean" }
1126
+ },
1127
+ ownerModule: "reasoning-kernel",
1128
+ ontologyPrimitive: "graph",
1129
+ tier: "workhorse"
1130
+ };
1131
+ var SUPERSEDE_EPISTEMIC_NODE = {
1132
+ name: "supersede_epistemic_node",
1133
+ description: "Supersede an epistemic graph node with a new version. Like `git commit --amend` on an immutable history branch \u2014 creates the replacement and marks the old node superseded.",
1134
+ parameters: {
1135
+ oldNodeId: { type: "string", description: "Node ID or global ID to supersede" },
1136
+ newGlobalId: { type: "string", description: "Optional replacement global ID" },
1137
+ newCanonicalText: { type: "string", description: "Replacement canonical text" },
1138
+ text: { type: "string", description: "Alias for newCanonicalText" },
1139
+ newContentHash: { type: "string", description: "Optional replacement content hash" },
1140
+ reason: { type: "string", description: "Reason for superseding" }
1141
+ },
1142
+ required: ["oldNodeId"],
1143
+ response: {
1144
+ description: "Supersede result",
1145
+ fields: { oldNodeId: "string", newNodeId: "string" }
1146
+ },
1147
+ ownerModule: "reasoning-kernel",
1148
+ ontologyPrimitive: "graph",
1149
+ tier: "workhorse"
1150
+ };
1151
+ var BATCH_CREATE_EPISTEMIC_NODES = {
1152
+ name: "batch_create_epistemic_nodes",
1153
+ description: "Commit multiple epistemic graph nodes. Like `git commit` with many staged files \u2014 writes a batch of canonical spine nodes.",
1154
+ parameters: {
1155
+ nodes: {
1156
+ type: "array",
1157
+ description: "Nodes to create with nodeType, canonicalText/text, and optional metadata."
1158
+ }
1159
+ },
1160
+ required: ["nodes"],
1161
+ response: {
1162
+ description: "Batch node creation result",
1163
+ fields: { created: "number", results: "array" }
1164
+ },
1165
+ ownerModule: "reasoning-kernel",
1166
+ ontologyPrimitive: "graph",
1167
+ tier: "workhorse"
1168
+ };
911
1169
  var RECORD_JUDGMENT = {
912
1170
  name: "record_judgment",
913
1171
  description: "Record a judgment \u2014 an irreversible commitment based on the current epistemic state. Like a `git tag` marking a release. A judgment synthesizes beliefs, evidence, and uncertainties into a determination. Once issued, a judgment is evaluated against the epistemic state that existed when it was made (knowledge horizon evaluation, Invariant #10).",
@@ -2107,8 +2365,8 @@ var IDENTITY_WHOAMI = {
2107
2365
  response: {
2108
2366
  description: "Canonical identity summary for the current session",
2109
2367
  fields: {
2110
- principalId: "string \u2014 canonical federated principal identifier",
2111
- principalType: "string \u2014 human, service, or agent",
2368
+ principalId: "string \u2014 canonical principal identifier; for humans this is the Clerk user_... ID",
2369
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2112
2370
  tenantId: "string | undefined \u2014 resolved tenant scope",
2113
2371
  workspaceId: "string | undefined \u2014 resolved workspace scope",
2114
2372
  scopes: "string[] | undefined \u2014 granted scopes for this session",
@@ -2119,6 +2377,49 @@ var IDENTITY_WHOAMI = {
2119
2377
  ontologyPrimitive: "identity",
2120
2378
  tier: "workhorse"
2121
2379
  };
2380
+ var RESOLVE_INTERACTIVE_PRINCIPAL = {
2381
+ name: "resolve_interactive_principal",
2382
+ 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.",
2383
+ parameters: {
2384
+ clerkId: {
2385
+ type: "string",
2386
+ description: "Authenticated Clerk subject (`sub`). Clerk proves identity only; it is not the authorization record."
2387
+ },
2388
+ tenantId: {
2389
+ type: "string",
2390
+ description: "Optional tenant scope. Omit only when the Clerk alias is globally unambiguous."
2391
+ },
2392
+ workspaceId: {
2393
+ type: "string",
2394
+ description: "Optional workspace scope. Required when the principal has access to multiple workspaces and no default can be inferred."
2395
+ },
2396
+ providerProjectId: {
2397
+ type: "string",
2398
+ description: "Optional Clerk project or provider instance id for tenants with multiple identity providers."
2399
+ }
2400
+ },
2401
+ required: ["clerkId"],
2402
+ response: {
2403
+ description: "Permit-backed Lucern principal context for tenant SDK bootstrap",
2404
+ fields: {
2405
+ principalId: "string \u2014 canonical Clerk user_... ID for human sessions",
2406
+ principalType: "string \u2014 human, service, agent, group, or external_viewer",
2407
+ clerkId: "string \u2014 authenticated Clerk subject alias",
2408
+ tenantId: "string \u2014 resolved tenant scope",
2409
+ workspaceId: "string | null \u2014 resolved workspace scope",
2410
+ roles: "string[] \u2014 effective Permit roles",
2411
+ scopes: "string[] \u2014 effective scopes derived from Permit/control-plane projection",
2412
+ groupIds: "string[] \u2014 active Permit group memberships",
2413
+ principalStatus: "string \u2014 active, invited, suspended, disabled, revoked, or missing",
2414
+ tenantStatus: "string \u2014 projected tenant resource status",
2415
+ workspaceStatus: "string \u2014 projected workspace resource status",
2416
+ permit: "object \u2014 Permit subject, tenant, and optional workspace tuple"
2417
+ }
2418
+ },
2419
+ ownerModule: "control-plane",
2420
+ ontologyPrimitive: "identity",
2421
+ tier: "workhorse"
2422
+ };
2122
2423
  var COMPILE_CONTEXT = {
2123
2424
  name: "compile_context",
2124
2425
  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.",
@@ -2380,6 +2681,10 @@ var CREATE_TASK = {
2380
2681
  tags: {
2381
2682
  type: "array",
2382
2683
  description: "Free-form string tags"
2684
+ },
2685
+ metadata: {
2686
+ type: "object",
2687
+ description: "Structured task metadata for handoff context and routing hints"
2383
2688
  }
2384
2689
  },
2385
2690
  required: ["title"],
@@ -2453,6 +2758,10 @@ var UPDATE_TASK = {
2453
2758
  type: "string",
2454
2759
  description: "Updated status",
2455
2760
  enum: ["todo", "in_progress", "blocked", "done"]
2761
+ },
2762
+ metadata: {
2763
+ type: "object",
2764
+ description: "Structured task metadata to replace or refine"
2456
2765
  }
2457
2766
  },
2458
2767
  required: ["taskId"],
@@ -2500,6 +2809,10 @@ var CREATE_TOPIC = {
2500
2809
  name: "create_topic",
2501
2810
  description: "Create a new topic container for scoping knowledge. Like `git init` \u2014 initializes a new repository for a knowledge domain. Topics are hierarchical: a deal topic can nest under a theme topic. Types: domain, theme, deal, strategy, constitution, project, portfolio.",
2502
2811
  parameters: {
2812
+ globalId: {
2813
+ type: "string",
2814
+ description: "Optional idempotent topic global ID"
2815
+ },
2503
2816
  name: { type: "string", description: "Topic name" },
2504
2817
  type: {
2505
2818
  type: "string",
@@ -2510,6 +2823,18 @@ var CREATE_TOPIC = {
2510
2823
  type: "string",
2511
2824
  description: "Optional parent topic for nesting"
2512
2825
  },
2826
+ parentTopicGlobalId: {
2827
+ type: "string",
2828
+ description: "Optional parent topic global ID for nesting"
2829
+ },
2830
+ tenantId: { type: "string", description: "Optional tenant scope" },
2831
+ workspaceId: { type: "string", description: "Optional workspace scope" },
2832
+ visibility: {
2833
+ type: "string",
2834
+ description: "Topic visibility",
2835
+ enum: ["private", "team", "firm", "external", "public"]
2836
+ },
2837
+ metadata: { type: "object", description: "Optional topic metadata" },
2513
2838
  createdBy: { type: "string", description: "Who created this topic" }
2514
2839
  },
2515
2840
  required: ["name", "type"],
@@ -2518,6 +2843,9 @@ var CREATE_TOPIC = {
2518
2843
  fields: {
2519
2844
  id: "string \u2014 topic ID",
2520
2845
  globalId: "string \u2014 globally unique ID",
2846
+ topicGlobalId: "string \u2014 topic global ID",
2847
+ epistemicNodeId: "string \u2014 materialized topic node ID",
2848
+ epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
2521
2849
  depth: "number \u2014 nesting depth"
2522
2850
  }
2523
2851
  },
@@ -2648,6 +2976,65 @@ var GET_TOPIC_TREE = {
2648
2976
  ontologyPrimitive: "graph",
2649
2977
  tier: "workhorse"
2650
2978
  };
2979
+ var MATERIALIZE_TOPIC_GRAPH = {
2980
+ name: "materialize_topic_graph",
2981
+ description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
2982
+ parameters: {
2983
+ rootTopicId: {
2984
+ type: "string",
2985
+ description: "Optional root topic for a bounded materialization pass"
2986
+ },
2987
+ dryRun: {
2988
+ type: "boolean",
2989
+ description: "When true, report missing rows without writing them"
2990
+ }
2991
+ },
2992
+ required: [],
2993
+ response: {
2994
+ description: "Topic graph materialization counts",
2995
+ fields: {
2996
+ topicsSeen: "number",
2997
+ nodesCreated: "number",
2998
+ nodesExisting: "number",
2999
+ edgesCreated: "number",
3000
+ edgesExisting: "number",
3001
+ errors: "array"
3002
+ }
3003
+ },
3004
+ ownerModule: "reasoning-kernel",
3005
+ ontologyPrimitive: "graph",
3006
+ tier: "workhorse"
3007
+ };
3008
+ var GET_TOPIC_GRAPH_SPINE = {
3009
+ name: "get_topic_graph_spine",
3010
+ description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
3011
+ parameters: {
3012
+ rootTopicId: {
3013
+ type: "string",
3014
+ description: "Optional root topic for a bounded verifier pass"
3015
+ },
3016
+ includeTopicBeliefEdges: {
3017
+ type: "boolean",
3018
+ description: "Include topic -> belief edges in the verifier payload"
3019
+ }
3020
+ },
3021
+ required: [],
3022
+ response: {
3023
+ description: "Topic graph spine verification payload",
3024
+ fields: {
3025
+ ok: "boolean",
3026
+ counts: "object",
3027
+ topics: "array",
3028
+ topicNodes: "array",
3029
+ parentEdges: "array",
3030
+ missingTopicNodes: "array",
3031
+ missingParentEdges: "array"
3032
+ }
3033
+ },
3034
+ ownerModule: "reasoning-kernel",
3035
+ ontologyPrimitive: "graph",
3036
+ tier: "workhorse"
3037
+ };
2651
3038
  var GET_CODE_CONTEXT = {
2652
3039
  name: "get_code_context",
2653
3040
  description: "Returns code-grounded beliefs, contracts, migration states, and failed attempts anchored to a specific file or function path. Like `git log -- <path>` \u2014 filters the knowledge graph to nodes anchored to a file path via metadata.codeAnchors. Results are separated by coding belief type: decisions, contracts, migrations, patterns, deprecations, and failures.",
@@ -2843,7 +3230,7 @@ var MANAGE_WRITE_POLICY = {
2843
3230
  },
2844
3231
  role: {
2845
3232
  type: "string",
2846
- description: "Role to set policy for (required for 'set'). E.g. 'agent:internal', 'user:analyst'."
3233
+ description: "Role to set policy for (required for 'set'). E.g. 'agent:internal' or a Permit role key such as 'workspace_admin'."
2847
3234
  },
2848
3235
  permission: {
2849
3236
  type: "string",
@@ -3830,6 +4217,9 @@ var BEGIN_BUILD_SESSION = {
3830
4217
  sessionMode: "string \u2014 async | interactive",
3831
4218
  targetBeliefIds: "array \u2014 scoped belief IDs",
3832
4219
  targetQuestionIds: "array \u2014 scoped question IDs",
4220
+ taskIds: "array \u2014 assigned task IDs for this worktree",
4221
+ incompleteTaskIds: "array \u2014 assigned task IDs that still require done/deferred/blocked proof",
4222
+ tasks: "array \u2014 assigned task packet with id, title, status, priority, links, and summaries",
3833
4223
  topBeliefs: "array \u2014 highest-confidence scoped beliefs",
3834
4224
  openQuestions: "array \u2014 open scoped questions",
3835
4225
  resolvedDecisions: "array \u2014 answered questions summarized for the session",
@@ -3885,6 +4275,19 @@ var MCP_TOOL_CONTRACTS = {
3885
4275
  bisect_confidence: BISECT_CONFIDENCE,
3886
4276
  // Edges (commit)
3887
4277
  create_edge: CREATE_EDGE,
4278
+ update_edge: UPDATE_EDGE,
4279
+ remove_edge: REMOVE_EDGE,
4280
+ remove_edges_between: REMOVE_EDGES_BETWEEN,
4281
+ batch_create_edges: BATCH_CREATE_EDGES,
4282
+ // Epistemic node spine (commit/amend/show)
4283
+ create_epistemic_node: CREATE_EPISTEMIC_NODE,
4284
+ get_epistemic_node: GET_EPISTEMIC_NODE,
4285
+ list_epistemic_nodes: LIST_EPISTEMIC_NODES,
4286
+ update_epistemic_node: UPDATE_EPISTEMIC_NODE,
4287
+ archive_epistemic_node: ARCHIVE_EPISTEMIC_NODE,
4288
+ verify_epistemic_node: VERIFY_EPISTEMIC_NODE,
4289
+ supersede_epistemic_node: SUPERSEDE_EPISTEMIC_NODE,
4290
+ batch_create_epistemic_nodes: BATCH_CREATE_EPISTEMIC_NODES,
3888
4291
  // Judgments (tag)
3889
4292
  record_judgment: RECORD_JUDGMENT,
3890
4293
  // Graph intelligence (showcase)
@@ -3919,6 +4322,7 @@ var MCP_TOOL_CONTRACTS = {
3919
4322
  update_worktree_targets: UPDATE_WORKTREE_TARGETS,
3920
4323
  update_worktree_metadata: UPDATE_WORKTREE_METADATA,
3921
4324
  identity_whoami: IDENTITY_WHOAMI,
4325
+ resolve_interactive_principal: RESOLVE_INTERACTIVE_PRINCIPAL,
3922
4326
  compile_context: COMPILE_CONTEXT,
3923
4327
  record_scope_learning: RECORD_SCOPE_LEARNING,
3924
4328
  pipeline_snapshot: PIPELINE_SNAPSHOT,
@@ -3958,6 +4362,8 @@ var MCP_TOOL_CONTRACTS = {
3958
4362
  get_topic: GET_TOPIC,
3959
4363
  update_topic: UPDATE_TOPIC,
3960
4364
  get_topic_tree: GET_TOPIC_TREE,
4365
+ materialize_topic_graph: MATERIALIZE_TOPIC_GRAPH,
4366
+ get_topic_graph_spine: GET_TOPIC_GRAPH_SPINE,
3961
4367
  // Coding intelligence (code-grounded knowledge)
3962
4368
  get_code_context: GET_CODE_CONTEXT,
3963
4369
  get_change_history: GET_CHANGE_HISTORY,
@@ -4034,6 +4440,7 @@ function entries(names, surfaceClass, surfaceIntent, surfaces, rationale) {
4034
4440
  var MCP_CORE_OPERATION_NAMES = [
4035
4441
  "compile_context",
4036
4442
  "identity_whoami",
4443
+ "resolve_interactive_principal",
4037
4444
  "check_permission",
4038
4445
  "filter_by_permission",
4039
4446
  "create_belief",
@@ -4062,14 +4469,28 @@ var MCP_CORE_OPERATION_NAMES = [
4062
4469
  "find_missing_questions",
4063
4470
  "get_high_priority_questions",
4064
4471
  "get_falsification_questions",
4472
+ "create_epistemic_node",
4473
+ "get_epistemic_node",
4474
+ "list_epistemic_nodes",
4475
+ "update_epistemic_node",
4476
+ "archive_epistemic_node",
4477
+ "verify_epistemic_node",
4478
+ "supersede_epistemic_node",
4479
+ "batch_create_epistemic_nodes",
4065
4480
  "create_topic",
4066
4481
  "get_topic",
4067
4482
  "list_topics",
4068
4483
  "update_topic",
4069
- "get_topic_tree"
4484
+ "get_topic_tree",
4485
+ "materialize_topic_graph",
4486
+ "get_topic_graph_spine"
4070
4487
  ];
4071
4488
  var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
4072
4489
  "create_edge",
4490
+ "update_edge",
4491
+ "remove_edge",
4492
+ "remove_edges_between",
4493
+ "batch_create_edges",
4073
4494
  "query_lineage",
4074
4495
  "traverse_graph",
4075
4496
  "get_graph_neighborhood",
@@ -4345,6 +4766,13 @@ function surfaceIntentGateViolations(entry) {
4345
4766
  }
4346
4767
  return violations;
4347
4768
  }
4769
+ var NODE_TYPE = z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
4770
+ var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
4771
+ var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
4772
+ z.enum(EDGE_TYPE_VALUES);
4773
+ z.enum(STORAGE_EDGE_TYPE_VALUES);
4774
+ z.enum(["active", "archived", "watching"]);
4775
+ z.enum(["private", "team", "firm", "external", "public"]);
4348
4776
 
4349
4777
  // src/function-registry/helpers.ts
4350
4778
  var jsonObjectSchema = z.record(z.unknown());
@@ -4441,12 +4869,20 @@ function unwrapMcpParameterSchema(schema) {
4441
4869
  current = current._def.schema;
4442
4870
  continue;
4443
4871
  default:
4444
- return { schema: current, required, description: description ?? current.description };
4872
+ return {
4873
+ schema: current,
4874
+ required,
4875
+ description: description ?? current.description
4876
+ };
4445
4877
  }
4446
4878
  }
4447
4879
  }
4448
4880
  function mcpParameterFromZod(fieldName, schema, contractName) {
4449
- const { schema: unwrapped, required, description: schemaDescription } = unwrapMcpParameterSchema(schema);
4881
+ const {
4882
+ schema: unwrapped,
4883
+ required,
4884
+ description: schemaDescription
4885
+ } = unwrapMcpParameterSchema(schema);
4450
4886
  const description = schemaDescription ?? unwrapped.description ?? fieldName;
4451
4887
  switch (unwrapped._def.typeName) {
4452
4888
  case z.ZodFirstPartyTypeKind.ZodString:
@@ -4491,10 +4927,12 @@ function mcpContractFromArgsSchema(base, args, contractName) {
4491
4927
  const entries2 = Object.entries(getObjectShape(args)).sort(
4492
4928
  ([left], [right]) => left.localeCompare(right)
4493
4929
  );
4494
- const converted = entries2.map(([fieldName, schema]) => [
4495
- fieldName,
4496
- mcpParameterFromZod(fieldName, schema, contractName)
4497
- ]);
4930
+ const converted = entries2.map(
4931
+ ([fieldName, schema]) => [
4932
+ fieldName,
4933
+ mcpParameterFromZod(fieldName, schema, contractName)
4934
+ ]
4935
+ );
4498
4936
  return {
4499
4937
  ...base,
4500
4938
  parameters: Object.fromEntries(
@@ -4609,9 +5047,16 @@ function surfaceContract(args) {
4609
5047
  scopes: args.scopes ?? [
4610
5048
  args.kind === "query" ? `${args.domain}.read` : `${args.domain}.write`
4611
5049
  ],
4612
- allowedPrincipalTypes: ["user", "service", "agent"]
5050
+ allowedPrincipalTypes: [
5051
+ "user",
5052
+ "service",
5053
+ "agent",
5054
+ "group",
5055
+ "external_viewer"
5056
+ ]
4613
5057
  },
4614
5058
  convex: args.convex,
5059
+ gateway: args.gateway,
4615
5060
  args: canonicalArgs,
4616
5061
  returns: canonicalReturns,
4617
5062
  input,
@@ -4645,6 +5090,7 @@ var ALL_FUNCTION_CONTRACTS = [
4645
5090
  ...evidenceContracts,
4646
5091
  ...questionsContracts,
4647
5092
  ...topicsContracts,
5093
+ ...nodesContracts,
4648
5094
  ...lensesContracts,
4649
5095
  ...ontologiesContracts,
4650
5096
  ...worktreesContracts,
@@ -4667,6 +5113,6 @@ var getFunctionContract = FUNCTION_CONTRACTS_BY_NAME.get.bind(
4667
5113
  FUNCTION_CONTRACTS_BY_NAME
4668
5114
  );
4669
5115
 
4670
- export { ALL_FUNCTION_CONTRACTS, DUPLICATE_OPERATION_NAMES, FORBIDDEN_APPLICATION_OPERATION_NAMES, FUNCTION_CONTRACTS_BY_NAME, FUNCTION_SURFACE_CONTRACTS, LEGACY_COMPAT_OPERATION_NAMES, LUCERN_OPERATION_MANIFEST, MCP_ANALYSIS_PLATFORM_OPERATION_NAMES, MCP_ANALYSIS_TENANT_OPERATION_NAMES, MCP_AUTOMATION_OPERATION_NAMES, MCP_CORE_OPERATION_NAMES, MCP_GOVERNANCE_PLATFORM_OPERATION_NAMES, MCP_GOVERNANCE_TENANT_OPERATION_NAMES, MCP_ONLY_INTERNAL_OPERATION_NAMES, MCP_WORKFLOW_PLATFORM_OPERATION_NAMES, MCP_WORKFLOW_TENANT_OPERATION_NAMES, PLATFORM_INTERNAL_OPERATION_NAMES, PLATFORM_PUBLIC_OPERATION_NAMES, SDK_ONLY_OPERATION_NAMES, TENANT_PUBLIC_OPERATION_NAMES, argsSchemaFromMcpContract, assertSurfaceCoverage, authUserId, classifyContract, compactRecord, defineFunctionContract, getFunctionContract, inputSchemaFromMcpContract, jsonObjectSchema, recordValue, surfaceContract, surfaceEnabled, surfaceIntentGateViolations, surfaceMcpContract, withCreatedBy, withUserId };
5116
+ export { ALL_FUNCTION_CONTRACTS, DUPLICATE_OPERATION_NAMES, FORBIDDEN_APPLICATION_OPERATION_NAMES, FUNCTION_CONTRACTS_BY_NAME, FUNCTION_SURFACE_CONTRACTS, LEGACY_COMPAT_OPERATION_NAMES, LUCERN_OPERATION_MANIFEST, MCP_ANALYSIS_PLATFORM_OPERATION_NAMES, MCP_ANALYSIS_TENANT_OPERATION_NAMES, MCP_AUTOMATION_OPERATION_NAMES, MCP_CORE_OPERATION_NAMES, MCP_GOVERNANCE_PLATFORM_OPERATION_NAMES, MCP_GOVERNANCE_TENANT_OPERATION_NAMES, MCP_ONLY_INTERNAL_OPERATION_NAMES, MCP_WORKFLOW_PLATFORM_OPERATION_NAMES, MCP_WORKFLOW_TENANT_OPERATION_NAMES, NODE_TYPE, PLATFORM_INTERNAL_OPERATION_NAMES, PLATFORM_PUBLIC_OPERATION_NAMES, SDK_ONLY_OPERATION_NAMES, TENANT_PUBLIC_OPERATION_NAMES, argsSchemaFromMcpContract, assertSurfaceCoverage, authUserId, classifyContract, compactRecord, defineFunctionContract, getFunctionContract, inputSchemaFromMcpContract, jsonObjectSchema, recordValue, surfaceContract, surfaceEnabled, surfaceIntentGateViolations, surfaceMcpContract, withCreatedBy, withUserId };
4671
5117
  //# sourceMappingURL=index.js.map
4672
5118
  //# sourceMappingURL=index.js.map