@lucern/sdk 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/accessControl.d.ts +31 -31
  3. package/dist/accessControl.js +1 -0
  4. package/dist/adminClient.d.ts +74 -74
  5. package/dist/adminClient.js +38 -30
  6. package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
  7. package/dist/{answersClient.js → answers-client.js} +2 -2
  8. package/dist/audience/index.d.ts +12 -12
  9. package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
  10. package/dist/audiences-client.js +107 -0
  11. package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
  12. package/dist/{auditClient.js → audit-client.js} +8 -7
  13. package/dist/authContext.d.ts +26 -26
  14. package/dist/authDeviceClient.d.ts +11 -11
  15. package/dist/authDeviceClient.js +4 -6
  16. package/dist/beliefs/index.d.ts +56 -28
  17. package/dist/beliefs/index.js +2 -1
  18. package/dist/beliefsClient.d.ts +71 -63
  19. package/dist/beliefsClient.js +90 -67
  20. package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
  21. package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
  22. package/dist/client-assembly-types.d.ts +219 -0
  23. package/dist/client-assembly-types.js +2 -0
  24. package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
  25. package/dist/client-config.js +2 -0
  26. package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
  27. package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
  28. package/dist/client.d.ts +1906 -352
  29. package/dist/client.js +34 -30
  30. package/dist/clientGraphNamespaces.d.ts +35 -25
  31. package/dist/clientGraphNamespaces.js +11 -5
  32. package/dist/clientHelpers.js +8 -5
  33. package/dist/clientKnowledgeNamespaces.d.ts +124 -84
  34. package/dist/clientKnowledgeNamespaces.js +35 -34
  35. package/dist/clientLocalHelpers.d.ts +81 -52
  36. package/dist/clientLocalHelpers.js +193 -43
  37. package/dist/clientPlatformNamespaces.d.ts +1541 -150
  38. package/dist/clientPlatformNamespaces.js +10 -5
  39. package/dist/clientRuntime.d.ts +1 -1
  40. package/dist/clientRuntime.js +1 -1
  41. package/dist/clientWorkflowNamespaces.d.ts +211 -97
  42. package/dist/clientWorkflowNamespaces.js +22 -19
  43. package/dist/contextClient.d.ts +2 -2
  44. package/dist/contextClient.js +79 -50
  45. package/dist/contextFacade.d.ts +1 -1
  46. package/dist/contextFacade.js +2 -0
  47. package/dist/contextPackCompiler.d.ts +52 -52
  48. package/dist/contextPackCompiler.js +192 -122
  49. package/dist/contextPackPolicy.d.ts +22 -22
  50. package/dist/contextPackPolicy.js +21 -9
  51. package/dist/contextPackSchema.d.ts +3 -3
  52. package/dist/contextPackSchema.js +1 -0
  53. package/dist/contextTypes.d.ts +155 -155
  54. package/dist/contracts/api-enums.contract.js +2 -11
  55. package/dist/contracts/auth-session.contract.d.ts +16 -16
  56. package/dist/contracts/auth-session.contract.js +3 -2
  57. package/dist/contracts/context-pack.contract.d.ts +216 -216
  58. package/dist/contracts/contextPack.js +2 -0
  59. package/dist/contracts/index.d.ts +1 -1
  60. package/dist/contracts/index.js +2 -1
  61. package/dist/contracts/lens-filter.contract.d.ts +8 -8
  62. package/dist/contracts/lens-filter.contract.js +10 -10
  63. package/dist/contracts/lens-workflow.contract.d.ts +32 -32
  64. package/dist/contracts/lens-workflow.contract.js +2 -1
  65. package/dist/contracts/lensFilter.js +2 -0
  66. package/dist/contracts/lensWorkflow.js +2 -0
  67. package/dist/contracts/mcpTools.d.ts +19 -19
  68. package/dist/contracts/mcpTools.js +3 -1
  69. package/dist/contracts/prompt.contract.d.ts +12 -12
  70. package/dist/contracts/prompt.js +1 -0
  71. package/dist/contracts/sdk-tools.contract.js +1 -0
  72. package/dist/contracts/sdkTools.js +2 -0
  73. package/dist/contracts/tool-contracts.js +1 -0
  74. package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
  75. package/dist/contracts/workflow-runtime.contract.js +1 -5
  76. package/dist/contracts/workflowRuntime.js +2 -0
  77. package/dist/contradictions/index.d.ts +8 -8
  78. package/dist/contradictions/index.js +1 -0
  79. package/dist/control-plane.d.ts +10 -10
  80. package/dist/control-plane.js +2 -2
  81. package/dist/controlObjectOwnership.d.ts +11 -11
  82. package/dist/controlObjectOwnership.js +1 -0
  83. package/dist/coreClient.d.ts +51 -51
  84. package/dist/coreClient.js +269 -101
  85. package/dist/customTools.d.ts +19 -19
  86. package/dist/customTools.js +4 -2
  87. package/dist/decisions/index.d.ts +18 -18
  88. package/dist/decisions/index.js +1 -0
  89. package/dist/decisionsClient.d.ts +4 -4
  90. package/dist/decisionsClient.js +36 -27
  91. package/dist/edges/index.d.ts +20 -18
  92. package/dist/edges/index.js +1 -0
  93. package/dist/embeddingsClient.d.ts +29 -29
  94. package/dist/embeddingsClient.js +15 -8
  95. package/dist/eventingClient.d.ts +27 -27
  96. package/dist/eventingClient.js +10 -5
  97. package/dist/events.d.ts +83 -83
  98. package/dist/events.js +19 -15
  99. package/dist/eventsCore.d.ts +7 -7
  100. package/dist/eventsCore.js +11 -10
  101. package/dist/evidence/index.d.ts +23 -21
  102. package/dist/evidence/index.js +1 -0
  103. package/dist/evidenceClient.d.ts +23 -23
  104. package/dist/evidenceClient.js +10 -6
  105. package/dist/facade/context.d.ts +9 -9
  106. package/dist/facade/context.js +67 -41
  107. package/dist/functionSurface.js +2 -0
  108. package/dist/functionSurfaceClient.js +2 -0
  109. package/dist/gatewayFacades.d.ts +215 -215
  110. package/dist/gatewayFacades.factories.d.ts +23 -44
  111. package/dist/gatewayFacades.factories.js +63 -62
  112. package/dist/gatewayFacades.js +31 -32
  113. package/dist/graphAnalysisClient.d.ts +60 -60
  114. package/dist/graphAnalysisClient.js +19 -18
  115. package/dist/graphClient.d.ts +34 -34
  116. package/dist/graphClient.js +56 -35
  117. package/dist/graphIntel.js +2 -0
  118. package/dist/graphIntelligence.d.ts +2 -2
  119. package/dist/graphIntelligence.js +1 -1
  120. package/dist/graphRecommendationsClient.d.ts +24 -24
  121. package/dist/graphRecommendationsClient.js +12 -7
  122. package/dist/graphStateClassifierClient.d.ts +13 -13
  123. package/dist/graphStateClassifierClient.js +10 -5
  124. package/dist/harnessClient.d.ts +61 -61
  125. package/dist/harnessClient.js +44 -31
  126. package/dist/identityClient.d.ts +33 -59
  127. package/dist/identityClient.js +126 -98
  128. package/dist/index.d.ts +20 -20
  129. package/dist/index.js +20 -19
  130. package/dist/infisicalRuntime.d.ts +11 -11
  131. package/dist/infisicalRuntime.js +20 -14
  132. package/dist/jobsClient.d.ts +28 -28
  133. package/dist/jobsClient.js +6 -3
  134. package/dist/learningClient.js +13 -8
  135. package/dist/lenses/index.d.ts +124 -28
  136. package/dist/lenses/index.js +1 -0
  137. package/dist/mcpClient.d.ts +1 -1
  138. package/dist/mcpClient.js +3 -3
  139. package/dist/modelRuntimeClient.d.ts +27 -27
  140. package/dist/modelRuntimeClient.js +10 -5
  141. package/dist/nodes/index.d.ts +9 -9
  142. package/dist/nodes/index.js +1 -0
  143. package/dist/ontologies/index.d.ts +68 -22
  144. package/dist/ontologies/index.js +1 -0
  145. package/dist/ontologyClient.js +24 -17
  146. package/dist/ontologyLinksClient.d.ts +35 -35
  147. package/dist/ontologyLinksClient.js +9 -6
  148. package/dist/opinion.d.ts +3 -3
  149. package/dist/opinion.js +12 -5
  150. package/dist/orgGraphSearchClient.d.ts +39 -39
  151. package/dist/orgGraphSearchClient.js +22 -13
  152. package/dist/packsClient.d.ts +1 -1
  153. package/dist/packsClient.js +28 -19
  154. package/dist/policyClient.d.ts +79 -68
  155. package/dist/policyClient.js +18 -12
  156. package/dist/proof-attestation.json +1 -1
  157. package/dist/questions/index.d.ts +38 -27
  158. package/dist/questions/index.js +1 -0
  159. package/dist/realtime/index.d.ts +3 -3
  160. package/dist/realtime/index.js +1 -0
  161. package/dist/realtime/refs.d.ts +2 -2
  162. package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
  163. package/dist/{reportsClient.js → reports-client.js} +19 -13
  164. package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
  165. package/dist/{schemaClient.js → schema-client.js} +14 -11
  166. package/dist/sdkSurface.d.ts +12 -12
  167. package/dist/sdkSurface.js +14 -10
  168. package/dist/secrets.d.ts +1 -1
  169. package/dist/secrets.js +2 -1
  170. package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
  171. package/dist/{sourcesClient.js → sources-client.js} +4 -5
  172. package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
  173. package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
  174. package/dist/toolRegistryClient.d.ts +46 -46
  175. package/dist/toolRegistryClient.js +22 -11
  176. package/dist/topics/index.d.ts +23 -23
  177. package/dist/topics/index.js +2 -1
  178. package/dist/topicsClient.d.ts +6 -6
  179. package/dist/topicsClient.js +29 -18
  180. package/dist/types.d.ts +356 -355
  181. package/dist/version.d.ts +1 -1
  182. package/dist/version.js +1 -1
  183. package/dist/workflowClient.d.ts +36 -35
  184. package/dist/workflowClient.js +88 -60
  185. package/dist/worktrees/index.d.ts +118 -32
  186. package/dist/worktrees/index.js +2 -1
  187. package/package.json +45 -5
  188. package/dist/audiencesClient.js +0 -115
  189. package/dist/clientAssemblyTypes.d.ts +0 -33
  190. package/dist/clientAssemblyTypes.js +0 -2
  191. package/dist/clientConfig.js +0 -2
@@ -2,53 +2,53 @@ import { type GatewayClientConfig } from "./coreClient";
2
2
  import type { JsonObject, ListResult } from "./types";
3
3
  export type ModelRuntimeClientConfig = GatewayClientConfig;
4
4
  export declare const MODEL_RUNTIME_FIELDS: readonly ["tenantId", "workspaceId", "principalId", "functionName", "slotKey", "modelId", "provider", "routingPolicy", "metadata", "limit", "cursor"];
5
- export type ModelRegistryRecord = {
6
- modelId: string;
7
- provider: string;
8
- displayName?: string;
9
- status?: string;
5
+ export interface ModelRegistryRecord {
10
6
  capabilities?: string[];
11
7
  contextWindow?: number;
12
- routingPolicy?: JsonObject | null;
13
- metadata?: JsonObject | null;
14
8
  createdAt?: number;
9
+ displayName?: string;
10
+ metadata?: JsonObject | null;
11
+ modelId: string;
12
+ provider: string;
13
+ routingPolicy?: JsonObject | null;
14
+ status?: string;
15
15
  updatedAt?: number;
16
- };
17
- export type ModelFunctionSlot = {
16
+ }
17
+ export interface ModelFunctionSlot {
18
18
  functionName: string;
19
- slotKey: string;
19
+ metadata?: JsonObject | null;
20
20
  modelId?: string;
21
21
  provider?: string;
22
22
  routingPolicy?: JsonObject | null;
23
- metadata?: JsonObject | null;
24
- };
25
- export type ModelRuntimeScope = {
26
- tenantId: string;
27
- workspaceId?: string;
23
+ slotKey: string;
24
+ }
25
+ export interface ModelRuntimeScope {
26
+ cursor?: string;
27
+ limit?: number;
28
28
  principalId?: string;
29
29
  provider?: string;
30
- limit?: number;
31
- cursor?: string;
32
- };
33
- export type ResolveModelSlotInput = {
34
30
  tenantId: string;
35
31
  workspaceId?: string;
36
- principalId?: string;
32
+ }
33
+ export interface ResolveModelSlotInput {
37
34
  functionName: string;
38
- slotKey?: string;
39
35
  metadata?: JsonObject;
40
- };
41
- export type UpdateModelSlotConfigInput = {
36
+ principalId?: string;
37
+ slotKey?: string;
42
38
  tenantId: string;
43
39
  workspaceId?: string;
44
- principalId?: string;
40
+ }
41
+ export interface UpdateModelSlotConfigInput {
45
42
  functionName: string;
46
- slotKey: string;
43
+ metadata?: JsonObject;
47
44
  modelId: string;
45
+ principalId?: string;
48
46
  provider?: string;
49
47
  routingPolicy?: JsonObject;
50
- metadata?: JsonObject;
51
- };
48
+ slotKey: string;
49
+ tenantId: string;
50
+ workspaceId?: string;
51
+ }
52
52
  export type ModelsResponse = ListResult<ModelRegistryRecord, "models">;
53
53
  export type ModelSlotsResponse = ListResult<ModelFunctionSlot, "slots">;
54
54
  export declare function createModelRuntimeClient(config?: ModelRuntimeClientConfig): {
@@ -1,5 +1,6 @@
1
+ // biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
2
+ import { cleanRequiredString, knownPayload, listResultFromEnvelope, } from "./boundary-client-surface.js";
1
3
  import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { cleanRequiredString, knownPayload, listResultFromEnvelope, } from "./boundaryClientSurface.js";
3
4
  import { mapGatewayData } from "./sdkSurface.js";
4
5
  export const MODEL_RUNTIME_FIELDS = [
5
6
  "tenantId",
@@ -31,9 +32,11 @@ export function createModelRuntimeClient(config = {}) {
31
32
  const gateway = createGatewayRequestClient(config);
32
33
  return {
33
34
  listModels(input) {
34
- return gateway.request({
35
+ return gateway
36
+ .request({
35
37
  path: `/api/platform/v1/model-runtime/models${toQueryString(scopeQuery(input))}`,
36
- }).then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "models")));
38
+ })
39
+ .then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "models")));
37
40
  },
38
41
  getModel(input) {
39
42
  cleanRequiredString(input.tenantId, "tenantId");
@@ -47,12 +50,14 @@ export function createModelRuntimeClient(config = {}) {
47
50
  });
48
51
  },
49
52
  listFunctionSlots(input) {
50
- return gateway.request({
53
+ return gateway
54
+ .request({
51
55
  path: `/api/platform/v1/model-runtime/function-slots${toQueryString({
52
56
  ...scopeQuery(input),
53
57
  functionName: input.functionName,
54
58
  })}`,
55
- }).then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "slots")));
59
+ })
60
+ .then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "slots")));
56
61
  },
57
62
  resolveSlot(input, idempotencyKey) {
58
63
  cleanRequiredString(input.tenantId, "tenantId");
@@ -4,14 +4,14 @@ export * as methodSchemas from "@lucern/contracts/sdk-methods.contract";
4
4
  export type NodesClientConfig = LucernClientConfig;
5
5
  export type NodesClient = ReturnType<typeof createNodesClient>;
6
6
  export declare function createNodesClient(config?: NodesClientConfig): {
7
- createNode: any;
8
- getNode: any;
9
- listNodes: any;
10
- updateNode: any;
11
- batchCreateNodes: any;
12
- supersedeNode: any;
13
- verifyNode: any;
14
- hardDeleteNode: any;
15
- raw: Record<string, any>;
7
+ createNode: (input: import("..").FunctionSurfaceInput, idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<unknown>>;
8
+ getNode: (input: string | Parameters<import("../client-assembly-types").ClientGraphClient["getNode"]>[0]) => ReturnType<import("../client-assembly-types").ClientGraphClient["getNode"]>;
9
+ listNodes: (query: import("..").ListNodesInput) => Promise<import("..").PlatformGatewaySuccess<import("..").ListResult<import("..").PlatformGraphNode, "nodes">>>;
10
+ updateNode: (input: import("..").FunctionSurfaceInput, idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<unknown>>;
11
+ batchCreateNodes: (input: import("..").FunctionSurfaceInput, idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<unknown>>;
12
+ supersedeNode: (input: import("..").FunctionSurfaceInput, idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<unknown>>;
13
+ verifyNode: (input: import("..").FunctionSurfaceInput, idempotencyKey?: string) => Promise<import("../client-config").GatewayDataEnvelope<unknown>>;
14
+ hardDeleteNode: (input: import("..").HardDeleteNodeInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>>>;
15
+ raw: import("../client-assembly-types").ClientNodesNamespace;
16
16
  };
17
17
  //# 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 graphContracts from "@lucern/contracts/graph/v1";
3
4
  export * as methodSchemas from "@lucern/contracts/sdk-methods.contract";
@@ -5,37 +5,83 @@ export * as toolSchemas from "@lucern/contracts/tool-contracts";
5
5
  export type OntologiesClientConfig = LucernClientConfig;
6
6
  export type OntologiesClient = ReturnType<typeof createOntologiesClient>;
7
7
  export declare function createOntologiesClient(config?: OntologiesClientConfig): {
8
- createOntology: (input: import("..").FunctionSurfaceInput) => any;
9
- getOntology: (ontologyId: string) => any;
8
+ createOntology: (input: import("..").FunctionSurfaceInput) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
9
+ getOntology: (ontologyId: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
10
10
  listOntologies: (input?: {
11
11
  tenantId?: string;
12
12
  tier?: string;
13
13
  status?: string;
14
- }) => any;
15
- bindOntology: (input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: Parameters<(...args: any[]) => any>[1]) => any;
16
- matchOntology: (input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: Parameters<(...args: any[]) => any>[1]) => any;
17
- updateOntology: (input: import("..").FunctionSurfaceInput) => any;
18
- archiveOntology: (input: import("..").FunctionSurfaceInput) => any;
14
+ }) => Promise<import("../client-config").GatewayDataEnvelope<{
15
+ ontologies: unknown[];
16
+ total: number;
17
+ items: unknown[];
18
+ definitions: unknown[];
19
+ }>>;
20
+ bindOntology: (input: Parameters<(input: import("..").OntologyBindingInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: Parameters<(input: import("..").OntologyBindingInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
21
+ matchOntology: (input: Parameters<(input: import("../gatewayFacades").OntologyMatchInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: Parameters<(input: import("../gatewayFacades").OntologyMatchInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
22
+ updateOntology: (input: import("..").FunctionSurfaceInput) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
23
+ archiveOntology: (input: import("..").FunctionSurfaceInput) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
19
24
  raw: {
20
25
  list(input?: {
21
26
  tenantId?: string;
22
27
  tier?: string;
23
28
  status?: string;
24
- }): any;
25
- get(ontologyId: string): any;
26
- bind(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: Parameters<(...args: any[]) => any>[1]): any;
27
- match(input: Parameters<(...args: any[]) => any>[0], idempotencyKey?: Parameters<(...args: any[]) => any>[1]): any;
28
- create(input: import("..").FunctionSurfaceInput): any;
29
- update(input: import("..").FunctionSurfaceInput): any;
30
- archive(input: import("..").FunctionSurfaceInput): any;
31
- createVersion(input: import("..").FunctionSurfaceInput): any;
32
- publishVersion(input: import("..").FunctionSurfaceInput): any;
33
- publishOntologyVersion(input: import("..").FunctionSurfaceInput): any;
34
- deprecateVersion(input: import("..").FunctionSurfaceInput): any;
35
- deprecateOntologyVersion(input: import("..").FunctionSurfaceInput): any;
36
- resolveEffective(input: import("..").FunctionSurfaceInput): any;
37
- resolveEffectiveOntology(input: import("..").FunctionSurfaceInput): any;
38
- raw: any;
29
+ }): Promise<import("../client-config").GatewayDataEnvelope<{
30
+ ontologies: unknown[];
31
+ total: number;
32
+ items: unknown[];
33
+ definitions: unknown[];
34
+ }>>;
35
+ get(ontologyId: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
36
+ bind(input: Parameters<(input: import("..").OntologyBindingInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: Parameters<(input: import("..").OntologyBindingInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
37
+ match(input: Parameters<(input: import("../gatewayFacades").OntologyMatchInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: Parameters<(input: import("../gatewayFacades").OntologyMatchInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
38
+ create(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
39
+ update(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
40
+ archive(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
41
+ createVersion(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
42
+ publishVersion(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
43
+ publishOntologyVersion(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
44
+ deprecateVersion(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
45
+ deprecateOntologyVersion(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
46
+ resolveEffective(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
47
+ resolveEffectiveOntology(input: import("..").FunctionSurfaceInput): Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
48
+ raw: {
49
+ list(filters?: import("..").GatewayScope & {
50
+ tenantId?: string;
51
+ tier?: string;
52
+ status?: string;
53
+ }): Promise<import("..").PlatformGatewaySuccess<{
54
+ ontologies: unknown[];
55
+ total: number;
56
+ items: unknown[];
57
+ definitions: unknown[];
58
+ }>>;
59
+ get(id: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
60
+ bind(input: import("..").OntologyBindingInput, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
61
+ createDefinition(input: import("..").OntologyDefinitionInput, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
62
+ updateDefinition(id: string, input: import("..").OntologyDefinitionUpdateInput, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
63
+ archiveDefinition(id: string, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
64
+ listVersions(ontologyId: string, filters?: import("..").GatewayScope & {
65
+ status?: string;
66
+ }): Promise<import("..").PlatformGatewaySuccess<import("..").ListResult<unknown, "versions">>>;
67
+ createVersion(ontologyId: string, input: import("..").OntologyVersionInput, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
68
+ publishVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
69
+ deprecateVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<import("..").PlatformGatewaySuccess<unknown>>;
70
+ listTopics(ontologyId: string): Promise<import("..").PlatformGatewaySuccess<import("..").ListResult<any, "topics">>>;
71
+ } & {
72
+ listDefinitions: (filters?: import("..").GatewayScope & {
73
+ tenantId?: string;
74
+ tier?: string;
75
+ status?: string;
76
+ }) => Promise<import("..").PlatformGatewaySuccess<{
77
+ ontologies: unknown[];
78
+ total: number;
79
+ items: unknown[];
80
+ definitions: unknown[];
81
+ }>>;
82
+ getDefinition: (id: string) => Promise<import("..").PlatformGatewaySuccess<unknown>>;
83
+ listTopicsByOntology: (ontologyId: string) => Promise<import("..").PlatformGatewaySuccess<import("..").ListResult<any, "topics">>>;
84
+ };
39
85
  };
40
86
  };
41
87
  //# 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 ontologiesContracts from "@lucern/contracts/ontologies/v1";
3
4
  export * as ontologyMatchingContracts from "@lucern/contracts/ontology-matching.contract";
@@ -1,5 +1,6 @@
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
- import { asListItems, asRecord, createListResult, mapGatewayData } from "./sdkSurface.js";
3
+ import { asListItems, asRecord, createListResult, mapGatewayData, } from "./sdkSurface.js";
3
4
  /**
4
5
  * Create the ontology client for ontology definitions and versions.
5
6
  * @param config - Gateway transport configuration.
@@ -11,7 +12,7 @@ export function createOntologyClient(config = {}) {
11
12
  /**
12
13
  * List ontology definitions matching optional filters.
13
14
  */
14
- async list(filters = {}) {
15
+ list(filters = {}) {
15
16
  return gateway
16
17
  .request({
17
18
  path: `/api/platform/v1/ontologies${toQueryString(filters)}`,
@@ -19,7 +20,9 @@ export function createOntologyClient(config = {}) {
19
20
  .then((response) => mapGatewayData(response, (data) => {
20
21
  const record = asRecord(data);
21
22
  const ontologies = asListItems(data, "ontologies");
22
- const definitions = ontologies.length > 0 ? ontologies : asListItems(data, "definitions");
23
+ const definitions = ontologies.length > 0
24
+ ? ontologies
25
+ : asListItems(data, "definitions");
23
26
  const total = typeof record.total === "number" && Number.isFinite(record.total)
24
27
  ? record.total
25
28
  : definitions.length;
@@ -34,7 +37,7 @@ export function createOntologyClient(config = {}) {
34
37
  /**
35
38
  * Get an ontology definition by identifier.
36
39
  */
37
- async get(id) {
40
+ get(id) {
38
41
  return gateway.request({
39
42
  path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
40
43
  });
@@ -42,7 +45,7 @@ export function createOntologyClient(config = {}) {
42
45
  /**
43
46
  * Bind an ontology definition to a topic.
44
47
  */
45
- async bind(input, idempotencyKey) {
48
+ bind(input, idempotencyKey) {
46
49
  return gateway.request({
47
50
  path: `/api/platform/v1/ontologies/${encodeURIComponent(input.ontologyId)}/bind`,
48
51
  method: "POST",
@@ -55,7 +58,7 @@ export function createOntologyClient(config = {}) {
55
58
  /**
56
59
  * Create an ontology definition.
57
60
  */
58
- async createDefinition(input, idempotencyKey) {
61
+ createDefinition(input, idempotencyKey) {
59
62
  return gateway.request({
60
63
  path: "/api/platform/v1/ontologies",
61
64
  method: "POST",
@@ -66,7 +69,7 @@ export function createOntologyClient(config = {}) {
66
69
  /**
67
70
  * Update an ontology definition.
68
71
  */
69
- async updateDefinition(id, input, idempotencyKey) {
72
+ updateDefinition(id, input, idempotencyKey) {
70
73
  return gateway.request({
71
74
  path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
72
75
  method: "PATCH",
@@ -77,7 +80,7 @@ export function createOntologyClient(config = {}) {
77
80
  /**
78
81
  * Archive an ontology definition.
79
82
  */
80
- async archiveDefinition(id, idempotencyKey) {
83
+ archiveDefinition(id, idempotencyKey) {
81
84
  return gateway.request({
82
85
  path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
83
86
  method: "DELETE",
@@ -87,15 +90,17 @@ export function createOntologyClient(config = {}) {
87
90
  /**
88
91
  * List versions for an ontology definition.
89
92
  */
90
- async listVersions(ontologyId, filters = {}) {
91
- return gateway.request({
93
+ listVersions(ontologyId, filters = {}) {
94
+ return gateway
95
+ .request({
92
96
  path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions${toQueryString(filters)}`,
93
- }).then((response) => mapGatewayData(response, (data) => createListResult(asListItems(data, "versions"), "versions")));
97
+ })
98
+ .then((response) => mapGatewayData(response, (data) => createListResult(asListItems(data, "versions"), "versions")));
94
99
  },
95
100
  /**
96
101
  * Create an ontology version.
97
102
  */
98
- async createVersion(ontologyId, input, idempotencyKey) {
103
+ createVersion(ontologyId, input, idempotencyKey) {
99
104
  return gateway.request({
100
105
  path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions`,
101
106
  method: "POST",
@@ -106,7 +111,7 @@ export function createOntologyClient(config = {}) {
106
111
  /**
107
112
  * Publish an ontology version.
108
113
  */
109
- async publishVersion(ontologyId, versionId, idempotencyKey) {
114
+ publishVersion(ontologyId, versionId, idempotencyKey) {
110
115
  return gateway.request({
111
116
  path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/publish`,
112
117
  method: "POST",
@@ -116,7 +121,7 @@ export function createOntologyClient(config = {}) {
116
121
  /**
117
122
  * Deprecate an ontology version.
118
123
  */
119
- async deprecateVersion(ontologyId, versionId, idempotencyKey) {
124
+ deprecateVersion(ontologyId, versionId, idempotencyKey) {
120
125
  return gateway.request({
121
126
  path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/deprecate`,
122
127
  method: "POST",
@@ -127,10 +132,12 @@ export function createOntologyClient(config = {}) {
127
132
  * List topics directly bound to a specific ontology definition.
128
133
  * Uses the topics gateway with ontologyId filter.
129
134
  */
130
- async listTopics(ontologyId) {
131
- return gateway.request({
135
+ listTopics(ontologyId) {
136
+ return gateway
137
+ .request({
132
138
  path: `/api/platform/v1/topics?ontologyId=${encodeURIComponent(ontologyId)}`,
133
- }).then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "topics")));
139
+ })
140
+ .then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "topics")));
134
141
  },
135
142
  };
136
143
  return Object.assign(client, {
@@ -3,57 +3,57 @@ import type { JsonObject, ListResult } from "./types";
3
3
  export type OntologyLinksClientConfig = GatewayClientConfig;
4
4
  export declare const ONTOLOGY_LINK_FIELDS: readonly ["topicId", "workspaceId", "linkId", "sourceNodeId", "sourceGlobalId", "targetNodeId", "targetGlobalId", "ontologyId", "ontologyType", "edgeType", "weight", "confidence", "status", "metadata"];
5
5
  export type OntologyLinkStatus = "active" | "candidate" | "dismissed" | "superseded" | "archived";
6
- export type OntologyLinkRecord = {
7
- linkId?: string;
6
+ export interface OntologyLinkRecord {
7
+ confidence?: number;
8
+ createdAt?: number;
8
9
  edgeId?: string;
9
- topicId?: string;
10
- workspaceId?: string;
11
- sourceNodeId?: string;
12
- sourceGlobalId?: string;
13
- targetNodeId?: string;
14
- targetGlobalId?: string;
10
+ edgeType: string;
11
+ linkId?: string;
12
+ metadata?: JsonObject | null;
15
13
  ontologyId: string;
16
14
  ontologyType?: string;
17
- edgeType: string;
18
- weight?: number;
19
- confidence?: number;
15
+ sourceGlobalId?: string;
16
+ sourceNodeId?: string;
20
17
  status?: OntologyLinkStatus | string;
21
- metadata?: JsonObject | null;
22
- createdAt?: number;
23
- updatedAt?: number;
24
- };
25
- export type OntologyLinkWriteInput = {
18
+ targetGlobalId?: string;
19
+ targetNodeId?: string;
26
20
  topicId?: string;
21
+ updatedAt?: number;
22
+ weight?: number;
27
23
  workspaceId?: string;
28
- sourceNodeId?: string;
29
- sourceGlobalId?: string;
30
- targetNodeId?: string;
31
- targetGlobalId?: string;
24
+ }
25
+ export interface OntologyLinkWriteInput {
26
+ confidence?: number;
27
+ edgeType: string;
28
+ metadata?: JsonObject;
32
29
  ontologyId: string;
33
30
  ontologyType?: string;
34
- edgeType: string;
35
- weight?: number;
36
- confidence?: number;
31
+ sourceGlobalId?: string;
32
+ sourceNodeId?: string;
37
33
  status?: OntologyLinkStatus;
38
- metadata?: JsonObject;
39
- };
40
- export type ListOntologyLinksForNodeInput = {
41
- nodeId?: string;
42
- globalId?: string;
34
+ targetGlobalId?: string;
35
+ targetNodeId?: string;
43
36
  topicId?: string;
37
+ weight?: number;
44
38
  workspaceId?: string;
39
+ }
40
+ export interface ListOntologyLinksForNodeInput {
41
+ cursor?: string;
42
+ edgeType?: string;
43
+ globalId?: string;
44
+ limit?: number;
45
+ nodeId?: string;
45
46
  ontologyId?: string;
46
47
  ontologyType?: string;
47
- edgeType?: string;
48
48
  status?: OntologyLinkStatus;
49
- limit?: number;
50
- cursor?: string;
51
- };
52
- export type UpdateOntologyLinkStatusInput = {
49
+ topicId?: string;
50
+ workspaceId?: string;
51
+ }
52
+ export interface UpdateOntologyLinkStatusInput {
53
53
  linkId: string;
54
- status: OntologyLinkStatus;
55
54
  metadata?: JsonObject;
56
- };
55
+ status: OntologyLinkStatus;
56
+ }
57
57
  export type OntologyLinksResponse = ListResult<OntologyLinkRecord, "links">;
58
58
  export declare function createOntologyLinksClient(config?: OntologyLinksClientConfig): {
59
59
  createLink(input: OntologyLinkWriteInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<OntologyLinkRecord>>;
@@ -1,5 +1,6 @@
1
+ // biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
2
+ import { cleanOptionalString, cleanRequiredString, knownPayload, listResultFromEnvelope, } from "./boundary-client-surface.js";
1
3
  import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
2
- import { cleanOptionalString, cleanRequiredString, knownPayload, listResultFromEnvelope, } from "./boundaryClientSurface.js";
3
4
  import { mapGatewayData } from "./sdkSurface.js";
4
5
  export const ONTOLOGY_LINK_FIELDS = [
5
6
  "topicId",
@@ -18,10 +19,10 @@ export const ONTOLOGY_LINK_FIELDS = [
18
19
  "metadata",
19
20
  ];
20
21
  function assertEndpoints(input) {
21
- if (!input.sourceNodeId && !input.sourceGlobalId) {
22
+ if (!(input.sourceNodeId || input.sourceGlobalId)) {
22
23
  throw new Error("sourceNodeId or sourceGlobalId is required");
23
24
  }
24
- if (!input.targetNodeId && !input.targetGlobalId) {
25
+ if (!(input.targetNodeId || input.targetGlobalId)) {
25
26
  throw new Error("targetNodeId or targetGlobalId is required");
26
27
  }
27
28
  }
@@ -53,11 +54,12 @@ export function createOntologyLinksClient(config = {}) {
53
54
  listLinksForNode(input) {
54
55
  const nodeId = cleanOptionalString(input.nodeId);
55
56
  const globalId = cleanOptionalString(input.globalId);
56
- if (!nodeId && !globalId) {
57
+ if (!(nodeId || globalId)) {
57
58
  throw new Error("nodeId or globalId is required");
58
59
  }
59
60
  const pathId = encodeURIComponent(nodeId ?? globalId ?? "");
60
- return gateway.request({
61
+ return gateway
62
+ .request({
61
63
  path: `/api/platform/v1/ontology-links/nodes/${pathId}${toQueryString({
62
64
  topicId: input.topicId,
63
65
  workspaceId: input.workspaceId,
@@ -69,7 +71,8 @@ export function createOntologyLinksClient(config = {}) {
69
71
  limit: input.limit,
70
72
  cursor: input.cursor,
71
73
  })}`,
72
- }).then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "links")));
74
+ })
75
+ .then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "links")));
73
76
  },
74
77
  updateLinkStatus(input, idempotencyKey) {
75
78
  return gateway.request({
package/dist/opinion.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export type Opinion = {
1
+ export interface Opinion {
2
+ a: number;
2
3
  b: number;
3
4
  d: number;
4
5
  u: number;
5
- a: number;
6
- };
6
+ }
7
7
  export declare function opinionFromBaseRate(probability: number): Opinion;
8
8
  export declare function opinionFromDogmatic(probability: number, baseRate: number): Opinion;
9
9
  export declare function opinionFromProjected(probability: number, uncertainty: number, baseRate: number): Opinion;
package/dist/opinion.js CHANGED
@@ -17,15 +17,22 @@ export function opinionFromBaseRate(probability) {
17
17
  export function opinionFromDogmatic(probability, baseRate) {
18
18
  return dogmatic(clamp01(probability), clamp01(baseRate));
19
19
  }
20
+ function representableProjectedUncertainty(probability, uncertainty, baseRate) {
21
+ const maxBeliefUncertainty = baseRate > 0 ? probability / baseRate : Number.POSITIVE_INFINITY;
22
+ const maxDisbeliefUncertainty = baseRate < 1
23
+ ? (1 - probability) / (1 - baseRate)
24
+ : Number.POSITIVE_INFINITY;
25
+ return clamp01(Math.min(uncertainty, maxBeliefUncertainty, maxDisbeliefUncertainty));
26
+ }
20
27
  export function opinionFromProjected(probability, uncertainty, baseRate) {
21
28
  const p = clamp01(probability);
22
- const u = clamp01(uncertainty);
23
- const remainingMass = 1 - u;
29
+ const a = clamp01(baseRate);
30
+ const u = representableProjectedUncertainty(p, clamp01(uncertainty), a);
24
31
  return {
25
- b: p * remainingMass,
26
- d: (1 - p) * remainingMass,
32
+ b: Math.max(0, p - a * u),
33
+ d: Math.max(0, 1 - p - (1 - a) * u),
27
34
  u,
28
- a: clamp01(baseRate),
35
+ a,
29
36
  };
30
37
  }
31
38
  //# sourceMappingURL=opinion.js.map