@lucern/sdk 1.0.19 → 1.0.21
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 +6 -0
- package/dist/beliefsClient.d.ts +4 -6
- package/dist/beliefsClient.js +17 -1
- package/dist/contextTypes.d.ts +1 -0
- package/dist/contracts/context-pack.contract.d.ts +1 -0
- package/dist/proof-attestation.json +1 -1
- package/dist/sdkSurface.d.ts +0 -1
- package/dist/sdkSurface.js +1 -3
- package/dist/types.d.ts +3 -6
- 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.21] - 2026-06-06
|
|
9
|
+
- Release notes pending.
|
|
10
|
+
|
|
11
|
+
## [1.0.20] - 2026-06-05
|
|
12
|
+
- Release notes pending.
|
|
13
|
+
|
|
8
14
|
## [1.0.19] - 2026-06-04
|
|
9
15
|
- Release notes pending.
|
|
10
16
|
|
package/dist/beliefsClient.d.ts
CHANGED
|
@@ -29,16 +29,14 @@ export declare function mapOpinionHistoryEntriesFromGatewayData(payload: Gateway
|
|
|
29
29
|
*
|
|
30
30
|
* Use `text` as the canonical belief statement.
|
|
31
31
|
* `canonicalText` remains available as a legacy alias for backwards compatibility.
|
|
32
|
+
* `topicGlobalId` is a required UUIDv7 topic epistemic-node globalId; SDK
|
|
33
|
+
* creation no longer translates `topicId` or `topicNodeId` into a write anchor.
|
|
32
34
|
* Beliefs start as drafts with a vacuous prior `(0, 0, 1, a)`. When omitted,
|
|
33
35
|
* `baseRate` defaults to the canonical neutral prior `0.5`.
|
|
34
36
|
*/
|
|
35
37
|
export type CreateBeliefInput = {
|
|
36
|
-
/** Required topic epistemicNodes globalId. */
|
|
37
|
-
topicGlobalId
|
|
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. */
|
|
41
|
-
topicId?: string;
|
|
38
|
+
/** Required UUIDv7 topic epistemicNodes globalId. */
|
|
39
|
+
topicGlobalId: string;
|
|
42
40
|
/** Preferred belief statement alias. */
|
|
43
41
|
text?: string;
|
|
44
42
|
/** @deprecated Use text. */
|
package/dist/beliefsClient.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, } from "./coreClient.js";
|
|
2
2
|
import { normalizeNodeWriteInput } from "./sdkSurface.js";
|
|
3
|
+
import { isUuidV7 } from "@lucern/contracts/ids";
|
|
3
4
|
export { LucernApiError };
|
|
4
5
|
function asRecord(value) {
|
|
5
6
|
return value && typeof value === "object" && !Array.isArray(value)
|
|
@@ -101,6 +102,21 @@ export function createBeliefsClient(config = {}) {
|
|
|
101
102
|
}
|
|
102
103
|
return normalized;
|
|
103
104
|
}
|
|
105
|
+
function normalizeCreateBeliefInput(input) {
|
|
106
|
+
const topicGlobalId = readString(input.topicGlobalId);
|
|
107
|
+
if (!topicGlobalId || !isUuidV7(topicGlobalId)) {
|
|
108
|
+
throw new Error("createBelief requires topicGlobalId to be a UUIDv7 topic epistemic-node globalId.");
|
|
109
|
+
}
|
|
110
|
+
const text = readString(input.text) ?? readString(input.canonicalText);
|
|
111
|
+
const body = { ...input, topicGlobalId };
|
|
112
|
+
delete body.topicId;
|
|
113
|
+
delete body.topicNodeId;
|
|
114
|
+
if (text) {
|
|
115
|
+
body.text = text;
|
|
116
|
+
body.canonicalText = text;
|
|
117
|
+
}
|
|
118
|
+
return body;
|
|
119
|
+
}
|
|
104
120
|
const getOpinionHistory = async (beliefId) => {
|
|
105
121
|
const response = await gateway.request({
|
|
106
122
|
path: `/api/platform/v1/beliefs/${encodeURIComponent(beliefId)}/confidence-history`,
|
|
@@ -117,7 +133,7 @@ export function createBeliefsClient(config = {}) {
|
|
|
117
133
|
path: "/api/platform/v1/beliefs",
|
|
118
134
|
method: "POST",
|
|
119
135
|
body: {
|
|
120
|
-
...
|
|
136
|
+
...normalizeCreateBeliefInput(input),
|
|
121
137
|
baseRate,
|
|
122
138
|
},
|
|
123
139
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
package/dist/contextTypes.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export type PublicCompiledContext = {
|
|
|
117
117
|
narrativeCoverage?: Record<string, unknown>;
|
|
118
118
|
synthesisLints?: Array<Record<string, unknown>>;
|
|
119
119
|
retrievalReceipt?: Record<string, unknown>;
|
|
120
|
+
assemblyReceipt?: Record<string, unknown>;
|
|
120
121
|
supportingObjects?: PublicContextSupportingObjects;
|
|
121
122
|
schemaVersion: string;
|
|
122
123
|
topicId: string;
|
|
@@ -370,6 +370,7 @@ export type PublicCompiledContext = {
|
|
|
370
370
|
narrativeCoverage?: Record<string, unknown>;
|
|
371
371
|
synthesisLints?: Array<Record<string, unknown>>;
|
|
372
372
|
retrievalReceipt?: Record<string, unknown>;
|
|
373
|
+
assemblyReceipt?: Record<string, unknown>;
|
|
373
374
|
supportingObjects?: PublicContextSupportingObjects;
|
|
374
375
|
schemaVersion: string;
|
|
375
376
|
topicId: string;
|
package/dist/sdkSurface.d.ts
CHANGED
package/dist/sdkSurface.js
CHANGED
|
@@ -29,9 +29,7 @@ function cloneWith(value, patch) {
|
|
|
29
29
|
* Resolve the canonical topic identifier.
|
|
30
30
|
*/
|
|
31
31
|
export function resolveTopicId(value) {
|
|
32
|
-
return
|
|
33
|
-
cleanString(value.topicNodeId) ??
|
|
34
|
-
cleanString(value.topicId));
|
|
32
|
+
return cleanString(value.topicGlobalId) ?? cleanString(value.topicId);
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
35
|
* Resolve the canonical text field from text-first or legacy canonicalText-first inputs.
|
package/dist/types.d.ts
CHANGED
|
@@ -18,14 +18,11 @@ export type JsonValue = null | boolean | number | string | JsonArray | JsonObjec
|
|
|
18
18
|
*/
|
|
19
19
|
export type TopicIdentifierInput = {
|
|
20
20
|
/**
|
|
21
|
-
* Preferred write anchor for belief creation: the globalId of a topic
|
|
22
|
-
* epistemicNode. `topicId` remains a
|
|
23
|
-
* surfaces
|
|
24
|
-
* belief writes.
|
|
21
|
+
* Preferred write anchor for belief creation: the UUIDv7 globalId of a topic
|
|
22
|
+
* epistemicNode. `topicId` remains a read/query scope for non-belief-write
|
|
23
|
+
* surfaces.
|
|
25
24
|
*/
|
|
26
25
|
topicGlobalId?: string;
|
|
27
|
-
/** Optional internal epistemicNodes _id for a topic node. */
|
|
28
|
-
topicNodeId?: string;
|
|
29
26
|
topicId?: string;
|
|
30
27
|
};
|
|
31
28
|
/**
|
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.21",
|
|
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.21",
|
|
117
|
+
"@lucern/reasoning-kernel": "1.0.21",
|
|
118
|
+
"@lucern/secrets": "1.0.21",
|
|
119
|
+
"@lucern/transport-core": "1.0.21",
|
|
120
120
|
"effect": "^3.21.2",
|
|
121
121
|
"zod": "^3.25.76"
|
|
122
122
|
},
|