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
7 lines • 5.56 kB
JavaScript
"use strict";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; }/* 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 _chunkIUCUN6N2cjs = require('./chunk-IUCUN6N2.cjs');var _chunkYWAJIV7Ecjs = require('./chunk-YWAJIV7E.cjs');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var b=(l,t,n)=>new (0, _chunkIUCUN6N2cjs.f)({enabled:l,types:t||_chunkYWAJIV7Ecjs.j.call(void 0, ),showFiltered:n.showFiltered||!1,highlightFiltered:n.highlightFiltered||!1},!0),p= exports.b =(l,t)=>{let n;return l&&t.filterTypes?(n=t.filterTypes.split(",").map(o=>o.trim()),t.verbose&&console.log(_chalk2.default.dim(`\u{1F512} Content filtering enabled with types: ${_optionalChain([n, 'optionalAccess', _ => _.join, 'call', _2 => _2(", ")])||""}`))):l&&(n=_chunkYWAJIV7Ecjs.j.call(void 0, ),t.verbose&&console.log(_chalk2.default.dim("\u{1F512} Content filtering enabled with all available types"))),n},h= exports.c =(l,t,n,o)=>{if(!n)return t;let c=l.filterContent(t).filteredText;return o.verbose&&(console.log(_chalk2.default.yellow(`
\u{1F50D} Query after filtering:`)),console.log(_chalk2.default.yellow("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(c),console.log(_chalk2.default.yellow("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))),c},F= exports.d =(l,t,n,o)=>{if(!n||!o.verbose&&!o.showFiltered&&!o.highlightFiltered)return;let r=l.filterContent(t);if(Object.keys(r.filterCount).length>0){if(o.verbose){console.log(_chalk2.default.yellow("\u{1F4CA} Prompt Filtering Summary:")),console.log(_chalk2.default.yellow("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let c=Object.values(r.filterCount).reduce((a,i)=>a+i,0);console.log(_chalk2.default.yellow(`Total filtered items: ${c}`)),console.log(_chalk2.default.yellow(`
Breakdown by type:`));for(let[a,i]of Object.entries(r.filterCount)){let s=Math.round(i/c*100),g="\u2588".repeat(Math.min(20,Math.floor(s/5)));console.log(_chalk2.default.yellow(` ${a.padEnd(15)}: ${i.toString().padStart(3)} (${s}%) ${g}`))}}else{let c=Object.values(r.filterCount).reduce((i,s)=>i+s,0);console.log(_chalk2.default.yellow(`\u{1F4CA} Filtered ${c} sensitive items from prompt`));let a=Object.entries(r.filterCount).sort(([,i],[,s])=>s-i).slice(0,3);if(a.length>0){let i=a.map(([s,g])=>`${s} (${g})`).join(", ");console.log(_chalk2.default.yellow(` Most common: ${i}`))}console.log(_chalk2.default.dim(" Use --verbose for detailed filtering statistics"))}o.highlightFiltered&&r.highlightedText&&(console.log(_chalk2.default.yellow(`
\u{1F50D} Highlighted sensitive content in prompt:`)),console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log(r.highlightedText),console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}},v= exports.e =(l,t)=>{if(l.saveConfiguration()){if(console.log(_chalk2.default.green("\u2705 Filter configuration saved successfully")),t.verbose){let o=l.getOptions();console.log(_chalk2.default.dim("Enabled:"),o.enabled),console.log(_chalk2.default.dim("Filter types:"),o.types.join(", ")),console.log(_chalk2.default.dim("Show filtered:"),o.showFiltered)}}else console.error(_chalk2.default.red("\u274C Failed to save filter configuration"))},w= exports.f =l=>{let t=new (0, _chunkIUCUN6N2cjs.f)({},!0);return t.resetConfiguration()?(console.log(_chalk2.default.green("\u2705 Filter configuration reset to defaults")),l.verbose&&console.log(_chalk2.default.dim("Default filter types:"),t.getAvailableFilterTypes().join(", "))):console.error(_chalk2.default.red("\u274C Failed to reset filter configuration")),t};exports.a = b; exports.b = p; exports.c = h; exports.d = F; exports.e = v; exports.f = w;
/* 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-ZZSMN3CV.cjs.map