@lucern/contracts 1.0.0 → 1.0.1

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 (213) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/dsl.d.ts +75 -4
  3. package/dist/dsl.values-rhsroqi0.d.ts +21 -0
  4. package/dist/dsl.values.d.ts +5 -0
  5. package/dist/dsl.values.js +675 -0
  6. package/dist/dsl.values.js.map +1 -0
  7. package/dist/function-registry/beliefs.d.ts +1 -17
  8. package/dist/function-registry/beliefs.js +155 -117
  9. package/dist/function-registry/beliefs.js.map +1 -1
  10. package/dist/function-registry/coding.d.ts +1 -17
  11. package/dist/function-registry/coding.js +155 -117
  12. package/dist/function-registry/coding.js.map +1 -1
  13. package/dist/function-registry/context.d.ts +1 -17
  14. package/dist/function-registry/context.js +155 -117
  15. package/dist/function-registry/context.js.map +1 -1
  16. package/dist/function-registry/contracts.d.ts +1 -17
  17. package/dist/function-registry/contracts.js +155 -117
  18. package/dist/function-registry/contracts.js.map +1 -1
  19. package/dist/function-registry/coordination.d.ts +1 -17
  20. package/dist/function-registry/coordination.js +155 -117
  21. package/dist/function-registry/coordination.js.map +1 -1
  22. package/dist/function-registry/edges.d.ts +1 -17
  23. package/dist/function-registry/edges.js +155 -117
  24. package/dist/function-registry/edges.js.map +1 -1
  25. package/dist/function-registry/evidence.d.ts +1 -17
  26. package/dist/function-registry/evidence.js +155 -117
  27. package/dist/function-registry/evidence.js.map +1 -1
  28. package/dist/function-registry/graph.d.ts +1 -17
  29. package/dist/function-registry/graph.js +155 -117
  30. package/dist/function-registry/graph.js.map +1 -1
  31. package/dist/function-registry/helpers.d.ts +1 -1
  32. package/dist/function-registry/helpers.js +155 -117
  33. package/dist/function-registry/helpers.js.map +1 -1
  34. package/dist/function-registry/identity.d.ts +1 -17
  35. package/dist/function-registry/identity.js +155 -117
  36. package/dist/function-registry/identity.js.map +1 -1
  37. package/dist/function-registry/index.d.ts +1 -1
  38. package/dist/function-registry/index.js +158 -118
  39. package/dist/function-registry/index.js.map +1 -1
  40. package/dist/function-registry/judgments.d.ts +1 -17
  41. package/dist/function-registry/judgments.js +155 -117
  42. package/dist/function-registry/judgments.js.map +1 -1
  43. package/dist/function-registry/legacy.d.ts +1 -17
  44. package/dist/function-registry/legacy.js +155 -117
  45. package/dist/function-registry/legacy.js.map +1 -1
  46. package/dist/function-registry/lenses.d.ts +1 -17
  47. package/dist/function-registry/lenses.js +155 -117
  48. package/dist/function-registry/lenses.js.map +1 -1
  49. package/dist/function-registry/manifest.d.ts +3 -3
  50. package/dist/function-registry/manifest.js +1 -0
  51. package/dist/function-registry/manifest.js.map +1 -1
  52. package/dist/function-registry/nodes.d.ts +1 -17
  53. package/dist/function-registry/nodes.js +155 -117
  54. package/dist/function-registry/nodes.js.map +1 -1
  55. package/dist/function-registry/ontologies.d.ts +1 -17
  56. package/dist/function-registry/ontologies.js +155 -117
  57. package/dist/function-registry/ontologies.js.map +1 -1
  58. package/dist/function-registry/pipeline.d.ts +1 -17
  59. package/dist/function-registry/pipeline.js +155 -117
  60. package/dist/function-registry/pipeline.js.map +1 -1
  61. package/dist/function-registry/questions.d.ts +1 -17
  62. package/dist/function-registry/questions.js +155 -117
  63. package/dist/function-registry/questions.js.map +1 -1
  64. package/dist/function-registry/tasks.d.ts +1 -17
  65. package/dist/function-registry/tasks.js +155 -117
  66. package/dist/function-registry/tasks.js.map +1 -1
  67. package/dist/function-registry/topics.d.ts +1 -17
  68. package/dist/function-registry/topics.js +155 -117
  69. package/dist/function-registry/topics.js.map +1 -1
  70. package/dist/function-registry/types.d.ts +2 -2
  71. package/dist/function-registry/worktrees.d.ts +41 -17
  72. package/dist/function-registry/worktrees.js +174 -117
  73. package/dist/function-registry/worktrees.js.map +1 -1
  74. package/dist/generated/lucernWebPublicEnv.js.map +1 -1
  75. package/dist/generated/lucernWebServerEnv.js.map +1 -1
  76. package/dist/{idOf-DR8tkhQS.d.ts → idOf-BmkVDhD8.d.ts} +1 -1
  77. package/dist/index.d.ts +47 -8
  78. package/dist/index.js +45072 -45005
  79. package/dist/index.js.map +1 -1
  80. package/dist/infisical-runtime.base.d.ts +444 -0
  81. package/dist/infisical-runtime.base.js +640 -0
  82. package/dist/infisical-runtime.base.js.map +1 -0
  83. package/dist/infisical-runtime.contract.d.ts +9 -440
  84. package/dist/infisical-runtime.contract.js +14 -1
  85. package/dist/infisical-runtime.contract.js.map +1 -1
  86. package/dist/infisical-runtime.platform-ops-secrets.d.ts +743 -0
  87. package/dist/infisical-runtime.platform-ops-secrets.js +962 -0
  88. package/dist/infisical-runtime.platform-ops-secrets.js.map +1 -0
  89. package/dist/infisical-runtime.platform-secrets.d.ts +598 -0
  90. package/dist/infisical-runtime.platform-secrets.js +726 -0
  91. package/dist/infisical-runtime.platform-secrets.js.map +1 -0
  92. package/dist/infisical-runtime.tenant-secrets.d.ts +486 -0
  93. package/dist/infisical-runtime.tenant-secrets.js +1131 -0
  94. package/dist/infisical-runtime.tenant-secrets.js.map +1 -0
  95. package/dist/manifests/edge-policy-manifest.d.ts +1 -1
  96. package/dist/manifests/infisical-runtime-manifest.d.ts +1 -1
  97. package/dist/manifests/infisical-runtime-manifest.js +14 -1
  98. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  99. package/dist/manifests/tenant-client-manifest.d.ts +5 -1
  100. package/dist/manifests/tenant-client-manifest.js +5 -0
  101. package/dist/manifests/tenant-client-manifest.js.map +1 -1
  102. package/dist/proof-attestation.json +1 -1
  103. package/dist/schemas/index.d.ts +1 -1
  104. package/dist/schemas/index.js.map +1 -1
  105. package/dist/schemas/manifest.d.ts +61 -61
  106. package/dist/schemas/manifest.js.map +1 -1
  107. package/dist/schemas/tables/kernel/config.js.map +1 -1
  108. package/dist/schemas/tables/kernel/coordination.js.map +1 -1
  109. package/dist/schemas/tables/kernel/decision.d.ts +1 -1
  110. package/dist/schemas/tables/kernel/decision.js.map +1 -1
  111. package/dist/schemas/tables/kernel/embedding.d.ts +1 -1
  112. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  113. package/dist/schemas/tables/kernel/epistemic.d.ts +1 -1
  114. package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
  115. package/dist/schemas/tables/kernel/idempotency.js.map +1 -1
  116. package/dist/schemas/tables/kernel/infra.js.map +1 -1
  117. package/dist/schemas/tables/kernel/intelligence.d.ts +1 -1
  118. package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
  119. package/dist/schemas/tables/kernel/lens.d.ts +5 -5
  120. package/dist/schemas/tables/kernel/lens.js.map +1 -1
  121. package/dist/schemas/tables/kernel/ontology.d.ts +1 -1
  122. package/dist/schemas/tables/kernel/ontology.js.map +1 -1
  123. package/dist/schemas/tables/kernel/platform.js.map +1 -1
  124. package/dist/schemas/tables/kernel/spine.d.ts +1 -1
  125. package/dist/schemas/tables/kernel/spine.js.map +1 -1
  126. package/dist/schemas/tables/kernel/task.d.ts +1 -1
  127. package/dist/schemas/tables/kernel/task.js.map +1 -1
  128. package/dist/schemas/tables/kernel/topic.d.ts +1 -1
  129. package/dist/schemas/tables/kernel/topic.js.map +1 -1
  130. package/dist/schemas/tables/kernel/workflow.d.ts +1 -1
  131. package/dist/schemas/tables/kernel/workflow.js.map +1 -1
  132. package/dist/schemas/tables/kernel/worktree.d.ts +1 -1
  133. package/dist/schemas/tables/kernel/worktree.js.map +1 -1
  134. package/dist/schemas/tables/mc/identity.d.ts +1 -1
  135. package/dist/schemas/tables/mc/methodology.d.ts +1 -1
  136. package/dist/schemas/tables/mc/pack.d.ts +9 -9
  137. package/dist/schemas/tables/mc/policy.d.ts +1 -1
  138. package/dist/schemas/tables/mc/registry.d.ts +1 -1
  139. package/dist/schemas/tables/mc/runtime.d.ts +1 -1
  140. package/dist/schemas/tables/mc/tenant.d.ts +1 -1
  141. package/dist/schemas/tables/mc/workspace.d.ts +1 -1
  142. package/dist/schemas.values-5J5oIK7z.d.ts +26 -0
  143. package/dist/schemas.values.d.ts +7 -0
  144. package/dist/schemas.values.js +5324 -0
  145. package/dist/schemas.values.js.map +1 -0
  146. package/dist/sdk-tools.contract.analytics.d.ts +27 -0
  147. package/dist/sdk-tools.contract.analytics.js +616 -0
  148. package/dist/sdk-tools.contract.analytics.js.map +1 -0
  149. package/dist/sdk-tools.contract.d.ts +43 -2
  150. package/dist/sdk-tools.contract.graph.d.ts +11 -0
  151. package/dist/sdk-tools.contract.graph.js +156 -0
  152. package/dist/sdk-tools.contract.graph.js.map +1 -0
  153. package/dist/sdk-tools.contract.js +4107 -4062
  154. package/dist/sdk-tools.contract.js.map +1 -1
  155. package/dist/sdk-tools.contract.registry.d.ts +25 -0
  156. package/dist/sdk-tools.contract.registry.js +5504 -0
  157. package/dist/sdk-tools.contract.registry.js.map +1 -0
  158. package/dist/sdk-tools.contract.types.d.ts +15 -0
  159. package/dist/sdk-tools.contract.types.js +3 -0
  160. package/dist/sdk-tools.contract.types.js.map +1 -0
  161. package/dist/sdk-tools.contract.values-LuBh95zg.d.ts +58 -0
  162. package/dist/sdk-tools.contract.values.d.ts +7 -0
  163. package/dist/sdk-tools.contract.values.js +5581 -0
  164. package/dist/sdk-tools.contract.values.js.map +1 -0
  165. package/dist/sdk-tools.contract.workflow.d.ts +17 -0
  166. package/dist/sdk-tools.contract.workflow.js +287 -0
  167. package/dist/sdk-tools.contract.workflow.js.map +1 -0
  168. package/dist/tenant-client.contract.d.ts +5 -1
  169. package/dist/tenant-client.contract.js +5 -0
  170. package/dist/tenant-client.contract.js.map +1 -1
  171. package/dist/tool-contracts.d.ts +34 -1
  172. package/dist/tool-contracts.graph.d.ts +18 -0
  173. package/dist/tool-contracts.graph.js +378 -0
  174. package/dist/tool-contracts.graph.js.map +1 -0
  175. package/dist/tool-contracts.intelligence-evidence.d.ts +15 -0
  176. package/dist/tool-contracts.intelligence-evidence.js +303 -0
  177. package/dist/tool-contracts.intelligence-evidence.js.map +1 -0
  178. package/dist/tool-contracts.js +155 -118
  179. package/dist/tool-contracts.js.map +1 -1
  180. package/dist/tool-contracts.lifecycle.d.ts +13 -0
  181. package/dist/tool-contracts.lifecycle.js +410 -0
  182. package/dist/tool-contracts.lifecycle.js.map +1 -0
  183. package/dist/tool-contracts.nodes-lenses.d.ts +17 -0
  184. package/dist/tool-contracts.nodes-lenses.js +334 -0
  185. package/dist/tool-contracts.nodes-lenses.js.map +1 -0
  186. package/dist/tool-contracts.ontology.d.ts +16 -0
  187. package/dist/tool-contracts.ontology.js +344 -0
  188. package/dist/tool-contracts.ontology.js.map +1 -0
  189. package/dist/tool-contracts.pipeline-coordination.d.ts +25 -0
  190. package/dist/tool-contracts.pipeline-coordination.js +684 -0
  191. package/dist/tool-contracts.pipeline-coordination.js.map +1 -0
  192. package/dist/tool-contracts.policy-observation-task-topic.d.ts +25 -0
  193. package/dist/tool-contracts.policy-observation-task-topic.js +740 -0
  194. package/dist/tool-contracts.policy-observation-task-topic.js.map +1 -0
  195. package/dist/tool-contracts.questions-listing.d.ts +27 -0
  196. package/dist/tool-contracts.questions-listing.js +782 -0
  197. package/dist/tool-contracts.questions-listing.js.map +1 -0
  198. package/dist/tool-contracts.types.d.ts +34 -0
  199. package/dist/tool-contracts.types.js +3 -0
  200. package/dist/tool-contracts.types.js.map +1 -0
  201. package/dist/tool-contracts.values-DjctSW7S.d.ts +147 -0
  202. package/dist/tool-contracts.values.d.ts +11 -0
  203. package/dist/tool-contracts.values.js +4398 -0
  204. package/dist/tool-contracts.values.js.map +1 -0
  205. package/dist/tool-contracts.worktrees.d.ts +8 -0
  206. package/dist/tool-contracts.worktrees.js +280 -0
  207. package/dist/tool-contracts.worktrees.js.map +1 -0
  208. package/package.json +3 -11
  209. package/dist/dsl-DVPthQGY.d.ts +0 -110
  210. package/dist/index-CM1Pl_vI.d.ts +0 -28
  211. package/dist/sdk-tools.contract-CKmSsrZ2.d.ts +0 -146
  212. package/dist/tool-contracts-C_xvM9q2.d.ts +0 -326
  213. package/dist/{edge-policy-manifest-Dw5IhT1L.d.ts → edge-policy-manifest-4KOSP4nk.d.ts} +2 -2
@@ -0,0 +1,378 @@
1
+ // src/types/reasoning-method.ts
2
+ var REASONING_METHODS = [
3
+ "deductive",
4
+ "inductive",
5
+ "abductive",
6
+ "analogical",
7
+ "causal",
8
+ "correlational",
9
+ "testimonial",
10
+ "statistical",
11
+ "implicit",
12
+ "pattern_match"
13
+ ];
14
+
15
+ // src/tool-contracts.graph.ts
16
+ var QUERY_LINEAGE = {
17
+ name: "query_lineage",
18
+ description: "Trace a belief's full ancestry \u2014 every fork, score, and confidence modulation. Like `git log --graph`. Returns the complete evolution chain showing how understanding developed over time. Lineage is permanent and can never be erased (Invariant #3).",
19
+ parameters: {
20
+ nodeId: { type: "string", description: "Starting node to trace from" },
21
+ depth: {
22
+ type: "number",
23
+ description: "How many generations to traverse (default: 5)"
24
+ }
25
+ },
26
+ required: ["nodeId"],
27
+ response: {
28
+ description: "Canonical lineage result",
29
+ fields: {
30
+ beliefId: "string \u2014 canonical belief ID",
31
+ lineage: "array \u2014 ancestry entries with beliefId, nodeId, formulation, forkReason, and createdAt"
32
+ }
33
+ },
34
+ ownerModule: "graph-search",
35
+ ontologyPrimitive: "belief",
36
+ tier: "workhorse"
37
+ };
38
+ var GET_CONFIDENCE_HISTORY = {
39
+ name: "get_confidence_history",
40
+ description: "Get the full confidence history for a belief. Each entry records the confidence level, trigger, rationale, and actor. Like `git log` for a single metric \u2014 append-only, never overwritten.",
41
+ parameters: {
42
+ nodeId: { type: "string", description: "The belief to get history for" }
43
+ },
44
+ required: ["nodeId"],
45
+ response: {
46
+ description: "Confidence history entries",
47
+ fields: {
48
+ beliefId: "string \u2014 canonical belief ID",
49
+ entries: "array \u2014 { confidence, trigger, rationale, timestamp, userId }",
50
+ nextCursor: "string | null"
51
+ }
52
+ },
53
+ ownerModule: "graph-primitives",
54
+ ontologyPrimitive: "belief",
55
+ tier: "workhorse"
56
+ };
57
+ var GET_AUDIT_TRAIL = {
58
+ name: "get_audit_trail",
59
+ description: "Get the full audit trail for a node \u2014 every mutation, who made it, when, and why. Like `git blame` for knowledge. All state transitions are explicit, attributable, and permanently queryable. No silent changes are possible (Invariant #14).",
60
+ parameters: {
61
+ nodeId: { type: "string", description: "The node to audit" },
62
+ limit: {
63
+ type: "number",
64
+ description: "Maximum entries to return (default: 50)"
65
+ }
66
+ },
67
+ required: ["nodeId"],
68
+ response: {
69
+ description: "Audit trail entries",
70
+ fields: {
71
+ entries: "array \u2014 { action, actor, timestamp, before, after, rationale }"
72
+ }
73
+ },
74
+ ownerModule: "graph-primitives",
75
+ ontologyPrimitive: "graph",
76
+ tier: "workhorse"
77
+ };
78
+ var TRAVERSE_GRAPH = {
79
+ name: "traverse_graph",
80
+ description: "Walk the reasoning graph from a starting node. Like `git log --graph` \u2014 traverses connected lineage across nodes and edges. Traversal follows epistemic layers: L4 (judgments) \u2192 L3 (beliefs, questions) \u2192 L2 (evidence) \u2192 L1 (sources). Never skips layers. Use direction 'up' to trace what a piece of evidence supports, 'down' to trace what supports a judgment.",
81
+ parameters: {
82
+ startNode: { type: "string", description: "Node to start traversal from" },
83
+ direction: {
84
+ type: "string",
85
+ description: "Traversal direction",
86
+ enum: ["up", "down", "both"]
87
+ },
88
+ maxDepth: {
89
+ type: "number",
90
+ description: "Maximum traversal depth (default: 3)"
91
+ }
92
+ },
93
+ required: ["startNode"],
94
+ response: {
95
+ description: "Subgraph of traversed nodes and edges",
96
+ fields: {
97
+ nodes: "array \u2014 traversed nodes",
98
+ edges: "array \u2014 traversed edges",
99
+ depth: "number"
100
+ }
101
+ },
102
+ ownerModule: "graph-search",
103
+ ontologyPrimitive: "graph",
104
+ tier: "workhorse"
105
+ };
106
+ var GET_GRAPH_NEIGHBORHOOD = {
107
+ name: "get_graph_neighborhood",
108
+ description: "Retrieve the local neighborhood around one or more graph nodes. Like `git log --graph --boundary` for a focused reasoning window. Returns the canonical neighborhood payload shared by HTTP and SDK graph surfaces.",
109
+ parameters: {
110
+ globalId: {
111
+ type: "string",
112
+ description: "Single root node global identifier."
113
+ },
114
+ globalIds: {
115
+ type: "array",
116
+ description: "Optional list of root node global identifiers."
117
+ },
118
+ maxDepth: {
119
+ type: "number",
120
+ description: "Maximum traversal depth (default: 2)."
121
+ }
122
+ },
123
+ required: [],
124
+ response: {
125
+ description: "Canonical graph neighborhood payload",
126
+ fields: {
127
+ nodes: "array \u2014 graph nodes in the returned neighborhood",
128
+ edges: "array \u2014 graph edges in the returned neighborhood",
129
+ depth: "number \u2014 deepest traversed node depth"
130
+ }
131
+ },
132
+ ownerModule: "graph-search",
133
+ ontologyPrimitive: "graph",
134
+ tier: "workhorse"
135
+ };
136
+ var TRACE_ENTITY_IMPACT = {
137
+ name: "trace_entity_impact",
138
+ 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.",
139
+ parameters: {
140
+ nodeId: {
141
+ type: "string",
142
+ description: "Entity node ID to trace impact from"
143
+ }
144
+ },
145
+ required: ["nodeId"],
146
+ response: {
147
+ description: "Entity impact trace: direct beliefs, evidence, and indirect belief reach",
148
+ fields: {
149
+ entityNodeId: "string \u2014 the traced entity",
150
+ entityType: "string \u2014 nodeType of the entity",
151
+ directBeliefConnections: "array \u2014 beliefs directly connected via bridge edges",
152
+ evidenceConnections: "array \u2014 evidence referencing this entity",
153
+ indirectBeliefConnections: "array \u2014 beliefs reached through evidence",
154
+ totalBeliefReach: "number \u2014 total unique beliefs impacted"
155
+ }
156
+ },
157
+ ownerModule: "graph-search",
158
+ ontologyPrimitive: "graph",
159
+ tier: "workhorse"
160
+ };
161
+ var SEARCH_BELIEFS = {
162
+ name: "search_beliefs",
163
+ description: "Search for beliefs in the reasoning graph. Like `git grep` \u2014 finds relevant beliefs across the full history and active state. Supports semantic search, filtering by status (unscored, scored, archived), confidence thresholds, and topic scope. Returns beliefs with their current confidence, lineage depth, and contradiction count.",
164
+ parameters: {
165
+ query: { type: "string", description: "Semantic search query" },
166
+ status: {
167
+ type: "string",
168
+ description: "Filter by belief status",
169
+ enum: ["unscored", "scored", "archived"]
170
+ },
171
+ minConfidence: {
172
+ type: "number",
173
+ description: "Minimum confidence threshold (0-1)"
174
+ },
175
+ topicId: { type: "string", description: "Filter by topic" },
176
+ limit: { type: "number", description: "Maximum results (default: 10)" }
177
+ },
178
+ required: ["query"],
179
+ response: {
180
+ description: "Matching beliefs with metadata",
181
+ fields: {
182
+ results: "array \u2014 { nodeId, canonicalText, confidence, status, contradictionCount }"
183
+ }
184
+ },
185
+ ownerModule: "graph-search",
186
+ ontologyPrimitive: "belief",
187
+ tier: "workhorse"
188
+ };
189
+ var FIND_CONTRADICTIONS = {
190
+ name: "find_contradictions",
191
+ description: "Find contradictions in the reasoning graph \u2014 beliefs that are in tension with each other. Like a merge conflict in `git` \u2014 surfaces incompatible states that require explicit resolution. Contradictions are first-class objects that may remain permanently unresolved. They can block judgments, trigger forks, or collapse confidence. Filter by project, status (unresolved, resolved, accepted), and severity.",
192
+ parameters: {
193
+ topicId: { type: "string", description: "Filter by topic" },
194
+ nodeId: {
195
+ type: "string",
196
+ description: "Find contradictions involving a specific belief"
197
+ },
198
+ status: {
199
+ type: "string",
200
+ description: "Filter by status",
201
+ enum: ["unresolved", "resolved", "accepted"]
202
+ }
203
+ },
204
+ required: [],
205
+ response: {
206
+ description: "Contradiction objects",
207
+ fields: {
208
+ contradictions: "array \u2014 { beliefA, beliefB, description, severity, status, defeatType }"
209
+ }
210
+ },
211
+ ownerModule: "graph-search",
212
+ ontologyPrimitive: "belief",
213
+ tier: "showcase"
214
+ };
215
+ var BISECT_CONFIDENCE = {
216
+ name: "bisect_confidence",
217
+ description: "Find when a belief's confidence diverged from reality. Like `git bisect` \u2014 binary search through the credence history to find the inflection point. Given a belief that is now known to be wrong (or right), traces back through confidence modulations to identify which evidence or event caused the divergence.",
218
+ parameters: {
219
+ nodeId: { type: "string", description: "The belief to bisect" },
220
+ expectedDirection: {
221
+ type: "string",
222
+ description: "Was confidence too high or too low?",
223
+ enum: ["overconfident", "underconfident"]
224
+ },
225
+ timeRange: {
226
+ type: "object",
227
+ description: "Optional time range to search within: { start: number, end: number }"
228
+ }
229
+ },
230
+ required: ["nodeId", "expectedDirection"],
231
+ response: {
232
+ description: "The inflection point in confidence history",
233
+ fields: {
234
+ beliefId: "string \u2014 canonical belief ID",
235
+ expectedDirection: "string \u2014 overconfident | underconfident",
236
+ inflectionEntry: "object \u2014 the confidence modulation where divergence began",
237
+ triggerEvent: "string | null \u2014 what caused the divergence",
238
+ confidenceBefore: "number | null",
239
+ confidenceAfter: "number | null",
240
+ totalEntries: "number",
241
+ inflectionIndex: "number | null"
242
+ }
243
+ },
244
+ ownerModule: "graph-search",
245
+ ontologyPrimitive: "belief",
246
+ tier: "showcase"
247
+ };
248
+ var CREATE_EDGE = {
249
+ name: "create_edge",
250
+ 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.",
251
+ parameters: {
252
+ from: {
253
+ type: "object",
254
+ description: "Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }"
255
+ },
256
+ to: {
257
+ type: "object",
258
+ description: "Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }"
259
+ },
260
+ edgeType: {
261
+ type: "string",
262
+ description: "Relationship type from the public epistemic edge enum."
263
+ },
264
+ globalId: {
265
+ type: "string",
266
+ description: "Optional idempotent edge global ID."
267
+ },
268
+ weight: {
269
+ type: "number",
270
+ description: "Edge weight: -1.0 to +1.0 for informs edges, 0-1 for structural"
271
+ },
272
+ reasoning: { type: "string", description: "Why this relationship exists" },
273
+ reasoningMethod: {
274
+ type: "string",
275
+ description: "How this was determined",
276
+ enum: [...REASONING_METHODS]
277
+ },
278
+ metadata: {
279
+ type: "object",
280
+ description: "Optional edge metadata."
281
+ }
282
+ },
283
+ required: ["from", "to", "edgeType"],
284
+ response: {
285
+ description: "The created edge",
286
+ fields: {
287
+ globalId: "string \u2014 edge identifier",
288
+ edgeType: "string",
289
+ fromLayer: "string",
290
+ toLayer: "string"
291
+ }
292
+ },
293
+ ownerModule: "graph-primitives",
294
+ ontologyPrimitive: "edge",
295
+ tier: "showcase"
296
+ };
297
+ var UPDATE_EDGE = {
298
+ name: "update_edge",
299
+ description: "Amend metadata on an existing graph edge. Like `git commit --amend` \u2014 changes the edge annotation without recreating the relationship.",
300
+ parameters: {
301
+ edgeId: { type: "string", description: "Edge ID or global ID to update" },
302
+ weight: { type: "number", description: "Updated edge weight" },
303
+ confidence: { type: "number", description: "Updated confidence" },
304
+ context: { type: "string", description: "Updated human-readable context" },
305
+ derivationType: { type: "string", description: "Updated derivation type" },
306
+ metadata: { type: "object", description: "Updated metadata" }
307
+ },
308
+ required: ["edgeId"],
309
+ response: {
310
+ description: "Edge update result",
311
+ fields: { success: "boolean" }
312
+ },
313
+ ownerModule: "graph-primitives",
314
+ ontologyPrimitive: "edge",
315
+ tier: "workhorse"
316
+ };
317
+ var REMOVE_EDGE = {
318
+ name: "remove_edge",
319
+ description: "Remove one graph edge by ID. Like `git rm` \u2014 deletes a single explicit relationship from the spine.",
320
+ parameters: {
321
+ edgeId: { type: "string", description: "Edge ID or global ID to remove" }
322
+ },
323
+ required: ["edgeId"],
324
+ response: {
325
+ description: "Edge removal result",
326
+ fields: { success: "boolean" }
327
+ },
328
+ ownerModule: "graph-primitives",
329
+ ontologyPrimitive: "edge",
330
+ tier: "workhorse"
331
+ };
332
+ var REMOVE_EDGES_BETWEEN = {
333
+ name: "remove_edges_between",
334
+ description: "Remove graph edges between two nodes. Like `git rm <pathspec>` \u2014 deletes relationships matching a source, target, and optional type.",
335
+ parameters: {
336
+ fromNodeId: { type: "string", description: "Source node ID or global ID" },
337
+ toNodeId: { type: "string", description: "Target node ID or global ID" },
338
+ edgeType: { type: "string", description: "Optional edge type filter" }
339
+ },
340
+ required: ["fromNodeId", "toNodeId"],
341
+ response: {
342
+ description: "Matched edge removal result",
343
+ fields: { deleted: "number" }
344
+ },
345
+ ownerModule: "graph-primitives",
346
+ ontologyPrimitive: "edge",
347
+ tier: "workhorse"
348
+ };
349
+ var BATCH_CREATE_EDGES = {
350
+ name: "batch_create_edges",
351
+ description: "Commit multiple typed graph edges. Like `git commit` with many staged paths \u2014 writes a batch of explicit relationships atomically per edge.",
352
+ parameters: {
353
+ edges: {
354
+ type: "array",
355
+ description: "Edges to create, each with from, to, edgeType, and optional weight/confidence/context."
356
+ },
357
+ skipLayerValidation: {
358
+ type: "boolean",
359
+ description: "Skip kernel layer validation for trusted materialization flows."
360
+ }
361
+ },
362
+ required: ["edges"],
363
+ response: {
364
+ description: "Batch edge creation result",
365
+ fields: {
366
+ created: "number",
367
+ results: "array",
368
+ errors: "array"
369
+ }
370
+ },
371
+ ownerModule: "graph-primitives",
372
+ ontologyPrimitive: "edge",
373
+ tier: "workhorse"
374
+ };
375
+
376
+ export { BATCH_CREATE_EDGES, BISECT_CONFIDENCE, CREATE_EDGE, FIND_CONTRADICTIONS, GET_AUDIT_TRAIL, GET_CONFIDENCE_HISTORY, GET_GRAPH_NEIGHBORHOOD, QUERY_LINEAGE, REMOVE_EDGE, REMOVE_EDGES_BETWEEN, SEARCH_BELIEFS, TRACE_ENTITY_IMPACT, TRAVERSE_GRAPH, UPDATE_EDGE };
377
+ //# sourceMappingURL=tool-contracts.graph.js.map
378
+ //# sourceMappingURL=tool-contracts.graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/reasoning-method.ts","../src/tool-contracts.graph.ts"],"names":[],"mappings":";AACO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,WAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,UAAA;AAAA,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U,aAAa,6BAAA,EAA8B;AAAA,IACzE,QAAA,EAAU,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,6BAAA,EAA8B;AAAA,IACvE,QAAA,EAAU,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA;AAA4B,GACvE;AAAA,EACA,QAAA,EAAU,CAAC,YAAA,EAAc,UAAU,CAAA;AAAA,EACnC,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,6BAAA;AAAA,IACb,MAAA,EAAQ,EAAE,OAAA,EAAS,QAAA;AAAS,GAC9B;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,MAAA;AAAA,EACnB,IAAA,EAAM;AACR;AAEO,IAAM,kBAAA,GAAsC;AAAA,EACjD,IAAA,EAAM,oBAAA;AAAA,EACN,WAAA,EACE,kJAAA;AAAA,EAEF,UAAA,EAAY;AAAA,IACV,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,OAAA;AAAA,MACN,WAAA,EACE;AAAA,KACJ;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,IAAA,EAAM,SAAA;AAAA,MACN,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,QAAA,EAAU,CAAC,OAAO,CAAA;AAAA,EAClB,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,4BAAA;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,QAAA;AAAA,MACT,OAAA,EAAS,OAAA;AAAA,MACT,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,WAAA,EAAa,kBAAA;AAAA,EACb,iBAAA,EAAmB,MAAA;AAAA,EACnB,IAAA,EAAM;AACR","file":"tool-contracts.graph.js","sourcesContent":["/** Reasoning methods supported by the kernel edge schema. */\nexport const REASONING_METHODS = [\n \"deductive\",\n \"inductive\",\n \"abductive\",\n \"analogical\",\n \"causal\",\n \"correlational\",\n \"testimonial\",\n \"statistical\",\n \"implicit\",\n \"pattern_match\",\n] as const;\n\nexport type ReasoningMethod = (typeof REASONING_METHODS)[number];\n","import type { McpToolContract } from \"./tool-contracts.types\";\nimport { REASONING_METHODS } from \"./api-enums.contract\";\n\nexport const QUERY_LINEAGE: McpToolContract = {\n name: \"query_lineage\",\n description:\n \"Trace a belief's full ancestry — every fork, score, and confidence modulation. \" +\n \"Like `git log --graph`. \" +\n \"Returns the complete evolution chain showing how understanding developed over time. \" +\n \"Lineage is permanent and can never be erased (Invariant #3).\",\n parameters: {\n nodeId: { type: \"string\", description: \"Starting node to trace from\" },\n depth: {\n type: \"number\",\n description: \"How many generations to traverse (default: 5)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Canonical lineage result\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n lineage: \"array — ancestry entries with beliefId, nodeId, formulation, forkReason, and createdAt\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_CONFIDENCE_HISTORY: McpToolContract = {\n name: \"get_confidence_history\",\n description:\n \"Get the full confidence history for a belief. \" +\n \"Each entry records the confidence level, trigger, rationale, and actor. \" +\n \"Like `git log` for a single metric — append-only, never overwritten.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to get history for\" },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Confidence history entries\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n entries: \"array — { confidence, trigger, rationale, timestamp, userId }\",\n nextCursor: \"string | null\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const GET_AUDIT_TRAIL: McpToolContract = {\n name: \"get_audit_trail\",\n description:\n \"Get the full audit trail for a node — every mutation, who made it, when, and why. \" +\n \"Like `git blame` for knowledge. \" +\n \"All state transitions are explicit, attributable, and permanently queryable. \" +\n \"No silent changes are possible (Invariant #14).\",\n parameters: {\n nodeId: { type: \"string\", description: \"The node to audit\" },\n limit: {\n type: \"number\",\n description: \"Maximum entries to return (default: 50)\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description: \"Audit trail entries\",\n fields: {\n entries: \"array — { action, actor, timestamp, before, after, rationale }\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// GRAPH QUERY TOOLS\n// =============================================================================\n\nexport const TRAVERSE_GRAPH: McpToolContract = {\n name: \"traverse_graph\",\n description:\n \"Walk the reasoning graph from a starting node. \" +\n \"Like `git log --graph` — traverses connected lineage across nodes and edges. \" +\n \"Traversal follows epistemic layers: L4 (judgments) → L3 (beliefs, questions) → L2 (evidence) → L1 (sources). \" +\n \"Never skips layers. \" +\n \"Use direction 'up' to trace what a piece of evidence supports, 'down' to trace what supports a judgment.\",\n parameters: {\n startNode: { type: \"string\", description: \"Node to start traversal from\" },\n direction: {\n type: \"string\",\n description: \"Traversal direction\",\n enum: [\"up\", \"down\", \"both\"],\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum traversal depth (default: 3)\",\n },\n },\n required: [\"startNode\"],\n response: {\n description: \"Subgraph of traversed nodes and edges\",\n fields: {\n nodes: \"array — traversed nodes\",\n edges: \"array — traversed edges\",\n depth: \"number\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const GET_GRAPH_NEIGHBORHOOD: McpToolContract = {\n name: \"get_graph_neighborhood\",\n description:\n \"Retrieve the local neighborhood around one or more graph nodes. \" +\n \"Like `git log --graph --boundary` for a focused reasoning window. \" +\n \"Returns the canonical neighborhood payload shared by HTTP and SDK graph surfaces.\",\n parameters: {\n globalId: {\n type: \"string\",\n description: \"Single root node global identifier.\",\n },\n globalIds: {\n type: \"array\",\n description: \"Optional list of root node global identifiers.\",\n },\n maxDepth: {\n type: \"number\",\n description: \"Maximum traversal depth (default: 2).\",\n },\n },\n required: [],\n response: {\n description: \"Canonical graph neighborhood payload\",\n fields: {\n nodes: \"array — graph nodes in the returned neighborhood\",\n edges: \"array — graph edges in the returned neighborhood\",\n depth: \"number — deepest traversed node depth\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const TRACE_ENTITY_IMPACT: McpToolContract = {\n name: \"trace_entity_impact\",\n description:\n \"Returns code-grounded beliefs, contracts, migration states, and failed attempts \" +\n \"anchored to a specific file or function path. \" +\n \"Like `git log -- <path>` — filters the knowledge graph to nodes anchored to a file path \" +\n \"via metadata.codeAnchors. Results are separated by coding belief type: decisions, contracts, \" +\n \"migrations, patterns, deprecations, and failures.\",\n parameters: {\n nodeId: {\n type: \"string\",\n description: \"Entity node ID to trace impact from\",\n },\n },\n required: [\"nodeId\"],\n response: {\n description:\n \"Entity impact trace: direct beliefs, evidence, and indirect belief reach\",\n fields: {\n entityNodeId: \"string — the traced entity\",\n entityType: \"string — nodeType of the entity\",\n directBeliefConnections:\n \"array — beliefs directly connected via bridge edges\",\n evidenceConnections: \"array — evidence referencing this entity\",\n indirectBeliefConnections: \"array — beliefs reached through evidence\",\n totalBeliefReach: \"number — total unique beliefs impacted\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"graph\",\n tier: \"workhorse\",\n};\n\nexport const SEARCH_BELIEFS: McpToolContract = {\n name: \"search_beliefs\",\n description:\n \"Search for beliefs in the reasoning graph. \" +\n \"Like `git grep` — finds relevant beliefs across the full history and active state. \" +\n \"Supports semantic search, filtering by status (unscored, scored, archived), \" +\n \"confidence thresholds, and topic scope. \" +\n \"Returns beliefs with their current confidence, lineage depth, and contradiction count.\",\n parameters: {\n query: { type: \"string\", description: \"Semantic search query\" },\n status: {\n type: \"string\",\n description: \"Filter by belief status\",\n enum: [\"unscored\", \"scored\", \"archived\"],\n },\n minConfidence: {\n type: \"number\",\n description: \"Minimum confidence threshold (0-1)\",\n },\n topicId: { type: \"string\", description: \"Filter by topic\" },\n limit: { type: \"number\", description: \"Maximum results (default: 10)\" },\n },\n required: [\"query\"],\n response: {\n description: \"Matching beliefs with metadata\",\n fields: {\n results:\n \"array — { nodeId, canonicalText, confidence, status, contradictionCount }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"workhorse\",\n};\n\nexport const FIND_CONTRADICTIONS: McpToolContract = {\n name: \"find_contradictions\",\n description:\n \"Find contradictions in the reasoning graph — beliefs that are in tension with each other. \" +\n \"Like a merge conflict in `git` — surfaces incompatible states that require explicit resolution. \" +\n \"Contradictions are first-class objects that may remain permanently unresolved. \" +\n \"They can block judgments, trigger forks, or collapse confidence. \" +\n \"Filter by project, status (unresolved, resolved, accepted), and severity.\",\n parameters: {\n topicId: { type: \"string\", description: \"Filter by topic\" },\n nodeId: {\n type: \"string\",\n description: \"Find contradictions involving a specific belief\",\n },\n status: {\n type: \"string\",\n description: \"Filter by status\",\n enum: [\"unresolved\", \"resolved\", \"accepted\"],\n },\n },\n required: [],\n response: {\n description: \"Contradiction objects\",\n fields: {\n contradictions:\n \"array — { beliefA, beliefB, description, severity, status, defeatType }\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// EDGE TOOLS\n// =============================================================================\n\nexport const BISECT_CONFIDENCE: McpToolContract = {\n name: \"bisect_confidence\",\n description:\n \"Find when a belief's confidence diverged from reality. \" +\n \"Like `git bisect` — binary search through the credence history to find the inflection point. \" +\n \"Given a belief that is now known to be wrong (or right), traces back through \" +\n \"confidence modulations to identify which evidence or event caused the divergence.\",\n parameters: {\n nodeId: { type: \"string\", description: \"The belief to bisect\" },\n expectedDirection: {\n type: \"string\",\n description: \"Was confidence too high or too low?\",\n enum: [\"overconfident\", \"underconfident\"],\n },\n timeRange: {\n type: \"object\",\n description:\n \"Optional time range to search within: { start: number, end: number }\",\n },\n },\n required: [\"nodeId\", \"expectedDirection\"],\n response: {\n description: \"The inflection point in confidence history\",\n fields: {\n beliefId: \"string — canonical belief ID\",\n expectedDirection: \"string — overconfident | underconfident\",\n inflectionEntry:\n \"object — the confidence modulation where divergence began\",\n triggerEvent: \"string | null — what caused the divergence\",\n confidenceBefore: \"number | null\",\n confidenceAfter: \"number | null\",\n totalEntries: \"number\",\n inflectionIndex: \"number | null\",\n },\n },\n ownerModule: \"graph-search\",\n ontologyPrimitive: \"belief\",\n tier: \"showcase\",\n};\n\n// =============================================================================\n// GRAPH INTELLIGENCE TOOLS\n// =============================================================================\n\nexport const CREATE_EDGE: McpToolContract = {\n name: \"create_edge\",\n description:\n \"Commit a typed relationship between two nodes in the reasoning graph. \" +\n \"Like `git commit` — an atomic write that declares a dependency between nodes. \" +\n \"Accepts any public epistemic edge type between public graph node refs so agents can author the full spine.\",\n parameters: {\n from: {\n type: \"object\",\n description:\n \"Source graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'topic' }\",\n },\n to: {\n type: \"object\",\n description:\n \"Target graph ref, e.g. { kind: 'epistemic_node', nodeId: '...', nodeType: 'belief' }\",\n },\n edgeType: {\n type: \"string\",\n description:\n \"Relationship type from the public epistemic edge enum.\",\n },\n globalId: {\n type: \"string\",\n description: \"Optional idempotent edge global ID.\",\n },\n weight: {\n type: \"number\",\n description:\n \"Edge weight: -1.0 to +1.0 for informs edges, 0-1 for structural\",\n },\n reasoning: { type: \"string\", description: \"Why this relationship exists\" },\n reasoningMethod: {\n type: \"string\",\n description: \"How this was determined\",\n enum: [...REASONING_METHODS],\n },\n metadata: {\n type: \"object\",\n description: \"Optional edge metadata.\",\n },\n },\n required: [\"from\", \"to\", \"edgeType\"],\n response: {\n description: \"The created edge\",\n fields: {\n globalId: \"string — edge identifier\",\n edgeType: \"string\",\n fromLayer: \"string\",\n toLayer: \"string\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"showcase\",\n};\n\nexport const UPDATE_EDGE: McpToolContract = {\n name: \"update_edge\",\n description:\n \"Amend metadata on an existing graph edge. \" +\n \"Like `git commit --amend` — changes the edge annotation without recreating the relationship.\",\n parameters: {\n edgeId: { type: \"string\", description: \"Edge ID or global ID to update\" },\n weight: { type: \"number\", description: \"Updated edge weight\" },\n confidence: { type: \"number\", description: \"Updated confidence\" },\n context: { type: \"string\", description: \"Updated human-readable context\" },\n derivationType: { type: \"string\", description: \"Updated derivation type\" },\n metadata: { type: \"object\", description: \"Updated metadata\" },\n },\n required: [\"edgeId\"],\n response: {\n description: \"Edge update result\",\n fields: { success: \"boolean\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const REMOVE_EDGE: McpToolContract = {\n name: \"remove_edge\",\n description:\n \"Remove one graph edge by ID. \" +\n \"Like `git rm` — deletes a single explicit relationship from the spine.\",\n parameters: {\n edgeId: { type: \"string\", description: \"Edge ID or global ID to remove\" },\n },\n required: [\"edgeId\"],\n response: {\n description: \"Edge removal result\",\n fields: { success: \"boolean\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const REMOVE_EDGES_BETWEEN: McpToolContract = {\n name: \"remove_edges_between\",\n description:\n \"Remove graph edges between two nodes. \" +\n \"Like `git rm <pathspec>` — deletes relationships matching a source, target, and optional type.\",\n parameters: {\n fromNodeId: { type: \"string\", description: \"Source node ID or global ID\" },\n toNodeId: { type: \"string\", description: \"Target node ID or global ID\" },\n edgeType: { type: \"string\", description: \"Optional edge type filter\" },\n },\n required: [\"fromNodeId\", \"toNodeId\"],\n response: {\n description: \"Matched edge removal result\",\n fields: { deleted: \"number\" },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\nexport const BATCH_CREATE_EDGES: McpToolContract = {\n name: \"batch_create_edges\",\n description:\n \"Commit multiple typed graph edges. \" +\n \"Like `git commit` with many staged paths — writes a batch of explicit relationships atomically per edge.\",\n parameters: {\n edges: {\n type: \"array\",\n description:\n \"Edges to create, each with from, to, edgeType, and optional weight/confidence/context.\",\n },\n skipLayerValidation: {\n type: \"boolean\",\n description: \"Skip kernel layer validation for trusted materialization flows.\",\n },\n },\n required: [\"edges\"],\n response: {\n description: \"Batch edge creation result\",\n fields: {\n created: \"number\",\n results: \"array\",\n errors: \"array\",\n },\n },\n ownerModule: \"graph-primitives\",\n ontologyPrimitive: \"edge\",\n tier: \"workhorse\",\n};\n\n// =============================================================================\n// EPISTEMIC NODE TOOLS\n// =============================================================================\n"]}
@@ -0,0 +1,15 @@
1
+ import { McpToolContract } from './tool-contracts.types.js';
2
+
3
+ declare const DETECT_CONFIRMATION_BIAS: McpToolContract;
4
+ declare const GET_GRAPH_STRUCTURE_ANALYSIS: McpToolContract;
5
+ declare const LIST_GRAPH_INTELLIGENCE_QUERIES: McpToolContract;
6
+ declare const RUN_GRAPH_INTELLIGENCE_QUERY: McpToolContract;
7
+ declare const GET_FALSIFICATION_QUESTIONS: McpToolContract;
8
+ declare const SEARCH_EVIDENCE: McpToolContract;
9
+ declare const CREATE_EVIDENCE: McpToolContract;
10
+ declare const GET_EVIDENCE: McpToolContract;
11
+ declare const LIST_EVIDENCE: McpToolContract;
12
+ declare const LINK_EVIDENCE: McpToolContract;
13
+ declare const LINK_EVIDENCE_TO_BELIEF: McpToolContract;
14
+
15
+ export { CREATE_EVIDENCE, DETECT_CONFIRMATION_BIAS, GET_EVIDENCE, GET_FALSIFICATION_QUESTIONS, GET_GRAPH_STRUCTURE_ANALYSIS, LINK_EVIDENCE, LINK_EVIDENCE_TO_BELIEF, LIST_EVIDENCE, LIST_GRAPH_INTELLIGENCE_QUERIES, RUN_GRAPH_INTELLIGENCE_QUERY, SEARCH_EVIDENCE };