- Added new workspace commands for type checking, building, and testing across multiple packages. - Updated CI workflow to include paths for new packages and utilize workspace commands. - Refactored MCP server to integrate with the agent-teams-controller, enhancing task management capabilities. - Improved task boundary detection and logging for MCP tools, ensuring better tracking of task states. - Updated documentation and prompts to reflect new MCP tool usage, replacing previous teamctl.js references.
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import { chmod, copyFile, mkdir, readdir, rm, stat } from 'node:fs/promises';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const packageRoot = path.resolve(__dirname, '..');
|
|
const srcDir = path.join(packageRoot, 'src');
|
|
const distDir = path.join(packageRoot, 'dist');
|
|
|
|
async function copyRecursive(sourceDir, targetDir) {
|
|
await mkdir(targetDir, { recursive: true });
|
|
const entries = await readdir(sourceDir, { withFileTypes: true });
|
|
|
|
for (const entry of entries) {
|
|
const sourcePath = path.join(sourceDir, entry.name);
|
|
const targetPath = path.join(targetDir, entry.name);
|
|
|
|
if (entry.isDirectory()) {
|
|
await copyRecursive(sourcePath, targetPath);
|
|
continue;
|
|
}
|
|
|
|
if (entry.isFile()) {
|
|
await copyFile(sourcePath, targetPath);
|
|
}
|
|
}
|
|
}
|
|
|
|
await rm(distDir, { recursive: true, force: true });
|
|
await mkdir(distDir, { recursive: true });
|
|
await copyRecursive(srcDir, distDir);
|
|
|
|
for (const executablePath of ['cli.js', path.join('legacy', 'teamctl.cli.js')]) {
|
|
const absPath = path.join(distDir, executablePath);
|
|
const info = await stat(absPath);
|
|
await chmod(absPath, info.mode | 0o111);
|
|
}
|