@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,740 @@
1
+ // src/tool-contracts.policy-observation-task-topic.ts
2
+ var CHECK_PERMISSION = {
3
+ name: "check_permission",
4
+ description: "Check whether a principal can read or mutate a topic scope. Like `git check-ref-format` for ACLs \u2014 validates whether the requested operation is allowed before execution.",
5
+ parameters: {
6
+ topicId: { type: "string", description: "Topic scope to evaluate" },
7
+ permission: {
8
+ type: "string",
9
+ description: "Permission to evaluate",
10
+ enum: ["read", "write"]
11
+ },
12
+ principal: {
13
+ type: "string",
14
+ description: "Optional principal override (defaults to current principal)"
15
+ },
16
+ beliefClusterId: {
17
+ type: "string",
18
+ description: "Optional neighborhood scope within a topic"
19
+ }
20
+ },
21
+ required: ["topicId", "permission"],
22
+ response: {
23
+ description: "Permission evaluation result",
24
+ fields: {
25
+ allowed: "boolean",
26
+ decision: "string \u2014 allow | deny",
27
+ reasonCode: "string",
28
+ principalId: "string",
29
+ topicId: "string",
30
+ permission: "string \u2014 read | write"
31
+ }
32
+ },
33
+ ownerModule: "access-control",
34
+ ontologyPrimitive: "policy",
35
+ tier: "workhorse"
36
+ };
37
+ var FILTER_BY_PERMISSION = {
38
+ name: "filter_by_permission",
39
+ description: "Filter a topic set down to ACL-authorized topics. Like `git rev-list --ancestry-path` for policy boundaries \u2014 keeps only topics permitted for the requested action.",
40
+ parameters: {
41
+ topicIds: { type: "array", description: "Topic IDs to evaluate" },
42
+ permission: {
43
+ type: "string",
44
+ description: "Permission filter",
45
+ enum: ["read", "write"]
46
+ },
47
+ principal: {
48
+ type: "string",
49
+ description: "Optional principal override (tenant admin only)"
50
+ }
51
+ },
52
+ required: ["topicIds", "permission"],
53
+ response: {
54
+ description: "Allowed/denied split for the requested topic set",
55
+ fields: {
56
+ permission: "string \u2014 read | write",
57
+ allowedTopicIds: "array \u2014 topic IDs allowed by policy",
58
+ deniedTopics: "array \u2014 { topicId, reasonCode }",
59
+ count: "number"
60
+ }
61
+ },
62
+ ownerModule: "access-control",
63
+ ontologyPrimitive: "policy",
64
+ tier: "workhorse"
65
+ };
66
+ var INGEST_OBSERVATION = {
67
+ name: "ingest_observation",
68
+ description: "Record an observational delta for a topic context stream. Like `git notes add` \u2014 attaches structured observation metadata without mutating graph state directly. Used by watcher/cowork agents to stage candidate updates before explicit write confirmation.",
69
+ parameters: {
70
+ topicId: {
71
+ type: "string",
72
+ description: "Optional topic scope hint for the observation"
73
+ },
74
+ observationType: {
75
+ type: "string",
76
+ description: "Observation class",
77
+ enum: [
78
+ "claim",
79
+ "evidence",
80
+ "question",
81
+ "contradiction",
82
+ "judgment",
83
+ "note"
84
+ ]
85
+ },
86
+ summary: {
87
+ type: "string",
88
+ description: "Human-readable observation summary"
89
+ },
90
+ source: {
91
+ type: "string",
92
+ description: "Optional source (message ID, tool name, URL, etc.)"
93
+ },
94
+ confidence: { type: "number", description: "Optional confidence in [0,1]" },
95
+ tags: { type: "array", description: "Optional observation tags" },
96
+ metadata: {
97
+ type: "object",
98
+ description: "Optional structured metadata payload"
99
+ }
100
+ },
101
+ required: ["observationType", "summary"],
102
+ response: {
103
+ description: "Recorded observation entry",
104
+ fields: {
105
+ observationId: "string",
106
+ topicId: "string",
107
+ observationType: "string",
108
+ createdAt: "number",
109
+ contextResourceUri: "string"
110
+ }
111
+ },
112
+ ownerModule: "agent-frameworks",
113
+ ontologyPrimitive: "graph",
114
+ tier: "workhorse"
115
+ };
116
+ var GET_OBSERVATION_CONTEXT = {
117
+ name: "get_observation_context",
118
+ description: "Retrieve observer-ready context for a topic, including recent deltas and semantic matches. Like `git log --grep` \u2014 shows recent context and filtered matches across observation history. This powers prompt context injection without mutating graph state.",
119
+ parameters: {
120
+ topicId: { type: "string", description: "Optional topic scope hint" },
121
+ query: {
122
+ type: "string",
123
+ description: "Optional semantic query over observation history"
124
+ },
125
+ limit: {
126
+ type: "number",
127
+ description: "Maximum entries in each returned collection"
128
+ }
129
+ },
130
+ required: ["topicId"],
131
+ response: {
132
+ description: "Observation context payload",
133
+ fields: {
134
+ topicId: "string",
135
+ totalObservations: "number",
136
+ latest: "array",
137
+ semanticMatches: "array",
138
+ byType: "object",
139
+ generatedAt: "number"
140
+ }
141
+ },
142
+ ownerModule: "agent-frameworks",
143
+ ontologyPrimitive: "graph",
144
+ tier: "workhorse"
145
+ };
146
+ var CREATE_TASK = {
147
+ name: "create_task",
148
+ description: "Create an execution task tied to the reasoning state. Like `git task` \u2014 tracks concrete work items (calls to make, data to gather, analyses to run) linked to questions, beliefs, or worktrees.",
149
+ parameters: {
150
+ title: { type: "string", description: "Task title" },
151
+ topicId: { type: "string", description: "Topic scope" },
152
+ description: {
153
+ type: "string",
154
+ description: "Long-form task description"
155
+ },
156
+ taskType: {
157
+ type: "string",
158
+ description: "Task taxonomy",
159
+ enum: [
160
+ "general",
161
+ "find_evidence",
162
+ "verify_claim",
163
+ "research",
164
+ "review",
165
+ "interview",
166
+ "analysis",
167
+ "track_metrics"
168
+ ]
169
+ },
170
+ priority: {
171
+ type: "string",
172
+ description: "Priority",
173
+ enum: ["urgent", "high", "medium", "low"]
174
+ },
175
+ status: {
176
+ type: "string",
177
+ description: "Initial status (defaults to todo)",
178
+ enum: ["todo", "in_progress", "blocked", "done"]
179
+ },
180
+ linkedWorktreeId: {
181
+ type: "string",
182
+ description: "Worktree this task belongs to"
183
+ },
184
+ linkedBeliefId: {
185
+ type: "string",
186
+ description: "Belief this task supports"
187
+ },
188
+ linkedQuestionId: {
189
+ type: "string",
190
+ description: "Question this task addresses"
191
+ },
192
+ assigneeId: {
193
+ type: "string",
194
+ description: "Principal assigned to the task"
195
+ },
196
+ dueDate: {
197
+ type: "number",
198
+ description: "Due date as epoch milliseconds"
199
+ },
200
+ tags: {
201
+ type: "array",
202
+ description: "Free-form string tags"
203
+ },
204
+ metadata: {
205
+ type: "object",
206
+ description: "Structured task metadata for handoff context and routing hints"
207
+ }
208
+ },
209
+ required: ["title"],
210
+ response: {
211
+ description: "The created task",
212
+ fields: {
213
+ taskId: "string",
214
+ status: "string \u2014 'pending'",
215
+ createdAt: "number"
216
+ }
217
+ },
218
+ ownerModule: "workflow-engine",
219
+ ontologyPrimitive: "task",
220
+ tier: "workhorse"
221
+ };
222
+ var COMPLETE_TASK = {
223
+ name: "complete_task",
224
+ description: "Mark a task as complete with an output summary. Like `git tag` for work items \u2014 records the discrete completion event and captures what was learned. Completed tasks feed back into the evidence graph.",
225
+ parameters: {
226
+ taskId: { type: "string", description: "The task to complete" },
227
+ outputSummary: {
228
+ type: "string",
229
+ description: "What was accomplished or learned"
230
+ },
231
+ evidenceCreated: {
232
+ type: "boolean",
233
+ description: "Whether new evidence was created from this task"
234
+ }
235
+ },
236
+ required: ["taskId", "outputSummary"],
237
+ response: {
238
+ description: "The completed task",
239
+ fields: {
240
+ taskId: "string",
241
+ completedAt: "number",
242
+ outputSummary: "string"
243
+ }
244
+ },
245
+ ownerModule: "workflow-engine",
246
+ ontologyPrimitive: "task",
247
+ tier: "workhorse"
248
+ };
249
+ var UPDATE_TASK = {
250
+ name: "update_task",
251
+ description: "Update a task's fields \u2014 relink to a different worktree, belief, or question, change title/priority/status. Like `git task edit` \u2014 mutates an existing task in place instead of requiring recreate-plus-supersede.",
252
+ parameters: {
253
+ taskId: { type: "string", description: "The task to update" },
254
+ linkedWorktreeId: {
255
+ type: "string",
256
+ description: "Reassign this task to a different worktree"
257
+ },
258
+ linkedBeliefId: {
259
+ type: "string",
260
+ description: "Link or relink this task to a belief node"
261
+ },
262
+ linkedQuestionId: {
263
+ type: "string",
264
+ description: "Link or relink this task to a question node"
265
+ },
266
+ title: { type: "string", description: "Updated task title" },
267
+ description: {
268
+ type: "string",
269
+ description: "Updated task description"
270
+ },
271
+ priority: {
272
+ type: "string",
273
+ description: "Updated priority",
274
+ enum: ["critical", "high", "medium", "low"]
275
+ },
276
+ status: {
277
+ type: "string",
278
+ description: "Updated status",
279
+ enum: ["todo", "in_progress", "blocked", "done"]
280
+ },
281
+ metadata: {
282
+ type: "object",
283
+ description: "Structured task metadata to replace or refine"
284
+ }
285
+ },
286
+ required: ["taskId"],
287
+ response: {
288
+ description: "The updated task",
289
+ fields: {
290
+ taskId: "string",
291
+ updatedAt: "number"
292
+ }
293
+ },
294
+ ownerModule: "workflow-engine",
295
+ ontologyPrimitive: "task",
296
+ tier: "workhorse"
297
+ };
298
+ var LIST_TASKS = {
299
+ name: "list_tasks",
300
+ description: "List tasks for a topic or worktree. Like `git task list` \u2014 returns tasks with status, priority, and linked nodes. Filter by worktree to see tasks for a specific investigation, or by status to find incomplete work.",
301
+ parameters: {
302
+ topicId: { type: "string", description: "Topic scope" },
303
+ linkedWorktreeId: {
304
+ type: "string",
305
+ description: "Filter to tasks linked to this worktree"
306
+ },
307
+ worktreeId: {
308
+ type: "string",
309
+ description: "Alias for linkedWorktreeId"
310
+ },
311
+ status: {
312
+ type: "string",
313
+ description: "Filter by status: todo, in_progress, blocked, done",
314
+ enum: ["todo", "in_progress", "blocked", "done"]
315
+ },
316
+ limit: { type: "number", description: "Maximum results (default: 100)" }
317
+ },
318
+ required: ["topicId"],
319
+ response: {
320
+ description: "List of tasks with metadata",
321
+ fields: { tasks: "array of task objects", count: "number" }
322
+ },
323
+ ownerModule: "workflow-engine",
324
+ ontologyPrimitive: "task",
325
+ tier: "workhorse"
326
+ };
327
+ var CREATE_TOPIC = {
328
+ name: "create_topic",
329
+ 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.",
330
+ parameters: {
331
+ globalId: {
332
+ type: "string",
333
+ description: "Optional idempotent topic global ID"
334
+ },
335
+ name: { type: "string", description: "Topic name" },
336
+ type: {
337
+ type: "string",
338
+ description: "Topic type. Validated against schemaEnumConfig category 'topic_type'."
339
+ },
340
+ description: { type: "string", description: "What this topic covers" },
341
+ parentTopicId: {
342
+ type: "string",
343
+ description: "Optional parent topic for nesting"
344
+ },
345
+ parentTopicGlobalId: {
346
+ type: "string",
347
+ description: "Optional parent topic global ID for nesting"
348
+ },
349
+ tenantId: { type: "string", description: "Optional tenant scope" },
350
+ workspaceId: { type: "string", description: "Optional workspace scope" },
351
+ visibility: {
352
+ type: "string",
353
+ description: "Topic visibility",
354
+ enum: ["private", "team", "firm", "external", "public"]
355
+ },
356
+ metadata: { type: "object", description: "Optional topic metadata" },
357
+ createdBy: { type: "string", description: "Who created this topic" }
358
+ },
359
+ required: ["name", "type"],
360
+ response: {
361
+ description: "The created topic",
362
+ fields: {
363
+ id: "string \u2014 topic ID",
364
+ globalId: "string \u2014 globally unique ID",
365
+ topicGlobalId: "string \u2014 topic global ID",
366
+ epistemicNodeId: "string \u2014 materialized topic node ID",
367
+ epistemicNodeGlobalId: "string \u2014 materialized topic node global ID",
368
+ depth: "number \u2014 nesting depth"
369
+ }
370
+ },
371
+ ownerModule: "reasoning-kernel",
372
+ ontologyPrimitive: "graph",
373
+ tier: "showcase"
374
+ };
375
+ var LIST_TOPICS = {
376
+ name: "list_topics",
377
+ description: "List topics, optionally filtered by type or parent. Like `git remote -v` \u2014 shows all knowledge containers with their types and hierarchy.",
378
+ parameters: {
379
+ type: {
380
+ type: "string",
381
+ description: "Filter by topic type (e.g., 'theme', 'deal')"
382
+ },
383
+ parentTopicId: {
384
+ type: "string",
385
+ description: "Filter to children of this parent"
386
+ },
387
+ status: {
388
+ type: "string",
389
+ description: "Filter by status",
390
+ enum: ["active", "archived", "watching"]
391
+ }
392
+ },
393
+ required: [],
394
+ response: {
395
+ description: "List of topics with metadata",
396
+ fields: {
397
+ topics: "array \u2014 { id, name, type, depth, status, parentTopicId }"
398
+ }
399
+ },
400
+ ownerModule: "reasoning-kernel",
401
+ ontologyPrimitive: "graph",
402
+ tier: "workhorse"
403
+ };
404
+ var GET_TOPIC = {
405
+ name: "get_topic",
406
+ description: "Get one topic by ID. Like `git remote show origin` \u2014 inspects a single knowledge container in detail.",
407
+ parameters: {
408
+ topicId: {
409
+ type: "string",
410
+ description: "Canonical topic ID to retrieve"
411
+ },
412
+ id: {
413
+ type: "string",
414
+ description: "Legacy alias for topicId"
415
+ }
416
+ },
417
+ required: ["topicId"],
418
+ response: {
419
+ description: "Single topic record",
420
+ fields: {
421
+ topic: "object \u2014 { id, globalId, name, type, depth, status, parentTopicId, description }"
422
+ }
423
+ },
424
+ ownerModule: "reasoning-kernel",
425
+ ontologyPrimitive: "graph",
426
+ tier: "workhorse"
427
+ };
428
+ var UPDATE_TOPIC = {
429
+ name: "update_topic",
430
+ description: "Update an existing topic's metadata. Like `git remote set-url` \u2014 changes the canonical configuration for a knowledge container without recreating it.",
431
+ parameters: {
432
+ topicId: {
433
+ type: "string",
434
+ description: "Canonical topic ID to update"
435
+ },
436
+ id: {
437
+ type: "string",
438
+ description: "Legacy alias for topicId"
439
+ },
440
+ name: { type: "string", description: "Updated topic name" },
441
+ description: { type: "string", description: "Updated topic description" },
442
+ type: {
443
+ type: "string",
444
+ description: "Updated topic type. Validated against schemaEnumConfig category 'topic_type'."
445
+ },
446
+ ontologyId: {
447
+ type: "string",
448
+ description: "Updated ontology binding"
449
+ },
450
+ clearOntologyId: {
451
+ type: "boolean",
452
+ description: "Clear the current ontology binding"
453
+ },
454
+ status: {
455
+ type: "string",
456
+ description: "Updated topic status",
457
+ enum: ["active", "archived", "watching"]
458
+ },
459
+ visibility: {
460
+ type: "string",
461
+ description: "Updated topic visibility",
462
+ enum: ["private", "team", "firm", "external", "public"]
463
+ }
464
+ },
465
+ required: [],
466
+ response: {
467
+ description: "The updated topic",
468
+ fields: {
469
+ id: "string \u2014 topic ID",
470
+ globalId: "string \u2014 globally unique ID",
471
+ status: "string \u2014 topic lifecycle status",
472
+ visibility: "string \u2014 topic visibility"
473
+ }
474
+ },
475
+ ownerModule: "reasoning-kernel",
476
+ ontologyPrimitive: "graph",
477
+ tier: "workhorse"
478
+ };
479
+ var GET_TOPIC_TREE = {
480
+ name: "get_topic_tree",
481
+ description: "Get the full topic hierarchy from a root. Like `git log --graph --all` \u2014 shows the complete tree of nested topics.",
482
+ parameters: {
483
+ rootId: { type: "string", description: "Root topic to start from" },
484
+ maxDepth: {
485
+ type: "number",
486
+ description: "Maximum depth to traverse (default: 5)"
487
+ }
488
+ },
489
+ required: ["rootId"],
490
+ response: {
491
+ description: "Tree of topics with nesting",
492
+ fields: { tree: "array \u2014 topics in BFS order with depth and path" }
493
+ },
494
+ ownerModule: "reasoning-kernel",
495
+ ontologyPrimitive: "graph",
496
+ tier: "workhorse"
497
+ };
498
+ var MATERIALIZE_TOPIC_GRAPH = {
499
+ name: "materialize_topic_graph",
500
+ description: "Backfill the topic graph spine. Like `git fsck --connectivity-only` with repair enabled \u2014 creates missing topic nodes and parent-child edges idempotently.",
501
+ parameters: {
502
+ rootTopicId: {
503
+ type: "string",
504
+ description: "Optional root topic for a bounded materialization pass"
505
+ },
506
+ dryRun: {
507
+ type: "boolean",
508
+ description: "When true, report missing rows without writing them"
509
+ }
510
+ },
511
+ required: [],
512
+ response: {
513
+ description: "Topic graph materialization counts",
514
+ fields: {
515
+ topicsSeen: "number",
516
+ nodesCreated: "number",
517
+ nodesExisting: "number",
518
+ edgesCreated: "number",
519
+ edgesExisting: "number",
520
+ errors: "array"
521
+ }
522
+ },
523
+ ownerModule: "reasoning-kernel",
524
+ ontologyPrimitive: "graph",
525
+ tier: "workhorse"
526
+ };
527
+ var GET_TOPIC_GRAPH_SPINE = {
528
+ name: "get_topic_graph_spine",
529
+ description: "Verify the topic graph spine. Like `git fsck` \u2014 reads topics, materialized topic nodes, parent-child edges, and missing spine rows.",
530
+ parameters: {
531
+ rootTopicId: {
532
+ type: "string",
533
+ description: "Optional root topic for a bounded verifier pass"
534
+ },
535
+ includeTopicBeliefEdges: {
536
+ type: "boolean",
537
+ description: "Include topic -> belief edges in the verifier payload"
538
+ }
539
+ },
540
+ required: [],
541
+ response: {
542
+ description: "Topic graph spine verification payload",
543
+ fields: {
544
+ ok: "boolean",
545
+ counts: "object",
546
+ topics: "array",
547
+ topicNodes: "array",
548
+ parentEdges: "array",
549
+ missingTopicNodes: "array",
550
+ missingParentEdges: "array"
551
+ }
552
+ },
553
+ ownerModule: "reasoning-kernel",
554
+ ontologyPrimitive: "graph",
555
+ tier: "workhorse"
556
+ };
557
+ var GET_CODE_CONTEXT = {
558
+ name: "get_code_context",
559
+ 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.",
560
+ parameters: {
561
+ filePath: {
562
+ type: "string",
563
+ description: "File path to search for (partial matches supported, e.g. 'epistemicBeliefs.ts' or 'convex/epistemicBeliefs.ts')"
564
+ },
565
+ topicId: {
566
+ type: "string",
567
+ description: "Topic scope (optional, uses default if not provided)"
568
+ },
569
+ includeFailures: {
570
+ type: "boolean",
571
+ description: "Whether to include failed attempt evidence (default: true)"
572
+ }
573
+ },
574
+ required: ["filePath"],
575
+ response: {
576
+ description: "Code-anchored beliefs and evidence grouped by type",
577
+ fields: {
578
+ filePath: "string \u2014 queried path",
579
+ decisions: "array \u2014 implementation_decision beliefs",
580
+ contracts: "array \u2014 interface_contract beliefs",
581
+ migrations: "array \u2014 migration_state beliefs",
582
+ patterns: "array \u2014 code_pattern beliefs",
583
+ deprecations: "array \u2014 deprecation_notice beliefs",
584
+ failures: "array \u2014 failed attempt evidence",
585
+ totalMatched: "number"
586
+ }
587
+ },
588
+ ownerModule: "coding-intelligence",
589
+ ontologyPrimitive: "belief",
590
+ tier: "showcase"
591
+ };
592
+ var GET_CHANGE_HISTORY = {
593
+ name: "get_change_history",
594
+ description: "Returns recent changes and decisions for a file path \u2014 the 'why' behind recent code changes. Like `git log --follow <path>` \u2014 shows the evolution of understanding anchored to a specific file. Searches beliefs and evidence updated recently, sorted by most recent first.",
595
+ parameters: {
596
+ filePath: { type: "string", description: "File path to get history for" },
597
+ topicId: { type: "string", description: "Topic scope (optional)" },
598
+ limit: { type: "number", description: "Max results (default: 10)" }
599
+ },
600
+ required: ["filePath"],
601
+ response: {
602
+ description: "Recent code-anchored changes sorted by recency",
603
+ fields: {
604
+ filePath: "string \u2014 queried path",
605
+ changes: "array \u2014 nodes with coding view (nodeId, beliefType, canonicalText, codeAnchors, timestamps)",
606
+ totalFound: "number",
607
+ showing: "number"
608
+ }
609
+ },
610
+ ownerModule: "coding-intelligence",
611
+ ontologyPrimitive: "belief",
612
+ tier: "workhorse"
613
+ };
614
+ var RECORD_ATTEMPT = {
615
+ name: "record_attempt",
616
+ description: "Log a failed approach as evidence linked to a belief. Like `git stash` for failed experiments \u2014 preserves what was tried so the same mistake isn't repeated. Creates evidence with metadata.failedApproach=true and metadata.codeAnchors. The key anti-repetition mechanism: future agents check the failure log before trying new approaches.",
617
+ parameters: {
618
+ description: {
619
+ type: "string",
620
+ description: "What was attempted and why it failed"
621
+ },
622
+ filePaths: {
623
+ type: "array",
624
+ description: "File paths involved in the attempt"
625
+ },
626
+ errorMessage: {
627
+ type: "string",
628
+ description: "Error message or failure reason"
629
+ },
630
+ linkedBeliefId: {
631
+ type: "string",
632
+ description: "Belief this attempt was targeting (creates -0.5 weight edge)"
633
+ },
634
+ topicId: { type: "string", description: "Topic scope (optional)" }
635
+ },
636
+ required: ["description"],
637
+ response: {
638
+ description: "The recorded failed attempt evidence node",
639
+ fields: {
640
+ nodeId: "string \u2014 evidence node ID",
641
+ edgeId: "string | null \u2014 edge to linked belief",
642
+ recorded: "boolean \u2014 true",
643
+ filePaths: "array \u2014 anchored file paths"
644
+ }
645
+ },
646
+ ownerModule: "coding-intelligence",
647
+ ontologyPrimitive: "evidence",
648
+ tier: "showcase"
649
+ };
650
+ var GET_FAILURE_LOG = {
651
+ name: "get_failure_log",
652
+ description: "Search past failed attempts matching a task description. Like `git log --grep='FAILED'` \u2014 finds evidence of what was tried before and didn't work. Before trying a new approach, check this log to avoid repeating the same mistake. Filters to evidence with metadata.failedApproach=true, sorted by recency.",
653
+ parameters: {
654
+ query: {
655
+ type: "string",
656
+ description: "Description of the task or approach to search for"
657
+ },
658
+ filePath: {
659
+ type: "string",
660
+ description: "Optional file path to narrow results"
661
+ },
662
+ topicId: { type: "string", description: "Topic scope (optional)" },
663
+ limit: { type: "number", description: "Max results (default: 5)" }
664
+ },
665
+ required: ["query"],
666
+ response: {
667
+ description: "Failed attempts matching the query",
668
+ fields: {
669
+ query: "string \u2014 search query",
670
+ failures: "array \u2014 failed attempt evidence with coding view",
671
+ totalFound: "number",
672
+ showing: "number"
673
+ }
674
+ },
675
+ ownerModule: "coding-intelligence",
676
+ ontologyPrimitive: "evidence",
677
+ tier: "showcase"
678
+ };
679
+ var GET_TOPIC_COVERAGE = {
680
+ name: "get_topic_coverage",
681
+ description: "Returns per-topic belief/question/evidence counts across the topic tree. Like `git diff --stat` for the knowledge graph \u2014 shows coverage density and empty spots across the topic hierarchy. Use to identify which topics need more beliefs, which lack questions, and overall graph health.",
682
+ parameters: {
683
+ topicId: {
684
+ type: "string",
685
+ description: "Topic scope ID (optional, uses default if not provided)"
686
+ },
687
+ includeDescendants: {
688
+ type: "boolean",
689
+ description: "Whether to include descendant topics in the coverage report (default: true)"
690
+ },
691
+ maxDepth: {
692
+ type: "number",
693
+ description: "Maximum descendant topic depth for neighborhood expansion. Defaults to 4 for root/theme scopes, 2 for deeper scopes."
694
+ }
695
+ },
696
+ required: [],
697
+ response: {
698
+ description: "Per-topic coverage metrics and aggregate summary",
699
+ fields: {
700
+ topics: "array \u2014 per-topic { topicId, name, type, depth, beliefs, questions, evidence, coverage }",
701
+ summary: "object \u2014 { totalTopics, coveredTopics, emptyTopics, coveragePercent, totalBeliefs, totalQuestions, totalEvidence }",
702
+ scopeTopicId: "string \u2014 the root topic used for scoping"
703
+ }
704
+ },
705
+ ownerModule: "coverage-intelligence",
706
+ ontologyPrimitive: "graph",
707
+ tier: "showcase"
708
+ };
709
+ var GET_GRAPH_GAPS = {
710
+ name: "get_graph_gaps",
711
+ description: "Identify structural gaps in the knowledge graph \u2014 empty topics, beliefs without questions, beliefs without evidence, and orphan edges. Like `git fsck` for reasoning coverage \u2014 surfaces holes that weaken the epistemic foundation. Returns prioritized gap list.",
712
+ parameters: {
713
+ topicId: {
714
+ type: "string",
715
+ description: "Topic scope ID (optional, uses default if not provided)"
716
+ },
717
+ maxDepth: {
718
+ type: "number",
719
+ description: "Maximum descendant topic depth for neighborhood expansion (default: 4)"
720
+ }
721
+ },
722
+ required: ["topicId"],
723
+ response: {
724
+ description: "Prioritized list of graph gaps by category",
725
+ fields: {
726
+ emptyTopics: "array \u2014 topics with zero beliefs { topicId, name, type, depth }",
727
+ beliefsWithoutQuestions: "array \u2014 beliefs that have no testing questions { nodeId, canonicalText, topicId }",
728
+ beliefsWithoutEvidence: "array \u2014 beliefs that have no supporting evidence { nodeId, canonicalText, topicId }",
729
+ summary: "object \u2014 { totalGaps, emptyTopicCount, untestedBeliefCount, unsupportedBeliefCount }",
730
+ scopeTopicId: "string \u2014 the root topic used for scoping"
731
+ }
732
+ },
733
+ ownerModule: "coverage-intelligence",
734
+ ontologyPrimitive: "graph",
735
+ tier: "showcase"
736
+ };
737
+
738
+ export { CHECK_PERMISSION, COMPLETE_TASK, CREATE_TASK, CREATE_TOPIC, FILTER_BY_PERMISSION, GET_CHANGE_HISTORY, GET_CODE_CONTEXT, GET_FAILURE_LOG, GET_GRAPH_GAPS, GET_OBSERVATION_CONTEXT, GET_TOPIC, GET_TOPIC_COVERAGE, GET_TOPIC_GRAPH_SPINE, GET_TOPIC_TREE, INGEST_OBSERVATION, LIST_TASKS, LIST_TOPICS, MATERIALIZE_TOPIC_GRAPH, RECORD_ATTEMPT, UPDATE_TASK, UPDATE_TOPIC };
739
+ //# sourceMappingURL=tool-contracts.policy-observation-task-topic.js.map
740
+ //# sourceMappingURL=tool-contracts.policy-observation-task-topic.js.map