@traits-dev/core 0.1.0

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.
@@ -0,0 +1,135 @@
1
+ import { V as ValidationResult, a as ValidationCheckSummary, b as ValidationDiagnostic, P as PersonalityProfile, r as runTier1Evaluation } from './index-CkGiIKnu.cjs';
2
+ export { C as CompileOptions, c as CompiledPersonality, d as ContextAdaptation, e as ContextResolution, D as DimensionName, f as DimensionObject, g as DimensionShorthand, h as DimensionValue, E as EvalSample, i as ExtendsDiagnostics, j as ExtendsResult, H as HumorDimensionObject, k as HumorDimensionValue, l as HumorStyle, I as ImportOptions, L as Level, T as Tier1Options, m as Tier2Options, n as Tier3Options, o as VocabularyConstraints, p as compileProfile, q as compileResolvedProfile, s as evaluateTier1Response, t as injectPersonality, u as loadProfileFile, v as mapImportAnalysisToProfile, w as normalizeProfile, x as renderImportedProfileYAML, y as resolveActiveContext, z as resolveExtends, A as runImportAnalysis, B as runTier1EvaluationForProfile, F as runTier2Evaluation, G as runTier2EvaluationForProfile, J as runTier3Evaluation, K as runTier3EvaluationForProfile, M as validateEvalScenario, N as validateEvalScenarios, O as validateProfile, Q as validateResolvedProfile } from './index-CkGiIKnu.cjs';
3
+
4
+ type ValidationResultObject = {
5
+ profilePath: string | null;
6
+ parentPath: string | null;
7
+ strict: boolean;
8
+ isValid: boolean;
9
+ exitCode: number;
10
+ checks: Record<string, ValidationCheckSummary>;
11
+ constraintCount: number;
12
+ constraintBreakdown: Record<string, number>;
13
+ diagnostics: {
14
+ errors: ValidationDiagnostic[];
15
+ warnings: ValidationDiagnostic[];
16
+ promotedWarnings: ValidationDiagnostic[];
17
+ effectiveErrors: ValidationDiagnostic[];
18
+ };
19
+ };
20
+ declare function toValidationResultObject(result: Partial<ValidationResult>): ValidationResultObject;
21
+ declare function formatValidationResult(result: Partial<ValidationResult>): string;
22
+
23
+ type CalibrationUpdateItem = {
24
+ dimension?: string;
25
+ level?: string;
26
+ id?: string;
27
+ pattern?: string;
28
+ adherence?: number;
29
+ };
30
+ type CalibrationUpdates = {
31
+ dimensions?: CalibrationUpdateItem[];
32
+ interactions?: CalibrationUpdateItem[];
33
+ };
34
+ type PatternFileData = {
35
+ dimensions?: Record<string, Record<string, Record<string, unknown>>>;
36
+ interactions?: Record<string, Record<string, unknown>>;
37
+ updated_at?: string;
38
+ [key: string]: unknown;
39
+ };
40
+ declare function applyCalibrationUpdates(patternData: PatternFileData, updates: CalibrationUpdates): {
41
+ data: PatternFileData;
42
+ summary: {
43
+ dimension_updates: number;
44
+ interaction_updates: number;
45
+ };
46
+ };
47
+ declare function mergeCalibrationFile(patternFilePath: string, updates: CalibrationUpdates): {
48
+ dimension_updates: number;
49
+ interaction_updates: number;
50
+ };
51
+
52
+ type TierState = {
53
+ tier: number;
54
+ available: boolean;
55
+ implemented: boolean;
56
+ reason: string;
57
+ };
58
+ declare function detectEvalTierAvailability(env?: Record<string, string | undefined>, options?: {
59
+ provider?: string;
60
+ }): Record<number, TierState>;
61
+ declare function resolveTierExecution(requestedTier: number | string, availability: Record<number, TierState>): {
62
+ tier_requested: number;
63
+ tier_executed: number;
64
+ tiers_run: number[];
65
+ blocked: Array<{
66
+ tier: number;
67
+ available: boolean;
68
+ implemented: boolean;
69
+ reason: string;
70
+ }>;
71
+ };
72
+
73
+ type EvalSample = {
74
+ id?: string;
75
+ prompt?: string;
76
+ response?: string;
77
+ };
78
+ type OfflineBaselineOptions = {
79
+ includeHelpfulness?: boolean;
80
+ compiledTier1Report?: {
81
+ average_score?: number;
82
+ } | null;
83
+ };
84
+ declare function runOfflineBaselineScaffold(profile: PersonalityProfile, samples: EvalSample[], options?: OfflineBaselineOptions): {
85
+ type: string;
86
+ deterministic: boolean;
87
+ helpfulness_included: boolean;
88
+ tier1: {
89
+ none: ReturnType<typeof runTier1Evaluation>;
90
+ basic: ReturnType<typeof runTier1Evaluation>;
91
+ deltas: {
92
+ basic_vs_none: number | null;
93
+ compiled_vs_none: number | null;
94
+ compiled_vs_basic: number | null;
95
+ };
96
+ };
97
+ };
98
+
99
+ type FetchLike$1 = (input: string, init?: RequestInit) => Promise<Response>;
100
+ declare function anthropicJudge({ apiKey, systemPrompt, userPrompt, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
101
+ apiKey: string;
102
+ systemPrompt: string;
103
+ userPrompt: string;
104
+ model?: string;
105
+ baseUrl?: string;
106
+ fetchImpl?: FetchLike$1;
107
+ timeoutMs?: number;
108
+ maxRetries?: number;
109
+ retryBaseMs?: number;
110
+ }): Promise<string>;
111
+
112
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
113
+ declare function openAIEmbed({ apiKey, input, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
114
+ apiKey: string;
115
+ input: string;
116
+ model?: string;
117
+ baseUrl?: string;
118
+ fetchImpl?: FetchLike;
119
+ timeoutMs?: number;
120
+ maxRetries?: number;
121
+ retryBaseMs?: number;
122
+ }): Promise<number[]>;
123
+ declare function openAIJudge({ apiKey, systemPrompt, userPrompt, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
124
+ apiKey: string;
125
+ systemPrompt: string;
126
+ userPrompt: string;
127
+ model?: string;
128
+ baseUrl?: string;
129
+ fetchImpl?: FetchLike;
130
+ timeoutMs?: number;
131
+ maxRetries?: number;
132
+ retryBaseMs?: number;
133
+ }): Promise<string>;
134
+
135
+ export { PersonalityProfile, ValidationDiagnostic, ValidationResult, anthropicJudge, applyCalibrationUpdates, detectEvalTierAvailability, formatValidationResult, mergeCalibrationFile, openAIEmbed, openAIJudge, resolveTierExecution, runOfflineBaselineScaffold, runTier1Evaluation, toValidationResultObject };
@@ -0,0 +1,135 @@
1
+ import { V as ValidationResult, a as ValidationCheckSummary, b as ValidationDiagnostic, P as PersonalityProfile, r as runTier1Evaluation } from './index-CkGiIKnu.js';
2
+ export { C as CompileOptions, c as CompiledPersonality, d as ContextAdaptation, e as ContextResolution, D as DimensionName, f as DimensionObject, g as DimensionShorthand, h as DimensionValue, E as EvalSample, i as ExtendsDiagnostics, j as ExtendsResult, H as HumorDimensionObject, k as HumorDimensionValue, l as HumorStyle, I as ImportOptions, L as Level, T as Tier1Options, m as Tier2Options, n as Tier3Options, o as VocabularyConstraints, p as compileProfile, q as compileResolvedProfile, s as evaluateTier1Response, t as injectPersonality, u as loadProfileFile, v as mapImportAnalysisToProfile, w as normalizeProfile, x as renderImportedProfileYAML, y as resolveActiveContext, z as resolveExtends, A as runImportAnalysis, B as runTier1EvaluationForProfile, F as runTier2Evaluation, G as runTier2EvaluationForProfile, J as runTier3Evaluation, K as runTier3EvaluationForProfile, M as validateEvalScenario, N as validateEvalScenarios, O as validateProfile, Q as validateResolvedProfile } from './index-CkGiIKnu.js';
3
+
4
+ type ValidationResultObject = {
5
+ profilePath: string | null;
6
+ parentPath: string | null;
7
+ strict: boolean;
8
+ isValid: boolean;
9
+ exitCode: number;
10
+ checks: Record<string, ValidationCheckSummary>;
11
+ constraintCount: number;
12
+ constraintBreakdown: Record<string, number>;
13
+ diagnostics: {
14
+ errors: ValidationDiagnostic[];
15
+ warnings: ValidationDiagnostic[];
16
+ promotedWarnings: ValidationDiagnostic[];
17
+ effectiveErrors: ValidationDiagnostic[];
18
+ };
19
+ };
20
+ declare function toValidationResultObject(result: Partial<ValidationResult>): ValidationResultObject;
21
+ declare function formatValidationResult(result: Partial<ValidationResult>): string;
22
+
23
+ type CalibrationUpdateItem = {
24
+ dimension?: string;
25
+ level?: string;
26
+ id?: string;
27
+ pattern?: string;
28
+ adherence?: number;
29
+ };
30
+ type CalibrationUpdates = {
31
+ dimensions?: CalibrationUpdateItem[];
32
+ interactions?: CalibrationUpdateItem[];
33
+ };
34
+ type PatternFileData = {
35
+ dimensions?: Record<string, Record<string, Record<string, unknown>>>;
36
+ interactions?: Record<string, Record<string, unknown>>;
37
+ updated_at?: string;
38
+ [key: string]: unknown;
39
+ };
40
+ declare function applyCalibrationUpdates(patternData: PatternFileData, updates: CalibrationUpdates): {
41
+ data: PatternFileData;
42
+ summary: {
43
+ dimension_updates: number;
44
+ interaction_updates: number;
45
+ };
46
+ };
47
+ declare function mergeCalibrationFile(patternFilePath: string, updates: CalibrationUpdates): {
48
+ dimension_updates: number;
49
+ interaction_updates: number;
50
+ };
51
+
52
+ type TierState = {
53
+ tier: number;
54
+ available: boolean;
55
+ implemented: boolean;
56
+ reason: string;
57
+ };
58
+ declare function detectEvalTierAvailability(env?: Record<string, string | undefined>, options?: {
59
+ provider?: string;
60
+ }): Record<number, TierState>;
61
+ declare function resolveTierExecution(requestedTier: number | string, availability: Record<number, TierState>): {
62
+ tier_requested: number;
63
+ tier_executed: number;
64
+ tiers_run: number[];
65
+ blocked: Array<{
66
+ tier: number;
67
+ available: boolean;
68
+ implemented: boolean;
69
+ reason: string;
70
+ }>;
71
+ };
72
+
73
+ type EvalSample = {
74
+ id?: string;
75
+ prompt?: string;
76
+ response?: string;
77
+ };
78
+ type OfflineBaselineOptions = {
79
+ includeHelpfulness?: boolean;
80
+ compiledTier1Report?: {
81
+ average_score?: number;
82
+ } | null;
83
+ };
84
+ declare function runOfflineBaselineScaffold(profile: PersonalityProfile, samples: EvalSample[], options?: OfflineBaselineOptions): {
85
+ type: string;
86
+ deterministic: boolean;
87
+ helpfulness_included: boolean;
88
+ tier1: {
89
+ none: ReturnType<typeof runTier1Evaluation>;
90
+ basic: ReturnType<typeof runTier1Evaluation>;
91
+ deltas: {
92
+ basic_vs_none: number | null;
93
+ compiled_vs_none: number | null;
94
+ compiled_vs_basic: number | null;
95
+ };
96
+ };
97
+ };
98
+
99
+ type FetchLike$1 = (input: string, init?: RequestInit) => Promise<Response>;
100
+ declare function anthropicJudge({ apiKey, systemPrompt, userPrompt, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
101
+ apiKey: string;
102
+ systemPrompt: string;
103
+ userPrompt: string;
104
+ model?: string;
105
+ baseUrl?: string;
106
+ fetchImpl?: FetchLike$1;
107
+ timeoutMs?: number;
108
+ maxRetries?: number;
109
+ retryBaseMs?: number;
110
+ }): Promise<string>;
111
+
112
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
113
+ declare function openAIEmbed({ apiKey, input, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
114
+ apiKey: string;
115
+ input: string;
116
+ model?: string;
117
+ baseUrl?: string;
118
+ fetchImpl?: FetchLike;
119
+ timeoutMs?: number;
120
+ maxRetries?: number;
121
+ retryBaseMs?: number;
122
+ }): Promise<number[]>;
123
+ declare function openAIJudge({ apiKey, systemPrompt, userPrompt, model, baseUrl, fetchImpl, timeoutMs, maxRetries, retryBaseMs }: {
124
+ apiKey: string;
125
+ systemPrompt: string;
126
+ userPrompt: string;
127
+ model?: string;
128
+ baseUrl?: string;
129
+ fetchImpl?: FetchLike;
130
+ timeoutMs?: number;
131
+ maxRetries?: number;
132
+ retryBaseMs?: number;
133
+ }): Promise<string>;
134
+
135
+ export { PersonalityProfile, ValidationDiagnostic, ValidationResult, anthropicJudge, applyCalibrationUpdates, detectEvalTierAvailability, formatValidationResult, mergeCalibrationFile, openAIEmbed, openAIJudge, resolveTierExecution, runOfflineBaselineScaffold, runTier1Evaluation, toValidationResultObject };