@lucern/contracts 0.1.1-alpha.1 → 0.1.2-alpha.2

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 (151) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +3 -0
  3. package/dist/agents/v1.d.ts +2 -0
  4. package/dist/agents/v1.js +3 -0
  5. package/dist/agents/v1.js.map +1 -0
  6. package/dist/api-enums.contract.d.ts +60 -0
  7. package/dist/api-enums.contract.js +174 -0
  8. package/dist/api-enums.contract.js.map +1 -0
  9. package/dist/auth-context.contract.d.ts +2 -0
  10. package/dist/auth-context.contract.js +48 -0
  11. package/dist/auth-context.contract.js.map +1 -0
  12. package/dist/auth-session.contract.d.ts +2 -0
  13. package/dist/auth-session.contract.js +48 -0
  14. package/dist/auth-session.contract.js.map +1 -0
  15. package/dist/auth.contract.d.ts +92 -0
  16. package/dist/auth.contract.js +48 -0
  17. package/dist/auth.contract.js.map +1 -0
  18. package/dist/beliefs/v1.d.ts +2 -0
  19. package/dist/beliefs/v1.js +3 -0
  20. package/dist/beliefs/v1.js.map +1 -0
  21. package/dist/context-pack.contract.d.ts +496 -0
  22. package/dist/context-pack.contract.js +98 -0
  23. package/dist/context-pack.contract.js.map +1 -0
  24. package/dist/convex-admin.contract.d.ts +7 -0
  25. package/dist/convex-admin.contract.js +3 -0
  26. package/dist/convex-admin.contract.js.map +1 -0
  27. package/dist/events-types.contract.d.ts +1 -0
  28. package/dist/events-types.contract.js +136 -0
  29. package/dist/events-types.contract.js.map +1 -0
  30. package/dist/events.contract.d.ts +178 -0
  31. package/dist/events.contract.js +136 -0
  32. package/dist/events.contract.js.map +1 -0
  33. package/dist/evidence/v1.d.ts +2 -0
  34. package/dist/evidence/v1.js +3 -0
  35. package/dist/evidence/v1.js.map +1 -0
  36. package/dist/gateway.contract.d.ts +79 -0
  37. package/dist/gateway.contract.js +12 -0
  38. package/dist/gateway.contract.js.map +1 -0
  39. package/dist/graph/v1.d.ts +2 -0
  40. package/dist/graph/v1.js +3 -0
  41. package/dist/graph/v1.js.map +1 -0
  42. package/dist/ids.contract.d.ts +9 -0
  43. package/{src/ids.contract.ts → dist/ids.contract.js} +10 -17
  44. package/dist/ids.contract.js.map +1 -0
  45. package/dist/index.d.ts +15 -2004
  46. package/dist/index.js +61 -118
  47. package/dist/index.js.map +1 -0
  48. package/dist/lens-filter.contract.d.ts +72 -0
  49. package/dist/lens-filter.contract.js +71 -0
  50. package/dist/lens-filter.contract.js.map +1 -0
  51. package/dist/lens-workflow.contract.d.ts +87 -0
  52. package/dist/lens-workflow.contract.js +123 -0
  53. package/dist/lens-workflow.contract.js.map +1 -0
  54. package/dist/mcp-tools.contract-D8kXcP6d.d.ts +254 -0
  55. package/dist/mcp-tools.contract.d.ts +1 -0
  56. package/dist/mcp-tools.contract.js +3016 -0
  57. package/dist/mcp-tools.contract.js.map +1 -0
  58. package/dist/ontologies/v1.d.ts +2 -0
  59. package/dist/ontologies/v1.js +3 -0
  60. package/dist/ontologies/v1.js.map +1 -0
  61. package/dist/ontology-matching.contract.d.ts +1 -0
  62. package/dist/ontology-matching.contract.js +346 -0
  63. package/dist/ontology-matching.contract.js.map +1 -0
  64. package/dist/prompt.contract.d.ts +26 -0
  65. package/dist/prompt.contract.js +12 -0
  66. package/dist/prompt.contract.js.map +1 -0
  67. package/dist/questions/v1.d.ts +2 -0
  68. package/dist/questions/v1.js +3 -0
  69. package/dist/questions/v1.js.map +1 -0
  70. package/dist/sdk-methods.contract.d.ts +376 -0
  71. package/dist/sdk-methods.contract.js +3 -0
  72. package/dist/sdk-methods.contract.js.map +1 -0
  73. package/dist/sdk-tools.contract-BnV0hKLp.d.ts +150 -0
  74. package/dist/sdk-tools.contract.d.ts +2 -0
  75. package/dist/sdk-tools.contract.js +4252 -0
  76. package/dist/sdk-tools.contract.js.map +1 -0
  77. package/dist/text-matching.contract.d.ts +55 -0
  78. package/{src/text-matching.contract.ts → dist/text-matching.contract.js} +36 -137
  79. package/dist/text-matching.contract.js.map +1 -0
  80. package/dist/topic-scope.contract.d.ts +1 -0
  81. package/{src/v1/topics/v1.ts → dist/topic-scope.contract.js} +13 -38
  82. package/dist/topic-scope.contract.js.map +1 -0
  83. package/dist/topics/v1.d.ts +2 -0
  84. package/dist/topics/v1.js +3 -0
  85. package/dist/topics/v1.js.map +1 -0
  86. package/dist/v1/agents/v1.d.ts +2 -0
  87. package/dist/v1/agents/v1.js +3 -0
  88. package/dist/v1/agents/v1.js.map +1 -0
  89. package/dist/v1/beliefs/v1.d.ts +2 -0
  90. package/dist/v1/beliefs/v1.js +3 -0
  91. package/dist/v1/beliefs/v1.js.map +1 -0
  92. package/dist/v1/evidence/v1.d.ts +2 -0
  93. package/dist/v1/evidence/v1.js +3 -0
  94. package/dist/v1/evidence/v1.js.map +1 -0
  95. package/dist/v1/graph/v1.d.ts +2 -0
  96. package/dist/v1/graph/v1.js +3 -0
  97. package/dist/v1/graph/v1.js.map +1 -0
  98. package/dist/v1/ontologies/v1.d.ts +78 -0
  99. package/dist/v1/ontologies/v1.js +346 -0
  100. package/dist/v1/ontologies/v1.js.map +1 -0
  101. package/dist/v1/questions/v1.d.ts +2 -0
  102. package/dist/v1/questions/v1.js +3 -0
  103. package/dist/v1/questions/v1.js.map +1 -0
  104. package/dist/v1/topics/v1.d.ts +21 -0
  105. package/dist/v1/topics/v1.js +54 -0
  106. package/dist/v1/topics/v1.js.map +1 -0
  107. package/dist/v1/worktrees/v1.d.ts +2 -0
  108. package/dist/v1/worktrees/v1.js +3 -0
  109. package/dist/v1/worktrees/v1.js.map +1 -0
  110. package/dist/workflow-runtime.contract.d.ts +163 -0
  111. package/dist/workflow-runtime.contract.js +245 -0
  112. package/dist/workflow-runtime.contract.js.map +1 -0
  113. package/dist/worktrees/v1.d.ts +2 -0
  114. package/dist/worktrees/v1.js +3 -0
  115. package/dist/worktrees/v1.js.map +1 -0
  116. package/package.json +23 -7
  117. package/src/agents/v1.ts +0 -8
  118. package/src/api-enums.contract.ts +0 -183
  119. package/src/auth-context.contract.ts +0 -9
  120. package/src/auth-session.contract.ts +0 -9
  121. package/src/auth.contract.ts +0 -162
  122. package/src/beliefs/v1.ts +0 -8
  123. package/src/context-pack.contract.ts +0 -704
  124. package/src/convex-admin.contract.ts +0 -14
  125. package/src/events-types.contract.ts +0 -9
  126. package/src/events.contract.ts +0 -376
  127. package/src/evidence/v1.ts +0 -8
  128. package/src/gateway.contract.ts +0 -151
  129. package/src/graph/v1.ts +0 -8
  130. package/src/index.ts +0 -30
  131. package/src/lens-filter.contract.ts +0 -183
  132. package/src/lens-workflow.contract.ts +0 -162
  133. package/src/mcp-tools.contract.ts +0 -3636
  134. package/src/ontologies/v1.ts +0 -8
  135. package/src/ontology-matching.contract.ts +0 -9
  136. package/src/prompt.contract.ts +0 -50
  137. package/src/questions/v1.ts +0 -8
  138. package/src/sdk-methods.contract.ts +0 -522
  139. package/src/sdk-tools.contract.ts +0 -1545
  140. package/src/topic-scope.contract.ts +0 -9
  141. package/src/topics/v1.ts +0 -8
  142. package/src/v1/agents/v1.ts +0 -8
  143. package/src/v1/beliefs/v1.ts +0 -8
  144. package/src/v1/evidence/v1.ts +0 -8
  145. package/src/v1/graph/v1.ts +0 -8
  146. package/src/v1/ontologies/v1.ts +0 -276
  147. package/src/v1/questions/v1.ts +0 -8
  148. package/src/v1/worktrees/v1.ts +0 -8
  149. package/src/workflow-runtime.contract.ts +0 -440
  150. package/src/worktrees/v1.ts +0 -8
  151. package/tsconfig.json +0 -9
@@ -1,8 +0,0 @@
1
- /**
2
- * Ontology API Contract v1
3
- *
4
- * Defines the public surface for ontology operations:
5
- * create, version, publish, resolve, entity/edge type management.
6
- * Migrates from front-end/lucern/contracts/ during EK-16.
7
- */
8
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * @lucern/contracts — ontology-matching compat shim
3
- *
4
- * This file moved to ./v1/ontologies/v1.ts during EK-16 T1 PR 2.
5
- * Retained here until the Lucern 1.0.0 barrel-sunset cut (D12).
6
- * New code should import from "@lucern/contracts/v1/ontologies" directly.
7
- */
8
-
9
- export * from "./v1/ontologies/v1";
@@ -1,50 +0,0 @@
1
- /**
2
- * Prompt contract for portable, provider-agnostic prompt artifacts.
3
- */
4
-
5
- export type LucernPromptModelHint = "fast" | "balanced" | "strong";
6
-
7
- export type LucernPrompt = {
8
- /** Stable prompt identifier, e.g. "lucern/classify-evidence" */
9
- slug: string;
10
- /** Semver-ish prompt version, e.g. "1.0.0" */
11
- version: string;
12
- /** Prompt template text (supports {{variable}} interpolation) */
13
- template: string;
14
- /** Variables expected by the template */
15
- variables: string[];
16
- /** Model family hint for runtime model routing */
17
- modelHint: LucernPromptModelHint;
18
- /** Metadata used for ownership and discovery */
19
- metadata: {
20
- author: string;
21
- createdAt: string;
22
- description: string;
23
- tags: string[];
24
- };
25
- };
26
-
27
- export function isLucernPrompt(value: unknown): value is LucernPrompt {
28
- if (!value || typeof value !== "object") {
29
- return false;
30
- }
31
- const prompt = value as Partial<LucernPrompt>;
32
-
33
- return (
34
- typeof prompt.slug === "string" &&
35
- typeof prompt.version === "string" &&
36
- typeof prompt.template === "string" &&
37
- Array.isArray(prompt.variables) &&
38
- prompt.variables.every((entry) => typeof entry === "string") &&
39
- (prompt.modelHint === "fast" ||
40
- prompt.modelHint === "balanced" ||
41
- prompt.modelHint === "strong") &&
42
- !!prompt.metadata &&
43
- typeof prompt.metadata === "object" &&
44
- typeof prompt.metadata.author === "string" &&
45
- typeof prompt.metadata.createdAt === "string" &&
46
- typeof prompt.metadata.description === "string" &&
47
- Array.isArray(prompt.metadata.tags) &&
48
- prompt.metadata.tags.every((entry) => typeof entry === "string")
49
- );
50
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Questions API Contract v1
3
- *
4
- * Defines the public surface for question operations:
5
- * create, refine, answer, status transitions, priority ranking.
6
- * Migrates from front-end/lucern/contracts/ during EK-16.
7
- */
8
- export {};
@@ -1,522 +0,0 @@
1
- /**
2
- * SDK Method Contract Definitions
3
- *
4
- * Canonical method signatures for the Lucern TypeScript SDK.
5
- * DERIVED from API contracts — not independently authored.
6
- *
7
- * These types define the public API of `@lucern/sdk`, covering:
8
- * - client initialization (formerly @lucern/sdk-core)
9
- * - belief, evidence, edge, contradiction operations (formerly @lucern/sdk-graph)
10
- * - branch, worktree, merge, push, pull request lifecycle (formerly @lucern/sdk-workflows)
11
- *
12
- * Historical note: T7.3.2 (2026-04-18) deleted the three sdk-alpha shim
13
- * packages; all surfaces now ship in the single `@lucern/sdk` package.
14
- *
15
- * CONTRACT SURFACE: Method signatures are semver-bound.
16
- * Adding optional parameters is non-breaking.
17
- * Changing required parameters or return types is BREAKING.
18
- */
19
-
20
- import type {
21
- BeliefStatus,
22
- BranchStatus,
23
- ConfidenceTrigger,
24
- ContradictionSeverity,
25
- DefeatType,
26
- EpistemicLayer,
27
- ForkReason,
28
- JudgmentType,
29
- MergeOutcome,
30
- PullRequestStatus,
31
- ReasoningMethod,
32
- } from "./api-enums.contract";
33
- import type {
34
- ContextRankingProfile,
35
- PublicCompiledContext,
36
- } from "./context-pack.contract";
37
-
38
- // =============================================================================
39
- // CLIENT TYPES (@lucern/sdk (core))
40
- // =============================================================================
41
-
42
- export type LucernClientConfig = {
43
- apiKey: string;
44
- environment: "sandbox" | "production";
45
- /** Optional base URL override for self-hosted deployments */
46
- baseUrl?: string;
47
- };
48
-
49
- export type LucernClient = {
50
- /** The authenticated client instance */
51
- readonly config: LucernClientConfig;
52
- };
53
-
54
- // =============================================================================
55
- // GRAPH TYPES (@lucern/sdk (graph))
56
- // =============================================================================
57
-
58
- /** Input to createBelief() */
59
- export type CreateBeliefInput = {
60
- canonicalText: string;
61
- topicId: string;
62
- /** @deprecated Use topicId. */
63
- projectId?: string;
64
- layer?: EpistemicLayer;
65
- domain?: string;
66
- nodeType?: string;
67
- };
68
-
69
- /** Result of createBelief() */
70
- export type BeliefResult = {
71
- nodeId: string;
72
- globalId: string;
73
- canonicalText: string;
74
- status: BeliefStatus;
75
- createdAt: number;
76
- };
77
-
78
- /** Input to refineBelief() */
79
- export type RefineBeliefInput = {
80
- canonicalText: string;
81
- rationale?: string;
82
- };
83
-
84
- /** Input to modulateConfidence() */
85
- export type ModulateConfidenceInput = {
86
- confidence: number;
87
- trigger: ConfidenceTrigger;
88
- rationale: string;
89
- };
90
-
91
- /** Result of modulateConfidence() */
92
- export type ConfidenceResult = {
93
- nodeId: string;
94
- newConfidence: number;
95
- previousConfidence: number | null;
96
- trigger: ConfidenceTrigger;
97
- };
98
-
99
- /** Input to forkBelief() */
100
- export type ForkBeliefInput = {
101
- newFormulation: string;
102
- forkReason: ForkReason;
103
- };
104
-
105
- /** Result of forkBelief() */
106
- export type ForkResult = {
107
- nodeId: string;
108
- parentNodeId: string;
109
- forkReason: ForkReason;
110
- canonicalText: string;
111
- };
112
-
113
- /** Input to addEvidence() */
114
- export type AddEvidenceInput = {
115
- canonicalText: string;
116
- topicId: string;
117
- /** @deprecated Use topicId. */
118
- projectId?: string;
119
- sourceUrl?: string;
120
- supports?: {
121
- nodeId: string;
122
- weight: number;
123
- reasoning?: string;
124
- };
125
- };
126
-
127
- /** Result of addEvidence() */
128
- export type EvidenceResult = {
129
- nodeId: string;
130
- globalId: string;
131
- edgeId?: string;
132
- };
133
-
134
- /** Input to flagContradiction() */
135
- export type FlagContradictionInput = {
136
- beliefA: string;
137
- beliefB: string;
138
- description: string;
139
- severity: ContradictionSeverity;
140
- topicId: string;
141
- /** @deprecated Use topicId. */
142
- projectId?: string;
143
- defeatType?: DefeatType;
144
- };
145
-
146
- /** Result of flagContradiction() */
147
- export type ContradictionResult = {
148
- contradictionId: string;
149
- status: "unresolved";
150
- beliefA: string;
151
- beliefB: string;
152
- defeatType?: DefeatType;
153
- };
154
-
155
- /** Input to createEdge() */
156
- export type CreateEdgeInput = {
157
- sourceId: string;
158
- targetId: string;
159
- edgeType: string;
160
- weight?: number;
161
- reasoning?: string;
162
- reasoningMethod?: ReasoningMethod;
163
- };
164
-
165
- /** Result of createEdge() */
166
- export type EdgeResult = {
167
- globalId: string;
168
- edgeType: string;
169
- fromLayer: EpistemicLayer;
170
- toLayer: EpistemicLayer;
171
- };
172
-
173
- /** Input to queryLineage() */
174
- export type QueryLineageInput = {
175
- depth?: number;
176
- };
177
-
178
- /** Result of queryLineage() */
179
- export type LineageResult = {
180
- chain: Array<{
181
- nodeId: string;
182
- canonicalText: string;
183
- confidence: number | null;
184
- forkedFrom: string | null;
185
- scoredAt: number | null;
186
- }>;
187
- forkTree: Record<string, string[]>;
188
- depth: number;
189
- };
190
-
191
- /** Input to searchBeliefs() */
192
- export type SearchBeliefsInput = {
193
- query: string;
194
- status?: BeliefStatus;
195
- minConfidence?: number;
196
- topicId?: string;
197
- /** @deprecated Use topicId. */
198
- projectId?: string;
199
- limit?: number;
200
- };
201
-
202
- /** Input to context.compile() */
203
- export type CompileContextInput = {
204
- query?: string;
205
- budget?: number;
206
- ranking?: ContextRankingProfile;
207
- limit?: number;
208
- maxDepth?: number;
209
- includeEntities?: boolean;
210
- };
211
-
212
- /** Result of context.compile() */
213
- export type CompiledContextResult = PublicCompiledContext;
214
-
215
- // =============================================================================
216
- // WORKFLOW TYPES (@lucern/sdk (workflows))
217
- // =============================================================================
218
-
219
- /** Input to addWorktree() — like git worktree add <branch> */
220
- export type AddWorktreeInput = {
221
- title: string;
222
- topicId: string;
223
- /** @deprecated Use topicId. */
224
- projectId?: string;
225
- branchId?: string;
226
- objective?: string;
227
- hypothesis?: string;
228
- beliefIds?: string[];
229
- autoShape?: boolean;
230
- domainPackId?: string;
231
- executionOrder?: number;
232
- dependsOn?: string[];
233
- blocks?: string[];
234
- gate?: string;
235
- };
236
-
237
- /** Result of addWorktree() */
238
- export type WorktreeResult = {
239
- worktreeId: string;
240
- title: string;
241
- status: string;
242
- hypothesis?: string;
243
- questionCount?: number;
244
- taskCount?: number;
245
- autoShapeApplied?: boolean;
246
- };
247
-
248
- /** Input to merge() */
249
- export type MergeInput = {
250
- outcomes: Array<{
251
- beliefId: string;
252
- confidence: number;
253
- rationale: string;
254
- }>;
255
- summary?: string;
256
- };
257
-
258
- /** Result of merge() */
259
- export type MergeResult = {
260
- worktreeId: string;
261
- status: "merged";
262
- outcome: MergeOutcome;
263
- beliefsScored: number;
264
- };
265
-
266
- // =============================================================================
267
- // JUDGMENT TYPES (Phase 1: new vocabulary)
268
- // =============================================================================
269
-
270
- /** Input to recordJudgment() */
271
- export type RecordJudgmentInput = {
272
- title: string;
273
- rationale: string;
274
- topicId: string;
275
- /** @deprecated Use topicId. */
276
- projectId?: string;
277
- beliefIds?: string[];
278
- confidence?: number;
279
- judgmentType?: JudgmentType;
280
- };
281
-
282
- /** Result of recordJudgment() */
283
- export type JudgmentResult = {
284
- judgmentId: string;
285
- title: string;
286
- status: "issued";
287
- };
288
-
289
- // =============================================================================
290
- // BRANCH TYPES (git branch)
291
- // =============================================================================
292
-
293
- /** Input to createBranch() */
294
- export type CreateBranchInput = {
295
- name: string;
296
- topicId: string;
297
- /** @deprecated Use topicId. */
298
- projectId?: string;
299
- description?: string;
300
- };
301
-
302
- /** Result of createBranch() */
303
- export type BranchResult = {
304
- branchId: string;
305
- name: string;
306
- status: BranchStatus;
307
- createdAt: number;
308
- };
309
-
310
- // =============================================================================
311
- // PUSH TYPES (git push)
312
- // =============================================================================
313
-
314
- /** Input to push() */
315
- export type PushInput = {
316
- targetContext: string;
317
- beliefIds?: string[];
318
- };
319
-
320
- /** Result of push() */
321
- export type PushResult = {
322
- pushedCount: number;
323
- targetContext: string;
324
- pushedAt: number;
325
- };
326
-
327
- // =============================================================================
328
- // PULL REQUEST TYPES (git pull request)
329
- // =============================================================================
330
-
331
- /** Input to openPullRequest() */
332
- export type OpenPullRequestInput = {
333
- reviewers?: string[];
334
- summary: string;
335
- };
336
-
337
- /** Result of openPullRequest() */
338
- export type PullRequestResult = {
339
- pullRequestId: string;
340
- worktreeId: string;
341
- status: PullRequestStatus;
342
- };
343
-
344
- // =============================================================================
345
- // BISECT TYPES (git bisect)
346
- // =============================================================================
347
-
348
- /** Input to bisectConfidence() */
349
- export type BisectConfidenceInput = {
350
- expectedDirection: "overconfident" | "underconfident";
351
- timeRange?: { start: number; end: number };
352
- };
353
-
354
- /** Result of bisectConfidence() */
355
- export type BisectResult = {
356
- inflectionEntry: {
357
- confidence: number;
358
- trigger: ConfidenceTrigger;
359
- rationale: string;
360
- timestamp: number;
361
- };
362
- triggerEvent: string;
363
- confidenceBefore: number;
364
- confidenceAfter: number;
365
- };
366
-
367
- // =============================================================================
368
- // SDK METHOD SIGNATURES
369
- // =============================================================================
370
-
371
- /**
372
- * @lucern/sdk (graph) method signatures.
373
- *
374
- * These define the public API. Implementation must match these signatures.
375
- * Parameters are the source of truth — generated from API contracts.
376
- */
377
- export type LucernGraphMethods = {
378
- // Belief lifecycle
379
- createBelief(
380
- client: LucernClient,
381
- input: CreateBeliefInput
382
- ): Promise<BeliefResult>;
383
- refineBelief(
384
- client: LucernClient,
385
- nodeId: string,
386
- input: RefineBeliefInput
387
- ): Promise<BeliefResult>;
388
- modulateConfidence(
389
- client: LucernClient,
390
- nodeId: string,
391
- input: ModulateConfidenceInput
392
- ): Promise<ConfidenceResult>;
393
- forkBelief(
394
- client: LucernClient,
395
- nodeId: string,
396
- input: ForkBeliefInput
397
- ): Promise<ForkResult>;
398
- archiveBelief(
399
- client: LucernClient,
400
- nodeId: string,
401
- rationale?: string
402
- ): Promise<{ nodeId: string; status: "archived" }>;
403
-
404
- // Evidence
405
- addEvidence(
406
- client: LucernClient,
407
- input: AddEvidenceInput
408
- ): Promise<EvidenceResult>;
409
-
410
- // Contradictions
411
- flagContradiction(
412
- client: LucernClient,
413
- input: FlagContradictionInput
414
- ): Promise<ContradictionResult>;
415
-
416
- // Edges
417
- createEdge(client: LucernClient, input: CreateEdgeInput): Promise<EdgeResult>;
418
-
419
- // Queries (log, blame, traverse, search)
420
- queryLineage(
421
- client: LucernClient,
422
- nodeId: string,
423
- input?: QueryLineageInput
424
- ): Promise<LineageResult>;
425
- getConfidenceHistory(
426
- client: LucernClient,
427
- nodeId: string
428
- ): Promise<{
429
- entries: Array<{
430
- confidence: number;
431
- trigger: ConfidenceTrigger;
432
- rationale: string;
433
- timestamp: number;
434
- userId: string;
435
- }>;
436
- }>;
437
- getAuditTrail(
438
- client: LucernClient,
439
- nodeId: string,
440
- limit?: number
441
- ): Promise<{
442
- entries: Array<{
443
- action: string;
444
- actor: string;
445
- timestamp: number;
446
- rationale?: string;
447
- }>;
448
- }>;
449
- searchBeliefs(
450
- client: LucernClient,
451
- input: SearchBeliefsInput
452
- ): Promise<{ results: BeliefResult[] }>;
453
- findContradictions(
454
- client: LucernClient,
455
- input: {
456
- topicId?: string;
457
- projectId?: string;
458
- nodeId?: string;
459
- status?: string;
460
- }
461
- ): Promise<{ contradictions: ContradictionResult[] }>;
462
- traverseGraph(
463
- client: LucernClient,
464
- input: {
465
- startNode: string;
466
- direction?: "up" | "down" | "both";
467
- maxDepth?: number;
468
- }
469
- ): Promise<{ nodes: unknown[]; edges: unknown[]; depth: number }>;
470
-
471
- // Forensics (bisect)
472
- bisectConfidence(
473
- client: LucernClient,
474
- nodeId: string,
475
- input: BisectConfidenceInput
476
- ): Promise<BisectResult>;
477
-
478
- // Judgments (tag)
479
- recordJudgment(
480
- client: LucernClient,
481
- input: RecordJudgmentInput
482
- ): Promise<JudgmentResult>;
483
- };
484
-
485
- /**
486
- * @lucern/sdk (workflows) method signatures.
487
- *
488
- * Lifecycle: createBranch (git branch) → addWorktree (git worktree add) →
489
- * openPullRequest (git pull request) → merge (git merge) → push (git push)
490
- */
491
- export type LucernWorkflowMethods = {
492
- // Branch lifecycle (git branch)
493
- createBranch(
494
- client: LucernClient,
495
- input: CreateBranchInput
496
- ): Promise<BranchResult>;
497
-
498
- // Worktree lifecycle (git worktree add → git merge)
499
- addWorktree(
500
- client: LucernClient,
501
- input: AddWorktreeInput
502
- ): Promise<WorktreeResult>;
503
- merge(
504
- client: LucernClient,
505
- worktreeId: string,
506
- input: MergeInput
507
- ): Promise<MergeResult>;
508
-
509
- // Pull request (git pull request)
510
- openPullRequest(
511
- client: LucernClient,
512
- worktreeId: string,
513
- input: OpenPullRequestInput
514
- ): Promise<PullRequestResult>;
515
-
516
- // Push (git push)
517
- push(
518
- client: LucernClient,
519
- worktreeId: string,
520
- input: PushInput
521
- ): Promise<PushResult>;
522
- };