@lucern/sdk 0.3.0-alpha.7 → 0.3.0-alpha.8

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 (41) hide show
  1. package/README.md +4 -4
  2. package/dist/beliefs/index.js +31 -19
  3. package/dist/beliefs/index.js.map +1 -1
  4. package/dist/client.d.ts +1 -1
  5. package/dist/client.js +31 -19
  6. package/dist/client.js.map +1 -1
  7. package/dist/contextClient.d.ts +4 -3
  8. package/dist/contextClient.js +30 -18
  9. package/dist/contextClient.js.map +1 -1
  10. package/dist/contextFacade.js +25 -16
  11. package/dist/contextFacade.js.map +1 -1
  12. package/dist/contextTypes.d.ts +2 -0
  13. package/dist/contradictions/index.js +31 -19
  14. package/dist/contradictions/index.js.map +1 -1
  15. package/dist/decisions/index.js +31 -19
  16. package/dist/decisions/index.js.map +1 -1
  17. package/dist/edges/index.js +31 -19
  18. package/dist/edges/index.js.map +1 -1
  19. package/dist/evidence/index.js +31 -19
  20. package/dist/evidence/index.js.map +1 -1
  21. package/dist/facade/context.d.ts +2 -1
  22. package/dist/facade/context.js +25 -16
  23. package/dist/facade/context.js.map +1 -1
  24. package/dist/index.js +56 -35
  25. package/dist/index.js.map +1 -1
  26. package/dist/lenses/index.js +31 -19
  27. package/dist/lenses/index.js.map +1 -1
  28. package/dist/nodes/index.js +31 -19
  29. package/dist/nodes/index.js.map +1 -1
  30. package/dist/ontologies/index.js +31 -19
  31. package/dist/ontologies/index.js.map +1 -1
  32. package/dist/questions/index.js +31 -19
  33. package/dist/questions/index.js.map +1 -1
  34. package/dist/topics/index.js +31 -19
  35. package/dist/topics/index.js.map +1 -1
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/dist/version.js.map +1 -1
  39. package/dist/worktrees/index.js +31 -19
  40. package/dist/worktrees/index.js.map +1 -1
  41. package/package.json +4 -4
@@ -3912,50 +3912,55 @@ function cleanNumber(value) {
3912
3912
  function cleanBoolean(value) {
3913
3913
  return typeof value === "boolean" ? value : void 0;
3914
3914
  }
3915
- function buildCompileContextRequest(topicId, input = {}) {
3916
- const payload = { topicId };
3917
- const query5 = cleanString4(input.query);
3915
+ function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
3916
+ const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
3917
+ const payload = {};
3918
+ const topicId = typeof topicIdOrInput === "string" ? cleanString4(topicIdOrInput) : cleanString4(effectiveInput.topicId);
3919
+ if (topicId) {
3920
+ payload.topicId = topicId;
3921
+ }
3922
+ const query5 = cleanString4(effectiveInput.query);
3918
3923
  if (query5) {
3919
3924
  payload.query = query5;
3920
3925
  }
3921
- const budget = cleanNumber(input.budget) ?? cleanNumber(input.tokenBudget);
3926
+ const budget = cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);
3922
3927
  if (budget !== void 0) {
3923
3928
  payload.budget = budget;
3924
3929
  }
3925
- const ranking = cleanString4(input.ranking) ?? cleanString4(input.rankingProfile);
3930
+ const ranking = cleanString4(effectiveInput.ranking) ?? cleanString4(effectiveInput.rankingProfile);
3926
3931
  if (ranking) {
3927
3932
  payload.ranking = ranking;
3928
3933
  }
3929
- const limit = cleanNumber(input.limit);
3934
+ const limit = cleanNumber(effectiveInput.limit);
3930
3935
  if (limit !== void 0) {
3931
3936
  payload.limit = limit;
3932
3937
  }
3933
- const maxDepth = cleanNumber(input.maxDepth);
3938
+ const maxDepth = cleanNumber(effectiveInput.maxDepth);
3934
3939
  if (maxDepth !== void 0) {
3935
3940
  payload.maxDepth = maxDepth;
3936
3941
  }
3937
- const includeEntities = cleanBoolean(input.includeEntities);
3942
+ const includeEntities = cleanBoolean(effectiveInput.includeEntities);
3938
3943
  if (includeEntities !== void 0) {
3939
3944
  payload.includeEntities = includeEntities;
3940
3945
  }
3941
- const mode = cleanString4(input.mode);
3946
+ const mode = cleanString4(effectiveInput.mode);
3942
3947
  if (mode) {
3943
3948
  payload.mode = mode;
3944
3949
  }
3945
- const includeFailures = cleanBoolean(input.includeFailures);
3950
+ const includeFailures = cleanBoolean(effectiveInput.includeFailures);
3946
3951
  if (includeFailures !== void 0) {
3947
3952
  payload.includeFailures = includeFailures;
3948
3953
  }
3949
- const worktreeId = cleanString4(input.worktreeId);
3954
+ const worktreeId = cleanString4(effectiveInput.worktreeId);
3950
3955
  if (worktreeId) {
3951
3956
  payload.worktreeId = worktreeId;
3952
3957
  }
3953
- const sessionId = cleanString4(input.sessionId);
3958
+ const sessionId = cleanString4(effectiveInput.sessionId);
3954
3959
  if (sessionId) {
3955
3960
  payload.sessionId = sessionId;
3956
3961
  }
3957
- if (Array.isArray(input.packWeightOverrides) && input.packWeightOverrides.length > 0) {
3958
- payload.packWeightOverrides = input.packWeightOverrides;
3962
+ if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
3963
+ payload.packWeightOverrides = effectiveInput.packWeightOverrides;
3959
3964
  }
3960
3965
  return {
3961
3966
  path: "/api/platform/v1/context/compile",
@@ -3967,13 +3972,20 @@ function createContextClient(config = {}) {
3967
3972
  const gateway = createGatewayRequestClient(config);
3968
3973
  return {
3969
3974
  /**
3970
- * Compile a focused reasoning context pack for a topic scope.
3971
- * @param topicId - The topic to compile context for.
3975
+ * Compile a focused reasoning context pack.
3976
+ * @param topicIdOrInput - Optional topic ID, or compile input for query-first resolution.
3972
3977
  * @param input - Optional compile parameters (query, budget, ranking, etc.).
3973
3978
  * @returns The compiled context payload with beliefs, questions, and evidence.
3974
3979
  */
3975
- async compile(topicId, input = {}) {
3976
- const request = buildCompileContextRequest(topicId, input);
3980
+ async compile(topicIdOrInput = {}, input = {}) {
3981
+ const request = buildCompileContextRequest(topicIdOrInput, input);
3982
+ return gateway.request({
3983
+ ...request,
3984
+ body: request.body
3985
+ });
3986
+ },
3987
+ async compileByQuery(input = {}) {
3988
+ const request = buildCompileContextRequest(input);
3977
3989
  return gateway.request({
3978
3990
  ...request,
3979
3991
  body: request.body
@@ -6625,7 +6637,7 @@ function createToolRegistryClient(config = {}) {
6625
6637
  }
6626
6638
 
6627
6639
  // src/version.ts
6628
- var LUCERN_SDK_VERSION = "0.3.0-alpha.7";
6640
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.8";
6629
6641
 
6630
6642
  // src/workflowClient.ts
6631
6643
  function normalizeLensQuery(value) {