@lucern/sdk 0.3.0-alpha.4 → 0.3.0-alpha.6
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/README.md +47 -0
- package/dist/beliefs/index.d.ts +3 -1
- package/dist/beliefs/index.js +32 -0
- package/dist/beliefs/index.js.map +1 -1
- package/dist/client.d.ts +2981 -40
- package/dist/client.js +32 -0
- package/dist/client.js.map +1 -1
- package/dist/contradictions/index.d.ts +3 -1
- package/dist/contradictions/index.js +32 -0
- package/dist/contradictions/index.js.map +1 -1
- package/dist/decisions/index.d.ts +3 -1
- package/dist/decisions/index.js +32 -0
- package/dist/decisions/index.js.map +1 -1
- package/dist/edges/index.d.ts +3 -1
- package/dist/edges/index.js +32 -0
- package/dist/edges/index.js.map +1 -1
- package/dist/evidence/index.d.ts +3 -1
- package/dist/evidence/index.js +32 -0
- package/dist/evidence/index.js.map +1 -1
- package/dist/functionSurface.d.ts +129 -0
- package/dist/functionSurface.js +1118 -0
- package/dist/functionSurface.js.map +1 -0
- package/dist/functionSurfaceClient.d.ts +8 -0
- package/dist/functionSurfaceClient.js +1118 -0
- package/dist/functionSurfaceClient.js.map +1 -0
- package/dist/graphAnalysisClient.d.ts +46 -1
- package/dist/graphAnalysisClient.js +24 -0
- package/dist/graphAnalysisClient.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/index.d.ts +5 -2
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -1
- package/dist/lenses/index.d.ts +4 -2
- package/dist/lenses/index.js +32 -0
- package/dist/lenses/index.js.map +1 -1
- package/dist/nodes/index.d.ts +3 -1
- package/dist/nodes/index.js +32 -0
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +3 -1
- package/dist/ontologies/index.js +32 -0
- package/dist/ontologies/index.js.map +1 -1
- package/dist/packRuntime.d.ts +2 -1
- package/dist/questions/index.d.ts +3 -1
- package/dist/questions/index.js +32 -0
- package/dist/questions/index.js.map +1 -1
- package/dist/topics/index.d.ts +3 -1
- package/dist/topics/index.js +32 -0
- package/dist/topics/index.js.map +1 -1
- package/dist/worktrees/index.d.ts +5 -3
- package/dist/worktrees/index.js +32 -0
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +12 -3
- package/dist/client-DOLqClbU.d.ts +0 -3091
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.
|
|
@@ -363,6 +388,28 @@ lucern.identity // API keys and sessions
|
|
|
363
388
|
|
|
364
389
|
The graph doesn't just store knowledge — it analyzes itself.
|
|
365
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
|
+
|
|
366
413
|
### Structural Analysis
|
|
367
414
|
|
|
368
415
|
```typescript
|
package/dist/beliefs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModulateConfidenceOpinionInput, OpinionHistoryEntry } from '../beliefsClient.js';
|
|
2
2
|
import { PlatformGatewaySuccess } from '../coreClient.js';
|
|
3
3
|
import { JsonObject } from '../types.js';
|
|
4
|
-
import {
|
|
4
|
+
import { LucernClientConfig } from '../client.js';
|
|
5
5
|
import * as v1 from '@lucern/contracts/beliefs/v1';
|
|
6
6
|
export { v1 as beliefsContracts };
|
|
7
7
|
import * as toolContracts from '@lucern/contracts/tool-contracts';
|
|
@@ -36,11 +36,13 @@ import '../ontologyLinksClient.js';
|
|
|
36
36
|
import '../orgGraphSearchClient.js';
|
|
37
37
|
import '../graphRecommendationsClient.js';
|
|
38
38
|
import '../graphAnalysisClient.js';
|
|
39
|
+
import '@lucern/contracts';
|
|
39
40
|
import '../embeddingsClient.js';
|
|
40
41
|
import '../policyClient.js';
|
|
41
42
|
import '../ontologyClient.js';
|
|
42
43
|
import '../contextTypes.js';
|
|
43
44
|
import '../topicsClient.js';
|
|
45
|
+
import '../functionSurface.js';
|
|
44
46
|
import '../answersClient.js';
|
|
45
47
|
import '../auditClient.js';
|
|
46
48
|
import '../contextClient.js';
|
package/dist/beliefs/index.js
CHANGED
|
@@ -4122,9 +4122,33 @@ function graphAnalysisQuery(input) {
|
|
|
4122
4122
|
cursor: input.cursor
|
|
4123
4123
|
};
|
|
4124
4124
|
}
|
|
4125
|
+
function normalizeRunQueryPayload(input) {
|
|
4126
|
+
return {
|
|
4127
|
+
...input,
|
|
4128
|
+
topicId: requireTopicId2(input),
|
|
4129
|
+
projectId: void 0
|
|
4130
|
+
};
|
|
4131
|
+
}
|
|
4125
4132
|
function createGraphAnalysisClient(config = {}) {
|
|
4126
4133
|
const gateway = createGatewayRequestClient(config);
|
|
4127
4134
|
return {
|
|
4135
|
+
listGraphIntelligenceQueries(input = {}) {
|
|
4136
|
+
return gateway.request({
|
|
4137
|
+
path: "/api/platform/v1/graph-intelligence/queries",
|
|
4138
|
+
method: "POST",
|
|
4139
|
+
body: {
|
|
4140
|
+
categoryId: input.categoryId,
|
|
4141
|
+
mode: input.mode
|
|
4142
|
+
}
|
|
4143
|
+
});
|
|
4144
|
+
},
|
|
4145
|
+
runGraphIntelligenceQuery(input) {
|
|
4146
|
+
return gateway.request({
|
|
4147
|
+
path: "/api/platform/v1/graph-intelligence/run",
|
|
4148
|
+
method: "POST",
|
|
4149
|
+
body: normalizeRunQueryPayload(input)
|
|
4150
|
+
});
|
|
4151
|
+
},
|
|
4128
4152
|
saveAnalysis(input, idempotencyKey) {
|
|
4129
4153
|
return gateway.request({
|
|
4130
4154
|
path: "/api/platform/v1/graph-analysis/analyses",
|
|
@@ -5027,6 +5051,7 @@ var CONTRACTS = {
|
|
|
5027
5051
|
"list_beliefs": { method: "GET", path: "/beliefs", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5028
5052
|
"list_campaigns": { method: "GET", path: "/worktrees/campaigns", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5029
5053
|
"list_evidence": { method: "GET", path: "/evidence", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5054
|
+
"list_graph_intelligence_queries": { method: "POST", path: "/graph-intelligence/queries", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5030
5055
|
"list_lenses": { method: "GET", path: "/lenses", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5031
5056
|
"list_ontologies": { method: "GET", path: "/ontologies", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5032
5057
|
"list_questions": { method: "GET", path: "/questions", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
@@ -5050,6 +5075,7 @@ var CONTRACTS = {
|
|
|
5050
5075
|
"register_session": { method: "POST", path: "/coordination/register-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5051
5076
|
"remove_lens_from_topic": { method: "DELETE", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5052
5077
|
"resolve_effective_ontology": { method: "POST", path: "/ontologies/effective", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5078
|
+
"run_graph_intelligence_query": { method: "POST", path: "/graph-intelligence/run", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5053
5079
|
"search_beliefs": { method: "POST", path: "/beliefs/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5054
5080
|
"search_evidence": { method: "POST", path: "/evidence/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5055
5081
|
"seed_belief_lattice": { method: "POST", path: "/scope/belief-lattice/seed", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
@@ -5325,6 +5351,9 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5325
5351
|
listEvidence(input = {}, idempotencyKey) {
|
|
5326
5352
|
return execute("list_evidence", input, idempotencyKey);
|
|
5327
5353
|
},
|
|
5354
|
+
listGraphIntelligenceQueries(input = {}, idempotencyKey) {
|
|
5355
|
+
return execute("list_graph_intelligence_queries", input, idempotencyKey);
|
|
5356
|
+
},
|
|
5328
5357
|
listLenses(input = {}, idempotencyKey) {
|
|
5329
5358
|
return execute("list_lenses", input, idempotencyKey);
|
|
5330
5359
|
},
|
|
@@ -5394,6 +5423,9 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5394
5423
|
resolveEffectiveOntology(input = {}, idempotencyKey) {
|
|
5395
5424
|
return execute("resolve_effective_ontology", input, idempotencyKey);
|
|
5396
5425
|
},
|
|
5426
|
+
runGraphIntelligenceQuery(input = {}, idempotencyKey) {
|
|
5427
|
+
return execute("run_graph_intelligence_query", input, idempotencyKey);
|
|
5428
|
+
},
|
|
5397
5429
|
searchBeliefs(input = {}, idempotencyKey) {
|
|
5398
5430
|
return execute("search_beliefs", input, idempotencyKey);
|
|
5399
5431
|
},
|