@lucern/sdk 0.3.0-alpha.8 → 0.3.0-alpha.9
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/dist/beliefs/index.d.ts +1 -0
- package/dist/beliefs/index.js +21 -9
- package/dist/beliefs/index.js.map +1 -1
- package/dist/client.d.ts +5 -2
- package/dist/client.js +21 -9
- package/dist/client.js.map +1 -1
- package/dist/clientHelpers.d.ts +21 -2
- package/dist/clientHelpers.js +16 -1
- package/dist/clientHelpers.js.map +1 -1
- package/dist/contradictions/index.d.ts +1 -0
- package/dist/contradictions/index.js +21 -9
- package/dist/contradictions/index.js.map +1 -1
- package/dist/decisions/index.d.ts +1 -0
- package/dist/decisions/index.js +21 -9
- package/dist/decisions/index.js.map +1 -1
- package/dist/edges/index.d.ts +1 -0
- package/dist/edges/index.js +21 -9
- package/dist/edges/index.js.map +1 -1
- package/dist/evidence/index.d.ts +1 -0
- package/dist/evidence/index.js +21 -9
- package/dist/evidence/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/lenses/index.d.ts +1 -0
- package/dist/lenses/index.js +21 -9
- package/dist/lenses/index.js.map +1 -1
- package/dist/nodes/index.d.ts +1 -0
- package/dist/nodes/index.js +21 -9
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +1 -0
- package/dist/ontologies/index.js +21 -9
- package/dist/ontologies/index.js.map +1 -1
- package/dist/questions/index.d.ts +1 -0
- package/dist/questions/index.js +21 -9
- package/dist/questions/index.js.map +1 -1
- package/dist/topics/index.d.ts +1 -0
- package/dist/topics/index.js +21 -9
- package/dist/topics/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/worktrees/index.d.ts +1 -0
- package/dist/worktrees/index.js +21 -9
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -52,6 +52,7 @@ import '../learningClient.js';
|
|
|
52
52
|
import '../reportsClient.js';
|
|
53
53
|
import '../sourcesClient.js';
|
|
54
54
|
import '../workflowClient.js';
|
|
55
|
+
import '../clientHelpers.js';
|
|
55
56
|
|
|
56
57
|
type QuestionsClientConfig = LucernClientConfig;
|
|
57
58
|
type QuestionsClient = ReturnType<typeof createQuestionsClient>;
|
package/dist/questions/index.js
CHANGED
|
@@ -6260,6 +6260,21 @@ function createSchemaClient(config = {}) {
|
|
|
6260
6260
|
}
|
|
6261
6261
|
|
|
6262
6262
|
// src/clientHelpers.ts
|
|
6263
|
+
function normalizeCustomNamespace(namespace) {
|
|
6264
|
+
return namespace.trim() || "custom";
|
|
6265
|
+
}
|
|
6266
|
+
function normalizeCustomToolPayload(input) {
|
|
6267
|
+
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
6268
|
+
}
|
|
6269
|
+
function resolveCustomToolFullName(name) {
|
|
6270
|
+
return name.includes(".") ? name : `custom.${name}`;
|
|
6271
|
+
}
|
|
6272
|
+
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
6273
|
+
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
6274
|
+
}
|
|
6275
|
+
function buildBeliefsArchivePayload(input) {
|
|
6276
|
+
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
6277
|
+
}
|
|
6263
6278
|
function asNodeArray(data) {
|
|
6264
6279
|
const rows = asListItems(data, "nodes");
|
|
6265
6280
|
if (rows.length > 0) {
|
|
@@ -6637,7 +6652,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
6637
6652
|
}
|
|
6638
6653
|
|
|
6639
6654
|
// src/version.ts
|
|
6640
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
6655
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
|
|
6641
6656
|
|
|
6642
6657
|
// src/workflowClient.ts
|
|
6643
6658
|
function normalizeLensQuery(value) {
|
|
@@ -7158,11 +7173,11 @@ function createLucernClient(config = {}) {
|
|
|
7158
7173
|
}
|
|
7159
7174
|
}
|
|
7160
7175
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
7161
|
-
const payload =
|
|
7176
|
+
const payload = normalizeCustomToolPayload(input);
|
|
7162
7177
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
7163
7178
|
};
|
|
7164
7179
|
const getCustomNamespace = (namespace) => {
|
|
7165
|
-
const normalized = namespace
|
|
7180
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
7166
7181
|
const cached = customNamespaceCache.get(normalized);
|
|
7167
7182
|
if (cached) {
|
|
7168
7183
|
return cached;
|
|
@@ -7622,10 +7637,7 @@ function createLucernClient(config = {}) {
|
|
|
7622
7637
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
7623
7638
|
},
|
|
7624
7639
|
refine(nodeId, textOrInput, rationale) {
|
|
7625
|
-
const payload =
|
|
7626
|
-
text: textOrInput.text,
|
|
7627
|
-
rationale: textOrInput.rationale
|
|
7628
|
-
};
|
|
7640
|
+
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
7629
7641
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
7630
7642
|
},
|
|
7631
7643
|
updateConfidence(nodeId, input) {
|
|
@@ -7663,7 +7675,7 @@ function createLucernClient(config = {}) {
|
|
|
7663
7675
|
}).then(exposeGatewayData);
|
|
7664
7676
|
},
|
|
7665
7677
|
archive(nodeId, input) {
|
|
7666
|
-
const payload =
|
|
7678
|
+
const payload = buildBeliefsArchivePayload(input);
|
|
7667
7679
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
7668
7680
|
},
|
|
7669
7681
|
list(args) {
|
|
@@ -8703,7 +8715,7 @@ function createLucernClient(config = {}) {
|
|
|
8703
8715
|
list: listRegisteredCustomTools,
|
|
8704
8716
|
clear: clearRegisteredCustomTools,
|
|
8705
8717
|
invoke(name, input = {}) {
|
|
8706
|
-
const fullName = name
|
|
8718
|
+
const fullName = resolveCustomToolFullName(name);
|
|
8707
8719
|
return invokeCustomTool(fullName, input);
|
|
8708
8720
|
},
|
|
8709
8721
|
namespace: getCustomNamespace
|