@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
package/dist/client.d.ts CHANGED
@@ -38,6 +38,7 @@ import { LearningClientConfig } from './learningClient.js';
38
38
  import { ReportsClientConfig } from './reportsClient.js';
39
39
  import { SourcesClientConfig, UpsertSourceSpec } from './sourcesClient.js';
40
40
  import { WorkflowClientConfig, WorkflowLensPerspectiveType, WorkflowLensStatus, AddWorktreeInput, WorkflowWorktreeStatus, UpdateWorktreeTargetsInput, MergeInput, CreateTaskInput, CompleteTaskInput, UpdateTaskInput, WorkflowBranchStatus, CompleteWorktreeInput, AdvanceWorktreePhaseInput, SetWorktreePhaseInput, PatchWorktreeStateInput, BulkCreateWorktreesInput, ListTopicsInput, SwitchTopicContextInput } from './workflowClient.js';
41
+ import { CustomToolInput as CustomToolInput$1 } from './clientHelpers.js';
41
42
  import './authContext.js';
42
43
  import './contracts/auth-session.contract.js';
43
44
  import './contracts/workflow-runtime.contract.js';
@@ -50,7 +51,7 @@ import 'zod';
50
51
  import '@lucern/contracts/tool-contracts';
51
52
 
52
53
  type ClientConfig = BeliefsClientConfig | SourcesClientConfig | GraphClientConfig | DecisionsClientConfig | AnswersClientConfig | ContextClientConfig | WorkflowClientConfig | AuditClientConfig | AdminClientConfig | EvidenceClientConfig | EmbeddingsClientConfig | EventingClientConfig | GraphAnalysisClientConfig | GraphRecommendationsClientConfig | GraphStateClassifierClientConfig | IdentityClientConfig | JobsClientConfig | ModelRuntimeClientConfig | OntologyLinksClientConfig | OrgGraphSearchClientConfig | PolicyClientConfig | PacksClientConfig | ReportsClientConfig | LearningClientConfig | TelemetryClientConfig | ToolRegistryClientConfig | FunctionSurfaceClientConfig | OntologyClientConfig | HarnessClientConfig | SchemaClientConfig | AudiencesClientConfig | TopicsClientConfig;
53
- type CustomToolInput = JsonObject;
54
+ type CustomToolInput = CustomToolInput$1;
54
55
  type CustomToolInvoker = (input?: CustomToolInput) => Promise<unknown>;
55
56
  type CustomToolNamespace = Record<string, CustomToolInvoker>;
56
57
  type GatewayDataEnvelope<T extends Record<string, unknown>> = PlatformGatewaySuccess<T> & T;
@@ -2169,7 +2170,9 @@ declare function createLucernClient(config?: LucernClientConfig): {
2169
2170
  name?: string;
2170
2171
  status?: "active" | "archived";
2171
2172
  defaultProjectVisibility?: "private" | "team" | "firm" | "external" | "public";
2172
- restore?: boolean;
2173
+ restore
2174
+ /** Target environment. Defaults to production if not specified. */
2175
+ ? /** Target environment. Defaults to production if not specified. */: boolean;
2173
2176
  metadata?: JsonObject;
2174
2177
  }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2175
2178
  listMemberships(query?: GatewayScope & {
package/dist/client.js CHANGED
@@ -6256,6 +6256,21 @@ function createSchemaClient(config = {}) {
6256
6256
  }
6257
6257
 
6258
6258
  // src/clientHelpers.ts
6259
+ function normalizeCustomNamespace(namespace) {
6260
+ return namespace.trim() || "custom";
6261
+ }
6262
+ function normalizeCustomToolPayload(input) {
6263
+ return input && typeof input === "object" && !Array.isArray(input) ? input : {};
6264
+ }
6265
+ function resolveCustomToolFullName(name) {
6266
+ return name.includes(".") ? name : `custom.${name}`;
6267
+ }
6268
+ function buildBeliefsRefinePayload(textOrInput, rationale) {
6269
+ return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
6270
+ }
6271
+ function buildBeliefsArchivePayload(input) {
6272
+ return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
6273
+ }
6259
6274
  function asNodeArray(data) {
6260
6275
  const rows = asListItems(data, "nodes");
6261
6276
  if (rows.length > 0) {
@@ -6633,7 +6648,7 @@ function createToolRegistryClient(config = {}) {
6633
6648
  }
6634
6649
 
6635
6650
  // src/version.ts
6636
- var LUCERN_SDK_VERSION = "0.3.0-alpha.8";
6651
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
6637
6652
 
6638
6653
  // src/workflowClient.ts
6639
6654
  function normalizeLensQuery(value) {
@@ -7154,11 +7169,11 @@ function createLucernClient(config = {}) {
7154
7169
  }
7155
7170
  }
7156
7171
  const invokeCustomTool = async (fullName, input = {}) => {
7157
- const payload = input && typeof input === "object" && !Array.isArray(input) ? input : {};
7172
+ const payload = normalizeCustomToolPayload(input);
7158
7173
  return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
7159
7174
  };
7160
7175
  const getCustomNamespace = (namespace) => {
7161
- const normalized = namespace.trim() || "custom";
7176
+ const normalized = normalizeCustomNamespace(namespace);
7162
7177
  const cached = customNamespaceCache.get(normalized);
7163
7178
  if (cached) {
7164
7179
  return cached;
@@ -7618,10 +7633,7 @@ function createLucernClient(config = {}) {
7618
7633
  return beliefsFacade.get(nodeId).then(exposeGatewayData);
7619
7634
  },
7620
7635
  refine(nodeId, textOrInput, rationale) {
7621
- const payload = typeof textOrInput === "string" ? { text: textOrInput, rationale } : {
7622
- text: textOrInput.text,
7623
- rationale: textOrInput.rationale
7624
- };
7636
+ const payload = buildBeliefsRefinePayload(textOrInput, rationale);
7625
7637
  return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
7626
7638
  },
7627
7639
  updateConfidence(nodeId, input) {
@@ -7659,7 +7671,7 @@ function createLucernClient(config = {}) {
7659
7671
  }).then(exposeGatewayData);
7660
7672
  },
7661
7673
  archive(nodeId, input) {
7662
- const payload = typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
7674
+ const payload = buildBeliefsArchivePayload(input);
7663
7675
  return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
7664
7676
  },
7665
7677
  list(args) {
@@ -8699,7 +8711,7 @@ function createLucernClient(config = {}) {
8699
8711
  list: listRegisteredCustomTools,
8700
8712
  clear: clearRegisteredCustomTools,
8701
8713
  invoke(name, input = {}) {
8702
- const fullName = name.includes(".") ? name : `custom.${name}`;
8714
+ const fullName = resolveCustomToolFullName(name);
8703
8715
  return invokeCustomTool(fullName, input);
8704
8716
  },
8705
8717
  namespace: getCustomNamespace