@elizaos/plugin-training 2.0.3-beta.6 → 2.0.3-beta.7
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/dist/backends/native.d.ts +96 -0
- package/dist/backends/native.d.ts.map +1 -0
- package/dist/backends/native.js +308 -0
- package/dist/backends/native.js.map +1 -0
- package/dist/cli/train.d.ts +22 -0
- package/dist/cli/train.d.ts.map +1 -0
- package/dist/cli/train.js +219 -0
- package/dist/cli/train.js.map +1 -0
- package/dist/core/action-benchmark-runner.d.ts +55 -0
- package/dist/core/action-benchmark-runner.d.ts.map +1 -0
- package/dist/core/action-benchmark-runner.js +341 -0
- package/dist/core/action-benchmark-runner.js.map +1 -0
- package/dist/core/artifact-store.d.ts +72 -0
- package/dist/core/artifact-store.d.ts.map +1 -0
- package/dist/core/artifact-store.js +50 -0
- package/dist/core/artifact-store.js.map +1 -0
- package/dist/core/benchmark-matrix-artifact.d.ts +102 -0
- package/dist/core/benchmark-matrix-artifact.d.ts.map +1 -0
- package/dist/core/benchmark-matrix-artifact.js +381 -0
- package/dist/core/benchmark-matrix-artifact.js.map +1 -0
- package/dist/core/benchmark-vs-cerebras-runner.d.ts +37 -0
- package/dist/core/benchmark-vs-cerebras-runner.d.ts.map +1 -0
- package/dist/core/benchmark-vs-cerebras-runner.js +151 -0
- package/dist/core/benchmark-vs-cerebras-runner.js.map +1 -0
- package/dist/core/cerebras-eval-model.d.ts +54 -0
- package/dist/core/cerebras-eval-model.d.ts.map +1 -0
- package/dist/core/cerebras-eval-model.js +249 -0
- package/dist/core/cerebras-eval-model.js.map +1 -0
- package/dist/core/cli.d.ts +15 -0
- package/dist/core/cli.d.ts.map +1 -0
- package/dist/core/cli.js +1003 -0
- package/dist/core/cli.js.map +1 -0
- package/dist/core/context-audit.d.ts +51 -0
- package/dist/core/context-audit.d.ts.map +1 -0
- package/dist/core/context-audit.js +166 -0
- package/dist/core/context-audit.js.map +1 -0
- package/dist/core/context-catalog.d.ts +47 -0
- package/dist/core/context-catalog.d.ts.map +1 -0
- package/dist/core/context-catalog.js +269 -0
- package/dist/core/context-catalog.js.map +1 -0
- package/dist/core/context-types.d.ts +3 -0
- package/dist/core/context-types.d.ts.map +1 -0
- package/dist/core/context-types.js +18 -0
- package/dist/core/context-types.js.map +1 -0
- package/dist/core/dataset-generator.d.ts +135 -0
- package/dist/core/dataset-generator.d.ts.map +1 -0
- package/dist/core/dataset-generator.js +895 -0
- package/dist/core/dataset-generator.js.map +1 -0
- package/dist/core/eliza1-benchmark-recipe.d.ts +18 -0
- package/dist/core/eliza1-benchmark-recipe.d.ts.map +1 -0
- package/dist/core/eliza1-benchmark-recipe.js +64 -0
- package/dist/core/eliza1-benchmark-recipe.js.map +1 -0
- package/dist/core/eliza1-bundle-stager.d.ts +57 -0
- package/dist/core/eliza1-bundle-stager.d.ts.map +1 -0
- package/dist/core/eliza1-bundle-stager.js +149 -0
- package/dist/core/eliza1-bundle-stager.js.map +1 -0
- package/dist/core/ensure-cron-job.d.ts +53 -0
- package/dist/core/ensure-cron-job.d.ts.map +1 -0
- package/dist/core/ensure-cron-job.js +51 -0
- package/dist/core/ensure-cron-job.js.map +1 -0
- package/dist/core/eval-comparison-artifact.d.ts +72 -0
- package/dist/core/eval-comparison-artifact.d.ts.map +1 -0
- package/dist/core/eval-comparison-artifact.js +281 -0
- package/dist/core/eval-comparison-artifact.js.map +1 -0
- package/dist/core/feed-generation-runner.d.ts +37 -0
- package/dist/core/feed-generation-runner.d.ts.map +1 -0
- package/dist/core/feed-generation-runner.js +232 -0
- package/dist/core/feed-generation-runner.js.map +1 -0
- package/dist/core/html-escape.d.ts +5 -0
- package/dist/core/html-escape.d.ts.map +1 -0
- package/dist/core/html-escape.js +11 -0
- package/dist/core/html-escape.js.map +1 -0
- package/dist/core/huggingface-dataset-ingest.d.ts +52 -0
- package/dist/core/huggingface-dataset-ingest.d.ts.map +1 -0
- package/dist/core/huggingface-dataset-ingest.js +134 -0
- package/dist/core/huggingface-dataset-ingest.js.map +1 -0
- package/dist/core/index.d.ts +29 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +204 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/privacy-filter.d.ts +95 -0
- package/dist/core/privacy-filter.d.ts.map +1 -0
- package/dist/core/privacy-filter.js +324 -0
- package/dist/core/privacy-filter.js.map +1 -0
- package/dist/core/promotion-gate.d.ts +117 -0
- package/dist/core/promotion-gate.d.ts.map +1 -0
- package/dist/core/promotion-gate.js +85 -0
- package/dist/core/promotion-gate.js.map +1 -0
- package/dist/core/promotion-persist.d.ts +116 -0
- package/dist/core/promotion-persist.d.ts.map +1 -0
- package/dist/core/promotion-persist.js +93 -0
- package/dist/core/promotion-persist.js.map +1 -0
- package/dist/core/prompt-compare.d.ts +99 -0
- package/dist/core/prompt-compare.d.ts.map +1 -0
- package/dist/core/prompt-compare.js +210 -0
- package/dist/core/prompt-compare.js.map +1 -0
- package/dist/core/replay-validator.d.ts +136 -0
- package/dist/core/replay-validator.d.ts.map +1 -0
- package/dist/core/replay-validator.js +312 -0
- package/dist/core/replay-validator.js.map +1 -0
- package/dist/core/roleplay-executor.d.ts +123 -0
- package/dist/core/roleplay-executor.d.ts.map +1 -0
- package/dist/core/roleplay-executor.js +675 -0
- package/dist/core/roleplay-executor.js.map +1 -0
- package/dist/core/roleplay-trajectories.d.ts +54 -0
- package/dist/core/roleplay-trajectories.d.ts.map +1 -0
- package/dist/core/roleplay-trajectories.js +88 -0
- package/dist/core/roleplay-trajectories.js.map +1 -0
- package/dist/core/scenario-blueprints.d.ts +62 -0
- package/dist/core/scenario-blueprints.d.ts.map +1 -0
- package/dist/core/scenario-blueprints.js +850 -0
- package/dist/core/scenario-blueprints.js.map +1 -0
- package/dist/core/scenario-runner.d.ts +36 -0
- package/dist/core/scenario-runner.d.ts.map +1 -0
- package/dist/core/scenario-runner.js +216 -0
- package/dist/core/scenario-runner.js.map +1 -0
- package/dist/core/skill-scoring-cron.d.ts +57 -0
- package/dist/core/skill-scoring-cron.d.ts.map +1 -0
- package/dist/core/skill-scoring-cron.js +180 -0
- package/dist/core/skill-scoring-cron.js.map +1 -0
- package/dist/core/test-trajectory-collector.d.ts +37 -0
- package/dist/core/test-trajectory-collector.d.ts.map +1 -0
- package/dist/core/test-trajectory-collector.js +225 -0
- package/dist/core/test-trajectory-collector.js.map +1 -0
- package/dist/core/track-c-queue-task.d.ts +37 -0
- package/dist/core/track-c-queue-task.d.ts.map +1 -0
- package/dist/core/track-c-queue-task.js +104 -0
- package/dist/core/track-c-queue-task.js.map +1 -0
- package/dist/core/training-analysis-index.d.ts +104 -0
- package/dist/core/training-analysis-index.d.ts.map +1 -0
- package/dist/core/training-analysis-index.js +3297 -0
- package/dist/core/training-analysis-index.js.map +1 -0
- package/dist/core/training-collection-runner.d.ts +508 -0
- package/dist/core/training-collection-runner.d.ts.map +1 -0
- package/dist/core/training-collection-runner.js +2299 -0
- package/dist/core/training-collection-runner.js.map +1 -0
- package/dist/core/training-config.d.ts +52 -0
- package/dist/core/training-config.d.ts.map +1 -0
- package/dist/core/training-config.js +117 -0
- package/dist/core/training-config.js.map +1 -0
- package/dist/core/training-orchestrator.d.ts +112 -0
- package/dist/core/training-orchestrator.d.ts.map +1 -0
- package/dist/core/training-orchestrator.js +729 -0
- package/dist/core/training-orchestrator.js.map +1 -0
- package/dist/core/training-readiness-report.d.ts +52 -0
- package/dist/core/training-readiness-report.d.ts.map +1 -0
- package/dist/core/training-readiness-report.js +765 -0
- package/dist/core/training-readiness-report.js.map +1 -0
- package/dist/core/trajectory-consumer.d.ts +15 -0
- package/dist/core/trajectory-consumer.d.ts.map +1 -0
- package/dist/core/trajectory-consumer.js +61 -0
- package/dist/core/trajectory-consumer.js.map +1 -0
- package/dist/core/trajectory-export-bundle.d.ts +95 -0
- package/dist/core/trajectory-export-bundle.d.ts.map +1 -0
- package/dist/core/trajectory-export-bundle.js +561 -0
- package/dist/core/trajectory-export-bundle.js.map +1 -0
- package/dist/core/trajectory-export-cron.d.ts +57 -0
- package/dist/core/trajectory-export-cron.d.ts.map +1 -0
- package/dist/core/trajectory-export-cron.js +170 -0
- package/dist/core/trajectory-export-cron.js.map +1 -0
- package/dist/core/trajectory-hf-upload.d.ts +50 -0
- package/dist/core/trajectory-hf-upload.d.ts.map +1 -0
- package/dist/core/trajectory-hf-upload.js +111 -0
- package/dist/core/trajectory-hf-upload.js.map +1 -0
- package/dist/core/trajectory-task-datasets.d.ts +62 -0
- package/dist/core/trajectory-task-datasets.d.ts.map +1 -0
- package/dist/core/trajectory-task-datasets.js +427 -0
- package/dist/core/trajectory-task-datasets.js.map +1 -0
- package/dist/core/wait-for-service.d.ts +25 -0
- package/dist/core/wait-for-service.d.ts.map +1 -0
- package/dist/core/wait-for-service.js +19 -0
- package/dist/core/wait-for-service.js.map +1 -0
- package/dist/core/workspace-runtime.d.ts +4 -0
- package/dist/core/workspace-runtime.d.ts.map +1 -0
- package/dist/core/workspace-runtime.js +25 -0
- package/dist/core/workspace-runtime.js.map +1 -0
- package/dist/dspy/artifact.d.ts +54 -0
- package/dist/dspy/artifact.d.ts.map +1 -0
- package/dist/dspy/artifact.js +61 -0
- package/dist/dspy/artifact.js.map +1 -0
- package/dist/dspy/chain-of-thought.d.ts +27 -0
- package/dist/dspy/chain-of-thought.d.ts.map +1 -0
- package/dist/dspy/chain-of-thought.js +43 -0
- package/dist/dspy/chain-of-thought.js.map +1 -0
- package/dist/dspy/examples.d.ts +72 -0
- package/dist/dspy/examples.d.ts.map +1 -0
- package/dist/dspy/examples.js +105 -0
- package/dist/dspy/examples.js.map +1 -0
- package/dist/dspy/index.d.ts +15 -0
- package/dist/dspy/index.d.ts.map +1 -0
- package/dist/dspy/index.js +40 -0
- package/dist/dspy/index.js.map +1 -0
- package/dist/dspy/lm-adapter.d.ts +100 -0
- package/dist/dspy/lm-adapter.d.ts.map +1 -0
- package/dist/dspy/lm-adapter.js +81 -0
- package/dist/dspy/lm-adapter.js.map +1 -0
- package/dist/dspy/optimizers/dspy-bootstrap-fewshot.d.ts +23 -0
- package/dist/dspy/optimizers/dspy-bootstrap-fewshot.d.ts.map +1 -0
- package/dist/dspy/optimizers/dspy-bootstrap-fewshot.js +85 -0
- package/dist/dspy/optimizers/dspy-bootstrap-fewshot.js.map +1 -0
- package/dist/dspy/optimizers/dspy-copro.d.ts +29 -0
- package/dist/dspy/optimizers/dspy-copro.d.ts.map +1 -0
- package/dist/dspy/optimizers/dspy-copro.js +141 -0
- package/dist/dspy/optimizers/dspy-copro.js.map +1 -0
- package/dist/dspy/optimizers/dspy-mipro.d.ts +37 -0
- package/dist/dspy/optimizers/dspy-mipro.d.ts.map +1 -0
- package/dist/dspy/optimizers/dspy-mipro.js +194 -0
- package/dist/dspy/optimizers/dspy-mipro.js.map +1 -0
- package/dist/dspy/optimizers/index.d.ts +5 -0
- package/dist/dspy/optimizers/index.d.ts.map +1 -0
- package/dist/dspy/optimizers/index.js +11 -0
- package/dist/dspy/optimizers/index.js.map +1 -0
- package/dist/dspy/optimizers/types.d.ts +39 -0
- package/dist/dspy/optimizers/types.d.ts.map +1 -0
- package/dist/dspy/optimizers/types.js +1 -0
- package/dist/dspy/optimizers/types.js.map +1 -0
- package/dist/dspy/predict.d.ts +49 -0
- package/dist/dspy/predict.d.ts.map +1 -0
- package/dist/dspy/predict.js +73 -0
- package/dist/dspy/predict.js.map +1 -0
- package/dist/dspy/signature.d.ts +88 -0
- package/dist/dspy/signature.d.ts.map +1 -0
- package/dist/dspy/signature.js +205 -0
- package/dist/dspy/signature.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/optimizers/bootstrap-fewshot.d.ts +42 -0
- package/dist/optimizers/bootstrap-fewshot.d.ts.map +1 -0
- package/dist/optimizers/bootstrap-fewshot.js +92 -0
- package/dist/optimizers/bootstrap-fewshot.js.map +1 -0
- package/dist/optimizers/gepa.d.ts +63 -0
- package/dist/optimizers/gepa.d.ts.map +1 -0
- package/dist/optimizers/gepa.js +232 -0
- package/dist/optimizers/gepa.js.map +1 -0
- package/dist/optimizers/index.d.ts +7 -0
- package/dist/optimizers/index.d.ts.map +1 -0
- package/dist/optimizers/index.js +51 -0
- package/dist/optimizers/index.js.map +1 -0
- package/dist/optimizers/instruction-search.d.ts +39 -0
- package/dist/optimizers/instruction-search.d.ts.map +1 -0
- package/dist/optimizers/instruction-search.js +108 -0
- package/dist/optimizers/instruction-search.js.map +1 -0
- package/dist/optimizers/prompt-evolution.d.ts +39 -0
- package/dist/optimizers/prompt-evolution.d.ts.map +1 -0
- package/dist/optimizers/prompt-evolution.js +101 -0
- package/dist/optimizers/prompt-evolution.js.map +1 -0
- package/dist/optimizers/scoring.d.ts +139 -0
- package/dist/optimizers/scoring.d.ts.map +1 -0
- package/dist/optimizers/scoring.js +299 -0
- package/dist/optimizers/scoring.js.map +1 -0
- package/dist/optimizers/types.d.ts +105 -0
- package/dist/optimizers/types.d.ts.map +1 -0
- package/dist/optimizers/types.js +1 -0
- package/dist/optimizers/types.js.map +1 -0
- package/dist/register-runtime.d.ts +3 -0
- package/dist/register-runtime.d.ts.map +1 -0
- package/dist/register-runtime.js +60 -0
- package/dist/register-runtime.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +31 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/routes/experience-routes.d.ts +21 -0
- package/dist/routes/experience-routes.d.ts.map +1 -0
- package/dist/routes/experience-routes.js +513 -0
- package/dist/routes/experience-routes.js.map +1 -0
- package/dist/routes/index.d.ts +5 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +17 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/training-routes.d.ts +10 -0
- package/dist/routes/training-routes.d.ts.map +1 -0
- package/dist/routes/training-routes.js +1239 -0
- package/dist/routes/training-routes.js.map +1 -0
- package/dist/routes/training-vast-routes.d.ts +35 -0
- package/dist/routes/training-vast-routes.d.ts.map +1 -0
- package/dist/routes/training-vast-routes.js +249 -0
- package/dist/routes/training-vast-routes.js.map +1 -0
- package/dist/routes/trajectory-routes.d.ts +19 -0
- package/dist/routes/trajectory-routes.d.ts.map +1 -0
- package/dist/routes/trajectory-routes.js +1122 -0
- package/dist/routes/trajectory-routes.js.map +1 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +63 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/training-backend-check.d.ts +8 -0
- package/dist/services/training-backend-check.d.ts.map +1 -0
- package/dist/services/training-backend-check.js +31 -0
- package/dist/services/training-backend-check.js.map +1 -0
- package/dist/services/training-service-like.d.ts +40 -0
- package/dist/services/training-service-like.d.ts.map +1 -0
- package/dist/services/training-service-like.js +1 -0
- package/dist/services/training-service-like.js.map +1 -0
- package/dist/services/training-service-registry.d.ts +4 -0
- package/dist/services/training-service-registry.d.ts.map +1 -0
- package/dist/services/training-service-registry.js +12 -0
- package/dist/services/training-service-registry.js.map +1 -0
- package/dist/services/training-service.d.ts +59 -0
- package/dist/services/training-service.d.ts.map +1 -0
- package/dist/services/training-service.js +154 -0
- package/dist/services/training-service.js.map +1 -0
- package/dist/services/training-trigger.d.ts +177 -0
- package/dist/services/training-trigger.d.ts.map +1 -0
- package/dist/services/training-trigger.js +300 -0
- package/dist/services/training-trigger.js.map +1 -0
- package/dist/services/training-vast-service.d.ts +149 -0
- package/dist/services/training-vast-service.d.ts.map +1 -0
- package/dist/services/training-vast-service.js +648 -0
- package/dist/services/training-vast-service.js.map +1 -0
- package/dist/services/vast-inference-stats.d.ts +37 -0
- package/dist/services/vast-inference-stats.d.ts.map +1 -0
- package/dist/services/vast-inference-stats.js +81 -0
- package/dist/services/vast-inference-stats.js.map +1 -0
- package/dist/services/vast-job-store.d.ts +74 -0
- package/dist/services/vast-job-store.d.ts.map +1 -0
- package/dist/services/vast-job-store.js +194 -0
- package/dist/services/vast-job-store.js.map +1 -0
- package/dist/services/vast-subprocess.d.ts +27 -0
- package/dist/services/vast-subprocess.d.ts.map +1 -0
- package/dist/services/vast-subprocess.js +78 -0
- package/dist/services/vast-subprocess.js.map +1 -0
- package/dist/setup-routes.d.ts +17 -0
- package/dist/setup-routes.d.ts.map +1 -0
- package/dist/setup-routes.js +319 -0
- package/dist/setup-routes.js.map +1 -0
- package/dist/ui/FineTuningSpatialView.d.ts +49 -0
- package/dist/ui/FineTuningSpatialView.d.ts.map +1 -0
- package/dist/ui/FineTuningSpatialView.js +154 -0
- package/dist/ui/FineTuningSpatialView.js.map +1 -0
- package/dist/ui/FineTuningView.d.ts +7 -0
- package/dist/ui/FineTuningView.d.ts.map +1 -0
- package/dist/ui/FineTuningView.helpers.d.ts +17 -0
- package/dist/ui/FineTuningView.helpers.d.ts.map +1 -0
- package/dist/ui/FineTuningView.helpers.js +30 -0
- package/dist/ui/FineTuningView.helpers.js.map +1 -0
- package/dist/ui/FineTuningView.interact.d.ts +2 -0
- package/dist/ui/FineTuningView.interact.d.ts.map +1 -0
- package/dist/ui/FineTuningView.interact.js +300 -0
- package/dist/ui/FineTuningView.interact.js.map +1 -0
- package/dist/ui/FineTuningView.js +4653 -0
- package/dist/ui/FineTuningView.js.map +1 -0
- package/dist/ui/fine-tuning-panels.d.ts +100 -0
- package/dist/ui/fine-tuning-panels.d.ts.map +1 -0
- package/dist/ui/fine-tuning-panels.helpers.d.ts +19 -0
- package/dist/ui/fine-tuning-panels.helpers.d.ts.map +1 -0
- package/dist/ui/fine-tuning-panels.helpers.js +77 -0
- package/dist/ui/fine-tuning-panels.helpers.js.map +1 -0
- package/dist/ui/fine-tuning-panels.js +928 -0
- package/dist/ui/fine-tuning-panels.js.map +1 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/training-view-bundle.d.ts +3 -0
- package/dist/ui/training-view-bundle.d.ts.map +1 -0
- package/dist/ui/training-view-bundle.js +7 -0
- package/dist/ui/training-view-bundle.js.map +1 -0
- package/dist/views/bundle.js +5312 -0
- package/dist/views/bundle.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay validator for synthetic training data.
|
|
3
|
+
*
|
|
4
|
+
* Validates that every generated sample:
|
|
5
|
+
* 1. Parses correctly with the same Eliza parser
|
|
6
|
+
* 2. References only valid contexts/actions/providers
|
|
7
|
+
* 3. Would survive round-trip through the real runtime
|
|
8
|
+
* 4. Has proper structure for eliza_native_v1 supervised tuning
|
|
9
|
+
*
|
|
10
|
+
* Also computes dataset quality metrics:
|
|
11
|
+
* - Decision balance (RESPOND/IGNORE/STOP distribution)
|
|
12
|
+
* - Context coverage (all contexts represented)
|
|
13
|
+
* - Agent name diversity (no statistical pollution)
|
|
14
|
+
* - Turn count distribution
|
|
15
|
+
*/
|
|
16
|
+
import type { AgentContext } from "./context-types.js";
|
|
17
|
+
import type { TrainingSample } from "./dataset-generator.js";
|
|
18
|
+
export interface ValidationResult {
|
|
19
|
+
sampleId: string;
|
|
20
|
+
valid: boolean;
|
|
21
|
+
errors: ValidationError[];
|
|
22
|
+
warnings: ValidationWarning[];
|
|
23
|
+
}
|
|
24
|
+
export interface ValidationError {
|
|
25
|
+
type: "invalid_json" | "missing_field" | "invalid_context" | "invalid_action" | "invalid_decision" | "empty_messages" | "no_agent_name" | "name_in_response";
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ValidationWarning {
|
|
29
|
+
type: "low_turn_count" | "high_turn_count" | "duplicate_agent_name" | "missing_grounding_keywords" | "single_participant";
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DatasetQualityReport {
|
|
33
|
+
totalSamples: number;
|
|
34
|
+
validSamples: number;
|
|
35
|
+
invalidSamples: number;
|
|
36
|
+
errorRate: number;
|
|
37
|
+
/** Distribution of decisions */
|
|
38
|
+
decisionBalance: {
|
|
39
|
+
RESPOND: number;
|
|
40
|
+
IGNORE: number;
|
|
41
|
+
STOP: number;
|
|
42
|
+
respondPct: number;
|
|
43
|
+
ignorePct: number;
|
|
44
|
+
stopPct: number;
|
|
45
|
+
};
|
|
46
|
+
/** Context coverage */
|
|
47
|
+
contextCoverage: Record<AgentContext, number>;
|
|
48
|
+
missingContexts: AgentContext[];
|
|
49
|
+
/** Agent name diversity */
|
|
50
|
+
uniqueAgentNames: number;
|
|
51
|
+
totalSamplesChecked: number;
|
|
52
|
+
nameDiversityRatio: number;
|
|
53
|
+
/** Turn count stats */
|
|
54
|
+
turnCountStats: {
|
|
55
|
+
min: number;
|
|
56
|
+
max: number;
|
|
57
|
+
mean: number;
|
|
58
|
+
median: number;
|
|
59
|
+
p90: number;
|
|
60
|
+
};
|
|
61
|
+
/** Pattern distribution */
|
|
62
|
+
patternDistribution: Record<string, number>;
|
|
63
|
+
/** Top errors */
|
|
64
|
+
topErrors: Array<{
|
|
65
|
+
type: string;
|
|
66
|
+
count: number;
|
|
67
|
+
}>;
|
|
68
|
+
/** Top warnings */
|
|
69
|
+
topWarnings: Array<{
|
|
70
|
+
type: string;
|
|
71
|
+
count: number;
|
|
72
|
+
}>;
|
|
73
|
+
/** Native model-boundary format validation */
|
|
74
|
+
nativeFormatValid: number;
|
|
75
|
+
nativeFormatInvalid: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validate a single training sample.
|
|
79
|
+
*/
|
|
80
|
+
export declare function validateSample(sample: TrainingSample): ValidationResult;
|
|
81
|
+
/**
|
|
82
|
+
* Validate an eliza_native_v1 tuning example JSONL line.
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateElizaNativeExample(jsonLine: string): {
|
|
85
|
+
valid: boolean;
|
|
86
|
+
errors: string[];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Validate an entire dataset and produce a quality report.
|
|
90
|
+
*/
|
|
91
|
+
export declare function validateDataset(samples: TrainingSample[]): DatasetQualityReport;
|
|
92
|
+
/**
|
|
93
|
+
* Run all validations and produce a formatted report string.
|
|
94
|
+
*/
|
|
95
|
+
export declare function formatQualityReport(report: DatasetQualityReport): string;
|
|
96
|
+
/**
|
|
97
|
+
* Minimum metadata a Skill needs for scoring. We do not import @elizaos/skills
|
|
98
|
+
* here because app-training is downstream of the skills package and we want
|
|
99
|
+
* scoreSkill to be usable in cron-job contexts that pass loaded skills.
|
|
100
|
+
*/
|
|
101
|
+
export interface ScoreableSkill {
|
|
102
|
+
name: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Loose Trajectory shape used for scoring. Mirrors the persisted-trajectory
|
|
106
|
+
* type but kept narrow so callers can pass results from any source (the
|
|
107
|
+
* `trajectories` service, JSON exports, fixtures).
|
|
108
|
+
*/
|
|
109
|
+
export interface ScoreableTrajectory {
|
|
110
|
+
trajectoryId?: string;
|
|
111
|
+
metrics?: {
|
|
112
|
+
finalStatus?: string;
|
|
113
|
+
};
|
|
114
|
+
steps?: Array<{
|
|
115
|
+
usedSkills?: string[];
|
|
116
|
+
}>;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Score a curated skill in [0, 1] based on its observed success rate across
|
|
121
|
+
* the supplied held-out trajectories.
|
|
122
|
+
*
|
|
123
|
+
* Algorithm:
|
|
124
|
+
* 1. Filter trajectories that reference the skill on any step (or via
|
|
125
|
+
* metadata.usedSkills, for parity with the refinement evaluator).
|
|
126
|
+
* 2. Score = successCount / totalReferencingCount.
|
|
127
|
+
* 3. Returns 0 when no referencing trajectories exist (signals "no data" —
|
|
128
|
+
* callers should treat 0 as "unscored" if they want to distinguish that
|
|
129
|
+
* from "always failed").
|
|
130
|
+
*
|
|
131
|
+
* The scoring is deliberately simple because the source of truth is the
|
|
132
|
+
* trajectory store; richer signals (duration, retry count, user follow-ups)
|
|
133
|
+
* are easy to layer in later by extending ScoreableTrajectory.
|
|
134
|
+
*/
|
|
135
|
+
export declare function scoreSkill(skill: ScoreableSkill, heldOutTrajectories: ScoreableTrajectory[]): Promise<number>;
|
|
136
|
+
//# sourceMappingURL=replay-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-validator.d.ts","sourceRoot":"","sources":["../../src/core/replay-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,wBAAwB,CAAC;AA8ChC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EACA,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EACA,gBAAgB,GAChB,iBAAiB,GACjB,sBAAsB,GACtB,4BAA4B,GAC5B,oBAAoB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAElB,gCAAgC;IAChC,eAAe,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QAC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AgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAyExE;AAID;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,cAAc,EACrB,mBAAmB,EAAE,mBAAmB,EAAE,GACzC,OAAO,CAAC,MAAM,CAAC,CAYjB"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ELIZA_NATIVE_MODEL_BOUNDARIES,
|
|
3
|
+
ELIZA_NATIVE_TRAJECTORY_FORMAT
|
|
4
|
+
} from "@elizaos/core";
|
|
5
|
+
import { ACTION_CONTEXT_MAP, ALL_CONTEXTS } from "./context-catalog.js";
|
|
6
|
+
const NATIVE_MODEL_BOUNDARIES = new Set(ELIZA_NATIVE_MODEL_BOUNDARIES);
|
|
7
|
+
function getTuningMessages(parsed) {
|
|
8
|
+
const row = parsed;
|
|
9
|
+
if (row.format === ELIZA_NATIVE_TRAJECTORY_FORMAT) {
|
|
10
|
+
const out = [];
|
|
11
|
+
const system = row.request.system;
|
|
12
|
+
if (typeof system === "string" && system.length > 0) {
|
|
13
|
+
out.push({ role: "system", content: system });
|
|
14
|
+
}
|
|
15
|
+
const msgs = row.request.messages;
|
|
16
|
+
if (Array.isArray(msgs)) {
|
|
17
|
+
for (const msg of msgs) {
|
|
18
|
+
if (msg.role === "system" && out.length > 0 && out[0]?.role === "system" && out[0]?.content === msg.content) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
out.push(msg);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (!out.some((msg) => msg.role === "user") && typeof row.request.prompt === "string" && row.request.prompt.length > 0) {
|
|
25
|
+
out.push({ role: "user", content: row.request.prompt });
|
|
26
|
+
}
|
|
27
|
+
return out.length > 0 ? out : null;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function validateSample(sample) {
|
|
32
|
+
const errors = [];
|
|
33
|
+
const warnings = [];
|
|
34
|
+
if (!sample.id)
|
|
35
|
+
errors.push({ type: "missing_field", message: "Missing sample ID" });
|
|
36
|
+
if (!sample.blueprintId)
|
|
37
|
+
errors.push({ type: "missing_field", message: "Missing blueprint ID" });
|
|
38
|
+
if (!sample.agentName)
|
|
39
|
+
errors.push({ type: "no_agent_name", message: "Missing agent name" });
|
|
40
|
+
if (sample.messages.length === 0) {
|
|
41
|
+
errors.push({ type: "empty_messages", message: "No messages in sample" });
|
|
42
|
+
} else {
|
|
43
|
+
if (sample.messages.length < 2) {
|
|
44
|
+
warnings.push({
|
|
45
|
+
type: "low_turn_count",
|
|
46
|
+
message: `Only ${sample.messages.length} turn(s)`
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (sample.messages.length > 30) {
|
|
50
|
+
warnings.push({
|
|
51
|
+
type: "high_turn_count",
|
|
52
|
+
message: `${sample.messages.length} turns (very long)`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const validDecisions = ["RESPOND", "IGNORE", "STOP"];
|
|
57
|
+
if (!validDecisions.includes(sample.expectedOutput.decision)) {
|
|
58
|
+
errors.push({
|
|
59
|
+
type: "invalid_decision",
|
|
60
|
+
message: `Invalid decision: ${sample.expectedOutput.decision}`
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (!ALL_CONTEXTS.includes(sample.expectedOutput.primaryContext)) {
|
|
64
|
+
errors.push({
|
|
65
|
+
type: "invalid_context",
|
|
66
|
+
message: `Unknown primary context: ${sample.expectedOutput.primaryContext}`
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
for (const ctx of sample.expectedOutput.secondaryContexts) {
|
|
70
|
+
if (!ALL_CONTEXTS.includes(ctx)) {
|
|
71
|
+
errors.push({
|
|
72
|
+
type: "invalid_context",
|
|
73
|
+
message: `Unknown secondary context: ${ctx}`
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (sample.expectedOutput.expectedAction) {
|
|
78
|
+
const actionUpper = sample.expectedOutput.expectedAction.toUpperCase();
|
|
79
|
+
if (!ACTION_CONTEXT_MAP[actionUpper]) {
|
|
80
|
+
warnings.push({
|
|
81
|
+
type: "missing_grounding_keywords",
|
|
82
|
+
message: `Action ${actionUpper} not in context catalog (may be a custom action)`
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const participants = new Set(
|
|
87
|
+
sample.messages.map((m) => m.name).filter(Boolean)
|
|
88
|
+
);
|
|
89
|
+
if (participants.size <= 1 && sample.messages.length > 2) {
|
|
90
|
+
warnings.push({
|
|
91
|
+
type: "single_participant",
|
|
92
|
+
message: "Only one participant name in the conversation"
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
sampleId: sample.id,
|
|
97
|
+
valid: errors.length === 0,
|
|
98
|
+
errors,
|
|
99
|
+
warnings
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function validateElizaNativeExample(jsonLine) {
|
|
103
|
+
const errors = [];
|
|
104
|
+
let parsed;
|
|
105
|
+
try {
|
|
106
|
+
parsed = JSON.parse(jsonLine);
|
|
107
|
+
} catch {
|
|
108
|
+
return { valid: false, errors: ["Invalid JSON"] };
|
|
109
|
+
}
|
|
110
|
+
const messages = getTuningMessages(parsed);
|
|
111
|
+
if (!messages) {
|
|
112
|
+
errors.push("Missing eliza_native_v1 request system/messages/prompt");
|
|
113
|
+
return { valid: false, errors };
|
|
114
|
+
}
|
|
115
|
+
const native = parsed;
|
|
116
|
+
if (native.format !== ELIZA_NATIVE_TRAJECTORY_FORMAT) {
|
|
117
|
+
errors.push(`format must be ${ELIZA_NATIVE_TRAJECTORY_FORMAT}`);
|
|
118
|
+
return { valid: false, errors };
|
|
119
|
+
}
|
|
120
|
+
if (!NATIVE_MODEL_BOUNDARIES.has(native.boundary)) {
|
|
121
|
+
errors.push("boundary must be a supported Vercel AI SDK model boundary");
|
|
122
|
+
}
|
|
123
|
+
if (messages.length < 2) {
|
|
124
|
+
errors.push("Need at least 2 request messages (e.g. system + user)");
|
|
125
|
+
}
|
|
126
|
+
const text = native.response.text;
|
|
127
|
+
const toolCalls = native.response.toolCalls;
|
|
128
|
+
if ((typeof text !== "string" || text.trim().length === 0) && !Array.isArray(toolCalls)) {
|
|
129
|
+
errors.push("Missing response.text or response.toolCalls");
|
|
130
|
+
}
|
|
131
|
+
for (const msg of messages) {
|
|
132
|
+
if (!msg.role || !["system", "developer", "user", "assistant", "tool"].includes(msg.role)) {
|
|
133
|
+
errors.push(`Invalid role: ${msg.role}`);
|
|
134
|
+
}
|
|
135
|
+
if (msg.content === void 0 && msg.parts === void 0) {
|
|
136
|
+
errors.push("Missing message content/parts");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return { valid: errors.length === 0, errors };
|
|
140
|
+
}
|
|
141
|
+
function validateDataset(samples) {
|
|
142
|
+
const results = samples.map(validateSample);
|
|
143
|
+
const validResults = results.filter((r) => r.valid);
|
|
144
|
+
const invalidResults = results.filter((r) => !r.valid);
|
|
145
|
+
const respondCount = samples.filter(
|
|
146
|
+
(s) => s.expectedOutput.decision === "RESPOND"
|
|
147
|
+
).length;
|
|
148
|
+
const ignoreCount = samples.filter(
|
|
149
|
+
(s) => s.expectedOutput.decision === "IGNORE"
|
|
150
|
+
).length;
|
|
151
|
+
const stopCount = samples.filter(
|
|
152
|
+
(s) => s.expectedOutput.decision === "STOP"
|
|
153
|
+
).length;
|
|
154
|
+
const contextCoverage = Object.fromEntries(
|
|
155
|
+
ALL_CONTEXTS.map((ctx) => [
|
|
156
|
+
ctx,
|
|
157
|
+
samples.filter((s) => s.expectedOutput.primaryContext === ctx).length
|
|
158
|
+
])
|
|
159
|
+
);
|
|
160
|
+
const missingContexts = ALL_CONTEXTS.filter(
|
|
161
|
+
(ctx) => contextCoverage[ctx] === 0
|
|
162
|
+
);
|
|
163
|
+
const uniqueNames = new Set(samples.map((s) => s.agentName));
|
|
164
|
+
const turnCounts = samples.map((s) => s.metadata.turnCount).sort((a, b) => a - b);
|
|
165
|
+
const turnCountStats = {
|
|
166
|
+
min: turnCounts[0] ?? 0,
|
|
167
|
+
max: turnCounts[turnCounts.length - 1] ?? 0,
|
|
168
|
+
mean: turnCounts.reduce((a, b) => a + b, 0) / (turnCounts.length || 1),
|
|
169
|
+
median: turnCounts[Math.floor(turnCounts.length / 2)] ?? 0,
|
|
170
|
+
p90: turnCounts[Math.floor(turnCounts.length * 0.9)] ?? 0
|
|
171
|
+
};
|
|
172
|
+
const patternDistribution = {};
|
|
173
|
+
for (const s of samples) {
|
|
174
|
+
patternDistribution[s.metadata.pattern] = (patternDistribution[s.metadata.pattern] ?? 0) + 1;
|
|
175
|
+
}
|
|
176
|
+
const errorCounts = {};
|
|
177
|
+
const warningCounts = {};
|
|
178
|
+
for (const r of results) {
|
|
179
|
+
for (const e of r.errors) {
|
|
180
|
+
errorCounts[e.type] = (errorCounts[e.type] ?? 0) + 1;
|
|
181
|
+
}
|
|
182
|
+
for (const w of r.warnings) {
|
|
183
|
+
warningCounts[w.type] = (warningCounts[w.type] ?? 0) + 1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
totalSamples: samples.length,
|
|
188
|
+
validSamples: validResults.length,
|
|
189
|
+
invalidSamples: invalidResults.length,
|
|
190
|
+
errorRate: invalidResults.length / (samples.length || 1),
|
|
191
|
+
decisionBalance: {
|
|
192
|
+
RESPOND: respondCount,
|
|
193
|
+
IGNORE: ignoreCount,
|
|
194
|
+
STOP: stopCount,
|
|
195
|
+
respondPct: respondCount / (samples.length || 1),
|
|
196
|
+
ignorePct: ignoreCount / (samples.length || 1),
|
|
197
|
+
stopPct: stopCount / (samples.length || 1)
|
|
198
|
+
},
|
|
199
|
+
contextCoverage,
|
|
200
|
+
missingContexts,
|
|
201
|
+
uniqueAgentNames: uniqueNames.size,
|
|
202
|
+
totalSamplesChecked: samples.length,
|
|
203
|
+
nameDiversityRatio: uniqueNames.size / (samples.length || 1),
|
|
204
|
+
turnCountStats,
|
|
205
|
+
patternDistribution,
|
|
206
|
+
topErrors: Object.entries(errorCounts).map(([type, count]) => ({ type, count })).sort((a, b) => b.count - a.count).slice(0, 10),
|
|
207
|
+
topWarnings: Object.entries(warningCounts).map(([type, count]) => ({ type, count })).sort((a, b) => b.count - a.count).slice(0, 10),
|
|
208
|
+
nativeFormatValid: 0,
|
|
209
|
+
// filled by separate JSONL validation
|
|
210
|
+
nativeFormatInvalid: 0
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function formatQualityReport(report) {
|
|
214
|
+
const lines = [];
|
|
215
|
+
lines.push("=== Dataset Quality Report ===");
|
|
216
|
+
lines.push("");
|
|
217
|
+
lines.push(`Total samples: ${report.totalSamples}`);
|
|
218
|
+
lines.push(
|
|
219
|
+
`Valid: ${report.validSamples} (${((1 - report.errorRate) * 100).toFixed(1)}%)`
|
|
220
|
+
);
|
|
221
|
+
lines.push(`Invalid: ${report.invalidSamples}`);
|
|
222
|
+
lines.push("");
|
|
223
|
+
lines.push("--- Decision Balance ---");
|
|
224
|
+
lines.push(
|
|
225
|
+
`RESPOND: ${report.decisionBalance.RESPOND} (${(report.decisionBalance.respondPct * 100).toFixed(1)}%)`
|
|
226
|
+
);
|
|
227
|
+
lines.push(
|
|
228
|
+
`IGNORE: ${report.decisionBalance.IGNORE} (${(report.decisionBalance.ignorePct * 100).toFixed(1)}%)`
|
|
229
|
+
);
|
|
230
|
+
lines.push(
|
|
231
|
+
`STOP: ${report.decisionBalance.STOP} (${(report.decisionBalance.stopPct * 100).toFixed(1)}%)`
|
|
232
|
+
);
|
|
233
|
+
lines.push("");
|
|
234
|
+
lines.push("--- Context Coverage ---");
|
|
235
|
+
for (const [ctx, count] of Object.entries(report.contextCoverage)) {
|
|
236
|
+
lines.push(` ${ctx}: ${count}`);
|
|
237
|
+
}
|
|
238
|
+
if (report.missingContexts.length > 0) {
|
|
239
|
+
lines.push(` MISSING: ${report.missingContexts.join(", ")}`);
|
|
240
|
+
}
|
|
241
|
+
lines.push("");
|
|
242
|
+
lines.push("--- Name Diversity ---");
|
|
243
|
+
lines.push(
|
|
244
|
+
`Unique agent names: ${report.uniqueAgentNames} / ${report.totalSamplesChecked} samples`
|
|
245
|
+
);
|
|
246
|
+
lines.push(
|
|
247
|
+
`Diversity ratio: ${(report.nameDiversityRatio * 100).toFixed(1)}%`
|
|
248
|
+
);
|
|
249
|
+
lines.push("");
|
|
250
|
+
lines.push("--- Turn Count ---");
|
|
251
|
+
lines.push(`Min: ${report.turnCountStats.min}`);
|
|
252
|
+
lines.push(`Max: ${report.turnCountStats.max}`);
|
|
253
|
+
lines.push(`Mean: ${report.turnCountStats.mean.toFixed(1)}`);
|
|
254
|
+
lines.push(`Median: ${report.turnCountStats.median}`);
|
|
255
|
+
lines.push(`P90: ${report.turnCountStats.p90}`);
|
|
256
|
+
lines.push("");
|
|
257
|
+
lines.push("--- Pattern Distribution ---");
|
|
258
|
+
for (const [pattern, count] of Object.entries(report.patternDistribution)) {
|
|
259
|
+
lines.push(` ${pattern}: ${count}`);
|
|
260
|
+
}
|
|
261
|
+
lines.push("");
|
|
262
|
+
if (report.topErrors.length > 0) {
|
|
263
|
+
lines.push("--- Top Errors ---");
|
|
264
|
+
for (const { type, count } of report.topErrors) {
|
|
265
|
+
lines.push(` ${type}: ${count}`);
|
|
266
|
+
}
|
|
267
|
+
lines.push("");
|
|
268
|
+
}
|
|
269
|
+
if (report.topWarnings.length > 0) {
|
|
270
|
+
lines.push("--- Top Warnings ---");
|
|
271
|
+
for (const { type, count } of report.topWarnings) {
|
|
272
|
+
lines.push(` ${type}: ${count}`);
|
|
273
|
+
}
|
|
274
|
+
lines.push("");
|
|
275
|
+
}
|
|
276
|
+
return lines.join("\n");
|
|
277
|
+
}
|
|
278
|
+
async function scoreSkill(skill, heldOutTrajectories) {
|
|
279
|
+
const referencing = heldOutTrajectories.filter(
|
|
280
|
+
(trajectory) => trajectoryUsesSkill(trajectory, skill.name)
|
|
281
|
+
);
|
|
282
|
+
if (referencing.length === 0) {
|
|
283
|
+
return 0;
|
|
284
|
+
}
|
|
285
|
+
const successes = referencing.filter(
|
|
286
|
+
(trajectory) => (trajectory.metrics?.finalStatus ?? "") === "completed"
|
|
287
|
+
).length;
|
|
288
|
+
const score = successes / referencing.length;
|
|
289
|
+
return Math.max(0, Math.min(1, score));
|
|
290
|
+
}
|
|
291
|
+
function trajectoryUsesSkill(trajectory, skillName) {
|
|
292
|
+
const target = skillName.trim();
|
|
293
|
+
if (!target) return false;
|
|
294
|
+
for (const step of trajectory.steps ?? []) {
|
|
295
|
+
if (Array.isArray(step.usedSkills) && step.usedSkills.includes(target)) {
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const metaUsed = trajectory.metadata?.usedSkills;
|
|
300
|
+
if (Array.isArray(metaUsed) && metaUsed.includes(target)) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
export {
|
|
306
|
+
formatQualityReport,
|
|
307
|
+
scoreSkill,
|
|
308
|
+
validateDataset,
|
|
309
|
+
validateElizaNativeExample,
|
|
310
|
+
validateSample
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=replay-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/replay-validator.ts"],"sourcesContent":["/**\n * Replay validator for synthetic training data.\n *\n * Validates that every generated sample:\n * 1. Parses correctly with the same Eliza parser\n * 2. References only valid contexts/actions/providers\n * 3. Would survive round-trip through the real runtime\n * 4. Has proper structure for eliza_native_v1 supervised tuning\n *\n * Also computes dataset quality metrics:\n * - Decision balance (RESPOND/IGNORE/STOP distribution)\n * - Context coverage (all contexts represented)\n * - Agent name diversity (no statistical pollution)\n * - Turn count distribution\n */\n\nimport {\n ELIZA_NATIVE_MODEL_BOUNDARIES,\n ELIZA_NATIVE_TRAJECTORY_FORMAT,\n type ElizaNativeTrajectoryRow,\n} from \"@elizaos/core\";\nimport { ACTION_CONTEXT_MAP, ALL_CONTEXTS } from \"./context-catalog.js\";\nimport type { AgentContext } from \"./context-types.js\";\nimport type {\n ElizaNativeTrainingExample,\n TrainingSample,\n} from \"./dataset-generator.js\";\n\ntype TuningMessage = { role?: string; content?: unknown; parts?: unknown };\nconst NATIVE_MODEL_BOUNDARIES = new Set<string>(ELIZA_NATIVE_MODEL_BOUNDARIES);\n\nfunction getTuningMessages(\n parsed: ElizaNativeTrainingExample,\n): TuningMessage[] | null {\n const row = parsed as ElizaNativeTrajectoryRow & {\n messages?: TuningMessage[];\n request?: { system?: unknown; messages?: unknown; prompt?: unknown };\n };\n if (row.format === ELIZA_NATIVE_TRAJECTORY_FORMAT) {\n const out: TuningMessage[] = [];\n const system = row.request.system;\n if (typeof system === \"string\" && system.length > 0) {\n out.push({ role: \"system\", content: system });\n }\n const msgs = row.request.messages;\n if (Array.isArray(msgs)) {\n for (const msg of msgs as TuningMessage[]) {\n if (\n msg.role === \"system\" &&\n out.length > 0 &&\n out[0]?.role === \"system\" &&\n out[0]?.content === msg.content\n ) {\n continue;\n }\n out.push(msg);\n }\n }\n if (\n !out.some((msg) => msg.role === \"user\") &&\n typeof row.request.prompt === \"string\" &&\n row.request.prompt.length > 0\n ) {\n out.push({ role: \"user\", content: row.request.prompt });\n }\n return out.length > 0 ? out : null;\n }\n return null;\n}\n\n// ==================== Validation types ====================\n\nexport interface ValidationResult {\n sampleId: string;\n valid: boolean;\n errors: ValidationError[];\n warnings: ValidationWarning[];\n}\n\nexport interface ValidationError {\n type:\n | \"invalid_json\"\n | \"missing_field\"\n | \"invalid_context\"\n | \"invalid_action\"\n | \"invalid_decision\"\n | \"empty_messages\"\n | \"no_agent_name\"\n | \"name_in_response\";\n message: string;\n}\n\nexport interface ValidationWarning {\n type:\n | \"low_turn_count\"\n | \"high_turn_count\"\n | \"duplicate_agent_name\"\n | \"missing_grounding_keywords\"\n | \"single_participant\";\n message: string;\n}\n\nexport interface DatasetQualityReport {\n totalSamples: number;\n validSamples: number;\n invalidSamples: number;\n errorRate: number;\n\n /** Distribution of decisions */\n decisionBalance: {\n RESPOND: number;\n IGNORE: number;\n STOP: number;\n respondPct: number;\n ignorePct: number;\n stopPct: number;\n };\n\n /** Context coverage */\n contextCoverage: Record<AgentContext, number>;\n missingContexts: AgentContext[];\n\n /** Agent name diversity */\n uniqueAgentNames: number;\n totalSamplesChecked: number;\n nameDiversityRatio: number;\n\n /** Turn count stats */\n turnCountStats: {\n min: number;\n max: number;\n mean: number;\n median: number;\n p90: number;\n };\n\n /** Pattern distribution */\n patternDistribution: Record<string, number>;\n\n /** Top errors */\n topErrors: Array<{ type: string; count: number }>;\n\n /** Top warnings */\n topWarnings: Array<{ type: string; count: number }>;\n\n /** Native model-boundary format validation */\n nativeFormatValid: number;\n nativeFormatInvalid: number;\n}\n\n// ==================== Validators ====================\n\n/**\n * Validate a single training sample.\n */\nexport function validateSample(sample: TrainingSample): ValidationResult {\n const errors: ValidationError[] = [];\n const warnings: ValidationWarning[] = [];\n\n // Check required fields\n if (!sample.id)\n errors.push({ type: \"missing_field\", message: \"Missing sample ID\" });\n if (!sample.blueprintId)\n errors.push({ type: \"missing_field\", message: \"Missing blueprint ID\" });\n if (!sample.agentName)\n errors.push({ type: \"no_agent_name\", message: \"Missing agent name\" });\n\n // Check messages\n if (sample.messages.length === 0) {\n errors.push({ type: \"empty_messages\", message: \"No messages in sample\" });\n } else {\n if (sample.messages.length < 2) {\n warnings.push({\n type: \"low_turn_count\",\n message: `Only ${sample.messages.length} turn(s)`,\n });\n }\n if (sample.messages.length > 30) {\n warnings.push({\n type: \"high_turn_count\",\n message: `${sample.messages.length} turns (very long)`,\n });\n }\n }\n\n // Check decision\n const validDecisions = [\"RESPOND\", \"IGNORE\", \"STOP\"];\n if (!validDecisions.includes(sample.expectedOutput.decision)) {\n errors.push({\n type: \"invalid_decision\",\n message: `Invalid decision: ${sample.expectedOutput.decision}`,\n });\n }\n\n // Check context\n if (\n !ALL_CONTEXTS.includes(sample.expectedOutput.primaryContext as AgentContext)\n ) {\n errors.push({\n type: \"invalid_context\",\n message: `Unknown primary context: ${sample.expectedOutput.primaryContext}`,\n });\n }\n\n for (const ctx of sample.expectedOutput.secondaryContexts) {\n if (!ALL_CONTEXTS.includes(ctx as AgentContext)) {\n errors.push({\n type: \"invalid_context\",\n message: `Unknown secondary context: ${ctx}`,\n });\n }\n }\n\n // Check expected action (if present)\n if (sample.expectedOutput.expectedAction) {\n const actionUpper = sample.expectedOutput.expectedAction.toUpperCase();\n if (!ACTION_CONTEXT_MAP[actionUpper]) {\n warnings.push({\n type: \"missing_grounding_keywords\",\n message: `Action ${actionUpper} not in context catalog (may be a custom action)`,\n });\n }\n }\n\n // Check for agent name pollution in the response\n // The model output should use the randomized agent name, not a fixed name\n const participants = new Set(\n sample.messages.map((m) => m.name).filter(Boolean),\n );\n if (participants.size <= 1 && sample.messages.length > 2) {\n warnings.push({\n type: \"single_participant\",\n message: \"Only one participant name in the conversation\",\n });\n }\n\n return {\n sampleId: sample.id,\n valid: errors.length === 0,\n errors,\n warnings,\n };\n}\n\n/**\n * Validate an eliza_native_v1 tuning example JSONL line.\n */\nexport function validateElizaNativeExample(jsonLine: string): {\n valid: boolean;\n errors: string[];\n} {\n const errors: string[] = [];\n\n let parsed: ElizaNativeTrainingExample;\n try {\n parsed = JSON.parse(jsonLine);\n } catch {\n return { valid: false, errors: [\"Invalid JSON\"] };\n }\n\n const messages = getTuningMessages(parsed);\n if (!messages) {\n errors.push(\"Missing eliza_native_v1 request system/messages/prompt\");\n return { valid: false, errors };\n }\n\n const native = parsed as ElizaNativeTrajectoryRow;\n if (native.format !== ELIZA_NATIVE_TRAJECTORY_FORMAT) {\n errors.push(`format must be ${ELIZA_NATIVE_TRAJECTORY_FORMAT}`);\n return { valid: false, errors };\n }\n if (!NATIVE_MODEL_BOUNDARIES.has(native.boundary)) {\n errors.push(\"boundary must be a supported Vercel AI SDK model boundary\");\n }\n\n if (messages.length < 2) {\n errors.push(\"Need at least 2 request messages (e.g. system + user)\");\n }\n const text = native.response.text;\n const toolCalls = native.response.toolCalls;\n if (\n (typeof text !== \"string\" || text.trim().length === 0) &&\n !Array.isArray(toolCalls)\n ) {\n errors.push(\"Missing response.text or response.toolCalls\");\n }\n for (const msg of messages) {\n if (\n !msg.role ||\n ![\"system\", \"developer\", \"user\", \"assistant\", \"tool\"].includes(msg.role)\n ) {\n errors.push(`Invalid role: ${msg.role}`);\n }\n if (msg.content === undefined && msg.parts === undefined) {\n errors.push(\"Missing message content/parts\");\n }\n }\n\n return { valid: errors.length === 0, errors };\n}\n\n/**\n * Validate an entire dataset and produce a quality report.\n */\nexport function validateDataset(\n samples: TrainingSample[],\n): DatasetQualityReport {\n const results = samples.map(validateSample);\n const validResults = results.filter((r) => r.valid);\n const invalidResults = results.filter((r) => !r.valid);\n\n // Decision balance\n const respondCount = samples.filter(\n (s) => s.expectedOutput.decision === \"RESPOND\",\n ).length;\n const ignoreCount = samples.filter(\n (s) => s.expectedOutput.decision === \"IGNORE\",\n ).length;\n const stopCount = samples.filter(\n (s) => s.expectedOutput.decision === \"STOP\",\n ).length;\n\n // Context coverage\n const contextCoverage = Object.fromEntries(\n ALL_CONTEXTS.map((ctx) => [\n ctx,\n samples.filter((s) => s.expectedOutput.primaryContext === ctx).length,\n ]),\n ) as Record<AgentContext, number>;\n const missingContexts = ALL_CONTEXTS.filter(\n (ctx) => contextCoverage[ctx] === 0,\n );\n\n // Agent name diversity\n const uniqueNames = new Set(samples.map((s) => s.agentName));\n\n // Turn count stats\n const turnCounts = samples\n .map((s) => s.metadata.turnCount)\n .sort((a, b) => a - b);\n const turnCountStats = {\n min: turnCounts[0] ?? 0,\n max: turnCounts[turnCounts.length - 1] ?? 0,\n mean: turnCounts.reduce((a, b) => a + b, 0) / (turnCounts.length || 1),\n median: turnCounts[Math.floor(turnCounts.length / 2)] ?? 0,\n p90: turnCounts[Math.floor(turnCounts.length * 0.9)] ?? 0,\n };\n\n // Pattern distribution\n const patternDistribution: Record<string, number> = {};\n for (const s of samples) {\n patternDistribution[s.metadata.pattern] =\n (patternDistribution[s.metadata.pattern] ?? 0) + 1;\n }\n\n // Top errors and warnings\n const errorCounts: Record<string, number> = {};\n const warningCounts: Record<string, number> = {};\n for (const r of results) {\n for (const e of r.errors) {\n errorCounts[e.type] = (errorCounts[e.type] ?? 0) + 1;\n }\n for (const w of r.warnings) {\n warningCounts[w.type] = (warningCounts[w.type] ?? 0) + 1;\n }\n }\n\n return {\n totalSamples: samples.length,\n validSamples: validResults.length,\n invalidSamples: invalidResults.length,\n errorRate: invalidResults.length / (samples.length || 1),\n\n decisionBalance: {\n RESPOND: respondCount,\n IGNORE: ignoreCount,\n STOP: stopCount,\n respondPct: respondCount / (samples.length || 1),\n ignorePct: ignoreCount / (samples.length || 1),\n stopPct: stopCount / (samples.length || 1),\n },\n\n contextCoverage,\n missingContexts,\n\n uniqueAgentNames: uniqueNames.size,\n totalSamplesChecked: samples.length,\n nameDiversityRatio: uniqueNames.size / (samples.length || 1),\n\n turnCountStats,\n patternDistribution,\n\n topErrors: Object.entries(errorCounts)\n .map(([type, count]) => ({ type, count }))\n .sort((a, b) => b.count - a.count)\n .slice(0, 10),\n\n topWarnings: Object.entries(warningCounts)\n .map(([type, count]) => ({ type, count }))\n .sort((a, b) => b.count - a.count)\n .slice(0, 10),\n\n nativeFormatValid: 0, // filled by separate JSONL validation\n nativeFormatInvalid: 0,\n };\n}\n\n/**\n * Run all validations and produce a formatted report string.\n */\nexport function formatQualityReport(report: DatasetQualityReport): string {\n const lines: string[] = [];\n\n lines.push(\"=== Dataset Quality Report ===\");\n lines.push(\"\");\n lines.push(`Total samples: ${report.totalSamples}`);\n lines.push(\n `Valid: ${report.validSamples} (${((1 - report.errorRate) * 100).toFixed(1)}%)`,\n );\n lines.push(`Invalid: ${report.invalidSamples}`);\n lines.push(\"\");\n\n lines.push(\"--- Decision Balance ---\");\n lines.push(\n `RESPOND: ${report.decisionBalance.RESPOND} (${(report.decisionBalance.respondPct * 100).toFixed(1)}%)`,\n );\n lines.push(\n `IGNORE: ${report.decisionBalance.IGNORE} (${(report.decisionBalance.ignorePct * 100).toFixed(1)}%)`,\n );\n lines.push(\n `STOP: ${report.decisionBalance.STOP} (${(report.decisionBalance.stopPct * 100).toFixed(1)}%)`,\n );\n lines.push(\"\");\n\n lines.push(\"--- Context Coverage ---\");\n for (const [ctx, count] of Object.entries(report.contextCoverage)) {\n lines.push(` ${ctx}: ${count}`);\n }\n if (report.missingContexts.length > 0) {\n lines.push(` MISSING: ${report.missingContexts.join(\", \")}`);\n }\n lines.push(\"\");\n\n lines.push(\"--- Name Diversity ---\");\n lines.push(\n `Unique agent names: ${report.uniqueAgentNames} / ${report.totalSamplesChecked} samples`,\n );\n lines.push(\n `Diversity ratio: ${(report.nameDiversityRatio * 100).toFixed(1)}%`,\n );\n lines.push(\"\");\n\n lines.push(\"--- Turn Count ---\");\n lines.push(`Min: ${report.turnCountStats.min}`);\n lines.push(`Max: ${report.turnCountStats.max}`);\n lines.push(`Mean: ${report.turnCountStats.mean.toFixed(1)}`);\n lines.push(`Median: ${report.turnCountStats.median}`);\n lines.push(`P90: ${report.turnCountStats.p90}`);\n lines.push(\"\");\n\n lines.push(\"--- Pattern Distribution ---\");\n for (const [pattern, count] of Object.entries(report.patternDistribution)) {\n lines.push(` ${pattern}: ${count}`);\n }\n lines.push(\"\");\n\n if (report.topErrors.length > 0) {\n lines.push(\"--- Top Errors ---\");\n for (const { type, count } of report.topErrors) {\n lines.push(` ${type}: ${count}`);\n }\n lines.push(\"\");\n }\n\n if (report.topWarnings.length > 0) {\n lines.push(\"--- Top Warnings ---\");\n for (const { type, count } of report.topWarnings) {\n lines.push(` ${type}: ${count}`);\n }\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n}\n\n// ==================== Skill scoring ====================\n\n/**\n * Minimum metadata a Skill needs for scoring. We do not import @elizaos/skills\n * here because app-training is downstream of the skills package and we want\n * scoreSkill to be usable in cron-job contexts that pass loaded skills.\n */\nexport interface ScoreableSkill {\n name: string;\n}\n\n/**\n * Loose Trajectory shape used for scoring. Mirrors the persisted-trajectory\n * type but kept narrow so callers can pass results from any source (the\n * `trajectories` service, JSON exports, fixtures).\n */\nexport interface ScoreableTrajectory {\n trajectoryId?: string;\n metrics?: { finalStatus?: string };\n steps?: Array<{\n usedSkills?: string[];\n }>;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Score a curated skill in [0, 1] based on its observed success rate across\n * the supplied held-out trajectories.\n *\n * Algorithm:\n * 1. Filter trajectories that reference the skill on any step (or via\n * metadata.usedSkills, for parity with the refinement evaluator).\n * 2. Score = successCount / totalReferencingCount.\n * 3. Returns 0 when no referencing trajectories exist (signals \"no data\" —\n * callers should treat 0 as \"unscored\" if they want to distinguish that\n * from \"always failed\").\n *\n * The scoring is deliberately simple because the source of truth is the\n * trajectory store; richer signals (duration, retry count, user follow-ups)\n * are easy to layer in later by extending ScoreableTrajectory.\n */\nexport async function scoreSkill(\n skill: ScoreableSkill,\n heldOutTrajectories: ScoreableTrajectory[],\n): Promise<number> {\n const referencing = heldOutTrajectories.filter((trajectory) =>\n trajectoryUsesSkill(trajectory, skill.name),\n );\n if (referencing.length === 0) {\n return 0;\n }\n const successes = referencing.filter(\n (trajectory) => (trajectory.metrics?.finalStatus ?? \"\") === \"completed\",\n ).length;\n const score = successes / referencing.length;\n return Math.max(0, Math.min(1, score));\n}\n\nfunction trajectoryUsesSkill(\n trajectory: ScoreableTrajectory,\n skillName: string,\n): boolean {\n const target = skillName.trim();\n if (!target) return false;\n for (const step of trajectory.steps ?? []) {\n if (Array.isArray(step.usedSkills) && step.usedSkills.includes(target)) {\n return true;\n }\n }\n const metaUsed = trajectory.metadata?.usedSkills;\n if (Array.isArray(metaUsed) && metaUsed.includes(target)) {\n return true;\n }\n return false;\n}\n"],"mappings":"AAgBA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,oBAAoB,oBAAoB;AAQjD,MAAM,0BAA0B,IAAI,IAAY,6BAA6B;AAE7E,SAAS,kBACP,QACwB;AACxB,QAAM,MAAM;AAIZ,MAAI,IAAI,WAAW,gCAAgC;AACjD,UAAM,MAAuB,CAAC;AAC9B,UAAM,SAAS,IAAI,QAAQ;AAC3B,QAAI,OAAO,WAAW,YAAY,OAAO,SAAS,GAAG;AACnD,UAAI,KAAK,EAAE,MAAM,UAAU,SAAS,OAAO,CAAC;AAAA,IAC9C;AACA,UAAM,OAAO,IAAI,QAAQ;AACzB,QAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,iBAAW,OAAO,MAAyB;AACzC,YACE,IAAI,SAAS,YACb,IAAI,SAAS,KACb,IAAI,CAAC,GAAG,SAAS,YACjB,IAAI,CAAC,GAAG,YAAY,IAAI,SACxB;AACA;AAAA,QACF;AACA,YAAI,KAAK,GAAG;AAAA,MACd;AAAA,IACF;AACA,QACE,CAAC,IAAI,KAAK,CAAC,QAAQ,IAAI,SAAS,MAAM,KACtC,OAAO,IAAI,QAAQ,WAAW,YAC9B,IAAI,QAAQ,OAAO,SAAS,GAC5B;AACA,UAAI,KAAK,EAAE,MAAM,QAAQ,SAAS,IAAI,QAAQ,OAAO,CAAC;AAAA,IACxD;AACA,WAAO,IAAI,SAAS,IAAI,MAAM;AAAA,EAChC;AACA,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OAAO,WAAW;AAC9C,YAAM,KAAK,KAAK,IAAI,KAAK,KAAK,EAAE;AAAA,IAClC;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,MAAI,OAAO,YAAY,SAAS,GAAG;AACjC,UAAM,KAAK,sBAAsB;AACjC,eAAW,EAAE,MAAM,MAAM,KAAK,OAAO,aAAa;AAChD,YAAM,KAAK,KAAK,IAAI,KAAK,KAAK,EAAE;AAAA,IAClC;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;AA2CA,eAAsB,WACpB,OACA,qBACiB;AACjB,QAAM,cAAc,oBAAoB;AAAA,IAAO,CAAC,eAC9C,oBAAoB,YAAY,MAAM,IAAI;AAAA,EAC5C;AACA,MAAI,YAAY,WAAW,GAAG;AAC5B,WAAO;AAAA,EACT;AACA,QAAM,YAAY,YAAY;AAAA,IAC5B,CAAC,gBAAgB,WAAW,SAAS,eAAe,QAAQ;AAAA,EAC9D,EAAE;AACF,QAAM,QAAQ,YAAY,YAAY;AACtC,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;AACvC;AAEA,SAAS,oBACP,YACA,WACS;AACT,QAAM,SAAS,UAAU,KAAK;AAC9B,MAAI,CAAC,OAAQ,QAAO;AACpB,aAAW,QAAQ,WAAW,SAAS,CAAC,GAAG;AACzC,QAAI,MAAM,QAAQ,KAAK,UAAU,KAAK,KAAK,WAAW,SAAS,MAAM,GAAG;AACtE,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,WAAW,WAAW,UAAU;AACtC,MAAI,MAAM,QAAQ,QAAQ,KAAK,SAAS,SAAS,MAAM,GAAG;AACxD,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Trajectory } from "@elizaos/agent";
|
|
2
|
+
import type { AgentRuntime } from "@elizaos/core";
|
|
3
|
+
import type { RoleplayEpisode, RoleplayTurn } from "./roleplay-trajectories.js";
|
|
4
|
+
import { type TrajectoryTaskDatasetExport, type TrajectoryTaskDatasetSummary } from "./trajectory-task-datasets.js";
|
|
5
|
+
type RoleplayDecision = "RESPOND" | "IGNORE" | "STOP";
|
|
6
|
+
export interface RoleplayTurnExecution {
|
|
7
|
+
turnId: string;
|
|
8
|
+
speaker: string;
|
|
9
|
+
role: RoleplayTurn["role"];
|
|
10
|
+
isEvaluationTarget: boolean;
|
|
11
|
+
actualDecision?: "RESPOND" | "IGNORE" | "STOP";
|
|
12
|
+
actualPrimaryContext?: string;
|
|
13
|
+
actualSecondaryContexts: string[];
|
|
14
|
+
selectedActions: string[];
|
|
15
|
+
executedActions: string[];
|
|
16
|
+
responseText: string;
|
|
17
|
+
callbackTexts: string[];
|
|
18
|
+
trajectoryId?: string;
|
|
19
|
+
warnings: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface RoleplayEpisodeExecution {
|
|
22
|
+
episodeId: string;
|
|
23
|
+
blueprintId: string;
|
|
24
|
+
agentName: string;
|
|
25
|
+
pattern?: string;
|
|
26
|
+
evaluationTurnId: string;
|
|
27
|
+
expectedDecision: RoleplayDecision;
|
|
28
|
+
actualDecision: RoleplayDecision;
|
|
29
|
+
expectedPrimaryContext: string;
|
|
30
|
+
actualPrimaryContext?: string;
|
|
31
|
+
expectedSecondaryContexts: string[];
|
|
32
|
+
actualSecondaryContexts: string[];
|
|
33
|
+
expectedAction?: string;
|
|
34
|
+
actualActions: string[];
|
|
35
|
+
selectedActions: string[];
|
|
36
|
+
executedActions: string[];
|
|
37
|
+
decisionMatch: boolean;
|
|
38
|
+
primaryContextMatch: boolean;
|
|
39
|
+
secondaryContextExactMatch: boolean;
|
|
40
|
+
routingMatch: boolean;
|
|
41
|
+
actionMatch: boolean;
|
|
42
|
+
selectedActionMatch: boolean;
|
|
43
|
+
executedActionMatch: boolean;
|
|
44
|
+
trajectoryCaptured: boolean;
|
|
45
|
+
responseText: string;
|
|
46
|
+
callbackTexts: string[];
|
|
47
|
+
warnings: string[];
|
|
48
|
+
turnExecutions: RoleplayTurnExecution[];
|
|
49
|
+
trajectory?: Trajectory | null;
|
|
50
|
+
}
|
|
51
|
+
export interface RoleplayBucketReport {
|
|
52
|
+
totalEpisodes: number;
|
|
53
|
+
decisionMatches: number;
|
|
54
|
+
routingMatches: number;
|
|
55
|
+
primaryContextMatches: number;
|
|
56
|
+
secondaryContextExactMatches: number;
|
|
57
|
+
actionRelevantEpisodes: number;
|
|
58
|
+
actionMatches: number;
|
|
59
|
+
selectedActionMatches: number;
|
|
60
|
+
executedActionMatches: number;
|
|
61
|
+
decisionAccuracy: number;
|
|
62
|
+
routingAccuracy: number;
|
|
63
|
+
primaryContextAccuracy: number;
|
|
64
|
+
secondaryContextExactAccuracy: number;
|
|
65
|
+
actionAccuracy: number;
|
|
66
|
+
selectedActionAccuracy: number;
|
|
67
|
+
executedActionAccuracy: number;
|
|
68
|
+
}
|
|
69
|
+
export interface RoleplayExecutionReport {
|
|
70
|
+
totalEpisodes: number;
|
|
71
|
+
decisionMatches: number;
|
|
72
|
+
routingMatches: number;
|
|
73
|
+
primaryContextMatches: number;
|
|
74
|
+
secondaryContextExactMatches: number;
|
|
75
|
+
actionMatches: number;
|
|
76
|
+
selectedActionMatches: number;
|
|
77
|
+
executedActionMatches: number;
|
|
78
|
+
trajectoryCaptured: number;
|
|
79
|
+
decisionAccuracy: number;
|
|
80
|
+
routingAccuracy: number;
|
|
81
|
+
primaryContextAccuracy: number;
|
|
82
|
+
secondaryContextExactAccuracy: number;
|
|
83
|
+
actionAccuracy: number;
|
|
84
|
+
selectedActionAccuracy: number;
|
|
85
|
+
executedActionAccuracy: number;
|
|
86
|
+
trajectoryCaptureRate: number;
|
|
87
|
+
decisionConfusionMatrix: Record<RoleplayDecision, Record<RoleplayDecision, number>>;
|
|
88
|
+
warningCounts: Record<string, number>;
|
|
89
|
+
byPrimaryContext: Record<string, RoleplayBucketReport>;
|
|
90
|
+
byPattern: Record<string, RoleplayBucketReport>;
|
|
91
|
+
trajectoryDatasetSummary?: TrajectoryTaskDatasetSummary | null;
|
|
92
|
+
mismatches: Array<{
|
|
93
|
+
episodeId: string;
|
|
94
|
+
pattern?: string;
|
|
95
|
+
expectedDecision: string;
|
|
96
|
+
actualDecision: string;
|
|
97
|
+
expectedPrimaryContext: string;
|
|
98
|
+
actualPrimaryContext?: string;
|
|
99
|
+
expectedAction?: string;
|
|
100
|
+
actualActions: string[];
|
|
101
|
+
selectedActions: string[];
|
|
102
|
+
executedActions: string[];
|
|
103
|
+
warnings: string[];
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
export interface RoleplayExecutionExportPaths {
|
|
107
|
+
executionsPath: string;
|
|
108
|
+
reportPath: string;
|
|
109
|
+
trajectoryDataset?: TrajectoryTaskDatasetExport;
|
|
110
|
+
}
|
|
111
|
+
export interface ExecuteRoleplayOptions {
|
|
112
|
+
runtime?: AgentRuntime;
|
|
113
|
+
timeoutMs?: number;
|
|
114
|
+
executeAllParticipantTurns?: boolean;
|
|
115
|
+
outputDir?: string;
|
|
116
|
+
}
|
|
117
|
+
export declare function executeRoleplayEpisode(episode: RoleplayEpisode, options?: ExecuteRoleplayOptions): Promise<RoleplayEpisodeExecution>;
|
|
118
|
+
export declare function executeRoleplayEpisodes(episodes: RoleplayEpisode[], options?: ExecuteRoleplayOptions): Promise<RoleplayEpisodeExecution[]>;
|
|
119
|
+
export declare function buildRoleplayExecutionReport(executions: RoleplayEpisodeExecution[], trajectoryDatasetSummary?: TrajectoryTaskDatasetSummary | null): RoleplayExecutionReport;
|
|
120
|
+
export declare function exportRoleplayExecutionResults(executions: RoleplayEpisodeExecution[], outputDir: string): Promise<RoleplayExecutionExportPaths>;
|
|
121
|
+
export declare function loadRoleplayEpisodesFromPath(inputPath: string): Promise<RoleplayEpisode[]>;
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=roleplay-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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