@lucern/sdk 0.2.0-alpha.5 → 0.2.0-alpha.7

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 (166) hide show
  1. package/.turbo/turbo-build.log +7 -0
  2. package/.turbo/turbo-typecheck.log +4 -0
  3. package/CHANGELOG.md +13 -0
  4. package/examples/README.md +69 -0
  5. package/examples/contradiction.ts +94 -0
  6. package/examples/investigation-context.ts +118 -0
  7. package/examples/questions-and-tasks.ts +55 -0
  8. package/examples/quickstart.ts +97 -0
  9. package/examples/shared.ts +318 -0
  10. package/examples/strict-public-types.ts +143 -0
  11. package/examples/worktree-lifecycle.ts +79 -0
  12. package/package.json +16 -59
  13. package/src/README.md +6 -0
  14. package/src/adminClient.ts +789 -0
  15. package/{dist/lib/platform/sdk/answersClient.d.ts → src/answersClient.ts} +17 -4
  16. package/src/audiencesClient.ts +209 -0
  17. package/src/auditClient.ts +50 -0
  18. package/src/beliefsClient.ts +319 -0
  19. package/src/client.ts +2647 -0
  20. package/src/contextClient.ts +130 -0
  21. package/src/contextFacade.ts +15 -0
  22. package/src/contextPackCompiler.ts +828 -0
  23. package/src/contextPackSchema.ts +251 -0
  24. package/src/contextTypes.ts +153 -0
  25. package/src/contracts/api-enums.contract.ts +202 -0
  26. package/src/contracts/auth-session.contract.ts +109 -0
  27. package/src/contracts/context-pack.contract.ts +700 -0
  28. package/src/contracts/contextPack.ts +1 -0
  29. package/src/contracts/index.ts +10 -0
  30. package/src/contracts/lens-filter.contract.ts +183 -0
  31. package/src/contracts/lens-workflow.contract.ts +162 -0
  32. package/src/contracts/lensFilter.ts +1 -0
  33. package/src/contracts/lensWorkflow.ts +1 -0
  34. package/src/contracts/mcp-tools.contract.ts +3636 -0
  35. package/src/contracts/mcpTools.ts +1 -0
  36. package/src/contracts/prompt.contract.ts +50 -0
  37. package/src/contracts/prompt.ts +1 -0
  38. package/src/contracts/sdk-tools.contract.ts +1457 -0
  39. package/src/contracts/sdkTools.ts +1 -0
  40. package/src/contracts/workflow-runtime.contract.ts +440 -0
  41. package/src/contracts/workflowRuntime.ts +1 -0
  42. package/src/controlObjectOwnership.ts +286 -0
  43. package/src/coreClient.ts +570 -0
  44. package/src/customTools.ts +398 -0
  45. package/src/decisionsClient.ts +286 -0
  46. package/src/domainContext.ts +15 -0
  47. package/src/events.ts +531 -0
  48. package/src/eventsCore.ts +168 -0
  49. package/src/facade/beliefs.ts +83 -0
  50. package/src/facade/context.ts +110 -0
  51. package/src/facade/contradictions.ts +29 -0
  52. package/src/facade/edges.ts +30 -0
  53. package/src/facade/events.ts +23 -0
  54. package/src/facade/evidence.ts +41 -0
  55. package/src/facade/graph.ts +38 -0
  56. package/src/facade/identity.ts +16 -0
  57. package/src/facade/ontologies.ts +34 -0
  58. package/src/facade/questions.ts +59 -0
  59. package/src/facade/search.ts +16 -0
  60. package/src/facade/tasks.ts +37 -0
  61. package/src/facade/topics.ts +42 -0
  62. package/src/facade/webhooks.ts +58 -0
  63. package/src/facade/worktrees.ts +51 -0
  64. package/src/gatewayFacades.ts +1666 -0
  65. package/src/graphClient.ts +529 -0
  66. package/src/harnessClient.ts +585 -0
  67. package/src/identityClient.ts +278 -0
  68. package/{dist/lib/platform/sdk/index.d.ts → src/index.ts} +3 -0
  69. package/src/learningClient.ts +95 -0
  70. package/src/mcpParityClient.ts +240 -0
  71. package/src/mcpParitySurface.ts +70 -0
  72. package/src/ontologyClient.ts +275 -0
  73. package/src/packRuntime.ts +3 -0
  74. package/src/packsClient.ts +260 -0
  75. package/src/policyClient.ts +572 -0
  76. package/src/promptCatalog.ts +1 -0
  77. package/src/realtime/index.ts +51 -0
  78. package/src/realtime/refs.ts +17 -0
  79. package/src/reportsClient.ts +99 -0
  80. package/src/schemaClient.ts +129 -0
  81. package/src/sdkSurface.ts +190 -0
  82. package/src/topicsClient.ts +243 -0
  83. package/src/types.ts +807 -0
  84. package/src/workflowClient.ts +826 -0
  85. package/tsconfig.json +9 -0
  86. package/dist/.generated +0 -2
  87. package/dist/index.d.ts +0 -3
  88. package/dist/index.js +0 -3
  89. package/dist/lib/platform/auth/credentials.d.ts +0 -5
  90. package/dist/lib/platform/auth/credentials.js +0 -40
  91. package/dist/lib/platform/sdk/adminClient.d.ts +0 -404
  92. package/dist/lib/platform/sdk/adminClient.js +0 -384
  93. package/dist/lib/platform/sdk/answersClient.js +0 -21
  94. package/dist/lib/platform/sdk/audiencesClient.d.ts +0 -93
  95. package/dist/lib/platform/sdk/audiencesClient.js +0 -111
  96. package/dist/lib/platform/sdk/auditClient.d.ts +0 -24
  97. package/dist/lib/platform/sdk/auditClient.js +0 -21
  98. package/dist/lib/platform/sdk/beliefsClient.d.ts +0 -157
  99. package/dist/lib/platform/sdk/beliefsClient.js +0 -124
  100. package/dist/lib/platform/sdk/client.d.ts +0 -2369
  101. package/dist/lib/platform/sdk/client.js +0 -1831
  102. package/dist/lib/platform/sdk/contextClient.d.ts +0 -21
  103. package/dist/lib/platform/sdk/contextClient.js +0 -86
  104. package/dist/lib/platform/sdk/contextPackCompiler.d.ts +0 -100
  105. package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
  106. package/dist/lib/platform/sdk/contextTypes.d.ts +0 -133
  107. package/dist/lib/platform/sdk/contextTypes.js +0 -1
  108. package/dist/lib/platform/sdk/controlObjectOwnership.d.ts +0 -308
  109. package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
  110. package/dist/lib/platform/sdk/coreClient.d.ts +0 -139
  111. package/dist/lib/platform/sdk/coreClient.js +0 -366
  112. package/dist/lib/platform/sdk/customTools.d.ts +0 -83
  113. package/dist/lib/platform/sdk/customTools.js +0 -247
  114. package/dist/lib/platform/sdk/decisionsClient.d.ts +0 -106
  115. package/dist/lib/platform/sdk/decisionsClient.js +0 -129
  116. package/dist/lib/platform/sdk/domainContext.d.ts +0 -1
  117. package/dist/lib/platform/sdk/domainContext.js +0 -1
  118. package/dist/lib/platform/sdk/events.d.ts +0 -176
  119. package/dist/lib/platform/sdk/events.js +0 -261
  120. package/dist/lib/platform/sdk/gatewayFacades.d.ts +0 -586
  121. package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
  122. package/dist/lib/platform/sdk/graphClient.d.ts +0 -266
  123. package/dist/lib/platform/sdk/graphClient.js +0 -235
  124. package/dist/lib/platform/sdk/harnessClient.d.ts +0 -309
  125. package/dist/lib/platform/sdk/harnessClient.js +0 -219
  126. package/dist/lib/platform/sdk/identityClient.d.ts +0 -134
  127. package/dist/lib/platform/sdk/identityClient.js +0 -131
  128. package/dist/lib/platform/sdk/index.js +0 -46
  129. package/dist/lib/platform/sdk/learningClient.d.ts +0 -40
  130. package/dist/lib/platform/sdk/learningClient.js +0 -53
  131. package/dist/lib/platform/sdk/mcpParityClient.d.ts +0 -69
  132. package/dist/lib/platform/sdk/mcpParityClient.js +0 -196
  133. package/dist/lib/platform/sdk/mcpParitySurface.d.ts +0 -10
  134. package/dist/lib/platform/sdk/mcpParitySurface.js +0 -57
  135. package/dist/lib/platform/sdk/ontologyClient.d.ts +0 -131
  136. package/dist/lib/platform/sdk/ontologyClient.js +0 -161
  137. package/dist/lib/platform/sdk/packRuntime.d.ts +0 -1
  138. package/dist/lib/platform/sdk/packRuntime.js +0 -1
  139. package/dist/lib/platform/sdk/packsClient.d.ts +0 -126
  140. package/dist/lib/platform/sdk/packsClient.js +0 -157
  141. package/dist/lib/platform/sdk/policyClient.d.ts +0 -293
  142. package/dist/lib/platform/sdk/policyClient.js +0 -277
  143. package/dist/lib/platform/sdk/promptCatalog.d.ts +0 -1
  144. package/dist/lib/platform/sdk/promptCatalog.js +0 -1
  145. package/dist/lib/platform/sdk/reportsClient.d.ts +0 -34
  146. package/dist/lib/platform/sdk/reportsClient.js +0 -64
  147. package/dist/lib/platform/sdk/schemaClient.d.ts +0 -59
  148. package/dist/lib/platform/sdk/schemaClient.js +0 -71
  149. package/dist/lib/platform/sdk/sdkSurface.d.ts +0 -56
  150. package/dist/lib/platform/sdk/sdkSurface.js +0 -140
  151. package/dist/lib/platform/sdk/topicsClient.d.ts +0 -78
  152. package/dist/lib/platform/sdk/topicsClient.js +0 -118
  153. package/dist/lib/platform/sdk/types.d.ts +0 -692
  154. package/dist/lib/platform/sdk/types.js +0 -1
  155. package/dist/lib/platform/sdk/version.d.ts +0 -2
  156. package/dist/lib/platform/sdk/workflowClient.d.ts +0 -313
  157. package/dist/lib/platform/sdk/workflowClient.js +0 -366
  158. package/dist/lucern/contracts/src/api-enums.contract.d.ts +0 -58
  159. package/dist/lucern/contracts/src/api-enums.contract.js +0 -147
  160. package/dist/lucern/contracts/src/lens-filter.contract.d.ts +0 -70
  161. package/dist/lucern/contracts/src/lens-filter.contract.js +0 -95
  162. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
  163. package/dist/lucern/contracts/src/lens-workflow.contract.js +0 -54
  164. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
  165. package/dist/lucern/contracts/src/mcp-tools.contract.js +0 -3281
  166. /package/{dist/lib/platform/sdk/version.js → src/version.ts} +0 -0
@@ -1,692 +0,0 @@
1
- import type { WorkflowAutoFixPolicy, WorkflowProofArtifact, WorkflowStaffingHint } from "./contracts/workflowRuntime";
2
- import type { DeprecatedBranchMetadata, LensPerspectiveType, LensPromptTemplateReference, LensStatus, LensTaskTemplate, LensWorkflowTemplate } from "./contracts/lensWorkflow";
3
- /** JSON-safe object whose values are recursively JSON-serializable. */
4
- export type JsonObject = {
5
- [key: string]: JsonValue | undefined;
6
- };
7
- /** JSON-safe array whose elements are recursively JSON-serializable. */
8
- export type JsonArray = JsonValue[];
9
- /**
10
- * Union of all JSON-safe primitive and composite types.
11
- *
12
- * Used throughout the SDK for metadata, details, and other
13
- * schemaless payloads that must survive JSON round-tripping.
14
- */
15
- export type JsonValue = null | boolean | number | string | JsonArray | JsonObject;
16
- /**
17
- * Canonical scope identifiers for SDK inputs and records.
18
- */
19
- export type TopicIdentifierInput = {
20
- topicId?: string;
21
- };
22
- /**
23
- * Canonical text aliases for belief, question, and evidence payloads.
24
- */
25
- export type TextAliasInput = {
26
- text?: string;
27
- /** @deprecated Use text. */
28
- canonicalText?: string;
29
- };
30
- /**
31
- * Standard list envelope returned by canonical SDK list methods.
32
- */
33
- export type ListResult<T, LegacyKey extends string = never> = {
34
- items: T[];
35
- total: number;
36
- } & {
37
- [Key in LegacyKey]: T[];
38
- };
39
- /**
40
- * Atomic knowledge unit in the reasoning graph.
41
- *
42
- * A belief carries a confidence score, belongs to a topic scope, and follows
43
- * the knowledge-as-code lifecycle: unscored (draft) -> scored (immutable) -> forked (evolved).
44
- * Confidence is always modulated via the append-only credence log, never overwritten.
45
- */
46
- export type PlatformBeliefRecord = {
47
- nodeId: string;
48
- globalId?: string;
49
- text?: string;
50
- canonicalText?: string;
51
- formulation?: string;
52
- status?: string;
53
- confidence?: number | null;
54
- topicId?: string;
55
- title?: string;
56
- subtype?: string;
57
- domain?: string;
58
- layer?: string;
59
- sourceType?: string;
60
- content?: string;
61
- contentHash?: string;
62
- tags?: string[];
63
- verificationStatus?: string;
64
- metadata?: JsonObject | null;
65
- createdAt?: number;
66
- updatedAt?: number;
67
- createdBy?: string;
68
- };
69
- /** Response returned after creating a new belief node. */
70
- export type CreateBeliefResponse = PlatformBeliefRecord;
71
- /** Response returned after an append-only confidence modulation on a belief. */
72
- export type ModulateConfidenceResponse = {
73
- nodeId: string;
74
- newConfidence?: number;
75
- previousConfidence?: number | null;
76
- confidence?: number;
77
- trigger?: string;
78
- rationale?: string;
79
- certainty?: number;
80
- recordedAt?: number;
81
- };
82
- /** Response returned after forking a scored belief into a new formulation. The new node carries a `supersedes` edge to the parent. */
83
- export interface ForkBeliefResponse extends PlatformBeliefRecord {
84
- parentNodeId?: string;
85
- forkReason?: string;
86
- }
87
- /**
88
- * Generic graph node spanning L1-L4 epistemic layers.
89
- *
90
- * Nodes include beliefs (L3), evidence (L2), sources (L1), and judgments (L4).
91
- * The `nodeType` field discriminates the layer; `confidence` is meaningful only
92
- * for belief-typed nodes.
93
- */
94
- export type PlatformGraphNode = {
95
- nodeId?: string;
96
- globalId?: string;
97
- nodeType?: string;
98
- text?: string;
99
- canonicalText?: string;
100
- content?: string;
101
- contentHash?: string;
102
- title?: string;
103
- subtype?: string;
104
- status?: string;
105
- confidence?: number | null;
106
- topicId?: string;
107
- sourceType?: string;
108
- tags?: string[];
109
- verificationStatus?: string;
110
- metadata?: JsonObject | null;
111
- createdAt?: number;
112
- updatedAt?: number;
113
- };
114
- /**
115
- * Directed edge between two graph nodes.
116
- *
117
- * Weight indicates support strength: -1.0 (contradicts) to +1.0 (strongly supports).
118
- * The `edgeType` field classifies the relationship (informs, tests, depends_on, supersedes, etc.).
119
- * Layer transition rules are enforced: L1 -> L3 direct edges are forbidden.
120
- */
121
- export type PlatformGraphEdge = {
122
- edgeId?: string;
123
- globalId?: string;
124
- fromNodeId?: string;
125
- toNodeId?: string;
126
- fromGlobalId?: string;
127
- toGlobalId?: string;
128
- sourceGlobalId?: string;
129
- targetGlobalId?: string;
130
- edgeType?: string;
131
- topicId?: string;
132
- confidence?: number;
133
- weight?: number;
134
- context?: string;
135
- derivationType?: string;
136
- createdAt?: number;
137
- updatedAt?: number;
138
- };
139
- /** The resolved principal context returned by the public SDK identity surface. */
140
- export type SdkPrincipalContext = {
141
- principalId: string;
142
- principalType: "user" | "human" | "service" | "group" | "external_viewer" | "agent";
143
- tenantId: string | null;
144
- workspaceId: string | null;
145
- scopes: string[];
146
- roles: string[];
147
- isPlatformAdmin: boolean;
148
- isTenantAdmin: boolean;
149
- isWorkspaceAdmin: boolean;
150
- authMode?: string;
151
- sessionId?: string;
152
- delegatedBy?: string;
153
- expiresAt?: number;
154
- };
155
- /** Evidence node record returned by evidence lifecycle APIs. */
156
- export type PlatformEvidenceRecord = {
157
- nodeId?: string;
158
- evidenceId?: string;
159
- globalId?: string;
160
- topicId?: string;
161
- text?: string;
162
- canonicalText?: string;
163
- title?: string;
164
- kind?: string;
165
- status?: string;
166
- source?: string;
167
- sourceUrl?: string;
168
- externalSourceUrl?: string;
169
- linkedBeliefId?: string;
170
- linkedQuestionId?: string;
171
- verificationStatus?: string;
172
- metadata?: JsonObject | null;
173
- tags?: string[];
174
- createdAt?: number;
175
- updatedAt?: number;
176
- createdBy?: string;
177
- };
178
- /** Question node record returned by question lifecycle APIs. */
179
- export type PlatformQuestionRecord = {
180
- nodeId?: string;
181
- questionId?: string;
182
- globalId?: string;
183
- topicId?: string;
184
- text?: string;
185
- canonicalText?: string;
186
- question?: string;
187
- status?: string;
188
- priority?: string;
189
- category?: string;
190
- questionType?: string;
191
- linkedBeliefId?: string;
192
- linkedWorktreeId?: string;
193
- conviction?: number;
194
- answerCompleteness?: string;
195
- convictionRationale?: string;
196
- metadata?: JsonObject | null;
197
- createdAt?: number;
198
- updatedAt?: number;
199
- createdBy?: string;
200
- };
201
- /** Answer record returned by answer/question APIs. */
202
- export type PlatformAnswerRecord = {
203
- nodeId?: string | null;
204
- answerId?: string | null;
205
- globalId?: string | null;
206
- questionNodeId?: string | null;
207
- answerText?: string | null;
208
- confidence?: string | null;
209
- versionNumber?: number;
210
- isLatest?: boolean;
211
- evidenceCount?: number;
212
- answeredBy?: string;
213
- answerSource?: string;
214
- status?: string;
215
- metadata?: JsonObject | null;
216
- createdAt?: number;
217
- updatedAt?: number;
218
- };
219
- /** Contract record returned by contract APIs. */
220
- export type PlatformContract = {
221
- contractId?: string;
222
- beliefId?: string;
223
- beliefNodeId?: string;
224
- title?: string;
225
- description?: string;
226
- status?: string;
227
- conditionType?: string;
228
- direction?: string;
229
- condition?: JsonValue;
230
- deadline?: number;
231
- compositeOf?: string[];
232
- compositeOperator?: string;
233
- modulation?: JsonValue;
234
- evaluationSchedule?: string;
235
- periodicIntervalMs?: number;
236
- createdAt?: number;
237
- updatedAt?: number;
238
- metadata?: JsonObject | null;
239
- };
240
- /** Evaluation result for an epistemic contract. */
241
- export type PlatformContractEvaluation = {
242
- contractId?: string;
243
- beliefId?: string;
244
- beliefNodeId?: string;
245
- status?: string;
246
- evaluationStatus?: string;
247
- satisfied?: boolean;
248
- trigger?: JsonValue;
249
- evaluatedAt?: number;
250
- nextEvaluationAt?: number;
251
- modulationApplied?: JsonValue;
252
- details?: JsonValue;
253
- };
254
- /** Response from a graph node query. May be a single node, an array, or null if not found. */
255
- export type QueryNodesResponse = PlatformGraphNode | PlatformGraphNode[] | null;
256
- /** Response returned after creating a new graph node. */
257
- export type CreateNodeResponse = PlatformGraphNode;
258
- /** Response returned after updating an existing graph node. */
259
- export type UpdateNodeResponse = PlatformGraphNode;
260
- /** Response from a graph edge query. May be a single edge, an array, or null if not found. */
261
- export type QueryEdgesResponse = PlatformGraphEdge | PlatformGraphEdge[] | null;
262
- /** Response returned after creating a new graph edge. */
263
- export type CreateEdgeResponse = PlatformGraphEdge;
264
- /** Count of edges removed in a bulk delete operation. */
265
- export type DeleteEdgeCountResponse = {
266
- removed?: number;
267
- deleted?: number;
268
- };
269
- /** Response from an edge delete operation. May include removed edge details or a count summary. */
270
- export type DeleteEdgeResponse = PlatformGraphEdge | PlatformGraphEdge[] | DeleteEdgeCountResponse | null;
271
- /** Local neighborhood around one or more graph nodes, including connected nodes and edges up to `maxDepth`. */
272
- export type GraphNeighborhoodResponse = {
273
- nodes?: PlatformGraphNode[];
274
- edges?: PlatformGraphEdge[];
275
- rootGlobalIds?: string[];
276
- maxDepth?: number;
277
- };
278
- /** Path traversal result between two graph nodes, including direct edges and the connected subgraph. */
279
- export type GraphPathResponse = {
280
- fromGlobalId: string;
281
- toGlobalId: string;
282
- maxDepth: number;
283
- directEdges: PlatformGraphEdge[];
284
- connectedGraph: GraphNeighborhoodResponse;
285
- };
286
- /** Available graph analytics metric types for structural analysis. */
287
- export type GraphAnalyticsMetric = "graph_stats" | "contradiction_tension" | "confirmation_bias" | "reasoning_depth" | "knowledge_frontier";
288
- /** Response envelope for a graph analytics computation, parameterized by metric type. */
289
- export type GraphAnalyticsResponse<Metric extends GraphAnalyticsMetric = GraphAnalyticsMetric> = {
290
- metric: Metric;
291
- payload: JsonValue;
292
- };
293
- /** A thematic branch within a topic. Worktrees are checked out from branches. */
294
- export type WorkflowBranchRecord = {
295
- branchId?: string;
296
- topicId?: string;
297
- name?: string;
298
- description?: string;
299
- status?: string;
300
- metadata?: JsonObject | null;
301
- createdAt?: number;
302
- updatedAt?: number;
303
- createdBy?: string;
304
- } & Partial<DeprecatedBranchMetadata>;
305
- /**
306
- * Isolated investigation scope within a branch.
307
- *
308
- * Worktrees track hypotheses, dependencies, proof artifacts, and execution sequencing.
309
- * Beliefs committed within a worktree can be freely amended (draft code on a feature branch).
310
- * When investigation is complete, `merge` integrates findings into the stable knowledge base.
311
- */
312
- export type WorkflowWorktreeRecord = {
313
- worktreeId?: string;
314
- topicId?: string;
315
- branchId?: string;
316
- title?: string;
317
- status?: string;
318
- phase?: string;
319
- hypothesis?: string;
320
- questionCount?: number;
321
- taskCount?: number;
322
- autoShapeApplied?: boolean;
323
- frameworkSuggestions?: JsonValue[];
324
- dependencySuggestions?: JsonValue[];
325
- gate?: string;
326
- track?: string;
327
- trackPosition?: number;
328
- executionBand?: number;
329
- executionOrder?: number;
330
- dependsOn?: string[];
331
- blocks?: string[];
332
- proofArtifacts?: WorkflowProofArtifact[];
333
- staffingHint?: WorkflowStaffingHint | string;
334
- lastReconciledAt?: number;
335
- autoFixPolicy?: WorkflowAutoFixPolicy;
336
- metadata?: JsonObject | null;
337
- createdAt?: number;
338
- updatedAt?: number;
339
- createdBy?: string;
340
- };
341
- /** Paginated list of workflow branches. */
342
- export type ListBranchesResponse = ListResult<WorkflowBranchRecord, "branches">;
343
- /** Response returned after creating a new workflow branch. */
344
- export type CreateBranchResponse = WorkflowBranchRecord;
345
- /**
346
- * Reusable analytical perspective with prompt templates, workflow templates, and task templates.
347
- *
348
- * A lens overlays a topic with a specific investigation frame. Multiple lenses can coexist
349
- * on the same topic. Lenses persist across worktrees and carry operational scaffolding.
350
- */
351
- export type WorkflowLensRecord = {
352
- lensId?: string;
353
- workspaceId?: string;
354
- topicId?: string;
355
- name?: string;
356
- description?: string;
357
- perspectiveType?: LensPerspectiveType;
358
- status?: LensStatus;
359
- isAppliedToTopic?: boolean;
360
- promptTemplates?: LensPromptTemplateReference[];
361
- workflowTemplates?: LensWorkflowTemplate[];
362
- taskTemplates?: LensTaskTemplate[];
363
- filterCriteria?: JsonValue;
364
- metadata?: JsonObject | null;
365
- createdAt?: number;
366
- updatedAt?: number;
367
- createdBy?: string;
368
- };
369
- /** Record of a lens being applied to (or removed from) a topic. */
370
- export type WorkflowLensBindingRecord = {
371
- bindingId?: string;
372
- lensId?: string;
373
- workspaceId?: string;
374
- topicId?: string;
375
- status?: string;
376
- appliedAt?: number;
377
- removedAt?: number;
378
- updatedAt?: number;
379
- metadata?: JsonObject | null;
380
- };
381
- /** Paginated list of workflow lenses. */
382
- export type ListLensesResponse = ListResult<WorkflowLensRecord, "lenses">;
383
- /** Response returned after creating a new lens. */
384
- export type CreateLensResponse = WorkflowLensRecord;
385
- /** Response returned after binding or unbinding a lens to a topic. */
386
- export type LensTopicBindingResponse = WorkflowLensBindingRecord;
387
- /** Paginated list of worktrees with optional track and band summary counts. */
388
- export type ListWorktreesResponse = ListResult<WorkflowWorktreeRecord, "worktrees"> & {
389
- tracks?: Record<string, number>;
390
- bands?: Record<string, number>;
391
- };
392
- /** Response returned after adding a new worktree to a topic. */
393
- export type AddWorktreeResponse = WorkflowWorktreeRecord;
394
- /** Response returned after merging a worktree's findings into the stable knowledge base. */
395
- export type MergeWorktreeResponse = {
396
- worktreeId?: string;
397
- status?: string;
398
- outcome?: string;
399
- beliefsScored?: number;
400
- summary?: string;
401
- mergedAt?: number;
402
- };
403
- /** Response returned after opening a pull request for peer review of a worktree. */
404
- export type OpenPullRequestResponse = {
405
- pullRequestId?: string;
406
- worktreeId?: string;
407
- status?: string;
408
- summary?: string;
409
- reviewers?: string[];
410
- createdAt?: number;
411
- };
412
- /** Response returned after pushing scored beliefs from a merged worktree to a target context. */
413
- export type PushWorktreeResponse = {
414
- pushId?: string;
415
- pushedCount?: number;
416
- targetContext?: string;
417
- status?: string;
418
- createdAt?: number;
419
- };
420
- /** Lightweight topic record used in workflow context (topic switching, listing). */
421
- export type WorkflowTopicRecord = {
422
- topicId: string;
423
- name: string;
424
- type?: string;
425
- isOwner?: boolean;
426
- tenantId?: string;
427
- workspaceId?: string;
428
- };
429
- /** Paginated list of workflow topic records. */
430
- export type ListTopicsResponse = ListResult<WorkflowTopicRecord, "topics">;
431
- /** Response returned after switching the active topic context. */
432
- export type SwitchTopicContextResponse = {
433
- topicId: string;
434
- topicName: string;
435
- switched: boolean;
436
- briefing: JsonValue | null;
437
- };
438
- /**
439
- * @deprecated Use WorkflowTopicRecord.
440
- */
441
- export type WorkflowProjectRecord = WorkflowTopicRecord;
442
- /**
443
- * @deprecated Use ListTopicsResponse.
444
- */
445
- export type ListProjectsResponse = ListTopicsResponse;
446
- /**
447
- * @deprecated Use SwitchTopicContextResponse.
448
- */
449
- export type SwitchProjectContextResponse = SwitchTopicContextResponse;
450
- /** Full topic record with hierarchy, visibility, and tenant/workspace scoping. */
451
- export type TopicRecord = {
452
- topicId?: string;
453
- id?: string;
454
- globalId?: string;
455
- name?: string;
456
- description?: string;
457
- type?: string;
458
- depth?: number;
459
- status?: string;
460
- parentTopicId?: string | null;
461
- tenantId?: string;
462
- workspaceId?: string;
463
- visibility?: string;
464
- createdAt?: number;
465
- updatedAt?: number;
466
- };
467
- /** Paginated list of full topic records. */
468
- export type TopicListResponse = ListResult<TopicRecord, "topics">;
469
- /** Topic record extended with ancestry path for tree traversals. */
470
- export type TopicTreeNode = TopicRecord & {
471
- path?: string[];
472
- };
473
- /** Response containing the full topic hierarchy from a given root. */
474
- export type TopicTreeResponse = {
475
- tree: TopicTreeNode[];
476
- };
477
- /** Per-topic belief, question, and evidence counts for coverage analysis. */
478
- export type TopicCoverageRecord = {
479
- topicId: string;
480
- name: string;
481
- type: string;
482
- depth: number;
483
- beliefs: number;
484
- questions: number;
485
- evidence: number;
486
- coverage: "full" | "partial" | "empty";
487
- };
488
- /** Aggregate coverage statistics across the topic tree. */
489
- export type TopicCoverageSummary = {
490
- totalTopics: number;
491
- coveredTopics: number;
492
- emptyTopics: number;
493
- coveragePercent: number;
494
- totalBeliefs: number;
495
- totalQuestions: number;
496
- totalEvidence: number;
497
- };
498
- /** Full coverage report with per-topic records and an aggregate summary. */
499
- export type TopicCoverageResponse = {
500
- topics: TopicCoverageRecord[];
501
- summary: TopicCoverageSummary;
502
- scopeTopicId?: string | null;
503
- };
504
- /** Response returned after creating a new execution task. */
505
- export type CreateTaskResponse = {
506
- taskId: string;
507
- status: string;
508
- createdAt: number;
509
- linkedWorktreeId?: string;
510
- linkedQuestionId?: string;
511
- linkedBeliefId?: string;
512
- };
513
- /** Response returned after marking a task as complete. */
514
- export type CompleteTaskResponse = {
515
- taskId: string;
516
- completedAt: number;
517
- outputSummary: string;
518
- status?: string;
519
- };
520
- /** Response returned after updating a task's fields. */
521
- export type UpdateTaskResponse = {
522
- taskId: string;
523
- updatedAt: number;
524
- status?: string;
525
- title?: string;
526
- };
527
- /**
528
- * Irreversible commitment based on the current epistemic state.
529
- *
530
- * A judgment synthesizes beliefs, evidence, and uncertainties into a determination.
531
- * Once issued, it is evaluated against the epistemic state that existed when it was made
532
- * (knowledge horizon evaluation, Invariant #10). Judgments are L4 entities in the graph.
533
- */
534
- export type JudgmentRecord = {
535
- _id?: string;
536
- judgmentId?: string;
537
- globalId?: string;
538
- summary?: string;
539
- title?: string;
540
- rationale?: string;
541
- decisionType?: string;
542
- judgmentType?: string;
543
- decisionConfidence?: number;
544
- confidence?: number;
545
- outcome?: string;
546
- status?: string;
547
- topicId?: string;
548
- createdAt?: number;
549
- updatedAt?: number;
550
- companyId?: string;
551
- amount?: number;
552
- valuation?: number;
553
- terms?: string;
554
- keyUncertainties?: string[];
555
- alternativesConsidered?: string[];
556
- decisionMakers?: string[];
557
- themeIds?: string[];
558
- };
559
- /** Paginated list of judgment records. */
560
- export type ListJudgmentsResponse = ListResult<JudgmentRecord, "judgments">;
561
- /** A single judgment record, or null if not found. */
562
- export type GetJudgmentResponse = JudgmentRecord | null;
563
- /** Response returned after recording a new judgment, including the knowledge horizon snapshot. */
564
- export type RecordJudgmentResponse = {
565
- nodeId?: string;
566
- judgmentId?: string;
567
- globalId?: string;
568
- status?: string;
569
- createdAt?: number;
570
- knowledgeHorizon?: {
571
- beliefCount?: number;
572
- openQuestionCount?: number;
573
- contradictionCount?: number;
574
- };
575
- };
576
- /** Response returned after recording the real-world outcome of a judgment. */
577
- export type RecordJudgmentOutcomeResponse = {
578
- success?: boolean;
579
- judgmentId?: string;
580
- outcome?: string;
581
- updatedAt?: number;
582
- };
583
- /** Assessment of whether the epistemic state is sufficient to issue a judgment. */
584
- export type JudgmentReadinessResponse = {
585
- ready?: boolean;
586
- beliefCount?: number;
587
- questionCoverage?: number;
588
- avgConfidence?: number;
589
- evidencePerBelief?: number;
590
- unresolvedContradictions?: number;
591
- blockers?: string[];
592
- recommendation?: string;
593
- };
594
- /** Calibration statistics for a single judgment type bucket. */
595
- export type JudgmentCalibrationBucket = {
596
- total?: number;
597
- successful?: number;
598
- };
599
- /** Calibration analysis comparing judgment confidence against real outcomes. */
600
- export type JudgmentCalibrationResponse = {
601
- totalDecisions?: number;
602
- decisionsWithOutcomes?: number;
603
- calibration?: {
604
- calibrationScore?: number;
605
- overconfident?: boolean;
606
- underconfident?: boolean;
607
- } | null;
608
- byType?: Record<string, JudgmentCalibrationBucket>;
609
- };
610
- /** A judgment that has been made but whose real-world outcome has not yet been recorded. */
611
- export type PendingJudgmentOutcomeRecord = {
612
- _id?: string;
613
- globalId?: string;
614
- summary?: string;
615
- title?: string;
616
- decisionType?: string;
617
- decisionConfidence?: number | null;
618
- decisionDate?: number;
619
- companyId?: string;
620
- outcome?: string;
621
- status?: string;
622
- };
623
- /** Paginated list of judgments pending outcome review. */
624
- export type PendingJudgmentOutcomeReviewResponse = ListResult<PendingJudgmentOutcomeRecord, "reviews">;
625
- /** A single integrity issue found during judgment transition audit. */
626
- export type JudgmentTransitionAuditIntegrityIssue = {
627
- code?: string;
628
- severity?: "error" | "warning" | string;
629
- message?: string;
630
- };
631
- /** Integrity check result for a single judgment's transition audit trail. */
632
- export type JudgmentTransitionAuditIntegrityCheck = {
633
- decisionNodeId?: string;
634
- globalId?: string;
635
- status?: string;
636
- outcome?: string;
637
- auditEventCount?: number;
638
- issues?: JudgmentTransitionAuditIntegrityIssue[];
639
- };
640
- /** Full integrity report for all judgment transitions within a topic. */
641
- export type JudgmentTransitionAuditIntegrityResponse = {
642
- topicId?: string;
643
- checkedDecisionCount?: number;
644
- failingDecisionCount?: number;
645
- passed?: boolean;
646
- issueTypeBreakdown?: Record<string, number>;
647
- checks?: JudgmentTransitionAuditIntegrityCheck[];
648
- };
649
- /** A report template definition for generating structured reports. */
650
- export type ReportTemplateRecord = {
651
- templateId?: string;
652
- slug?: string;
653
- name?: string;
654
- version?: string;
655
- description?: string;
656
- status?: string;
657
- };
658
- /** Response for report template queries. May be a list, a single template, or null. */
659
- export type ReportTemplatesResponse = ListResult<ReportTemplateRecord, "templates"> | ReportTemplateRecord | null;
660
- /** A generated report instance for a topic. */
661
- export type ProjectReportRecord = {
662
- reportId?: string;
663
- topicId?: string;
664
- title?: string;
665
- status?: string;
666
- slug?: string;
667
- summary?: string;
668
- createdAt?: number;
669
- updatedAt?: number;
670
- };
671
- /** Paginated list of generated reports. */
672
- export type ProjectReportsResponse = ListResult<ProjectReportRecord, "reports">;
673
- /** A single section within a generated report. */
674
- export type ReportSectionRecord = {
675
- sectionId?: string;
676
- slug?: string;
677
- title?: string;
678
- heading?: string;
679
- body?: string;
680
- content?: string;
681
- order?: number;
682
- metadata?: JsonObject | null;
683
- };
684
- /** A complete report including all its sections. */
685
- export type ReportWithSectionsResponse = {
686
- reportId?: string;
687
- topicId?: string;
688
- title?: string;
689
- status?: string;
690
- summary?: string;
691
- sections?: ReportSectionRecord[];
692
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** Current SDK package version. */
2
- export declare const LUCERN_SDK_VERSION = "0.2.0-alpha.1";