evOo-local/scripts/test-listfiles.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

35 lines
1.3 KiB
TypeScript

import { normalizeWorkspacePath } from "../packages/adapters/src/computer-support.js";
import { DesktopSandboxProvider } from "../packages/adapters/src/desktop-sandbox.js";
import { createDb } from "../packages/db/src/index.js";
async function test() {
console.log("normalizeWorkspacePath('.'):", JSON.stringify(normalizeWorkspacePath(".")));
console.log("normalizeWorkspacePath(''):", JSON.stringify(normalizeWorkspacePath("")));
console.log(
"normalizeWorkspacePath('./apex-trading'):",
JSON.stringify(normalizeWorkspacePath("./apex-trading")),
);
const { prisma } = createDb("postgres://ingowagner@127.0.0.1:5432/evoo");
const quant = await prisma.bot.findFirst({
where: { name: "Apex Quant" },
include: { computer: true },
});
if (!quant?.computer) throw new Error("No quant or computer");
const sandbox = new DesktopSandboxProvider({
dataDir: "/Users/ingowagner/evOo/data",
prisma,
});
const files = await sandbox.listFiles({ id: quant.computer.id, kind: "desktop" }, ".", {} as any);
console.log("Successfully listed '.' for Apex Quant! Found entries:", files.length);
for (const f of files.slice(0, 10)) {
console.log(`- ${f.kind}: ${f.path}`);
}
}
test()
.catch(console.error)
.finally(() => process.exit(0));