@lucern/sdk 1.0.29 → 1.0.31
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.
- package/CHANGELOG.md +12 -0
- package/dist/accessControl.d.ts +31 -31
- package/dist/accessControl.js +1 -0
- package/dist/adminClient.d.ts +74 -74
- package/dist/adminClient.js +38 -30
- package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
- package/dist/{answersClient.js → answers-client.js} +2 -2
- package/dist/audience/index.d.ts +12 -12
- package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
- package/dist/audiences-client.js +107 -0
- package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
- package/dist/{auditClient.js → audit-client.js} +8 -7
- package/dist/authContext.d.ts +26 -26
- package/dist/authDeviceClient.d.ts +11 -11
- package/dist/authDeviceClient.js +4 -6
- package/dist/beliefs/index.d.ts +56 -28
- package/dist/beliefs/index.js +2 -1
- package/dist/beliefsClient.d.ts +71 -63
- package/dist/beliefsClient.js +90 -67
- package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
- package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
- package/dist/client-assembly-types.d.ts +219 -0
- package/dist/client-assembly-types.js +2 -0
- package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
- package/dist/client-config.js +2 -0
- package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
- package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
- package/dist/client.d.ts +1906 -352
- package/dist/client.js +34 -30
- package/dist/clientGraphNamespaces.d.ts +35 -25
- package/dist/clientGraphNamespaces.js +11 -5
- package/dist/clientHelpers.js +8 -5
- package/dist/clientKnowledgeNamespaces.d.ts +124 -84
- package/dist/clientKnowledgeNamespaces.js +35 -34
- package/dist/clientLocalHelpers.d.ts +81 -52
- package/dist/clientLocalHelpers.js +193 -43
- package/dist/clientPlatformNamespaces.d.ts +1541 -150
- package/dist/clientPlatformNamespaces.js +10 -5
- package/dist/clientRuntime.d.ts +1 -1
- package/dist/clientRuntime.js +1 -1
- package/dist/clientWorkflowNamespaces.d.ts +211 -97
- package/dist/clientWorkflowNamespaces.js +22 -19
- package/dist/contextClient.d.ts +2 -2
- package/dist/contextClient.js +79 -50
- package/dist/contextFacade.d.ts +1 -1
- package/dist/contextFacade.js +2 -0
- package/dist/contextPackCompiler.d.ts +52 -52
- package/dist/contextPackCompiler.js +192 -122
- package/dist/contextPackPolicy.d.ts +22 -22
- package/dist/contextPackPolicy.js +21 -9
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +1 -0
- package/dist/contextTypes.d.ts +155 -155
- package/dist/contracts/api-enums.contract.js +2 -11
- package/dist/contracts/auth-session.contract.d.ts +16 -16
- package/dist/contracts/auth-session.contract.js +3 -2
- package/dist/contracts/context-pack.contract.d.ts +216 -216
- package/dist/contracts/contextPack.js +2 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/lens-filter.contract.d.ts +8 -8
- package/dist/contracts/lens-filter.contract.js +10 -10
- package/dist/contracts/lens-workflow.contract.d.ts +32 -32
- package/dist/contracts/lens-workflow.contract.js +2 -1
- package/dist/contracts/lensFilter.js +2 -0
- package/dist/contracts/lensWorkflow.js +2 -0
- package/dist/contracts/mcpTools.d.ts +19 -19
- package/dist/contracts/mcpTools.js +3 -1
- package/dist/contracts/prompt.contract.d.ts +12 -12
- package/dist/contracts/prompt.js +1 -0
- package/dist/contracts/sdk-tools.contract.js +1 -0
- package/dist/contracts/sdkTools.js +2 -0
- package/dist/contracts/tool-contracts.js +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
- package/dist/contracts/workflow-runtime.contract.js +1 -5
- package/dist/contracts/workflowRuntime.js +2 -0
- package/dist/contradictions/index.d.ts +8 -8
- package/dist/contradictions/index.js +1 -0
- package/dist/control-plane.d.ts +10 -10
- package/dist/control-plane.js +2 -2
- package/dist/controlObjectOwnership.d.ts +11 -11
- package/dist/controlObjectOwnership.js +1 -0
- package/dist/coreClient.d.ts +51 -51
- package/dist/coreClient.js +269 -101
- package/dist/customTools.d.ts +19 -19
- package/dist/customTools.js +4 -2
- package/dist/decisions/index.d.ts +18 -18
- package/dist/decisions/index.js +1 -0
- package/dist/decisionsClient.d.ts +4 -4
- package/dist/decisionsClient.js +36 -27
- package/dist/edges/index.d.ts +20 -18
- package/dist/edges/index.js +1 -0
- package/dist/embeddingsClient.d.ts +29 -29
- package/dist/embeddingsClient.js +15 -8
- package/dist/eventingClient.d.ts +27 -27
- package/dist/eventingClient.js +10 -5
- package/dist/events.d.ts +83 -83
- package/dist/events.js +19 -15
- package/dist/eventsCore.d.ts +7 -7
- package/dist/eventsCore.js +11 -10
- package/dist/evidence/index.d.ts +23 -21
- package/dist/evidence/index.js +1 -0
- package/dist/evidenceClient.d.ts +23 -23
- package/dist/evidenceClient.js +10 -6
- package/dist/facade/context.d.ts +9 -9
- package/dist/facade/context.js +67 -41
- package/dist/functionSurface.js +2 -0
- package/dist/functionSurfaceClient.js +2 -0
- package/dist/gatewayFacades.d.ts +215 -215
- package/dist/gatewayFacades.factories.d.ts +23 -44
- package/dist/gatewayFacades.factories.js +63 -62
- package/dist/gatewayFacades.js +31 -32
- package/dist/graphAnalysisClient.d.ts +60 -60
- package/dist/graphAnalysisClient.js +19 -18
- package/dist/graphClient.d.ts +34 -34
- package/dist/graphClient.js +56 -35
- package/dist/graphIntel.js +2 -0
- package/dist/graphIntelligence.d.ts +2 -2
- package/dist/graphIntelligence.js +1 -1
- package/dist/graphRecommendationsClient.d.ts +24 -24
- package/dist/graphRecommendationsClient.js +12 -7
- package/dist/graphStateClassifierClient.d.ts +13 -13
- package/dist/graphStateClassifierClient.js +10 -5
- package/dist/harnessClient.d.ts +61 -61
- package/dist/harnessClient.js +44 -31
- package/dist/identityClient.d.ts +33 -59
- package/dist/identityClient.js +126 -98
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -19
- package/dist/infisicalRuntime.d.ts +11 -11
- package/dist/infisicalRuntime.js +20 -14
- package/dist/jobsClient.d.ts +28 -28
- package/dist/jobsClient.js +6 -3
- package/dist/learningClient.js +13 -8
- package/dist/lenses/index.d.ts +124 -28
- package/dist/lenses/index.js +1 -0
- package/dist/mcpClient.d.ts +1 -1
- package/dist/mcpClient.js +3 -3
- package/dist/modelRuntimeClient.d.ts +27 -27
- package/dist/modelRuntimeClient.js +10 -5
- package/dist/nodes/index.d.ts +9 -9
- package/dist/nodes/index.js +1 -0
- package/dist/ontologies/index.d.ts +68 -22
- package/dist/ontologies/index.js +1 -0
- package/dist/ontologyClient.js +24 -17
- package/dist/ontologyLinksClient.d.ts +35 -35
- package/dist/ontologyLinksClient.js +9 -6
- package/dist/opinion.d.ts +3 -3
- package/dist/opinion.js +12 -5
- package/dist/orgGraphSearchClient.d.ts +39 -39
- package/dist/orgGraphSearchClient.js +22 -13
- package/dist/packsClient.d.ts +1 -1
- package/dist/packsClient.js +28 -19
- package/dist/policyClient.d.ts +79 -68
- package/dist/policyClient.js +18 -12
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +38 -27
- package/dist/questions/index.js +1 -0
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/refs.d.ts +2 -2
- package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
- package/dist/{reportsClient.js → reports-client.js} +19 -13
- package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
- package/dist/{schemaClient.js → schema-client.js} +14 -11
- package/dist/sdkSurface.d.ts +12 -12
- package/dist/sdkSurface.js +14 -10
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +2 -1
- package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
- package/dist/{sourcesClient.js → sources-client.js} +4 -5
- package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
- package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
- package/dist/toolRegistryClient.d.ts +46 -46
- package/dist/toolRegistryClient.js +22 -11
- package/dist/topics/index.d.ts +23 -23
- package/dist/topics/index.js +2 -1
- package/dist/topicsClient.d.ts +6 -6
- package/dist/topicsClient.js +29 -18
- package/dist/types.d.ts +356 -355
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflowClient.d.ts +36 -35
- package/dist/workflowClient.js +88 -60
- package/dist/worktrees/index.d.ts +118 -32
- package/dist/worktrees/index.js +2 -1
- package/package.json +45 -5
- package/dist/audiencesClient.js +0 -115
- package/dist/clientAssemblyTypes.d.ts +0 -33
- package/dist/clientAssemblyTypes.js +0 -2
- package/dist/clientConfig.js +0 -2
|
@@ -76,14 +76,14 @@ export declare const MIN_CONTRADICTION_BUDGET = 40;
|
|
|
76
76
|
* - priority: Question priority (critical > high > medium > low)
|
|
77
77
|
* - severity: Contradiction severity (critical > high > medium > low)
|
|
78
78
|
*/
|
|
79
|
-
export
|
|
80
|
-
query: number;
|
|
81
|
-
recency: number;
|
|
82
|
-
confidence?: number;
|
|
79
|
+
export interface RankingWeightVector {
|
|
83
80
|
beliefType?: number;
|
|
81
|
+
confidence?: number;
|
|
84
82
|
priority?: number;
|
|
83
|
+
query: number;
|
|
84
|
+
recency: number;
|
|
85
85
|
severity?: number;
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
export declare const RANKING_WEIGHTS: Readonly<Record<ContextPackSectionKey, RankingWeightVector>>;
|
|
88
88
|
/** Recency decay half-life in days. After 30 days, recency score = 0.5. */
|
|
89
89
|
export declare const RECENCY_HALF_LIFE_DAYS = 30;
|
|
@@ -112,130 +112,130 @@ export declare const DEFAULT_PRIORITY_SCORE = 0.5;
|
|
|
112
112
|
export declare const SEVERITY_SCORES: Readonly<Record<string, number>>;
|
|
113
113
|
export declare const DEFAULT_SEVERITY_SCORE = 0.5;
|
|
114
114
|
/** A ranked belief in the invariants or activeBeliefs section. */
|
|
115
|
-
export
|
|
116
|
-
|
|
115
|
+
export interface ContextPackBelief {
|
|
116
|
+
beliefType: string | null;
|
|
117
117
|
canonicalText: string;
|
|
118
118
|
confidence: number | null;
|
|
119
|
-
|
|
119
|
+
/** Human-readable explanation of why this item was ranked here (RS-2). */
|
|
120
|
+
justification?: string;
|
|
121
|
+
nodeId: string;
|
|
120
122
|
score: number;
|
|
121
123
|
/** Present in activeBeliefs, absent in invariants */
|
|
122
124
|
status?: string;
|
|
123
125
|
updatedAt?: number | null;
|
|
126
|
+
}
|
|
127
|
+
/** A ranked question in the openQuestions section. */
|
|
128
|
+
export interface ContextPackQuestion {
|
|
124
129
|
/** Human-readable explanation of why this item was ranked here (RS-2). */
|
|
125
130
|
justification?: string;
|
|
126
|
-
|
|
127
|
-
/** A ranked question in the openQuestions section. */
|
|
128
|
-
export type ContextPackQuestion = {
|
|
131
|
+
priority: string;
|
|
129
132
|
questionId: string;
|
|
130
|
-
|
|
133
|
+
score: number;
|
|
131
134
|
status: string;
|
|
132
|
-
|
|
135
|
+
text: string;
|
|
133
136
|
updatedAt?: number | null;
|
|
134
|
-
|
|
135
|
-
/** Human-readable explanation of why this item was ranked here (RS-2). */
|
|
136
|
-
justification?: string;
|
|
137
|
-
};
|
|
137
|
+
}
|
|
138
138
|
/** A ranked evidence item in the recentEvidence section. */
|
|
139
|
-
export
|
|
140
|
-
nodeId: string;
|
|
139
|
+
export interface ContextPackEvidence {
|
|
141
140
|
canonicalText: string;
|
|
142
|
-
sourceUrl: string | null;
|
|
143
|
-
kind: string;
|
|
144
141
|
createdAt: number | null;
|
|
145
|
-
score: number;
|
|
146
142
|
/** Human-readable explanation of why this item was ranked here (RS-2). */
|
|
147
143
|
justification?: string;
|
|
148
|
-
|
|
144
|
+
kind: string;
|
|
145
|
+
nodeId: string;
|
|
146
|
+
score: number;
|
|
147
|
+
sourceUrl: string | null;
|
|
148
|
+
}
|
|
149
149
|
/** A ranked contradiction in the contradictions section. */
|
|
150
|
-
export
|
|
150
|
+
export interface ContextPackContradiction {
|
|
151
151
|
contradictionId: string;
|
|
152
|
-
severity: string;
|
|
153
|
-
status: string;
|
|
154
152
|
description: string;
|
|
155
|
-
score: number;
|
|
156
153
|
/** Human-readable explanation of why this item was ranked here (RS-2). */
|
|
157
154
|
justification?: string;
|
|
158
|
-
|
|
155
|
+
score: number;
|
|
156
|
+
severity: string;
|
|
157
|
+
status: string;
|
|
158
|
+
}
|
|
159
159
|
/**
|
|
160
160
|
* An entity from the ontological layer surfaced in the context pack.
|
|
161
161
|
* Entities are domain objects (companies, people, functions, etc.) connected
|
|
162
162
|
* to beliefs via bridge edges. They provide the "reality anchor" that makes
|
|
163
163
|
* the reasoning graph domain-aware.
|
|
164
164
|
*/
|
|
165
|
-
export
|
|
166
|
-
/** Convex document ID of the entity node. */
|
|
167
|
-
nodeId: string;
|
|
168
|
-
/** Entity type (e.g., "company", "person", "function"). */
|
|
169
|
-
entityType: string;
|
|
170
|
-
/** Human-readable title/name of the entity. */
|
|
171
|
-
title: string;
|
|
165
|
+
export interface ContextPackEntity {
|
|
172
166
|
/** Number of beliefs connected to this entity via bridge edges. */
|
|
173
167
|
connectedBeliefCount: number;
|
|
174
168
|
/** Number of evidence items referencing this entity. */
|
|
175
169
|
connectedEvidenceCount: number;
|
|
176
|
-
/**
|
|
177
|
-
|
|
170
|
+
/** Entity type (e.g., "company", "person", "function"). */
|
|
171
|
+
entityType: string;
|
|
178
172
|
/** Entity metadata (structured per ontology schema). */
|
|
179
173
|
metadata?: Record<string, unknown>;
|
|
180
|
-
|
|
174
|
+
/** Convex document ID of the entity node. */
|
|
175
|
+
nodeId: string;
|
|
176
|
+
/** Relevance score from ranking algorithm. */
|
|
177
|
+
score: number;
|
|
178
|
+
/** Human-readable title/name of the entity. */
|
|
179
|
+
title: string;
|
|
180
|
+
}
|
|
181
181
|
/**
|
|
182
182
|
* A lattice seed entry representing a belief that was auto-generated
|
|
183
183
|
* to cover an ontology entity type within a topic scope.
|
|
184
184
|
*/
|
|
185
|
-
export
|
|
185
|
+
export interface BeliefLatticeSeed {
|
|
186
186
|
/** The belief node ID that was created or already existed. */
|
|
187
187
|
beliefNodeId: string;
|
|
188
|
-
/** The entity type this seed belief covers. */
|
|
189
|
-
entityType: string;
|
|
190
|
-
/** Whether this seed was newly created or already existed. */
|
|
191
|
-
created: boolean;
|
|
192
188
|
/** The canonical text of the seed belief. */
|
|
193
189
|
canonicalText: string;
|
|
194
|
-
|
|
190
|
+
/** Whether this seed was newly created or already existed. */
|
|
191
|
+
created: boolean;
|
|
192
|
+
/** The entity type this seed belief covers. */
|
|
193
|
+
entityType: string;
|
|
194
|
+
}
|
|
195
195
|
/** Counts and scoped health signals for the context pack. */
|
|
196
|
-
export
|
|
197
|
-
|
|
196
|
+
export interface ContextPackSummary {
|
|
197
|
+
contradictions: number;
|
|
198
|
+
descendantDepth: number;
|
|
199
|
+
evidenceItems: number;
|
|
198
200
|
invariants: number;
|
|
199
201
|
openQuestions: number;
|
|
200
|
-
|
|
201
|
-
contradictions: number;
|
|
202
|
+
query: string | null;
|
|
202
203
|
/** Number of ontological entities in scope (optional, present when entity graph is active). */
|
|
203
204
|
relatedEntities?: number;
|
|
204
205
|
scopedTopics: number;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
};
|
|
206
|
+
totalBeliefs: number;
|
|
207
|
+
}
|
|
208
208
|
/** A failed approach surfaced from the failure log for anti-repetition. */
|
|
209
|
-
export
|
|
210
|
-
/** Lucern attempt/evidence node ID. */
|
|
211
|
-
attemptId: string;
|
|
209
|
+
export interface ContextPackFailure {
|
|
212
210
|
/** What was tried. */
|
|
213
211
|
approach: string;
|
|
212
|
+
/** Lucern attempt/evidence node ID. */
|
|
213
|
+
attemptId: string;
|
|
214
214
|
/** Why it failed. */
|
|
215
215
|
outcome: string;
|
|
216
216
|
/** When the attempt was recorded (ms since epoch). */
|
|
217
217
|
recordedAt: number;
|
|
218
218
|
/** Relevance score from ranking algorithm. */
|
|
219
219
|
score: number;
|
|
220
|
-
}
|
|
220
|
+
}
|
|
221
221
|
/** Failure context section appended to context packs in delta mode. */
|
|
222
|
-
export
|
|
222
|
+
export interface ContextPackFailureContext {
|
|
223
223
|
/** Ranked failed approaches relevant to the current query. */
|
|
224
224
|
failures: ContextPackFailure[];
|
|
225
225
|
/** IDs of items suppressed from other sections due to anti-repetition. */
|
|
226
226
|
suppressedIds: string[];
|
|
227
|
-
}
|
|
227
|
+
}
|
|
228
228
|
/** A verification obligation surfaced by delta compilation. */
|
|
229
|
-
export
|
|
229
|
+
export interface VerificationObligation {
|
|
230
230
|
/** What must be verified. */
|
|
231
231
|
description: string;
|
|
232
|
-
/** Source of the obligation (e.g., "belief:xyz confidence drop"). */
|
|
233
|
-
source: string;
|
|
234
232
|
/** Severity: how important it is to verify. */
|
|
235
233
|
severity: "critical" | "high" | "medium" | "low";
|
|
236
|
-
|
|
234
|
+
/** Source of the obligation (e.g., "belief:xyz confidence drop"). */
|
|
235
|
+
source: string;
|
|
236
|
+
}
|
|
237
237
|
/** Delta report appended to context packs when mode = "delta". */
|
|
238
|
-
export
|
|
238
|
+
export interface ContextPackDeltaReport {
|
|
239
239
|
/** Items that changed since the reference point (new, updated, removed). */
|
|
240
240
|
changedItems: Array<{
|
|
241
241
|
id: string;
|
|
@@ -243,33 +243,25 @@ export type ContextPackDeltaReport = {
|
|
|
243
243
|
changeType: "added" | "updated" | "removed" | "confidence_changed";
|
|
244
244
|
summary: string;
|
|
245
245
|
}>;
|
|
246
|
-
/** Obligations the consuming session must verify. */
|
|
247
|
-
verificationObligations: VerificationObligation[];
|
|
248
246
|
/** Reference point for the delta (worktree ID, timestamp, or commit SHA). */
|
|
249
247
|
referencePoint: string;
|
|
250
|
-
|
|
248
|
+
/** Obligations the consuming session must verify. */
|
|
249
|
+
verificationObligations: VerificationObligation[];
|
|
250
|
+
}
|
|
251
251
|
/**
|
|
252
252
|
* Per-section weight overrides that domain packs can apply.
|
|
253
253
|
* Overrides merge with RANKING_WEIGHTS — only specified fields replace defaults.
|
|
254
254
|
*/
|
|
255
|
-
export
|
|
255
|
+
export interface PackWeightOverride {
|
|
256
256
|
/** Which section to override weights for. */
|
|
257
257
|
section: ContextPackSectionKey;
|
|
258
258
|
/** Partial weight vector — only specified fields replace defaults. */
|
|
259
259
|
weights: Partial<RankingWeightVector>;
|
|
260
|
-
}
|
|
260
|
+
}
|
|
261
261
|
/** Token-budgeted section selections for prompt injection. */
|
|
262
|
-
export
|
|
263
|
-
/** Total token budget for the entire context pack. */
|
|
264
|
-
tokenBudget: number;
|
|
262
|
+
export interface ContextPackInjectionPolicy {
|
|
265
263
|
/** Estimated tokens consumed across all sections. */
|
|
266
264
|
estimatedTokens: number;
|
|
267
|
-
/** Per-section token budgets derived from SECTION_BUDGET_RATIOS. */
|
|
268
|
-
sectionBudgets: Record<ContextPackSectionKey, number>;
|
|
269
|
-
/** Actual token usage per section after greedy fill. */
|
|
270
|
-
sectionUsage: Record<ContextPackSectionKey, number>;
|
|
271
|
-
/** Node/question IDs selected for injection, per section. */
|
|
272
|
-
selected: Record<ContextPackSectionKey, string[]>;
|
|
273
265
|
/** Items that were scored but excluded from injection, with reason (RS-2). */
|
|
274
266
|
excludedItems?: Array<{
|
|
275
267
|
id: string;
|
|
@@ -277,86 +269,88 @@ export type ContextPackInjectionPolicy = {
|
|
|
277
269
|
reason: "budget_exceeded" | "anti_repetition" | "below_threshold";
|
|
278
270
|
score: number;
|
|
279
271
|
}>;
|
|
280
|
-
|
|
272
|
+
/** Per-section token budgets derived from SECTION_BUDGET_RATIOS. */
|
|
273
|
+
sectionBudgets: Record<ContextPackSectionKey, number>;
|
|
274
|
+
/** Actual token usage per section after greedy fill. */
|
|
275
|
+
sectionUsage: Record<ContextPackSectionKey, number>;
|
|
276
|
+
/** Node/question IDs selected for injection, per section. */
|
|
277
|
+
selected: Record<ContextPackSectionKey, string[]>;
|
|
278
|
+
/** Total token budget for the entire context pack. */
|
|
279
|
+
tokenBudget: number;
|
|
280
|
+
}
|
|
281
281
|
/** Telemetry for context pack assembly. */
|
|
282
|
-
export
|
|
282
|
+
export interface ContextPackDiagnostics {
|
|
283
283
|
/** Total candidates scored across all sections. */
|
|
284
284
|
itemsScored: number;
|
|
285
285
|
/** Ratio of estimatedTokens / tokenBudget. Range [0, 1+]. */
|
|
286
286
|
tokenBudgetUtilization: number;
|
|
287
|
-
}
|
|
287
|
+
}
|
|
288
288
|
/**
|
|
289
289
|
* Public context surface returned by the SDK-facing context client.
|
|
290
290
|
*
|
|
291
291
|
* This preserves the existing external shape while the canonical compiler
|
|
292
292
|
* contract evolves in parallel as ContextPackV1.
|
|
293
293
|
*/
|
|
294
|
-
export
|
|
294
|
+
export interface PublicContextBelief {
|
|
295
295
|
beliefId: string;
|
|
296
|
-
text: string;
|
|
297
|
-
confidence: number | null;
|
|
298
296
|
beliefType?: string | null;
|
|
297
|
+
confidence: number | null;
|
|
298
|
+
justification?: string;
|
|
299
|
+
score: number;
|
|
299
300
|
status?: string;
|
|
301
|
+
text: string;
|
|
300
302
|
updatedAt?: number | null;
|
|
301
|
-
|
|
303
|
+
}
|
|
304
|
+
export interface PublicContextQuestion {
|
|
302
305
|
justification?: string;
|
|
303
|
-
|
|
304
|
-
export type PublicContextQuestion = {
|
|
306
|
+
priority: string;
|
|
305
307
|
questionId: string;
|
|
306
|
-
|
|
308
|
+
score: number;
|
|
307
309
|
status: string;
|
|
308
|
-
|
|
310
|
+
text: string;
|
|
309
311
|
updatedAt?: number | null;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
export type PublicContextEvidence = {
|
|
312
|
+
}
|
|
313
|
+
export interface PublicContextEvidence {
|
|
314
|
+
createdAt?: number | null;
|
|
314
315
|
evidenceId: string;
|
|
315
|
-
|
|
316
|
-
sourceUrl?: string | null;
|
|
316
|
+
justification?: string;
|
|
317
317
|
kind: string;
|
|
318
|
-
createdAt?: number | null;
|
|
319
318
|
score: number;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
319
|
+
sourceUrl?: string | null;
|
|
320
|
+
text: string;
|
|
321
|
+
}
|
|
322
|
+
export interface PublicContextContradiction {
|
|
323
323
|
contradictionId: string;
|
|
324
|
-
severity: string;
|
|
325
|
-
status: string;
|
|
326
324
|
description: string;
|
|
327
|
-
score: number;
|
|
328
325
|
justification?: string;
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
text?: string;
|
|
326
|
+
score: number;
|
|
327
|
+
severity: string;
|
|
328
|
+
status: string;
|
|
329
|
+
}
|
|
330
|
+
export interface PublicContextEntity {
|
|
335
331
|
connectedBeliefCount: number;
|
|
336
332
|
connectedEvidenceCount: number;
|
|
337
|
-
|
|
333
|
+
entityId: string;
|
|
334
|
+
entityType: string;
|
|
338
335
|
metadata?: Record<string, unknown>;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
336
|
+
score: number;
|
|
337
|
+
text?: string;
|
|
338
|
+
title: string;
|
|
339
|
+
}
|
|
340
|
+
export interface PublicContextInjectionPolicy {
|
|
342
341
|
estimatedTokens: number;
|
|
343
|
-
sectionBudgets: Record<string, number>;
|
|
344
|
-
sectionUsage: Record<string, number>;
|
|
345
|
-
selected: Record<string, string[]>;
|
|
346
342
|
excludedItems?: Array<{
|
|
347
343
|
id: string;
|
|
348
344
|
section: string;
|
|
349
345
|
reason: "budget_exceeded" | "anti_repetition" | "below_threshold";
|
|
350
346
|
score: number;
|
|
351
347
|
}>;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
narrative_id?: string;
|
|
359
|
-
scope?: Record<string, unknown>;
|
|
348
|
+
sectionBudgets: Record<string, number>;
|
|
349
|
+
sectionUsage: Record<string, number>;
|
|
350
|
+
selected: Record<string, string[]>;
|
|
351
|
+
tokenBudget: number;
|
|
352
|
+
}
|
|
353
|
+
export interface PublicContextNarrativeBlock {
|
|
360
354
|
childNarratives?: Array<{
|
|
361
355
|
narrativeId: string;
|
|
362
356
|
narrative_id?: string;
|
|
@@ -365,51 +359,31 @@ export type PublicContextNarrativeBlock = {
|
|
|
365
359
|
summary: string;
|
|
366
360
|
recordsNamed?: number;
|
|
367
361
|
}>;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
kind: string;
|
|
363
|
+
narrative_id?: string;
|
|
364
|
+
narrativeId?: string;
|
|
365
|
+
recordsNamed?: number;
|
|
366
|
+
scope?: Record<string, unknown>;
|
|
367
|
+
text: string;
|
|
368
|
+
}
|
|
369
|
+
export interface PublicContextSupportingObjects {
|
|
371
370
|
activeBeliefs?: PublicContextBelief[];
|
|
372
|
-
openQuestions?: PublicContextQuestion[];
|
|
373
|
-
recentEvidence?: PublicContextEvidence[];
|
|
374
371
|
contradictions?: PublicContextContradiction[];
|
|
375
|
-
relatedEntities?: PublicContextEntity[];
|
|
376
|
-
worktrees?: unknown[];
|
|
377
|
-
lanes?: string[];
|
|
378
372
|
entities?: unknown[];
|
|
379
|
-
};
|
|
380
|
-
export type PublicCompiledContext = {
|
|
381
|
-
contextNarrative: Array<string | PublicContextNarrativeBlock>;
|
|
382
|
-
narrativeCoverage?: Record<string, unknown>;
|
|
383
|
-
synthesisLints?: SynthesisQualityLint[];
|
|
384
|
-
retrievalReceipt?: Record<string, unknown>;
|
|
385
|
-
assemblyReceipt?: Record<string, unknown>;
|
|
386
|
-
supportingObjects?: PublicContextSupportingObjects;
|
|
387
|
-
schemaVersion: string;
|
|
388
|
-
topicId: string;
|
|
389
|
-
topicName: string;
|
|
390
|
-
scopedTopicIds: string[];
|
|
391
|
-
generatedAt: number;
|
|
392
|
-
ranking: ContextRankingProfile;
|
|
393
|
-
summary: Record<string, unknown>;
|
|
394
373
|
invariants?: PublicContextBelief[];
|
|
395
|
-
|
|
374
|
+
lanes?: string[];
|
|
396
375
|
openQuestions?: PublicContextQuestion[];
|
|
397
376
|
recentEvidence?: PublicContextEvidence[];
|
|
398
|
-
contradictions?: PublicContextContradiction[];
|
|
399
377
|
relatedEntities?: PublicContextEntity[];
|
|
400
|
-
|
|
401
|
-
|
|
378
|
+
worktrees?: unknown[];
|
|
379
|
+
}
|
|
380
|
+
export interface PublicCompiledContext {
|
|
381
|
+
activeBeliefs?: PublicContextBelief[];
|
|
382
|
+
appliedWeightOverrides?: unknown[];
|
|
383
|
+
assemblyReceipt?: Record<string, unknown>;
|
|
402
384
|
compilationMode?: string;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
attemptId: string;
|
|
406
|
-
approach: string;
|
|
407
|
-
outcome: string;
|
|
408
|
-
recordedAt: number;
|
|
409
|
-
score: number;
|
|
410
|
-
}>;
|
|
411
|
-
suppressedIds: string[];
|
|
412
|
-
};
|
|
385
|
+
contextNarrative: Array<string | PublicContextNarrativeBlock>;
|
|
386
|
+
contradictions?: PublicContextContradiction[];
|
|
413
387
|
deltaReport?: {
|
|
414
388
|
changedItems: Array<{
|
|
415
389
|
id: string;
|
|
@@ -424,8 +398,34 @@ export type PublicCompiledContext = {
|
|
|
424
398
|
}>;
|
|
425
399
|
referencePoint: string;
|
|
426
400
|
};
|
|
427
|
-
|
|
428
|
-
|
|
401
|
+
diagnostics: Record<string, unknown>;
|
|
402
|
+
failureContext?: {
|
|
403
|
+
failures: Array<{
|
|
404
|
+
attemptId: string;
|
|
405
|
+
approach: string;
|
|
406
|
+
outcome: string;
|
|
407
|
+
recordedAt: number;
|
|
408
|
+
score: number;
|
|
409
|
+
}>;
|
|
410
|
+
suppressedIds: string[];
|
|
411
|
+
};
|
|
412
|
+
generatedAt: number;
|
|
413
|
+
injectionPolicy: PublicContextInjectionPolicy;
|
|
414
|
+
invariants?: PublicContextBelief[];
|
|
415
|
+
narrativeCoverage?: Record<string, unknown>;
|
|
416
|
+
openQuestions?: PublicContextQuestion[];
|
|
417
|
+
ranking: ContextRankingProfile;
|
|
418
|
+
recentEvidence?: PublicContextEvidence[];
|
|
419
|
+
relatedEntities?: PublicContextEntity[];
|
|
420
|
+
retrievalReceipt?: Record<string, unknown>;
|
|
421
|
+
schemaVersion: string;
|
|
422
|
+
scopedTopicIds: string[];
|
|
423
|
+
summary: Record<string, unknown>;
|
|
424
|
+
supportingObjects?: PublicContextSupportingObjects;
|
|
425
|
+
synthesisLints?: SynthesisQualityLint[];
|
|
426
|
+
topicId: string;
|
|
427
|
+
topicName: string;
|
|
428
|
+
}
|
|
429
429
|
/**
|
|
430
430
|
* The canonical output schema for context compilation responses.
|
|
431
431
|
*
|
|
@@ -433,88 +433,88 @@ export type PublicCompiledContext = {
|
|
|
433
433
|
* in the output. Adding optional fields is non-breaking; removing or
|
|
434
434
|
* changing types is breaking (requires version bump).
|
|
435
435
|
*/
|
|
436
|
-
export
|
|
437
|
-
/**
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
|
|
436
|
+
export interface ContextPackV1 {
|
|
437
|
+
/** Active beliefs ranked by query relevance. */
|
|
438
|
+
activeBeliefs: ContextPackBelief[];
|
|
439
|
+
/** Pack weight overrides applied during ranking (RS-2). */
|
|
440
|
+
appliedWeightOverrides?: PackWeightOverride[];
|
|
441
|
+
/** Compilation mode used to generate this pack (RS-2). Default: "standard". */
|
|
442
|
+
compilationMode?: ContextCompilationMode;
|
|
443
|
+
/** Concise instructions for agent context injection. */
|
|
444
|
+
contextNarrative: Array<string | PublicContextNarrativeBlock>;
|
|
445
|
+
/** Active contradictions ranked by severity. */
|
|
446
|
+
contradictions: ContextPackContradiction[];
|
|
447
|
+
/** Delta report (RS-2). Present only when compilationMode = "delta". */
|
|
448
|
+
deltaReport?: ContextPackDeltaReport;
|
|
449
|
+
/** Assembly telemetry. */
|
|
450
|
+
diagnostics: ContextPackDiagnostics;
|
|
451
|
+
/** Failure context for anti-repetition (RS-2). Present when failures are relevant. */
|
|
452
|
+
failureContext?: ContextPackFailureContext;
|
|
445
453
|
/** Deterministic freshness watermark for this pack (ms since epoch). */
|
|
446
454
|
generatedAt: number;
|
|
447
|
-
/**
|
|
448
|
-
|
|
449
|
-
/** Aggregate counts and health signals. */
|
|
450
|
-
summary: ContextPackSummary;
|
|
455
|
+
/** Token-budgeted injection selections. */
|
|
456
|
+
injectionPolicy: ContextPackInjectionPolicy;
|
|
451
457
|
/** High-confidence invariant beliefs (beliefType = "invariant"). */
|
|
452
458
|
invariants: ContextPackBelief[];
|
|
453
|
-
/** Active beliefs ranked by query relevance. */
|
|
454
|
-
activeBeliefs: ContextPackBelief[];
|
|
455
459
|
/** Open questions ranked by relevance and priority. */
|
|
456
460
|
openQuestions: ContextPackQuestion[];
|
|
461
|
+
/** Which ranking profile was used. */
|
|
462
|
+
rankingProfile: ContextRankingProfile;
|
|
457
463
|
/** Recent evidence ranked by relevance and recency. */
|
|
458
464
|
recentEvidence: ContextPackEvidence[];
|
|
459
|
-
/** Active contradictions ranked by severity. */
|
|
460
|
-
contradictions: ContextPackContradiction[];
|
|
461
465
|
/**
|
|
462
466
|
* Ontological entities connected to beliefs in scope, ranked by connectivity.
|
|
463
467
|
* Optional — present when entity graph substrate is active for this topic.
|
|
464
468
|
* NON-BREAKING addition per contract rules.
|
|
465
469
|
*/
|
|
466
470
|
relatedEntities?: ContextPackEntity[];
|
|
467
|
-
/**
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
deltaReport?: ContextPackDeltaReport;
|
|
479
|
-
/** Pack weight overrides applied during ranking (RS-2). */
|
|
480
|
-
appliedWeightOverrides?: PackWeightOverride[];
|
|
481
|
-
};
|
|
471
|
+
/** Schema version for compatibility checking. */
|
|
472
|
+
schemaVersion: typeof CONTEXT_PACK_SCHEMA_VERSION;
|
|
473
|
+
/** All topic IDs included in the neighborhood expansion. */
|
|
474
|
+
scopedTopicIds: string[];
|
|
475
|
+
/** Aggregate counts and health signals. */
|
|
476
|
+
summary: ContextPackSummary;
|
|
477
|
+
/** Resolved topic ID after scope resolution. */
|
|
478
|
+
topicId: string;
|
|
479
|
+
/** Human-readable topic name. */
|
|
480
|
+
topicName: string;
|
|
481
|
+
}
|
|
482
482
|
/**
|
|
483
483
|
* The canonical input schema for `compile_context`.
|
|
484
484
|
* `topicId` is the only scope identifier.
|
|
485
485
|
*/
|
|
486
|
-
export
|
|
487
|
-
/**
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
486
|
+
export interface ContextPackRequestV1 {
|
|
487
|
+
/**
|
|
488
|
+
* Maximum carrier topics to enrich with raw belief/question/evidence rows for
|
|
489
|
+
* explicit dimension-seeded compiles. The full dimension is still synthesized
|
|
490
|
+
* through worktrees and receipts; this only bounds raw content fan-out.
|
|
491
|
+
*/
|
|
492
|
+
contentTopicLimit?: number;
|
|
493
|
+
/** Include ontological entities connected to beliefs in scope. Default: true. */
|
|
494
|
+
includeEntities?: boolean;
|
|
495
|
+
/** Include failure log context for anti-repetition (RS-2). Default: false. */
|
|
496
|
+
includeFailures?: boolean;
|
|
491
497
|
/** Max items per section. Default: DEFAULT_SECTION_LIMIT. */
|
|
492
498
|
limit?: number;
|
|
493
|
-
/** Ranking profile. Default: DEFAULT_RANKING_PROFILE. */
|
|
494
|
-
rankingProfile?: ContextRankingProfile;
|
|
495
|
-
/** Total token budget. Default: DEFAULT_TOKEN_BUDGET. */
|
|
496
|
-
tokenBudget?: number;
|
|
497
499
|
/** Descendant topic depth for neighborhood expansion. */
|
|
498
500
|
maxDepth?: number;
|
|
499
|
-
/** Include ontological entities connected to beliefs in scope. Default: true. */
|
|
500
|
-
includeEntities?: boolean;
|
|
501
501
|
/** Compilation mode (RS-2). Default: "standard". */
|
|
502
502
|
mode?: ContextCompilationMode;
|
|
503
|
-
/** Include failure log context for anti-repetition (RS-2). Default: false. */
|
|
504
|
-
includeFailures?: boolean;
|
|
505
|
-
/** Active worktree ID for delta mode reference point (RS-2). */
|
|
506
|
-
worktreeId?: string;
|
|
507
|
-
/** Session ID for anti-repetition dedup (RS-2). */
|
|
508
|
-
sessionId?: string;
|
|
509
503
|
/** Pack weight overrides from domain pack binding (RS-2). */
|
|
510
504
|
packWeightOverrides?: PackWeightOverride[];
|
|
511
|
-
/**
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
505
|
+
/** Focus query for relevance ranking. */
|
|
506
|
+
query?: string;
|
|
507
|
+
/** Ranking profile. Default: DEFAULT_RANKING_PROFILE. */
|
|
508
|
+
rankingProfile?: ContextRankingProfile;
|
|
509
|
+
/** Session ID for anti-repetition dedup (RS-2). */
|
|
510
|
+
sessionId?: string;
|
|
511
|
+
/** Total token budget. Default: DEFAULT_TOKEN_BUDGET. */
|
|
512
|
+
tokenBudget?: number;
|
|
513
|
+
/** Topic scope ID (required). */
|
|
514
|
+
topicId: string;
|
|
515
|
+
/** Active worktree ID for delta mode reference point (RS-2). */
|
|
516
|
+
worktreeId?: string;
|
|
517
|
+
}
|
|
518
518
|
/**
|
|
519
519
|
* Question statuses that are considered "resolved" (not open).
|
|
520
520
|
* Used to filter which questions appear in the openQuestions section.
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
// biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
|
|
2
|
+
// biome-ignore-all lint/performance/noBarrelFile: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the facade/barrel export is intentional.
|
|
1
3
|
export * from "./context-pack.contract.js";
|
|
2
4
|
//# sourceMappingURL=contextPack.js.map
|
|
@@ -4,8 +4,8 @@ export * from "./contextPack";
|
|
|
4
4
|
export * from "./lensFilter";
|
|
5
5
|
export * from "./lensWorkflow";
|
|
6
6
|
export * from "./mcpTools";
|
|
7
|
-
export * as mcpToolsContract from "./tool-contracts";
|
|
8
7
|
export * from "./prompt";
|
|
9
8
|
export * as sdkToolsContract from "./sdk-tools.contract";
|
|
9
|
+
export * as mcpToolsContract from "./tool-contracts";
|
|
10
10
|
export * from "./workflowRuntime";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/contracts/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
// biome-ignore-all lint/performance/noBarrelFile: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the facade/barrel export is intentional.
|
|
1
2
|
export * from "./api-enums.contract.js";
|
|
2
3
|
export * from "./auth-session.contract.js";
|
|
3
4
|
export * from "./contextPack.js";
|
|
4
5
|
export * from "./lensFilter.js";
|
|
5
6
|
export * from "./lensWorkflow.js";
|
|
6
7
|
export * from "./mcpTools.js";
|
|
7
|
-
export * as mcpToolsContract from "./tool-contracts.js";
|
|
8
8
|
export * from "./prompt.js";
|
|
9
9
|
export * as sdkToolsContract from "./sdk-tools.contract.js";
|
|
10
|
+
export * as mcpToolsContract from "./tool-contracts.js";
|
|
10
11
|
export * from "./workflowRuntime.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|