@lucern/sdk 1.0.28 → 1.0.30

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 (191) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/accessControl.d.ts +31 -31
  3. package/dist/accessControl.js +1 -0
  4. package/dist/adminClient.d.ts +74 -74
  5. package/dist/adminClient.js +38 -30
  6. package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
  7. package/dist/{answersClient.js → answers-client.js} +2 -2
  8. package/dist/audience/index.d.ts +12 -12
  9. package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
  10. package/dist/audiences-client.js +107 -0
  11. package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
  12. package/dist/{auditClient.js → audit-client.js} +8 -7
  13. package/dist/authContext.d.ts +26 -26
  14. package/dist/authDeviceClient.d.ts +11 -11
  15. package/dist/authDeviceClient.js +4 -6
  16. package/dist/beliefs/index.d.ts +56 -28
  17. package/dist/beliefs/index.js +2 -1
  18. package/dist/beliefsClient.d.ts +71 -63
  19. package/dist/beliefsClient.js +90 -67
  20. package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
  21. package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
  22. package/dist/client-assembly-types.d.ts +219 -0
  23. package/dist/client-assembly-types.js +2 -0
  24. package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
  25. package/dist/client-config.js +2 -0
  26. package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
  27. package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
  28. package/dist/client.d.ts +1906 -352
  29. package/dist/client.js +34 -30
  30. package/dist/clientGraphNamespaces.d.ts +35 -25
  31. package/dist/clientGraphNamespaces.js +11 -5
  32. package/dist/clientHelpers.js +8 -5
  33. package/dist/clientKnowledgeNamespaces.d.ts +124 -84
  34. package/dist/clientKnowledgeNamespaces.js +35 -34
  35. package/dist/clientLocalHelpers.d.ts +81 -52
  36. package/dist/clientLocalHelpers.js +193 -43
  37. package/dist/clientPlatformNamespaces.d.ts +1541 -150
  38. package/dist/clientPlatformNamespaces.js +10 -5
  39. package/dist/clientRuntime.d.ts +1 -1
  40. package/dist/clientRuntime.js +1 -1
  41. package/dist/clientWorkflowNamespaces.d.ts +211 -97
  42. package/dist/clientWorkflowNamespaces.js +22 -19
  43. package/dist/contextClient.d.ts +2 -2
  44. package/dist/contextClient.js +79 -50
  45. package/dist/contextFacade.d.ts +1 -1
  46. package/dist/contextFacade.js +2 -0
  47. package/dist/contextPackCompiler.d.ts +52 -52
  48. package/dist/contextPackCompiler.js +192 -122
  49. package/dist/contextPackPolicy.d.ts +22 -22
  50. package/dist/contextPackPolicy.js +21 -9
  51. package/dist/contextPackSchema.d.ts +3 -3
  52. package/dist/contextPackSchema.js +1 -0
  53. package/dist/contextTypes.d.ts +155 -155
  54. package/dist/contracts/api-enums.contract.js +2 -11
  55. package/dist/contracts/auth-session.contract.d.ts +16 -16
  56. package/dist/contracts/auth-session.contract.js +3 -2
  57. package/dist/contracts/context-pack.contract.d.ts +216 -216
  58. package/dist/contracts/contextPack.js +2 -0
  59. package/dist/contracts/index.d.ts +1 -1
  60. package/dist/contracts/index.js +2 -1
  61. package/dist/contracts/lens-filter.contract.d.ts +8 -8
  62. package/dist/contracts/lens-filter.contract.js +10 -10
  63. package/dist/contracts/lens-workflow.contract.d.ts +32 -32
  64. package/dist/contracts/lens-workflow.contract.js +2 -1
  65. package/dist/contracts/lensFilter.js +2 -0
  66. package/dist/contracts/lensWorkflow.js +2 -0
  67. package/dist/contracts/mcpTools.d.ts +19 -19
  68. package/dist/contracts/mcpTools.js +3 -1
  69. package/dist/contracts/prompt.contract.d.ts +12 -12
  70. package/dist/contracts/prompt.js +1 -0
  71. package/dist/contracts/sdk-tools.contract.js +1 -0
  72. package/dist/contracts/sdkTools.js +2 -0
  73. package/dist/contracts/tool-contracts.js +1 -0
  74. package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
  75. package/dist/contracts/workflow-runtime.contract.js +1 -5
  76. package/dist/contracts/workflowRuntime.js +2 -0
  77. package/dist/contradictions/index.d.ts +8 -8
  78. package/dist/contradictions/index.js +1 -0
  79. package/dist/control-plane.d.ts +10 -10
  80. package/dist/control-plane.js +2 -2
  81. package/dist/controlObjectOwnership.d.ts +11 -11
  82. package/dist/controlObjectOwnership.js +1 -0
  83. package/dist/coreClient.d.ts +51 -51
  84. package/dist/coreClient.js +269 -101
  85. package/dist/customTools.d.ts +19 -19
  86. package/dist/customTools.js +4 -2
  87. package/dist/decisions/index.d.ts +18 -18
  88. package/dist/decisions/index.js +1 -0
  89. package/dist/decisionsClient.d.ts +4 -4
  90. package/dist/decisionsClient.js +36 -27
  91. package/dist/edges/index.d.ts +20 -18
  92. package/dist/edges/index.js +1 -0
  93. package/dist/embeddingsClient.d.ts +29 -29
  94. package/dist/embeddingsClient.js +15 -8
  95. package/dist/eventingClient.d.ts +27 -27
  96. package/dist/eventingClient.js +10 -5
  97. package/dist/events.d.ts +83 -83
  98. package/dist/events.js +19 -15
  99. package/dist/eventsCore.d.ts +7 -7
  100. package/dist/eventsCore.js +11 -10
  101. package/dist/evidence/index.d.ts +23 -21
  102. package/dist/evidence/index.js +1 -0
  103. package/dist/evidenceClient.d.ts +23 -23
  104. package/dist/evidenceClient.js +10 -6
  105. package/dist/facade/context.d.ts +9 -9
  106. package/dist/facade/context.js +67 -41
  107. package/dist/functionSurface.js +2 -0
  108. package/dist/functionSurfaceClient.js +2 -0
  109. package/dist/gatewayFacades.d.ts +215 -215
  110. package/dist/gatewayFacades.factories.d.ts +23 -44
  111. package/dist/gatewayFacades.factories.js +63 -62
  112. package/dist/gatewayFacades.js +31 -32
  113. package/dist/graphAnalysisClient.d.ts +60 -60
  114. package/dist/graphAnalysisClient.js +19 -18
  115. package/dist/graphClient.d.ts +34 -34
  116. package/dist/graphClient.js +56 -35
  117. package/dist/graphIntel.js +2 -0
  118. package/dist/graphIntelligence.d.ts +2 -2
  119. package/dist/graphIntelligence.js +1 -1
  120. package/dist/graphRecommendationsClient.d.ts +24 -24
  121. package/dist/graphRecommendationsClient.js +12 -7
  122. package/dist/graphStateClassifierClient.d.ts +13 -13
  123. package/dist/graphStateClassifierClient.js +10 -5
  124. package/dist/harnessClient.d.ts +61 -61
  125. package/dist/harnessClient.js +44 -31
  126. package/dist/identityClient.d.ts +33 -59
  127. package/dist/identityClient.js +126 -98
  128. package/dist/index.d.ts +20 -20
  129. package/dist/index.js +20 -19
  130. package/dist/infisicalRuntime.d.ts +11 -11
  131. package/dist/infisicalRuntime.js +20 -14
  132. package/dist/jobsClient.d.ts +28 -28
  133. package/dist/jobsClient.js +6 -3
  134. package/dist/learningClient.js +13 -8
  135. package/dist/lenses/index.d.ts +124 -28
  136. package/dist/lenses/index.js +1 -0
  137. package/dist/mcpClient.d.ts +1 -1
  138. package/dist/mcpClient.js +3 -3
  139. package/dist/modelRuntimeClient.d.ts +27 -27
  140. package/dist/modelRuntimeClient.js +10 -5
  141. package/dist/nodes/index.d.ts +9 -9
  142. package/dist/nodes/index.js +1 -0
  143. package/dist/ontologies/index.d.ts +68 -22
  144. package/dist/ontologies/index.js +1 -0
  145. package/dist/ontologyClient.js +24 -17
  146. package/dist/ontologyLinksClient.d.ts +35 -35
  147. package/dist/ontologyLinksClient.js +9 -6
  148. package/dist/opinion.d.ts +3 -3
  149. package/dist/opinion.js +12 -5
  150. package/dist/orgGraphSearchClient.d.ts +39 -39
  151. package/dist/orgGraphSearchClient.js +22 -13
  152. package/dist/packsClient.d.ts +1 -1
  153. package/dist/packsClient.js +28 -19
  154. package/dist/policyClient.d.ts +79 -68
  155. package/dist/policyClient.js +18 -12
  156. package/dist/proof-attestation.json +1 -1
  157. package/dist/questions/index.d.ts +38 -27
  158. package/dist/questions/index.js +1 -0
  159. package/dist/realtime/index.d.ts +3 -3
  160. package/dist/realtime/index.js +1 -0
  161. package/dist/realtime/refs.d.ts +2 -2
  162. package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
  163. package/dist/{reportsClient.js → reports-client.js} +19 -13
  164. package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
  165. package/dist/{schemaClient.js → schema-client.js} +14 -11
  166. package/dist/sdkSurface.d.ts +12 -12
  167. package/dist/sdkSurface.js +14 -10
  168. package/dist/secrets.d.ts +1 -1
  169. package/dist/secrets.js +2 -1
  170. package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
  171. package/dist/{sourcesClient.js → sources-client.js} +4 -5
  172. package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
  173. package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
  174. package/dist/toolRegistryClient.d.ts +46 -46
  175. package/dist/toolRegistryClient.js +22 -11
  176. package/dist/topics/index.d.ts +23 -23
  177. package/dist/topics/index.js +2 -1
  178. package/dist/topicsClient.d.ts +6 -6
  179. package/dist/topicsClient.js +29 -18
  180. package/dist/types.d.ts +356 -355
  181. package/dist/version.d.ts +1 -1
  182. package/dist/version.js +1 -1
  183. package/dist/workflowClient.d.ts +36 -35
  184. package/dist/workflowClient.js +88 -60
  185. package/dist/worktrees/index.d.ts +118 -32
  186. package/dist/worktrees/index.js +2 -1
  187. package/package.json +45 -5
  188. package/dist/audiencesClient.js +0 -115
  189. package/dist/clientAssemblyTypes.d.ts +0 -33
  190. package/dist/clientAssemblyTypes.js +0 -2
  191. package/dist/clientConfig.js +0 -2
@@ -1,24 +1,42 @@
1
1
  import { type OpinionHistoryEntry } from "./beliefsClient";
2
- import { type EvidenceCompatInput } from "./clientEvidenceCompat";
3
- import type { ClientNamespaceContext } from "./clientAssemblyTypes";
4
- import type { CustomToolInput, CustomToolNamespace } from "./clientConfig";
2
+ import type { ClientLocalHelperContext } from "./client-assembly-types";
3
+ import type { CustomToolInput, CustomToolNamespace } from "./client-config";
4
+ import { type EvidenceCompatInput } from "./client-evidence-compat";
5
5
  import { type PlatformGatewaySuccess } from "./coreClient";
6
6
  import type { FunctionSurfaceInput } from "./generated/functionSurface";
7
7
  import type { JsonObject } from "./types";
8
- export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
8
+ export declare function createClientLocalHelpers(ctx: ClientLocalHelperContext): {
9
9
  addEvidence: (args: EvidenceCompatInput) => Promise<Record<string, unknown>>;
10
- archiveOntologyCompat: (input?: JsonObject) => Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
10
+ archiveOntologyCompat: (input?: JsonObject) => Promise<{
11
+ correlationId: string;
12
+ data: Record<string, unknown>;
13
+ idempotentReplay: boolean;
14
+ policyTraceId: string | null;
15
+ success: true;
16
+ }>;
11
17
  bisectConfidence: (nodeId: string, args: {
12
18
  expectedDirection: "overconfident" | "underconfident";
13
- }) => Promise<any>;
14
- createContractCompat: (input?: JsonObject) => Promise<any>;
19
+ }) => Promise<import("./client-config").GatewayDataEnvelope<import("./gatewayFacades").GatewayRecord>>;
20
+ createContractCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
15
21
  createEvidence: (args: EvidenceCompatInput) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
16
- createOntologyCompat: (input?: JsonObject) => Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
17
- createOntologyVersionCompat: (input?: JsonObject) => Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
18
- deprecateOntologyVersionCompat: (input?: JsonObject) => Promise<any>;
19
- discoverEntityConnections: (input?: JsonObject) => Promise<any>;
20
- discoverTopics: (input?: JsonObject) => Promise<any>;
21
- evaluateContractCompat: (input?: JsonObject) => Promise<any>;
22
+ createOntologyCompat: (input?: JsonObject) => Promise<{
23
+ correlationId: string;
24
+ data: Record<string, unknown>;
25
+ idempotentReplay: boolean;
26
+ policyTraceId: string | null;
27
+ success: true;
28
+ }>;
29
+ createOntologyVersionCompat: (input?: JsonObject) => Promise<{
30
+ correlationId: string;
31
+ data: Record<string, unknown>;
32
+ idempotentReplay: boolean;
33
+ policyTraceId: string | null;
34
+ success: true;
35
+ }>;
36
+ deprecateOntologyVersionCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
37
+ discoverEntityConnections: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
38
+ discoverTopics: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
39
+ evaluateContractCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
22
40
  extensionNamespaces: Record<string, CustomToolNamespace>;
23
41
  findContradictions: (args: {
24
42
  topicId?: string;
@@ -40,12 +58,12 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
40
58
  actor: string;
41
59
  timestamp: number;
42
60
  rationale: string;
43
- before: string | number | boolean | import("./types").JsonArray | JsonObject | null;
44
- after: string | number | boolean | import("./types").JsonArray | JsonObject | null;
61
+ before: string | number | boolean | JsonObject | import("./types").JsonArray | null;
62
+ after: string | number | boolean | JsonObject | import("./types").JsonArray | null;
45
63
  }[];
46
64
  }>;
47
- getConfidenceHistory: (nodeId: string) => Promise<any>;
48
- getContractStatusCompat: (input?: JsonObject) => Promise<any>;
65
+ getConfidenceHistory: (nodeId: string) => Promise<import("./client-config").GatewayDataEnvelope<import("./gatewayFacades").GatewayRecord>>;
66
+ getContractStatusCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
49
67
  getCustomNamespace: (namespace: string) => CustomToolNamespace;
50
68
  getOpinionHistory: (nodeId: string) => Promise<OpinionHistoryEntry[]>;
51
69
  invokeCustomTool: (fullName: string, input?: CustomToolInput) => Promise<unknown>;
@@ -56,17 +74,17 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
56
74
  minConfidence?: number;
57
75
  limit?: number;
58
76
  cursor?: string;
59
- }) => Promise<any>;
60
- listContractsCompat: (input?: JsonObject) => Promise<any>;
77
+ }) => Promise<import("./gatewayFacades").BeliefRecord[]>;
78
+ listContractsCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
61
79
  nodesNamespace: {
62
- list: (...args: any[]) => any;
63
- get(input: string | Parameters<(...args: any[]) => any>[0]): any;
64
- create(input: FunctionSurfaceInput, idempotencyKey?: string): any;
65
- createEpistemicNode(input: FunctionSurfaceInput, idempotencyKey?: string): any;
66
- update(input: FunctionSurfaceInput, idempotencyKey?: string): any;
67
- updateEpistemicNode(input: FunctionSurfaceInput, idempotencyKey?: string): any;
68
- batchCreate(input: FunctionSurfaceInput, idempotencyKey?: string): any;
69
- batchCreateEpistemicNodes(input: FunctionSurfaceInput, idempotencyKey?: string): any;
80
+ list: (query: import("./graphClient").ListNodesInput) => Promise<PlatformGatewaySuccess<import("./types").ListResult<import("./types").PlatformGraphNode, "nodes">>>;
81
+ get(input: string | Parameters<(query: import("./graphClient").GetNodeInput) => Promise<PlatformGatewaySuccess<import("./types").PlatformGraphNode>>>[0]): Promise<PlatformGatewaySuccess<import("./types").PlatformGraphNode>>;
82
+ create(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
83
+ createEpistemicNode(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
84
+ update(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
85
+ updateEpistemicNode(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
86
+ batchCreate(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
87
+ batchCreateEpistemicNodes(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
70
88
  listByTopicAndType(input: {
71
89
  topicId?: string;
72
90
  projectId?: string;
@@ -76,7 +94,7 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
76
94
  sourceText?: string;
77
95
  limit?: number;
78
96
  cursor?: string;
79
- }): Promise<any>;
97
+ }): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
80
98
  countByTopicAndType(input: {
81
99
  topicId?: string;
82
100
  projectId?: string;
@@ -84,32 +102,37 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
84
102
  nodeTypes?: string[];
85
103
  query?: string;
86
104
  limit?: number;
87
- }): Promise<any>;
88
- supersede(input: FunctionSurfaceInput, idempotencyKey?: string): any;
89
- verify(input: FunctionSurfaceInput, idempotencyKey?: string): any;
90
- archive(input: FunctionSurfaceInput, idempotencyKey?: string): any;
91
- hardDelete: (...args: any[]) => any;
105
+ }): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
106
+ supersede(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
107
+ verify(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
108
+ archive(input: FunctionSurfaceInput, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<unknown>>;
109
+ hardDelete: (input: import("./graphClient").HardDeleteNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
92
110
  };
93
111
  ontologyLinksNamespace: {
94
- resolveThemeSource(input: JsonObject): Promise<any>;
95
- create: (...args: any[]) => any;
96
- link: (...args: any[]) => any;
112
+ resolveThemeSource(input: JsonObject): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
113
+ createLink(input: import("./ontologyLinksClient").OntologyLinkWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./ontologyLinksClient").OntologyLinkRecord>>;
114
+ upsertLink(input: import("./ontologyLinksClient").OntologyLinkWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./ontologyLinksClient").OntologyLinkRecord>>;
115
+ listLinksForNode(input: import("./ontologyLinksClient").ListOntologyLinksForNodeInput): Promise<PlatformGatewaySuccess<import("./types").ListResult<import("./ontologyLinksClient").OntologyLinkRecord, "links">>>;
116
+ updateLinkStatus(input: import("./ontologyLinksClient").UpdateOntologyLinkStatusInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./ontologyLinksClient").OntologyLinkRecord>>;
97
117
  };
98
118
  publicationNamespace: {
99
- create(input: JsonObject, idempotencyKey?: string): Promise<any>;
100
- update(publicationId: string, input: JsonObject, idempotencyKey?: string): Promise<any>;
101
- list(input?: JsonObject): Promise<any>;
119
+ create(input: JsonObject, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
120
+ update(publicationId: string, input: JsonObject, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
121
+ list(input?: JsonObject): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
102
122
  getByTopic(input: string | {
103
123
  topicId: string;
104
124
  workspaceId?: string;
105
- }): Promise<any>;
106
- publish(publicationId: string, input?: JsonObject, idempotencyKey?: string): Promise<any>;
107
- unpublish(publicationId: string, input?: JsonObject, idempotencyKey?: string): Promise<any>;
108
- remove(publicationId: string, input?: JsonObject): Promise<any>;
125
+ }): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
126
+ publish(publicationId: string, input?: JsonObject, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
127
+ unpublish(publicationId: string, input?: JsonObject, idempotencyKey?: string): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
128
+ remove(publicationId: string, input?: JsonObject): Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
109
129
  };
110
- publishOntologyVersionCompat: (input?: JsonObject) => Promise<any>;
130
+ publishOntologyVersionCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
111
131
  queryLineage: (nodeId: string, depth?: number) => Promise<{
112
- chain: any;
132
+ chain: {
133
+ nodeId: {};
134
+ relation: string;
135
+ }[];
113
136
  forkTree: {
114
137
  nodeId: string;
115
138
  parentCount: number;
@@ -117,10 +140,10 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
117
140
  children: never[];
118
141
  };
119
142
  depth: number;
120
- beliefId: any;
121
- lineage: any;
143
+ beliefId: string | undefined;
144
+ lineage: Record<string, unknown>[];
122
145
  }>;
123
- resolveEffectiveOntologyCompat: (input?: JsonObject) => Promise<any>;
146
+ resolveEffectiveOntologyCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
124
147
  searchBeliefs: (args: {
125
148
  query: string;
126
149
  topicId?: string;
@@ -137,9 +160,15 @@ export declare function createClientLocalHelpers(ctx: ClientNamespaceContext): {
137
160
  minConfidence?: number;
138
161
  limit?: number;
139
162
  cursor?: string;
140
- }) => Promise<any>;
141
- traceEntityImpactCompat: (input?: JsonObject) => Promise<any>;
142
- triggerBeliefReview: (input?: JsonObject) => Promise<any>;
143
- updateOntologyCompat: (input?: JsonObject) => Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
163
+ }) => Promise<import("./client-config").GatewayDataEnvelope<import("./gatewayFacades").SearchResult>>;
164
+ traceEntityImpactCompat: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
165
+ triggerBeliefReview: (input?: JsonObject) => Promise<import("./client-config").GatewayDataEnvelope<Record<string, unknown>>>;
166
+ updateOntologyCompat: (input?: JsonObject) => Promise<{
167
+ correlationId: string;
168
+ data: Record<string, unknown>;
169
+ idempotentReplay: boolean;
170
+ policyTraceId: string | null;
171
+ success: true;
172
+ }>;
144
173
  };
145
174
  //# sourceMappingURL=clientLocalHelpers.d.ts.map
@@ -1,12 +1,159 @@
1
- import { mapOpinionHistoryEntriesFromGatewayData } from "./beliefsClient.js";
2
- import { addEvidenceCompat, createEvidenceCompat, } from "./clientEvidenceCompat.js";
1
+ // biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
2
+ import { mapOpinionHistoryEntriesFromGatewayData, } from "./beliefsClient.js";
3
+ import { addEvidenceCompat, createEvidenceCompat, } from "./client-evidence-compat.js";
3
4
  import { asNodeArray, matchesAuditNodeReference, normalizeCustomNamespace, normalizeCustomToolPayload, requireTopicId, requireTopicOrProjectId, sdkQueryString, } from "./clientHelpers.js";
4
5
  import { randomIdempotencyKey, toQueryString, } from "./coreClient.js";
5
- import { invokeRegisteredCustomTool, } from "./customTools.js";
6
+ import { invokeRegisteredCustomTool } from "./customTools.js";
6
7
  import { asListItems, resolveTopicId } from "./sdkSurface.js";
8
+ function isJsonObject(value) {
9
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10
+ }
11
+ function optionalStringField(input, fieldName) {
12
+ const value = input[fieldName];
13
+ return typeof value === "string" ? value : undefined;
14
+ }
15
+ function requiredStringField(input, fieldName, context) {
16
+ const value = optionalStringField(input, fieldName);
17
+ if (!value) {
18
+ throw new Error(`${context} requires string field ${fieldName}`);
19
+ }
20
+ return value;
21
+ }
22
+ function optionalStringArrayField(input, fieldName, context) {
23
+ const value = input[fieldName];
24
+ if (value === undefined) {
25
+ return;
26
+ }
27
+ if (!Array.isArray(value)) {
28
+ throw new Error(`${context} field ${fieldName} must be a string array`);
29
+ }
30
+ return value.map((item, index) => {
31
+ if (typeof item !== "string") {
32
+ throw new Error(`${context} field ${fieldName}[${index}] must be a string`);
33
+ }
34
+ return item;
35
+ });
36
+ }
37
+ function requiredObjectArrayField(input, fieldName, context) {
38
+ const value = input[fieldName];
39
+ if (!Array.isArray(value)) {
40
+ throw new Error(`${context} requires object array field ${fieldName}`);
41
+ }
42
+ return value.map((item, index) => {
43
+ if (!isJsonObject(item)) {
44
+ throw new Error(`${context} field ${fieldName}[${index}] must be an object`);
45
+ }
46
+ return item;
47
+ });
48
+ }
49
+ function optionalJsonObjectField(input, fieldName, context) {
50
+ const value = input[fieldName];
51
+ if (value === undefined) {
52
+ return;
53
+ }
54
+ if (!isJsonObject(value)) {
55
+ throw new Error(`${context} field ${fieldName} must be an object`);
56
+ }
57
+ return value;
58
+ }
59
+ function readOntologyTier(input) {
60
+ const value = input.tier;
61
+ if (value === "platform" || value === "pack" || value === "tenant") {
62
+ return value;
63
+ }
64
+ if (value === undefined) {
65
+ return;
66
+ }
67
+ throw new Error("Ontology definition field tier must be platform, pack, or tenant");
68
+ }
69
+ function readOntologyStatus(input) {
70
+ const value = input.status;
71
+ if (value === "draft" || value === "active" || value === "deprecated") {
72
+ return value;
73
+ }
74
+ if (value === undefined) {
75
+ return;
76
+ }
77
+ throw new Error("Ontology update field status must be draft, active, or deprecated");
78
+ }
79
+ function readConstraintSeverity(input, context) {
80
+ const value = input.constraintSeverity;
81
+ if (value === "info" || value === "warn" || value === undefined) {
82
+ return value;
83
+ }
84
+ throw new Error(`${context} field constraintSeverity must be info or warn`);
85
+ }
86
+ function readOntologySubtypes(input, context) {
87
+ const value = input.subtypes;
88
+ if (value === undefined) {
89
+ return;
90
+ }
91
+ if (!Array.isArray(value)) {
92
+ throw new Error(`${context} field subtypes must be an object array`);
93
+ }
94
+ return value.map((item, index) => {
95
+ if (!isJsonObject(item)) {
96
+ throw new Error(`${context} field subtypes[${index}] must be an object`);
97
+ }
98
+ const subtypeContext = `${context}.subtypes[${index}]`;
99
+ return {
100
+ value: requiredStringField(item, "value", subtypeContext),
101
+ label: requiredStringField(item, "label", subtypeContext),
102
+ description: optionalStringField(item, "description"),
103
+ };
104
+ });
105
+ }
106
+ function readOntologyDefinitionInput(input) {
107
+ return {
108
+ ontologyKey: requiredStringField(input, "ontologyKey", "Ontology definition"),
109
+ name: requiredStringField(input, "name", "Ontology definition"),
110
+ description: optionalStringField(input, "description"),
111
+ tenantId: optionalStringField(input, "tenantId"),
112
+ tier: readOntologyTier(input),
113
+ workspaceId: optionalStringField(input, "workspaceId"),
114
+ };
115
+ }
116
+ function readOntologyDefinitionUpdateInput(input) {
117
+ return {
118
+ name: optionalStringField(input, "name"),
119
+ description: optionalStringField(input, "description"),
120
+ status: readOntologyStatus(input),
121
+ tenantId: optionalStringField(input, "tenantId"),
122
+ workspaceId: optionalStringField(input, "workspaceId"),
123
+ };
124
+ }
125
+ function readOntologyVersionInput(input) {
126
+ return {
127
+ version: requiredStringField(input, "version", "Ontology version"),
128
+ entityTypes: requiredObjectArrayField(input, "entityTypes", "Ontology version").map((entityType, index) => {
129
+ const context = `Ontology version entityTypes[${index}]`;
130
+ return {
131
+ value: requiredStringField(entityType, "value", context),
132
+ label: requiredStringField(entityType, "label", context),
133
+ description: optionalStringField(entityType, "description"),
134
+ schema: optionalJsonObjectField(entityType, "schema", context),
135
+ subtypes: readOntologySubtypes(entityType, context),
136
+ };
137
+ }),
138
+ edgeTypes: requiredObjectArrayField(input, "edgeTypes", "Ontology version").map((edgeType, index) => {
139
+ const context = `Ontology version edgeTypes[${index}]`;
140
+ return {
141
+ value: requiredStringField(edgeType, "value", context),
142
+ label: requiredStringField(edgeType, "label", context),
143
+ description: optionalStringField(edgeType, "description"),
144
+ sourceTypes: optionalStringArrayField(edgeType, "sourceTypes", context),
145
+ targetTypes: optionalStringArrayField(edgeType, "targetTypes", context),
146
+ constraintSeverity: readConstraintSeverity(edgeType, context),
147
+ };
148
+ }),
149
+ releaseNotes: optionalStringField(input, "releaseNotes"),
150
+ tenantId: optionalStringField(input, "tenantId"),
151
+ workspaceId: optionalStringField(input, "workspaceId"),
152
+ };
153
+ }
7
154
  export function createClientLocalHelpers(ctx) {
8
- const { auditClient, beliefsFacade, customNamespaceCache, evidenceFacade, exposeGatewayData, graphClient, graphFacade, gateway, functionSurfaceClient, ontologyClient, ontologyLinksClient, searchFacade, } = ctx;
9
- const invokeCustomTool = async (fullName, input = {}) => {
155
+ const { auditClient, beliefsFacade, customNamespaceCache, evidenceFacade, exposeGatewayData, graphClient, gateway, functionSurfaceClient, ontologyClient, ontologyLinksClient, searchFacade, } = ctx;
156
+ const invokeCustomTool = (fullName, input = {}) => {
10
157
  const payload = normalizeCustomToolPayload(input);
11
158
  return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
12
159
  };
@@ -73,7 +220,7 @@ export function createClientLocalHelpers(ctx) {
73
220
  : mergedResults.filter((result) => result.type === "belief");
74
221
  return { results };
75
222
  }
76
- async function searchResources(query, options = {}) {
223
+ function searchResources(query, options = {}) {
77
224
  const topicId = resolveTopicId(options);
78
225
  if (!topicId) {
79
226
  throw new Error("topicId is required");
@@ -92,22 +239,29 @@ export function createClientLocalHelpers(ctx) {
92
239
  }
93
240
  async function findContradictions(args) {
94
241
  const topicId = resolveTopicId(args);
95
- const response = topicId
96
- ? await graphClient.listNodes({
242
+ let response;
243
+ if (topicId) {
244
+ response = await graphClient.listNodes({
97
245
  topicId,
98
246
  nodeType: "contradiction",
99
247
  limit: 500,
100
- })
101
- : args.nodeId
102
- ? await graphClient.listNodes({ nodeId: args.nodeId })
103
- : { data: [] };
248
+ });
249
+ }
250
+ else if (args.nodeId) {
251
+ response = await graphClient.listNodes({ nodeId: args.nodeId });
252
+ }
253
+ else {
254
+ response = { data: [] };
255
+ }
104
256
  const contradictions = asNodeArray(response.data)
105
257
  .filter((node) => {
106
- const status = typeof node.metadata?.status === "string"
107
- ? node.metadata.status
108
- : typeof node.status === "string"
109
- ? node.status
110
- : "unresolved";
258
+ let status = "unresolved";
259
+ if (typeof node.metadata?.status === "string") {
260
+ status = node.metadata.status;
261
+ }
262
+ else if (typeof node.status === "string") {
263
+ status = node.status;
264
+ }
111
265
  if (args.status && status !== args.status) {
112
266
  return false;
113
267
  }
@@ -135,13 +289,9 @@ export function createClientLocalHelpers(ctx) {
135
289
  }
136
290
  async function queryLineage(nodeId, depth = 5) {
137
291
  const response = await beliefsFacade.lineage(nodeId);
138
- const lineage = Array.isArray(response.data.lineage)
139
- ? response.data.lineage
140
- : [];
292
+ const lineage = (Array.isArray(response.data.lineage) ? response.data.lineage : []);
141
293
  const chain = lineage.length > 0
142
- ? lineage
143
- .slice(0, depth + 1)
144
- .map((entry, index) => ({
294
+ ? lineage.slice(0, depth + 1).map((entry, index) => ({
145
295
  nodeId: entry.nodeId ?? entry.beliefId ?? "",
146
296
  relation: index === 0 ? "self" : "ancestor",
147
297
  }))
@@ -159,7 +309,7 @@ export function createClientLocalHelpers(ctx) {
159
309
  lineage,
160
310
  };
161
311
  }
162
- async function getConfidenceHistory(nodeId) {
312
+ function getConfidenceHistory(nodeId) {
163
313
  return beliefsFacade.confidenceHistory(nodeId).then(exposeGatewayData);
164
314
  }
165
315
  async function getOpinionHistory(nodeId) {
@@ -186,10 +336,10 @@ export function createClientLocalHelpers(ctx) {
186
336
  });
187
337
  return { entries };
188
338
  }
189
- async function bisectConfidence(nodeId, args) {
339
+ function bisectConfidence(nodeId, args) {
190
340
  return beliefsFacade.bisect(nodeId, args).then(exposeGatewayData);
191
341
  }
192
- async function discoverTopics(input = {}) {
342
+ function discoverTopics(input = {}) {
193
343
  return gateway
194
344
  .request({
195
345
  path: "/api/platform/v1/context/discover",
@@ -198,7 +348,7 @@ export function createClientLocalHelpers(ctx) {
198
348
  })
199
349
  .then(exposeGatewayData);
200
350
  }
201
- async function discoverEntityConnections(input = {}) {
351
+ function discoverEntityConnections(input = {}) {
202
352
  return gateway
203
353
  .request({
204
354
  path: "/api/platform/v1/context/entity-connections",
@@ -207,7 +357,7 @@ export function createClientLocalHelpers(ctx) {
207
357
  })
208
358
  .then(exposeGatewayData);
209
359
  }
210
- async function triggerBeliefReview(input = {}) {
360
+ function triggerBeliefReview(input = {}) {
211
361
  return gateway
212
362
  .request({
213
363
  path: "/api/platform/v1/context/belief-review",
@@ -217,7 +367,7 @@ export function createClientLocalHelpers(ctx) {
217
367
  })
218
368
  .then(exposeGatewayData);
219
369
  }
220
- async function createContractCompat(input = {}) {
370
+ function createContractCompat(input = {}) {
221
371
  return gateway
222
372
  .request({
223
373
  path: "/api/platform/v1/contracts",
@@ -227,7 +377,7 @@ export function createClientLocalHelpers(ctx) {
227
377
  })
228
378
  .then(exposeGatewayData);
229
379
  }
230
- async function evaluateContractCompat(input = {}) {
380
+ function evaluateContractCompat(input = {}) {
231
381
  return gateway
232
382
  .request({
233
383
  path: "/api/platform/v1/contracts/evaluate",
@@ -237,7 +387,7 @@ export function createClientLocalHelpers(ctx) {
237
387
  })
238
388
  .then(exposeGatewayData);
239
389
  }
240
- async function getContractStatusCompat(input = {}) {
390
+ function getContractStatusCompat(input = {}) {
241
391
  return gateway
242
392
  .request({
243
393
  path: "/api/platform/v1/contracts/status",
@@ -246,7 +396,7 @@ export function createClientLocalHelpers(ctx) {
246
396
  })
247
397
  .then(exposeGatewayData);
248
398
  }
249
- async function listContractsCompat(input = {}) {
399
+ function listContractsCompat(input = {}) {
250
400
  return gateway
251
401
  .request({
252
402
  path: `/api/platform/v1/contracts${toQueryString({
@@ -260,31 +410,31 @@ export function createClientLocalHelpers(ctx) {
260
410
  .then(exposeGatewayData);
261
411
  }
262
412
  async function createOntologyCompat(input = {}) {
263
- const response = await ontologyClient.createDefinition(input);
413
+ const response = await ontologyClient.createDefinition(readOntologyDefinitionInput(input));
264
414
  const envelope = response;
265
- return Object.assign({}, envelope, envelope.data);
415
+ return { ...envelope, ...envelope.data };
266
416
  }
267
417
  async function updateOntologyCompat(input = {}) {
268
418
  const id = typeof input.id === "string" ? input.id : "";
269
419
  const { id: _id, ...rest } = input;
270
- const response = await ontologyClient.updateDefinition(id, rest);
420
+ const response = await ontologyClient.updateDefinition(id, readOntologyDefinitionUpdateInput(rest));
271
421
  const envelope = response;
272
- return Object.assign({}, envelope, envelope.data);
422
+ return { ...envelope, ...envelope.data };
273
423
  }
274
424
  async function archiveOntologyCompat(input = {}) {
275
425
  const id = typeof input.id === "string" ? input.id : "";
276
426
  const response = await ontologyClient.archiveDefinition(id);
277
427
  const envelope = response;
278
- return Object.assign({}, envelope, envelope.data);
428
+ return { ...envelope, ...envelope.data };
279
429
  }
280
430
  async function createOntologyVersionCompat(input = {}) {
281
431
  const ontologyId = typeof input.ontologyId === "string" ? input.ontologyId : "";
282
432
  const { ontologyId: _ontologyId, ...rest } = input;
283
- const response = await ontologyClient.createVersion(ontologyId, rest);
433
+ const response = await ontologyClient.createVersion(ontologyId, readOntologyVersionInput(rest));
284
434
  const envelope = response;
285
- return Object.assign({}, envelope, envelope.data);
435
+ return { ...envelope, ...envelope.data };
286
436
  }
287
- async function publishOntologyVersionCompat(input = {}) {
437
+ function publishOntologyVersionCompat(input = {}) {
288
438
  return gateway
289
439
  .request({
290
440
  path: "/api/platform/v1/ontologies/versions/publish",
@@ -294,7 +444,7 @@ export function createClientLocalHelpers(ctx) {
294
444
  })
295
445
  .then(exposeGatewayData);
296
446
  }
297
- async function deprecateOntologyVersionCompat(input = {}) {
447
+ function deprecateOntologyVersionCompat(input = {}) {
298
448
  return gateway
299
449
  .request({
300
450
  path: "/api/platform/v1/ontologies/versions/deprecate",
@@ -304,7 +454,7 @@ export function createClientLocalHelpers(ctx) {
304
454
  })
305
455
  .then(exposeGatewayData);
306
456
  }
307
- async function resolveEffectiveOntologyCompat(input = {}) {
457
+ function resolveEffectiveOntologyCompat(input = {}) {
308
458
  return gateway
309
459
  .request({
310
460
  path: "/api/platform/v1/ontologies/effective",
@@ -313,7 +463,7 @@ export function createClientLocalHelpers(ctx) {
313
463
  })
314
464
  .then(exposeGatewayData);
315
465
  }
316
- async function traceEntityImpactCompat(input = {}) {
466
+ function traceEntityImpactCompat(input = {}) {
317
467
  return gateway
318
468
  .request({
319
469
  path: "/api/platform/v1/graph/trace-entity-impact",