@lucern/sdk 0.3.0-alpha.0 → 0.3.0-alpha.10
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 +3 -0
- package/README.md +84 -25
- package/dist/adminClient.d.ts +10 -8
- package/dist/adminClient.js +242 -39
- package/dist/adminClient.js.map +1 -1
- package/dist/answersClient.d.ts +2 -0
- package/dist/answersClient.js +221 -11
- package/dist/answersClient.js.map +1 -1
- package/dist/audience/index.d.ts +2 -1
- package/dist/audience/index.js +1 -3
- package/dist/audience/index.js.map +1 -1
- package/dist/audiencesClient.d.ts +18 -16
- package/dist/audiencesClient.js +297 -90
- package/dist/audiencesClient.js.map +1 -1
- package/dist/auditClient.d.ts +2 -0
- package/dist/auditClient.js +227 -15
- package/dist/auditClient.js.map +1 -1
- package/dist/authContext.d.ts +56 -0
- package/dist/authContext.js +170 -0
- package/dist/authContext.js.map +1 -0
- package/dist/authDeviceClient.d.ts +49 -0
- package/dist/authDeviceClient.js +121 -0
- package/dist/authDeviceClient.js.map +1 -0
- package/dist/beliefs/index.d.ts +31 -11
- package/dist/beliefs/index.js +3347 -1109
- package/dist/beliefs/index.js.map +1 -1
- package/dist/beliefsClient.d.ts +18 -31
- package/dist/beliefsClient.js +264 -97
- package/dist/beliefsClient.js.map +1 -1
- package/dist/boundaryClientSurface.d.ts +20 -0
- package/dist/boundaryClientSurface.js +73 -0
- package/dist/boundaryClientSurface.js.map +1 -0
- package/dist/client.d.ts +2969 -27
- package/dist/client.js +3347 -1109
- package/dist/client.js.map +1 -1
- package/dist/clientHelpers.d.ts +48 -0
- package/dist/clientHelpers.js +137 -0
- package/dist/clientHelpers.js.map +1 -0
- package/dist/contextClient.d.ts +6 -3
- package/dist/contextClient.js +252 -30
- package/dist/contextClient.js.map +1 -1
- package/dist/contextFacade.js +25 -16
- package/dist/contextFacade.js.map +1 -1
- package/dist/contextPackCompiler.js +19 -30
- package/dist/contextPackCompiler.js.map +1 -1
- package/dist/contextPackPolicy.js +7 -17
- package/dist/contextPackPolicy.js.map +1 -1
- package/dist/contextTypes.d.ts +2 -0
- package/dist/contracts/api-enums.contract.d.ts +1 -1
- package/dist/contracts/api-enums.contract.js.map +1 -1
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +109 -5
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/lens-filter.contract.js +4 -3
- package/dist/contracts/lens-filter.contract.js.map +1 -1
- package/dist/contracts/lens-workflow.contract.js +4 -3
- package/dist/contracts/lens-workflow.contract.js.map +1 -1
- package/dist/contracts/lensFilter.js +4 -3
- package/dist/contracts/lensFilter.js.map +1 -1
- package/dist/contracts/lensWorkflow.js +4 -3
- package/dist/contracts/lensWorkflow.js.map +1 -1
- package/dist/contracts/mcpTools.d.ts +46 -1
- package/dist/contracts/mcpTools.js +102 -0
- package/dist/contracts/mcpTools.js.map +1 -1
- package/dist/contracts/workflow-runtime.contract.js +1 -1
- package/dist/contracts/workflow-runtime.contract.js.map +1 -1
- package/dist/contracts/workflowRuntime.js +1 -1
- package/dist/contracts/workflowRuntime.js.map +1 -1
- package/dist/contradictions/index.d.ts +24 -4
- package/dist/contradictions/index.js +3347 -1109
- package/dist/contradictions/index.js.map +1 -1
- package/dist/coreClient.d.ts +11 -1
- package/dist/coreClient.js +222 -14
- package/dist/coreClient.js.map +1 -1
- package/dist/decisions/index.d.ts +34 -14
- package/dist/decisions/index.js +3347 -1109
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisionsClient.d.ts +6 -12
- package/dist/decisionsClient.js +235 -37
- package/dist/decisionsClient.js.map +1 -1
- package/dist/edges/index.d.ts +47 -87
- package/dist/edges/index.js +3347 -1109
- package/dist/edges/index.js.map +1 -1
- package/dist/embeddingsClient.d.ts +106 -0
- package/dist/embeddingsClient.js +731 -0
- package/dist/embeddingsClient.js.map +1 -0
- package/dist/eventingClient.d.ts +96 -0
- package/dist/eventingClient.js +728 -0
- package/dist/eventingClient.js.map +1 -0
- package/dist/events.js +6 -3
- package/dist/events.js.map +1 -1
- package/dist/eventsCore.d.ts +3 -1
- package/dist/eventsCore.js +222 -14
- package/dist/eventsCore.js.map +1 -1
- package/dist/evidence/index.d.ts +25 -4
- package/dist/evidence/index.js +3347 -1109
- package/dist/evidence/index.js.map +1 -1
- package/dist/evidenceClient.d.ts +2 -0
- package/dist/evidenceClient.js +222 -14
- package/dist/evidenceClient.js.map +1 -1
- package/dist/facade/context.d.ts +2 -1
- package/dist/facade/context.js +25 -16
- package/dist/facade/context.js.map +1 -1
- package/dist/functionSurface.d.ts +143 -0
- package/dist/functionSurface.js +1204 -0
- package/dist/functionSurface.js.map +1 -0
- package/dist/functionSurfaceClient.d.ts +8 -0
- package/dist/functionSurfaceClient.js +1204 -0
- package/dist/functionSurfaceClient.js.map +1 -0
- package/dist/gatewayFacades.d.ts +81 -52
- package/dist/gatewayFacades.js +483 -169
- package/dist/gatewayFacades.js.map +1 -1
- package/dist/graphAnalysisClient.d.ts +192 -0
- package/dist/graphAnalysisClient.js +799 -0
- package/dist/graphAnalysisClient.js.map +1 -0
- package/dist/graphClient.d.ts +7 -13
- package/dist/graphClient.js +244 -45
- package/dist/graphClient.js.map +1 -1
- package/dist/graphIntel.d.ts +3 -0
- package/dist/graphIntel.js +3 -0
- package/dist/graphIntel.js.map +1 -0
- package/dist/graphIntelligence.d.ts +2 -0
- package/dist/graphIntelligence.js +47 -0
- package/dist/graphIntelligence.js.map +1 -0
- package/dist/graphRecommendationsClient.d.ts +56 -0
- package/dist/graphRecommendationsClient.js +664 -0
- package/dist/graphRecommendationsClient.js.map +1 -0
- package/dist/graphStateClassifierClient.d.ts +73 -0
- package/dist/graphStateClassifierClient.js +716 -0
- package/dist/graphStateClassifierClient.js.map +1 -0
- package/dist/harnessClient.d.ts +15 -24
- package/dist/harnessClient.js +235 -42
- package/dist/harnessClient.js.map +1 -1
- package/dist/identityClient.d.ts +97 -11
- package/dist/identityClient.js +409 -33
- package/dist/identityClient.js.map +1 -1
- package/dist/index.d.ts +29 -6
- package/dist/index.js +3936 -1155
- package/dist/index.js.map +1 -1
- package/dist/infisicalRuntime.d.ts +42 -0
- package/dist/infisicalRuntime.js +314 -0
- package/dist/infisicalRuntime.js.map +1 -0
- package/dist/jobsClient.d.ts +98 -0
- package/dist/jobsClient.js +726 -0
- package/dist/jobsClient.js.map +1 -0
- package/dist/learningClient.d.ts +8 -6
- package/dist/learningClient.js +252 -44
- package/dist/learningClient.js.map +1 -1
- package/dist/lenses/index.d.ts +82 -42
- package/dist/lenses/index.js +3347 -1109
- package/dist/lenses/index.js.map +1 -1
- package/dist/mcpClient.d.ts +28 -0
- package/dist/mcpClient.js +668 -0
- package/dist/mcpClient.js.map +1 -0
- package/dist/modelRuntimeClient.d.ts +72 -0
- package/dist/modelRuntimeClient.js +704 -0
- package/dist/modelRuntimeClient.js.map +1 -0
- package/dist/nodes/index.d.ts +63 -21
- package/dist/nodes/index.js +3347 -1109
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +53 -32
- package/dist/ontologies/index.js +3347 -1109
- package/dist/ontologies/index.js.map +1 -1
- package/dist/ontologyClient.d.ts +19 -25
- package/dist/ontologyClient.js +258 -40
- package/dist/ontologyClient.js.map +1 -1
- package/dist/ontologyLinksClient.d.ts +71 -0
- package/dist/ontologyLinksClient.js +697 -0
- package/dist/ontologyLinksClient.js.map +1 -0
- package/dist/opinion.d.ts +2 -2
- package/dist/opinion.js +4 -4
- package/dist/opinion.js.map +1 -1
- package/dist/orgGraphSearchClient.d.ts +85 -0
- package/dist/orgGraphSearchClient.js +672 -0
- package/dist/orgGraphSearchClient.js.map +1 -0
- package/dist/packsClient.d.ts +11 -23
- package/dist/packsClient.js +234 -46
- package/dist/packsClient.js.map +1 -1
- package/dist/policyClient.d.ts +13 -10
- package/dist/policyClient.js +243 -25
- package/dist/policyClient.js.map +1 -1
- package/dist/questions/index.d.ts +24 -4
- package/dist/questions/index.js +3347 -1109
- package/dist/questions/index.js.map +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/reportsClient.d.ts +9 -7
- package/dist/reportsClient.js +281 -53
- package/dist/reportsClient.js.map +1 -1
- package/dist/schemaClient.d.ts +5 -3
- package/dist/schemaClient.js +235 -29
- package/dist/schemaClient.js.map +1 -1
- package/dist/sdkSurface.d.ts +8 -3
- package/dist/sdkSurface.js +10 -6
- package/dist/sdkSurface.js.map +1 -1
- package/dist/sourcesClient.d.ts +2 -0
- package/dist/sourcesClient.js +222 -14
- package/dist/sourcesClient.js.map +1 -1
- package/dist/telemetryClient.d.ts +94 -0
- package/dist/telemetryClient.js +741 -0
- package/dist/telemetryClient.js.map +1 -0
- package/dist/toolRegistryClient.d.ts +115 -0
- package/dist/toolRegistryClient.js +767 -0
- package/dist/toolRegistryClient.js.map +1 -0
- package/dist/topics/index.d.ts +35 -9
- package/dist/topics/index.js +3349 -1109
- package/dist/topics/index.js.map +1 -1
- package/dist/topicsClient.d.ts +4 -0
- package/dist/topicsClient.js +237 -24
- package/dist/topicsClient.js.map +1 -1
- package/dist/types.d.ts +12 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/workflowClient.d.ts +76 -45
- package/dist/workflowClient.js +262 -65
- package/dist/workflowClient.js.map +1 -1
- package/dist/worktrees/index.d.ts +78 -39
- package/dist/worktrees/index.js +3347 -1109
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +13 -3
- package/dist/client-DAuKnDlx.d.ts +0 -2547
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,9 @@ All notable changes to `@lucern/sdk` will be documented in this file.
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
- No unreleased changes yet.
|
|
7
7
|
|
|
8
|
+
## [0.3.0-alpha.7] - 2026-05-03
|
|
9
|
+
- Rebuild the coherent Lucern package line after Campaign 1 SDK hardening fixes.
|
|
10
|
+
|
|
8
11
|
## [0.2.0-alpha.5] - 2026-04-18
|
|
9
12
|
- Refresh publish from current stackos source under EK-16 T4.
|
|
10
13
|
- Version-numbering note: 0.2.0-alpha.2 through 0.2.0-alpha.5 were published from earlier stackos source on 2026-04-12 by pete_c. This release (alpha.5) is the first to ship the current April 18 source — 56 commits of accumulated changes from the code-separation track.
|
package/README.md
CHANGED
|
@@ -10,6 +10,31 @@ Lucern gives your agents a reasoning graph that accumulates understanding across
|
|
|
10
10
|
npm install @lucern/sdk
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Install Model
|
|
14
|
+
|
|
15
|
+
`@lucern/sdk` is the primary TypeScript app dependency. Installing it also
|
|
16
|
+
installs its internal runtime dependencies, including Lucern contracts and
|
|
17
|
+
reasoning-kernel helpers, but a tenant should still list any `@lucern/*`
|
|
18
|
+
package that its own code or scripts import or execute.
|
|
19
|
+
|
|
20
|
+
Common direct installs:
|
|
21
|
+
|
|
22
|
+
| Need | Install |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Programmatic Lucern API calls | `@lucern/sdk` |
|
|
25
|
+
| Tool access checks | `@lucern/access-control` |
|
|
26
|
+
| React hooks/components | `@lucern/react @lucern/sdk` |
|
|
27
|
+
| Convex component binding | `@lucern/identity @lucern/reasoning-kernel` |
|
|
28
|
+
| Bootstrap, auth, doctor, and operator commands | `@lucern/cli` |
|
|
29
|
+
| Agent-facing MCP server/runtime | `@lucern/mcp` |
|
|
30
|
+
| Full design-partner/package-suite pin | all packages from `TENANT_CLIENT_INSTALLABLE_PACKAGES` in `@lucern/contracts` |
|
|
31
|
+
|
|
32
|
+
The difference matters: `@lucern/cli` is a direct install because it provides
|
|
33
|
+
the `lucern` binary, but tenant app source should not import it. The Convex
|
|
34
|
+
component packages are direct installs for `convex.config.ts`, while application
|
|
35
|
+
code should stay on `@lucern/sdk`, `@lucern/react`, `@lucern/mcp`,
|
|
36
|
+
`@lucern/access-control`, `@lucern/contracts`, and `@lucern/types`.
|
|
37
|
+
|
|
13
38
|
## Canonical Interface
|
|
14
39
|
|
|
15
40
|
`@lucern/sdk` is the canonical public interface for Lucern.
|
|
@@ -27,6 +52,7 @@ IA-7 closes the remaining SDK surface gaps needed for SDK-first clients:
|
|
|
27
52
|
```typescript
|
|
28
53
|
import {
|
|
29
54
|
createLucernClient,
|
|
55
|
+
opinionFromDogmatic,
|
|
30
56
|
type PlatformBeliefRecord,
|
|
31
57
|
type SdkPrincipalContext,
|
|
32
58
|
type WorkflowWorktreeRecord,
|
|
@@ -87,45 +113,54 @@ const topicId = securityTopic.data.topicId;
|
|
|
87
113
|
// A fact — verified and anchored
|
|
88
114
|
const sqlFact = await lucern.beliefs.create({
|
|
89
115
|
topicId,
|
|
90
|
-
baseRate: 0.5,
|
|
91
116
|
canonicalText: "Parameterized queries prevent SQL injection in all major database drivers",
|
|
92
117
|
beliefType: "fact",
|
|
93
118
|
});
|
|
119
|
+
const sqlFactEvidence = await lucern.evidence.create({
|
|
120
|
+
topicId,
|
|
121
|
+
text: "OWASP SQL Injection Prevention guidance identifies parameterized queries as the primary defense.",
|
|
122
|
+
sourceUrl: "https://owasp.org/www-community/attacks/SQL_Injection",
|
|
123
|
+
targetId: sqlFact.data.nodeId,
|
|
124
|
+
weight: 1,
|
|
125
|
+
});
|
|
94
126
|
await lucern.beliefs.modulateConfidence(sqlFact.data.nodeId, {
|
|
95
|
-
|
|
127
|
+
opinion: opinionFromDogmatic(0.95, 0.5),
|
|
96
128
|
trigger: "evidence_added",
|
|
129
|
+
triggeringEvidenceId: sqlFactEvidence.data.nodeId,
|
|
97
130
|
rationale: "OWASP verified, industry standard for 20+ years",
|
|
98
131
|
});
|
|
99
132
|
|
|
100
133
|
// A belief — confident from observation
|
|
101
134
|
const patternBelief = await lucern.beliefs.create({
|
|
102
135
|
topicId,
|
|
103
|
-
baseRate: 0.5,
|
|
104
136
|
canonicalText: "Most security vulnerabilities in our codebase come from unvalidated user input at API boundaries, not from cryptographic weaknesses",
|
|
105
137
|
});
|
|
138
|
+
const patternEvidence = await lucern.evidence.create({
|
|
139
|
+
topicId,
|
|
140
|
+
text: "Last 6 months of security audits found 14 input validation issues and 1 cryptographic issue.",
|
|
141
|
+
sourceUrl: "audit://security/findings-last-6-months",
|
|
142
|
+
targetId: patternBelief.data.nodeId,
|
|
143
|
+
weight: 0.82,
|
|
144
|
+
});
|
|
106
145
|
await lucern.beliefs.modulateConfidence(patternBelief.data.nodeId, {
|
|
107
|
-
|
|
146
|
+
opinion: opinionFromDogmatic(0.82, 0.5),
|
|
108
147
|
trigger: "evidence_added",
|
|
148
|
+
triggeringEvidenceId: patternEvidence.data.nodeId,
|
|
109
149
|
rationale: "Last 6 months of security audits: 14 input validation issues, 1 crypto issue",
|
|
110
150
|
});
|
|
111
151
|
|
|
112
152
|
// A hypothesis — under active testing
|
|
113
153
|
const hypothesis = await lucern.beliefs.create({
|
|
114
154
|
topicId,
|
|
115
|
-
baseRate: 0.5,
|
|
116
155
|
canonicalText: "Automated static analysis catches fewer than 30% of the input validation vulnerabilities that human reviewers find",
|
|
117
156
|
beliefType: "hypothesis",
|
|
118
157
|
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
trigger: "manual",
|
|
122
|
-
rationale: "Anecdotal — need to run a proper comparison study",
|
|
123
|
-
});
|
|
158
|
+
// This remains at the default vacuous prior until evidence or an answered
|
|
159
|
+
// question records what the comparison study found.
|
|
124
160
|
|
|
125
161
|
// An assumption — untested but used as a basis for decisions
|
|
126
162
|
const assumption = await lucern.beliefs.create({
|
|
127
163
|
topicId,
|
|
128
|
-
baseRate: 0.5,
|
|
129
164
|
canonicalText: "Our CI pipeline runs all static analysis rules on every PR",
|
|
130
165
|
beliefType: "assumption",
|
|
131
166
|
});
|
|
@@ -202,7 +237,7 @@ Your agent processes the results and commits evidence to the graph.
|
|
|
202
237
|
|
|
203
238
|
```typescript
|
|
204
239
|
// Static analysis results
|
|
205
|
-
await lucern.evidence.create({
|
|
240
|
+
const staticEvidence = await lucern.evidence.create({
|
|
206
241
|
topicId,
|
|
207
242
|
text: "Semgrep + CodeQL found 23 issues across 50 PRs. 18 were true positives. Categories: 12 input validation, 4 auth bypass patterns, 2 information disclosure.",
|
|
208
243
|
sourceUrl: "ci://semgrep-run/batch-50pr-comparison",
|
|
@@ -211,7 +246,7 @@ await lucern.evidence.create({
|
|
|
211
246
|
});
|
|
212
247
|
|
|
213
248
|
// Human review results
|
|
214
|
-
await lucern.evidence.create({
|
|
249
|
+
const humanEvidence = await lucern.evidence.create({
|
|
215
250
|
topicId,
|
|
216
251
|
text: "Two senior engineers found 41 issues across the same 50 PRs (34 unique after dedup). Categories: 22 input validation, 7 business logic flaws, 3 auth, 2 race conditions.",
|
|
217
252
|
sourceUrl: "review://manual-audit/batch-50pr",
|
|
@@ -227,7 +262,7 @@ const comparisonQuestion = await lucern.questions.create({
|
|
|
227
262
|
linkedBeliefId: hypothesis.data.nodeId,
|
|
228
263
|
});
|
|
229
264
|
|
|
230
|
-
await lucern.questions.answer(comparisonQuestion.data.questionId, {
|
|
265
|
+
const comparisonAnswer = await lucern.questions.answer(comparisonQuestion.data.questionId, {
|
|
231
266
|
text: "Static analysis caught 18 of 34 unique issues (53%). However, it missed all 7 business logic flaws and both race conditions — categories where it found 0%.",
|
|
232
267
|
confidence: "strong",
|
|
233
268
|
evidenceIds: [staticEvidence.data.nodeId, humanEvidence.data.nodeId],
|
|
@@ -241,8 +276,9 @@ The original hypothesis said "less than 30%." The data shows 53% — but the sto
|
|
|
241
276
|
```typescript
|
|
242
277
|
// Drop confidence on the original (it was too pessimistic about overall catch rate)
|
|
243
278
|
await lucern.beliefs.modulateConfidence(hypothesis.data.nodeId, {
|
|
244
|
-
|
|
279
|
+
opinion: opinionFromDogmatic(0.2, 0.5),
|
|
245
280
|
trigger: "evidence_added",
|
|
281
|
+
triggeringEvidenceId: humanEvidence.data.nodeId,
|
|
246
282
|
rationale: "Static analysis catches 53% overall, not <30%. But the category breakdown reveals something more important.",
|
|
247
283
|
});
|
|
248
284
|
|
|
@@ -253,22 +289,24 @@ const evolved = await lucern.beliefs.fork(hypothesis.data.nodeId, {
|
|
|
253
289
|
});
|
|
254
290
|
|
|
255
291
|
await lucern.beliefs.modulateConfidence(evolved.data.nodeId, {
|
|
256
|
-
|
|
292
|
+
opinion: opinionFromDogmatic(0.88, 0.5),
|
|
257
293
|
trigger: "evidence_added",
|
|
294
|
+
triggeringEvidenceId: humanEvidence.data.nodeId,
|
|
295
|
+
triggeringAnswerId: comparisonAnswer.data.answerId,
|
|
258
296
|
rationale: "Direct comparison data: 0/7 business logic flaws caught, 0/2 race conditions caught, while input validation catch rate was 12/22 (55%)",
|
|
259
297
|
});
|
|
260
298
|
|
|
261
299
|
// This creates a new actionable belief
|
|
262
300
|
const actionable = await lucern.beliefs.create({
|
|
263
301
|
topicId,
|
|
264
|
-
baseRate: 0.5,
|
|
265
302
|
canonicalText: "Human code review should focus on business logic and concurrency — the categories where static analysis provides zero coverage",
|
|
266
303
|
beliefType: "belief",
|
|
267
304
|
});
|
|
268
305
|
|
|
269
306
|
await lucern.beliefs.modulateConfidence(actionable.data.nodeId, {
|
|
270
|
-
|
|
307
|
+
opinion: opinionFromDogmatic(0.85, 0.5),
|
|
271
308
|
trigger: "worktree_outcome",
|
|
309
|
+
triggeringWorktreeId: investigation.data.worktreeId,
|
|
272
310
|
rationale: "Direct implication of the comparison study findings",
|
|
273
311
|
});
|
|
274
312
|
|
|
@@ -288,7 +326,7 @@ await lucern.graph.createEdge({
|
|
|
288
326
|
Before your agent starts its next session, it reads the graph:
|
|
289
327
|
|
|
290
328
|
```typescript
|
|
291
|
-
const context = await lucern.context.compile(
|
|
329
|
+
const context = await lucern.context.compile({
|
|
292
330
|
query: "code review strategy and static analysis coverage",
|
|
293
331
|
ranking: "weighted_v1",
|
|
294
332
|
tokenBudget: 2000,
|
|
@@ -350,6 +388,28 @@ lucern.identity // API keys and sessions
|
|
|
350
388
|
|
|
351
389
|
The graph doesn't just store knowledge — it analyzes itself.
|
|
352
390
|
|
|
391
|
+
### Query Suite
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
// Discover the prompt-backed Graph Intelligence recipes tenants can expose in
|
|
395
|
+
// their own UI or model workflows.
|
|
396
|
+
const catalog = await lucern.graphAnalysis.listGraphIntelligenceQueries();
|
|
397
|
+
|
|
398
|
+
// Run a named recipe. Lucern returns the resolved prompt, deterministic graph
|
|
399
|
+
// analysis bundle, sampled graph context, and public tool plan for LLM synthesis.
|
|
400
|
+
const preMortem = await lucern.graphAnalysis.runGraphIntelligenceQuery({
|
|
401
|
+
topicId,
|
|
402
|
+
queryId: "pre-mortem",
|
|
403
|
+
limit: 25,
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
await modelMachine.run({
|
|
407
|
+
prompt: preMortem.data.prompt,
|
|
408
|
+
context: preMortem.data.analysis,
|
|
409
|
+
tools: preMortem.data.toolPlan,
|
|
410
|
+
});
|
|
411
|
+
```
|
|
412
|
+
|
|
353
413
|
### Structural Analysis
|
|
354
414
|
|
|
355
415
|
```typescript
|
|
@@ -432,7 +492,7 @@ traversal.data.nodes.forEach(node => {
|
|
|
432
492
|
### Inject Reasoning Context Into Any LLM Call
|
|
433
493
|
|
|
434
494
|
```typescript
|
|
435
|
-
const context = await lucern.context.compile(
|
|
495
|
+
const context = await lucern.context.compile({
|
|
436
496
|
query: "security review priorities",
|
|
437
497
|
ranking: "weighted_v1",
|
|
438
498
|
tokenBudget: 3000,
|
|
@@ -543,7 +603,7 @@ architectural decisions, check the reasoning graph:
|
|
|
543
603
|
|
|
544
604
|
- Read current beliefs: `lucern.beliefs.list({ topicId: "..." })`
|
|
545
605
|
- Check for contradictions: `lucern.contradictions.list({ topicId: "..." })`
|
|
546
|
-
- Compile context before analysis: `lucern.context.compile(
|
|
606
|
+
- Compile context before analysis: `lucern.context.compile({ query: "..." })`
|
|
547
607
|
|
|
548
608
|
After making decisions, write them back:
|
|
549
609
|
- Create beliefs for architectural decisions
|
|
@@ -574,7 +634,7 @@ contradictions, or knowledge state.
|
|
|
574
634
|
Compile the current context to understand what the graph knows:
|
|
575
635
|
|
|
576
636
|
\`\`\`typescript
|
|
577
|
-
const context = await lucern.context.compile(
|
|
637
|
+
const context = await lucern.context.compile({
|
|
578
638
|
query: "<what you're working on>",
|
|
579
639
|
tokenBudget: 2000,
|
|
580
640
|
});
|
|
@@ -591,7 +651,6 @@ Record what you learned:
|
|
|
591
651
|
// Create a belief for decisions made
|
|
592
652
|
await lucern.beliefs.create({
|
|
593
653
|
topicId,
|
|
594
|
-
baseRate: 0.5,
|
|
595
654
|
canonicalText: "<what you now believe to be true>",
|
|
596
655
|
});
|
|
597
656
|
|
|
@@ -706,8 +765,8 @@ history.data.forEach(entry => {
|
|
|
706
765
|
});
|
|
707
766
|
|
|
708
767
|
// Example output:
|
|
709
|
-
// 2026-04-10T14:00:00Z null -> 0.
|
|
710
|
-
// 2026-04-11T09:30:00Z 0.
|
|
768
|
+
// 2026-04-10T14:00:00Z null -> 0.50 [initial] Vacuous neutral prior
|
|
769
|
+
// 2026-04-11T09:30:00Z 0.50 -> 0.75 [evidence_added] Semgrep data supports
|
|
711
770
|
// 2026-04-11T16:00:00Z 0.75 -> 0.20 [evidence_added] Comparison study contradicted
|
|
712
771
|
```
|
|
713
772
|
|
package/dist/adminClient.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { GatewayClientConfig, PlatformGatewaySuccess, GatewayScope } from './cor
|
|
|
2
2
|
export { LucernApiError } from './coreClient.js';
|
|
3
3
|
import { ListResult, JsonObject } from './types.js';
|
|
4
4
|
import { ControlObjectOwnershipContract } from './controlObjectOwnership.js';
|
|
5
|
+
import './authContext.js';
|
|
6
|
+
import './contracts/auth-session.contract.js';
|
|
5
7
|
import './contracts/workflow-runtime.contract.js';
|
|
6
8
|
import './contracts/lens-workflow.contract.js';
|
|
7
9
|
import './contracts/lens-filter.contract.js';
|
|
@@ -151,11 +153,11 @@ declare function createAdminClient(config?: AdminClientConfig): {
|
|
|
151
153
|
/**
|
|
152
154
|
* Get the control-object ownership contract.
|
|
153
155
|
*/
|
|
154
|
-
getControlObjectOwnership()
|
|
156
|
+
getControlObjectOwnership: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
|
|
155
157
|
/**
|
|
156
158
|
* @deprecated Use getControlObjectOwnership.
|
|
157
159
|
*/
|
|
158
|
-
getControlObjectOwnershipContract()
|
|
160
|
+
getControlObjectOwnershipContract: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
|
|
159
161
|
/**
|
|
160
162
|
* List workspaces for the current admin scope.
|
|
161
163
|
*/
|
|
@@ -188,33 +190,33 @@ declare function createAdminClient(config?: AdminClientConfig): {
|
|
|
188
190
|
/**
|
|
189
191
|
* Create a membership.
|
|
190
192
|
*/
|
|
191
|
-
createMembership(input: GatewayScope & {
|
|
193
|
+
createMembership: (input: GatewayScope & {
|
|
192
194
|
membershipId?: string;
|
|
193
195
|
principalId: string;
|
|
194
196
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
195
197
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
196
198
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
197
|
-
}, idempotencyKey?: string)
|
|
199
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
198
200
|
/**
|
|
199
201
|
* Update a membership.
|
|
200
202
|
*/
|
|
201
|
-
updateMembership(input: GatewayScope & {
|
|
203
|
+
updateMembership: (input: GatewayScope & {
|
|
202
204
|
membershipId?: string;
|
|
203
205
|
principalId: string;
|
|
204
206
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
205
207
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
206
208
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
207
|
-
}, idempotencyKey?: string)
|
|
209
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
208
210
|
/**
|
|
209
211
|
* @deprecated Use createMembership or updateMembership.
|
|
210
212
|
*/
|
|
211
|
-
upsertMembership(input: GatewayScope & {
|
|
213
|
+
upsertMembership: (input: GatewayScope & {
|
|
212
214
|
membershipId?: string;
|
|
213
215
|
principalId: string;
|
|
214
216
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
215
217
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
216
218
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
217
|
-
}, idempotencyKey?: string)
|
|
219
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
218
220
|
/**
|
|
219
221
|
* List tenant API keys in the current admin scope.
|
|
220
222
|
*/
|