@lucern/sdk 1.0.10 → 1.0.12
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 +6 -0
- package/README.md +35 -0
- package/dist/.generated +2 -0
- package/dist/accessControl.d.ts +19 -26
- package/dist/accessControl.js +195 -1423
- package/dist/adminClient.d.ts +52 -59
- package/dist/adminClient.js +364 -1142
- package/dist/answersClient.d.ts +5 -14
- package/dist/answersClient.js +19 -737
- package/dist/audience/index.d.ts +18 -18
- package/dist/audience/index.js +87 -90
- package/dist/audiencesClient.d.ts +19 -27
- package/dist/audiencesClient.js +107 -868
- package/dist/auditClient.d.ts +8 -15
- package/dist/auditClient.js +18 -791
- package/dist/authContext.d.ts +11 -16
- package/dist/authContext.js +122 -154
- package/dist/authDeviceClient.d.ts +8 -17
- package/dist/authDeviceClient.js +113 -102
- package/dist/beliefs/index.d.ts +15 -67
- package/dist/beliefs/index.js +17 -10172
- package/dist/beliefs/lifecycle.d.ts +10 -11
- package/dist/beliefs/lifecycle.js +78 -80
- package/dist/beliefsClient.d.ts +26 -32
- package/dist/beliefsClient.js +250 -990
- package/dist/boundaryClientSurface.d.ts +11 -16
- package/dist/boundaryClientSurface.js +49 -68
- package/dist/client.d.ts +73 -112
- package/dist/client.js +232 -10146
- package/dist/clientAssemblyTypes.d.ts +3 -3
- package/dist/clientAssemblyTypes.js +1 -2
- package/dist/clientConfig.d.ts +45 -59
- package/dist/clientConfig.js +1 -2
- package/dist/clientEvidenceCompat.d.ts +7 -14
- package/dist/clientEvidenceCompat.js +50 -64
- package/dist/clientGraphNamespaces.d.ts +3 -5
- package/dist/clientGraphNamespaces.js +170 -245
- package/dist/clientHelpers.d.ts +20 -25
- package/dist/clientHelpers.js +104 -127
- package/dist/clientKnowledgeNamespaces.d.ts +6 -53
- package/dist/clientKnowledgeNamespaces.js +502 -506
- package/dist/clientLocalHelpers.d.ts +11 -56
- package/dist/clientLocalHelpers.js +503 -732
- package/dist/clientPlatformNamespaces.d.ts +14 -53
- package/dist/clientPlatformNamespaces.js +229 -314
- package/dist/clientRuntime.d.ts +5 -53
- package/dist/clientRuntime.js +26 -30
- package/dist/clientWorkflowNamespaces.d.ts +6 -15
- package/dist/clientWorkflowNamespaces.js +529 -596
- package/dist/contextClient.d.ts +9 -17
- package/dist/contextClient.js +92 -805
- package/dist/contextFacade.d.ts +11 -2
- package/dist/contextFacade.js +10 -81
- package/dist/contextPackCompiler.d.ts +10 -11
- package/dist/contextPackCompiler.js +494 -1040
- package/dist/contextPackPolicy.d.ts +14 -15
- package/dist/contextPackPolicy.js +227 -305
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +169 -176
- package/dist/contextTypes.d.ts +14 -15
- package/dist/contextTypes.js +1 -2
- package/dist/contracts/api-enums.contract.d.ts +29 -30
- package/dist/contracts/api-enums.contract.js +162 -88
- package/dist/contracts/auth-session.contract.d.ts +13 -14
- package/dist/contracts/auth-session.contract.js +55 -52
- package/dist/contracts/context-pack.contract.d.ts +54 -55
- package/dist/contracts/context-pack.contract.js +160 -88
- package/dist/contracts/contextPack.d.ts +2 -1
- package/dist/contracts/contextPack.js +1 -97
- package/dist/contracts/index.d.ts +11 -12
- package/dist/contracts/index.js +10 -854
- package/dist/contracts/lens-filter.contract.d.ts +9 -10
- package/dist/contracts/lens-filter.contract.js +82 -58
- package/dist/contracts/lens-workflow.contract.d.ts +21 -23
- package/dist/contracts/lens-workflow.contract.js +48 -117
- package/dist/contracts/lensFilter.d.ts +2 -1
- package/dist/contracts/lensFilter.js +1 -71
- package/dist/contracts/lensWorkflow.d.ts +2 -2
- package/dist/contracts/lensWorkflow.js +1 -123
- package/dist/contracts/mcpTools.d.ts +16 -18
- package/dist/contracts/mcpTools.js +89 -123
- package/dist/contracts/prompt.contract.d.ts +4 -5
- package/dist/contracts/prompt.contract.js +23 -10
- package/dist/contracts/prompt.d.ts +2 -1
- package/dist/contracts/prompt.js +1 -11
- package/dist/contracts/sdk-tools.contract.d.ts +2 -1
- package/dist/contracts/sdk-tools.contract.js +1 -2
- package/dist/contracts/sdkTools.d.ts +2 -1
- package/dist/contracts/sdkTools.js +1 -26
- package/dist/contracts/tool-contracts.d.ts +2 -1
- package/dist/contracts/tool-contracts.js +1 -2
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -46
- package/dist/contracts/workflow-runtime.contract.js +241 -228
- package/dist/contracts/workflowRuntime.d.ts +2 -1
- package/dist/contracts/workflowRuntime.js +1 -244
- package/dist/contradictions/index.d.ts +8 -60
- package/dist/contradictions/index.js +11 -10166
- package/dist/control-plane.d.ts +17 -24
- package/dist/control-plane.js +124 -840
- package/dist/controlObjectOwnership.d.ts +19 -20
- package/dist/controlObjectOwnership.js +207 -201
- package/dist/coreClient.d.ts +23 -28
- package/dist/coreClient.js +567 -692
- package/dist/customTools.d.ts +17 -21
- package/dist/customTools.js +221 -221
- package/dist/decisions/index.d.ts +7 -58
- package/dist/decisions/index.js +14 -10168
- package/dist/decisionsClient.d.ts +25 -32
- package/dist/decisionsClient.js +113 -913
- package/dist/domainContext.d.ts +2 -1
- package/dist/domainContext.js +1 -2
- package/dist/edges/index.d.ts +21 -73
- package/dist/edges/index.js +12 -10167
- package/dist/embeddingsClient.d.ts +22 -30
- package/dist/embeddingsClient.js +73 -922
- package/dist/eventingClient.d.ts +23 -31
- package/dist/eventingClient.js +89 -918
- package/dist/events.d.ts +48 -49
- package/dist/events.js +257 -241
- package/dist/eventsCore.d.ts +20 -29
- package/dist/eventsCore.js +86 -830
- package/dist/evidence/index.d.ts +9 -60
- package/dist/evidence/index.js +13 -10167
- package/dist/evidenceClient.d.ts +13 -22
- package/dist/evidenceClient.js +34 -751
- package/dist/facade/context.d.ts +7 -8
- package/dist/facade/context.js +73 -72
- package/dist/functionSurface.d.ts +2 -156
- package/dist/functionSurface.js +1 -1460
- package/dist/functionSurfaceClient.d.ts +2 -9
- package/dist/functionSurfaceClient.js +1 -1460
- package/dist/gatewayFacades.d.ts +79 -296
- package/dist/gatewayFacades.factories.d.ts +209 -14
- package/dist/gatewayFacades.factories.js +561 -2227
- package/dist/gatewayFacades.js +284 -2627
- package/dist/generated/functionSurface.d.ts +149 -0
- package/dist/generated/functionSurface.js +749 -0
- package/dist/graphAnalysisClient.d.ts +41 -49
- package/dist/graphAnalysisClient.js +185 -974
- package/dist/graphClient.d.ts +53 -60
- package/dist/graphClient.js +219 -1090
- package/dist/graphIntel.d.ts +2 -4
- package/dist/graphIntel.js +1 -2
- package/dist/graphIntelligence.d.ts +4 -2
- package/dist/graphIntelligence.js +2 -46
- package/dist/graphRecommendationsClient.d.ts +15 -23
- package/dist/graphRecommendationsClient.js +70 -849
- package/dist/graphStateClassifierClient.d.ts +17 -25
- package/dist/graphStateClassifierClient.js +67 -908
- package/dist/harnessClient.d.ts +40 -47
- package/dist/harnessClient.js +198 -993
- package/dist/identityClient.d.ts +25 -33
- package/dist/identityClient.js +245 -1186
- package/dist/index.d.ts +73 -69
- package/dist/index.js +72 -13304
- package/dist/infisicalRuntime.d.ts +12 -14
- package/dist/infisicalRuntime.js +290 -297
- package/dist/jobsClient.d.ts +24 -32
- package/dist/jobsClient.js +101 -916
- package/dist/learningClient.d.ts +8 -16
- package/dist/learningClient.js +45 -809
- package/dist/lenses/index.d.ts +13 -65
- package/dist/lenses/index.js +11 -10166
- package/dist/mcpClient.d.ts +14 -23
- package/dist/mcpClient.js +115 -856
- package/dist/modelRuntimeClient.d.ts +18 -26
- package/dist/modelRuntimeClient.js +74 -894
- package/dist/nodes/index.d.ts +7 -58
- package/dist/nodes/index.js +14 -10168
- package/dist/ontologies/index.d.ts +21 -73
- package/dist/ontologies/index.js +14 -10169
- package/dist/ontologyClient.d.ts +23 -31
- package/dist/ontologyClient.js +138 -924
- package/dist/ontologyLinksClient.d.ts +16 -24
- package/dist/ontologyLinksClient.js +76 -886
- package/dist/opinion.d.ts +5 -6
- package/dist/opinion.js +21 -25
- package/dist/orgGraphSearchClient.d.ts +19 -27
- package/dist/orgGraphSearchClient.js +89 -857
- package/dist/packRuntime.d.ts +2 -2
- package/dist/packRuntime.js +1 -2
- package/dist/packsClient.d.ts +30 -37
- package/dist/packsClient.js +131 -906
- package/dist/policyClient.d.ts +21 -29
- package/dist/policyClient.js +267 -1026
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +9 -60
- package/dist/questions/index.js +15 -10169
- package/dist/realtime/index.d.ts +20 -16
- package/dist/realtime/index.js +30 -19
- package/dist/realtime/refs.d.ts +4 -6
- package/dist/realtime/refs.js +12 -7
- package/dist/realtime-refs.d.ts +1 -0
- package/dist/realtime-refs.js +1 -0
- package/dist/realtime.d.ts +1 -0
- package/dist/realtime.js +1 -0
- package/dist/reportsClient.d.ts +10 -19
- package/dist/reportsClient.js +48 -836
- package/dist/schemaClient.d.ts +16 -23
- package/dist/schemaClient.js +62 -832
- package/dist/sdkSurface.d.ts +18 -25
- package/dist/sdkSurface.js +135 -106
- package/dist/secrets.d.ts +2 -1
- package/dist/secrets.js +1 -2
- package/dist/sourcesClient.d.ts +11 -18
- package/dist/sourcesClient.js +18 -741
- package/dist/telemetryClient.d.ts +22 -30
- package/dist/telemetryClient.js +107 -931
- package/dist/toolRegistryClient.d.ts +27 -35
- package/dist/toolRegistryClient.js +116 -954
- package/dist/topics/index.d.ts +13 -64
- package/dist/topics/index.js +15 -10169
- package/dist/topicsClient.d.ts +19 -27
- package/dist/topicsClient.js +106 -894
- package/dist/types.d.ts +84 -87
- package/dist/types.js +1 -2
- package/dist/version.d.ts +2 -3
- package/dist/version.js +2 -5
- package/dist/workflowClient.d.ts +60 -65
- package/dist/workflowClient.js +343 -1219
- package/dist/worktrees/index.d.ts +16 -68
- package/dist/worktrees/index.js +14 -10169
- package/package.json +6 -6
- package/dist/accessControl.js.map +0 -1
- package/dist/adminClient.js.map +0 -1
- package/dist/answersClient.js.map +0 -1
- package/dist/audience/index.js.map +0 -1
- package/dist/audiencesClient.js.map +0 -1
- package/dist/auditClient.js.map +0 -1
- package/dist/authContext.js.map +0 -1
- package/dist/authDeviceClient.js.map +0 -1
- package/dist/beliefs/index.js.map +0 -1
- package/dist/beliefs/lifecycle.js.map +0 -1
- package/dist/beliefsClient.js.map +0 -1
- package/dist/boundaryClientSurface.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/clientAssemblyTypes.js.map +0 -1
- package/dist/clientConfig.js.map +0 -1
- package/dist/clientEvidenceCompat.js.map +0 -1
- package/dist/clientGraphNamespaces.js.map +0 -1
- package/dist/clientHelpers.js.map +0 -1
- package/dist/clientKnowledgeNamespaces.js.map +0 -1
- package/dist/clientLocalHelpers.js.map +0 -1
- package/dist/clientPlatformNamespaces.js.map +0 -1
- package/dist/clientRuntime.js.map +0 -1
- package/dist/clientWorkflowNamespaces.js.map +0 -1
- package/dist/contextClient.js.map +0 -1
- package/dist/contextFacade.js.map +0 -1
- package/dist/contextPackCompiler.js.map +0 -1
- package/dist/contextPackPolicy.js.map +0 -1
- package/dist/contextPackSchema.js.map +0 -1
- package/dist/contextTypes.js.map +0 -1
- package/dist/contracts/api-enums.contract.js.map +0 -1
- package/dist/contracts/auth-session.contract.js.map +0 -1
- package/dist/contracts/context-pack.contract.js.map +0 -1
- package/dist/contracts/contextPack.js.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/lens-filter.contract.js.map +0 -1
- package/dist/contracts/lens-workflow.contract.js.map +0 -1
- package/dist/contracts/lensFilter.js.map +0 -1
- package/dist/contracts/lensWorkflow.js.map +0 -1
- package/dist/contracts/mcpTools.js.map +0 -1
- package/dist/contracts/prompt.contract.js.map +0 -1
- package/dist/contracts/prompt.js.map +0 -1
- package/dist/contracts/sdk-tools.contract.js.map +0 -1
- package/dist/contracts/sdkTools.js.map +0 -1
- package/dist/contracts/tool-contracts.js.map +0 -1
- package/dist/contracts/workflow-runtime.contract.js.map +0 -1
- package/dist/contracts/workflowRuntime.js.map +0 -1
- package/dist/contradictions/index.js.map +0 -1
- package/dist/control-plane.js.map +0 -1
- package/dist/controlObjectOwnership.js.map +0 -1
- package/dist/coreClient.js.map +0 -1
- package/dist/customTools.js.map +0 -1
- package/dist/decisions/index.js.map +0 -1
- package/dist/decisionsClient.js.map +0 -1
- package/dist/domainContext.js.map +0 -1
- package/dist/edges/index.js.map +0 -1
- package/dist/embeddingsClient.js.map +0 -1
- package/dist/eventingClient.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/eventsCore.js.map +0 -1
- package/dist/evidence/index.js.map +0 -1
- package/dist/evidenceClient.js.map +0 -1
- package/dist/facade/context.js.map +0 -1
- package/dist/functionSurface.js.map +0 -1
- package/dist/functionSurfaceClient.js.map +0 -1
- package/dist/gatewayFacades.factories.js.map +0 -1
- package/dist/gatewayFacades.js.map +0 -1
- package/dist/graphAnalysisClient.js.map +0 -1
- package/dist/graphClient.js.map +0 -1
- package/dist/graphIntel.js.map +0 -1
- package/dist/graphIntelligence.js.map +0 -1
- package/dist/graphRecommendationsClient.js.map +0 -1
- package/dist/graphStateClassifierClient.js.map +0 -1
- package/dist/harnessClient.js.map +0 -1
- package/dist/identityClient.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infisicalRuntime.js.map +0 -1
- package/dist/jobsClient.js.map +0 -1
- package/dist/learningClient.js.map +0 -1
- package/dist/lenses/index.js.map +0 -1
- package/dist/mcpClient.js.map +0 -1
- package/dist/modelRuntimeClient.js.map +0 -1
- package/dist/nodes/index.js.map +0 -1
- package/dist/ontologies/index.js.map +0 -1
- package/dist/ontologyClient.js.map +0 -1
- package/dist/ontologyLinksClient.js.map +0 -1
- package/dist/opinion.js.map +0 -1
- package/dist/orgGraphSearchClient.js.map +0 -1
- package/dist/packRuntime.js.map +0 -1
- package/dist/packsClient.js.map +0 -1
- package/dist/policyClient.js.map +0 -1
- package/dist/questions/index.js.map +0 -1
- package/dist/realtime/index.js.map +0 -1
- package/dist/realtime/refs.js.map +0 -1
- package/dist/reportsClient.js.map +0 -1
- package/dist/schemaClient.js.map +0 -1
- package/dist/sdk-tools.contract-B4c1Zr1o.d.ts +0 -22
- package/dist/sdkSurface.js.map +0 -1
- package/dist/secrets.js.map +0 -1
- package/dist/sourcesClient.js.map +0 -1
- package/dist/telemetryClient.js.map +0 -1
- package/dist/tool-contracts-BUiL9P6z.d.ts +0 -22
- package/dist/toolRegistryClient.js.map +0 -1
- package/dist/topics/index.js.map +0 -1
- package/dist/topicsClient.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/workflowClient.js.map +0 -1
- package/dist/worktrees/index.js.map +0 -1
package/dist/clientHelpers.js
CHANGED
|
@@ -1,137 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// src/clientHelpers.ts
|
|
32
|
-
function normalizeCustomNamespace(namespace) {
|
|
33
|
-
return namespace.trim() || "custom";
|
|
34
|
-
}
|
|
35
|
-
function normalizeCustomToolPayload(input) {
|
|
36
|
-
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
37
|
-
}
|
|
38
|
-
function resolveCustomToolFullName(name) {
|
|
39
|
-
return name.includes(".") ? name : `custom.${name}`;
|
|
40
|
-
}
|
|
41
|
-
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
42
|
-
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
43
|
-
}
|
|
44
|
-
function buildBeliefsArchivePayload(input) {
|
|
45
|
-
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
46
|
-
}
|
|
47
|
-
function asNodeArray(data) {
|
|
48
|
-
const rows = asListItems(data, "nodes");
|
|
49
|
-
if (rows.length > 0) {
|
|
50
|
-
return rows.filter(
|
|
51
|
-
(value) => Boolean(value) && typeof value === "object"
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
if (data && typeof data === "object") {
|
|
55
|
-
return [data];
|
|
56
|
-
}
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
function asEdgeArray(data) {
|
|
60
|
-
const rows = asListItems(data, "edges");
|
|
61
|
-
if (rows.length > 0) {
|
|
62
|
-
return rows.filter(
|
|
63
|
-
(value) => Boolean(value) && typeof value === "object"
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
if (data && typeof data === "object") {
|
|
67
|
-
return [data];
|
|
68
|
-
}
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
function requireTopicId(args) {
|
|
72
|
-
const topicId = resolveTopicId(args);
|
|
73
|
-
if (!topicId) {
|
|
74
|
-
throw new Error("topicId is required");
|
|
75
|
-
}
|
|
76
|
-
return topicId;
|
|
77
|
-
}
|
|
78
|
-
function requireTopicOrProjectId(args) {
|
|
79
|
-
const topicId = args.topicId?.trim() || args.projectId?.trim() || void 0;
|
|
80
|
-
if (!topicId) {
|
|
81
|
-
throw new Error("topicId is required");
|
|
82
|
-
}
|
|
83
|
-
return topicId;
|
|
84
|
-
}
|
|
85
|
-
var AUDIT_NODE_REFERENCE_KEY_PATTERN = /(^|_)(id|nodeid|beliefid|resourceid|targetid|sourceid|subjectid|globalid|entityid|recordid|fromnodeid|tonodeid|linkednodeid|linkedbeliefid|nodeids|beliefids|resourceids)$/i;
|
|
86
|
-
function matchesAuditNodeReference(value, nodeId) {
|
|
87
|
-
if (Array.isArray(value)) {
|
|
88
|
-
return value.some((entry) => matchesAuditNodeReference(entry, nodeId));
|
|
89
|
-
}
|
|
90
|
-
if (!value || typeof value !== "object") {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
return Object.entries(value).some(([key, entry]) => {
|
|
94
|
-
if (typeof entry === "string" && entry === nodeId && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key)) {
|
|
95
|
-
return true;
|
|
1
|
+
import { asListItems, resolveText, resolveTopicId } from "./sdkSurface.js";
|
|
2
|
+
export function normalizeCustomNamespace(namespace) {
|
|
3
|
+
return namespace.trim() || "custom";
|
|
4
|
+
}
|
|
5
|
+
export function normalizeCustomToolPayload(input) {
|
|
6
|
+
return input && typeof input === "object" && !Array.isArray(input)
|
|
7
|
+
? input
|
|
8
|
+
: {};
|
|
9
|
+
}
|
|
10
|
+
export function resolveCustomToolFullName(name) {
|
|
11
|
+
return name.includes(".") ? name : `custom.${name}`;
|
|
12
|
+
}
|
|
13
|
+
export function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
14
|
+
return typeof textOrInput === "string"
|
|
15
|
+
? { text: textOrInput, rationale }
|
|
16
|
+
: { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
17
|
+
}
|
|
18
|
+
export function buildBeliefsArchivePayload(input) {
|
|
19
|
+
return typeof input === "string"
|
|
20
|
+
? { reason: input }
|
|
21
|
+
: input
|
|
22
|
+
? { reason: input.reason ?? input.rationale }
|
|
23
|
+
: undefined;
|
|
24
|
+
}
|
|
25
|
+
export function asNodeArray(data) {
|
|
26
|
+
const rows = asListItems(data, "nodes");
|
|
27
|
+
if (rows.length > 0) {
|
|
28
|
+
return rows.filter((value) => Boolean(value) && typeof value === "object");
|
|
96
29
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
30
|
+
if (data && typeof data === "object") {
|
|
31
|
+
return [data];
|
|
99
32
|
}
|
|
100
|
-
return
|
|
101
|
-
});
|
|
33
|
+
return [];
|
|
102
34
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
35
|
+
export function asEdgeArray(data) {
|
|
36
|
+
const rows = asListItems(data, "edges");
|
|
37
|
+
if (rows.length > 0) {
|
|
38
|
+
return rows.filter((value) => Boolean(value) && typeof value === "object");
|
|
39
|
+
}
|
|
40
|
+
if (data && typeof data === "object") {
|
|
41
|
+
return [data];
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
109
44
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
45
|
+
export function requireTopicId(args) {
|
|
46
|
+
const topicId = resolveTopicId(args);
|
|
47
|
+
if (!topicId) {
|
|
48
|
+
throw new Error("topicId is required");
|
|
49
|
+
}
|
|
50
|
+
return topicId;
|
|
116
51
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
continue;
|
|
52
|
+
export function requireTopicOrProjectId(args) {
|
|
53
|
+
const topicId = args.topicId?.trim() || args.projectId?.trim() || undefined;
|
|
54
|
+
if (!topicId) {
|
|
55
|
+
throw new Error("topicId is required");
|
|
122
56
|
}
|
|
57
|
+
return topicId;
|
|
58
|
+
}
|
|
59
|
+
const AUDIT_NODE_REFERENCE_KEY_PATTERN = /(^|_)(id|nodeid|beliefid|resourceid|targetid|sourceid|subjectid|globalid|entityid|recordid|fromnodeid|tonodeid|linkednodeid|linkedbeliefid|nodeids|beliefids|resourceids)$/i;
|
|
60
|
+
export function matchesAuditNodeReference(value, nodeId) {
|
|
123
61
|
if (Array.isArray(value)) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
62
|
+
return value.some((entry) => matchesAuditNodeReference(entry, nodeId));
|
|
63
|
+
}
|
|
64
|
+
if (!value || typeof value !== "object") {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return Object.entries(value).some(([key, entry]) => {
|
|
68
|
+
if (typeof entry === "string" &&
|
|
69
|
+
entry === nodeId &&
|
|
70
|
+
AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key)) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if (Array.isArray(entry) &&
|
|
74
|
+
AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key) &&
|
|
75
|
+
entry.some((item) => item === nodeId)) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
return matchesAuditNodeReference(entry, nodeId);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export function requireText(args) {
|
|
82
|
+
const text = resolveText(args);
|
|
83
|
+
if (!text) {
|
|
84
|
+
throw new Error("text is required");
|
|
85
|
+
}
|
|
86
|
+
return text;
|
|
87
|
+
}
|
|
88
|
+
export function requireBaseRate(args) {
|
|
89
|
+
const baseRate = typeof args.baseRate === "number" && Number.isFinite(args.baseRate)
|
|
90
|
+
? args.baseRate
|
|
91
|
+
: 0.5;
|
|
92
|
+
if (baseRate < 0 || baseRate > 1) {
|
|
93
|
+
throw new Error("baseRate must be within [0, 1].");
|
|
94
|
+
}
|
|
95
|
+
return baseRate;
|
|
96
|
+
}
|
|
97
|
+
export function sdkQueryString(input) {
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
for (const [key, value] of Object.entries(input)) {
|
|
100
|
+
if (value === undefined || value === null) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(value)) {
|
|
104
|
+
if (value.length > 0) {
|
|
105
|
+
params.set(key, value.join(","));
|
|
106
|
+
}
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
params.set(key, String(value));
|
|
128
110
|
}
|
|
129
|
-
params.
|
|
130
|
-
|
|
131
|
-
const serialized = params.toString();
|
|
132
|
-
return serialized ? `?${serialized}` : "";
|
|
111
|
+
const serialized = params.toString();
|
|
112
|
+
return serialized ? `?${serialized}` : "";
|
|
133
113
|
}
|
|
134
|
-
|
|
135
|
-
export { asEdgeArray, asNodeArray, buildBeliefsArchivePayload, buildBeliefsRefinePayload, matchesAuditNodeReference, normalizeCustomNamespace, normalizeCustomToolPayload, requireBaseRate, requireText, requireTopicId, requireTopicOrProjectId, resolveCustomToolFullName, sdkQueryString };
|
|
136
|
-
//# sourceMappingURL=clientHelpers.js.map
|
|
137
114
|
//# sourceMappingURL=clientHelpers.js.map
|
|
@@ -1,54 +1,8 @@
|
|
|
1
|
-
import { ClientNamespaceContext } from
|
|
2
|
-
import { BeliefsCompatCreateInput,
|
|
3
|
-
import { FunctionSurfaceInput } from
|
|
4
|
-
import { JsonObject } from
|
|
5
|
-
|
|
6
|
-
import './adminClient.js';
|
|
7
|
-
import './coreClient.js';
|
|
8
|
-
import '@lucern/transport-core';
|
|
9
|
-
import './authContext.js';
|
|
10
|
-
import './contracts/auth-session.contract.js';
|
|
11
|
-
import './controlObjectOwnership.js';
|
|
12
|
-
import './answersClient.js';
|
|
13
|
-
import './audiencesClient.js';
|
|
14
|
-
import './auditClient.js';
|
|
15
|
-
import './beliefsClient.js';
|
|
16
|
-
import './opinion.js';
|
|
17
|
-
import './contextClient.js';
|
|
18
|
-
import './contextTypes.js';
|
|
19
|
-
import './control-plane.js';
|
|
20
|
-
import './decisionsClient.js';
|
|
21
|
-
import './embeddingsClient.js';
|
|
22
|
-
import './boundaryClientSurface.js';
|
|
23
|
-
import './eventingClient.js';
|
|
24
|
-
import './evidenceClient.js';
|
|
25
|
-
import './graphAnalysisClient.js';
|
|
26
|
-
import '@lucern/contracts';
|
|
27
|
-
import './graphClient.js';
|
|
28
|
-
import './graphRecommendationsClient.js';
|
|
29
|
-
import './graphStateClassifierClient.js';
|
|
30
|
-
import './harnessClient.js';
|
|
31
|
-
import './identityClient.js';
|
|
32
|
-
import './jobsClient.js';
|
|
33
|
-
import './learningClient.js';
|
|
34
|
-
import './modelRuntimeClient.js';
|
|
35
|
-
import './ontologyClient.js';
|
|
36
|
-
import './ontologyLinksClient.js';
|
|
37
|
-
import './orgGraphSearchClient.js';
|
|
38
|
-
import './packsClient.js';
|
|
39
|
-
import './policyClient.js';
|
|
40
|
-
import './reportsClient.js';
|
|
41
|
-
import './schemaClient.js';
|
|
42
|
-
import './sourcesClient.js';
|
|
43
|
-
import './telemetryClient.js';
|
|
44
|
-
import './toolRegistryClient.js';
|
|
45
|
-
import './topicsClient.js';
|
|
46
|
-
import './workflowClient.js';
|
|
47
|
-
import './contracts/lens-workflow.contract.js';
|
|
48
|
-
import './contracts/lens-filter.contract.js';
|
|
49
|
-
import './contracts/workflow-runtime.contract.js';
|
|
50
|
-
|
|
51
|
-
declare function createClientKnowledgeNamespaces(ctx: ClientNamespaceContext): {
|
|
1
|
+
import type { ClientNamespaceContext } from "./clientAssemblyTypes";
|
|
2
|
+
import type { BeliefsCompatCreateInput, BeliefsCompatForkInput, BeliefsCompatUpdateConfidenceInput } from "./clientConfig";
|
|
3
|
+
import type { FunctionSurfaceInput } from "./generated/functionSurface";
|
|
4
|
+
import type { JsonObject } from "./types";
|
|
5
|
+
export declare function createClientKnowledgeNamespaces(ctx: ClientNamespaceContext): {
|
|
52
6
|
events: {
|
|
53
7
|
list(query?: Parameters<(...args: any[]) => any>[0]): any;
|
|
54
8
|
replay(input: Parameters<(...args: any[]) => any>[0]): any;
|
|
@@ -257,5 +211,4 @@ declare function createClientKnowledgeNamespaces(ctx: ClientNamespaceContext): {
|
|
|
257
211
|
}): Promise<any>;
|
|
258
212
|
};
|
|
259
213
|
};
|
|
260
|
-
|
|
261
|
-
export { createClientKnowledgeNamespaces };
|
|
214
|
+
//# sourceMappingURL=clientKnowledgeNamespaces.d.ts.map
|