rawi
Version:
Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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 • 2.83 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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 _ora = require('ora'); var _ora2 = _interopRequireDefault(_ora);var a= (_class =class i{__init() {this.activeSpinners=new Map}constructor(){;_class.prototype.__init.call(this);}static getInstance(){return i.instance||(i.instance=new i),i.instance}start(t,e,s){this.stop(t);let n=_ora2.default.call(void 0, {text:e,color:_optionalChain([s, 'optionalAccess', _ => _.color])||"cyan"}).start();return this.activeSpinners.set(t,n),n}updateText(t,e){let s=this.activeSpinners.get(t);s&&(s.text=e)}succeed(t,e){let s=this.activeSpinners.get(t);s&&(s.succeed(e),this.activeSpinners.delete(t))}fail(t,e){let s=this.activeSpinners.get(t);s&&(s.fail(e),this.activeSpinners.delete(t))}stop(t){let e=this.activeSpinners.get(t);e&&(e.stop(),this.activeSpinners.delete(t))}stopAll(){for(let t of this.activeSpinners.values())t.stop();this.activeSpinners.clear()}get(t){return this.activeSpinners.get(t)}isActive(t){return this.activeSpinners.has(t)}async withSpinner(t,e,s,n){this.start(t,e,{color:_optionalChain([n, 'optionalAccess', _2 => _2.color])});try{let r=await s();return this.succeed(t,_optionalChain([n, 'optionalAccess', _3 => _3.successText])),r}catch(r){throw this.fail(t,_optionalChain([n, 'optionalAccess', _4 => _4.failText])),r}}}, _class),o= exports.b =a.getInstance(),{start:g,updateText:l,succeed:v,fail:h,stop:u,stopAll:S,withSpinner:f}=o;exports.a = a; exports.b = o; exports.c = g; exports.d = l; exports.e = v; exports.f = h; exports.g = u; exports.h = S; exports.i = f;
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 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-OJLMC7PN.cjs.map