@lucern/sdk 0.2.0-alpha.6 → 0.2.0-alpha.7

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 (206) hide show
  1. package/.turbo/turbo-build.log +7 -0
  2. package/.turbo/turbo-typecheck.log +4 -0
  3. package/CHANGELOG.md +13 -0
  4. package/examples/README.md +69 -0
  5. package/examples/contradiction.ts +94 -0
  6. package/examples/investigation-context.ts +118 -0
  7. package/examples/questions-and-tasks.ts +55 -0
  8. package/examples/quickstart.ts +97 -0
  9. package/examples/shared.ts +318 -0
  10. package/examples/strict-public-types.ts +143 -0
  11. package/examples/worktree-lifecycle.ts +79 -0
  12. package/package.json +16 -58
  13. package/src/README.md +6 -0
  14. package/src/adminClient.ts +789 -0
  15. package/{dist/lib/platform/sdk/answersClient.d.ts → src/answersClient.ts} +17 -4
  16. package/src/audiencesClient.ts +209 -0
  17. package/src/auditClient.ts +50 -0
  18. package/src/beliefsClient.ts +319 -0
  19. package/src/client.ts +2647 -0
  20. package/src/contextClient.ts +130 -0
  21. package/{dist/lib/platform/sdk/contextFacade.d.ts → src/contextFacade.ts} +6 -1
  22. package/src/contextPackCompiler.ts +828 -0
  23. package/src/contextPackSchema.ts +251 -0
  24. package/src/contextTypes.ts +153 -0
  25. package/src/contracts/api-enums.contract.ts +202 -0
  26. package/src/contracts/auth-session.contract.ts +109 -0
  27. package/src/contracts/context-pack.contract.ts +700 -0
  28. package/src/contracts/contextPack.ts +1 -0
  29. package/src/contracts/index.ts +10 -0
  30. package/src/contracts/lens-filter.contract.ts +183 -0
  31. package/src/contracts/lens-workflow.contract.ts +162 -0
  32. package/src/contracts/lensFilter.ts +1 -0
  33. package/src/contracts/lensWorkflow.ts +1 -0
  34. package/src/contracts/mcp-tools.contract.ts +3636 -0
  35. package/src/contracts/mcpTools.ts +1 -0
  36. package/src/contracts/prompt.contract.ts +50 -0
  37. package/src/contracts/prompt.ts +1 -0
  38. package/src/contracts/sdk-tools.contract.ts +1457 -0
  39. package/src/contracts/sdkTools.ts +1 -0
  40. package/src/contracts/workflow-runtime.contract.ts +440 -0
  41. package/src/contracts/workflowRuntime.ts +1 -0
  42. package/src/controlObjectOwnership.ts +286 -0
  43. package/src/coreClient.ts +570 -0
  44. package/src/customTools.ts +398 -0
  45. package/src/decisionsClient.ts +286 -0
  46. package/src/domainContext.ts +15 -0
  47. package/src/events.ts +531 -0
  48. package/src/eventsCore.ts +168 -0
  49. package/src/facade/beliefs.ts +83 -0
  50. package/src/facade/context.ts +110 -0
  51. package/src/facade/contradictions.ts +29 -0
  52. package/src/facade/edges.ts +30 -0
  53. package/src/facade/events.ts +23 -0
  54. package/src/facade/evidence.ts +41 -0
  55. package/src/facade/graph.ts +38 -0
  56. package/src/facade/identity.ts +16 -0
  57. package/src/facade/ontologies.ts +34 -0
  58. package/src/facade/questions.ts +59 -0
  59. package/src/facade/search.ts +16 -0
  60. package/src/facade/tasks.ts +37 -0
  61. package/src/facade/topics.ts +42 -0
  62. package/src/facade/webhooks.ts +58 -0
  63. package/src/facade/worktrees.ts +51 -0
  64. package/src/gatewayFacades.ts +1666 -0
  65. package/src/graphClient.ts +529 -0
  66. package/src/harnessClient.ts +585 -0
  67. package/src/identityClient.ts +278 -0
  68. package/src/learningClient.ts +95 -0
  69. package/src/mcpParityClient.ts +240 -0
  70. package/src/mcpParitySurface.ts +70 -0
  71. package/src/ontologyClient.ts +275 -0
  72. package/src/packRuntime.ts +3 -0
  73. package/src/packsClient.ts +260 -0
  74. package/src/policyClient.ts +572 -0
  75. package/src/realtime/index.ts +51 -0
  76. package/src/realtime/refs.ts +17 -0
  77. package/src/reportsClient.ts +99 -0
  78. package/src/schemaClient.ts +129 -0
  79. package/src/sdkSurface.ts +190 -0
  80. package/src/topicsClient.ts +243 -0
  81. package/src/types.ts +807 -0
  82. package/src/workflowClient.ts +826 -0
  83. package/tsconfig.json +9 -0
  84. package/dist/.generated +0 -2
  85. package/dist/index.d.ts +0 -3
  86. package/dist/index.js +0 -3
  87. package/dist/lib/platform/auth/credentials.d.ts +0 -5
  88. package/dist/lib/platform/auth/credentials.js +0 -40
  89. package/dist/lib/platform/sdk/adminClient.d.ts +0 -404
  90. package/dist/lib/platform/sdk/adminClient.js +0 -384
  91. package/dist/lib/platform/sdk/answersClient.js +0 -21
  92. package/dist/lib/platform/sdk/audiencesClient.d.ts +0 -93
  93. package/dist/lib/platform/sdk/audiencesClient.js +0 -111
  94. package/dist/lib/platform/sdk/auditClient.d.ts +0 -24
  95. package/dist/lib/platform/sdk/auditClient.js +0 -21
  96. package/dist/lib/platform/sdk/beliefsClient.d.ts +0 -157
  97. package/dist/lib/platform/sdk/beliefsClient.js +0 -124
  98. package/dist/lib/platform/sdk/client.d.ts +0 -2369
  99. package/dist/lib/platform/sdk/client.js +0 -1831
  100. package/dist/lib/platform/sdk/contextClient.d.ts +0 -21
  101. package/dist/lib/platform/sdk/contextClient.js +0 -86
  102. package/dist/lib/platform/sdk/contextFacade.js +0 -10
  103. package/dist/lib/platform/sdk/contextPackCompiler.d.ts +0 -100
  104. package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
  105. package/dist/lib/platform/sdk/contextTypes.d.ts +0 -133
  106. package/dist/lib/platform/sdk/contextTypes.js +0 -1
  107. package/dist/lib/platform/sdk/controlObjectOwnership.d.ts +0 -308
  108. package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
  109. package/dist/lib/platform/sdk/coreClient.d.ts +0 -139
  110. package/dist/lib/platform/sdk/coreClient.js +0 -366
  111. package/dist/lib/platform/sdk/customTools.d.ts +0 -83
  112. package/dist/lib/platform/sdk/customTools.js +0 -247
  113. package/dist/lib/platform/sdk/decisionsClient.d.ts +0 -106
  114. package/dist/lib/platform/sdk/decisionsClient.js +0 -129
  115. package/dist/lib/platform/sdk/domainContext.d.ts +0 -1
  116. package/dist/lib/platform/sdk/domainContext.js +0 -1
  117. package/dist/lib/platform/sdk/events.d.ts +0 -176
  118. package/dist/lib/platform/sdk/events.js +0 -261
  119. package/dist/lib/platform/sdk/eventsCore.d.ts +0 -13
  120. package/dist/lib/platform/sdk/eventsCore.js +0 -13
  121. package/dist/lib/platform/sdk/gatewayFacades.d.ts +0 -586
  122. package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
  123. package/dist/lib/platform/sdk/graphClient.d.ts +0 -266
  124. package/dist/lib/platform/sdk/graphClient.js +0 -235
  125. package/dist/lib/platform/sdk/harnessClient.d.ts +0 -309
  126. package/dist/lib/platform/sdk/harnessClient.js +0 -219
  127. package/dist/lib/platform/sdk/identityClient.d.ts +0 -134
  128. package/dist/lib/platform/sdk/identityClient.js +0 -131
  129. package/dist/lib/platform/sdk/index.js +0 -49
  130. package/dist/lib/platform/sdk/learningClient.d.ts +0 -40
  131. package/dist/lib/platform/sdk/learningClient.js +0 -53
  132. package/dist/lib/platform/sdk/mcpParityClient.d.ts +0 -69
  133. package/dist/lib/platform/sdk/mcpParityClient.js +0 -196
  134. package/dist/lib/platform/sdk/mcpParitySurface.d.ts +0 -10
  135. package/dist/lib/platform/sdk/mcpParitySurface.js +0 -57
  136. package/dist/lib/platform/sdk/ontologyClient.d.ts +0 -131
  137. package/dist/lib/platform/sdk/ontologyClient.js +0 -161
  138. package/dist/lib/platform/sdk/packRuntime.d.ts +0 -1
  139. package/dist/lib/platform/sdk/packRuntime.js +0 -1
  140. package/dist/lib/platform/sdk/packsClient.d.ts +0 -126
  141. package/dist/lib/platform/sdk/packsClient.js +0 -157
  142. package/dist/lib/platform/sdk/policyClient.d.ts +0 -293
  143. package/dist/lib/platform/sdk/policyClient.js +0 -277
  144. package/dist/lib/platform/sdk/promptCatalog.js +0 -1
  145. package/dist/lib/platform/sdk/reportsClient.d.ts +0 -34
  146. package/dist/lib/platform/sdk/reportsClient.js +0 -64
  147. package/dist/lib/platform/sdk/schemaClient.d.ts +0 -59
  148. package/dist/lib/platform/sdk/schemaClient.js +0 -71
  149. package/dist/lib/platform/sdk/sdkSurface.d.ts +0 -56
  150. package/dist/lib/platform/sdk/sdkSurface.js +0 -140
  151. package/dist/lib/platform/sdk/topicsClient.d.ts +0 -78
  152. package/dist/lib/platform/sdk/topicsClient.js +0 -118
  153. package/dist/lib/platform/sdk/types.d.ts +0 -692
  154. package/dist/lib/platform/sdk/types.js +0 -1
  155. package/dist/lib/platform/sdk/version.d.ts +0 -2
  156. package/dist/lib/platform/sdk/workflowClient.d.ts +0 -313
  157. package/dist/lib/platform/sdk/workflowClient.js +0 -366
  158. package/dist/lucern/contracts/src/api-enums.contract.d.ts +0 -58
  159. package/dist/lucern/contracts/src/api-enums.contract.js +0 -147
  160. package/dist/lucern/contracts/src/auth-context.contract.d.ts +0 -8
  161. package/dist/lucern/contracts/src/auth-context.contract.js +0 -8
  162. package/dist/lucern/contracts/src/auth-session.contract.d.ts +0 -8
  163. package/dist/lucern/contracts/src/auth-session.contract.js +0 -8
  164. package/dist/lucern/contracts/src/auth.contract.d.ts +0 -88
  165. package/dist/lucern/contracts/src/auth.contract.js +0 -57
  166. package/dist/lucern/contracts/src/context-pack.contract.d.ts +0 -494
  167. package/dist/lucern/contracts/src/context-pack.contract.js +0 -169
  168. package/dist/lucern/contracts/src/convex-admin.contract.d.ts +0 -5
  169. package/dist/lucern/contracts/src/convex-admin.contract.js +0 -1
  170. package/dist/lucern/contracts/src/events-types.contract.d.ts +0 -8
  171. package/dist/lucern/contracts/src/events-types.contract.js +0 -8
  172. package/dist/lucern/contracts/src/events.contract.d.ts +0 -176
  173. package/dist/lucern/contracts/src/events.contract.js +0 -159
  174. package/dist/lucern/contracts/src/gateway.contract.d.ts +0 -74
  175. package/dist/lucern/contracts/src/gateway.contract.js +0 -19
  176. package/dist/lucern/contracts/src/ids.contract.d.ts +0 -7
  177. package/dist/lucern/contracts/src/ids.contract.js +0 -24
  178. package/dist/lucern/contracts/src/index.d.ts +0 -29
  179. package/dist/lucern/contracts/src/index.js +0 -29
  180. package/dist/lucern/contracts/src/lens-filter.contract.d.ts +0 -70
  181. package/dist/lucern/contracts/src/lens-filter.contract.js +0 -95
  182. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
  183. package/dist/lucern/contracts/src/lens-workflow.contract.js +0 -54
  184. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
  185. package/dist/lucern/contracts/src/mcp-tools.contract.js +0 -3281
  186. package/dist/lucern/contracts/src/ontology-matching.contract.d.ts +0 -8
  187. package/dist/lucern/contracts/src/ontology-matching.contract.js +0 -8
  188. package/dist/lucern/contracts/src/prompt.contract.d.ts +0 -24
  189. package/dist/lucern/contracts/src/prompt.contract.js +0 -24
  190. package/dist/lucern/contracts/src/sdk-methods.contract.d.ts +0 -358
  191. package/dist/lucern/contracts/src/sdk-methods.contract.js +0 -19
  192. package/dist/lucern/contracts/src/sdk-tools.contract.d.ts +0 -92
  193. package/dist/lucern/contracts/src/sdk-tools.contract.js +0 -1398
  194. package/dist/lucern/contracts/src/text-matching.contract.d.ts +0 -53
  195. package/dist/lucern/contracts/src/text-matching.contract.js +0 -277
  196. package/dist/lucern/contracts/src/topic-scope.contract.d.ts +0 -8
  197. package/dist/lucern/contracts/src/topic-scope.contract.js +0 -8
  198. package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +0 -161
  199. package/dist/lucern/contracts/src/workflow-runtime.contract.js +0 -257
  200. package/dist/realtime-refs.d.ts +0 -1
  201. package/dist/realtime-refs.js +0 -1
  202. package/dist/realtime.d.ts +0 -1
  203. package/dist/realtime.js +0 -1
  204. /package/{dist/lib/platform/sdk/index.d.ts → src/index.ts} +0 -0
  205. /package/{dist/lib/platform/sdk/promptCatalog.d.ts → src/promptCatalog.ts} +0 -0
  206. /package/{dist/lib/platform/sdk/version.js → src/version.ts} +0 -0
@@ -0,0 +1,83 @@
1
+ import {
2
+ createBeliefsClientCore,
3
+ type BeliefsClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/beliefs";
5
+
6
+ export type BeliefsFacadeConfig = BeliefsClientCoreConfig;
7
+
8
+ export function createBeliefsFacade(config: BeliefsFacadeConfig = {}) {
9
+ const beliefsClient = createBeliefsClientCore(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof beliefsClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof beliefsClient.create>[1]
15
+ ) {
16
+ return beliefsClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async get(id: string) {
20
+ return beliefsClient.get(id);
21
+ },
22
+
23
+ async list(query: Parameters<typeof beliefsClient.list>[0]) {
24
+ return beliefsClient.list(query);
25
+ },
26
+
27
+ async refine(
28
+ id: string,
29
+ input: Parameters<typeof beliefsClient.refine>[1],
30
+ idempotencyKey?: Parameters<typeof beliefsClient.refine>[2]
31
+ ) {
32
+ return beliefsClient.refine(id, input, idempotencyKey);
33
+ },
34
+
35
+ async fork(
36
+ id: string,
37
+ input: Parameters<typeof beliefsClient.fork>[1],
38
+ idempotencyKey?: Parameters<typeof beliefsClient.fork>[2]
39
+ ) {
40
+ return beliefsClient.fork(id, input, idempotencyKey);
41
+ },
42
+
43
+ async updateConfidence(
44
+ id: string,
45
+ input: Parameters<typeof beliefsClient.updateConfidence>[1],
46
+ idempotencyKey?: Parameters<typeof beliefsClient.updateConfidence>[2]
47
+ ) {
48
+ return beliefsClient.updateConfidence(id, input, idempotencyKey);
49
+ },
50
+
51
+ async archive(
52
+ id: string,
53
+ input?: Parameters<typeof beliefsClient.archive>[1],
54
+ idempotencyKey?: Parameters<typeof beliefsClient.archive>[2]
55
+ ) {
56
+ return beliefsClient.archive(id, input, idempotencyKey);
57
+ },
58
+
59
+ async lineage(id: string) {
60
+ return beliefsClient.lineage(id);
61
+ },
62
+
63
+ async confidenceHistory(id: string) {
64
+ return beliefsClient.confidenceHistory(id);
65
+ },
66
+
67
+ async createContract(
68
+ id: string,
69
+ input: Parameters<typeof beliefsClient.createContract>[1],
70
+ idempotencyKey?: Parameters<typeof beliefsClient.createContract>[2]
71
+ ) {
72
+ return beliefsClient.createContract(id, input, idempotencyKey);
73
+ },
74
+
75
+ async bisect(
76
+ id: string,
77
+ input: Parameters<typeof beliefsClient.bisect>[1],
78
+ idempotencyKey?: Parameters<typeof beliefsClient.bisect>[2]
79
+ ) {
80
+ return beliefsClient.bisect(id, input, idempotencyKey);
81
+ },
82
+ };
83
+ }
@@ -0,0 +1,110 @@
1
+ import type { CompileContextInput, PublicCompiledContext } from "../contextTypes";
2
+
3
+ export type ContextClientRequest = {
4
+ path: "/api/platform/v1/context/compile";
5
+ method: "POST";
6
+ body: Record<string, unknown>;
7
+ };
8
+
9
+ export type ContextFacadeTransport = {
10
+ request<T>(request: ContextClientRequest): Promise<T>;
11
+ };
12
+
13
+ export type ContextFacadeConfig = {
14
+ transport: ContextFacadeTransport;
15
+ };
16
+
17
+ function cleanString(value: unknown): string | undefined {
18
+ return typeof value === "string" && value.trim().length > 0
19
+ ? value.trim()
20
+ : undefined;
21
+ }
22
+
23
+ function cleanNumber(value: unknown): number | undefined {
24
+ return typeof value === "number" && Number.isFinite(value) ? value : undefined;
25
+ }
26
+
27
+ function cleanBoolean(value: unknown): boolean | undefined {
28
+ return typeof value === "boolean" ? value : undefined;
29
+ }
30
+
31
+ function buildCompileContextRequest(
32
+ topicId: string,
33
+ input: CompileContextInput = {}
34
+ ): ContextClientRequest {
35
+ const payload: Record<string, unknown> = { topicId };
36
+
37
+ const query = cleanString(input.query);
38
+ if (query) {
39
+ payload.query = query;
40
+ }
41
+
42
+ const budget = cleanNumber(input.budget) ?? cleanNumber(input.tokenBudget);
43
+ if (budget !== undefined) {
44
+ payload.budget = budget;
45
+ }
46
+
47
+ const ranking = cleanString(input.ranking) ?? cleanString(input.rankingProfile);
48
+ if (ranking) {
49
+ payload.ranking = ranking;
50
+ }
51
+
52
+ const limit = cleanNumber(input.limit);
53
+ if (limit !== undefined) {
54
+ payload.limit = limit;
55
+ }
56
+
57
+ const maxDepth = cleanNumber(input.maxDepth);
58
+ if (maxDepth !== undefined) {
59
+ payload.maxDepth = maxDepth;
60
+ }
61
+
62
+ const includeEntities = cleanBoolean(input.includeEntities);
63
+ if (includeEntities !== undefined) {
64
+ payload.includeEntities = includeEntities;
65
+ }
66
+
67
+ const mode = cleanString(input.mode);
68
+ if (mode) {
69
+ payload.mode = mode;
70
+ }
71
+
72
+ const includeFailures = cleanBoolean(input.includeFailures);
73
+ if (includeFailures !== undefined) {
74
+ payload.includeFailures = includeFailures;
75
+ }
76
+
77
+ const worktreeId = cleanString(input.worktreeId);
78
+ if (worktreeId) {
79
+ payload.worktreeId = worktreeId;
80
+ }
81
+
82
+ const sessionId = cleanString(input.sessionId);
83
+ if (sessionId) {
84
+ payload.sessionId = sessionId;
85
+ }
86
+
87
+ if (
88
+ Array.isArray(input.packWeightOverrides) &&
89
+ input.packWeightOverrides.length > 0
90
+ ) {
91
+ payload.packWeightOverrides = input.packWeightOverrides;
92
+ }
93
+
94
+ return {
95
+ path: "/api/platform/v1/context/compile",
96
+ method: "POST",
97
+ body: payload,
98
+ };
99
+ }
100
+
101
+ export function createContextFacade(config: ContextFacadeConfig) {
102
+ return {
103
+ compile(topicId: string, input: CompileContextInput = {}) {
104
+ const request = buildCompileContextRequest(topicId, input);
105
+ return config.transport.request<PublicCompiledContext>(request);
106
+ },
107
+ };
108
+ }
109
+
110
+ export type { CompileContextInput, PublicCompiledContext };
@@ -0,0 +1,29 @@
1
+ import {
2
+ createContradictionsClient,
3
+ type ContradictionsClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/contradictions";
5
+
6
+ export type ContradictionsFacadeConfig = ContradictionsClientCoreConfig;
7
+
8
+ export function createContradictionsFacade(
9
+ config: ContradictionsFacadeConfig = {}
10
+ ) {
11
+ const contradictionsClient = createContradictionsClient(config);
12
+
13
+ return {
14
+ async flag(
15
+ input: Parameters<typeof contradictionsClient.flag>[0],
16
+ idempotencyKey?: Parameters<typeof contradictionsClient.flag>[1]
17
+ ) {
18
+ return contradictionsClient.flag(input, idempotencyKey);
19
+ },
20
+
21
+ async list(query: Parameters<typeof contradictionsClient.list>[0]) {
22
+ return contradictionsClient.list(query);
23
+ },
24
+
25
+ async get(id: string) {
26
+ return contradictionsClient.get(id);
27
+ },
28
+ };
29
+ }
@@ -0,0 +1,30 @@
1
+ import {
2
+ createEdgesClient,
3
+ type EdgesClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/edges";
5
+
6
+ export type EdgesFacadeConfig = EdgesClientCoreConfig;
7
+
8
+ export function createEdgesFacade(config: EdgesFacadeConfig = {}) {
9
+ const edgesClient = createEdgesClient(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof edgesClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof edgesClient.create>[1]
15
+ ) {
16
+ return edgesClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async list(query: Parameters<typeof edgesClient.list>[0]) {
20
+ return edgesClient.list(query);
21
+ },
22
+
23
+ async traverse(
24
+ input: Parameters<typeof edgesClient.traverse>[0],
25
+ idempotencyKey?: Parameters<typeof edgesClient.traverse>[1]
26
+ ) {
27
+ return edgesClient.traverse(input, idempotencyKey);
28
+ },
29
+ };
30
+ }
@@ -0,0 +1,23 @@
1
+ import {
2
+ createEventsClientCore,
3
+ type EventsClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/events";
5
+
6
+ export type EventsFacadeConfig = EventsClientCoreConfig;
7
+
8
+ export function createEventsFacade(config: EventsFacadeConfig = {}) {
9
+ const eventsClient = createEventsClientCore(config);
10
+
11
+ return {
12
+ async list(query: Parameters<typeof eventsClient.list>[0]) {
13
+ return eventsClient.list(query);
14
+ },
15
+
16
+ async replay(
17
+ input: Parameters<typeof eventsClient.replay>[0],
18
+ idempotencyKey?: Parameters<typeof eventsClient.replay>[1]
19
+ ) {
20
+ return eventsClient.replay(input, idempotencyKey);
21
+ },
22
+ };
23
+ }
@@ -0,0 +1,41 @@
1
+ import {
2
+ createEvidenceClient,
3
+ type EvidenceClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/evidence";
5
+
6
+ export type EvidenceFacadeConfig = EvidenceClientCoreConfig;
7
+
8
+ export function createEvidenceFacade(config: EvidenceFacadeConfig = {}) {
9
+ const evidenceClient = createEvidenceClient(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof evidenceClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof evidenceClient.create>[1]
15
+ ) {
16
+ return evidenceClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async get(id: string) {
20
+ return evidenceClient.get(id);
21
+ },
22
+
23
+ async list(query: Parameters<typeof evidenceClient.list>[0]) {
24
+ return evidenceClient.list(query);
25
+ },
26
+
27
+ async link(
28
+ input: Parameters<typeof evidenceClient.link>[0],
29
+ idempotencyKey?: Parameters<typeof evidenceClient.link>[1]
30
+ ) {
31
+ return evidenceClient.link(input, idempotencyKey);
32
+ },
33
+
34
+ async search(
35
+ query: Parameters<typeof evidenceClient.search>[0],
36
+ idempotencyKey?: Parameters<typeof evidenceClient.search>[1]
37
+ ) {
38
+ return evidenceClient.search(query, idempotencyKey);
39
+ },
40
+ };
41
+ }
@@ -0,0 +1,38 @@
1
+ import {
2
+ createGraphClient,
3
+ type GraphClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/graph";
5
+
6
+ export type GraphFacadeConfig = GraphClientCoreConfig;
7
+
8
+ export function createGraphFacade(config: GraphFacadeConfig = {}) {
9
+ const graphClient = createGraphClient(config);
10
+
11
+ return {
12
+ async neighborhood(
13
+ input: Parameters<typeof graphClient.neighborhood>[0]
14
+ ) {
15
+ return graphClient.neighborhood(input);
16
+ },
17
+
18
+ async traverse(input: Parameters<typeof graphClient.traverse>[0]) {
19
+ return graphClient.traverse(input);
20
+ },
21
+
22
+ async analyze(input: Parameters<typeof graphClient.analyze>[0]) {
23
+ return graphClient.analyze(input);
24
+ },
25
+
26
+ async bias(input: Parameters<typeof graphClient.bias>[0]) {
27
+ return graphClient.bias(input);
28
+ },
29
+
30
+ async gaps(input: Parameters<typeof graphClient.gaps>[0]) {
31
+ return graphClient.gaps(input);
32
+ },
33
+
34
+ async falsify(input: Parameters<typeof graphClient.falsify>[0]) {
35
+ return graphClient.falsify(input);
36
+ },
37
+ };
38
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ createIdentityWhoamiClient,
3
+ type IdentityClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/identity";
5
+
6
+ export type IdentityFacadeConfig = IdentityClientCoreConfig;
7
+
8
+ export function createIdentityFacade(config: IdentityFacadeConfig = {}) {
9
+ const identityClient = createIdentityWhoamiClient(config);
10
+
11
+ return {
12
+ async whoami() {
13
+ return identityClient.whoami();
14
+ },
15
+ };
16
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ createOntologiesClientCore,
3
+ type OntologiesClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/ontologies";
5
+
6
+ export type OntologiesFacadeConfig = OntologiesClientCoreConfig;
7
+
8
+ export function createOntologiesFacade(config: OntologiesFacadeConfig = {}) {
9
+ const ontologiesClient = createOntologiesClientCore(config);
10
+
11
+ return {
12
+ async get(id: string) {
13
+ return ontologiesClient.get(id);
14
+ },
15
+
16
+ async list(query: Parameters<typeof ontologiesClient.list>[0] = {}) {
17
+ return ontologiesClient.list(query);
18
+ },
19
+
20
+ async bind(
21
+ input: Parameters<typeof ontologiesClient.bind>[0],
22
+ idempotencyKey?: Parameters<typeof ontologiesClient.bind>[1]
23
+ ) {
24
+ return ontologiesClient.bind(input, idempotencyKey);
25
+ },
26
+
27
+ async match(
28
+ input: Parameters<typeof ontologiesClient.match>[0],
29
+ idempotencyKey?: Parameters<typeof ontologiesClient.match>[1]
30
+ ) {
31
+ return ontologiesClient.match(input, idempotencyKey);
32
+ },
33
+ };
34
+ }
@@ -0,0 +1,59 @@
1
+ import {
2
+ createQuestionsClient,
3
+ type QuestionsClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/questions";
5
+
6
+ export type QuestionsFacadeConfig = QuestionsClientCoreConfig;
7
+
8
+ export function createQuestionsFacade(config: QuestionsFacadeConfig = {}) {
9
+ const questionsClient = createQuestionsClient(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof questionsClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof questionsClient.create>[1]
15
+ ) {
16
+ return questionsClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async get(id: string) {
20
+ return questionsClient.get(id);
21
+ },
22
+
23
+ async list(query: Parameters<typeof questionsClient.list>[0]) {
24
+ return questionsClient.list(query);
25
+ },
26
+
27
+ async answer(
28
+ id: string,
29
+ input: Parameters<typeof questionsClient.answer>[1],
30
+ idempotencyKey?: Parameters<typeof questionsClient.answer>[2]
31
+ ) {
32
+ return questionsClient.answer(id, input, idempotencyKey);
33
+ },
34
+
35
+ async refine(
36
+ id: string,
37
+ input: Parameters<typeof questionsClient.refine>[1],
38
+ idempotencyKey?: Parameters<typeof questionsClient.refine>[2]
39
+ ) {
40
+ return questionsClient.refine(id, input, idempotencyKey);
41
+ },
42
+
43
+ async archive(
44
+ id: string,
45
+ input?: Parameters<typeof questionsClient.archive>[1],
46
+ idempotencyKey?: Parameters<typeof questionsClient.archive>[2]
47
+ ) {
48
+ return questionsClient.archive(id, input, idempotencyKey);
49
+ },
50
+
51
+ async updateStatus(
52
+ id: string,
53
+ input: Parameters<typeof questionsClient.updateStatus>[1],
54
+ idempotencyKey?: Parameters<typeof questionsClient.updateStatus>[2]
55
+ ) {
56
+ return questionsClient.updateStatus(id, input, idempotencyKey);
57
+ },
58
+ };
59
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ createSearchClient,
3
+ type SearchClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/search";
5
+
6
+ export type SearchFacadeConfig = SearchClientCoreConfig;
7
+
8
+ export function createSearchFacade(config: SearchFacadeConfig = {}) {
9
+ const searchClient = createSearchClient(config);
10
+
11
+ return {
12
+ async query(input: Parameters<typeof searchClient.query>[0]) {
13
+ return searchClient.query(input);
14
+ },
15
+ };
16
+ }
@@ -0,0 +1,37 @@
1
+ import {
2
+ createTasksClientCore,
3
+ type TasksClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/tasks";
5
+
6
+ export type TasksFacadeConfig = TasksClientCoreConfig;
7
+
8
+ export function createTasksFacade(config: TasksFacadeConfig = {}) {
9
+ const tasksClient = createTasksClientCore(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof tasksClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof tasksClient.create>[1]
15
+ ) {
16
+ return tasksClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async update(
20
+ input: Parameters<typeof tasksClient.update>[0],
21
+ idempotencyKey?: Parameters<typeof tasksClient.update>[1]
22
+ ) {
23
+ return tasksClient.update(input, idempotencyKey);
24
+ },
25
+
26
+ async complete(
27
+ input: Parameters<typeof tasksClient.complete>[0],
28
+ idempotencyKey?: Parameters<typeof tasksClient.complete>[1]
29
+ ) {
30
+ return tasksClient.complete(input, idempotencyKey);
31
+ },
32
+
33
+ async list(query: Parameters<typeof tasksClient.list>[0]) {
34
+ return tasksClient.list(query);
35
+ },
36
+ };
37
+ }
@@ -0,0 +1,42 @@
1
+ import {
2
+ createTopicsClientCore,
3
+ type TopicsClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/topics";
5
+
6
+ export type TopicsFacadeConfig = TopicsClientCoreConfig;
7
+
8
+ export function createTopicsFacade(config: TopicsFacadeConfig = {}) {
9
+ const topicsClient = createTopicsClientCore(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof topicsClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof topicsClient.create>[1]
15
+ ) {
16
+ return topicsClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async get(id: string) {
20
+ return topicsClient.get(id);
21
+ },
22
+
23
+ async list(query: Parameters<typeof topicsClient.list>[0] = {}) {
24
+ return topicsClient.list(query);
25
+ },
26
+
27
+ async update(
28
+ input: Parameters<typeof topicsClient.update>[0],
29
+ idempotencyKey?: Parameters<typeof topicsClient.update>[1]
30
+ ) {
31
+ return topicsClient.update(input, idempotencyKey);
32
+ },
33
+
34
+ async tree(input: Parameters<typeof topicsClient.tree>[0]) {
35
+ return topicsClient.tree(input);
36
+ },
37
+
38
+ async coverage(input: Parameters<typeof topicsClient.coverage>[0]) {
39
+ return topicsClient.coverage(input);
40
+ },
41
+ };
42
+ }
@@ -0,0 +1,58 @@
1
+ import {
2
+ createWebhooksClientCore,
3
+ type WebhooksClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/webhooks";
5
+
6
+ export type WebhooksFacadeConfig = WebhooksClientCoreConfig;
7
+
8
+ export function createWebhooksFacade(config: WebhooksFacadeConfig = {}) {
9
+ const webhooksClient = createWebhooksClientCore(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof webhooksClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof webhooksClient.create>[1]
15
+ ) {
16
+ return webhooksClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async list(query?: Parameters<typeof webhooksClient.list>[0]) {
20
+ return webhooksClient.list(query);
21
+ },
22
+
23
+ async get(id: string) {
24
+ return webhooksClient.get(id);
25
+ },
26
+
27
+ async update(
28
+ id: string,
29
+ input: Parameters<typeof webhooksClient.update>[1],
30
+ idempotencyKey?: Parameters<typeof webhooksClient.update>[2]
31
+ ) {
32
+ return webhooksClient.update(id, input, idempotencyKey);
33
+ },
34
+
35
+ async delete(id: string, idempotencyKey?: Parameters<typeof webhooksClient.delete>[1]) {
36
+ return webhooksClient.delete(id, idempotencyKey);
37
+ },
38
+
39
+ async test(
40
+ id: string,
41
+ input?: Parameters<typeof webhooksClient.test>[1],
42
+ idempotencyKey?: Parameters<typeof webhooksClient.test>[2]
43
+ ) {
44
+ return webhooksClient.test(id, input, idempotencyKey);
45
+ },
46
+
47
+ async deliveries(
48
+ id: string,
49
+ query?: Parameters<typeof webhooksClient.deliveries>[1]
50
+ ) {
51
+ return webhooksClient.deliveries(id, query);
52
+ },
53
+
54
+ async health(id: string) {
55
+ return webhooksClient.health(id);
56
+ },
57
+ };
58
+ }
@@ -0,0 +1,51 @@
1
+ import {
2
+ createWorktreesClientCore,
3
+ type WorktreesClientCoreConfig,
4
+ } from "@/lucern/packages/client-core/src/worktrees";
5
+
6
+ export type WorktreesFacadeConfig = WorktreesClientCoreConfig;
7
+
8
+ export function createWorktreesFacade(config: WorktreesFacadeConfig = {}) {
9
+ const worktreesClient = createWorktreesClientCore(config);
10
+
11
+ return {
12
+ async create(
13
+ input: Parameters<typeof worktreesClient.create>[0],
14
+ idempotencyKey?: Parameters<typeof worktreesClient.create>[1]
15
+ ) {
16
+ return worktreesClient.create(input, idempotencyKey);
17
+ },
18
+
19
+ async list(query: Parameters<typeof worktreesClient.list>[0]) {
20
+ return worktreesClient.list(query);
21
+ },
22
+
23
+ async activate(
24
+ input: Parameters<typeof worktreesClient.activate>[0],
25
+ idempotencyKey?: Parameters<typeof worktreesClient.activate>[1]
26
+ ) {
27
+ return worktreesClient.activate(input, idempotencyKey);
28
+ },
29
+
30
+ async update(
31
+ input: Parameters<typeof worktreesClient.update>[0],
32
+ idempotencyKey?: Parameters<typeof worktreesClient.update>[1]
33
+ ) {
34
+ return worktreesClient.update(input, idempotencyKey);
35
+ },
36
+
37
+ async merge(
38
+ input: Parameters<typeof worktreesClient.merge>[0],
39
+ idempotencyKey?: Parameters<typeof worktreesClient.merge>[1]
40
+ ) {
41
+ return worktreesClient.merge(input, idempotencyKey);
42
+ },
43
+
44
+ async updateTargets(
45
+ input: Parameters<typeof worktreesClient.updateTargets>[0],
46
+ idempotencyKey?: Parameters<typeof worktreesClient.updateTargets>[1]
47
+ ) {
48
+ return worktreesClient.updateTargets(input, idempotencyKey);
49
+ },
50
+ };
51
+ }