@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.
Files changed (46) hide show
  1. package/dist/beliefs/index.d.ts +1 -0
  2. package/dist/beliefs/index.js +21 -9
  3. package/dist/beliefs/index.js.map +1 -1
  4. package/dist/client.d.ts +5 -2
  5. package/dist/client.js +21 -9
  6. package/dist/client.js.map +1 -1
  7. package/dist/clientHelpers.d.ts +21 -2
  8. package/dist/clientHelpers.js +16 -1
  9. package/dist/clientHelpers.js.map +1 -1
  10. package/dist/contradictions/index.d.ts +1 -0
  11. package/dist/contradictions/index.js +21 -9
  12. package/dist/contradictions/index.js.map +1 -1
  13. package/dist/decisions/index.d.ts +1 -0
  14. package/dist/decisions/index.js +21 -9
  15. package/dist/decisions/index.js.map +1 -1
  16. package/dist/edges/index.d.ts +1 -0
  17. package/dist/edges/index.js +21 -9
  18. package/dist/edges/index.js.map +1 -1
  19. package/dist/evidence/index.d.ts +1 -0
  20. package/dist/evidence/index.js +21 -9
  21. package/dist/evidence/index.js.map +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +21 -9
  24. package/dist/index.js.map +1 -1
  25. package/dist/lenses/index.d.ts +1 -0
  26. package/dist/lenses/index.js +21 -9
  27. package/dist/lenses/index.js.map +1 -1
  28. package/dist/nodes/index.d.ts +1 -0
  29. package/dist/nodes/index.js +21 -9
  30. package/dist/nodes/index.js.map +1 -1
  31. package/dist/ontologies/index.d.ts +1 -0
  32. package/dist/ontologies/index.js +21 -9
  33. package/dist/ontologies/index.js.map +1 -1
  34. package/dist/questions/index.d.ts +1 -0
  35. package/dist/questions/index.js +21 -9
  36. package/dist/questions/index.js.map +1 -1
  37. package/dist/topics/index.d.ts +1 -0
  38. package/dist/topics/index.js +21 -9
  39. package/dist/topics/index.js.map +1 -1
  40. package/dist/version.d.ts +1 -1
  41. package/dist/version.js +1 -1
  42. package/dist/version.js.map +1 -1
  43. package/dist/worktrees/index.d.ts +1 -0
  44. package/dist/worktrees/index.js +21 -9
  45. package/dist/worktrees/index.js.map +1 -1
  46. 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 EvidenceClientConfig = LucernClientConfig;
57
58
  type EvidenceClient = ReturnType<typeof createEvidenceClient>;
@@ -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.8";
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 = input && typeof input === "object" && !Array.isArray(input) ? input : {};
7176
+ const payload = normalizeCustomToolPayload(input);
7162
7177
  return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
7163
7178
  };
7164
7179
  const getCustomNamespace = (namespace) => {
7165
- const normalized = namespace.trim() || "custom";
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 = typeof textOrInput === "string" ? { text: textOrInput, rationale } : {
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 = typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
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.includes(".") ? name : `custom.${name}`;
8718
+ const fullName = resolveCustomToolFullName(name);
8707
8719
  return invokeCustomTool(fullName, input);
8708
8720
  },
8709
8721
  namespace: getCustomNamespace