@lucern/sdk 1.0.11 → 1.0.13
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 +10 -0
- package/README.md +24 -27
- 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 +16 -67
- package/dist/beliefs/index.js +20 -10181
- package/dist/beliefs/lifecycle.d.ts +10 -11
- package/dist/beliefs/lifecycle.js +78 -80
- package/dist/beliefsClient.d.ts +30 -35
- package/dist/beliefsClient.js +238 -994
- package/dist/boundaryClientSurface.d.ts +11 -16
- package/dist/boundaryClientSurface.js +49 -68
- package/dist/client.d.ts +82 -113
- package/dist/client.js +232 -10155
- 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 +24 -14
- package/dist/clientEvidenceCompat.js +56 -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 +24 -54
- package/dist/clientKnowledgeNamespaces.js +506 -506
- package/dist/clientLocalHelpers.d.ts +11 -56
- package/dist/clientLocalHelpers.js +503 -732
- package/dist/clientPlatformNamespaces.d.ts +5 -53
- package/dist/clientPlatformNamespaces.js +229 -323
- 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 -10175
- 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 -10177
- 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 -10176
- 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 +42 -61
- package/dist/evidence/index.js +13 -10176
- 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 +93 -296
- package/dist/gatewayFacades.factories.d.ts +209 -14
- package/dist/gatewayFacades.factories.js +545 -2228
- 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 -13313
- 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 -10175
- 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 -10177
- package/dist/ontologies/index.d.ts +21 -73
- package/dist/ontologies/index.js +14 -10178
- 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 -10178
- 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 -10178
- 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 -10178
- 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. */
|
|
@@ -84,24 +79,25 @@ type ModulateConfidenceInputBase = {
|
|
|
84
79
|
maxInlinePropagationTargets?: number;
|
|
85
80
|
};
|
|
86
81
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
82
|
+
* @deprecated Public callers should not submit confidence tuples directly.
|
|
83
|
+
* Attach supporting or contradicting evidence and let the kernel derive the
|
|
84
|
+
* next subjective-logic opinion.
|
|
89
85
|
*/
|
|
90
|
-
type ModulateConfidenceOpinionInput = ModulateConfidenceInputBase & {
|
|
86
|
+
export type ModulateConfidenceOpinionInput = ModulateConfidenceInputBase & {
|
|
91
87
|
opinion: Opinion;
|
|
92
88
|
};
|
|
93
|
-
type ModulateConfidenceInput = ModulateConfidenceOpinionInput;
|
|
89
|
+
export type ModulateConfidenceInput = ModulateConfidenceOpinionInput;
|
|
94
90
|
/**
|
|
95
91
|
* Input for forking a scored belief into a new formulation.
|
|
96
92
|
* Scored beliefs are immutable — fork to evolve understanding.
|
|
97
93
|
*/
|
|
98
|
-
type ForkBeliefInput = {
|
|
94
|
+
export type ForkBeliefInput = {
|
|
99
95
|
newFormulation: string;
|
|
100
96
|
forkReason?: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse" | "manual";
|
|
101
97
|
rationale?: string;
|
|
102
98
|
};
|
|
103
99
|
/** Input for changing a belief's lifecycle status. */
|
|
104
|
-
type UpdateBeliefStatusInput = {
|
|
100
|
+
export type UpdateBeliefStatusInput = {
|
|
105
101
|
id?: string;
|
|
106
102
|
nodeId?: string;
|
|
107
103
|
beliefId?: string;
|
|
@@ -109,14 +105,14 @@ type UpdateBeliefStatusInput = {
|
|
|
109
105
|
reason?: string;
|
|
110
106
|
};
|
|
111
107
|
/** Input for updating a belief's rationale without refining its text. */
|
|
112
|
-
type UpdateBeliefRationaleInput = {
|
|
108
|
+
export type UpdateBeliefRationaleInput = {
|
|
113
109
|
id?: string;
|
|
114
110
|
nodeId?: string;
|
|
115
111
|
beliefId?: string;
|
|
116
112
|
rationale?: string;
|
|
117
113
|
};
|
|
118
114
|
/** Input for creating a belief-to-belief reasoning edge. */
|
|
119
|
-
type LinkBeliefsInput = {
|
|
115
|
+
export type LinkBeliefsInput = {
|
|
120
116
|
fromNodeId: string;
|
|
121
117
|
toNodeId: string;
|
|
122
118
|
edgeType: string;
|
|
@@ -124,7 +120,7 @@ type LinkBeliefsInput = {
|
|
|
124
120
|
context?: string;
|
|
125
121
|
};
|
|
126
122
|
/** Input for unlinking a belief from an attached evidence item. */
|
|
127
|
-
type UnlinkBeliefEvidenceInput = {
|
|
123
|
+
export type UnlinkBeliefEvidenceInput = {
|
|
128
124
|
beliefNodeId?: string;
|
|
129
125
|
beliefId?: string;
|
|
130
126
|
nodeId?: string;
|
|
@@ -132,14 +128,14 @@ type UnlinkBeliefEvidenceInput = {
|
|
|
132
128
|
evidenceId?: string;
|
|
133
129
|
};
|
|
134
130
|
/** Input for updating a belief's criticality classification. */
|
|
135
|
-
type UpdateBeliefCriticalityInput = {
|
|
131
|
+
export type UpdateBeliefCriticalityInput = {
|
|
136
132
|
id?: string;
|
|
137
133
|
nodeId?: string;
|
|
138
134
|
beliefId?: string;
|
|
139
135
|
criticality: "blocking" | "important" | "supporting" | "essential" | "nice_to_have";
|
|
140
136
|
};
|
|
141
137
|
/** Input for bulk-updating multiple beliefs' criticality. */
|
|
142
|
-
type BatchUpdateBeliefCriticalityInput = {
|
|
138
|
+
export type BatchUpdateBeliefCriticalityInput = {
|
|
143
139
|
updates: Array<{
|
|
144
140
|
beliefId: string;
|
|
145
141
|
criticality: "blocking" | "important" | "supporting" | "essential" | "nice_to_have";
|
|
@@ -151,7 +147,7 @@ type BatchUpdateBeliefCriticalityInput = {
|
|
|
151
147
|
}>;
|
|
152
148
|
};
|
|
153
149
|
/** Input for moving beliefs into a different topic scope. */
|
|
154
|
-
type ReassignBeliefsTopicInput = {
|
|
150
|
+
export type ReassignBeliefsTopicInput = {
|
|
155
151
|
beliefNodeIds?: string[];
|
|
156
152
|
beliefIds?: string[];
|
|
157
153
|
targetTopicId: string;
|
|
@@ -161,17 +157,17 @@ type ReassignBeliefsTopicInput = {
|
|
|
161
157
|
* Create the beliefs client for belief lifecycle operations.
|
|
162
158
|
*
|
|
163
159
|
* @param config - Gateway transport configuration.
|
|
164
|
-
* @returns An object with
|
|
160
|
+
* @returns An object with belief lifecycle methods. Confidence is updated by evidence writes.
|
|
165
161
|
*/
|
|
166
|
-
declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
162
|
+
export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
167
163
|
/**
|
|
168
164
|
* Create a belief within a topic scope.
|
|
169
165
|
*/
|
|
170
|
-
createBelief(input: CreateBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
|
|
166
|
+
createBelief(input: CreateBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./types").PlatformBeliefRecord>>;
|
|
171
167
|
/**
|
|
172
168
|
* Refine a draft belief in place.
|
|
173
169
|
*/
|
|
174
|
-
refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
|
|
170
|
+
refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<import("./types").PlatformBeliefRecord>>;
|
|
175
171
|
/**
|
|
176
172
|
* Record a confidence change for an existing belief.
|
|
177
173
|
*/
|
|
@@ -225,5 +221,4 @@ declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
225
221
|
*/
|
|
226
222
|
reassignBeliefsTopic(input: ReassignBeliefsTopicInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
|
|
227
223
|
};
|
|
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 };
|
|
224
|
+
//# sourceMappingURL=beliefsClient.d.ts.map
|