@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
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - Changing the version string is BREAKING (consumers check it)
|
|
15
15
|
*/
|
|
16
16
|
/** Canonical version string. Consumers MUST check this field for compatibility. */
|
|
17
|
-
declare const CONTEXT_PACK_SCHEMA_VERSION: "1.0.0";
|
|
17
|
+
export declare const CONTEXT_PACK_SCHEMA_VERSION: "1.0.0";
|
|
18
18
|
/**
|
|
19
19
|
* Available ranking profiles for context-pack assembly.
|
|
20
20
|
*
|
|
@@ -22,9 +22,9 @@ declare const CONTEXT_PACK_SCHEMA_VERSION: "1.0.0";
|
|
|
22
22
|
* - `weighted_v1`: Multi-signal scoring combining query relevance, recency, confidence,
|
|
23
23
|
* belief type, priority, and severity with section-specific weight vectors.
|
|
24
24
|
*/
|
|
25
|
-
type ContextRankingProfile = "baseline_v1" | "weighted_v1";
|
|
26
|
-
declare const CONTEXT_RANKING_PROFILES: readonly ContextRankingProfile[];
|
|
27
|
-
declare const DEFAULT_RANKING_PROFILE: ContextRankingProfile;
|
|
25
|
+
export type ContextRankingProfile = "baseline_v1" | "weighted_v1";
|
|
26
|
+
export declare const CONTEXT_RANKING_PROFILES: readonly ContextRankingProfile[];
|
|
27
|
+
export declare const DEFAULT_RANKING_PROFILE: ContextRankingProfile;
|
|
28
28
|
/**
|
|
29
29
|
* Context compilation mode.
|
|
30
30
|
*
|
|
@@ -32,14 +32,14 @@ declare const DEFAULT_RANKING_PROFILE: ContextRankingProfile;
|
|
|
32
32
|
* - `delta`: Diff-aware — adds failure context, verification obligations,
|
|
33
33
|
* and worktree ledger analysis to the standard context pack.
|
|
34
34
|
*/
|
|
35
|
-
type ContextCompilationMode = "standard" | "delta";
|
|
36
|
-
declare const DEFAULT_COMPILATION_MODE: ContextCompilationMode;
|
|
35
|
+
export type ContextCompilationMode = "standard" | "delta";
|
|
36
|
+
export declare const DEFAULT_COMPILATION_MODE: ContextCompilationMode;
|
|
37
37
|
/**
|
|
38
38
|
* The five canonical sections of a context pack.
|
|
39
39
|
* Order matters: invariants are injected first, contradictions last.
|
|
40
40
|
*/
|
|
41
|
-
type ContextPackSectionKey = "invariants" | "activeBeliefs" | "openQuestions" | "recentEvidence" | "contradictions";
|
|
42
|
-
declare const CONTEXT_PACK_SECTION_KEYS: readonly ContextPackSectionKey[];
|
|
41
|
+
export type ContextPackSectionKey = "invariants" | "activeBeliefs" | "openQuestions" | "recentEvidence" | "contradictions";
|
|
42
|
+
export declare const CONTEXT_PACK_SECTION_KEYS: readonly ContextPackSectionKey[];
|
|
43
43
|
/**
|
|
44
44
|
* Token budget allocation ratios per section.
|
|
45
45
|
* These sum to 1.0 and determine how the total tokenBudget is divided.
|
|
@@ -51,19 +51,19 @@ declare const CONTEXT_PACK_SECTION_KEYS: readonly ContextPackSectionKey[];
|
|
|
51
51
|
* - recentEvidence (0.17): Implementation context for grounding
|
|
52
52
|
* - contradictions (0.08): Tension signals, smallest section
|
|
53
53
|
*/
|
|
54
|
-
declare const SECTION_BUDGET_RATIOS: Readonly<Record<ContextPackSectionKey, number>>;
|
|
54
|
+
export declare const SECTION_BUDGET_RATIOS: Readonly<Record<ContextPackSectionKey, number>>;
|
|
55
55
|
/** Minimum allowed token budget. Below this, context packs lose utility. */
|
|
56
|
-
declare const MIN_TOKEN_BUDGET = 400;
|
|
56
|
+
export declare const MIN_TOKEN_BUDGET = 400;
|
|
57
57
|
/** Maximum allowed token budget. Above this, context packs bloat prompts. */
|
|
58
|
-
declare const MAX_TOKEN_BUDGET = 8000;
|
|
58
|
+
export declare const MAX_TOKEN_BUDGET = 8000;
|
|
59
59
|
/** Default token budget when caller does not specify. */
|
|
60
|
-
declare const DEFAULT_TOKEN_BUDGET = 1800;
|
|
60
|
+
export declare const DEFAULT_TOKEN_BUDGET = 1800;
|
|
61
61
|
/** Default max items per section. */
|
|
62
|
-
declare const DEFAULT_SECTION_LIMIT = 8;
|
|
62
|
+
export declare const DEFAULT_SECTION_LIMIT = 8;
|
|
63
63
|
/** Hard ceiling on items per section. */
|
|
64
|
-
declare const MAX_SECTION_LIMIT = 25;
|
|
64
|
+
export declare const MAX_SECTION_LIMIT = 25;
|
|
65
65
|
/** Minimum contradiction section budget floor (tokens). */
|
|
66
|
-
declare const MIN_CONTRADICTION_BUDGET = 40;
|
|
66
|
+
export declare const MIN_CONTRADICTION_BUDGET = 40;
|
|
67
67
|
/**
|
|
68
68
|
* Weight vectors for the weighted_v1 ranking profile.
|
|
69
69
|
* Each section has a different signal mix:
|
|
@@ -75,7 +75,7 @@ declare const MIN_CONTRADICTION_BUDGET = 40;
|
|
|
75
75
|
* - priority: Question priority (critical > high > medium > low)
|
|
76
76
|
* - severity: Contradiction severity (critical > high > medium > low)
|
|
77
77
|
*/
|
|
78
|
-
type RankingWeightVector = {
|
|
78
|
+
export type RankingWeightVector = {
|
|
79
79
|
query: number;
|
|
80
80
|
recency: number;
|
|
81
81
|
confidence?: number;
|
|
@@ -83,35 +83,35 @@ type RankingWeightVector = {
|
|
|
83
83
|
priority?: number;
|
|
84
84
|
severity?: number;
|
|
85
85
|
};
|
|
86
|
-
declare const RANKING_WEIGHTS: Readonly<Record<ContextPackSectionKey, RankingWeightVector>>;
|
|
86
|
+
export declare const RANKING_WEIGHTS: Readonly<Record<ContextPackSectionKey, RankingWeightVector>>;
|
|
87
87
|
/** Recency decay half-life in days. After 30 days, recency score = 0.5. */
|
|
88
|
-
declare const RECENCY_HALF_LIFE_DAYS = 30;
|
|
88
|
+
export declare const RECENCY_HALF_LIFE_DAYS = 30;
|
|
89
89
|
/**
|
|
90
90
|
* Ranking weight vector for the relatedEntities section.
|
|
91
91
|
* Entities are ranked by query relevance and connectivity (bridge edge count).
|
|
92
92
|
* Separate from RANKING_WEIGHTS because entities are not part of the
|
|
93
93
|
* token-budgeted injection plan.
|
|
94
94
|
*/
|
|
95
|
-
declare const ENTITY_RANKING_WEIGHTS: {
|
|
95
|
+
export declare const ENTITY_RANKING_WEIGHTS: {
|
|
96
96
|
readonly query: 0.4;
|
|
97
97
|
readonly connectivity: 0.6;
|
|
98
98
|
};
|
|
99
99
|
/** Default max entities to include in the context pack. */
|
|
100
|
-
declare const DEFAULT_ENTITY_LIMIT = 10;
|
|
100
|
+
export declare const DEFAULT_ENTITY_LIMIT = 10;
|
|
101
101
|
/** Hard ceiling on entities per context pack. */
|
|
102
|
-
declare const MAX_ENTITY_LIMIT = 50;
|
|
102
|
+
export declare const MAX_ENTITY_LIMIT = 50;
|
|
103
103
|
/**
|
|
104
104
|
* Bonus multiplier for belief types in ranking.
|
|
105
105
|
* Invariants get 1.0, unknown types get 0.4.
|
|
106
106
|
*/
|
|
107
|
-
declare const BELIEF_TYPE_BONUS: Readonly<Record<string, number>>;
|
|
108
|
-
declare const DEFAULT_BELIEF_TYPE_BONUS = 0.4;
|
|
109
|
-
declare const PRIORITY_SCORES: Readonly<Record<string, number>>;
|
|
110
|
-
declare const DEFAULT_PRIORITY_SCORE = 0.5;
|
|
111
|
-
declare const SEVERITY_SCORES: Readonly<Record<string, number>>;
|
|
112
|
-
declare const DEFAULT_SEVERITY_SCORE = 0.5;
|
|
107
|
+
export declare const BELIEF_TYPE_BONUS: Readonly<Record<string, number>>;
|
|
108
|
+
export declare const DEFAULT_BELIEF_TYPE_BONUS = 0.4;
|
|
109
|
+
export declare const PRIORITY_SCORES: Readonly<Record<string, number>>;
|
|
110
|
+
export declare const DEFAULT_PRIORITY_SCORE = 0.5;
|
|
111
|
+
export declare const SEVERITY_SCORES: Readonly<Record<string, number>>;
|
|
112
|
+
export declare const DEFAULT_SEVERITY_SCORE = 0.5;
|
|
113
113
|
/** A ranked belief in the invariants or activeBeliefs section. */
|
|
114
|
-
type ContextPackBelief = {
|
|
114
|
+
export type ContextPackBelief = {
|
|
115
115
|
nodeId: string;
|
|
116
116
|
canonicalText: string;
|
|
117
117
|
confidence: number | null;
|
|
@@ -124,7 +124,7 @@ type ContextPackBelief = {
|
|
|
124
124
|
justification?: string;
|
|
125
125
|
};
|
|
126
126
|
/** A ranked question in the openQuestions section. */
|
|
127
|
-
type ContextPackQuestion = {
|
|
127
|
+
export type ContextPackQuestion = {
|
|
128
128
|
questionId: string;
|
|
129
129
|
text: string;
|
|
130
130
|
status: string;
|
|
@@ -135,7 +135,7 @@ type ContextPackQuestion = {
|
|
|
135
135
|
justification?: string;
|
|
136
136
|
};
|
|
137
137
|
/** A ranked evidence item in the recentEvidence section. */
|
|
138
|
-
type ContextPackEvidence = {
|
|
138
|
+
export type ContextPackEvidence = {
|
|
139
139
|
nodeId: string;
|
|
140
140
|
canonicalText: string;
|
|
141
141
|
sourceUrl: string | null;
|
|
@@ -146,7 +146,7 @@ type ContextPackEvidence = {
|
|
|
146
146
|
justification?: string;
|
|
147
147
|
};
|
|
148
148
|
/** A ranked contradiction in the contradictions section. */
|
|
149
|
-
type ContextPackContradiction = {
|
|
149
|
+
export type ContextPackContradiction = {
|
|
150
150
|
contradictionId: string;
|
|
151
151
|
severity: string;
|
|
152
152
|
status: string;
|
|
@@ -161,7 +161,7 @@ type ContextPackContradiction = {
|
|
|
161
161
|
* to beliefs via bridge edges. They provide the "reality anchor" that makes
|
|
162
162
|
* the reasoning graph domain-aware.
|
|
163
163
|
*/
|
|
164
|
-
type ContextPackEntity = {
|
|
164
|
+
export type ContextPackEntity = {
|
|
165
165
|
/** Convex document ID of the entity node. */
|
|
166
166
|
nodeId: string;
|
|
167
167
|
/** Entity type (e.g., "company", "person", "function"). */
|
|
@@ -181,7 +181,7 @@ type ContextPackEntity = {
|
|
|
181
181
|
* A lattice seed entry representing a belief that was auto-generated
|
|
182
182
|
* to cover an ontology entity type within a topic scope.
|
|
183
183
|
*/
|
|
184
|
-
type BeliefLatticeSeed = {
|
|
184
|
+
export type BeliefLatticeSeed = {
|
|
185
185
|
/** The belief node ID that was created or already existed. */
|
|
186
186
|
beliefNodeId: string;
|
|
187
187
|
/** The entity type this seed belief covers. */
|
|
@@ -192,7 +192,7 @@ type BeliefLatticeSeed = {
|
|
|
192
192
|
canonicalText: string;
|
|
193
193
|
};
|
|
194
194
|
/** Counts and scoped health signals for the context pack. */
|
|
195
|
-
type ContextPackSummary = {
|
|
195
|
+
export type ContextPackSummary = {
|
|
196
196
|
totalBeliefs: number;
|
|
197
197
|
invariants: number;
|
|
198
198
|
openQuestions: number;
|
|
@@ -205,7 +205,7 @@ type ContextPackSummary = {
|
|
|
205
205
|
query: string | null;
|
|
206
206
|
};
|
|
207
207
|
/** A failed approach surfaced from the failure log for anti-repetition. */
|
|
208
|
-
type ContextPackFailure = {
|
|
208
|
+
export type ContextPackFailure = {
|
|
209
209
|
/** Lucern attempt/evidence node ID. */
|
|
210
210
|
attemptId: string;
|
|
211
211
|
/** What was tried. */
|
|
@@ -218,14 +218,14 @@ type ContextPackFailure = {
|
|
|
218
218
|
score: number;
|
|
219
219
|
};
|
|
220
220
|
/** Failure context section appended to context packs in delta mode. */
|
|
221
|
-
type ContextPackFailureContext = {
|
|
221
|
+
export type ContextPackFailureContext = {
|
|
222
222
|
/** Ranked failed approaches relevant to the current query. */
|
|
223
223
|
failures: ContextPackFailure[];
|
|
224
224
|
/** IDs of items suppressed from other sections due to anti-repetition. */
|
|
225
225
|
suppressedIds: string[];
|
|
226
226
|
};
|
|
227
227
|
/** A verification obligation surfaced by delta compilation. */
|
|
228
|
-
type VerificationObligation = {
|
|
228
|
+
export type VerificationObligation = {
|
|
229
229
|
/** What must be verified. */
|
|
230
230
|
description: string;
|
|
231
231
|
/** Source of the obligation (e.g., "belief:xyz confidence drop"). */
|
|
@@ -234,7 +234,7 @@ type VerificationObligation = {
|
|
|
234
234
|
severity: "critical" | "high" | "medium" | "low";
|
|
235
235
|
};
|
|
236
236
|
/** Delta report appended to context packs when mode = "delta". */
|
|
237
|
-
type ContextPackDeltaReport = {
|
|
237
|
+
export type ContextPackDeltaReport = {
|
|
238
238
|
/** Items that changed since the reference point (new, updated, removed). */
|
|
239
239
|
changedItems: Array<{
|
|
240
240
|
id: string;
|
|
@@ -251,14 +251,14 @@ type ContextPackDeltaReport = {
|
|
|
251
251
|
* Per-section weight overrides that domain packs can apply.
|
|
252
252
|
* Overrides merge with RANKING_WEIGHTS — only specified fields replace defaults.
|
|
253
253
|
*/
|
|
254
|
-
type PackWeightOverride = {
|
|
254
|
+
export type PackWeightOverride = {
|
|
255
255
|
/** Which section to override weights for. */
|
|
256
256
|
section: ContextPackSectionKey;
|
|
257
257
|
/** Partial weight vector — only specified fields replace defaults. */
|
|
258
258
|
weights: Partial<RankingWeightVector>;
|
|
259
259
|
};
|
|
260
260
|
/** Token-budgeted section selections for prompt injection. */
|
|
261
|
-
type ContextPackInjectionPolicy = {
|
|
261
|
+
export type ContextPackInjectionPolicy = {
|
|
262
262
|
/** Total token budget for the entire context pack. */
|
|
263
263
|
tokenBudget: number;
|
|
264
264
|
/** Estimated tokens consumed across all sections. */
|
|
@@ -278,7 +278,7 @@ type ContextPackInjectionPolicy = {
|
|
|
278
278
|
}>;
|
|
279
279
|
};
|
|
280
280
|
/** Telemetry for context pack assembly. */
|
|
281
|
-
type ContextPackDiagnostics = {
|
|
281
|
+
export type ContextPackDiagnostics = {
|
|
282
282
|
/** Total candidates scored across all sections. */
|
|
283
283
|
itemsScored: number;
|
|
284
284
|
/** Ratio of estimatedTokens / tokenBudget. Range [0, 1+]. */
|
|
@@ -290,7 +290,7 @@ type ContextPackDiagnostics = {
|
|
|
290
290
|
* This preserves the existing external shape while the canonical compiler
|
|
291
291
|
* contract evolves in parallel as ContextPackV1.
|
|
292
292
|
*/
|
|
293
|
-
type PublicContextBelief = {
|
|
293
|
+
export type PublicContextBelief = {
|
|
294
294
|
beliefId: string;
|
|
295
295
|
text: string;
|
|
296
296
|
confidence: number | null;
|
|
@@ -300,7 +300,7 @@ type PublicContextBelief = {
|
|
|
300
300
|
score: number;
|
|
301
301
|
justification?: string;
|
|
302
302
|
};
|
|
303
|
-
type PublicContextQuestion = {
|
|
303
|
+
export type PublicContextQuestion = {
|
|
304
304
|
questionId: string;
|
|
305
305
|
text: string;
|
|
306
306
|
status: string;
|
|
@@ -309,7 +309,7 @@ type PublicContextQuestion = {
|
|
|
309
309
|
score: number;
|
|
310
310
|
justification?: string;
|
|
311
311
|
};
|
|
312
|
-
type PublicContextEvidence = {
|
|
312
|
+
export type PublicContextEvidence = {
|
|
313
313
|
evidenceId: string;
|
|
314
314
|
text: string;
|
|
315
315
|
sourceUrl?: string | null;
|
|
@@ -318,7 +318,7 @@ type PublicContextEvidence = {
|
|
|
318
318
|
score: number;
|
|
319
319
|
justification?: string;
|
|
320
320
|
};
|
|
321
|
-
type PublicContextContradiction = {
|
|
321
|
+
export type PublicContextContradiction = {
|
|
322
322
|
contradictionId: string;
|
|
323
323
|
severity: string;
|
|
324
324
|
status: string;
|
|
@@ -326,7 +326,7 @@ type PublicContextContradiction = {
|
|
|
326
326
|
score: number;
|
|
327
327
|
justification?: string;
|
|
328
328
|
};
|
|
329
|
-
type PublicContextEntity = {
|
|
329
|
+
export type PublicContextEntity = {
|
|
330
330
|
entityId: string;
|
|
331
331
|
entityType: string;
|
|
332
332
|
title: string;
|
|
@@ -336,7 +336,7 @@ type PublicContextEntity = {
|
|
|
336
336
|
score: number;
|
|
337
337
|
metadata?: Record<string, unknown>;
|
|
338
338
|
};
|
|
339
|
-
type PublicContextInjectionPolicy = {
|
|
339
|
+
export type PublicContextInjectionPolicy = {
|
|
340
340
|
tokenBudget: number;
|
|
341
341
|
estimatedTokens: number;
|
|
342
342
|
sectionBudgets: Record<string, number>;
|
|
@@ -349,7 +349,7 @@ type PublicContextInjectionPolicy = {
|
|
|
349
349
|
score: number;
|
|
350
350
|
}>;
|
|
351
351
|
};
|
|
352
|
-
type PublicCompiledContext = {
|
|
352
|
+
export type PublicCompiledContext = {
|
|
353
353
|
schemaVersion: string;
|
|
354
354
|
topicId: string;
|
|
355
355
|
topicName: string;
|
|
@@ -400,7 +400,7 @@ type PublicCompiledContext = {
|
|
|
400
400
|
* in the output. Adding optional fields is non-breaking; removing or
|
|
401
401
|
* changing types is breaking (requires version bump).
|
|
402
402
|
*/
|
|
403
|
-
type ContextPackV1 = {
|
|
403
|
+
export type ContextPackV1 = {
|
|
404
404
|
/** Schema version for compatibility checking. */
|
|
405
405
|
schemaVersion: typeof CONTEXT_PACK_SCHEMA_VERSION;
|
|
406
406
|
/** Resolved topic ID after scope resolution. */
|
|
@@ -450,7 +450,7 @@ type ContextPackV1 = {
|
|
|
450
450
|
* The canonical input schema for `compile_context`.
|
|
451
451
|
* `topicId` is the only scope identifier.
|
|
452
452
|
*/
|
|
453
|
-
type ContextPackRequestV1 = {
|
|
453
|
+
export type ContextPackRequestV1 = {
|
|
454
454
|
/** Topic scope ID (required). */
|
|
455
455
|
topicId: string;
|
|
456
456
|
/** Focus query for relevance ranking. */
|
|
@@ -480,13 +480,12 @@ type ContextPackRequestV1 = {
|
|
|
480
480
|
* Question statuses that are considered "resolved" (not open).
|
|
481
481
|
* Used to filter which questions appear in the openQuestions section.
|
|
482
482
|
*/
|
|
483
|
-
declare const RESOLVED_QUESTION_STATUSES: readonly string[];
|
|
483
|
+
export declare const RESOLVED_QUESTION_STATUSES: readonly string[];
|
|
484
484
|
/**
|
|
485
485
|
* Tokens-per-word multiplier for rough token estimation.
|
|
486
486
|
* Conservative estimate: ~1.35 tokens per whitespace-delimited word.
|
|
487
487
|
*/
|
|
488
|
-
declare const TOKENS_PER_WORD = 1.35;
|
|
488
|
+
export declare const TOKENS_PER_WORD = 1.35;
|
|
489
489
|
/** Minimum token estimate for any non-empty string. */
|
|
490
|
-
declare const MIN_TOKEN_ESTIMATE = 8;
|
|
491
|
-
|
|
492
|
-
export { BELIEF_TYPE_BONUS, type BeliefLatticeSeed, CONTEXT_PACK_SCHEMA_VERSION, CONTEXT_PACK_SECTION_KEYS, CONTEXT_RANKING_PROFILES, type ContextCompilationMode, type ContextPackBelief, type ContextPackContradiction, type ContextPackDeltaReport, type ContextPackDiagnostics, type ContextPackEntity, type ContextPackEvidence, type ContextPackFailure, type ContextPackFailureContext, type ContextPackInjectionPolicy, type ContextPackQuestion, type ContextPackRequestV1, type ContextPackSectionKey, type ContextPackSummary, type ContextPackV1, type ContextRankingProfile, DEFAULT_BELIEF_TYPE_BONUS, DEFAULT_COMPILATION_MODE, DEFAULT_ENTITY_LIMIT, DEFAULT_PRIORITY_SCORE, DEFAULT_RANKING_PROFILE, DEFAULT_SECTION_LIMIT, DEFAULT_SEVERITY_SCORE, DEFAULT_TOKEN_BUDGET, ENTITY_RANKING_WEIGHTS, MAX_ENTITY_LIMIT, MAX_SECTION_LIMIT, MAX_TOKEN_BUDGET, MIN_CONTRADICTION_BUDGET, MIN_TOKEN_BUDGET, MIN_TOKEN_ESTIMATE, PRIORITY_SCORES, type PackWeightOverride, type PublicCompiledContext, type PublicContextBelief, type PublicContextContradiction, type PublicContextEntity, type PublicContextEvidence, type PublicContextInjectionPolicy, type PublicContextQuestion, RANKING_WEIGHTS, RECENCY_HALF_LIFE_DAYS, RESOLVED_QUESTION_STATUSES, type RankingWeightVector, SECTION_BUDGET_RATIOS, SEVERITY_SCORES, TOKENS_PER_WORD, type VerificationObligation };
|
|
490
|
+
export declare const MIN_TOKEN_ESTIMATE = 8;
|
|
491
|
+
//# sourceMappingURL=context-pack.contract.d.ts.map
|
|
@@ -1,98 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Context-Pack Contract v1
|
|
3
|
+
*
|
|
4
|
+
* Canonical TypeScript types and constants for the context-pack output schema.
|
|
5
|
+
* This is the external contract consumed by:
|
|
6
|
+
* - MCP tool `compile_context` (canonical compiler read)
|
|
7
|
+
* - SDK/HTTP consumers that read compiled context packs programmatically
|
|
8
|
+
* - Benchmark harnesses (context-pack-ab)
|
|
9
|
+
*
|
|
10
|
+
* BREAKING CHANGE RULES:
|
|
11
|
+
* - Adding optional fields to ContextPackV1 is NON-breaking
|
|
12
|
+
* - Removing fields or changing types is BREAKING (bump CONTEXT_PACK_SCHEMA_VERSION)
|
|
13
|
+
* - Changing section budget ratios or ranking weights is NON-breaking (tuning)
|
|
14
|
+
* - Changing the version string is BREAKING (consumers check it)
|
|
15
|
+
*/
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// SCHEMA VERSION
|
|
18
|
+
// =============================================================================
|
|
19
|
+
/** Canonical version string. Consumers MUST check this field for compatibility. */
|
|
20
|
+
export const CONTEXT_PACK_SCHEMA_VERSION = "1.0.0";
|
|
21
|
+
export const CONTEXT_RANKING_PROFILES = [
|
|
22
|
+
"baseline_v1",
|
|
23
|
+
"weighted_v1",
|
|
6
24
|
];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
export const DEFAULT_RANKING_PROFILE = "weighted_v1";
|
|
26
|
+
export const DEFAULT_COMPILATION_MODE = "standard";
|
|
27
|
+
export const CONTEXT_PACK_SECTION_KEYS = [
|
|
28
|
+
"invariants",
|
|
29
|
+
"activeBeliefs",
|
|
30
|
+
"openQuestions",
|
|
31
|
+
"recentEvidence",
|
|
32
|
+
"contradictions",
|
|
15
33
|
];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
// =============================================================================
|
|
35
|
+
// SECTION BUDGET RATIOS
|
|
36
|
+
// =============================================================================
|
|
37
|
+
/**
|
|
38
|
+
* Token budget allocation ratios per section.
|
|
39
|
+
* These sum to 1.0 and determine how the total tokenBudget is divided.
|
|
40
|
+
*
|
|
41
|
+
* Rationale:
|
|
42
|
+
* - invariants (0.28): Highest-priority constraints, injected first
|
|
43
|
+
* - activeBeliefs (0.30): Largest section, carries domain knowledge
|
|
44
|
+
* - openQuestions (0.17): Unresolved work items guide agent behavior
|
|
45
|
+
* - recentEvidence (0.17): Implementation context for grounding
|
|
46
|
+
* - contradictions (0.08): Tension signals, smallest section
|
|
47
|
+
*/
|
|
48
|
+
export const SECTION_BUDGET_RATIOS = {
|
|
49
|
+
invariants: 0.28,
|
|
50
|
+
activeBeliefs: 0.3,
|
|
51
|
+
openQuestions: 0.17,
|
|
52
|
+
recentEvidence: 0.17,
|
|
53
|
+
contradictions: 0.08,
|
|
22
54
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// TOKEN BUDGET CONSTRAINTS
|
|
57
|
+
// =============================================================================
|
|
58
|
+
/** Minimum allowed token budget. Below this, context packs lose utility. */
|
|
59
|
+
export const MIN_TOKEN_BUDGET = 400;
|
|
60
|
+
/** Maximum allowed token budget. Above this, context packs bloat prompts. */
|
|
61
|
+
export const MAX_TOKEN_BUDGET = 8000;
|
|
62
|
+
/** Default token budget when caller does not specify. */
|
|
63
|
+
export const DEFAULT_TOKEN_BUDGET = 1800;
|
|
64
|
+
/** Default max items per section. */
|
|
65
|
+
export const DEFAULT_SECTION_LIMIT = 8;
|
|
66
|
+
/** Hard ceiling on items per section. */
|
|
67
|
+
export const MAX_SECTION_LIMIT = 25;
|
|
68
|
+
/** Minimum contradiction section budget floor (tokens). */
|
|
69
|
+
export const MIN_CONTRADICTION_BUDGET = 40;
|
|
70
|
+
export const RANKING_WEIGHTS = {
|
|
71
|
+
invariants: {
|
|
72
|
+
query: 0.35,
|
|
73
|
+
recency: 0.1,
|
|
74
|
+
confidence: 0.4,
|
|
75
|
+
beliefType: 0.15,
|
|
76
|
+
},
|
|
77
|
+
activeBeliefs: {
|
|
78
|
+
query: 0.5,
|
|
79
|
+
recency: 0.2,
|
|
80
|
+
confidence: 0.2,
|
|
81
|
+
beliefType: 0.1,
|
|
82
|
+
},
|
|
83
|
+
openQuestions: {
|
|
84
|
+
query: 0.55,
|
|
85
|
+
recency: 0.2,
|
|
86
|
+
priority: 0.25,
|
|
87
|
+
},
|
|
88
|
+
recentEvidence: {
|
|
89
|
+
query: 0.6,
|
|
90
|
+
recency: 0.4,
|
|
91
|
+
},
|
|
92
|
+
contradictions: {
|
|
93
|
+
query: 0.4,
|
|
94
|
+
recency: 0.2,
|
|
95
|
+
severity: 0.4,
|
|
96
|
+
},
|
|
56
97
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
98
|
+
/** Recency decay half-life in days. After 30 days, recency score = 0.5. */
|
|
99
|
+
export const RECENCY_HALF_LIFE_DAYS = 30;
|
|
100
|
+
/**
|
|
101
|
+
* Ranking weight vector for the relatedEntities section.
|
|
102
|
+
* Entities are ranked by query relevance and connectivity (bridge edge count).
|
|
103
|
+
* Separate from RANKING_WEIGHTS because entities are not part of the
|
|
104
|
+
* token-budgeted injection plan.
|
|
105
|
+
*/
|
|
106
|
+
export const ENTITY_RANKING_WEIGHTS = {
|
|
107
|
+
query: 0.4,
|
|
108
|
+
connectivity: 0.6,
|
|
61
109
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
110
|
+
/** Default max entities to include in the context pack. */
|
|
111
|
+
export const DEFAULT_ENTITY_LIMIT = 10;
|
|
112
|
+
/** Hard ceiling on entities per context pack. */
|
|
113
|
+
export const MAX_ENTITY_LIMIT = 50;
|
|
114
|
+
// =============================================================================
|
|
115
|
+
// BELIEF TYPE BONUS MAP
|
|
116
|
+
// =============================================================================
|
|
117
|
+
/**
|
|
118
|
+
* Bonus multiplier for belief types in ranking.
|
|
119
|
+
* Invariants get 1.0, unknown types get 0.4.
|
|
120
|
+
*/
|
|
121
|
+
export const BELIEF_TYPE_BONUS = {
|
|
122
|
+
invariant: 1.0,
|
|
123
|
+
tenet: 0.8,
|
|
124
|
+
principle: 0.6,
|
|
68
125
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
126
|
+
export const DEFAULT_BELIEF_TYPE_BONUS = 0.4;
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// PRIORITY / SEVERITY SCORE MAPS
|
|
129
|
+
// =============================================================================
|
|
130
|
+
export const PRIORITY_SCORES = {
|
|
131
|
+
critical: 1.0,
|
|
132
|
+
high: 0.85,
|
|
133
|
+
medium: 0.55,
|
|
134
|
+
low: 0.35,
|
|
75
135
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
136
|
+
export const DEFAULT_PRIORITY_SCORE = 0.5;
|
|
137
|
+
export const SEVERITY_SCORES = {
|
|
138
|
+
critical: 1.0,
|
|
139
|
+
high: 0.85,
|
|
140
|
+
medium: 0.6,
|
|
141
|
+
low: 0.35,
|
|
82
142
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
143
|
+
export const DEFAULT_SEVERITY_SCORE = 0.5;
|
|
144
|
+
// =============================================================================
|
|
145
|
+
// RESOLVED QUESTION STATUSES
|
|
146
|
+
// =============================================================================
|
|
147
|
+
/**
|
|
148
|
+
* Question statuses that are considered "resolved" (not open).
|
|
149
|
+
* Used to filter which questions appear in the openQuestions section.
|
|
150
|
+
*/
|
|
151
|
+
export const RESOLVED_QUESTION_STATUSES = [
|
|
152
|
+
"answered",
|
|
153
|
+
"archived",
|
|
154
|
+
"closed",
|
|
155
|
+
"resolved",
|
|
156
|
+
"resolved_support",
|
|
157
|
+
"resolved_contra",
|
|
158
|
+
"belief_forked",
|
|
92
159
|
];
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
160
|
+
// =============================================================================
|
|
161
|
+
// TOKEN ESTIMATION
|
|
162
|
+
// =============================================================================
|
|
163
|
+
/**
|
|
164
|
+
* Tokens-per-word multiplier for rough token estimation.
|
|
165
|
+
* Conservative estimate: ~1.35 tokens per whitespace-delimited word.
|
|
166
|
+
*/
|
|
167
|
+
export const TOKENS_PER_WORD = 1.35;
|
|
168
|
+
/** Minimum token estimate for any non-empty string. */
|
|
169
|
+
export const MIN_TOKEN_ESTIMATE = 8;
|
|
98
170
|
//# sourceMappingURL=context-pack.contract.js.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./context-pack.contract";
|
|
2
|
+
//# sourceMappingURL=contextPack.d.ts.map
|