UNPKG

rawi

Version:

Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into

4 lines 1.99 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */ var _chunkCTDDUOU6cjs = require('./chunk-CTDDUOU6.cjs');var _chunkMGIUGMP2cjs = require('./chunk-MGIUGMP2.cjs');var _chunk3YIPDBV3cjs = require('./chunk-3YIPDBV3.cjs');var _chunk3BQKIUKScjs = require('./chunk-3BQKIUKS.cjs');async function x(e){let t=await _chunkCTDDUOU6cjs.a.call(void 0, ),n=_chunkCTDDUOU6cjs.b.call(void 0, t),r=_chunk3YIPDBV3cjs.a.call(void 0, n),s=_chunk3YIPDBV3cjs.b.call(void 0, e.description),i=await _chunk3BQKIUKScjs.c.call(void 0, {credentials:e.credentials,systemPrompt:r,userPrompt:s});return{command:i.command,description:e.description,context:n,generationTime:i.generationTime}}function C(e){let t=[],n=_chunkMGIUGMP2cjs.f.call(void 0, e),r=[/rm\s+-rf\s*\/\s*$/,/rm\s+-rf\s*\*\s*$/,/>\s*\/dev\/sda/,/dd\s+.*of=\/dev/,/mkfs/,/fdisk/,/:(){ :|:& };:/,/sudo\s+rm/,/sudo\s+dd/,/curl.*\|\s*sh/,/wget.*\|\s*sh/];for(let s of r)if(s.test(e)){n=!0,t.push("This command may be dangerous and could cause system damage");break}return!e||e.trim()===""?{isValid:!1,isDangerous:!1,warnings:["Generated command is empty"]}:(e.length>1e3&&t.push("Generated command is unusually long"),(e.includes(";")||e.includes("&&")||e.includes("||"))&&t.push("Command contains multiple operations"),{isValid:!0,isDangerous:n,warnings:t})}exports.a = x; exports.b = C; /* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */ //# sourceMappingURL=chunk-DFRFF36Y.cjs.map