@2501-ai/cli
Version:
[](https://www.npmjs.com/package/@2501-ai/cli) [](https://www.2501.ai/research/full-humaneval-benchmark) [); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureRemoteWorkspaceExists = ensureRemoteWorkspaceExists;
exports.setupRemoteWorkspace = setupRemoteWorkspace;
const remoteExecutor_1 = require("./remoteExecutor");
const logger_1 = __importDefault(require("../utils/logger"));
function ensureRemoteWorkspaceExists(isWindows, workspacePath) {
return __awaiter(this, void 0, void 0, function* () {
const createCommand = isWindows
? `if not exist "${workspacePath}" mkdir "${workspacePath}"`
: `mkdir -p "${workspacePath}"`;
logger_1.default.debug(`Ensuring remote workspace directory exists: ${workspacePath}`);
yield remoteExecutor_1.RemoteExecutor.instance.executeCommand(createCommand, undefined, true);
logger_1.default.debug(`Remote workspace directory ready: ${workspacePath}`);
});
}
function setupRemoteWorkspace(remoteExecConfig, options) {
return __awaiter(this, void 0, void 0, function* () {
const isWindows = remoteExecConfig.platform === 'windows';
let workspacePath = options.remoteWorkspace;
if (!workspacePath) {
workspacePath = isWindows
? 'C:\\ProgramData\\2501\\'
: `/home/${remoteExecConfig.user}/.2501/workspace`;
logger_1.default.debug(`Using default workspace path: ${workspacePath}`);
}
yield ensureRemoteWorkspaceExists(isWindows, workspacePath);
return workspacePath;
});
}