@lucern/sdk 1.0.16 → 1.0.18
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 +7 -1
- package/README.md +18 -28
- package/dist/beliefs/index.d.ts +0 -5
- package/dist/beliefs/index.js +0 -4
- package/dist/beliefsClient.d.ts +12 -42
- package/dist/beliefsClient.js +0 -22
- package/dist/client.d.ts +1 -3
- package/dist/clientConfig.d.ts +4 -3
- package/dist/clientKnowledgeNamespaces.d.ts +1 -4
- package/dist/clientKnowledgeNamespaces.js +2 -11
- package/dist/clientPlatformNamespaces.d.ts +1 -0
- package/dist/clientPlatformNamespaces.js +3 -0
- package/dist/contextTypes.d.ts +26 -6
- package/dist/contracts/context-pack.contract.d.ts +26 -6
- package/dist/gatewayFacades.d.ts +3 -3
- package/dist/gatewayFacades.factories.d.ts +1 -9
- package/dist/gatewayFacades.factories.js +0 -14
- package/dist/gatewayFacades.js +0 -17
- package/dist/generated/functionSurface.d.ts +6 -2
- package/dist/generated/functionSurface.js +26 -6
- package/dist/policyClient.d.ts +26 -2
- package/dist/proof-attestation.json +3 -3
- package/dist/sdkSurface.d.ts +2 -0
- package/dist/sdkSurface.js +6 -1
- package/dist/types.d.ts +21 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to `@lucern/sdk` will be documented in this file.
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
- No unreleased changes yet.
|
|
7
7
|
|
|
8
|
+
## [1.0.18] - 2026-06-02
|
|
9
|
+
- Release notes pending.
|
|
10
|
+
|
|
11
|
+
## [1.0.17] - 2026-06-01
|
|
12
|
+
- Release notes pending.
|
|
13
|
+
|
|
8
14
|
## [1.0.16] - 2026-06-01
|
|
9
15
|
- Release notes pending.
|
|
10
16
|
|
|
@@ -18,7 +24,7 @@ All notable changes to `@lucern/sdk` will be documented in this file.
|
|
|
18
24
|
- Exposes the Campaign 1 closeout headless surface: MCP output-schema
|
|
19
25
|
metadata, richer retrieval receipts, synthesis narrative coverage, and
|
|
20
26
|
evidence relation fields for supporting or contradicting belief links.
|
|
21
|
-
- Deprecates direct public
|
|
27
|
+
- Deprecates direct public SL scoring in favor of evidence-backed
|
|
22
28
|
Subjective Logic accumulation.
|
|
23
29
|
|
|
24
30
|
## [1.0.12] - 2026-05-31
|
package/README.md
CHANGED
|
@@ -194,49 +194,51 @@ const performanceTopic = await lucern.topics.create({
|
|
|
194
194
|
type: "theme",
|
|
195
195
|
parentTopicId: codeQuality.data.topicId,
|
|
196
196
|
});
|
|
197
|
+
|
|
198
|
+
const topicGlobalId =
|
|
199
|
+
securityTopic.data.topicGlobalId ?? securityTopic.data.globalId;
|
|
200
|
+
const topicId = topicGlobalId; // Compatibility projection for read/query APIs.
|
|
197
201
|
```
|
|
198
202
|
|
|
199
203
|
### 2. Populate the Graph With What You Know
|
|
200
204
|
|
|
201
|
-
Beliefs
|
|
205
|
+
Beliefs move through deterministic lifecycle states: `assumption` when raw, `hypothesis` when testable, `active` once evidence attaches, then `superseded`, `resolved_true`, or `resolved_false` as evidence and time settle the claim.
|
|
202
206
|
|
|
203
207
|
```typescript
|
|
204
|
-
const topicId = securityTopic.data.topicId;
|
|
205
|
-
|
|
206
208
|
// A fact — verified and anchored
|
|
207
209
|
const sqlFact = await lucern.beliefs.create({
|
|
208
|
-
|
|
210
|
+
topicGlobalId,
|
|
209
211
|
canonicalText: "Parameterized queries prevent SQL injection in all major database drivers",
|
|
210
212
|
beliefType: "fact",
|
|
211
213
|
});
|
|
212
214
|
const sqlFactEvidence = await lucern.evidence.create({
|
|
213
|
-
topicId,
|
|
215
|
+
topicId: topicGlobalId,
|
|
214
216
|
text: "OWASP SQL Injection Prevention guidance identifies parameterized queries as the primary defense.",
|
|
215
217
|
sourceUrl: "https://owasp.org/www-community/attacks/SQL_Injection",
|
|
216
218
|
targetId: sqlFact.data.nodeId,
|
|
217
219
|
evidenceRelation: "supports",
|
|
218
|
-
|
|
220
|
+
weight: 0.95,
|
|
219
221
|
rationale: "OWASP verified, industry standard for 20+ years",
|
|
220
222
|
});
|
|
221
223
|
|
|
222
224
|
// A belief — confident from observation
|
|
223
225
|
const patternBelief = await lucern.beliefs.create({
|
|
224
|
-
|
|
226
|
+
topicGlobalId,
|
|
225
227
|
canonicalText: "Most security vulnerabilities in our codebase come from unvalidated user input at API boundaries, not from cryptographic weaknesses",
|
|
226
228
|
});
|
|
227
229
|
const patternEvidence = await lucern.evidence.create({
|
|
228
|
-
topicId,
|
|
230
|
+
topicId: topicGlobalId,
|
|
229
231
|
text: "Last 6 months of security audits found 14 input validation issues and 1 cryptographic issue.",
|
|
230
232
|
sourceUrl: "audit://security/findings-last-6-months",
|
|
231
233
|
targetId: patternBelief.data.nodeId,
|
|
232
234
|
evidenceRelation: "supports",
|
|
233
|
-
|
|
235
|
+
weight: 0.82,
|
|
234
236
|
rationale: "Last 6 months of security audits: 14 input validation issues, 1 crypto issue",
|
|
235
237
|
});
|
|
236
238
|
|
|
237
239
|
// A hypothesis — under active testing
|
|
238
240
|
const hypothesis = await lucern.beliefs.create({
|
|
239
|
-
|
|
241
|
+
topicGlobalId,
|
|
240
242
|
canonicalText: "Automated static analysis catches fewer than 30% of the input validation vulnerabilities that human reviewers find",
|
|
241
243
|
beliefType: "hypothesis",
|
|
242
244
|
});
|
|
@@ -245,7 +247,7 @@ const hypothesis = await lucern.beliefs.create({
|
|
|
245
247
|
|
|
246
248
|
// An assumption — untested but used as a basis for decisions
|
|
247
249
|
const assumption = await lucern.beliefs.create({
|
|
248
|
-
|
|
250
|
+
topicGlobalId,
|
|
249
251
|
canonicalText: "Our CI pipeline runs all static analysis rules on every PR",
|
|
250
252
|
beliefType: "assumption",
|
|
251
253
|
});
|
|
@@ -365,7 +367,6 @@ await lucern.evidence.linkToBelief({
|
|
|
365
367
|
beliefId: hypothesis.data.nodeId,
|
|
366
368
|
weight: -0.8,
|
|
367
369
|
evidenceRelation: "contradicts",
|
|
368
|
-
confidence: 0.8,
|
|
369
370
|
rationale: "Static analysis catches 53% overall, not <30%. But the category breakdown reveals something more important.",
|
|
370
371
|
});
|
|
371
372
|
|
|
@@ -380,13 +381,12 @@ await lucern.evidence.linkToBelief({
|
|
|
380
381
|
beliefId: evolved.data.nodeId,
|
|
381
382
|
weight: 0.88,
|
|
382
383
|
evidenceRelation: "supports",
|
|
383
|
-
confidence: 0.88,
|
|
384
384
|
rationale: "Direct comparison data: 0/7 business logic flaws caught, 0/2 race conditions caught, while input validation catch rate was 12/22 (55%)",
|
|
385
385
|
});
|
|
386
386
|
|
|
387
387
|
// This creates a new actionable belief
|
|
388
388
|
const actionable = await lucern.beliefs.create({
|
|
389
|
-
|
|
389
|
+
topicGlobalId,
|
|
390
390
|
canonicalText: "Human code review should focus on business logic and concurrency — the categories where static analysis provides zero coverage",
|
|
391
391
|
beliefType: "belief",
|
|
392
392
|
});
|
|
@@ -397,7 +397,7 @@ await lucern.evidence.create({
|
|
|
397
397
|
sourceUrl: `worktree://${investigation.data.worktreeId}`,
|
|
398
398
|
targetId: actionable.data.nodeId,
|
|
399
399
|
evidenceRelation: "supports",
|
|
400
|
-
|
|
400
|
+
weight: 0.85,
|
|
401
401
|
rationale: "Direct implication of the comparison study findings",
|
|
402
402
|
});
|
|
403
403
|
|
|
@@ -741,7 +741,7 @@ Record what you learned:
|
|
|
741
741
|
\`\`\`typescript
|
|
742
742
|
// Create a belief for decisions made
|
|
743
743
|
await lucern.beliefs.create({
|
|
744
|
-
|
|
744
|
+
topicGlobalId,
|
|
745
745
|
canonicalText: "<what you now believe to be true>",
|
|
746
746
|
});
|
|
747
747
|
|
|
@@ -825,18 +825,8 @@ When the investigation is complete, merge findings into the main graph:
|
|
|
825
825
|
```typescript
|
|
826
826
|
await lucern.worktrees.merge(worktreeId, {
|
|
827
827
|
summary: "Static analysis catches 53% of vulns overall but has zero coverage for business logic flaws",
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
beliefId: hypothesis.data.nodeId,
|
|
831
|
-
confidence: 0.2,
|
|
832
|
-
rationale: "Overall catch rate was 53%, not <30% — but the category breakdown is more important",
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
beliefId: evolved.data.nodeId,
|
|
836
|
-
confidence: 0.88,
|
|
837
|
-
rationale: "Direct comparison data confirms the coverage gap hypothesis at category level",
|
|
838
|
-
},
|
|
839
|
-
],
|
|
828
|
+
rationale:
|
|
829
|
+
"Contradicting evidence is attached to the old belief and supporting evidence is attached to the forked belief before merge.",
|
|
840
830
|
});
|
|
841
831
|
```
|
|
842
832
|
|
package/dist/beliefs/index.d.ts
CHANGED
|
@@ -21,8 +21,6 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
21
21
|
rationale?: string;
|
|
22
22
|
}, rationale?: string) => any;
|
|
23
23
|
forkBelief: (nodeId: string, input: import("../clientConfig").BeliefsCompatForkInput) => any;
|
|
24
|
-
/** @deprecated Attach supporting or contradicting evidence instead. */
|
|
25
|
-
modulateBeliefConfidence(): never;
|
|
26
24
|
archiveBelief: (nodeId: string, input?: string | {
|
|
27
25
|
reason?: string;
|
|
28
26
|
rationale?: string;
|
|
@@ -36,9 +34,6 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
36
34
|
text: string;
|
|
37
35
|
rationale?: string;
|
|
38
36
|
}, rationale?: string): any;
|
|
39
|
-
updateConfidence(nodeId: string, input: import("../clientConfig").BeliefsCompatUpdateConfidenceInput): any;
|
|
40
|
-
modulateConfidence(nodeId: string, input: import("../clientConfig").BeliefsCompatUpdateConfidenceInput): any;
|
|
41
|
-
updateStatus(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
42
37
|
updateRationale(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
43
38
|
linkBeliefs(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
44
39
|
unlinkEvidence(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
package/dist/beliefs/index.js
CHANGED
|
@@ -11,10 +11,6 @@ export function createBeliefsClient(config = {}) {
|
|
|
11
11
|
searchBeliefs: beliefs.search,
|
|
12
12
|
refineBelief: beliefs.refine,
|
|
13
13
|
forkBelief: beliefs.fork,
|
|
14
|
-
/** @deprecated Attach supporting or contradicting evidence instead. */
|
|
15
|
-
modulateBeliefConfidence() {
|
|
16
|
-
throw new Error("Belief confidence is SL-derived. Use lucern.evidence.create(...) or lucern.evidence.linkToBelief(...) with evidenceRelation instead.");
|
|
17
|
-
},
|
|
18
14
|
archiveBelief: beliefs.archive,
|
|
19
15
|
getBeliefLineage: beliefs.lineage,
|
|
20
16
|
getBeliefConfidenceHistory: beliefs.confidenceHistory,
|
package/dist/beliefsClient.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type GatewayClientConfig, LucernApiError, type PlatformGatewaySuccess } from "./coreClient";
|
|
2
|
-
import {
|
|
3
|
-
import type { ForkBeliefResponse, JsonObject, ModulateConfidenceResponse } from "./types";
|
|
2
|
+
import type { ForkBeliefResponse, JsonObject } from "./types";
|
|
4
3
|
export { LucernApiError };
|
|
5
4
|
export type { PlatformGatewaySuccess } from "./coreClient";
|
|
6
|
-
export type { CreateBeliefResponse, ForkBeliefResponse,
|
|
5
|
+
export type { CreateBeliefResponse, ForkBeliefResponse, } from "./types";
|
|
7
6
|
export type { Opinion } from "./opinion";
|
|
8
7
|
/** Configuration for the beliefs client. Inherits gateway transport settings. */
|
|
9
8
|
export type BeliefsClientConfig = GatewayClientConfig;
|
|
@@ -34,6 +33,11 @@ export declare function mapOpinionHistoryEntriesFromGatewayData(payload: Gateway
|
|
|
34
33
|
* `baseRate` defaults to the canonical neutral prior `0.5`.
|
|
35
34
|
*/
|
|
36
35
|
export type CreateBeliefInput = {
|
|
36
|
+
/** Required topic epistemicNodes globalId. */
|
|
37
|
+
topicGlobalId?: string;
|
|
38
|
+
/** Optional internal epistemicNodes _id for the topic anchor. */
|
|
39
|
+
topicNodeId?: string;
|
|
40
|
+
/** @deprecated Use topicGlobalId. Must identify a topic epistemicNode, not a legacy topics-table row. */
|
|
37
41
|
topicId?: string;
|
|
38
42
|
/** Preferred belief statement alias. */
|
|
39
43
|
text?: string;
|
|
@@ -67,43 +71,17 @@ export type RefineBeliefInput = {
|
|
|
67
71
|
rationale?: string;
|
|
68
72
|
title?: string;
|
|
69
73
|
};
|
|
70
|
-
type BeliefConfidenceTrigger = "evidence_added" | "evidence_removed" | "contradiction_detected" | "contradiction_resolved" | "agent_assessment" | "worktree_outcome" | "worktree_completed" | "fusion" | "discount" | "deduction";
|
|
71
|
-
type ModulateConfidenceInputBase = {
|
|
72
|
-
trigger: BeliefConfidenceTrigger;
|
|
73
|
-
rationale: string;
|
|
74
|
-
triggeringEvidenceId?: string;
|
|
75
|
-
triggeringQuestionId?: string;
|
|
76
|
-
triggeringAnswerId?: string;
|
|
77
|
-
triggeringContradictionId?: string;
|
|
78
|
-
triggeringWorktreeId?: string;
|
|
79
|
-
maxInlinePropagationTargets?: number;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Public callers should not submit confidence tuples directly.
|
|
83
|
-
* Attach supporting or contradicting evidence and let the kernel derive the
|
|
84
|
-
* next subjective-logic opinion.
|
|
85
|
-
*/
|
|
86
|
-
export type ModulateConfidenceOpinionInput = ModulateConfidenceInputBase & {
|
|
87
|
-
opinion: Opinion;
|
|
88
|
-
};
|
|
89
|
-
export type ModulateConfidenceInput = ModulateConfidenceOpinionInput;
|
|
90
74
|
/**
|
|
91
|
-
* Input for forking
|
|
92
|
-
*
|
|
75
|
+
* Input for forking an evidence-bearing belief into a new formulation.
|
|
76
|
+
* Every fork must cite evidence already attached to the parent through SL.
|
|
93
77
|
*/
|
|
94
78
|
export type ForkBeliefInput = {
|
|
95
79
|
newFormulation: string;
|
|
96
|
-
forkReason
|
|
80
|
+
forkReason: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse";
|
|
81
|
+
forkMode?: "supersede" | "branch";
|
|
82
|
+
triggeringEvidenceId: string;
|
|
97
83
|
rationale?: string;
|
|
98
84
|
};
|
|
99
|
-
/** Input for changing a belief's lifecycle status. */
|
|
100
|
-
export type UpdateBeliefStatusInput = {
|
|
101
|
-
id?: string;
|
|
102
|
-
nodeId?: string;
|
|
103
|
-
beliefId?: string;
|
|
104
|
-
status: "active" | "superseded" | "archived";
|
|
105
|
-
reason?: string;
|
|
106
|
-
};
|
|
107
85
|
/** Input for updating a belief's rationale without refining its text. */
|
|
108
86
|
export type UpdateBeliefRationaleInput = {
|
|
109
87
|
id?: string;
|
|
@@ -168,10 +146,6 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
168
146
|
* Refine a draft belief in place.
|
|
169
147
|
*/
|
|
170
148
|
refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./types").PlatformBeliefRecord>>;
|
|
171
|
-
/**
|
|
172
|
-
* Record a confidence change for an existing belief.
|
|
173
|
-
*/
|
|
174
|
-
modulateConfidence: (beliefId: string, input: ModulateConfidenceOpinionInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<ModulateConfidenceResponse>>;
|
|
175
149
|
/**
|
|
176
150
|
* Returns the belief's confidence trajectory as a chronological array.
|
|
177
151
|
*
|
|
@@ -192,10 +166,6 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
192
166
|
* Fork a scored belief into a new formulation.
|
|
193
167
|
*/
|
|
194
168
|
forkBelief(beliefId: string, input: ForkBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ForkBeliefResponse>>;
|
|
195
|
-
/**
|
|
196
|
-
* Update a belief's lifecycle status.
|
|
197
|
-
*/
|
|
198
|
-
updateBeliefStatus(input: UpdateBeliefStatusInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
|
|
199
169
|
/**
|
|
200
170
|
* Update a belief's rationale without changing its text.
|
|
201
171
|
*/
|
package/dist/beliefsClient.js
CHANGED
|
@@ -101,13 +101,6 @@ export function createBeliefsClient(config = {}) {
|
|
|
101
101
|
}
|
|
102
102
|
return normalized;
|
|
103
103
|
}
|
|
104
|
-
/** @deprecated Use evidence.create or evidence.linkToBelief with evidenceRelation. */
|
|
105
|
-
const modulateConfidence = async (beliefId, input, idempotencyKey) => {
|
|
106
|
-
void beliefId;
|
|
107
|
-
void input;
|
|
108
|
-
void idempotencyKey;
|
|
109
|
-
throw new Error("Belief confidence is SL-derived. Use lucern.evidence.create({ targetId, evidenceRelation: 'supports'|'contradicts', confidence, rationale }) or lucern.evidence.linkToBelief(...) instead.");
|
|
110
|
-
};
|
|
111
104
|
const getOpinionHistory = async (beliefId) => {
|
|
112
105
|
const response = await gateway.request({
|
|
113
106
|
path: `/api/platform/v1/beliefs/${encodeURIComponent(beliefId)}/confidence-history`,
|
|
@@ -141,10 +134,6 @@ export function createBeliefsClient(config = {}) {
|
|
|
141
134
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
142
135
|
});
|
|
143
136
|
},
|
|
144
|
-
/**
|
|
145
|
-
* Record a confidence change for an existing belief.
|
|
146
|
-
*/
|
|
147
|
-
modulateConfidence,
|
|
148
137
|
/**
|
|
149
138
|
* Returns the belief's confidence trajectory as a chronological array.
|
|
150
139
|
*
|
|
@@ -172,17 +161,6 @@ export function createBeliefsClient(config = {}) {
|
|
|
172
161
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
173
162
|
});
|
|
174
163
|
},
|
|
175
|
-
/**
|
|
176
|
-
* Update a belief's lifecycle status.
|
|
177
|
-
*/
|
|
178
|
-
async updateBeliefStatus(input, idempotencyKey) {
|
|
179
|
-
return gateway.request({
|
|
180
|
-
path: "/api/platform/v1/beliefs/update-status",
|
|
181
|
-
method: "POST",
|
|
182
|
-
body: input,
|
|
183
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
164
|
/**
|
|
187
165
|
* Update a belief's rationale without changing its text.
|
|
188
166
|
*/
|
package/dist/client.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare function createLucernClient(config?: LucernClientConfig): {
|
|
|
22
22
|
checkPermission(input: import("./functionSurface").FunctionSurfaceInput): any;
|
|
23
23
|
listAccessibleTopics(input?: Parameters<(...args: any[]) => any>[0]): any;
|
|
24
24
|
filterByPermission(input: import("./functionSurface").FunctionSurfaceInput): any;
|
|
25
|
+
compileCapabilitySlice(input: Parameters<any>[0], idempotencyKey?: string): any;
|
|
25
26
|
manageWritePolicy(input: import("./functionSurface").FunctionSurfaceInput, idempotencyKey?: string): any;
|
|
26
27
|
raw: Record<string, (...args: any[]) => any> & {
|
|
27
28
|
create: (...args: any[]) => any;
|
|
@@ -437,9 +438,6 @@ export declare function createLucernClient(config?: LucernClientConfig): {
|
|
|
437
438
|
text: string;
|
|
438
439
|
rationale?: string;
|
|
439
440
|
}, rationale?: string): any;
|
|
440
|
-
updateConfidence(nodeId: string, input: import("./clientConfig").BeliefsCompatUpdateConfidenceInput): any;
|
|
441
|
-
modulateConfidence(nodeId: string, input: import("./clientConfig").BeliefsCompatUpdateConfidenceInput): any;
|
|
442
|
-
updateStatus(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
443
441
|
updateRationale(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
444
442
|
linkBeliefs(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
445
443
|
unlinkEvidence(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
package/dist/clientConfig.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { AdminClientConfig } from "./adminClient";
|
|
|
2
2
|
import type { AnswersClientConfig } from "./answersClient";
|
|
3
3
|
import type { AudiencesClientConfig } from "./audiencesClient";
|
|
4
4
|
import type { AuditClientConfig } from "./auditClient";
|
|
5
|
-
import type { BeliefsClientConfig
|
|
5
|
+
import type { BeliefsClientConfig } from "./beliefsClient";
|
|
6
6
|
import type { ContextClientConfig } from "./contextClient";
|
|
7
7
|
import type { ControlPlaneIdentityClientConfig } from "./control-plane";
|
|
8
8
|
import type { DecisionsClientConfig } from "./decisionsClient";
|
|
@@ -58,10 +58,11 @@ export type BeliefsCompatForkInput = {
|
|
|
58
58
|
text?: string;
|
|
59
59
|
newFormulation?: string;
|
|
60
60
|
formulation?: string;
|
|
61
|
-
forkReason
|
|
61
|
+
forkReason: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse";
|
|
62
|
+
forkMode?: "supersede" | "branch";
|
|
63
|
+
triggeringEvidenceId: string;
|
|
62
64
|
rationale?: string;
|
|
63
65
|
};
|
|
64
|
-
export type BeliefsCompatUpdateConfidenceInput = ModulateConfidenceInput;
|
|
65
66
|
/**
|
|
66
67
|
* Configuration for the high-level Lucern SDK client.
|
|
67
68
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientNamespaceContext } from "./clientAssemblyTypes";
|
|
2
|
-
import type { BeliefsCompatCreateInput, BeliefsCompatForkInput
|
|
2
|
+
import type { BeliefsCompatCreateInput, BeliefsCompatForkInput } from "./clientConfig";
|
|
3
3
|
import type { FunctionSurfaceInput } from "./generated/functionSurface";
|
|
4
4
|
import type { JsonObject } from "./types";
|
|
5
5
|
export declare function createClientKnowledgeNamespaces(ctx: ClientNamespaceContext): {
|
|
@@ -20,9 +20,6 @@ export declare function createClientKnowledgeNamespaces(ctx: ClientNamespaceCont
|
|
|
20
20
|
text: string;
|
|
21
21
|
rationale?: string;
|
|
22
22
|
}, rationale?: string): any;
|
|
23
|
-
updateConfidence(nodeId: string, input: BeliefsCompatUpdateConfidenceInput): any;
|
|
24
|
-
modulateConfidence(nodeId: string, input: BeliefsCompatUpdateConfidenceInput): any;
|
|
25
|
-
updateStatus(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
26
23
|
updateRationale(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
27
24
|
linkBeliefs(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
28
25
|
unlinkEvidence(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
|
|
@@ -41,17 +41,6 @@ export function createClientKnowledgeNamespaces(ctx) {
|
|
|
41
41
|
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
42
42
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
43
43
|
},
|
|
44
|
-
updateConfidence(nodeId, input) {
|
|
45
|
-
return beliefsFacade.updateConfidence(nodeId, input).then(exposeGatewayData);
|
|
46
|
-
},
|
|
47
|
-
modulateConfidence(nodeId, input) {
|
|
48
|
-
return beliefsFacade.updateConfidence(nodeId, input).then(exposeGatewayData);
|
|
49
|
-
},
|
|
50
|
-
updateStatus(input, idempotencyKey) {
|
|
51
|
-
return beliefsFacade
|
|
52
|
-
.updateStatus(input, idempotencyKey)
|
|
53
|
-
.then(exposeGatewayData);
|
|
54
|
-
},
|
|
55
44
|
updateRationale(input, idempotencyKey) {
|
|
56
45
|
return beliefsFacade
|
|
57
46
|
.updateRationale(input, idempotencyKey)
|
|
@@ -87,6 +76,8 @@ export function createClientKnowledgeNamespaces(ctx) {
|
|
|
87
76
|
.fork(nodeId, {
|
|
88
77
|
text: requireText(input),
|
|
89
78
|
forkReason: input.forkReason,
|
|
79
|
+
forkMode: input.forkMode,
|
|
80
|
+
triggeringEvidenceId: input.triggeringEvidenceId,
|
|
90
81
|
rationale: input.rationale,
|
|
91
82
|
})
|
|
92
83
|
.then(exposeGatewayData);
|
|
@@ -17,6 +17,7 @@ export declare function createClientPlatformNamespaces(ctx: ClientNamespaceConte
|
|
|
17
17
|
checkPermission(input: FunctionSurfaceInput): any;
|
|
18
18
|
listAccessibleTopics(input?: Parameters<(...args: any[]) => any>[0]): any;
|
|
19
19
|
filterByPermission(input: FunctionSurfaceInput): any;
|
|
20
|
+
compileCapabilitySlice(input: Parameters<any>[0], idempotencyKey?: string): any;
|
|
20
21
|
manageWritePolicy(input: FunctionSurfaceInput, idempotencyKey?: string): any;
|
|
21
22
|
raw: Record<string, (...args: any[]) => any> & {
|
|
22
23
|
create: (...args: any[]) => any;
|
|
@@ -51,6 +51,9 @@ export function createClientPlatformNamespaces(ctx) {
|
|
|
51
51
|
principalId: typeof input.principalId === "string" ? input.principalId : undefined,
|
|
52
52
|
});
|
|
53
53
|
},
|
|
54
|
+
compileCapabilitySlice(input, idempotencyKey) {
|
|
55
|
+
return functionSurfaceClient.compileCapabilitySlice(input, idempotencyKey);
|
|
56
|
+
},
|
|
54
57
|
// Backward compatibility shim: keep the policy namespace exposing the
|
|
55
58
|
// historical manageWritePolicy entry point.
|
|
56
59
|
manageWritePolicy(input, idempotencyKey) {
|
package/dist/contextTypes.d.ts
CHANGED
|
@@ -96,7 +96,28 @@ export type PublicContextInjectionPolicy = {
|
|
|
96
96
|
score: number;
|
|
97
97
|
}>;
|
|
98
98
|
};
|
|
99
|
+
export type PublicContextNarrativeBlock = {
|
|
100
|
+
kind: string;
|
|
101
|
+
text: string;
|
|
102
|
+
recordsNamed?: number;
|
|
103
|
+
};
|
|
104
|
+
export type PublicContextSupportingObjects = {
|
|
105
|
+
invariants?: PublicContextBelief[];
|
|
106
|
+
activeBeliefs?: PublicContextBelief[];
|
|
107
|
+
openQuestions?: PublicContextQuestion[];
|
|
108
|
+
recentEvidence?: PublicContextEvidence[];
|
|
109
|
+
contradictions?: PublicContextContradiction[];
|
|
110
|
+
relatedEntities?: PublicContextEntity[];
|
|
111
|
+
worktrees?: unknown[];
|
|
112
|
+
lanes?: string[];
|
|
113
|
+
entities?: unknown[];
|
|
114
|
+
};
|
|
99
115
|
export type PublicCompiledContext = {
|
|
116
|
+
contextNarrative: Array<string | PublicContextNarrativeBlock>;
|
|
117
|
+
narrativeCoverage?: Record<string, unknown>;
|
|
118
|
+
synthesisLints?: Array<Record<string, unknown>>;
|
|
119
|
+
retrievalReceipt?: Record<string, unknown>;
|
|
120
|
+
supportingObjects?: PublicContextSupportingObjects;
|
|
100
121
|
schemaVersion: string;
|
|
101
122
|
topicId: string;
|
|
102
123
|
topicName: string;
|
|
@@ -104,13 +125,12 @@ export type PublicCompiledContext = {
|
|
|
104
125
|
generatedAt: number;
|
|
105
126
|
ranking: ContextRankingProfile;
|
|
106
127
|
summary: Record<string, unknown>;
|
|
107
|
-
invariants
|
|
108
|
-
activeBeliefs
|
|
109
|
-
openQuestions
|
|
110
|
-
recentEvidence
|
|
111
|
-
contradictions
|
|
128
|
+
invariants?: PublicContextBelief[];
|
|
129
|
+
activeBeliefs?: PublicContextBelief[];
|
|
130
|
+
openQuestions?: PublicContextQuestion[];
|
|
131
|
+
recentEvidence?: PublicContextEvidence[];
|
|
132
|
+
contradictions?: PublicContextContradiction[];
|
|
112
133
|
relatedEntities?: PublicContextEntity[];
|
|
113
|
-
contextNarrative: string[];
|
|
114
134
|
injectionPolicy: PublicContextInjectionPolicy;
|
|
115
135
|
diagnostics: Record<string, unknown>;
|
|
116
136
|
compilationMode?: string;
|
|
@@ -349,7 +349,28 @@ export type PublicContextInjectionPolicy = {
|
|
|
349
349
|
score: number;
|
|
350
350
|
}>;
|
|
351
351
|
};
|
|
352
|
+
export type PublicContextNarrativeBlock = {
|
|
353
|
+
kind: string;
|
|
354
|
+
text: string;
|
|
355
|
+
recordsNamed?: number;
|
|
356
|
+
};
|
|
357
|
+
export type PublicContextSupportingObjects = {
|
|
358
|
+
invariants?: PublicContextBelief[];
|
|
359
|
+
activeBeliefs?: PublicContextBelief[];
|
|
360
|
+
openQuestions?: PublicContextQuestion[];
|
|
361
|
+
recentEvidence?: PublicContextEvidence[];
|
|
362
|
+
contradictions?: PublicContextContradiction[];
|
|
363
|
+
relatedEntities?: PublicContextEntity[];
|
|
364
|
+
worktrees?: unknown[];
|
|
365
|
+
lanes?: string[];
|
|
366
|
+
entities?: unknown[];
|
|
367
|
+
};
|
|
352
368
|
export type PublicCompiledContext = {
|
|
369
|
+
contextNarrative: Array<string | PublicContextNarrativeBlock>;
|
|
370
|
+
narrativeCoverage?: Record<string, unknown>;
|
|
371
|
+
synthesisLints?: Array<Record<string, unknown>>;
|
|
372
|
+
retrievalReceipt?: Record<string, unknown>;
|
|
373
|
+
supportingObjects?: PublicContextSupportingObjects;
|
|
353
374
|
schemaVersion: string;
|
|
354
375
|
topicId: string;
|
|
355
376
|
topicName: string;
|
|
@@ -357,13 +378,12 @@ export type PublicCompiledContext = {
|
|
|
357
378
|
generatedAt: number;
|
|
358
379
|
ranking: ContextRankingProfile;
|
|
359
380
|
summary: Record<string, unknown>;
|
|
360
|
-
invariants
|
|
361
|
-
activeBeliefs
|
|
362
|
-
openQuestions
|
|
363
|
-
recentEvidence
|
|
364
|
-
contradictions
|
|
381
|
+
invariants?: PublicContextBelief[];
|
|
382
|
+
activeBeliefs?: PublicContextBelief[];
|
|
383
|
+
openQuestions?: PublicContextQuestion[];
|
|
384
|
+
recentEvidence?: PublicContextEvidence[];
|
|
385
|
+
contradictions?: PublicContextContradiction[];
|
|
365
386
|
relatedEntities?: PublicContextEntity[];
|
|
366
|
-
contextNarrative: string[];
|
|
367
387
|
injectionPolicy: PublicContextInjectionPolicy;
|
|
368
388
|
diagnostics: Record<string, unknown>;
|
|
369
389
|
compilationMode?: string;
|
package/dist/gatewayFacades.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "./coreClient";
|
|
2
|
-
import type { ModulateConfidenceInput } from "./beliefsClient";
|
|
3
2
|
import { type TopicCoverageQuery, type TopicTreeQuery, type TopicUpdateInput } from "./topicsClient";
|
|
4
3
|
import type { GraphAnalyticsMetric, JsonObject } from "./types";
|
|
5
4
|
export type GatewayRecord = Record<string, unknown>;
|
|
@@ -108,10 +107,11 @@ export type BeliefRefineInput = {
|
|
|
108
107
|
};
|
|
109
108
|
export type BeliefForkInput = {
|
|
110
109
|
text: string;
|
|
111
|
-
forkReason
|
|
110
|
+
forkReason: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse";
|
|
111
|
+
forkMode?: "supersede" | "branch";
|
|
112
|
+
triggeringEvidenceId: string;
|
|
112
113
|
rationale?: string;
|
|
113
114
|
};
|
|
114
|
-
export type BeliefConfidenceInput = ModulateConfidenceInput;
|
|
115
115
|
export type BeliefArchiveInput = {
|
|
116
116
|
reason?: string;
|
|
117
117
|
rationale?: string;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "./coreClient";
|
|
2
2
|
import { type OntologyBindingInput } from "./ontologyClient";
|
|
3
|
-
import type { BeliefArchiveInput, BeliefBisectInput,
|
|
3
|
+
import type { BeliefArchiveInput, BeliefBisectInput, BeliefContractInput, BeliefCreateInput, BeliefForkInput, BeliefRecord, BeliefsLineageResult, BeliefsListQuery, BeliefsListResult, BeliefRefineInput, ContradictionsListResult, EdgeCreateInput, EdgeListQuery, EdgeTraverseInput, EvidenceCreateInput, EvidenceCreateResult, EvidenceListQuery, EvidenceLinkInput, EvidenceLinkResult, EvidenceSearchInput, EventsListQuery, EventsListResult, GatewayList, GatewayRecord, GraphFalsifyInput, GraphNeighborhoodInput, OntologyMatchInput, QuestionAnswerInput, QuestionArchiveInput, QuestionCreateInput, QuestionRefineInput, QuestionStatusInput, QuestionsListQuery, QuestionsListResult, ReplayEventsInput } from "./gatewayFacades";
|
|
4
4
|
export declare function createBeliefsFacade(config?: GatewayClientConfig): {
|
|
5
5
|
create(input: BeliefCreateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<BeliefRecord>>;
|
|
6
6
|
get(id: string): Promise<PlatformGatewaySuccess<BeliefRecord>>;
|
|
7
7
|
list(query: BeliefsListQuery): Promise<PlatformGatewaySuccess<BeliefsListResult>>;
|
|
8
8
|
refine(id: string, input: BeliefRefineInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<BeliefRecord>>;
|
|
9
9
|
fork(id: string, input: BeliefForkInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<BeliefRecord>>;
|
|
10
|
-
updateConfidence(id: string, input: BeliefConfidenceInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<GatewayRecord>>;
|
|
11
|
-
updateStatus(input: {
|
|
12
|
-
id?: string;
|
|
13
|
-
nodeId?: string;
|
|
14
|
-
beliefId?: string;
|
|
15
|
-
status: "active" | "superseded" | "archived";
|
|
16
|
-
reason?: string;
|
|
17
|
-
}, idempotencyKey?: string): Promise<PlatformGatewaySuccess<GatewayRecord>>;
|
|
18
10
|
updateRationale(input: {
|
|
19
11
|
id?: string;
|
|
20
12
|
nodeId?: string;
|
|
@@ -49,20 +49,6 @@ export function createBeliefsFacade(config = {}) {
|
|
|
49
49
|
idempotencyKey,
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
|
-
async updateConfidence(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
53
|
-
void id;
|
|
54
|
-
void input;
|
|
55
|
-
void idempotencyKey;
|
|
56
|
-
throw new Error("Belief confidence is SL-derived. Use lucern.evidence.create({ targetId, evidenceRelation: 'supports'|'contradicts', confidence, rationale }) or lucern.evidence.linkToBelief(...) instead.");
|
|
57
|
-
},
|
|
58
|
-
async updateStatus(input, idempotencyKey = randomIdempotencyKey()) {
|
|
59
|
-
return gateway.request({
|
|
60
|
-
path: "/api/platform/v1/beliefs/update-status",
|
|
61
|
-
method: "POST",
|
|
62
|
-
body: input,
|
|
63
|
-
idempotencyKey,
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
52
|
async updateRationale(input, idempotencyKey = randomIdempotencyKey()) {
|
|
67
53
|
return gateway.request({
|
|
68
54
|
path: "/api/platform/v1/beliefs/update-rationale",
|
package/dist/gatewayFacades.js
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
2
|
import { createTopicsClient, } from "./topicsClient.js";
|
|
3
|
-
function normalizeBeliefConfidenceInput(input) {
|
|
4
|
-
const opinion = input.opinion;
|
|
5
|
-
return {
|
|
6
|
-
belief: opinion.b,
|
|
7
|
-
disbelief: opinion.d,
|
|
8
|
-
uncertainty: opinion.u,
|
|
9
|
-
baseRate: opinion.a,
|
|
10
|
-
trigger: input.trigger,
|
|
11
|
-
rationale: input.rationale,
|
|
12
|
-
triggeringEvidenceId: input.triggeringEvidenceId,
|
|
13
|
-
triggeringQuestionId: input.triggeringQuestionId,
|
|
14
|
-
triggeringAnswerId: input.triggeringAnswerId,
|
|
15
|
-
triggeringContradictionId: input.triggeringContradictionId,
|
|
16
|
-
triggeringWorktreeId: input.triggeringWorktreeId,
|
|
17
|
-
maxInlinePropagationTargets: input.maxInlinePropagationTargets,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
3
|
function serializeTypes(types) {
|
|
21
4
|
return Array.isArray(types) && types.length > 0 ? types.join(",") : undefined;
|
|
22
5
|
}
|
|
@@ -3,7 +3,7 @@ import type { JsonObject } from "../types";
|
|
|
3
3
|
export type FunctionSurfaceClientConfig = GatewayClientConfig;
|
|
4
4
|
export type FunctionSurfaceInput = JsonObject;
|
|
5
5
|
export type FunctionSurfaceResult<T = unknown> = Promise<PlatformGatewaySuccess<T>>;
|
|
6
|
-
export declare const FUNCTION_SURFACE_METHOD_PATHS: readonly ["answers.answerQuestion", "answers.createAnswer", "answers.getAnswer", "beliefs.archiveBelief", "beliefs.bisectConfidence", "beliefs.createBelief", "beliefs.forkBelief", "beliefs.getBelief", "beliefs.getConfidenceHistory", "beliefs.listBeliefs", "beliefs.
|
|
6
|
+
export declare const FUNCTION_SURFACE_METHOD_PATHS: readonly ["answers.answerQuestion", "answers.createAnswer", "answers.getAnswer", "beliefs.appendSlScoring", "beliefs.archiveBelief", "beliefs.bisectConfidence", "beliefs.createBelief", "beliefs.forkBelief", "beliefs.getBelief", "beliefs.getConfidenceHistory", "beliefs.listBeliefs", "beliefs.refineBelief", "beliefs.searchBeliefs", "bootstrap.generateSessionHandoff", "coding.getChangeHistory", "coding.getCodeContext", "coding.getFailureLog", "coding.recordAttempt", "context.analyzeTopicDensity", "context.applyAutoBranching", "context.compileContext", "context.discover", "context.discoverEntityConnections", "context.getLatticeCoverage", "context.lucernOrient", "context.recordScopeLearning", "context.seedBeliefLattice", "context.triggerBeliefReview", "contracts.createEpistemicContract", "contracts.evaluateContract", "contracts.getContractStatus", "contradictions.flagContradiction", "controlPlane.identity.resolveInteractivePrincipal", "coordination.broadcastMessage", "coordination.claimFiles", "coordination.endSession", "coordination.getAgentInbox", "coordination.heartbeatSession", "coordination.listActiveSessions", "coordination.registerSession", "coordination.sendAgentMessage", "edges.batchCreateEdges", "edges.createEdge", "edges.queryAnchorHistory", "edges.queryLineage", "edges.removeEdge", "edges.removeEdgesBetween", "edges.updateEdge", "embeddings.getByNodeIds", "embeddings.listMissingForTopic", "embeddings.markEmbeddingBackfillQueued", "embeddings.vectorSearchByTopic", "evidence.addEvidence", "evidence.archiveEvidence", "evidence.createEvidence", "evidence.getEvidence", "evidence.linkEvidence", "evidence.linkEvidenceToBelief", "evidence.linkEvidenceToQuestion", "evidence.listEvidence", "evidence.searchEvidence", "graph.detectConfirmationBias", "graph.findContradictions", "graph.getGraphGaps", "graph.getGraphNeighborhood", "graph.getGraphStructureAnalysis", "graph.getTopicCoverage", "graph.traceEntityImpact", "graph.traverseGraph", "graphAnalysis.listGraphIntelligenceQueries", "graphAnalysis.runGraphIntelligenceQuery", "hybrid.analyzeGraphImpact", "hybrid.detectGraphDrift", "hybrid.expandGraphNeighborhood", "hybrid.findRelatedNodes", "hybrid.hybridDiscover", "hybrid.resolveTopicSemantic", "identity.checkPermission", "identity.filterByPermission", "identity.whoami", "judgments.getAuditTrail", "judgments.recordJudgment", "lenses.applyLensToTopic", "lenses.createLens", "lenses.listLenses", "lenses.removeLensFromTopic", "nodes.archiveEpistemicNode", "nodes.batchCreateEpistemicNodes", "nodes.createEpistemicNode", "nodes.getEpistemicNode", "nodes.listEpistemicNodes", "nodes.supersedeEpistemicNode", "nodes.updateEpistemicNode", "nodes.verifyEpistemicNode", "observations.getObservationContext", "observations.ingestObservation", "ontologies.applyOntology", "ontologies.archiveOntology", "ontologies.createOntology", "ontologies.createOntologyVersion", "ontologies.deprecateOntologyVersion", "ontologies.getOntology", "ontologies.listOntologies", "ontologies.matchEntityType", "ontologies.publishOntologyVersion", "ontologies.resolveEffectiveOntology", "ontologies.updateOntology", "policy.compileCapabilitySlice", "policy.manageWritePolicy", "questions.archiveQuestion", "questions.createQuestion", "questions.findMissingQuestions", "questions.getFalsificationQuestions", "questions.getHighPriorityQuestions", "questions.getQuestion", "questions.listQuestions", "questions.refineQuestion", "questions.updateQuestionStatus", "tasks.completeTask", "tasks.createTask", "tasks.listTasks", "tasks.updateTask", "topics.createTopic", "topics.getTopic", "topics.getTopicGraphSpine", "topics.getTopicTree", "topics.listTopics", "topics.materializeTopicGraph", "topics.updateTopic", "worktrees.activateWorktree", "worktrees.addWorktree", "worktrees.beginBuildSession", "worktrees.getWorktree", "worktrees.listAllWorktrees", "worktrees.listCampaigns", "worktrees.listWorktrees", "worktrees.listWorktreesByBelief", "worktrees.merge", "worktrees.openPullRequest", "worktrees.pipelineSnapshot", "worktrees.push", "worktrees.updateWorktreeMetadata", "worktrees.updateWorktreeTargets"];
|
|
7
7
|
export declare function createFunctionSurfaceClient(config?: FunctionSurfaceClientConfig): {
|
|
8
8
|
sessionId: string;
|
|
9
9
|
activateWorktree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
@@ -12,11 +12,13 @@ export declare function createFunctionSurfaceClient(config?: FunctionSurfaceClie
|
|
|
12
12
|
analyzeGraphImpact(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
13
13
|
analyzeTopicDensity(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
14
14
|
answerQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
15
|
+
appendSlScoring(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
15
16
|
applyAutoBranching(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
16
17
|
applyLensToTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
17
18
|
applyOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
18
19
|
archiveBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
19
20
|
archiveEpistemicNode(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
21
|
+
archiveEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
20
22
|
archiveOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
21
23
|
archiveQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
22
24
|
batchCreateEdges(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
@@ -26,6 +28,7 @@ export declare function createFunctionSurfaceClient(config?: FunctionSurfaceClie
|
|
|
26
28
|
broadcastMessage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
27
29
|
checkPermission(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
28
30
|
claimFiles(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
31
|
+
compileCapabilitySlice(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
29
32
|
compileContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
30
33
|
completeTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
31
34
|
createAnswer(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
@@ -102,16 +105,17 @@ export declare function createFunctionSurfaceClient(config?: FunctionSurfaceClie
|
|
|
102
105
|
listTasks(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
103
106
|
listTopics(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
104
107
|
listWorktrees(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
108
|
+
listWorktreesByBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
105
109
|
lucernOrient(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
106
110
|
manageWritePolicy(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
107
111
|
matchEntityType(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
108
112
|
materializeTopicGraph(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
109
113
|
merge(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
110
|
-
modulateConfidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
111
114
|
openPullRequest(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
112
115
|
pipelineSnapshot(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
113
116
|
publishOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
114
117
|
push(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
118
|
+
queryAnchorHistory(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
115
119
|
queryLineage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
116
120
|
markEmbeddingBackfillQueued(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
117
121
|
recordAttempt(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
|
|
@@ -4,6 +4,7 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
4
4
|
"answers.answerQuestion",
|
|
5
5
|
"answers.createAnswer",
|
|
6
6
|
"answers.getAnswer",
|
|
7
|
+
"beliefs.appendSlScoring",
|
|
7
8
|
"beliefs.archiveBelief",
|
|
8
9
|
"beliefs.bisectConfidence",
|
|
9
10
|
"beliefs.createBelief",
|
|
@@ -11,7 +12,6 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
11
12
|
"beliefs.getBelief",
|
|
12
13
|
"beliefs.getConfidenceHistory",
|
|
13
14
|
"beliefs.listBeliefs",
|
|
14
|
-
"beliefs.modulateConfidence",
|
|
15
15
|
"beliefs.refineBelief",
|
|
16
16
|
"beliefs.searchBeliefs",
|
|
17
17
|
"bootstrap.generateSessionHandoff",
|
|
@@ -44,6 +44,7 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
44
44
|
"coordination.sendAgentMessage",
|
|
45
45
|
"edges.batchCreateEdges",
|
|
46
46
|
"edges.createEdge",
|
|
47
|
+
"edges.queryAnchorHistory",
|
|
47
48
|
"edges.queryLineage",
|
|
48
49
|
"edges.removeEdge",
|
|
49
50
|
"edges.removeEdgesBetween",
|
|
@@ -53,6 +54,7 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
53
54
|
"embeddings.markEmbeddingBackfillQueued",
|
|
54
55
|
"embeddings.vectorSearchByTopic",
|
|
55
56
|
"evidence.addEvidence",
|
|
57
|
+
"evidence.archiveEvidence",
|
|
56
58
|
"evidence.createEvidence",
|
|
57
59
|
"evidence.getEvidence",
|
|
58
60
|
"evidence.linkEvidence",
|
|
@@ -106,6 +108,7 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
106
108
|
"ontologies.publishOntologyVersion",
|
|
107
109
|
"ontologies.resolveEffectiveOntology",
|
|
108
110
|
"ontologies.updateOntology",
|
|
111
|
+
"policy.compileCapabilitySlice",
|
|
109
112
|
"policy.manageWritePolicy",
|
|
110
113
|
"questions.archiveQuestion",
|
|
111
114
|
"questions.createQuestion",
|
|
@@ -134,6 +137,7 @@ export const FUNCTION_SURFACE_METHOD_PATHS = [
|
|
|
134
137
|
"worktrees.listAllWorktrees",
|
|
135
138
|
"worktrees.listCampaigns",
|
|
136
139
|
"worktrees.listWorktrees",
|
|
140
|
+
"worktrees.listWorktreesByBelief",
|
|
137
141
|
"worktrees.merge",
|
|
138
142
|
"worktrees.openPullRequest",
|
|
139
143
|
"worktrees.pipelineSnapshot",
|
|
@@ -148,11 +152,13 @@ const CONTRACTS = {
|
|
|
148
152
|
"analyze_graph_impact": { method: "POST", path: "/hybrid/impact", kind: "action", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
149
153
|
"analyze_topic_density": { method: "POST", path: "/scope/topic-density", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
150
154
|
"answer_question": { method: "POST", path: "/questions/answer", kind: "mutation", idempotent: true, surfaceIntent: "compatibility" },
|
|
155
|
+
"append_sl_scoring": { method: "POST", path: "/beliefs/sl-scoring", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
151
156
|
"apply_auto_branching": { method: "POST", path: "/scope/auto-branching", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
152
157
|
"apply_lens_to_topic": { method: "POST", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
153
158
|
"apply_ontology": { method: "POST", path: "/ontologies/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
154
159
|
"archive_belief": { method: "DELETE", path: "/beliefs", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
155
160
|
"archive_epistemic_node": { method: "POST", path: "/nodes/archive", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
161
|
+
"archive_evidence": { method: "DELETE", path: "/evidence", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
156
162
|
"archive_ontology": { method: "DELETE", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
157
163
|
"archive_question": { method: "DELETE", path: "/questions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
158
164
|
"batch_create_edges": { method: "POST", path: "/edges/batch", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
@@ -162,6 +168,7 @@ const CONTRACTS = {
|
|
|
162
168
|
"broadcast_message": { method: "POST", path: "/coordination/messages/broadcast", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
163
169
|
"check_permission": { method: "POST", path: "/identity/check-permission", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
164
170
|
"claim_files": { method: "POST", path: "/coordination/file-claims", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
171
|
+
"compile_capability_slice": { method: "POST", path: "/policy/capability-slice", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
165
172
|
"compile_context": { method: "POST", path: "/context/compile", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
166
173
|
"complete_task": { method: "POST", path: "/tasks/complete", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
167
174
|
"create_answer": { method: "POST", path: "/answers", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
@@ -203,7 +210,7 @@ const CONTRACTS = {
|
|
|
203
210
|
"get_epistemic_node": { method: "GET", path: "/nodes/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
204
211
|
"get_evidence": { method: "GET", path: "/evidence/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
205
212
|
"get_failure_log": { method: "POST", path: "/coding/failure-log", kind: "query", idempotent: false, surfaceIntent: "system" },
|
|
206
|
-
"get_falsification_questions": { method: "POST", path: "/questions/falsification", kind: "
|
|
213
|
+
"get_falsification_questions": { method: "POST", path: "/questions/falsification", kind: "action", idempotent: true, surfaceIntent: "mcp_core" },
|
|
207
214
|
"get_graph_gaps": { method: "POST", path: "/graph/gaps", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
208
215
|
"get_graph_neighborhood": { method: "POST", path: "/graph/neighborhood", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
209
216
|
"get_graph_structure_analysis": { method: "POST", path: "/graph/structure-analysis", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
@@ -238,16 +245,17 @@ const CONTRACTS = {
|
|
|
238
245
|
"list_tasks": { method: "GET", path: "/tasks", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
239
246
|
"list_topics": { method: "GET", path: "/topics", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
240
247
|
"list_worktrees": { method: "GET", path: "/worktrees", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
248
|
+
"list_worktrees_by_belief": { method: "GET", path: "/worktrees/by-belief", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
241
249
|
"lucern_orient": { method: "POST", path: "/context/orient", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
242
250
|
"manage_write_policy": { method: "POST", path: "/policy/write-policy/manage", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
243
251
|
"match_entity_type": { method: "POST", path: "/ontologies/match-entity-type", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
244
252
|
"materialize_topic_graph": { method: "POST", path: "/topics/materialize-graph", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
245
253
|
"merge": { method: "POST", path: "/worktrees/merge", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
246
|
-
"modulate_confidence": { method: "POST", path: "/beliefs/confidence", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
247
254
|
"open_pull_request": { method: "POST", path: "/worktrees/open-pull-request", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
248
255
|
"pipeline_snapshot": { method: "POST", path: "/worktrees/pipeline-snapshot", kind: "query", idempotent: false, surfaceIntent: "system" },
|
|
249
256
|
"publish_ontology_version": { method: "POST", path: "/ontologies/versions/publish", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
250
257
|
"push": { method: "POST", path: "/worktrees/push", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
258
|
+
"query_anchor_history": { method: "POST", path: "/edges/anchor-history", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
251
259
|
"query_lineage": { method: "POST", path: "/edges/lineage", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
252
260
|
"queue_embedding_backfill": { method: "POST", path: "/embeddings/backfill-queued", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
253
261
|
"record_attempt": { method: "POST", path: "/coding/attempts", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
@@ -345,6 +353,9 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
345
353
|
answerQuestion(input = {}, idempotencyKey) {
|
|
346
354
|
return execute("answer_question", input, idempotencyKey);
|
|
347
355
|
},
|
|
356
|
+
appendSlScoring(input = {}, idempotencyKey) {
|
|
357
|
+
return execute("append_sl_scoring", input, idempotencyKey);
|
|
358
|
+
},
|
|
348
359
|
applyAutoBranching(input = {}, idempotencyKey) {
|
|
349
360
|
return execute("apply_auto_branching", input, idempotencyKey);
|
|
350
361
|
},
|
|
@@ -360,6 +371,9 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
360
371
|
archiveEpistemicNode(input = {}, idempotencyKey) {
|
|
361
372
|
return execute("archive_epistemic_node", input, idempotencyKey);
|
|
362
373
|
},
|
|
374
|
+
archiveEvidence(input = {}, idempotencyKey) {
|
|
375
|
+
return execute("archive_evidence", input, idempotencyKey);
|
|
376
|
+
},
|
|
363
377
|
archiveOntology(input = {}, idempotencyKey) {
|
|
364
378
|
return execute("archive_ontology", input, idempotencyKey);
|
|
365
379
|
},
|
|
@@ -387,6 +401,9 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
387
401
|
claimFiles(input = {}, idempotencyKey) {
|
|
388
402
|
return execute("claim_files", input, idempotencyKey);
|
|
389
403
|
},
|
|
404
|
+
compileCapabilitySlice(input = {}, idempotencyKey) {
|
|
405
|
+
return execute("compile_capability_slice", input, idempotencyKey);
|
|
406
|
+
},
|
|
390
407
|
compileContext(input = {}, idempotencyKey) {
|
|
391
408
|
return execute("compile_context", input, idempotencyKey);
|
|
392
409
|
},
|
|
@@ -615,6 +632,9 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
615
632
|
listWorktrees(input = {}, idempotencyKey) {
|
|
616
633
|
return execute("list_worktrees", input, idempotencyKey);
|
|
617
634
|
},
|
|
635
|
+
listWorktreesByBelief(input = {}, idempotencyKey) {
|
|
636
|
+
return execute("list_worktrees_by_belief", input, idempotencyKey);
|
|
637
|
+
},
|
|
618
638
|
lucernOrient(input = {}, idempotencyKey) {
|
|
619
639
|
return execute("lucern_orient", input, idempotencyKey);
|
|
620
640
|
},
|
|
@@ -630,9 +650,6 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
630
650
|
merge(input = {}, idempotencyKey) {
|
|
631
651
|
return execute("merge", input, idempotencyKey);
|
|
632
652
|
},
|
|
633
|
-
modulateConfidence(input = {}, idempotencyKey) {
|
|
634
|
-
return execute("modulate_confidence", input, idempotencyKey);
|
|
635
|
-
},
|
|
636
653
|
openPullRequest(input = {}, idempotencyKey) {
|
|
637
654
|
return execute("open_pull_request", input, idempotencyKey);
|
|
638
655
|
},
|
|
@@ -645,6 +662,9 @@ export function createFunctionSurfaceClient(config = {}) {
|
|
|
645
662
|
push(input = {}, idempotencyKey) {
|
|
646
663
|
return execute("push", input, idempotencyKey);
|
|
647
664
|
},
|
|
665
|
+
queryAnchorHistory(input = {}, idempotencyKey) {
|
|
666
|
+
return execute("query_anchor_history", input, idempotencyKey);
|
|
667
|
+
},
|
|
648
668
|
queryLineage(input = {}, idempotencyKey) {
|
|
649
669
|
return execute("query_lineage", input, idempotencyKey);
|
|
650
670
|
},
|
package/dist/policyClient.d.ts
CHANGED
|
@@ -82,14 +82,38 @@ export type TenantPolicyPermission = {
|
|
|
82
82
|
resource: string;
|
|
83
83
|
actions: string[];
|
|
84
84
|
};
|
|
85
|
+
export type TenantPolicyKind = "role" | "object_classification";
|
|
86
|
+
export type TenantPolicyExternalAccess = "allowed" | "summaries" | "omitted";
|
|
87
|
+
export type TenantPolicyClassificationFields = {
|
|
88
|
+
policyKind?: TenantPolicyKind;
|
|
89
|
+
profileKey?: string;
|
|
90
|
+
objectTypes?: string[];
|
|
91
|
+
accessTier?: string;
|
|
92
|
+
exportClass?: string;
|
|
93
|
+
classificationKey?: string;
|
|
94
|
+
classificationLabels?: string[];
|
|
95
|
+
policyTags?: string[];
|
|
96
|
+
externalAccess?: TenantPolicyExternalAccess;
|
|
97
|
+
requiredGroupKey?: string;
|
|
98
|
+
};
|
|
85
99
|
export type TenantPolicyRecord = {
|
|
86
100
|
id?: string;
|
|
87
101
|
tenantId: string;
|
|
88
102
|
workspaceId?: string;
|
|
103
|
+
policyKind?: TenantPolicyKind;
|
|
89
104
|
roleName: string;
|
|
90
105
|
description?: string;
|
|
91
106
|
permissions: TenantPolicyPermission[];
|
|
92
107
|
groupBindings: string[];
|
|
108
|
+
profileKey?: string;
|
|
109
|
+
objectTypes?: string[];
|
|
110
|
+
accessTier?: string;
|
|
111
|
+
exportClass?: string;
|
|
112
|
+
classificationKey?: string;
|
|
113
|
+
classificationLabels?: string[];
|
|
114
|
+
policyTags?: string[];
|
|
115
|
+
externalAccess?: TenantPolicyExternalAccess;
|
|
116
|
+
requiredGroupKey?: string;
|
|
93
117
|
createdAt?: number;
|
|
94
118
|
updatedAt?: number;
|
|
95
119
|
createdBy?: string;
|
|
@@ -210,7 +234,7 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
210
234
|
/**
|
|
211
235
|
* Create a tenant role policy.
|
|
212
236
|
*/
|
|
213
|
-
createRolePolicy(input: GatewayScope & {
|
|
237
|
+
createRolePolicy(input: GatewayScope & TenantPolicyClassificationFields & {
|
|
214
238
|
roleName: string;
|
|
215
239
|
description?: string;
|
|
216
240
|
permissions: TenantPolicyPermission[];
|
|
@@ -227,7 +251,7 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
227
251
|
/**
|
|
228
252
|
* Update a tenant role policy by identifier.
|
|
229
253
|
*/
|
|
230
|
-
updateRolePolicy(id: string, input: GatewayScope & {
|
|
254
|
+
updateRolePolicy(id: string, input: GatewayScope & TenantPolicyClassificationFields & {
|
|
231
255
|
roleName: string;
|
|
232
256
|
description?: string;
|
|
233
257
|
permissions: TenantPolicyPermission[];
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"contractsCovered": [
|
|
34
|
+
"append_sl_scoring",
|
|
34
35
|
"create_evidence",
|
|
35
36
|
"list_beliefs",
|
|
36
|
-
"list_tasks"
|
|
37
|
-
"modulate_confidence"
|
|
37
|
+
"list_tasks"
|
|
38
38
|
],
|
|
39
39
|
"emittersUsed": [
|
|
40
40
|
"typescript-types",
|
|
41
41
|
"convex-validators",
|
|
42
42
|
"proof-attestation"
|
|
43
43
|
],
|
|
44
|
-
"signedAt":
|
|
44
|
+
"signedAt": 1780432640939
|
|
45
45
|
}
|
package/dist/sdkSurface.d.ts
CHANGED
package/dist/sdkSurface.js
CHANGED
|
@@ -29,7 +29,9 @@ function cloneWith(value, patch) {
|
|
|
29
29
|
* Resolve the canonical topic identifier.
|
|
30
30
|
*/
|
|
31
31
|
export function resolveTopicId(value) {
|
|
32
|
-
return cleanString(value.
|
|
32
|
+
return (cleanString(value.topicGlobalId) ??
|
|
33
|
+
cleanString(value.topicNodeId) ??
|
|
34
|
+
cleanString(value.topicId));
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Resolve the canonical text field from text-first or legacy canonicalText-first inputs.
|
|
@@ -73,6 +75,9 @@ export function normalizeNodeWriteInput(value) {
|
|
|
73
75
|
const next = { ...value };
|
|
74
76
|
if (topicId) {
|
|
75
77
|
next.topicId = topicId;
|
|
78
|
+
if (!cleanString(next.topicGlobalId)) {
|
|
79
|
+
next.topicGlobalId = topicId;
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
if (text) {
|
|
78
83
|
next.text = text;
|
package/dist/types.d.ts
CHANGED
|
@@ -17,6 +17,15 @@ export type JsonValue = null | boolean | number | string | JsonArray | JsonObjec
|
|
|
17
17
|
* Canonical scope identifiers for SDK inputs and records.
|
|
18
18
|
*/
|
|
19
19
|
export type TopicIdentifierInput = {
|
|
20
|
+
/**
|
|
21
|
+
* Preferred write anchor for belief creation: the globalId of a topic
|
|
22
|
+
* epistemicNode. `topicId` remains a compatibility projection for read/query
|
|
23
|
+
* surfaces and must already refer to that same topic node when used for
|
|
24
|
+
* belief writes.
|
|
25
|
+
*/
|
|
26
|
+
topicGlobalId?: string;
|
|
27
|
+
/** Optional internal epistemicNodes _id for a topic node. */
|
|
28
|
+
topicNodeId?: string;
|
|
20
29
|
topicId?: string;
|
|
21
30
|
};
|
|
22
31
|
/**
|
|
@@ -40,8 +49,8 @@ export type ListResult<T, LegacyKey extends string = never> = {
|
|
|
40
49
|
* Atomic knowledge unit in the reasoning graph.
|
|
41
50
|
*
|
|
42
51
|
* A belief carries a confidence score, belongs to a topic scope, and follows
|
|
43
|
-
* the knowledge-as-code lifecycle:
|
|
44
|
-
* Confidence is
|
|
52
|
+
* the knowledge-as-code lifecycle: assumption -> hypothesis -> active -> resolved/superseded.
|
|
53
|
+
* Confidence is derived from supporting or contradicting evidence through SL scoring, never set by callers.
|
|
45
54
|
*/
|
|
46
55
|
export type PlatformBeliefRecord = {
|
|
47
56
|
nodeId: string;
|
|
@@ -50,8 +59,11 @@ export type PlatformBeliefRecord = {
|
|
|
50
59
|
canonicalText?: string;
|
|
51
60
|
formulation?: string;
|
|
52
61
|
status?: string;
|
|
62
|
+
beliefStatus?: string;
|
|
63
|
+
epistemicStatus?: string;
|
|
53
64
|
confidence?: number | null;
|
|
54
65
|
topicId?: string;
|
|
66
|
+
topicGlobalId?: string;
|
|
55
67
|
title?: string;
|
|
56
68
|
subtype?: string;
|
|
57
69
|
domain?: string;
|
|
@@ -68,21 +80,13 @@ export type PlatformBeliefRecord = {
|
|
|
68
80
|
};
|
|
69
81
|
/** Response returned after creating a new belief node. */
|
|
70
82
|
export type CreateBeliefResponse = PlatformBeliefRecord;
|
|
71
|
-
/** Response returned after an
|
|
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
|
+
/** Response returned after forking an evidence-bearing belief into a new formulation. */
|
|
83
84
|
export interface ForkBeliefResponse extends PlatformBeliefRecord {
|
|
84
85
|
parentNodeId?: string;
|
|
85
86
|
forkReason?: string;
|
|
87
|
+
forkMode?: "supersede" | "branch";
|
|
88
|
+
triggeringEvidenceId?: string;
|
|
89
|
+
triggeringEvidenceRelation?: "supports" | "contradicts";
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
88
92
|
* Generic graph node spanning L1-L4 epistemic layers.
|
|
@@ -102,6 +106,8 @@ export type PlatformGraphNode = {
|
|
|
102
106
|
title?: string;
|
|
103
107
|
subtype?: string;
|
|
104
108
|
status?: string;
|
|
109
|
+
beliefStatus?: string;
|
|
110
|
+
epistemicStatus?: string;
|
|
105
111
|
confidence?: number | null;
|
|
106
112
|
topicId?: string;
|
|
107
113
|
sourceType?: string;
|
|
@@ -342,6 +348,7 @@ export type WorkflowBranchRecord = {
|
|
|
342
348
|
*/
|
|
343
349
|
export type WorkflowWorktreeRecord = {
|
|
344
350
|
worktreeId?: string;
|
|
351
|
+
nodeId?: string;
|
|
345
352
|
topicId?: string;
|
|
346
353
|
branchId?: string;
|
|
347
354
|
title?: string;
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucern/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -113,10 +113,10 @@
|
|
|
113
113
|
"typecheck": "tsc --project tsconfig.typecheck.json --noEmit"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@lucern/contracts": "1.0.
|
|
117
|
-
"@lucern/reasoning-kernel": "1.0.
|
|
118
|
-
"@lucern/secrets": "1.0.
|
|
119
|
-
"@lucern/transport-core": "1.0.
|
|
116
|
+
"@lucern/contracts": "1.0.18",
|
|
117
|
+
"@lucern/reasoning-kernel": "1.0.18",
|
|
118
|
+
"@lucern/secrets": "1.0.18",
|
|
119
|
+
"@lucern/transport-core": "1.0.18",
|
|
120
120
|
"effect": "^3.21.2",
|
|
121
121
|
"zod": "^3.25.76"
|
|
122
122
|
},
|