@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
@@ -54,6 +54,7 @@ import '../learningClient.js';
54
54
  import '../reportsClient.js';
55
55
  import '../sourcesClient.js';
56
56
  import '../workflowClient.js';
57
+ import '../clientHelpers.js';
57
58
 
58
59
  type EdgesClientConfig = LucernClientConfig;
59
60
  type EdgesClient = ReturnType<typeof createEdgesClient>;
@@ -6262,6 +6262,21 @@ function createSchemaClient(config = {}) {
6262
6262
  }
6263
6263
 
6264
6264
  // src/clientHelpers.ts
6265
+ function normalizeCustomNamespace(namespace) {
6266
+ return namespace.trim() || "custom";
6267
+ }
6268
+ function normalizeCustomToolPayload(input) {
6269
+ return input && typeof input === "object" && !Array.isArray(input) ? input : {};
6270
+ }
6271
+ function resolveCustomToolFullName(name) {
6272
+ return name.includes(".") ? name : `custom.${name}`;
6273
+ }
6274
+ function buildBeliefsRefinePayload(textOrInput, rationale) {
6275
+ return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
6276
+ }
6277
+ function buildBeliefsArchivePayload(input) {
6278
+ return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
6279
+ }
6265
6280
  function asNodeArray(data) {
6266
6281
  const rows = asListItems(data, "nodes");
6267
6282
  if (rows.length > 0) {
@@ -6639,7 +6654,7 @@ function createToolRegistryClient(config = {}) {
6639
6654
  }
6640
6655
 
6641
6656
  // src/version.ts
6642
- var LUCERN_SDK_VERSION = "0.3.0-alpha.8";
6657
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
6643
6658
 
6644
6659
  // src/workflowClient.ts
6645
6660
  function normalizeLensQuery(value) {
@@ -7160,11 +7175,11 @@ function createLucernClient(config = {}) {
7160
7175
  }
7161
7176
  }
7162
7177
  const invokeCustomTool = async (fullName, input = {}) => {
7163
- const payload = input && typeof input === "object" && !Array.isArray(input) ? input : {};
7178
+ const payload = normalizeCustomToolPayload(input);
7164
7179
  return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
7165
7180
  };
7166
7181
  const getCustomNamespace = (namespace) => {
7167
- const normalized = namespace.trim() || "custom";
7182
+ const normalized = normalizeCustomNamespace(namespace);
7168
7183
  const cached = customNamespaceCache.get(normalized);
7169
7184
  if (cached) {
7170
7185
  return cached;
@@ -7624,10 +7639,7 @@ function createLucernClient(config = {}) {
7624
7639
  return beliefsFacade.get(nodeId).then(exposeGatewayData);
7625
7640
  },
7626
7641
  refine(nodeId, textOrInput, rationale) {
7627
- const payload = typeof textOrInput === "string" ? { text: textOrInput, rationale } : {
7628
- text: textOrInput.text,
7629
- rationale: textOrInput.rationale
7630
- };
7642
+ const payload = buildBeliefsRefinePayload(textOrInput, rationale);
7631
7643
  return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
7632
7644
  },
7633
7645
  updateConfidence(nodeId, input) {
@@ -7665,7 +7677,7 @@ function createLucernClient(config = {}) {
7665
7677
  }).then(exposeGatewayData);
7666
7678
  },
7667
7679
  archive(nodeId, input) {
7668
- const payload = typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
7680
+ const payload = buildBeliefsArchivePayload(input);
7669
7681
  return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
7670
7682
  },
7671
7683
  list(args) {
@@ -8705,7 +8717,7 @@ function createLucernClient(config = {}) {
8705
8717
  list: listRegisteredCustomTools,
8706
8718
  clear: clearRegisteredCustomTools,
8707
8719
  invoke(name, input = {}) {
8708
- const fullName = name.includes(".") ? name : `custom.${name}`;
8720
+ const fullName = resolveCustomToolFullName(name);
8709
8721
  return invokeCustomTool(fullName, input);
8710
8722
  },
8711
8723
  namespace: getCustomNamespace