@poncho-ai/harness 0.37.0 → 0.37.1
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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/scripts/migrate-to-engine.mjs +61 -36
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.37.
|
|
2
|
+
> @poncho-ai/harness@0.37.1 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
3
3
|
> node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[embed-docs] Generated poncho-docs.ts with 4 topics
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.js [22m[32m389.90 KB[39m
|
|
12
12
|
[32mESM[39m [1mdist/isolate-TCWTUVG4.js [22m[32m47.34 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 211ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 6845ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m56.62 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.37.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fb61a62`](https://github.com/cesr/poncho-ai/commit/fb61a6259367f0a62d0acd7a20ef2fae93013819) Thanks [@cesr](https://github.com/cesr)! - fix: migration script now discovers and migrates all agent directories instead of only the first one
|
|
8
|
+
|
|
3
9
|
## 0.37.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -106,30 +106,26 @@ async function readJsonSafe(filePath) {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
async function
|
|
109
|
+
async function findAgentDirs(workingDir) {
|
|
110
110
|
const ponchoDir = resolve(workingDir, ".poncho");
|
|
111
|
+
const results = [];
|
|
111
112
|
try {
|
|
112
113
|
const entries = await readdir(ponchoDir, { withFileTypes: true });
|
|
113
114
|
for (const e of entries) {
|
|
114
115
|
if (e.isDirectory() && !e.name.startsWith(".")) {
|
|
115
|
-
|
|
116
|
+
results.push({ dir: resolve(ponchoDir, e.name), id: e.name });
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
} catch { /* no .poncho dir */ }
|
|
119
|
-
return
|
|
120
|
+
return results;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
// ---------------------------------------------------------------------------
|
|
123
124
|
// Read from local
|
|
124
125
|
// ---------------------------------------------------------------------------
|
|
125
126
|
|
|
126
|
-
async function
|
|
127
|
-
|
|
128
|
-
if (!agent) {
|
|
129
|
-
console.error("No .poncho agent directory found in", workingDir);
|
|
130
|
-
process.exit(1);
|
|
131
|
-
}
|
|
132
|
-
console.log(`Found local agent: ${agent.id} at ${agent.dir}`);
|
|
127
|
+
async function readLocalAgent(agent) {
|
|
128
|
+
console.log(` Reading agent: ${agent.id} at ${agent.dir}`);
|
|
133
129
|
|
|
134
130
|
const data = { agentId: agent.id, conversations: [], memories: [], todos: [], reminders: [] };
|
|
135
131
|
|
|
@@ -189,6 +185,29 @@ async function readLocal(workingDir) {
|
|
|
189
185
|
return data;
|
|
190
186
|
}
|
|
191
187
|
|
|
188
|
+
async function readLocal(workingDir) {
|
|
189
|
+
const agents = await findAgentDirs(workingDir);
|
|
190
|
+
if (agents.length === 0) {
|
|
191
|
+
console.error("No .poncho agent directory found in", workingDir);
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// If --agent-id is specified, filter to that agent
|
|
196
|
+
const filtered = AGENT_ID ? agents.filter((a) => a.id === AGENT_ID) : agents;
|
|
197
|
+
if (filtered.length === 0) {
|
|
198
|
+
console.error(`Agent "${AGENT_ID}" not found. Available agents: ${agents.map((a) => a.id).join(", ")}`);
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
console.log(`Found ${filtered.length} agent(s) to migrate`);
|
|
203
|
+
|
|
204
|
+
const results = [];
|
|
205
|
+
for (const agent of filtered) {
|
|
206
|
+
results.push(await readLocalAgent(agent));
|
|
207
|
+
}
|
|
208
|
+
return results;
|
|
209
|
+
}
|
|
210
|
+
|
|
192
211
|
// ---------------------------------------------------------------------------
|
|
193
212
|
// Read from Upstash
|
|
194
213
|
// ---------------------------------------------------------------------------
|
|
@@ -323,9 +342,12 @@ async function readUpstash(agentId) {
|
|
|
323
342
|
async function readFromEngine(sourceProvider, agentId) {
|
|
324
343
|
if (!agentId) {
|
|
325
344
|
// Try to detect from .poncho directory
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
else {
|
|
345
|
+
const agents = await findAgentDirs(WORKING_DIR);
|
|
346
|
+
if (agents.length === 1) agentId = agents[0].id;
|
|
347
|
+
else if (agents.length > 1) {
|
|
348
|
+
console.error(`Multiple agents found: ${agents.map((a) => a.id).join(", ")}. Use --agent-id to specify one.`);
|
|
349
|
+
process.exit(1);
|
|
350
|
+
} else {
|
|
329
351
|
console.error("--agent-id is required for engine source (or run from a project with .poncho/)");
|
|
330
352
|
process.exit(1);
|
|
331
353
|
}
|
|
@@ -513,40 +535,43 @@ async function main() {
|
|
|
513
535
|
console.log(`Working dir: ${WORKING_DIR}`);
|
|
514
536
|
if (DRY_RUN) console.log("(dry run — no data will be written)\n");
|
|
515
537
|
|
|
516
|
-
// Read source
|
|
517
|
-
let
|
|
538
|
+
// Read source — local returns an array (one per agent), others return a single object
|
|
539
|
+
let dataList;
|
|
518
540
|
if (SOURCE === "local") {
|
|
519
|
-
|
|
541
|
+
dataList = await readLocal(WORKING_DIR);
|
|
520
542
|
} else if (SOURCE === "upstash") {
|
|
521
|
-
|
|
543
|
+
dataList = [await readUpstash(AGENT_ID)];
|
|
522
544
|
} else if (SOURCE === "sqlite" || SOURCE === "postgresql") {
|
|
523
|
-
|
|
545
|
+
dataList = [await readFromEngine(SOURCE, AGENT_ID)];
|
|
524
546
|
} else {
|
|
525
547
|
console.error(`Unknown source: ${SOURCE}. Use "local", "upstash", "sqlite", or "postgresql".`);
|
|
526
548
|
process.exit(1);
|
|
527
549
|
}
|
|
528
550
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
551
|
+
for (const data of dataList) {
|
|
552
|
+
console.log(`\nAgent: ${data.agentId}`);
|
|
553
|
+
console.log(` Read from ${SOURCE}:`);
|
|
554
|
+
console.log(` Conversations: ${data.conversations.length}`);
|
|
555
|
+
console.log(` Memories: ${data.memories?.length ?? 0}`);
|
|
556
|
+
console.log(` Todo lists: ${data.todos.length}`);
|
|
557
|
+
console.log(` Reminders: ${data.reminders.length}`);
|
|
558
|
+
if (data.vfsFiles?.length) console.log(` VFS files: ${data.vfsFiles.length}`);
|
|
559
|
+
|
|
560
|
+
if (data.conversations.length === 0 && !data.memories?.length && data.todos.length === 0 && data.reminders.length === 0 && !data.vfsFiles?.length) {
|
|
561
|
+
console.log(" Nothing to migrate for this agent.");
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
535
564
|
|
|
536
|
-
|
|
537
|
-
console.log("\nNothing to migrate.");
|
|
538
|
-
process.exit(0);
|
|
539
|
-
}
|
|
565
|
+
const result = await writeToEngine(data);
|
|
540
566
|
|
|
541
|
-
|
|
542
|
-
|
|
567
|
+
console.log(` ${DRY_RUN ? "Would import" : "Imported"} to ${TARGET}:`);
|
|
568
|
+
console.log(` Conversations: ${result.convCount}`);
|
|
569
|
+
console.log(` Memories: ${result.memoryCount}`);
|
|
570
|
+
console.log(` Todos: ${result.todoCount}`);
|
|
571
|
+
console.log(` Reminders: ${result.reminderCount}`);
|
|
572
|
+
if (result.vfsCount) console.log(` VFS files: ${result.vfsCount}`);
|
|
573
|
+
}
|
|
543
574
|
|
|
544
|
-
console.log(`\n${DRY_RUN ? "Would import" : "Imported"} to ${TARGET}:`);
|
|
545
|
-
console.log(` Conversations: ${result.convCount}`);
|
|
546
|
-
console.log(` Memories: ${result.memoryCount}`);
|
|
547
|
-
console.log(` Todos: ${result.todoCount}`);
|
|
548
|
-
console.log(` Reminders: ${result.reminderCount}`);
|
|
549
|
-
if (result.vfsCount) console.log(` VFS files: ${result.vfsCount}`);
|
|
550
575
|
console.log("\nDone!");
|
|
551
576
|
}
|
|
552
577
|
|