@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
package/dist/client.d.ts CHANGED
@@ -1124,7 +1124,7 @@ declare function createLucernClient(config?: LucernClientConfig): {
1124
1124
  };
1125
1125
  context: {
1126
1126
  listTopics(query?: Parameters<(query?: TopicListInput) => Promise<PlatformGatewaySuccess<TopicListResponse>>>[0]): Promise<PlatformGatewaySuccess<TopicListResponse>>;
1127
- compile: (topicId: string, input?: CompileContextInput) => Promise<PlatformGatewaySuccess<PublicCompiledContext>>;
1127
+ compile: (topicIdOrInput?: string | CompileContextInput, input?: CompileContextInput) => Promise<PlatformGatewaySuccess<PublicCompiledContext>>;
1128
1128
  recordScopeLearning: (input?: FunctionSurfaceInput, idempotencyKey?: string) => FunctionSurfaceResult<unknown>;
1129
1129
  discover(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1130
1130
  analyzeTopicDensity: (input?: FunctionSurfaceInput, idempotencyKey?: string) => FunctionSurfaceResult<unknown>;
package/dist/client.js CHANGED
@@ -3908,50 +3908,55 @@ function cleanNumber(value) {
3908
3908
  function cleanBoolean(value) {
3909
3909
  return typeof value === "boolean" ? value : void 0;
3910
3910
  }
3911
- function buildCompileContextRequest(topicId, input = {}) {
3912
- const payload = { topicId };
3913
- const query5 = cleanString4(input.query);
3911
+ function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
3912
+ const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
3913
+ const payload = {};
3914
+ const topicId = typeof topicIdOrInput === "string" ? cleanString4(topicIdOrInput) : cleanString4(effectiveInput.topicId);
3915
+ if (topicId) {
3916
+ payload.topicId = topicId;
3917
+ }
3918
+ const query5 = cleanString4(effectiveInput.query);
3914
3919
  if (query5) {
3915
3920
  payload.query = query5;
3916
3921
  }
3917
- const budget = cleanNumber(input.budget) ?? cleanNumber(input.tokenBudget);
3922
+ const budget = cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);
3918
3923
  if (budget !== void 0) {
3919
3924
  payload.budget = budget;
3920
3925
  }
3921
- const ranking = cleanString4(input.ranking) ?? cleanString4(input.rankingProfile);
3926
+ const ranking = cleanString4(effectiveInput.ranking) ?? cleanString4(effectiveInput.rankingProfile);
3922
3927
  if (ranking) {
3923
3928
  payload.ranking = ranking;
3924
3929
  }
3925
- const limit = cleanNumber(input.limit);
3930
+ const limit = cleanNumber(effectiveInput.limit);
3926
3931
  if (limit !== void 0) {
3927
3932
  payload.limit = limit;
3928
3933
  }
3929
- const maxDepth = cleanNumber(input.maxDepth);
3934
+ const maxDepth = cleanNumber(effectiveInput.maxDepth);
3930
3935
  if (maxDepth !== void 0) {
3931
3936
  payload.maxDepth = maxDepth;
3932
3937
  }
3933
- const includeEntities = cleanBoolean(input.includeEntities);
3938
+ const includeEntities = cleanBoolean(effectiveInput.includeEntities);
3934
3939
  if (includeEntities !== void 0) {
3935
3940
  payload.includeEntities = includeEntities;
3936
3941
  }
3937
- const mode = cleanString4(input.mode);
3942
+ const mode = cleanString4(effectiveInput.mode);
3938
3943
  if (mode) {
3939
3944
  payload.mode = mode;
3940
3945
  }
3941
- const includeFailures = cleanBoolean(input.includeFailures);
3946
+ const includeFailures = cleanBoolean(effectiveInput.includeFailures);
3942
3947
  if (includeFailures !== void 0) {
3943
3948
  payload.includeFailures = includeFailures;
3944
3949
  }
3945
- const worktreeId = cleanString4(input.worktreeId);
3950
+ const worktreeId = cleanString4(effectiveInput.worktreeId);
3946
3951
  if (worktreeId) {
3947
3952
  payload.worktreeId = worktreeId;
3948
3953
  }
3949
- const sessionId = cleanString4(input.sessionId);
3954
+ const sessionId = cleanString4(effectiveInput.sessionId);
3950
3955
  if (sessionId) {
3951
3956
  payload.sessionId = sessionId;
3952
3957
  }
3953
- if (Array.isArray(input.packWeightOverrides) && input.packWeightOverrides.length > 0) {
3954
- payload.packWeightOverrides = input.packWeightOverrides;
3958
+ if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
3959
+ payload.packWeightOverrides = effectiveInput.packWeightOverrides;
3955
3960
  }
3956
3961
  return {
3957
3962
  path: "/api/platform/v1/context/compile",
@@ -3963,13 +3968,20 @@ function createContextClient(config = {}) {
3963
3968
  const gateway = createGatewayRequestClient(config);
3964
3969
  return {
3965
3970
  /**
3966
- * Compile a focused reasoning context pack for a topic scope.
3967
- * @param topicId - The topic to compile context for.
3971
+ * Compile a focused reasoning context pack.
3972
+ * @param topicIdOrInput - Optional topic ID, or compile input for query-first resolution.
3968
3973
  * @param input - Optional compile parameters (query, budget, ranking, etc.).
3969
3974
  * @returns The compiled context payload with beliefs, questions, and evidence.
3970
3975
  */
3971
- async compile(topicId, input = {}) {
3972
- const request = buildCompileContextRequest(topicId, input);
3976
+ async compile(topicIdOrInput = {}, input = {}) {
3977
+ const request = buildCompileContextRequest(topicIdOrInput, input);
3978
+ return gateway.request({
3979
+ ...request,
3980
+ body: request.body
3981
+ });
3982
+ },
3983
+ async compileByQuery(input = {}) {
3984
+ const request = buildCompileContextRequest(input);
3973
3985
  return gateway.request({
3974
3986
  ...request,
3975
3987
  body: request.body
@@ -6621,7 +6633,7 @@ function createToolRegistryClient(config = {}) {
6621
6633
  }
6622
6634
 
6623
6635
  // src/version.ts
6624
- var LUCERN_SDK_VERSION = "0.3.0-alpha.7";
6636
+ var LUCERN_SDK_VERSION = "0.3.0-alpha.8";
6625
6637
 
6626
6638
  // src/workflowClient.ts
6627
6639
  function normalizeLensQuery(value) {