@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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const remoteExecutor_1 = require("../remoteExecutor");
const { JEST_WINRM_PASS, JEST_WINRM_USER, JEST_WINRM_HOST } = process.env;
if (!JEST_WINRM_PASS || !JEST_WINRM_USER || !JEST_WINRM_HOST) {
throw new Error('Missing environment variables');
}
describe('RemoteExecutor - WinRM', () => {
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
remoteExecutor_1.RemoteExecutor.instance.init({
enabled: true,
target: JEST_WINRM_HOST,
port: 5985,
type: 'winrm',
platform: 'windows',
user: JEST_WINRM_USER,
remote_workspace: `C:\\Users\\${JEST_WINRM_USER}`,
password: JEST_WINRM_PASS,
});
yield remoteExecutor_1.RemoteExecutor.instance.validateConnection();
}));
it('should retrieve the hostname', () => __awaiter(void 0, void 0, void 0, function* () {
const cmd = 'hostname';
const result = yield remoteExecutor_1.RemoteExecutor.instance.executeCommand(cmd);
expect(result).toContain('EC2AMAZ-L9ASL32');
}));
it.skip('should execute sql command', () => __awaiter(void 0, void 0, void 0, function* () {
const cmd = 'cd C:\\Users\\administrator ; sqlcmd -Q "SELECT name FROM sys.databases"';
const result = yield remoteExecutor_1.RemoteExecutor.instance.executeCommand(cmd);
expect(result).toContain('master');
}), 30000);
it('should Check if powershell patterns are working', () => __awaiter(void 0, void 0, void 0, function* () {
const cmd = 'cd . ; Get-Process python -ErrorAction SilentlyContinue | Where-Object { $_.CommandLine -like "*celery*" } | Select-Object Id, ProcessName, CommandLine';
const result = yield remoteExecutor_1.RemoteExecutor.instance.executeCommand(cmd);
expect(result).not.toContain('error');
}), 30000);
it('should execute complex commands', () => __awaiter(void 0, void 0, void 0, function* () {
const cmd = 'cd . ; $result = @{}; $result.RabbitMQ = (Get-Service -Name "RabbitMQ" -ErrorAction SilentlyContinue).Status; $result.PostgreSQL = (Get-Service -Name "postgresql-x64-18" -ErrorAction SilentlyContinue).Status; $result.Celery = @(Get-Process -Name "celery" -ErrorAction SilentlyContinue).Count -gt 0; $result.Flower = (Get-Service -Name "FlowerMonitor" -ErrorAction SilentlyContinue).Status; ConvertTo-Json -InputObject $result -Depth 3';
const result = yield remoteExecutor_1.RemoteExecutor.instance.executeCommand(cmd);
console.log(JSON.stringify(result, null, 2));
expect(result).not.toContain('error');
}), 30000);
});