@elizaos/training 2.0.0-alpha.76 → 2.0.0-alpha.78
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/package.json +2 -2
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/.tsbuildinfo +0 -1
- package/dist/adapter.js +0 -59
- package/dist/archetypes/ArchetypeConfigService.js +0 -510
- package/dist/archetypes/derive-archetype.js +0 -196
- package/dist/archetypes/index.js +0 -7
- package/dist/benchmark/ArchetypeMatchupBenchmark.js +0 -547
- package/dist/benchmark/BenchmarkChartGenerator.js +0 -632
- package/dist/benchmark/BenchmarkDataGenerator.js +0 -825
- package/dist/benchmark/BenchmarkDataViewer.js +0 -197
- package/dist/benchmark/BenchmarkHistoryService.js +0 -135
- package/dist/benchmark/BenchmarkRunner.js +0 -483
- package/dist/benchmark/BenchmarkValidator.js +0 -158
- package/dist/benchmark/FastEvalRunner.js +0 -133
- package/dist/benchmark/MetricsValidator.js +0 -104
- package/dist/benchmark/MetricsVisualizer.js +0 -775
- package/dist/benchmark/ModelBenchmarkService.js +0 -433
- package/dist/benchmark/ModelRegistry.js +0 -122
- package/dist/benchmark/RulerBenchmarkIntegration.js +0 -168
- package/dist/benchmark/SimulationA2AInterface.js +0 -683
- package/dist/benchmark/SimulationEngine.js +0 -522
- package/dist/benchmark/TaskRunner.js +0 -60
- package/dist/benchmark/__tests__/BenchmarkRunner.test.js +0 -409
- package/dist/benchmark/__tests__/HeadToHead.test.js +0 -105
- package/dist/benchmark/index.js +0 -23
- package/dist/benchmark/parseSimulationMetrics.js +0 -86
- package/dist/benchmark/simulation-types.js +0 -1
- package/dist/dependencies.js +0 -197
- package/dist/generation/TrajectoryGenerator.js +0 -244
- package/dist/generation/index.js +0 -6
- package/dist/huggingface/HuggingFaceDatasetUploader.js +0 -463
- package/dist/huggingface/HuggingFaceIntegrationService.js +0 -272
- package/dist/huggingface/HuggingFaceModelUploader.js +0 -385
- package/dist/huggingface/index.js +0 -9
- package/dist/huggingface/shared/HuggingFaceUploadUtil.js +0 -144
- package/dist/index.js +0 -41
- package/dist/init-training.js +0 -43
- package/dist/metrics/TrajectoryMetricsExtractor.js +0 -523
- package/dist/metrics/__tests__/TrajectoryMetricsExtractor.test.js +0 -628
- package/dist/metrics/index.js +0 -7
- package/dist/metrics/types.js +0 -21
- package/dist/rubrics/__tests__/index.test.js +0 -150
- package/dist/rubrics/ass-kisser.js +0 -83
- package/dist/rubrics/degen.js +0 -78
- package/dist/rubrics/goody-twoshoes.js +0 -82
- package/dist/rubrics/index.js +0 -184
- package/dist/rubrics/information-trader.js +0 -82
- package/dist/rubrics/infosec.js +0 -99
- package/dist/rubrics/liar.js +0 -102
- package/dist/rubrics/perps-trader.js +0 -85
- package/dist/rubrics/researcher.js +0 -79
- package/dist/rubrics/scammer.js +0 -80
- package/dist/rubrics/social-butterfly.js +0 -71
- package/dist/rubrics/super-predictor.js +0 -95
- package/dist/rubrics/trader.js +0 -65
- package/dist/scoring/ArchetypeScoringService.js +0 -301
- package/dist/scoring/JudgePromptBuilder.js +0 -401
- package/dist/scoring/LLMJudgeCache.js +0 -263
- package/dist/scoring/index.js +0 -8
- package/dist/training/AutomationPipeline.js +0 -714
- package/dist/training/BenchmarkService.js +0 -370
- package/dist/training/ConfigValidator.js +0 -153
- package/dist/training/MarketOutcomesTracker.js +0 -142
- package/dist/training/ModelDeployer.js +0 -128
- package/dist/training/ModelFetcher.js +0 -48
- package/dist/training/ModelSelectionService.js +0 -248
- package/dist/training/ModelUsageVerifier.js +0 -106
- package/dist/training/MultiModelOrchestrator.js +0 -349
- package/dist/training/RLModelConfig.js +0 -295
- package/dist/training/RewardBackpropagationService.js +0 -117
- package/dist/training/RulerScoringService.js +0 -450
- package/dist/training/TrainingMonitor.js +0 -108
- package/dist/training/TrajectoryRecorder.js +0 -281
- package/dist/training/__tests__/TrajectoryRecorder.test.js +0 -363
- package/dist/training/index.js +0 -30
- package/dist/training/logRLConfig.js +0 -29
- package/dist/training/pipeline.js +0 -80
- package/dist/training/storage/ModelStorageService.js +0 -190
- package/dist/training/storage/TrainingDataArchiver.js +0 -136
- package/dist/training/storage/index.js +0 -7
- package/dist/training/types.js +0 -6
- package/dist/training/window-utils.js +0 -100
- package/dist/utils/index.js +0 -73
- package/dist/utils/logger.js +0 -55
- package/dist/utils/snowflake.js +0 -15
- package/dist/utils/synthetic-detector.js +0 -67
- package/vitest.config.ts +0 -8
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Archetype Derivation
|
|
3
|
-
*
|
|
4
|
-
* Derives training archetypes from NPC characteristics.
|
|
5
|
-
* Maps game NPC roles and personalities to training pipeline archetypes.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import { getAvailableArchetypes, normalizeArchetype } from "../rubrics";
|
|
10
|
-
/**
|
|
11
|
-
* Role to archetype mappings
|
|
12
|
-
* Maps game NPC roles to training archetypes
|
|
13
|
-
*/
|
|
14
|
-
const ROLE_TO_ARCHETYPE = {
|
|
15
|
-
// High-reliability roles → ethical archetypes
|
|
16
|
-
insider: "information-trader",
|
|
17
|
-
expert: "researcher",
|
|
18
|
-
whistleblower: "goody-twoshoes",
|
|
19
|
-
analyst: "researcher",
|
|
20
|
-
// Media/content roles
|
|
21
|
-
journalist: "social-butterfly",
|
|
22
|
-
reporter: "social-butterfly",
|
|
23
|
-
influencer: "social-butterfly",
|
|
24
|
-
// Low-reliability roles → deceptive archetypes
|
|
25
|
-
deceiver: "scammer",
|
|
26
|
-
politician: "liar",
|
|
27
|
-
conspiracy: "liar",
|
|
28
|
-
// Trading-focused roles
|
|
29
|
-
trader: "trader",
|
|
30
|
-
investor: "trader",
|
|
31
|
-
speculator: "degen",
|
|
32
|
-
// Default fallback
|
|
33
|
-
unknown: "trader",
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Personality keyword to archetype mappings
|
|
37
|
-
* Used when role doesn't provide clear mapping
|
|
38
|
-
*/
|
|
39
|
-
const PERSONALITY_KEYWORDS = [
|
|
40
|
-
// High priority - distinctive personalities
|
|
41
|
-
{
|
|
42
|
-
keywords: ["manipulative", "deceptive", "cunning", "unethical"],
|
|
43
|
-
archetype: "scammer",
|
|
44
|
-
priority: 10,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
keywords: ["reckless", "impulsive", "yolo", "fomo", "aggressive"],
|
|
48
|
-
archetype: "degen",
|
|
49
|
-
priority: 10,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
keywords: ["honest", "ethical", "helpful", "transparent", "altruistic"],
|
|
53
|
-
archetype: "goody-twoshoes",
|
|
54
|
-
priority: 10,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
keywords: ["thorough", "meticulous", "analytical", "data-driven"],
|
|
58
|
-
archetype: "researcher",
|
|
59
|
-
priority: 8,
|
|
60
|
-
},
|
|
61
|
-
// Medium priority - trading styles
|
|
62
|
-
{
|
|
63
|
-
keywords: ["disciplined", "methodical", "patient", "risk-averse"],
|
|
64
|
-
archetype: "trader",
|
|
65
|
-
priority: 5,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
keywords: ["social", "networker", "outgoing", "community"],
|
|
69
|
-
archetype: "social-butterfly",
|
|
70
|
-
priority: 5,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
keywords: ["flattering", "agreeable", "sycophantic", "pleasing"],
|
|
74
|
-
archetype: "ass-kisser",
|
|
75
|
-
priority: 5,
|
|
76
|
-
},
|
|
77
|
-
// Low priority - general
|
|
78
|
-
{
|
|
79
|
-
keywords: ["suspicious", "secretive", "paranoid", "security"],
|
|
80
|
-
archetype: "infosec",
|
|
81
|
-
priority: 3,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
keywords: ["leverage", "perpetual", "futures", "derivatives"],
|
|
85
|
-
archetype: "perps-trader",
|
|
86
|
-
priority: 3,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
keywords: ["prediction", "forecast", "oracle", "prophet"],
|
|
90
|
-
archetype: "super-predictor",
|
|
91
|
-
priority: 3,
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
/**
|
|
95
|
-
* Derives a training archetype from NPC characteristics
|
|
96
|
-
*
|
|
97
|
-
* @param npc - NPC characteristics to analyze
|
|
98
|
-
* @returns Normalized archetype string
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```typescript
|
|
102
|
-
* const archetype = deriveArchetype({
|
|
103
|
-
* id: 'npc-1',
|
|
104
|
-
* name: 'Insider Ian',
|
|
105
|
-
* role: 'insider',
|
|
106
|
-
* reliability: 0.9
|
|
107
|
-
* });
|
|
108
|
-
* // Returns: 'information-trader'
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
export function deriveArchetype(npc) {
|
|
112
|
-
// 1. Check role mapping first (most reliable)
|
|
113
|
-
if (npc.role) {
|
|
114
|
-
const roleKey = npc.role.toLowerCase().trim();
|
|
115
|
-
const roleArchetype = ROLE_TO_ARCHETYPE[roleKey];
|
|
116
|
-
if (roleArchetype) {
|
|
117
|
-
return normalizeArchetype(roleArchetype);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// 2. Analyze reliability for deception indicators
|
|
121
|
-
// Only classify as deceptive if BOTH low reliability AND willingToLie
|
|
122
|
-
// This avoids misclassifying legitimate low-reliability NPCs (e.g., unreliable but honest)
|
|
123
|
-
if (npc.reliability !== undefined &&
|
|
124
|
-
npc.reliability < 0.3 &&
|
|
125
|
-
npc.willingToLie === true) {
|
|
126
|
-
// Confirmed deceptive: low reliability + actively willing to lie
|
|
127
|
-
return "scammer";
|
|
128
|
-
}
|
|
129
|
-
// Note: High reliability is factored into personality analysis below, not used as an override.
|
|
130
|
-
// This prevents highly reliable journalists from becoming information-traders.
|
|
131
|
-
// 3. Analyze personality keywords
|
|
132
|
-
if (npc.personality) {
|
|
133
|
-
const personalityLower = npc.personality.toLowerCase();
|
|
134
|
-
let bestMatch = null;
|
|
135
|
-
for (const mapping of PERSONALITY_KEYWORDS) {
|
|
136
|
-
const matchCount = mapping.keywords.filter((keyword) => personalityLower.includes(keyword)).length;
|
|
137
|
-
if (matchCount > 0) {
|
|
138
|
-
const effectivePriority = mapping.priority * matchCount;
|
|
139
|
-
if (!bestMatch || effectivePriority > bestMatch.priority) {
|
|
140
|
-
bestMatch = {
|
|
141
|
-
archetype: mapping.archetype,
|
|
142
|
-
priority: effectivePriority,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
if (bestMatch) {
|
|
148
|
-
return normalizeArchetype(bestMatch.archetype);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// 4. Check domain for trading specialization
|
|
152
|
-
if (npc.domain && npc.domain.length > 0) {
|
|
153
|
-
const domains = npc.domain.map((d) => d.toLowerCase());
|
|
154
|
-
if (domains.includes("trading") || domains.includes("finance")) {
|
|
155
|
-
return "trader";
|
|
156
|
-
}
|
|
157
|
-
if (domains.includes("technology") || domains.includes("tech")) {
|
|
158
|
-
return "researcher";
|
|
159
|
-
}
|
|
160
|
-
if (domains.includes("media") || domains.includes("social")) {
|
|
161
|
-
return "social-butterfly";
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
// 5. Default fallback
|
|
165
|
-
return "trader";
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Creates an archetype resolver from a map of NPC characteristics
|
|
169
|
-
*
|
|
170
|
-
* @param npcs - Array of NPC characteristics
|
|
171
|
-
* @returns Function that resolves archetype from NPC ID
|
|
172
|
-
*/
|
|
173
|
-
export function createArchetypeResolver(npcs) {
|
|
174
|
-
const archetypeMap = new Map();
|
|
175
|
-
for (const npc of npcs) {
|
|
176
|
-
archetypeMap.set(npc.id, deriveArchetype(npc));
|
|
177
|
-
}
|
|
178
|
-
return (npcId) => {
|
|
179
|
-
return archetypeMap.get(npcId) ?? "trader";
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Pre-computed archetype mappings for common NPC roles
|
|
184
|
-
* Useful for quick lookups without full NPC analysis
|
|
185
|
-
*/
|
|
186
|
-
export function getRoleArchetype(role) {
|
|
187
|
-
const normalized = role.toLowerCase().trim();
|
|
188
|
-
return ROLE_TO_ARCHETYPE[normalized] ?? "trader";
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Get all valid training archetypes
|
|
192
|
-
* Re-exports from rubrics for convenience
|
|
193
|
-
*/
|
|
194
|
-
export function getValidArchetypes() {
|
|
195
|
-
return getAvailableArchetypes();
|
|
196
|
-
}
|
package/dist/archetypes/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Archetypes Module
|
|
3
|
-
*
|
|
4
|
-
* Central service for managing agent archetype configurations and behaviors.
|
|
5
|
-
*/
|
|
6
|
-
export { ArchetypeConfigService, archetypeConfigService, } from "./ArchetypeConfigService";
|
|
7
|
-
export { createArchetypeResolver, deriveArchetype, getRoleArchetype, getValidArchetypes, } from "./derive-archetype";
|