@lucern/sdk 1.0.29 → 1.0.31

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 +12 -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
package/dist/events.d.ts CHANGED
@@ -7,141 +7,141 @@ export type DomainEventType = (typeof DOMAIN_EVENT_TYPES)[number];
7
7
  export type DomainResourceType = "belief" | "evidence" | "question" | "edge" | "contradiction" | "worktree" | "topic" | "task" | "ontology" | "context" | "identity" | "webhook";
8
8
  export type DomainActorType = "human" | "agent" | "service";
9
9
  export type DomainEventData = Record<string, unknown>;
10
- export type DomainEvent = {
11
- eventId: string;
12
- type: DomainEventType | string;
13
- version: typeof DOMAIN_EVENT_VERSION;
14
- timestamp: number;
15
- tenantId?: string;
16
- workspaceId?: string;
17
- topicId: string;
18
- resourceId: string;
19
- resourceType: DomainResourceType | string;
10
+ export interface DomainEvent {
20
11
  actorId: string;
21
12
  actorType: DomainActorType;
22
- data: DomainEventData;
23
13
  correlationId?: string;
14
+ data: DomainEventData;
15
+ eventId: string;
24
16
  expiresAt: number;
25
- };
26
- export type CreateDomainEventInput = {
27
- eventId?: string;
28
- timestamp?: number;
17
+ resourceId: string;
18
+ resourceType: DomainResourceType | string;
29
19
  tenantId?: string;
30
- workspaceId?: string;
20
+ timestamp: number;
31
21
  topicId: string;
32
22
  type: DomainEventType | string;
33
- resourceId: string;
34
- resourceType: DomainResourceType | string;
23
+ version: typeof DOMAIN_EVENT_VERSION;
24
+ workspaceId?: string;
25
+ }
26
+ export interface CreateDomainEventInput {
35
27
  actorId: string;
36
28
  actorType: DomainActorType;
37
- data?: DomainEventData;
38
29
  correlationId?: string;
30
+ data?: DomainEventData;
31
+ eventId?: string;
32
+ resourceId: string;
33
+ resourceType: DomainResourceType | string;
39
34
  retentionDays?: number;
40
- };
41
- export type EventCursor = {
42
- timestamp: number;
35
+ tenantId?: string;
36
+ timestamp?: number;
37
+ topicId: string;
38
+ type: DomainEventType | string;
39
+ workspaceId?: string;
40
+ }
41
+ export interface EventCursor {
43
42
  eventId: string;
44
- };
45
- export type EventListQuery = {
46
- topicId?: string;
43
+ timestamp: number;
44
+ }
45
+ export interface EventListQuery {
47
46
  after?: string;
48
- types?: string[];
49
- startTime?: number;
50
47
  endTime?: number;
51
48
  limit?: number;
52
- };
53
- export type EventListResult = {
49
+ startTime?: number;
50
+ topicId?: string;
51
+ types?: string[];
52
+ }
53
+ export interface EventListResult {
54
54
  events: DomainEvent[];
55
55
  nextCursor: string | null;
56
- };
56
+ }
57
57
  export type WebhookSecretMode = "configured";
58
- export type WebhookRecord = {
59
- id: string;
60
- webhookId: string;
61
- tenantId?: string;
62
- workspaceId?: string;
63
- topicId?: string;
64
- url: string;
65
- events: string[];
58
+ export interface WebhookRecord {
66
59
  active: boolean;
67
- secretConfigured: boolean;
68
60
  createdAt: number;
69
- updatedAt: number;
70
61
  createdBy: string;
71
- updatedBy: string;
62
+ events: string[];
63
+ id: string;
72
64
  lastDeliveryAt?: number;
73
65
  lastSuccessfulDeliveryAt?: number;
74
- };
75
- export type WebhookCreateInput = {
66
+ secretConfigured: boolean;
67
+ tenantId?: string;
68
+ topicId?: string;
69
+ updatedAt: number;
70
+ updatedBy: string;
76
71
  url: string;
72
+ webhookId: string;
73
+ workspaceId?: string;
74
+ }
75
+ export interface WebhookCreateInput {
76
+ active?: boolean;
77
77
  events: string[];
78
78
  secret: string;
79
79
  topicId?: string;
80
+ url: string;
81
+ }
82
+ export interface WebhookUpdateInput {
80
83
  active?: boolean;
81
- };
82
- export type WebhookUpdateInput = {
83
- url?: string;
84
84
  events?: string[];
85
85
  secret?: string;
86
86
  topicId?: string | null;
87
- active?: boolean;
88
- };
87
+ url?: string;
88
+ }
89
89
  export type WebhookDeliveryStatus = "pending" | "delivering" | "succeeded" | "failed" | "dead_letter";
90
- export type WebhookDeliveryRecord = {
91
- id: string;
90
+ export interface WebhookDeliveryRecord {
91
+ attemptCount: number;
92
+ createdAt: number;
93
+ deliveredAt?: number;
92
94
  deliveryId: string;
93
- webhookId: string;
94
95
  eventId: string;
95
96
  eventType: string;
96
- topicId: string;
97
- status: WebhookDeliveryStatus;
98
- attemptCount: number;
99
- maxAttempts: number;
100
- nextAttemptAt?: number;
97
+ id: string;
101
98
  lastAttemptAt?: number;
102
- lastStatusCode?: number;
103
99
  lastError?: string;
104
- deliveredAt?: number;
105
- createdAt: number;
100
+ lastStatusCode?: number;
101
+ maxAttempts: number;
102
+ nextAttemptAt?: number;
103
+ status: WebhookDeliveryStatus;
104
+ topicId: string;
106
105
  updatedAt: number;
107
- };
108
- export type WebhookDeliveryAttemptRecord = {
109
- id: string;
106
+ webhookId: string;
107
+ }
108
+ export interface WebhookDeliveryAttemptRecord {
110
109
  attemptId: string;
110
+ attemptNumber: number;
111
+ createdAt: number;
111
112
  deliveryId: string;
112
- webhookId: string;
113
+ durationMs?: number;
114
+ error?: string;
113
115
  eventId: string;
114
116
  eventType: string;
115
- attemptNumber: number;
117
+ id: string;
118
+ responseBody?: string;
116
119
  status: "succeeded" | "failed";
117
120
  statusCode?: number;
118
- error?: string;
119
- responseBody?: string;
120
- durationMs?: number;
121
- createdAt: number;
122
- };
123
- export type WebhookDeliveriesResult = {
121
+ webhookId: string;
122
+ }
123
+ export interface WebhookDeliveriesResult {
124
124
  deliveries: Array<WebhookDeliveryRecord & {
125
125
  attempts?: WebhookDeliveryAttemptRecord[];
126
126
  }>;
127
- };
128
- export type WebhookHealthResult = {
129
- webhookId: string;
130
- totalAttempts: number;
131
- successfulAttempts: number;
132
- failedAttempts: number;
133
- successRate: number;
134
- pendingDeliveries: number;
127
+ }
128
+ export interface WebhookHealthResult {
135
129
  deadLetterDeliveries: number;
130
+ failedAttempts: number;
136
131
  lastDeliveryAt?: number;
137
132
  lastSuccessfulDeliveryAt?: number;
138
- };
139
- export type WebhookTestResult = {
133
+ pendingDeliveries: number;
134
+ successfulAttempts: number;
135
+ successRate: number;
136
+ totalAttempts: number;
140
137
  webhookId: string;
138
+ }
139
+ export interface WebhookTestResult {
140
+ attempts: number;
141
141
  deliveryId: string;
142
142
  status: WebhookDeliveryStatus;
143
- attempts: number;
144
- };
143
+ webhookId: string;
144
+ }
145
145
  export type ReplayEventsInput = EventListQuery & {
146
146
  webhookId?: string;
147
147
  };
@@ -165,7 +165,7 @@ export declare function inferActorType(args: {
165
165
  authMode?: string;
166
166
  principalType?: string;
167
167
  }): DomainActorType;
168
- export declare function emitDomainEvent(invokeMutation: (reference: any, args: CreateDomainEventInput) => Promise<unknown>, input: CreateDomainEventInput): Promise<unknown>;
168
+ export declare function emitDomainEvent(invokeMutation: (reference: string, args: CreateDomainEventInput) => Promise<unknown>, input: CreateDomainEventInput): Promise<unknown>;
169
169
  export declare function assertValidWebhookUrl(url: string): string;
170
170
  export declare function normalizeWebhookPatterns(patterns: readonly string[]): string[];
171
171
  export declare function assertValidWebhookSecret(secret: string): string;
package/dist/events.js CHANGED
@@ -1,7 +1,9 @@
1
1
  export const DOMAIN_EVENT_VERSION = "1.0";
2
2
  export const EVENT_RETENTION_DEFAULT_DAYS = 30;
3
3
  export const WEBHOOK_MAX_ATTEMPTS = 5;
4
- export const WEBHOOK_RETRY_DELAYS_MS = [1_000, 5_000, 30_000, 300_000];
4
+ export const WEBHOOK_RETRY_DELAYS_MS = [1000, 5000, 30_000, 300_000];
5
+ const EMPTY_EVENT_PATTERN = /^$/;
6
+ const ANY_EVENT_PATTERN = /^.*$/;
5
7
  export const DOMAIN_EVENT_TYPES = [
6
8
  "belief.created",
7
9
  "belief.forked",
@@ -47,10 +49,10 @@ function escapeRegex(value) {
47
49
  export function eventPatternToRegExp(pattern) {
48
50
  const normalized = pattern.trim();
49
51
  if (!normalized) {
50
- return /^$/;
52
+ return EMPTY_EVENT_PATTERN;
51
53
  }
52
54
  if (normalized === "*") {
53
- return /^.*$/;
55
+ return ANY_EVENT_PATTERN;
54
56
  }
55
57
  const source = escapeRegex(normalized).replace(/\\\*/g, ".*");
56
58
  return new RegExp(`^${source}$`);
@@ -144,8 +146,7 @@ export function decodeEventCursor(cursor) {
144
146
  eventId: parsed.eventId.trim(),
145
147
  };
146
148
  }
147
- catch (error) {
148
- void error;
149
+ catch {
149
150
  return null;
150
151
  }
151
152
  }
@@ -169,16 +170,15 @@ export function inferActorType(args) {
169
170
  }
170
171
  return "human";
171
172
  }
172
- export async function emitDomainEvent(invokeMutation, input) {
173
- return await invokeMutation("events:recordEvent", input);
173
+ export function emitDomainEvent(invokeMutation, input) {
174
+ return invokeMutation("events:recordEvent", input);
174
175
  }
175
176
  const LOCALHOST_HOSTS = new Set(["localhost", "127.0.0.1", "::1"]);
176
177
  function normalizeUrl(url) {
177
178
  try {
178
179
  return new URL(url.trim());
179
180
  }
180
- catch (error) {
181
- void error;
181
+ catch {
182
182
  throw new Error("Webhook URL must be a valid absolute URL.");
183
183
  }
184
184
  }
@@ -187,7 +187,8 @@ export function assertValidWebhookUrl(url) {
187
187
  const hostname = parsed.hostname.trim().toLowerCase();
188
188
  const nodeEnv = RUNTIME_ENV?.NODE_ENV;
189
189
  const allowLocalHttp = nodeEnv === "test" || LOCALHOST_HOSTS.has(hostname);
190
- if (parsed.protocol !== "https:" && !(allowLocalHttp && parsed.protocol === "http:")) {
190
+ if (parsed.protocol !== "https:" &&
191
+ !(allowLocalHttp && parsed.protocol === "http:")) {
191
192
  throw new Error("Webhook URL must use HTTPS.");
192
193
  }
193
194
  return parsed.toString();
@@ -218,7 +219,7 @@ export async function computeWebhookSignature(payload, secret) {
218
219
  }
219
220
  export function nextDeliveryAttemptAt(currentAttemptCount, now = Date.now()) {
220
221
  if (currentAttemptCount >= WEBHOOK_MAX_ATTEMPTS) {
221
- return undefined;
222
+ return;
222
223
  }
223
224
  const retryIndex = currentAttemptCount - 1;
224
225
  const delay = WEBHOOK_RETRY_DELAYS_MS[retryIndex];
@@ -234,7 +235,8 @@ export function sanitizeWebhookRecord(value) {
234
235
  tenantId: typeof value.tenantId === "string" && value.tenantId.trim().length > 0
235
236
  ? value.tenantId
236
237
  : undefined,
237
- workspaceId: typeof value.workspaceId === "string" && value.workspaceId.trim().length > 0
238
+ workspaceId: typeof value.workspaceId === "string" &&
239
+ value.workspaceId.trim().length > 0
238
240
  ? value.workspaceId
239
241
  : undefined,
240
242
  topicId: typeof value.topicId === "string" && value.topicId.trim().length > 0
@@ -252,15 +254,17 @@ export function sanitizeWebhookRecord(value) {
252
254
  updatedAt: Number(value.updatedAt ?? value.createdAt ?? Date.now()),
253
255
  createdBy: String(value.createdBy ?? ""),
254
256
  updatedBy: String(value.updatedBy ?? value.createdBy ?? ""),
255
- lastDeliveryAt: typeof value.lastDeliveryAt === "number" ? value.lastDeliveryAt : undefined,
257
+ lastDeliveryAt: typeof value.lastDeliveryAt === "number"
258
+ ? value.lastDeliveryAt
259
+ : undefined,
256
260
  lastSuccessfulDeliveryAt: typeof value.lastSuccessfulDeliveryAt === "number"
257
261
  ? value.lastSuccessfulDeliveryAt
258
262
  : undefined,
259
263
  };
260
264
  }
261
- export function truncateWebhookResponseBody(responseBody, maxLength = 2_000) {
265
+ export function truncateWebhookResponseBody(responseBody, maxLength = 2000) {
262
266
  if (!responseBody) {
263
- return undefined;
267
+ return;
264
268
  }
265
269
  if (responseBody.length <= maxLength) {
266
270
  return responseBody;
@@ -4,16 +4,16 @@ export type EventsClientCoreConfig = GatewayClientConfig;
4
4
  export type EventsListResponse = PlatformGatewaySuccess<EventListResult>;
5
5
  export type EventsReplayResponse = PlatformGatewaySuccess<ReplayEventsResult>;
6
6
  export type WebhooksClientCoreConfig = GatewayClientConfig;
7
- export type WebhookListQuery = {
7
+ export interface WebhookListQuery {
8
8
  topicId?: string;
9
- };
10
- export type WebhookDeliveriesQuery = {
9
+ }
10
+ export interface WebhookDeliveriesQuery {
11
11
  limit?: number;
12
- };
13
- export type WebhookDeleteResult = {
14
- webhookId: string;
12
+ }
13
+ export interface WebhookDeleteResult {
15
14
  deleted: boolean;
16
- };
15
+ webhookId: string;
16
+ }
17
17
  export type WebhooksCreateResponse = PlatformGatewaySuccess<WebhookRecord>;
18
18
  export type WebhooksListResponse = PlatformGatewaySuccess<{
19
19
  webhooks: WebhookRecord[];
@@ -1,3 +1,4 @@
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.
1
2
  import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
3
  function serializeTypes(types) {
3
4
  return Array.isArray(types) && types.length > 0 ? types.join(",") : undefined;
@@ -5,7 +6,7 @@ function serializeTypes(types) {
5
6
  export function createEventsClientCore(config = {}) {
6
7
  const gateway = createGatewayRequestClient(config);
7
8
  return {
8
- async list(query = {}) {
9
+ list(query = {}) {
9
10
  return gateway.request({
10
11
  path: `/v1/events${toQueryString({
11
12
  topicId: query.topicId,
@@ -17,7 +18,7 @@ export function createEventsClientCore(config = {}) {
17
18
  })}`,
18
19
  });
19
20
  },
20
- async replay(input, idempotencyKey = randomIdempotencyKey()) {
21
+ replay(input, idempotencyKey = randomIdempotencyKey()) {
21
22
  return gateway.request({
22
23
  path: "/v1/events/replay",
23
24
  method: "POST",
@@ -30,7 +31,7 @@ export function createEventsClientCore(config = {}) {
30
31
  export function createWebhooksClientCore(config = {}) {
31
32
  const gateway = createGatewayRequestClient(config);
32
33
  return {
33
- async create(input, idempotencyKey = randomIdempotencyKey()) {
34
+ create(input, idempotencyKey = randomIdempotencyKey()) {
34
35
  return gateway.request({
35
36
  path: "/v1/webhooks",
36
37
  method: "POST",
@@ -38,19 +39,19 @@ export function createWebhooksClientCore(config = {}) {
38
39
  idempotencyKey,
39
40
  });
40
41
  },
41
- async list(query = {}) {
42
+ list(query = {}) {
42
43
  return gateway.request({
43
44
  path: `/v1/webhooks${toQueryString({
44
45
  topicId: query.topicId,
45
46
  })}`,
46
47
  });
47
48
  },
48
- async get(id) {
49
+ get(id) {
49
50
  return gateway.request({
50
51
  path: `/v1/webhooks/${encodeURIComponent(id)}`,
51
52
  });
52
53
  },
53
- async update(id, input, idempotencyKey = randomIdempotencyKey()) {
54
+ update(id, input, idempotencyKey = randomIdempotencyKey()) {
54
55
  return gateway.request({
55
56
  path: `/v1/webhooks/${encodeURIComponent(id)}`,
56
57
  method: "PATCH",
@@ -58,14 +59,14 @@ export function createWebhooksClientCore(config = {}) {
58
59
  idempotencyKey,
59
60
  });
60
61
  },
61
- async delete(id, idempotencyKey = randomIdempotencyKey()) {
62
+ delete(id, idempotencyKey = randomIdempotencyKey()) {
62
63
  return gateway.request({
63
64
  path: `/v1/webhooks/${encodeURIComponent(id)}`,
64
65
  method: "DELETE",
65
66
  idempotencyKey,
66
67
  });
67
68
  },
68
- async test(id, input = {}, idempotencyKey = randomIdempotencyKey()) {
69
+ test(id, input = {}, idempotencyKey = randomIdempotencyKey()) {
69
70
  return gateway.request({
70
71
  path: `/v1/webhooks/${encodeURIComponent(id)}/test`,
71
72
  method: "POST",
@@ -73,14 +74,14 @@ export function createWebhooksClientCore(config = {}) {
73
74
  idempotencyKey,
74
75
  });
75
76
  },
76
- async deliveries(id, query = {}) {
77
+ deliveries(id, query = {}) {
77
78
  return gateway.request({
78
79
  path: `/v1/webhooks/${encodeURIComponent(id)}/deliveries${toQueryString({
79
80
  limit: query.limit,
80
81
  })}`,
81
82
  });
82
83
  },
83
- async health(id) {
84
+ health(id) {
84
85
  return gateway.request({
85
86
  path: `/v1/webhooks/${encodeURIComponent(id)}/health`,
86
87
  });
@@ -4,14 +4,14 @@ export * as toolSchemas from "@lucern/contracts/tool-contracts";
4
4
  export type EvidenceClientConfig = LucernClientConfig;
5
5
  export type EvidenceClient = ReturnType<typeof createEvidenceClient>;
6
6
  export declare function createEvidenceClient(config?: EvidenceClientConfig): {
7
- createEvidence: (args: import("../clientEvidenceCompat").EvidenceCompatInput) => any;
8
- getEvidence: (evidenceId: string) => any;
7
+ createEvidence: (args: import("../client-evidence-compat").EvidenceCompatInput) => Promise<import("../client-config").GatewayDataEnvelope<Record<string, unknown>>>;
8
+ getEvidence: (evidenceId: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
9
9
  listEvidence: (args: {
10
10
  topicId?: string;
11
11
  targetId?: string;
12
12
  limit?: number;
13
13
  cursor?: string;
14
- }) => any;
14
+ }) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayList>>;
15
15
  searchEvidence: (args: {
16
16
  q?: string;
17
17
  query?: string;
@@ -20,7 +20,7 @@ export declare function createEvidenceClient(config?: EvidenceClientConfig): {
20
20
  methodology?: string;
21
21
  limit?: number;
22
22
  cursor?: string;
23
- }) => any;
23
+ }) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayList>>;
24
24
  linkEvidence: (args: {
25
25
  evidenceId: string;
26
26
  targetId?: string;
@@ -31,19 +31,19 @@ export declare function createEvidenceClient(config?: EvidenceClientConfig): {
31
31
  evidenceRelation?: "supports" | "contradicts";
32
32
  confidence?: number;
33
33
  rationale?: string;
34
- }) => any;
35
- classifyEvidence: (beliefId: string, evidenceId: string, config?: Parameters<any>[2], idempotencyKey?: string) => any;
36
- classifyEvidenceBatch: (beliefId: string, evidence: Parameters<any>[1], config?: Parameters<any>[2], idempotencyKey?: string) => any;
34
+ }) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").EvidenceLinkResult>>;
35
+ classifyEvidence: (beliefId: string, evidenceId: string, config?: Parameters<(beliefId: string, evidenceId: string, classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceResult>>>[2], idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<import("..").ClassifyEvidenceResult>>;
36
+ classifyEvidenceBatch: (beliefId: string, evidence: Parameters<(beliefId: string, evidence: import("..").ClassifyEvidenceBatchItem[], classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceBatchResult>>>[1], config?: Parameters<(beliefId: string, evidence: import("..").ClassifyEvidenceBatchItem[], classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceBatchResult>>>[2], idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<import("..").ClassifyEvidenceBatchResult>>;
37
37
  raw: {
38
- create(args: import("../clientEvidenceCompat").EvidenceCompatInput): any;
39
- add: any;
40
- get(evidenceId: string): any;
38
+ create(args: import("../client-evidence-compat").EvidenceCompatInput): Promise<import("../client-config").GatewayDataEnvelope<Record<string, unknown>>>;
39
+ add: (args_0: import("../client-evidence-compat").EvidenceCompatInput) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
40
+ get(evidenceId: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
41
41
  list(args: {
42
42
  topicId?: string;
43
43
  targetId?: string;
44
44
  limit?: number;
45
45
  cursor?: string;
46
- }): any;
46
+ }): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayList>>;
47
47
  search(args: {
48
48
  q?: string;
49
49
  query?: string;
@@ -52,7 +52,7 @@ export declare function createEvidenceClient(config?: EvidenceClientConfig): {
52
52
  methodology?: string;
53
53
  limit?: number;
54
54
  cursor?: string;
55
- }): any;
55
+ }): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayList>>;
56
56
  link(args: {
57
57
  evidenceId: string;
58
58
  targetId?: string;
@@ -63,7 +63,7 @@ export declare function createEvidenceClient(config?: EvidenceClientConfig): {
63
63
  evidenceRelation?: "supports" | "contradicts";
64
64
  confidence?: number;
65
65
  rationale?: string;
66
- }): any;
66
+ }): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").EvidenceLinkResult>>;
67
67
  linkToBelief(args: {
68
68
  evidenceId: string;
69
69
  beliefId: string;
@@ -71,14 +71,16 @@ export declare function createEvidenceClient(config?: EvidenceClientConfig): {
71
71
  evidenceRelation?: "supports" | "contradicts";
72
72
  confidence?: number;
73
73
  rationale?: string;
74
- }): any;
75
- classifyEvidence(beliefId: string, evidenceId: string, config?: Parameters<any>[2], idempotencyKey?: string): any;
76
- classifyEvidenceBatch(beliefId: string, evidence: Parameters<any>[1], config?: Parameters<any>[2], idempotencyKey?: string): any;
77
- updateStatus(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
78
- update(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
79
- flagIncorrect(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
80
- remove(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
81
- updateVerificationStatus(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: string): any;
74
+ }): Promise<{
75
+ beliefId: string;
76
+ }>;
77
+ classifyEvidence(beliefId: string, evidenceId: string, config?: Parameters<(beliefId: string, evidenceId: string, classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceResult>>>[2], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("..").ClassifyEvidenceResult>>;
78
+ classifyEvidenceBatch(beliefId: string, evidence: Parameters<(beliefId: string, evidence: import("..").ClassifyEvidenceBatchItem[], classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceBatchResult>>>[1], config?: Parameters<(beliefId: string, evidence: import("..").ClassifyEvidenceBatchItem[], classificationConfig?: import("..").EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ClassifyEvidenceBatchResult>>>[2], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("..").ClassifyEvidenceBatchResult>>;
79
+ updateStatus(input: Parameters<(input: import("../gatewayFacades").GatewayRecord, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
80
+ update(input: Parameters<(input: import("../gatewayFacades").GatewayRecord, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
81
+ flagIncorrect(input: Parameters<(input: import("../gatewayFacades").GatewayRecord, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
82
+ remove(input: Parameters<(input: import("../gatewayFacades").GatewayRecord, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
83
+ updateVerificationStatus(input: Parameters<(input: import("../gatewayFacades").GatewayRecord, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
82
84
  };
83
85
  };
84
86
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,4 @@
1
+ // biome-ignore-all lint/performance/noBarrelFile: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the facade/barrel export is intentional.
1
2
  import { createLucernClient } from "../client.js";
2
3
  export * as evidenceContracts from "@lucern/contracts/evidence/v1";
3
4
  export * as toolSchemas from "@lucern/contracts/tool-contracts";
@@ -1,15 +1,15 @@
1
1
  import { type GatewayClientConfig } from "./coreClient";
2
2
  type EvidenceClassificationRelation = "supports" | "contradicts" | "irrelevant";
3
- type ModelFallbackConfig = {
4
- modelKey: string;
3
+ interface ModelFallbackConfig {
4
+ maxTokens: number;
5
5
  modelId: string;
6
+ modelKey: string;
6
7
  temperature: number;
7
- maxTokens: number;
8
- };
8
+ }
9
9
  type ResolvedModelConfig = ModelFallbackConfig & {
10
10
  promptName: string;
11
11
  };
12
- type TracingAdapter = {
12
+ interface TracingAdapter {
13
13
  startGeneration(input: {
14
14
  name: string;
15
15
  userId?: string;
@@ -21,7 +21,7 @@ type TracingAdapter = {
21
21
  end: (output: unknown) => Promise<void>;
22
22
  error: (err: unknown) => Promise<void>;
23
23
  }>;
24
- };
24
+ }
25
25
  type PromptResolver = (name: string) => Promise<string | null>;
26
26
  type ModelResolver = (slotKey: string, fallback: ResolvedModelConfig) => Promise<ResolvedModelConfig>;
27
27
  type ClassificationRuntimeAdapter = (input: {
@@ -35,20 +35,20 @@ type ClassificationRuntimeAdapter = (input: {
35
35
  relation: EvidenceClassificationRelation;
36
36
  rationale: string;
37
37
  }>;
38
- export type SerializableClassifyEvidenceConfig = {
39
- promptName?: string;
40
- modelSlotKey?: string;
41
- modelFallback?: ModelFallbackConfig;
38
+ export interface SerializableClassifyEvidenceConfig {
42
39
  edgeWeightPolicy?: {
43
40
  supports: number;
44
41
  contradicts: number;
45
42
  };
43
+ modelFallback?: ModelFallbackConfig;
44
+ modelSlotKey?: string;
45
+ promptName?: string;
46
46
  statusTransition?: {
47
47
  onSupports: string;
48
48
  onContradicts: string;
49
49
  };
50
50
  writeLegacyTables?: boolean;
51
- };
51
+ }
52
52
  export type ClassifyEvidenceConfig = SerializableClassifyEvidenceConfig & {
53
53
  trustDiscountPolicy?: (relation: Exclude<EvidenceClassificationRelation, "irrelevant">, rationale: string) => number;
54
54
  tracing?: TracingAdapter;
@@ -56,41 +56,41 @@ export type ClassifyEvidenceConfig = SerializableClassifyEvidenceConfig & {
56
56
  modelResolver?: ModelResolver;
57
57
  classifier?: ClassificationRuntimeAdapter;
58
58
  };
59
- export type ClassifyEvidenceResult = {
59
+ export interface ClassifyEvidenceResult {
60
60
  beliefId: string;
61
- evidenceId: string;
62
- relation: EvidenceClassificationRelation;
63
- rationale: string;
64
- usedFallback: boolean;
65
61
  edgeWeight?: number;
66
- promptName: string;
67
- model: ResolvedModelConfig;
62
+ evidenceId: string;
68
63
  link?: {
69
64
  edgeGlobalId: string;
70
65
  linkId?: string;
71
66
  confidence: number;
72
67
  writeLegacyTables: boolean;
73
68
  };
69
+ model: ResolvedModelConfig;
70
+ promptName: string;
71
+ rationale: string;
72
+ relation: EvidenceClassificationRelation;
74
73
  statusUpdate?: {
75
74
  previousStatus?: string;
76
75
  newStatus: string;
77
76
  historyWritten: boolean;
78
77
  };
79
- };
80
- export type ClassifyEvidenceBatchItem = {
78
+ usedFallback: boolean;
79
+ }
80
+ export interface ClassifyEvidenceBatchItem {
81
81
  evidenceId?: string;
82
82
  insightId?: string;
83
83
  nodeId?: string;
84
84
  text?: string;
85
- };
86
- export type ClassifyEvidenceBatchResult = {
85
+ }
86
+ export interface ClassifyEvidenceBatchResult {
87
87
  items: ClassifyEvidenceResult[];
88
88
  summary: {
89
89
  supporting: number;
90
90
  contradicting: number;
91
91
  irrelevant: number;
92
92
  };
93
- };
93
+ }
94
94
  export type { PlatformGatewaySuccess } from "./coreClient";
95
95
  /** Configuration for the evidence classification client. */
96
96
  export type EvidenceClientConfig = GatewayClientConfig;