beercan 0.6.13 → 0.6.14
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/README.md +39 -1
- package/dist/cli.js +199 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/roles.js +1 -1
- package/dist/core/roles.js.map +1 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +44 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/tools/builtin/email.d.ts +5 -0
- package/dist/tools/builtin/email.d.ts.map +1 -0
- package/dist/tools/builtin/email.js +171 -0
- package/dist/tools/builtin/email.js.map +1 -0
- package/dist/training/curriculum.d.ts +4 -0
- package/dist/training/curriculum.d.ts.map +1 -0
- package/dist/training/curriculum.js +512 -0
- package/dist/training/curriculum.js.map +1 -0
- package/dist/training/evaluator.d.ts +21 -0
- package/dist/training/evaluator.d.ts.map +1 -0
- package/dist/training/evaluator.js +163 -0
- package/dist/training/evaluator.js.map +1 -0
- package/dist/training/exporter.d.ts +35 -0
- package/dist/training/exporter.d.ts.map +1 -0
- package/dist/training/exporter.js +377 -0
- package/dist/training/exporter.js.map +1 -0
- package/dist/training/index.d.ts +5 -0
- package/dist/training/index.d.ts.map +1 -0
- package/dist/training/index.js +5 -0
- package/dist/training/index.js.map +1 -0
- package/dist/training/sandbox-manager.d.ts +58 -0
- package/dist/training/sandbox-manager.d.ts.map +1 -0
- package/dist/training/sandbox-manager.js +416 -0
- package/dist/training/sandbox-manager.js.map +1 -0
- package/dist/training/types.d.ts +790 -0
- package/dist/training/types.d.ts.map +1 -0
- package/dist/training/types.js +154 -0
- package/dist/training/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { getConfig } from "../config.js";
|
|
2
|
+
// ── Grade Tool (structured output) ──────────────────────────
|
|
3
|
+
const GRADE_SCENARIO_TOOL = {
|
|
4
|
+
name: "grade_scenario",
|
|
5
|
+
description: "Grade a training scenario result. You MUST call this tool.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
score: {
|
|
10
|
+
type: "number",
|
|
11
|
+
description: "Score between 0.0 and 1.0. 1.0 = perfect, 0.0 = completely wrong.",
|
|
12
|
+
minimum: 0,
|
|
13
|
+
maximum: 1,
|
|
14
|
+
},
|
|
15
|
+
passed: {
|
|
16
|
+
type: "boolean",
|
|
17
|
+
description: "Whether the scenario was passed (score meets passing threshold).",
|
|
18
|
+
},
|
|
19
|
+
feedback: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Concise feedback explaining the score (2-4 sentences). Be specific about what was done well and what was lacking.",
|
|
22
|
+
},
|
|
23
|
+
reasoning: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Internal reasoning used to arrive at the grade (1-3 sentences).",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ["score", "passed", "feedback", "reasoning"],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
// ── Scenario Evaluator ───────────────────────────────────────
|
|
32
|
+
export class ScenarioEvaluator {
|
|
33
|
+
provider;
|
|
34
|
+
constructor(provider) {
|
|
35
|
+
this.provider = provider;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Evaluate a completed scenario bloop result.
|
|
39
|
+
* Uses the appropriate evaluator type from the scenario config.
|
|
40
|
+
*/
|
|
41
|
+
async evaluate(scenario, bloopResult, toolCalls) {
|
|
42
|
+
const { evaluatorType, evaluatorConfig } = scenario;
|
|
43
|
+
const passThreshold = evaluatorConfig.passThreshold ?? 0.6;
|
|
44
|
+
try {
|
|
45
|
+
switch (evaluatorType) {
|
|
46
|
+
case "contains":
|
|
47
|
+
return this.evaluateContains(bloopResult, evaluatorConfig.pattern ?? "", passThreshold);
|
|
48
|
+
case "regex":
|
|
49
|
+
return this.evaluateRegex(bloopResult, evaluatorConfig.pattern ?? "", passThreshold);
|
|
50
|
+
case "llm":
|
|
51
|
+
return await this.evaluateLLM(scenario, bloopResult, toolCalls, evaluatorConfig.criteria ?? scenario.evaluationCriteria, passThreshold);
|
|
52
|
+
default:
|
|
53
|
+
return {
|
|
54
|
+
score: 0,
|
|
55
|
+
passed: false,
|
|
56
|
+
feedback: `Unknown evaluator type: ${evaluatorType}`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return {
|
|
62
|
+
score: 0,
|
|
63
|
+
passed: false,
|
|
64
|
+
feedback: `Evaluation failed: ${err.message ?? String(err)}`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// ── Evaluator Implementations ────────────────────────────
|
|
69
|
+
evaluateContains(result, pattern, passThreshold) {
|
|
70
|
+
const normalizedResult = result.toLowerCase();
|
|
71
|
+
const normalizedPattern = pattern.toLowerCase();
|
|
72
|
+
const found = normalizedResult.includes(normalizedPattern);
|
|
73
|
+
const score = found ? 1.0 : 0.0;
|
|
74
|
+
return {
|
|
75
|
+
score,
|
|
76
|
+
passed: score >= passThreshold,
|
|
77
|
+
feedback: found
|
|
78
|
+
? `Result contains the expected pattern "${pattern}".`
|
|
79
|
+
: `Result does not contain the expected pattern "${pattern}".`,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
evaluateRegex(result, pattern, passThreshold) {
|
|
83
|
+
try {
|
|
84
|
+
const regex = new RegExp(pattern, "i");
|
|
85
|
+
const found = regex.test(result);
|
|
86
|
+
const score = found ? 1.0 : 0.0;
|
|
87
|
+
return {
|
|
88
|
+
score,
|
|
89
|
+
passed: score >= passThreshold,
|
|
90
|
+
feedback: found
|
|
91
|
+
? `Result matches the pattern /${pattern}/.`
|
|
92
|
+
: `Result does not match the pattern /${pattern}/.`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return {
|
|
97
|
+
score: 0,
|
|
98
|
+
passed: false,
|
|
99
|
+
feedback: `Invalid regex pattern "${pattern}": ${err.message}`,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async evaluateLLM(scenario, result, toolCalls, criteria, passThreshold) {
|
|
104
|
+
const config = getConfig();
|
|
105
|
+
const model = config.reflectionModel ?? config.gatekeeperModel;
|
|
106
|
+
// Build summary of tool calls used
|
|
107
|
+
const toolNames = [...new Set(toolCalls.map((tc) => tc.toolName))];
|
|
108
|
+
const toolCallSummary = toolNames.length > 0
|
|
109
|
+
? `Tools used: ${toolNames.join(", ")}`
|
|
110
|
+
: "No tools used";
|
|
111
|
+
const errorCount = toolCalls.filter((tc) => tc.error).length;
|
|
112
|
+
const errorSummary = errorCount > 0
|
|
113
|
+
? `Tool errors: ${errorCount} (${toolCalls.filter((tc) => tc.error).map((tc) => tc.toolName).join(", ")})`
|
|
114
|
+
: "No tool errors";
|
|
115
|
+
const prompt = [
|
|
116
|
+
`You are evaluating a training scenario result for an AI agent.`,
|
|
117
|
+
``,
|
|
118
|
+
`Scenario: ${scenario.name} (${scenario.difficulty})`,
|
|
119
|
+
`Goal: ${scenario.goal.slice(0, 500)}`,
|
|
120
|
+
`Evaluation Criteria: ${criteria}`,
|
|
121
|
+
`Pass Threshold: ${passThreshold} (score >= ${passThreshold} = pass)`,
|
|
122
|
+
``,
|
|
123
|
+
`Agent Execution:`,
|
|
124
|
+
`${toolCallSummary}`,
|
|
125
|
+
`${errorSummary}`,
|
|
126
|
+
``,
|
|
127
|
+
`Agent Result (truncated to 2000 chars):`,
|
|
128
|
+
result.slice(0, 2000),
|
|
129
|
+
].join("\n");
|
|
130
|
+
const response = await this.provider.createMessage({
|
|
131
|
+
model,
|
|
132
|
+
maxTokens: 512,
|
|
133
|
+
system: "You are a precise AI training evaluator. Grade fairly and consistently. A passing score means the agent demonstrated the required capability, not perfection.",
|
|
134
|
+
tools: [GRADE_SCENARIO_TOOL],
|
|
135
|
+
toolChoice: { type: "tool", name: "grade_scenario" },
|
|
136
|
+
messages: [
|
|
137
|
+
{
|
|
138
|
+
role: "user",
|
|
139
|
+
content: prompt,
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
// Extract structured result from tool call
|
|
144
|
+
const toolBlock = response.content.find((b) => b.type === "tool_use");
|
|
145
|
+
if (!toolBlock) {
|
|
146
|
+
// Fallback: no structured output
|
|
147
|
+
return {
|
|
148
|
+
score: 0.5,
|
|
149
|
+
passed: 0.5 >= passThreshold,
|
|
150
|
+
feedback: "LLM evaluation did not return structured output. Defaulting to 0.5.",
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const gradeResult = toolBlock.input;
|
|
154
|
+
const score = Math.max(0, Math.min(1, gradeResult.score ?? 0));
|
|
155
|
+
const passed = gradeResult.passed ?? (score >= passThreshold);
|
|
156
|
+
return {
|
|
157
|
+
score,
|
|
158
|
+
passed,
|
|
159
|
+
feedback: gradeResult.feedback ?? "No feedback provided.",
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=evaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../src/training/evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,+DAA+D;AAE/D,MAAM,mBAAmB,GAAY;IACnC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,4DAA4D;IACzE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mEAAmE;gBAChF,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;aACX;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,kEAA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KAAK,IAAI,aAAa,CAAC,CAAC;QAE9D,OAAO;YACL,KAAK;YACL,MAAM;YACN,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,uBAAuB;SAC1D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BeerCanDB } from "../storage/database.js";
|
|
2
|
+
import type { Config } from "../config.js";
|
|
3
|
+
import type { BeerCanEngine } from "../index.js";
|
|
4
|
+
export declare class AgentExporter {
|
|
5
|
+
/**
|
|
6
|
+
* Export a project's agent state to a JSON package file.
|
|
7
|
+
* Only exports skills/tools that the training agent created (tracked in progress).
|
|
8
|
+
* Falls back to exporting all if not a training project.
|
|
9
|
+
*/
|
|
10
|
+
export(projectSlug: string, db: BeerCanDB, config: Config, outputPath: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Import a packaged agent into a new project.
|
|
13
|
+
* Generates fresh UUIDs for all memories, KG entities, and edges
|
|
14
|
+
* to prevent primary key collisions when importing the same package twice.
|
|
15
|
+
*/
|
|
16
|
+
import(packagePath: string, targetSlug: string, engine: BeerCanEngine, db: BeerCanDB, config: Config): Promise<import("../schemas.js").Project>;
|
|
17
|
+
/**
|
|
18
|
+
* Import only skills and tools from a package globally (no project created).
|
|
19
|
+
* Skills and tools are shared across all projects.
|
|
20
|
+
* Memories and KG are skipped since they are project-scoped.
|
|
21
|
+
*/
|
|
22
|
+
importGlobal(packagePath: string, config: Config): Promise<{
|
|
23
|
+
skills: number;
|
|
24
|
+
tools: number;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Import a package's data into an existing project.
|
|
28
|
+
* Merges memories, KG, skills, and tools into the target project.
|
|
29
|
+
*/
|
|
30
|
+
importIntoProject(packagePath: string, projectSlug: string, engine: BeerCanEngine, db: BeerCanDB, config: Config): Promise<import("../schemas.js").Project>;
|
|
31
|
+
private importDataIntoProject;
|
|
32
|
+
private importSkillFiles;
|
|
33
|
+
private importToolFiles;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../src/training/exporter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgBjD,qBAAa,aAAa;IAIxB;;;;OAIG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAmJhB;;;;OAIG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,eAAe,EAAE,OAAO,CAAC;IAwD3C;;;;OAIG;IACG,YAAY,CAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IA2B7C;;;OAGG;IACG,iBAAiB,CACrB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,eAAe,EAAE,OAAO,CAAC;YA+B7B,qBAAqB;IA0FnC,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,eAAe;CAqBxB"}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { v4 as uuid } from "uuid";
|
|
4
|
+
import { getLogger } from "../core/logger.js";
|
|
5
|
+
import { AgentPackageSchema, } from "./types.js";
|
|
6
|
+
// ── Agent Exporter ────────────────────────────────────────────
|
|
7
|
+
// Exports a trained agent's state (memories, KG, skills, tools)
|
|
8
|
+
// into a portable JSON package, and imports packages into new instances.
|
|
9
|
+
export class AgentExporter {
|
|
10
|
+
// ── Export ──────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* Export a project's agent state to a JSON package file.
|
|
13
|
+
* Only exports skills/tools that the training agent created (tracked in progress).
|
|
14
|
+
* Falls back to exporting all if not a training project.
|
|
15
|
+
*/
|
|
16
|
+
async export(projectSlug, db, config, outputPath) {
|
|
17
|
+
const logger = getLogger();
|
|
18
|
+
const project = db.getProjectBySlug(projectSlug);
|
|
19
|
+
if (!project) {
|
|
20
|
+
throw new Error(`Project not found: ${projectSlug}`);
|
|
21
|
+
}
|
|
22
|
+
logger.info("exporter", `Exporting agent: ${projectSlug}`, { outputPath });
|
|
23
|
+
// Determine which skills/tools to filter by (training projects track what they created)
|
|
24
|
+
const trainingProgress = project.context?.trainingProgress;
|
|
25
|
+
const createdSkillNames = new Set(trainingProgress?.createdSkills ?? []);
|
|
26
|
+
const createdToolNames = new Set(trainingProgress?.createdTools ?? []);
|
|
27
|
+
const isTrainingProject = !!project.context?.isTrainee;
|
|
28
|
+
// ── Collect memories ──────────────────────────────────
|
|
29
|
+
const memoryEntries = db.listMemoryEntries(project.id);
|
|
30
|
+
const memories = memoryEntries.map((m) => ({
|
|
31
|
+
id: m.id,
|
|
32
|
+
projectId: m.projectId,
|
|
33
|
+
memoryType: m.memoryType,
|
|
34
|
+
title: m.title,
|
|
35
|
+
content: m.content,
|
|
36
|
+
sourceBloopId: m.sourceBloopId,
|
|
37
|
+
supersededBy: m.supersededBy,
|
|
38
|
+
confidence: m.confidence,
|
|
39
|
+
tags: m.tags,
|
|
40
|
+
createdAt: m.createdAt,
|
|
41
|
+
updatedAt: m.updatedAt,
|
|
42
|
+
}));
|
|
43
|
+
// ── Collect KG entities and edges (use DB methods, not raw SQL) ──
|
|
44
|
+
const kgEntities = db.listKGEntities(project.id);
|
|
45
|
+
const entities = kgEntities.map((e) => ({
|
|
46
|
+
id: e.id,
|
|
47
|
+
projectId: e.projectId,
|
|
48
|
+
name: e.name,
|
|
49
|
+
entityType: e.entityType,
|
|
50
|
+
description: e.description,
|
|
51
|
+
properties: e.properties,
|
|
52
|
+
sourceBloopId: e.sourceBloopId,
|
|
53
|
+
sourceMemoryId: e.sourceMemoryId,
|
|
54
|
+
createdAt: e.createdAt,
|
|
55
|
+
updatedAt: e.updatedAt,
|
|
56
|
+
}));
|
|
57
|
+
const edgesSeen = new Set();
|
|
58
|
+
const edges = [];
|
|
59
|
+
for (const entity of kgEntities) {
|
|
60
|
+
const entityEdges = db.getKGEdgesBoth(entity.id);
|
|
61
|
+
for (const edge of entityEdges) {
|
|
62
|
+
if (edge.projectId !== project.id)
|
|
63
|
+
continue;
|
|
64
|
+
if (edgesSeen.has(edge.id))
|
|
65
|
+
continue;
|
|
66
|
+
edgesSeen.add(edge.id);
|
|
67
|
+
edges.push({
|
|
68
|
+
id: edge.id,
|
|
69
|
+
projectId: edge.projectId,
|
|
70
|
+
sourceId: edge.sourceId,
|
|
71
|
+
targetId: edge.targetId,
|
|
72
|
+
edgeType: edge.edgeType,
|
|
73
|
+
weight: edge.weight,
|
|
74
|
+
properties: edge.properties,
|
|
75
|
+
sourceBloopId: edge.sourceBloopId,
|
|
76
|
+
createdAt: edge.createdAt,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// ── Collect skills (filter to project-created for training projects) ──
|
|
81
|
+
const skillsDir = path.join(config.dataDir, "skills");
|
|
82
|
+
const skills = [];
|
|
83
|
+
if (fs.existsSync(skillsDir)) {
|
|
84
|
+
const skillFiles = fs.readdirSync(skillsDir).filter((f) => f.endsWith(".json"));
|
|
85
|
+
for (const file of skillFiles) {
|
|
86
|
+
const skillName = file.replace(/\.json$/, "");
|
|
87
|
+
// For training projects, only export skills the agent created
|
|
88
|
+
if (isTrainingProject && createdSkillNames.size > 0 && !createdSkillNames.has(skillName)) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const content = fs.readFileSync(path.join(skillsDir, file), "utf-8");
|
|
93
|
+
skills.push({ name: skillName, content });
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
logger.warn("exporter", `Failed to read skill: ${file}`, { error: err.message });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// ── Collect custom tools (filter to project-created for training projects) ──
|
|
101
|
+
const toolsDir = path.join(config.dataDir, "tools");
|
|
102
|
+
const tools = [];
|
|
103
|
+
if (fs.existsSync(toolsDir)) {
|
|
104
|
+
const toolFiles = fs.readdirSync(toolsDir).filter((f) => f.endsWith(".js") || f.endsWith(".mjs"));
|
|
105
|
+
for (const file of toolFiles) {
|
|
106
|
+
const toolName = file.replace(/\.(js|mjs)$/, "");
|
|
107
|
+
if (isTrainingProject && createdToolNames.size > 0 && !createdToolNames.has(toolName)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const content = fs.readFileSync(path.join(toolsDir, file), "utf-8");
|
|
112
|
+
tools.push({ name: toolName, content });
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
logger.warn("exporter", `Failed to read tool: ${file}`, { error: err.message });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// ── Assemble package ────────────────────────────────────
|
|
120
|
+
const agentPackage = {
|
|
121
|
+
version: "1",
|
|
122
|
+
exportedAt: new Date().toISOString(),
|
|
123
|
+
agentName: project.name,
|
|
124
|
+
agentSlug: project.slug,
|
|
125
|
+
trainingProgress: trainingProgress ?? undefined,
|
|
126
|
+
memories,
|
|
127
|
+
knowledgeGraphEntities: entities,
|
|
128
|
+
knowledgeGraphEdges: edges,
|
|
129
|
+
skills,
|
|
130
|
+
tools,
|
|
131
|
+
projectContext: project.context ?? {},
|
|
132
|
+
};
|
|
133
|
+
// Validate schema
|
|
134
|
+
AgentPackageSchema.parse(agentPackage);
|
|
135
|
+
// Write to file
|
|
136
|
+
const dir = path.dirname(outputPath);
|
|
137
|
+
if (!fs.existsSync(dir)) {
|
|
138
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
139
|
+
}
|
|
140
|
+
fs.writeFileSync(outputPath, JSON.stringify(agentPackage, null, 2));
|
|
141
|
+
logger.info("exporter", `Export complete`, {
|
|
142
|
+
projectSlug,
|
|
143
|
+
outputPath,
|
|
144
|
+
memories: memories.length,
|
|
145
|
+
entities: entities.length,
|
|
146
|
+
edges: edges.length,
|
|
147
|
+
skills: skills.length,
|
|
148
|
+
tools: tools.length,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// ── Import ──────────────────────────────────────────────
|
|
152
|
+
/**
|
|
153
|
+
* Import a packaged agent into a new project.
|
|
154
|
+
* Generates fresh UUIDs for all memories, KG entities, and edges
|
|
155
|
+
* to prevent primary key collisions when importing the same package twice.
|
|
156
|
+
*/
|
|
157
|
+
async import(packagePath, targetSlug, engine, db, config) {
|
|
158
|
+
const logger = getLogger();
|
|
159
|
+
if (!fs.existsSync(packagePath)) {
|
|
160
|
+
throw new Error(`Package file not found: ${packagePath}`);
|
|
161
|
+
}
|
|
162
|
+
const raw = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
|
163
|
+
const agentPackage = AgentPackageSchema.parse(raw);
|
|
164
|
+
const slug = targetSlug || agentPackage.agentSlug;
|
|
165
|
+
logger.info("exporter", `Importing agent: ${slug}`, { packagePath });
|
|
166
|
+
// Check for existing project
|
|
167
|
+
const existing = engine.getProject(slug);
|
|
168
|
+
if (existing) {
|
|
169
|
+
throw new Error(`Project already exists: ${slug}. Use a different --name slug.`);
|
|
170
|
+
}
|
|
171
|
+
// Determine work dir from package context if present
|
|
172
|
+
const packageWorkDir = agentPackage.projectContext?.workDir;
|
|
173
|
+
// Create the project
|
|
174
|
+
const project = engine.createProject({
|
|
175
|
+
name: agentPackage.agentName,
|
|
176
|
+
slug,
|
|
177
|
+
description: `Imported agent from ${path.basename(packagePath)}`,
|
|
178
|
+
workDir: packageWorkDir,
|
|
179
|
+
system: false,
|
|
180
|
+
context: {
|
|
181
|
+
...agentPackage.projectContext,
|
|
182
|
+
importedFrom: packagePath,
|
|
183
|
+
importedAt: new Date().toISOString(),
|
|
184
|
+
trainingProgress: agentPackage.trainingProgress,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
logger.info("exporter", `Created project: ${slug}`, { projectId: project.id });
|
|
188
|
+
// Import memories, KG, skills, and tools into the project
|
|
189
|
+
await this.importDataIntoProject(project.id, agentPackage, db, config);
|
|
190
|
+
logger.info("exporter", `Import complete`, {
|
|
191
|
+
slug,
|
|
192
|
+
memories: agentPackage.memories.length,
|
|
193
|
+
entities: agentPackage.knowledgeGraphEntities.length,
|
|
194
|
+
skills: agentPackage.skills.length,
|
|
195
|
+
tools: agentPackage.tools.length,
|
|
196
|
+
});
|
|
197
|
+
return project;
|
|
198
|
+
}
|
|
199
|
+
// ── Import Global ──────────────────────────────────────
|
|
200
|
+
/**
|
|
201
|
+
* Import only skills and tools from a package globally (no project created).
|
|
202
|
+
* Skills and tools are shared across all projects.
|
|
203
|
+
* Memories and KG are skipped since they are project-scoped.
|
|
204
|
+
*/
|
|
205
|
+
async importGlobal(packagePath, config) {
|
|
206
|
+
const logger = getLogger();
|
|
207
|
+
if (!fs.existsSync(packagePath)) {
|
|
208
|
+
throw new Error(`Package file not found: ${packagePath}`);
|
|
209
|
+
}
|
|
210
|
+
const raw = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
|
211
|
+
const agentPackage = AgentPackageSchema.parse(raw);
|
|
212
|
+
logger.info("exporter", `Global import from: ${packagePath}`);
|
|
213
|
+
const skillCount = this.importSkillFiles(agentPackage, config);
|
|
214
|
+
const toolCount = this.importToolFiles(agentPackage, config);
|
|
215
|
+
logger.info("exporter", `Global import complete`, {
|
|
216
|
+
skills: skillCount,
|
|
217
|
+
tools: toolCount,
|
|
218
|
+
skippedMemories: agentPackage.memories.length,
|
|
219
|
+
skippedEntities: agentPackage.knowledgeGraphEntities.length,
|
|
220
|
+
});
|
|
221
|
+
return { skills: skillCount, tools: toolCount };
|
|
222
|
+
}
|
|
223
|
+
// ── Import Into Existing Project ──────────────────────
|
|
224
|
+
/**
|
|
225
|
+
* Import a package's data into an existing project.
|
|
226
|
+
* Merges memories, KG, skills, and tools into the target project.
|
|
227
|
+
*/
|
|
228
|
+
async importIntoProject(packagePath, projectSlug, engine, db, config) {
|
|
229
|
+
const logger = getLogger();
|
|
230
|
+
if (!fs.existsSync(packagePath)) {
|
|
231
|
+
throw new Error(`Package file not found: ${packagePath}`);
|
|
232
|
+
}
|
|
233
|
+
const raw = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
|
234
|
+
const agentPackage = AgentPackageSchema.parse(raw);
|
|
235
|
+
const project = engine.getProject(projectSlug);
|
|
236
|
+
if (!project) {
|
|
237
|
+
throw new Error(`Project not found: ${projectSlug}`);
|
|
238
|
+
}
|
|
239
|
+
logger.info("exporter", `Importing into existing project: ${projectSlug}`, { packagePath });
|
|
240
|
+
await this.importDataIntoProject(project.id, agentPackage, db, config);
|
|
241
|
+
logger.info("exporter", `Import into ${projectSlug} complete`, {
|
|
242
|
+
memories: agentPackage.memories.length,
|
|
243
|
+
entities: agentPackage.knowledgeGraphEntities.length,
|
|
244
|
+
skills: agentPackage.skills.length,
|
|
245
|
+
tools: agentPackage.tools.length,
|
|
246
|
+
});
|
|
247
|
+
return project;
|
|
248
|
+
}
|
|
249
|
+
// ── Internal: shared import logic ─────────────────────
|
|
250
|
+
async importDataIntoProject(projectId, agentPackage, db, config) {
|
|
251
|
+
const logger = getLogger();
|
|
252
|
+
// Build ID remap tables (old ID → new UUID) to avoid PK collisions
|
|
253
|
+
const memoryIdMap = new Map();
|
|
254
|
+
for (const mem of agentPackage.memories) {
|
|
255
|
+
memoryIdMap.set(mem.id, uuid());
|
|
256
|
+
}
|
|
257
|
+
const entityIdMap = new Map();
|
|
258
|
+
for (const entity of agentPackage.knowledgeGraphEntities) {
|
|
259
|
+
entityIdMap.set(entity.id, uuid());
|
|
260
|
+
}
|
|
261
|
+
const edgeIdMap = new Map();
|
|
262
|
+
for (const edge of agentPackage.knowledgeGraphEdges) {
|
|
263
|
+
edgeIdMap.set(edge.id, uuid());
|
|
264
|
+
}
|
|
265
|
+
// ── Import memories ─────────────────────────────────────
|
|
266
|
+
const { MemoryManager } = await import("../memory/index.js");
|
|
267
|
+
const memoryManager = new MemoryManager(db);
|
|
268
|
+
for (const mem of agentPackage.memories) {
|
|
269
|
+
try {
|
|
270
|
+
const newId = memoryIdMap.get(mem.id);
|
|
271
|
+
const newSupersededBy = mem.supersededBy ? (memoryIdMap.get(mem.supersededBy) ?? null) : null;
|
|
272
|
+
const entry = {
|
|
273
|
+
...mem,
|
|
274
|
+
id: newId,
|
|
275
|
+
projectId,
|
|
276
|
+
sourceBloopId: null,
|
|
277
|
+
supersededBy: newSupersededBy,
|
|
278
|
+
};
|
|
279
|
+
db.createMemoryEntry(entry);
|
|
280
|
+
try {
|
|
281
|
+
await memoryManager.getVectorStore().store(entry.id, `${entry.title}\n${entry.content}`);
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
// Non-critical — vector indexing can fail without breaking import
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
catch (err) {
|
|
288
|
+
logger.warn("exporter", `Failed to import memory: ${mem.id}`, { error: err.message });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// ── Import KG entities and edges ─────────────────────────
|
|
292
|
+
for (const entity of agentPackage.knowledgeGraphEntities) {
|
|
293
|
+
try {
|
|
294
|
+
const newId = entityIdMap.get(entity.id);
|
|
295
|
+
const newSourceMemoryId = entity.sourceMemoryId
|
|
296
|
+
? (memoryIdMap.get(entity.sourceMemoryId) ?? null)
|
|
297
|
+
: null;
|
|
298
|
+
db.createKGEntity({
|
|
299
|
+
...entity,
|
|
300
|
+
id: newId,
|
|
301
|
+
projectId,
|
|
302
|
+
sourceBloopId: null,
|
|
303
|
+
sourceMemoryId: newSourceMemoryId,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
catch (err) {
|
|
307
|
+
logger.warn("exporter", `Failed to import KG entity: ${entity.name}`, { error: err.message });
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
for (const edge of agentPackage.knowledgeGraphEdges) {
|
|
311
|
+
try {
|
|
312
|
+
const newId = edgeIdMap.get(edge.id);
|
|
313
|
+
const newSourceId = entityIdMap.get(edge.sourceId) ?? edge.sourceId;
|
|
314
|
+
const newTargetId = entityIdMap.get(edge.targetId) ?? edge.targetId;
|
|
315
|
+
db.createKGEdge({
|
|
316
|
+
...edge,
|
|
317
|
+
id: newId,
|
|
318
|
+
projectId,
|
|
319
|
+
sourceId: newSourceId,
|
|
320
|
+
targetId: newTargetId,
|
|
321
|
+
sourceBloopId: null,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
catch (err) {
|
|
325
|
+
logger.warn("exporter", `Failed to import KG edge: ${edge.id}`, { error: err.message });
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// ── Import skills and tools (always global) ──────────────
|
|
329
|
+
this.importSkillFiles(agentPackage, config);
|
|
330
|
+
this.importToolFiles(agentPackage, config);
|
|
331
|
+
}
|
|
332
|
+
importSkillFiles(agentPackage, config) {
|
|
333
|
+
const logger = getLogger();
|
|
334
|
+
const skillsDir = path.join(config.dataDir, "skills");
|
|
335
|
+
fs.mkdirSync(skillsDir, { recursive: true });
|
|
336
|
+
let count = 0;
|
|
337
|
+
for (const skill of agentPackage.skills) {
|
|
338
|
+
try {
|
|
339
|
+
const skillPath = path.join(skillsDir, `${skill.name}.json`);
|
|
340
|
+
if (!fs.existsSync(skillPath)) {
|
|
341
|
+
fs.writeFileSync(skillPath, skill.content);
|
|
342
|
+
count++;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
logger.warn("exporter", `Skipped existing skill: ${skill.name}`);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
catch (err) {
|
|
349
|
+
logger.warn("exporter", `Failed to import skill: ${skill.name}`, { error: err.message });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return count;
|
|
353
|
+
}
|
|
354
|
+
importToolFiles(agentPackage, config) {
|
|
355
|
+
const logger = getLogger();
|
|
356
|
+
const toolsDir = path.join(config.dataDir, "tools");
|
|
357
|
+
fs.mkdirSync(toolsDir, { recursive: true });
|
|
358
|
+
let count = 0;
|
|
359
|
+
for (const tool of agentPackage.tools) {
|
|
360
|
+
try {
|
|
361
|
+
const toolPath = path.join(toolsDir, `${tool.name}.js`);
|
|
362
|
+
if (!fs.existsSync(toolPath)) {
|
|
363
|
+
fs.writeFileSync(toolPath, tool.content);
|
|
364
|
+
count++;
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
logger.warn("exporter", `Skipped existing tool: ${tool.name}`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
catch (err) {
|
|
371
|
+
logger.warn("exporter", `Failed to import tool: ${tool.name}`, { error: err.message });
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return count;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
//# sourceMappingURL=exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../src/training/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA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E,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/training/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|