2026-04-24 19:44:55 +08:00
|
|
|
import { cp, mkdir } from "node:fs/promises";
|
2026-04-24 19:43:59 +08:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
|
|
|
|
|
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
const rootDir = path.resolve(currentDir, "..");
|
|
|
|
|
const source = path.join(rootDir, "lib", "sdk", "cs-ai-agent-sdk.js");
|
|
|
|
|
const targetDir = path.join(rootDir, "public", "sdk");
|
|
|
|
|
const target = path.join(targetDir, "cs-ai-agent-sdk.min.js");
|
|
|
|
|
|
|
|
|
|
await mkdir(targetDir, { recursive: true });
|
2026-04-24 19:44:55 +08:00
|
|
|
await cp(source, target);
|
2026-04-24 19:43:59 +08:00
|
|
|
|
|
|
|
|
console.log(`sdk written to ${target}`);
|