@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
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
type BeliefLifecycleStatus = "assumption" | "hypothesis" | "belief" | "fact";
|
|
2
|
-
declare function isBeliefLifecycleStatus(value: unknown): value is BeliefLifecycleStatus;
|
|
3
|
-
declare function isResolvedByConfidence(confidence: unknown): boolean;
|
|
4
|
-
declare function hasResolvedPredictionOutcome(predictionMeta: unknown): boolean;
|
|
5
|
-
declare function shouldTreatBeliefAsFact(opts: {
|
|
1
|
+
export type BeliefLifecycleStatus = "assumption" | "hypothesis" | "belief" | "fact";
|
|
2
|
+
export declare function isBeliefLifecycleStatus(value: unknown): value is BeliefLifecycleStatus;
|
|
3
|
+
export declare function isResolvedByConfidence(confidence: unknown): boolean;
|
|
4
|
+
export declare function hasResolvedPredictionOutcome(predictionMeta: unknown): boolean;
|
|
5
|
+
export declare function shouldTreatBeliefAsFact(opts: {
|
|
6
6
|
confidence?: unknown;
|
|
7
7
|
predictionMeta?: unknown;
|
|
8
8
|
metadata?: Record<string, unknown>;
|
|
9
9
|
}): boolean;
|
|
10
|
-
declare function resolveBeliefLifecycleStatus(opts: {
|
|
10
|
+
export declare function resolveBeliefLifecycleStatus(opts: {
|
|
11
11
|
beliefStatus?: unknown;
|
|
12
12
|
confidence?: unknown;
|
|
13
13
|
predictionMeta?: unknown;
|
|
14
14
|
metadata?: Record<string, unknown>;
|
|
15
15
|
}): BeliefLifecycleStatus;
|
|
16
|
-
declare function isPreValidationBeliefStatus(status: BeliefLifecycleStatus): boolean;
|
|
17
|
-
declare function isPropagationEligibleBeliefStatus(status: BeliefLifecycleStatus): boolean;
|
|
18
|
-
declare function promoteBeliefStatusAfterScoring(status: BeliefLifecycleStatus, opts?: {
|
|
16
|
+
export declare function isPreValidationBeliefStatus(status: BeliefLifecycleStatus): boolean;
|
|
17
|
+
export declare function isPropagationEligibleBeliefStatus(status: BeliefLifecycleStatus): boolean;
|
|
18
|
+
export declare function promoteBeliefStatusAfterScoring(status: BeliefLifecycleStatus, opts?: {
|
|
19
19
|
confidence?: unknown;
|
|
20
20
|
predictionMeta?: unknown;
|
|
21
21
|
metadata?: Record<string, unknown>;
|
|
22
22
|
}): BeliefLifecycleStatus;
|
|
23
|
-
|
|
24
|
-
export { type BeliefLifecycleStatus, hasResolvedPredictionOutcome, isBeliefLifecycleStatus, isPreValidationBeliefStatus, isPropagationEligibleBeliefStatus, isResolvedByConfidence, promoteBeliefStatusAfterScoring, resolveBeliefLifecycleStatus, shouldTreatBeliefAsFact };
|
|
23
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1,98 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"fact"
|
|
1
|
+
const BELIEF_STATUS_VALUES = [
|
|
2
|
+
"assumption",
|
|
3
|
+
"hypothesis",
|
|
4
|
+
"belief",
|
|
5
|
+
"fact",
|
|
7
6
|
];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const RESOLVED_PREDICTION_OUTCOMES = [
|
|
8
|
+
"confirmed",
|
|
9
|
+
"disconfirmed",
|
|
10
|
+
"partial",
|
|
11
|
+
"expired",
|
|
13
12
|
];
|
|
14
|
-
function isBeliefLifecycleStatus(value) {
|
|
15
|
-
|
|
13
|
+
export function isBeliefLifecycleStatus(value) {
|
|
14
|
+
return (typeof value === "string" &&
|
|
15
|
+
BELIEF_STATUS_VALUES.includes(value));
|
|
16
16
|
}
|
|
17
17
|
function normalizeBeliefConfidence(confidence) {
|
|
18
|
-
|
|
18
|
+
if (typeof confidence !== "number" || !Number.isFinite(confidence)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (confidence >= 0 && confidence <= 1) {
|
|
22
|
+
return confidence;
|
|
23
|
+
}
|
|
24
|
+
if (confidence > 1 && confidence <= 100) {
|
|
25
|
+
return confidence / 100;
|
|
26
|
+
}
|
|
19
27
|
return null;
|
|
20
|
-
}
|
|
21
|
-
if (confidence >= 0 && confidence <= 1) {
|
|
22
|
-
return confidence;
|
|
23
|
-
}
|
|
24
|
-
if (confidence > 1 && confidence <= 100) {
|
|
25
|
-
return confidence / 100;
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
28
|
}
|
|
29
|
-
function isResolvedByConfidence(confidence) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
export function isResolvedByConfidence(confidence) {
|
|
30
|
+
const normalized = normalizeBeliefConfidence(confidence);
|
|
31
|
+
if (normalized === null) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return normalized <= 0 || normalized >= 1;
|
|
35
35
|
}
|
|
36
|
-
function hasResolvedPredictionOutcome(predictionMeta) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
export function hasResolvedPredictionOutcome(predictionMeta) {
|
|
37
|
+
if (!predictionMeta || typeof predictionMeta !== "object") {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
const outcome = predictionMeta.outcome;
|
|
41
|
+
return (typeof outcome === "string" &&
|
|
42
|
+
RESOLVED_PREDICTION_OUTCOMES.includes(outcome));
|
|
42
43
|
}
|
|
43
44
|
function getPredictionMetaFromMetadata(metadata) {
|
|
44
|
-
|
|
45
|
+
return metadata?.predictionMeta;
|
|
45
46
|
}
|
|
46
|
-
function shouldTreatBeliefAsFact(opts) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
export function shouldTreatBeliefAsFact(opts) {
|
|
48
|
+
if (isResolvedByConfidence(opts.confidence)) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (hasResolvedPredictionOutcome(opts.predictionMeta)) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (hasResolvedPredictionOutcome(getPredictionMetaFromMetadata(opts.metadata))) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
57
58
|
}
|
|
58
|
-
function resolveBeliefLifecycleStatus(opts) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
const direct = opts.beliefStatus;
|
|
63
|
-
if (isBeliefLifecycleStatus(direct)) {
|
|
64
|
-
const normalized = normalizeBeliefConfidence(opts.confidence);
|
|
65
|
-
if (normalized !== null && isPreValidationBeliefStatus(direct)) {
|
|
66
|
-
return "belief";
|
|
59
|
+
export function resolveBeliefLifecycleStatus(opts) {
|
|
60
|
+
if (shouldTreatBeliefAsFact(opts)) {
|
|
61
|
+
return "fact";
|
|
67
62
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
const direct = opts.beliefStatus;
|
|
64
|
+
if (isBeliefLifecycleStatus(direct)) {
|
|
65
|
+
const normalized = normalizeBeliefConfidence(opts.confidence);
|
|
66
|
+
if (normalized !== null && isPreValidationBeliefStatus(direct)) {
|
|
67
|
+
return "belief";
|
|
68
|
+
}
|
|
69
|
+
return direct;
|
|
75
70
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
const metaStatus = opts.metadata?.beliefStatus;
|
|
72
|
+
if (isBeliefLifecycleStatus(metaStatus)) {
|
|
73
|
+
const normalized = normalizeBeliefConfidence(opts.confidence);
|
|
74
|
+
if (normalized !== null && isPreValidationBeliefStatus(metaStatus)) {
|
|
75
|
+
return "belief";
|
|
76
|
+
}
|
|
77
|
+
return metaStatus;
|
|
78
|
+
}
|
|
79
|
+
return "assumption";
|
|
79
80
|
}
|
|
80
|
-
function isPreValidationBeliefStatus(status) {
|
|
81
|
-
|
|
81
|
+
export function isPreValidationBeliefStatus(status) {
|
|
82
|
+
return status === "assumption" || status === "hypothesis";
|
|
82
83
|
}
|
|
83
|
-
function isPropagationEligibleBeliefStatus(status) {
|
|
84
|
-
|
|
84
|
+
export function isPropagationEligibleBeliefStatus(status) {
|
|
85
|
+
return status === "belief" || status === "fact";
|
|
85
86
|
}
|
|
86
|
-
function promoteBeliefStatusAfterScoring(status, opts) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
export function promoteBeliefStatusAfterScoring(status, opts) {
|
|
88
|
+
if (shouldTreatBeliefAsFact({ ...opts })) {
|
|
89
|
+
return "fact";
|
|
90
|
+
}
|
|
91
|
+
if (isPreValidationBeliefStatus(status)) {
|
|
92
|
+
return "belief";
|
|
93
|
+
}
|
|
94
|
+
return status === "fact" ? "fact" : "belief";
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
-
export { hasResolvedPredictionOutcome, isBeliefLifecycleStatus, isPreValidationBeliefStatus, isPropagationEligibleBeliefStatus, isResolvedByConfidence, promoteBeliefStatusAfterScoring, resolveBeliefLifecycleStatus, shouldTreatBeliefAsFact };
|
|
97
|
-
//# sourceMappingURL=lifecycle.js.map
|
|
98
96
|
//# sourceMappingURL=lifecycle.js.map
|
package/dist/beliefsClient.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
export { LucernApiError }
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import './contracts/lens-filter.contract.js';
|
|
9
|
-
import '@lucern/transport-core';
|
|
10
|
-
import './authContext.js';
|
|
11
|
-
import './contracts/auth-session.contract.js';
|
|
12
|
-
|
|
1
|
+
import { type GatewayClientConfig, LucernApiError, type PlatformGatewaySuccess } from "./coreClient";
|
|
2
|
+
import { type Opinion } from "./opinion";
|
|
3
|
+
import type { ForkBeliefResponse, JsonObject, ModulateConfidenceResponse } from "./types";
|
|
4
|
+
export { LucernApiError };
|
|
5
|
+
export type { PlatformGatewaySuccess } from "./coreClient";
|
|
6
|
+
export type { CreateBeliefResponse, ForkBeliefResponse, ModulateConfidenceResponse, } from "./types";
|
|
7
|
+
export type { Opinion } from "./opinion";
|
|
13
8
|
/** Configuration for the beliefs client. Inherits gateway transport settings. */
|
|
14
|
-
type BeliefsClientConfig = GatewayClientConfig;
|
|
15
|
-
type OpinionHistoryEntry = {
|
|
9
|
+
export type BeliefsClientConfig = GatewayClientConfig;
|
|
10
|
+
export type OpinionHistoryEntry = {
|
|
16
11
|
t: number;
|
|
17
12
|
b: number;
|
|
18
13
|
d: number;
|
|
@@ -29,7 +24,7 @@ type OpinionHistoryEntry = {
|
|
|
29
24
|
slOperator?: string;
|
|
30
25
|
};
|
|
31
26
|
type GatewayRecord = Record<string, unknown>;
|
|
32
|
-
declare function mapOpinionHistoryEntriesFromGatewayData(payload: GatewayRecord): OpinionHistoryEntry[];
|
|
27
|
+
export declare function mapOpinionHistoryEntriesFromGatewayData(payload: GatewayRecord): OpinionHistoryEntry[];
|
|
33
28
|
/**
|
|
34
29
|
* Input for creating a new belief within a topic scope.
|
|
35
30
|
*
|
|
@@ -38,7 +33,7 @@ declare function mapOpinionHistoryEntriesFromGatewayData(payload: GatewayRecord)
|
|
|
38
33
|
* Beliefs start as drafts with a vacuous prior `(0, 0, 1, a)`. When omitted,
|
|
39
34
|
* `baseRate` defaults to the canonical neutral prior `0.5`.
|
|
40
35
|
*/
|
|
41
|
-
type CreateBeliefInput = {
|
|
36
|
+
export type CreateBeliefInput = {
|
|
42
37
|
topicId?: string;
|
|
43
38
|
/** Preferred belief statement alias. */
|
|
44
39
|
text?: string;
|
|
@@ -64,7 +59,7 @@ type CreateBeliefInput = {
|
|
|
64
59
|
* Use `text` as the canonical belief statement.
|
|
65
60
|
* `canonicalText` remains available as a legacy alias for backwards compatibility.
|
|
66
61
|
*/
|
|
67
|
-
type RefineBeliefInput = {
|
|
62
|
+
export type RefineBeliefInput = {
|
|
68
63
|
/** Preferred belief statement alias. */
|
|
69
64
|
text?: string;
|
|
70
65
|
/** @deprecated Use text. */
|
|
@@ -87,21 +82,21 @@ type ModulateConfidenceInputBase = {
|
|
|
87
82
|
* Record an append-only confidence change using an explicit subjective-logic
|
|
88
83
|
* opinion tuple.
|
|
89
84
|
*/
|
|
90
|
-
type ModulateConfidenceOpinionInput = ModulateConfidenceInputBase & {
|
|
85
|
+
export type ModulateConfidenceOpinionInput = ModulateConfidenceInputBase & {
|
|
91
86
|
opinion: Opinion;
|
|
92
87
|
};
|
|
93
|
-
type ModulateConfidenceInput = ModulateConfidenceOpinionInput;
|
|
88
|
+
export type ModulateConfidenceInput = ModulateConfidenceOpinionInput;
|
|
94
89
|
/**
|
|
95
90
|
* Input for forking a scored belief into a new formulation.
|
|
96
91
|
* Scored beliefs are immutable — fork to evolve understanding.
|
|
97
92
|
*/
|
|
98
|
-
type ForkBeliefInput = {
|
|
93
|
+
export type ForkBeliefInput = {
|
|
99
94
|
newFormulation: string;
|
|
100
95
|
forkReason?: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse" | "manual";
|
|
101
96
|
rationale?: string;
|
|
102
97
|
};
|
|
103
98
|
/** Input for changing a belief's lifecycle status. */
|
|
104
|
-
type UpdateBeliefStatusInput = {
|
|
99
|
+
export type UpdateBeliefStatusInput = {
|
|
105
100
|
id?: string;
|
|
106
101
|
nodeId?: string;
|
|
107
102
|
beliefId?: string;
|
|
@@ -109,14 +104,14 @@ type UpdateBeliefStatusInput = {
|
|
|
109
104
|
reason?: string;
|
|
110
105
|
};
|
|
111
106
|
/** Input for updating a belief's rationale without refining its text. */
|
|
112
|
-
type UpdateBeliefRationaleInput = {
|
|
107
|
+
export type UpdateBeliefRationaleInput = {
|
|
113
108
|
id?: string;
|
|
114
109
|
nodeId?: string;
|
|
115
110
|
beliefId?: string;
|
|
116
111
|
rationale?: string;
|
|
117
112
|
};
|
|
118
113
|
/** Input for creating a belief-to-belief reasoning edge. */
|
|
119
|
-
type LinkBeliefsInput = {
|
|
114
|
+
export type LinkBeliefsInput = {
|
|
120
115
|
fromNodeId: string;
|
|
121
116
|
toNodeId: string;
|
|
122
117
|
edgeType: string;
|
|
@@ -124,7 +119,7 @@ type LinkBeliefsInput = {
|
|
|
124
119
|
context?: string;
|
|
125
120
|
};
|
|
126
121
|
/** Input for unlinking a belief from an attached evidence item. */
|
|
127
|
-
type UnlinkBeliefEvidenceInput = {
|
|
122
|
+
export type UnlinkBeliefEvidenceInput = {
|
|
128
123
|
beliefNodeId?: string;
|
|
129
124
|
beliefId?: string;
|
|
130
125
|
nodeId?: string;
|
|
@@ -132,14 +127,14 @@ type UnlinkBeliefEvidenceInput = {
|
|
|
132
127
|
evidenceId?: string;
|
|
133
128
|
};
|
|
134
129
|
/** Input for updating a belief's criticality classification. */
|
|
135
|
-
type UpdateBeliefCriticalityInput = {
|
|
130
|
+
export type UpdateBeliefCriticalityInput = {
|
|
136
131
|
id?: string;
|
|
137
132
|
nodeId?: string;
|
|
138
133
|
beliefId?: string;
|
|
139
134
|
criticality: "blocking" | "important" | "supporting" | "essential" | "nice_to_have";
|
|
140
135
|
};
|
|
141
136
|
/** Input for bulk-updating multiple beliefs' criticality. */
|
|
142
|
-
type BatchUpdateBeliefCriticalityInput = {
|
|
137
|
+
export type BatchUpdateBeliefCriticalityInput = {
|
|
143
138
|
updates: Array<{
|
|
144
139
|
beliefId: string;
|
|
145
140
|
criticality: "blocking" | "important" | "supporting" | "essential" | "nice_to_have";
|
|
@@ -151,7 +146,7 @@ type BatchUpdateBeliefCriticalityInput = {
|
|
|
151
146
|
}>;
|
|
152
147
|
};
|
|
153
148
|
/** Input for moving beliefs into a different topic scope. */
|
|
154
|
-
type ReassignBeliefsTopicInput = {
|
|
149
|
+
export type ReassignBeliefsTopicInput = {
|
|
155
150
|
beliefNodeIds?: string[];
|
|
156
151
|
beliefIds?: string[];
|
|
157
152
|
targetTopicId: string;
|
|
@@ -163,15 +158,15 @@ type ReassignBeliefsTopicInput = {
|
|
|
163
158
|
* @param config - Gateway transport configuration.
|
|
164
159
|
* @returns An object with `createBelief`, `refineBelief`, `modulateConfidence`, and `forkBelief` methods.
|
|
165
160
|
*/
|
|
166
|
-
declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
161
|
+
export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
167
162
|
/**
|
|
168
163
|
* Create a belief within a topic scope.
|
|
169
164
|
*/
|
|
170
|
-
createBelief(input: CreateBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
|
|
165
|
+
createBelief(input: CreateBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./types").PlatformBeliefRecord>>;
|
|
171
166
|
/**
|
|
172
167
|
* Refine a draft belief in place.
|
|
173
168
|
*/
|
|
174
|
-
refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
|
|
169
|
+
refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./types").PlatformBeliefRecord>>;
|
|
175
170
|
/**
|
|
176
171
|
* Record a confidence change for an existing belief.
|
|
177
172
|
*/
|
|
@@ -225,5 +220,4 @@ declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
225
220
|
*/
|
|
226
221
|
reassignBeliefsTopic(input: ReassignBeliefsTopicInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
|
|
227
222
|
};
|
|
228
|
-
|
|
229
|
-
export { type BatchUpdateBeliefCriticalityInput, type BeliefsClientConfig, type CreateBeliefInput, type ForkBeliefInput, ForkBeliefResponse, type LinkBeliefsInput, type ModulateConfidenceInput, type ModulateConfidenceOpinionInput, ModulateConfidenceResponse, Opinion, type OpinionHistoryEntry, PlatformGatewaySuccess, type ReassignBeliefsTopicInput, type RefineBeliefInput, type UnlinkBeliefEvidenceInput, type UpdateBeliefCriticalityInput, type UpdateBeliefRationaleInput, type UpdateBeliefStatusInput, createBeliefsClient, mapOpinionHistoryEntriesFromGatewayData };
|
|
223
|
+
//# sourceMappingURL=beliefsClient.d.ts.map
|