@lucern/sdk 0.2.0-alpha.6 → 0.2.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 (274) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{lib/platform/sdk/adminClient.d.ts → adminClient.d.ts} +56 -51
  3. package/dist/adminClient.js +755 -0
  4. package/dist/adminClient.js.map +1 -0
  5. package/dist/answersClient.d.ts +23 -0
  6. package/dist/answersClient.js +333 -0
  7. package/dist/answersClient.js.map +1 -0
  8. package/dist/{lib/platform/sdk/audiencesClient.d.ts → audiencesClient.d.ts} +24 -18
  9. package/dist/audiencesClient.js +472 -0
  10. package/dist/audiencesClient.js.map +1 -0
  11. package/dist/auditClient.d.ts +29 -0
  12. package/dist/auditClient.js +386 -0
  13. package/dist/auditClient.js.map +1 -0
  14. package/dist/{lib/platform/sdk/beliefsClient.d.ts → beliefsClient.d.ts} +32 -27
  15. package/dist/beliefsClient.js +477 -0
  16. package/dist/beliefsClient.js.map +1 -0
  17. package/dist/{lib/platform/sdk/client.d.ts → client.d.ts} +404 -395
  18. package/dist/client.js +6134 -0
  19. package/dist/client.js.map +1 -0
  20. package/dist/{lib/platform/sdk/contextClient.d.ts → contextClient.d.ts} +13 -7
  21. package/dist/contextClient.js +396 -0
  22. package/dist/contextClient.js.map +1 -0
  23. package/dist/contextFacade.d.ts +2 -0
  24. package/dist/contextFacade.js +73 -0
  25. package/dist/contextFacade.js.map +1 -0
  26. package/dist/{lib/platform/sdk/contextPackCompiler.d.ts → contextPackCompiler.d.ts} +11 -9
  27. package/dist/contextPackCompiler.js +1091 -0
  28. package/dist/contextPackCompiler.js.map +1 -0
  29. package/dist/contextPackPolicy.d.ts +84 -0
  30. package/dist/contextPackPolicy.js +347 -0
  31. package/dist/contextPackPolicy.js.map +1 -0
  32. package/dist/contextPackSchema.d.ts +7 -0
  33. package/dist/contextPackSchema.js +203 -0
  34. package/dist/contextPackSchema.js.map +1 -0
  35. package/dist/{lib/platform/sdk/contextTypes.d.ts → contextTypes.d.ts} +15 -13
  36. package/dist/contextTypes.js +3 -0
  37. package/dist/contextTypes.js.map +1 -0
  38. package/dist/contracts/api-enums.contract.d.ts +81 -0
  39. package/dist/contracts/api-enums.contract.js +92 -0
  40. package/dist/contracts/api-enums.contract.js.map +1 -0
  41. package/dist/contracts/auth-session.contract.d.ts +55 -0
  42. package/dist/contracts/auth-session.contract.js +48 -0
  43. package/dist/contracts/auth-session.contract.js.map +1 -0
  44. package/dist/{lucern/contracts/src → contracts}/context-pack.contract.d.ts +56 -58
  45. package/dist/contracts/context-pack.contract.js +98 -0
  46. package/dist/contracts/context-pack.contract.js.map +1 -0
  47. package/dist/contracts/contextPack.d.ts +1 -0
  48. package/dist/contracts/contextPack.js +98 -0
  49. package/dist/contracts/contextPack.js.map +1 -0
  50. package/dist/contracts/index.d.ts +9 -0
  51. package/dist/contracts/index.js +4892 -0
  52. package/dist/contracts/index.js.map +1 -0
  53. package/dist/{lucern/contracts/src → contracts}/lens-filter.contract.d.ts +10 -8
  54. package/dist/contracts/lens-filter.contract.js +71 -0
  55. package/dist/contracts/lens-filter.contract.js.map +1 -0
  56. package/dist/contracts/lens-workflow.contract.d.ts +87 -0
  57. package/dist/contracts/lens-workflow.contract.js +123 -0
  58. package/dist/contracts/lens-workflow.contract.js.map +1 -0
  59. package/dist/contracts/lensFilter.d.ts +1 -0
  60. package/dist/contracts/lensFilter.js +71 -0
  61. package/dist/contracts/lensFilter.js.map +1 -0
  62. package/dist/contracts/lensWorkflow.d.ts +2 -0
  63. package/dist/contracts/lensWorkflow.js +123 -0
  64. package/dist/contracts/lensWorkflow.js.map +1 -0
  65. package/dist/contracts/mcp-tools.contract.d.ts +1 -0
  66. package/dist/contracts/mcp-tools.contract.js +2986 -0
  67. package/dist/contracts/mcp-tools.contract.js.map +1 -0
  68. package/dist/contracts/mcpTools.d.ts +1 -0
  69. package/dist/contracts/mcpTools.js +2986 -0
  70. package/dist/contracts/mcpTools.js.map +1 -0
  71. package/dist/{lucern/contracts/src → contracts}/prompt.contract.d.ts +5 -3
  72. package/dist/contracts/prompt.contract.js +12 -0
  73. package/dist/contracts/prompt.contract.js.map +1 -0
  74. package/dist/contracts/prompt.d.ts +1 -0
  75. package/dist/contracts/prompt.js +12 -0
  76. package/dist/contracts/prompt.js.map +1 -0
  77. package/dist/contracts/sdk-tools.contract.d.ts +2 -0
  78. package/dist/contracts/sdk-tools.contract.js +4134 -0
  79. package/dist/contracts/sdk-tools.contract.js.map +1 -0
  80. package/dist/contracts/sdkTools.d.ts +2 -0
  81. package/dist/contracts/sdkTools.js +4134 -0
  82. package/dist/contracts/sdkTools.js.map +1 -0
  83. package/dist/contracts/workflow-runtime.contract.d.ts +163 -0
  84. package/dist/contracts/workflow-runtime.contract.js +245 -0
  85. package/dist/contracts/workflow-runtime.contract.js.map +1 -0
  86. package/dist/contracts/workflowRuntime.d.ts +1 -0
  87. package/dist/contracts/workflowRuntime.js +245 -0
  88. package/dist/contracts/workflowRuntime.js.map +1 -0
  89. package/dist/{lib/platform/sdk/controlObjectOwnership.d.ts → controlObjectOwnership.d.ts} +20 -18
  90. package/dist/controlObjectOwnership.js +215 -0
  91. package/dist/controlObjectOwnership.js.map +1 -0
  92. package/dist/{lib/platform/sdk/coreClient.d.ts → coreClient.d.ts} +19 -14
  93. package/dist/coreClient.js +339 -0
  94. package/dist/coreClient.js.map +1 -0
  95. package/dist/{lib/platform/sdk/customTools.d.ts → customTools.d.ts} +21 -16
  96. package/dist/customTools.js +248 -0
  97. package/dist/customTools.js.map +1 -0
  98. package/dist/{lib/platform/sdk/decisionsClient.d.ts → decisionsClient.d.ts} +29 -24
  99. package/dist/decisionsClient.js +522 -0
  100. package/dist/decisionsClient.js.map +1 -0
  101. package/dist/domainContext.d.ts +1 -0
  102. package/dist/domainContext.js +3 -0
  103. package/dist/domainContext.js.map +1 -0
  104. package/dist/events.d.ts +178 -0
  105. package/dist/events.js +249 -0
  106. package/dist/events.js.map +1 -0
  107. package/dist/eventsCore.d.ts +49 -0
  108. package/dist/eventsCore.js +429 -0
  109. package/dist/eventsCore.js.map +1 -0
  110. package/dist/facade/context.d.ts +18 -0
  111. package/dist/facade/context.js +73 -0
  112. package/dist/facade/context.js.map +1 -0
  113. package/dist/{lib/platform/sdk/gatewayFacades.d.ts → gatewayFacades.d.ts} +31 -26
  114. package/dist/gatewayFacades.js +1953 -0
  115. package/dist/gatewayFacades.js.map +1 -0
  116. package/dist/{lib/platform/sdk/graphClient.d.ts → graphClient.d.ts} +57 -52
  117. package/dist/graphClient.js +698 -0
  118. package/dist/graphClient.js.map +1 -0
  119. package/dist/{lib/platform/sdk/harnessClient.d.ts → harnessClient.d.ts} +44 -39
  120. package/dist/harnessClient.js +607 -0
  121. package/dist/harnessClient.js.map +1 -0
  122. package/dist/{lib/platform/sdk/identityClient.d.ts → identityClient.d.ts} +17 -11
  123. package/dist/identityClient.js +497 -0
  124. package/dist/identityClient.js.map +1 -0
  125. package/dist/index.d.ts +42 -3
  126. package/dist/index.js +11381 -3
  127. package/dist/index.js.map +1 -0
  128. package/dist/{lib/platform/sdk/learningClient.d.ts → learningClient.d.ts} +13 -7
  129. package/dist/learningClient.js +409 -0
  130. package/dist/learningClient.js.map +1 -0
  131. package/dist/{lib/platform/sdk/mcpParityClient.d.ts → mcpParityClient.d.ts} +10 -5
  132. package/dist/mcpParityClient.js +516 -0
  133. package/dist/mcpParityClient.js.map +1 -0
  134. package/dist/mcpParitySurface.d.ts +12 -0
  135. package/dist/mcpParitySurface.js +65 -0
  136. package/dist/mcpParitySurface.js.map +1 -0
  137. package/dist/mcpTools-DPZxowDX.d.ts +254 -0
  138. package/dist/{lib/platform/sdk/ontologyClient.d.ts → ontologyClient.d.ts} +28 -22
  139. package/dist/ontologyClient.js +513 -0
  140. package/dist/ontologyClient.js.map +1 -0
  141. package/dist/packRuntime.d.ts +2 -0
  142. package/dist/packRuntime.js +3 -0
  143. package/dist/packRuntime.js.map +1 -0
  144. package/dist/{lib/platform/sdk/packsClient.d.ts → packsClient.d.ts} +34 -29
  145. package/dist/packsClient.js +525 -0
  146. package/dist/packsClient.js.map +1 -0
  147. package/dist/{lib/platform/sdk/policyClient.d.ts → policyClient.d.ts} +26 -20
  148. package/dist/policyClient.js +625 -0
  149. package/dist/policyClient.js.map +1 -0
  150. package/dist/realtime/index.d.ts +29 -0
  151. package/dist/realtime/index.js +23 -0
  152. package/dist/realtime/index.js.map +1 -0
  153. package/dist/realtime/refs.d.ts +17 -0
  154. package/dist/realtime/refs.js +9 -0
  155. package/dist/realtime/refs.js.map +1 -0
  156. package/dist/reportsClient.d.ts +41 -0
  157. package/dist/reportsClient.js +418 -0
  158. package/dist/reportsClient.js.map +1 -0
  159. package/dist/{lib/platform/sdk/schemaClient.d.ts → schemaClient.d.ts} +20 -15
  160. package/dist/schemaClient.js +434 -0
  161. package/dist/schemaClient.js.map +1 -0
  162. package/dist/sdkSurface.d.ts +61 -0
  163. package/dist/sdkSurface.js +112 -0
  164. package/dist/sdkSurface.js.map +1 -0
  165. package/dist/sdkTools-CwXJDACb.d.ts +150 -0
  166. package/dist/{lib/platform/sdk/topicsClient.d.ts → topicsClient.d.ts} +24 -18
  167. package/dist/topicsClient.js +492 -0
  168. package/dist/topicsClient.js.map +1 -0
  169. package/dist/{lib/platform/sdk/types.d.ts → types.d.ts} +84 -80
  170. package/dist/types.js +3 -0
  171. package/dist/types.js.map +1 -0
  172. package/dist/version.d.ts +4 -0
  173. package/dist/version.js +6 -0
  174. package/dist/version.js.map +1 -0
  175. package/dist/{lib/platform/sdk/workflowClient.d.ts → workflowClient.d.ts} +60 -57
  176. package/dist/workflowClient.js +830 -0
  177. package/dist/workflowClient.js.map +1 -0
  178. package/package.json +25 -43
  179. package/dist/.generated +0 -2
  180. package/dist/lib/platform/auth/credentials.d.ts +0 -5
  181. package/dist/lib/platform/auth/credentials.js +0 -40
  182. package/dist/lib/platform/sdk/adminClient.js +0 -384
  183. package/dist/lib/platform/sdk/answersClient.d.ts +0 -16
  184. package/dist/lib/platform/sdk/answersClient.js +0 -21
  185. package/dist/lib/platform/sdk/audiencesClient.js +0 -111
  186. package/dist/lib/platform/sdk/auditClient.d.ts +0 -24
  187. package/dist/lib/platform/sdk/auditClient.js +0 -21
  188. package/dist/lib/platform/sdk/beliefsClient.js +0 -124
  189. package/dist/lib/platform/sdk/client.js +0 -1831
  190. package/dist/lib/platform/sdk/contextClient.js +0 -86
  191. package/dist/lib/platform/sdk/contextFacade.d.ts +0 -10
  192. package/dist/lib/platform/sdk/contextFacade.js +0 -10
  193. package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
  194. package/dist/lib/platform/sdk/contextTypes.js +0 -1
  195. package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
  196. package/dist/lib/platform/sdk/coreClient.js +0 -366
  197. package/dist/lib/platform/sdk/customTools.js +0 -247
  198. package/dist/lib/platform/sdk/decisionsClient.js +0 -129
  199. package/dist/lib/platform/sdk/domainContext.d.ts +0 -1
  200. package/dist/lib/platform/sdk/domainContext.js +0 -1
  201. package/dist/lib/platform/sdk/events.d.ts +0 -176
  202. package/dist/lib/platform/sdk/events.js +0 -261
  203. package/dist/lib/platform/sdk/eventsCore.d.ts +0 -13
  204. package/dist/lib/platform/sdk/eventsCore.js +0 -13
  205. package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
  206. package/dist/lib/platform/sdk/graphClient.js +0 -235
  207. package/dist/lib/platform/sdk/harnessClient.js +0 -219
  208. package/dist/lib/platform/sdk/identityClient.js +0 -131
  209. package/dist/lib/platform/sdk/index.d.ts +0 -49
  210. package/dist/lib/platform/sdk/index.js +0 -49
  211. package/dist/lib/platform/sdk/learningClient.js +0 -53
  212. package/dist/lib/platform/sdk/mcpParityClient.js +0 -196
  213. package/dist/lib/platform/sdk/mcpParitySurface.d.ts +0 -10
  214. package/dist/lib/platform/sdk/mcpParitySurface.js +0 -57
  215. package/dist/lib/platform/sdk/ontologyClient.js +0 -161
  216. package/dist/lib/platform/sdk/packRuntime.d.ts +0 -1
  217. package/dist/lib/platform/sdk/packRuntime.js +0 -1
  218. package/dist/lib/platform/sdk/packsClient.js +0 -157
  219. package/dist/lib/platform/sdk/policyClient.js +0 -277
  220. package/dist/lib/platform/sdk/promptCatalog.d.ts +0 -1
  221. package/dist/lib/platform/sdk/promptCatalog.js +0 -1
  222. package/dist/lib/platform/sdk/reportsClient.d.ts +0 -34
  223. package/dist/lib/platform/sdk/reportsClient.js +0 -64
  224. package/dist/lib/platform/sdk/schemaClient.js +0 -71
  225. package/dist/lib/platform/sdk/sdkSurface.d.ts +0 -56
  226. package/dist/lib/platform/sdk/sdkSurface.js +0 -140
  227. package/dist/lib/platform/sdk/topicsClient.js +0 -118
  228. package/dist/lib/platform/sdk/types.js +0 -1
  229. package/dist/lib/platform/sdk/version.d.ts +0 -2
  230. package/dist/lib/platform/sdk/version.js +0 -2
  231. package/dist/lib/platform/sdk/workflowClient.js +0 -366
  232. package/dist/lucern/contracts/src/api-enums.contract.d.ts +0 -58
  233. package/dist/lucern/contracts/src/api-enums.contract.js +0 -147
  234. package/dist/lucern/contracts/src/auth-context.contract.d.ts +0 -8
  235. package/dist/lucern/contracts/src/auth-context.contract.js +0 -8
  236. package/dist/lucern/contracts/src/auth-session.contract.d.ts +0 -8
  237. package/dist/lucern/contracts/src/auth-session.contract.js +0 -8
  238. package/dist/lucern/contracts/src/auth.contract.d.ts +0 -88
  239. package/dist/lucern/contracts/src/auth.contract.js +0 -57
  240. package/dist/lucern/contracts/src/context-pack.contract.js +0 -169
  241. package/dist/lucern/contracts/src/convex-admin.contract.d.ts +0 -5
  242. package/dist/lucern/contracts/src/convex-admin.contract.js +0 -1
  243. package/dist/lucern/contracts/src/events-types.contract.d.ts +0 -8
  244. package/dist/lucern/contracts/src/events-types.contract.js +0 -8
  245. package/dist/lucern/contracts/src/events.contract.d.ts +0 -176
  246. package/dist/lucern/contracts/src/events.contract.js +0 -159
  247. package/dist/lucern/contracts/src/gateway.contract.d.ts +0 -74
  248. package/dist/lucern/contracts/src/gateway.contract.js +0 -19
  249. package/dist/lucern/contracts/src/ids.contract.d.ts +0 -7
  250. package/dist/lucern/contracts/src/ids.contract.js +0 -24
  251. package/dist/lucern/contracts/src/index.d.ts +0 -29
  252. package/dist/lucern/contracts/src/index.js +0 -29
  253. package/dist/lucern/contracts/src/lens-filter.contract.js +0 -95
  254. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
  255. package/dist/lucern/contracts/src/lens-workflow.contract.js +0 -54
  256. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
  257. package/dist/lucern/contracts/src/mcp-tools.contract.js +0 -3281
  258. package/dist/lucern/contracts/src/ontology-matching.contract.d.ts +0 -8
  259. package/dist/lucern/contracts/src/ontology-matching.contract.js +0 -8
  260. package/dist/lucern/contracts/src/prompt.contract.js +0 -24
  261. package/dist/lucern/contracts/src/sdk-methods.contract.d.ts +0 -358
  262. package/dist/lucern/contracts/src/sdk-methods.contract.js +0 -19
  263. package/dist/lucern/contracts/src/sdk-tools.contract.d.ts +0 -92
  264. package/dist/lucern/contracts/src/sdk-tools.contract.js +0 -1398
  265. package/dist/lucern/contracts/src/text-matching.contract.d.ts +0 -53
  266. package/dist/lucern/contracts/src/text-matching.contract.js +0 -277
  267. package/dist/lucern/contracts/src/topic-scope.contract.d.ts +0 -8
  268. package/dist/lucern/contracts/src/topic-scope.contract.js +0 -8
  269. package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +0 -161
  270. package/dist/lucern/contracts/src/workflow-runtime.contract.js +0 -257
  271. package/dist/realtime-refs.d.ts +0 -1
  272. package/dist/realtime-refs.js +0 -1
  273. package/dist/realtime.d.ts +0 -1
  274. package/dist/realtime.js +0 -1
@@ -1,235 +0,0 @@
1
- import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { mapAliasedList, mapGatewayData, normalizeNodeWriteInput, normalizeNodeVerificationStatus, normalizeTopicQuery, withSdkAliases, } from "./sdkSurface.js";
3
- export { LucernApiError };
4
- /**
5
- * Create the low-level graph client for nodes, edges, and graph analytics.
6
- * @param config - Gateway transport configuration.
7
- * @returns An object with methods for CRUD on nodes/edges plus analytics, traversal, and search.
8
- */
9
- export function createGraphClient(config = {}) {
10
- const gateway = createGatewayRequestClient(config);
11
- return {
12
- /**
13
- * List graph nodes matching the provided filters.
14
- */
15
- async listNodes(query) {
16
- return gateway.request({
17
- path: `/api/platform/v1/graph/nodes${toQueryString(normalizeTopicQuery(query))}`,
18
- }).then((response) => mapGatewayData(response, (data) => mapAliasedList(data, "nodes")));
19
- },
20
- /**
21
- * @deprecated Use listNodes.
22
- */
23
- async queryNodes(query) {
24
- return this.listNodes(query);
25
- },
26
- /**
27
- * Retrieve a single graph node by nodeId or globalId.
28
- */
29
- async getNode(query) {
30
- return gateway.request({
31
- path: `/api/platform/v1/graph/nodes${toQueryString(query)}`,
32
- }).then((response) => mapGatewayData(response, (data) => withSdkAliases(data)));
33
- },
34
- /**
35
- * Create a graph node.
36
- */
37
- async createNode(input, idempotencyKey) {
38
- return gateway.request({
39
- path: "/api/platform/v1/graph/nodes",
40
- method: "POST",
41
- body: normalizeNodeWriteInput(input),
42
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
43
- }).then((response) => mapGatewayData(response, (data) => withSdkAliases(data)));
44
- },
45
- /**
46
- * Update a graph node.
47
- */
48
- async updateNode(input, idempotencyKey) {
49
- return gateway.request({
50
- path: "/api/platform/v1/graph/nodes",
51
- method: "PUT",
52
- body: normalizeNodeWriteInput(input),
53
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
54
- }).then((response) => mapGatewayData(response, (data) => withSdkAliases(data)));
55
- },
56
- /**
57
- * Batch create graph nodes through the admin route surface.
58
- */
59
- async batchCreateNodes(input, idempotencyKey) {
60
- return gateway.request({
61
- path: "/api/platform/v1/graph/nodes/batch",
62
- method: "POST",
63
- body: {
64
- nodes: input.nodes.map((node) => normalizeNodeWriteInput(node)),
65
- },
66
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
67
- });
68
- },
69
- /**
70
- * Supersede an existing graph node with a new canonical version.
71
- */
72
- async supersedeNode(input, idempotencyKey) {
73
- return gateway.request({
74
- path: "/api/platform/v1/graph/nodes/supersede",
75
- method: "POST",
76
- body: input,
77
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
78
- });
79
- },
80
- /**
81
- * Update a node's verification status.
82
- */
83
- async verifyNode(input, idempotencyKey) {
84
- const verificationStatus = normalizeNodeVerificationStatus(input.verificationStatus) ??
85
- input.verificationStatus;
86
- return gateway.request({
87
- path: "/api/platform/v1/graph/nodes/verify",
88
- method: "POST",
89
- body: {
90
- ...input,
91
- verificationStatus,
92
- },
93
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
94
- });
95
- },
96
- /**
97
- * Permanently delete a node via the admin-only hard-delete route.
98
- */
99
- async hardDeleteNode(input, idempotencyKey) {
100
- return gateway.request({
101
- path: "/api/platform/v1/graph/nodes/hard-delete",
102
- method: "POST",
103
- body: input,
104
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
105
- });
106
- },
107
- /**
108
- * List graph edges matching the provided filters.
109
- */
110
- async listEdges(query) {
111
- return gateway.request({
112
- path: `/api/platform/v1/graph/edges${toQueryString(normalizeTopicQuery(query))}`,
113
- }).then((response) => mapGatewayData(response, (data) => mapAliasedList(data, "edges")));
114
- },
115
- /**
116
- * @deprecated Use listEdges.
117
- */
118
- async queryEdges(query) {
119
- return this.listEdges(query);
120
- },
121
- /**
122
- * Create a graph edge.
123
- */
124
- async createEdge(input, idempotencyKey) {
125
- return gateway.request({
126
- path: "/api/platform/v1/graph/edges",
127
- method: "POST",
128
- body: normalizeTopicQuery(input),
129
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
130
- });
131
- },
132
- /**
133
- * Delete one or more edges matching the provided filter.
134
- */
135
- async deleteEdge(query, idempotencyKey) {
136
- return gateway.request({
137
- path: `/api/platform/v1/graph/edges${toQueryString(query)}`,
138
- method: "DELETE",
139
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
140
- });
141
- },
142
- /**
143
- * Retrieve a graph neighborhood around a root node.
144
- */
145
- async neighborhood(query) {
146
- return gateway.request({
147
- path: `/api/platform/v1/graph/neighborhood${toQueryString(query)}`,
148
- });
149
- },
150
- /**
151
- * Traverse the graph from a starting node.
152
- */
153
- async traverse(query) {
154
- return gateway.request({
155
- path: "/api/platform/v1/graph/traverse",
156
- method: "POST",
157
- body: normalizeTopicQuery(query),
158
- });
159
- },
160
- /**
161
- * Analyze graph structure for a topic.
162
- */
163
- async analyze(query = {}) {
164
- const normalized = normalizeTopicQuery(query);
165
- return gateway.request({
166
- path: `/api/platform/v1/graph/analyze${toQueryString({
167
- topicId: typeof normalized.topicId === "string" ? normalized.topicId : undefined,
168
- metric: typeof normalized.metric === "string" ? normalized.metric : undefined,
169
- limit: typeof normalized.limit === "number" ? normalized.limit : undefined,
170
- })}`,
171
- });
172
- },
173
- /**
174
- * Detect confirmation-bias patterns for a topic graph.
175
- */
176
- async bias(query = {}) {
177
- const normalized = normalizeTopicQuery(query);
178
- return gateway.request({
179
- path: `/api/platform/v1/graph/bias${toQueryString({
180
- topicId: typeof normalized.topicId === "string" ? normalized.topicId : undefined,
181
- threshold: typeof normalized.threshold === "number"
182
- ? normalized.threshold
183
- : undefined,
184
- limit: typeof normalized.limit === "number" ? normalized.limit : undefined,
185
- })}`,
186
- });
187
- },
188
- /**
189
- * Find graph gaps for beliefs that still need testing.
190
- */
191
- async gaps(query) {
192
- const normalized = normalizeTopicQuery(query);
193
- return gateway.request({
194
- path: `/api/platform/v1/graph/gaps${toQueryString({
195
- topicId: typeof normalized.topicId === "string" ? normalized.topicId : undefined,
196
- minConfidence: typeof normalized.minConfidence === "number"
197
- ? normalized.minConfidence
198
- : undefined,
199
- })}`,
200
- });
201
- },
202
- /**
203
- * Search across graph resources within a topic.
204
- */
205
- async search(query) {
206
- return gateway.request({
207
- path: "/api/platform/v1/search",
208
- method: "POST",
209
- body: normalizeTopicQuery(query),
210
- });
211
- },
212
- /**
213
- * Retrieve a graph neighborhood around a root node.
214
- */
215
- async getNeighborhood(query) {
216
- return this.neighborhood(query);
217
- },
218
- /**
219
- * Retrieve the shortest known path between two graph nodes.
220
- */
221
- async getPath(query) {
222
- return gateway.request({
223
- path: `/api/platform/v1/graph/path${toQueryString(query)}`,
224
- });
225
- },
226
- /**
227
- * Retrieve graph analytics for the requested metric.
228
- */
229
- async getAnalytics(query = {}) {
230
- return gateway.request({
231
- path: `/api/platform/v1/graph/analytics${toQueryString(query)}`,
232
- });
233
- },
234
- };
235
- }
@@ -1,219 +0,0 @@
1
- import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { createListResult, mapGatewayData, normalizeTopicQuery } from "./sdkSurface.js";
3
- export { LucernApiError };
4
- /**
5
- * Create the harness client for agent and tool registry operations.
6
- */
7
- export function createHarnessClient(config = {}) {
8
- const gateway = createGatewayRequestClient(config);
9
- return {
10
- /**
11
- * List agent definitions.
12
- */
13
- async listAgentDefinitions(scope = {}) {
14
- return gateway.request({
15
- path: `/api/platform/v1/harness/agents${toQueryString(scope)}`,
16
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "agents")));
17
- },
18
- /**
19
- * Get an agent definition.
20
- */
21
- async getAgentDefinition(agentId, scope = {}) {
22
- return gateway.request({
23
- path: `/api/platform/v1/harness/agents/${encodeURIComponent(agentId)}${toQueryString(scope)}`,
24
- });
25
- },
26
- /**
27
- * Create an agent definition.
28
- */
29
- async createAgentDefinition(input, idempotencyKey) {
30
- return gateway.request({
31
- path: "/api/platform/v1/harness/agents",
32
- method: "POST",
33
- body: input,
34
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
35
- });
36
- },
37
- /**
38
- * @deprecated Use createAgentDefinition.
39
- */
40
- async registerAgentDefinition(input, idempotencyKey) {
41
- return this.createAgentDefinition(input, idempotencyKey);
42
- },
43
- /**
44
- * Update an agent definition.
45
- */
46
- async updateAgentDefinition(agentId, input, idempotencyKey) {
47
- return gateway.request({
48
- path: `/api/platform/v1/harness/agents/${encodeURIComponent(agentId)}`,
49
- method: "PUT",
50
- body: input,
51
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
52
- });
53
- },
54
- /**
55
- * Invoke a managed agent definition.
56
- */
57
- async invokeManagedAgentDefinition(agentId, input, idempotencyKey) {
58
- return gateway.request({
59
- path: `/api/platform/v1/harness/agents/${encodeURIComponent(agentId)}/runs`,
60
- method: "POST",
61
- body: {
62
- agentDefinitionId: agentId,
63
- ...input,
64
- },
65
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
66
- });
67
- },
68
- /**
69
- * List runs for an agent definition.
70
- */
71
- async listAgentRuns(agentId, scope = {}) {
72
- return gateway.request({
73
- path: `/api/platform/v1/harness/agents/${encodeURIComponent(agentId)}/runs${toQueryString(scope)}`,
74
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "runs")));
75
- },
76
- /**
77
- * @deprecated Use listAgentRuns.
78
- */
79
- async listRunsForAgent(agentId, scope = {}) {
80
- return this.listAgentRuns(agentId, scope);
81
- },
82
- /**
83
- * List tool definitions.
84
- */
85
- async listToolDefinitions(scope = {}) {
86
- return gateway.request({
87
- path: `/api/platform/v1/harness/tools${toQueryString(scope)}`,
88
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "tools")));
89
- },
90
- /**
91
- * Get a tool definition.
92
- */
93
- async getToolDefinition(toolId, scope = {}) {
94
- return gateway.request({
95
- path: `/api/platform/v1/harness/tools/${encodeURIComponent(toolId)}${toQueryString(scope)}`,
96
- });
97
- },
98
- /**
99
- * Create a tool definition.
100
- */
101
- async createToolDefinition(input, idempotencyKey) {
102
- return gateway.request({
103
- path: "/api/platform/v1/harness/tools",
104
- method: "POST",
105
- body: input,
106
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
107
- });
108
- },
109
- /**
110
- * @deprecated Use createToolDefinition.
111
- */
112
- async registerToolDefinition(input, idempotencyKey) {
113
- return this.createToolDefinition(input, idempotencyKey);
114
- },
115
- /**
116
- * Update a tool definition.
117
- */
118
- async updateToolDefinition(toolId, input, idempotencyKey) {
119
- return gateway.request({
120
- path: `/api/platform/v1/harness/tools/${encodeURIComponent(toolId)}`,
121
- method: "PUT",
122
- body: input,
123
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
124
- });
125
- },
126
- /**
127
- * Execute a tool definition.
128
- */
129
- async executeToolDefinition(toolId, input = {}) {
130
- return gateway.request({
131
- path: `/api/platform/v1/harness/tools/${encodeURIComponent(toolId)}/execute`,
132
- method: "POST",
133
- body: input,
134
- });
135
- },
136
- /**
137
- * List run ledger entries.
138
- */
139
- async listRunEntries(scope = {}) {
140
- return gateway.request({
141
- path: `/api/platform/v1/harness/runs${toQueryString(scope)}`,
142
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "runs")));
143
- },
144
- /**
145
- * @deprecated Use listRunEntries.
146
- */
147
- async listRunLedgerEntries(scope = {}) {
148
- return this.listRunEntries(scope);
149
- },
150
- /**
151
- * Create a harness run.
152
- */
153
- async startHarnessRun(input, idempotencyKey) {
154
- return gateway.request({
155
- path: "/api/platform/v1/harness/runs",
156
- method: "POST",
157
- body: normalizeTopicQuery(input),
158
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
159
- });
160
- },
161
- /**
162
- * Get a run ledger entry.
163
- */
164
- async getRunLedgerEntry(runId) {
165
- return gateway.request({
166
- path: `/api/platform/v1/harness/runs/${encodeURIComponent(runId)}`,
167
- });
168
- },
169
- /**
170
- * Update a harness run with a ledger event.
171
- */
172
- async reportHarnessRunEvent(runId, input, idempotencyKey) {
173
- return gateway.request({
174
- path: `/api/platform/v1/harness/runs/${encodeURIComponent(runId)}/report`,
175
- method: "POST",
176
- body: input,
177
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
178
- });
179
- },
180
- /**
181
- * Update a harness run heartbeat.
182
- */
183
- async heartbeatHarnessRun(runId, input, idempotencyKey) {
184
- return gateway.request({
185
- path: `/api/platform/v1/harness/runs/${encodeURIComponent(runId)}/heartbeat`,
186
- method: "POST",
187
- body: input,
188
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
189
- });
190
- },
191
- /**
192
- * Complete a harness run.
193
- */
194
- async completeHarnessRun(runId, input, idempotencyKey) {
195
- return gateway.request({
196
- path: `/api/platform/v1/harness/runs/${encodeURIComponent(runId)}/complete`,
197
- method: "POST",
198
- body: input,
199
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
200
- });
201
- },
202
- /**
203
- * List prompt resolutions.
204
- */
205
- async listPromptResolutions(query = {}) {
206
- return gateway.request({
207
- path: `/api/platform/v1/harness/prompts${toQueryString(query)}`,
208
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "prompts")));
209
- },
210
- /**
211
- * Get the harness scope taxonomy.
212
- */
213
- async getScopeTaxonomy() {
214
- return gateway.request({
215
- path: "/api/platform/v1/harness/scopes",
216
- });
217
- },
218
- };
219
- }
@@ -1,131 +0,0 @@
1
- import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { createListResult, mapGatewayData } from "./sdkSurface.js";
3
- function createIdentityWhoamiClient(config = {}) {
4
- const gateway = createGatewayRequestClient(config);
5
- return {
6
- async whoami() {
7
- return gateway.request({
8
- path: "/api/platform/v1/identity/whoami",
9
- });
10
- },
11
- };
12
- }
13
- export { LucernApiError };
14
- /**
15
- * Create the identity client for principals and API keys.
16
- * @param config - Gateway transport configuration.
17
- * @returns An object with methods for whoami, principal management, and key management.
18
- */
19
- export function createIdentityClient(config = {}) {
20
- const gateway = createGatewayRequestClient(config);
21
- const whoamiClient = createIdentityWhoamiClient(config);
22
- const requestPrincipalWrite = (method, input, idempotencyKey) => gateway.request({
23
- path: "/api/platform/v1/identity/principals",
24
- method,
25
- body: input,
26
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
27
- });
28
- return {
29
- /**
30
- * Resolve the current authenticated identity summary.
31
- */
32
- async whoami() {
33
- return whoamiClient.whoami().then((response) => mapGatewayData(response, (data) => ({
34
- principalId: data.principalId,
35
- principalType: data.principalType,
36
- tenantId: data.tenantId ?? null,
37
- workspaceId: data.workspaceId ?? null,
38
- scopes: Array.isArray(data.scopes) ? data.scopes : [],
39
- roles: Array.isArray(data.roles) ? data.roles : [],
40
- isPlatformAdmin: data.isPlatformAdmin === true,
41
- isTenantAdmin: data.isTenantAdmin === true,
42
- isWorkspaceAdmin: data.isWorkspaceAdmin === true,
43
- authMode: data.authMode,
44
- sessionId: data.sessionId,
45
- delegatedBy: data.delegatedBy,
46
- expiresAt: data.expiresAt,
47
- })));
48
- },
49
- /**
50
- * List principals in the current identity scope.
51
- */
52
- async listPrincipals(query = {}) {
53
- return gateway.request({
54
- path: `/api/platform/v1/identity/principals${toQueryString(query)}`,
55
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "principals")));
56
- },
57
- /**
58
- * Create a principal.
59
- */
60
- async createPrincipal(input, idempotencyKey) {
61
- return requestPrincipalWrite("POST", input, idempotencyKey);
62
- },
63
- /**
64
- * Update a principal.
65
- */
66
- async updatePrincipal(input, idempotencyKey) {
67
- return requestPrincipalWrite("PATCH", input, idempotencyKey);
68
- },
69
- /**
70
- * @deprecated Use createPrincipal or updatePrincipal.
71
- */
72
- async upsertPrincipal(input, idempotencyKey) {
73
- return requestPrincipalWrite("PATCH", input, idempotencyKey);
74
- },
75
- /**
76
- * List keys in the current identity scope.
77
- */
78
- async listKeys(query = {}) {
79
- return gateway.request({
80
- path: `/api/platform/v1/identity/keys${toQueryString(query)}`,
81
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "keys")));
82
- },
83
- /**
84
- * Create an API key.
85
- */
86
- async createKey(input, idempotencyKey) {
87
- return gateway.request({
88
- path: "/api/platform/v1/identity/keys",
89
- method: "POST",
90
- body: input,
91
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
92
- });
93
- },
94
- /**
95
- * Rotate an API key.
96
- */
97
- async rotateKey(keyId, input = {}, idempotencyKey) {
98
- return gateway.request({
99
- path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/rotate`,
100
- method: "POST",
101
- body: input,
102
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
103
- });
104
- },
105
- /**
106
- * Delete an API key by revoking it.
107
- */
108
- async deleteKey(keyId, input = {}, idempotencyKey) {
109
- return gateway.request({
110
- path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/revoke`,
111
- method: "POST",
112
- body: input,
113
- idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
114
- });
115
- },
116
- /**
117
- * @deprecated Use deleteKey.
118
- */
119
- async revokeKey(keyId, input = {}, idempotencyKey) {
120
- return this.deleteKey(keyId, input, idempotencyKey);
121
- },
122
- /**
123
- * Search Clerk users by email or display attributes.
124
- */
125
- async searchClerkUsers(q) {
126
- return gateway.request({
127
- path: `/api/platform/v1/identity/clerk-users${toQueryString({ q })}`,
128
- });
129
- },
130
- };
131
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * @lucern/sdk — The reasoning operating system for AI-native applications.
3
- *
4
- * This is the main entry point. It re-exports all client factories,
5
- * types, contracts, and utilities from domain modules.
6
- *
7
- * @packageDocumentation
8
- */
9
- export * from "./adminClient";
10
- export * from "./answersClient";
11
- export * from "./audiencesClient";
12
- export * from "./auditClient";
13
- export * from "./beliefsClient";
14
- export * from "./client";
15
- export * from "./contextFacade";
16
- export * from "./contextPackCompiler";
17
- export * from "./controlObjectOwnership";
18
- export * from "./coreClient";
19
- export * from "./contextClient";
20
- export * from "./contracts/api-enums.contract";
21
- export * from "./contracts/auth-session.contract";
22
- export { MAX_ENTITY_LIMIT } from "./contracts/contextPack";
23
- export * from "./contracts/lensFilter";
24
- export * from "./contracts/lensWorkflow";
25
- export * from "./contracts/mcpTools";
26
- export * from "./contracts/prompt";
27
- export * from "./contracts/workflowRuntime";
28
- export * from "./domainContext";
29
- export * from "./customTools";
30
- export * from "./decisionsClient";
31
- export * from "./events";
32
- export * from "./eventsCore";
33
- export * from "./graphClient";
34
- export * from "./harnessClient";
35
- export * from "./identityClient";
36
- export * from "./learningClient";
37
- export * from "./mcpParityClient";
38
- export * from "./mcpParitySurface";
39
- export * from "./ontologyClient";
40
- export * from "./packRuntime";
41
- export * from "./packsClient";
42
- export * from "./policyClient";
43
- export * from "./reportsClient";
44
- export * from "./schemaClient";
45
- export * from "./sdkSurface";
46
- export * from "./topicsClient";
47
- export * from "./types";
48
- export * from "./version";
49
- export * from "./workflowClient";
@@ -1,49 +0,0 @@
1
- /**
2
- * @lucern/sdk — The reasoning operating system for AI-native applications.
3
- *
4
- * This is the main entry point. It re-exports all client factories,
5
- * types, contracts, and utilities from domain modules.
6
- *
7
- * @packageDocumentation
8
- */
9
- export * from "./adminClient.js";
10
- export * from "./answersClient.js";
11
- export * from "./audiencesClient.js";
12
- export * from "./auditClient.js";
13
- export * from "./beliefsClient.js";
14
- export * from "./client.js";
15
- export * from "./contextFacade.js";
16
- export * from "./contextPackCompiler.js";
17
- export * from "./controlObjectOwnership.js";
18
- export * from "./coreClient.js";
19
- export * from "./contextClient.js";
20
- export * from "./contracts/api-enums.contract.js";
21
- export * from "./contracts/auth-session.contract.js";
22
- export { MAX_ENTITY_LIMIT } from "./contracts/contextPack.js";
23
- export * from "./contracts/lensFilter.js";
24
- export * from "./contracts/lensWorkflow.js";
25
- export * from "./contracts/mcpTools.js";
26
- export * from "./contracts/prompt.js";
27
- export * from "./contracts/workflowRuntime.js";
28
- export * from "./domainContext.js";
29
- export * from "./customTools.js";
30
- export * from "./decisionsClient.js";
31
- export * from "./events.js";
32
- export * from "./eventsCore.js";
33
- export * from "./graphClient.js";
34
- export * from "./harnessClient.js";
35
- export * from "./identityClient.js";
36
- export * from "./learningClient.js";
37
- export * from "./mcpParityClient.js";
38
- export * from "./mcpParitySurface.js";
39
- export * from "./ontologyClient.js";
40
- export * from "./packRuntime.js";
41
- export * from "./packsClient.js";
42
- export * from "./policyClient.js";
43
- export * from "./reportsClient.js";
44
- export * from "./schemaClient.js";
45
- export * from "./sdkSurface.js";
46
- export * from "./topicsClient.js";
47
- export * from "./types.js";
48
- export * from "./version.js";
49
- export * from "./workflowClient.js";