@lucern/sdk 1.0.19 → 1.0.20

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 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
+ ## [1.0.20] - 2026-06-05
9
+ - Release notes pending.
10
+
8
11
  ## [1.0.19] - 2026-06-04
9
12
  - Release notes pending.
10
13
 
@@ -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?: 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. */
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. */
@@ -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
- ...normalizeNodeWriteInput(input),
136
+ ...normalizeCreateBeliefInput(input),
121
137
  baseRate,
122
138
  },
123
139
  idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
@@ -41,5 +41,5 @@
41
41
  "convex-validators",
42
42
  "proof-attestation"
43
43
  ],
44
- "signedAt": 1780614051827
44
+ "signedAt": 1780649268504
45
45
  }
@@ -3,7 +3,6 @@ import type { JsonObject, ListResult } from "./types";
3
3
  type TopicScopedValue = {
4
4
  topicId?: string;
5
5
  topicGlobalId?: string;
6
- topicNodeId?: string;
7
6
  };
8
7
  type TextScopedValue = {
9
8
  text?: string;
@@ -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 (cleanString(value.topicGlobalId) ??
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 compatibility projection for read/query
23
- * surfaces and must already refer to that same topic node when used for
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
@@ -1,3 +1,3 @@
1
1
  /** Current SDK package version. */
2
- export declare const LUCERN_SDK_VERSION = "1.0.19";
2
+ export declare const LUCERN_SDK_VERSION = "1.0.20";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Current SDK package version. */
2
- export const LUCERN_SDK_VERSION = "1.0.19";
2
+ export const LUCERN_SDK_VERSION = "1.0.20";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucern/sdk",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
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.19",
117
- "@lucern/reasoning-kernel": "1.0.19",
118
- "@lucern/secrets": "1.0.19",
119
- "@lucern/transport-core": "1.0.19",
116
+ "@lucern/contracts": "1.0.20",
117
+ "@lucern/reasoning-kernel": "1.0.20",
118
+ "@lucern/secrets": "1.0.20",
119
+ "@lucern/transport-core": "1.0.20",
120
120
  "effect": "^3.21.2",
121
121
  "zod": "^3.25.76"
122
122
  },