@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.
- package/CHANGELOG.md +12 -0
- package/dist/accessControl.d.ts +31 -31
- package/dist/accessControl.js +1 -0
- package/dist/adminClient.d.ts +74 -74
- package/dist/adminClient.js +38 -30
- package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
- package/dist/{answersClient.js → answers-client.js} +2 -2
- package/dist/audience/index.d.ts +12 -12
- package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
- package/dist/audiences-client.js +107 -0
- package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
- package/dist/{auditClient.js → audit-client.js} +8 -7
- package/dist/authContext.d.ts +26 -26
- package/dist/authDeviceClient.d.ts +11 -11
- package/dist/authDeviceClient.js +4 -6
- package/dist/beliefs/index.d.ts +56 -28
- package/dist/beliefs/index.js +2 -1
- package/dist/beliefsClient.d.ts +71 -63
- package/dist/beliefsClient.js +90 -67
- package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
- package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
- package/dist/client-assembly-types.d.ts +219 -0
- package/dist/client-assembly-types.js +2 -0
- package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
- package/dist/client-config.js +2 -0
- package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
- package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
- package/dist/client.d.ts +1906 -352
- package/dist/client.js +34 -30
- package/dist/clientGraphNamespaces.d.ts +35 -25
- package/dist/clientGraphNamespaces.js +11 -5
- package/dist/clientHelpers.js +8 -5
- package/dist/clientKnowledgeNamespaces.d.ts +124 -84
- package/dist/clientKnowledgeNamespaces.js +35 -34
- package/dist/clientLocalHelpers.d.ts +81 -52
- package/dist/clientLocalHelpers.js +193 -43
- package/dist/clientPlatformNamespaces.d.ts +1541 -150
- package/dist/clientPlatformNamespaces.js +10 -5
- package/dist/clientRuntime.d.ts +1 -1
- package/dist/clientRuntime.js +1 -1
- package/dist/clientWorkflowNamespaces.d.ts +211 -97
- package/dist/clientWorkflowNamespaces.js +22 -19
- package/dist/contextClient.d.ts +2 -2
- package/dist/contextClient.js +79 -50
- package/dist/contextFacade.d.ts +1 -1
- package/dist/contextFacade.js +2 -0
- package/dist/contextPackCompiler.d.ts +52 -52
- package/dist/contextPackCompiler.js +192 -122
- package/dist/contextPackPolicy.d.ts +22 -22
- package/dist/contextPackPolicy.js +21 -9
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +1 -0
- package/dist/contextTypes.d.ts +155 -155
- package/dist/contracts/api-enums.contract.js +2 -11
- package/dist/contracts/auth-session.contract.d.ts +16 -16
- package/dist/contracts/auth-session.contract.js +3 -2
- package/dist/contracts/context-pack.contract.d.ts +216 -216
- package/dist/contracts/contextPack.js +2 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/lens-filter.contract.d.ts +8 -8
- package/dist/contracts/lens-filter.contract.js +10 -10
- package/dist/contracts/lens-workflow.contract.d.ts +32 -32
- package/dist/contracts/lens-workflow.contract.js +2 -1
- package/dist/contracts/lensFilter.js +2 -0
- package/dist/contracts/lensWorkflow.js +2 -0
- package/dist/contracts/mcpTools.d.ts +19 -19
- package/dist/contracts/mcpTools.js +3 -1
- package/dist/contracts/prompt.contract.d.ts +12 -12
- package/dist/contracts/prompt.js +1 -0
- package/dist/contracts/sdk-tools.contract.js +1 -0
- package/dist/contracts/sdkTools.js +2 -0
- package/dist/contracts/tool-contracts.js +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
- package/dist/contracts/workflow-runtime.contract.js +1 -5
- package/dist/contracts/workflowRuntime.js +2 -0
- package/dist/contradictions/index.d.ts +8 -8
- package/dist/contradictions/index.js +1 -0
- package/dist/control-plane.d.ts +10 -10
- package/dist/control-plane.js +2 -2
- package/dist/controlObjectOwnership.d.ts +11 -11
- package/dist/controlObjectOwnership.js +1 -0
- package/dist/coreClient.d.ts +51 -51
- package/dist/coreClient.js +269 -101
- package/dist/customTools.d.ts +19 -19
- package/dist/customTools.js +4 -2
- package/dist/decisions/index.d.ts +18 -18
- package/dist/decisions/index.js +1 -0
- package/dist/decisionsClient.d.ts +4 -4
- package/dist/decisionsClient.js +36 -27
- package/dist/edges/index.d.ts +20 -18
- package/dist/edges/index.js +1 -0
- package/dist/embeddingsClient.d.ts +29 -29
- package/dist/embeddingsClient.js +15 -8
- package/dist/eventingClient.d.ts +27 -27
- package/dist/eventingClient.js +10 -5
- package/dist/events.d.ts +83 -83
- package/dist/events.js +19 -15
- package/dist/eventsCore.d.ts +7 -7
- package/dist/eventsCore.js +11 -10
- package/dist/evidence/index.d.ts +23 -21
- package/dist/evidence/index.js +1 -0
- package/dist/evidenceClient.d.ts +23 -23
- package/dist/evidenceClient.js +10 -6
- package/dist/facade/context.d.ts +9 -9
- package/dist/facade/context.js +67 -41
- package/dist/functionSurface.js +2 -0
- package/dist/functionSurfaceClient.js +2 -0
- package/dist/gatewayFacades.d.ts +215 -215
- package/dist/gatewayFacades.factories.d.ts +23 -44
- package/dist/gatewayFacades.factories.js +63 -62
- package/dist/gatewayFacades.js +31 -32
- package/dist/graphAnalysisClient.d.ts +60 -60
- package/dist/graphAnalysisClient.js +19 -18
- package/dist/graphClient.d.ts +34 -34
- package/dist/graphClient.js +56 -35
- package/dist/graphIntel.js +2 -0
- package/dist/graphIntelligence.d.ts +2 -2
- package/dist/graphIntelligence.js +1 -1
- package/dist/graphRecommendationsClient.d.ts +24 -24
- package/dist/graphRecommendationsClient.js +12 -7
- package/dist/graphStateClassifierClient.d.ts +13 -13
- package/dist/graphStateClassifierClient.js +10 -5
- package/dist/harnessClient.d.ts +61 -61
- package/dist/harnessClient.js +44 -31
- package/dist/identityClient.d.ts +33 -59
- package/dist/identityClient.js +126 -98
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -19
- package/dist/infisicalRuntime.d.ts +11 -11
- package/dist/infisicalRuntime.js +20 -14
- package/dist/jobsClient.d.ts +28 -28
- package/dist/jobsClient.js +6 -3
- package/dist/learningClient.js +13 -8
- package/dist/lenses/index.d.ts +124 -28
- package/dist/lenses/index.js +1 -0
- package/dist/mcpClient.d.ts +1 -1
- package/dist/mcpClient.js +3 -3
- package/dist/modelRuntimeClient.d.ts +27 -27
- package/dist/modelRuntimeClient.js +10 -5
- package/dist/nodes/index.d.ts +9 -9
- package/dist/nodes/index.js +1 -0
- package/dist/ontologies/index.d.ts +68 -22
- package/dist/ontologies/index.js +1 -0
- package/dist/ontologyClient.js +24 -17
- package/dist/ontologyLinksClient.d.ts +35 -35
- package/dist/ontologyLinksClient.js +9 -6
- package/dist/opinion.d.ts +3 -3
- package/dist/opinion.js +12 -5
- package/dist/orgGraphSearchClient.d.ts +39 -39
- package/dist/orgGraphSearchClient.js +22 -13
- package/dist/packsClient.d.ts +1 -1
- package/dist/packsClient.js +28 -19
- package/dist/policyClient.d.ts +79 -68
- package/dist/policyClient.js +18 -12
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +38 -27
- package/dist/questions/index.js +1 -0
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/refs.d.ts +2 -2
- package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
- package/dist/{reportsClient.js → reports-client.js} +19 -13
- package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
- package/dist/{schemaClient.js → schema-client.js} +14 -11
- package/dist/sdkSurface.d.ts +12 -12
- package/dist/sdkSurface.js +14 -10
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +2 -1
- package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
- package/dist/{sourcesClient.js → sources-client.js} +4 -5
- package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
- package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
- package/dist/toolRegistryClient.d.ts +46 -46
- package/dist/toolRegistryClient.js +22 -11
- package/dist/topics/index.d.ts +23 -23
- package/dist/topics/index.js +2 -1
- package/dist/topicsClient.d.ts +6 -6
- package/dist/topicsClient.js +29 -18
- package/dist/types.d.ts +356 -355
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflowClient.d.ts +36 -35
- package/dist/workflowClient.js +88 -60
- package/dist/worktrees/index.d.ts +118 -32
- package/dist/worktrees/index.js +2 -1
- package/package.json +45 -5
- package/dist/audiencesClient.js +0 -115
- package/dist/clientAssemblyTypes.d.ts +0 -33
- package/dist/clientAssemblyTypes.js +0 -2
- 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
|
|
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
|
|
16
|
+
}
|
|
17
|
+
export interface ModelFunctionSlot {
|
|
18
18
|
functionName: string;
|
|
19
|
-
|
|
19
|
+
metadata?: JsonObject | null;
|
|
20
20
|
modelId?: string;
|
|
21
21
|
provider?: string;
|
|
22
22
|
routingPolicy?: JsonObject | null;
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
32
|
+
}
|
|
33
|
+
export interface ResolveModelSlotInput {
|
|
37
34
|
functionName: string;
|
|
38
|
-
slotKey?: string;
|
|
39
35
|
metadata?: JsonObject;
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
principalId?: string;
|
|
37
|
+
slotKey?: string;
|
|
42
38
|
tenantId: string;
|
|
43
39
|
workspaceId?: string;
|
|
44
|
-
|
|
40
|
+
}
|
|
41
|
+
export interface UpdateModelSlotConfigInput {
|
|
45
42
|
functionName: string;
|
|
46
|
-
|
|
43
|
+
metadata?: JsonObject;
|
|
47
44
|
modelId: string;
|
|
45
|
+
principalId?: string;
|
|
48
46
|
provider?: string;
|
|
49
47
|
routingPolicy?: JsonObject;
|
|
50
|
-
|
|
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
|
|
35
|
+
return gateway
|
|
36
|
+
.request({
|
|
35
37
|
path: `/api/platform/v1/model-runtime/models${toQueryString(scopeQuery(input))}`,
|
|
36
|
-
})
|
|
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
|
|
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
|
-
})
|
|
59
|
+
})
|
|
60
|
+
.then((response) => mapGatewayData(response, (data) => listResultFromEnvelope(data, "slots")));
|
|
56
61
|
},
|
|
57
62
|
resolveSlot(input, idempotencyKey) {
|
|
58
63
|
cleanRequiredString(input.tenantId, "tenantId");
|
package/dist/nodes/index.d.ts
CHANGED
|
@@ -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:
|
|
8
|
-
getNode:
|
|
9
|
-
listNodes:
|
|
10
|
-
updateNode:
|
|
11
|
-
batchCreateNodes:
|
|
12
|
-
supersedeNode:
|
|
13
|
-
verifyNode:
|
|
14
|
-
hardDeleteNode:
|
|
15
|
-
raw:
|
|
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
|
package/dist/nodes/index.js
CHANGED
|
@@ -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) =>
|
|
9
|
-
getOntology: (ontologyId: string) =>
|
|
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
|
-
}) =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
}):
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
package/dist/ontologies/index.js
CHANGED
|
@@ -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";
|
package/dist/ontologyClient.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
return gateway
|
|
93
|
+
listVersions(ontologyId, filters = {}) {
|
|
94
|
+
return gateway
|
|
95
|
+
.request({
|
|
92
96
|
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions${toQueryString(filters)}`,
|
|
93
|
-
})
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
-
return gateway
|
|
135
|
+
listTopics(ontologyId) {
|
|
136
|
+
return gateway
|
|
137
|
+
.request({
|
|
132
138
|
path: `/api/platform/v1/topics?ontologyId=${encodeURIComponent(ontologyId)}`,
|
|
133
|
-
})
|
|
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
|
|
7
|
-
|
|
6
|
+
export interface OntologyLinkRecord {
|
|
7
|
+
confidence?: number;
|
|
8
|
+
createdAt?: number;
|
|
8
9
|
edgeId?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
confidence?: number;
|
|
15
|
+
sourceGlobalId?: string;
|
|
16
|
+
sourceNodeId?: string;
|
|
20
17
|
status?: OntologyLinkStatus | string;
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
}
|
|
25
|
+
export interface OntologyLinkWriteInput {
|
|
26
|
+
confidence?: number;
|
|
27
|
+
edgeType: string;
|
|
28
|
+
metadata?: JsonObject;
|
|
32
29
|
ontologyId: string;
|
|
33
30
|
ontologyType?: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
confidence?: number;
|
|
31
|
+
sourceGlobalId?: string;
|
|
32
|
+
sourceNodeId?: string;
|
|
37
33
|
status?: OntologyLinkStatus;
|
|
38
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
export
|
|
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
|
|
22
|
+
if (!(input.sourceNodeId || input.sourceGlobalId)) {
|
|
22
23
|
throw new Error("sourceNodeId or sourceGlobalId is required");
|
|
23
24
|
}
|
|
24
|
-
if (!input.targetNodeId
|
|
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
|
|
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
|
|
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
|
-
})
|
|
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
|
|
1
|
+
export interface Opinion {
|
|
2
|
+
a: number;
|
|
2
3
|
b: number;
|
|
3
4
|
d: number;
|
|
4
5
|
u: number;
|
|
5
|
-
|
|
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
|
|
23
|
-
const
|
|
29
|
+
const a = clamp01(baseRate);
|
|
30
|
+
const u = representableProjectedUncertainty(p, clamp01(uncertainty), a);
|
|
24
31
|
return {
|
|
25
|
-
b: p *
|
|
26
|
-
d: (1 - p) *
|
|
32
|
+
b: Math.max(0, p - a * u),
|
|
33
|
+
d: Math.max(0, 1 - p - (1 - a) * u),
|
|
27
34
|
u,
|
|
28
|
-
a
|
|
35
|
+
a,
|
|
29
36
|
};
|
|
30
37
|
}
|
|
31
38
|
//# sourceMappingURL=opinion.js.map
|