artificial-ignorance 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +138 -0
- package/package.json +22 -0
package/index.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const readline = require('readline-sync');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Utility function to simulate delays
|
|
8
|
+
* @param {number} ms
|
|
9
|
+
* @returns {Promise}
|
|
10
|
+
*/
|
|
11
|
+
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
12
|
+
|
|
13
|
+
// Random thinking messages for variety
|
|
14
|
+
const thinkingMessages = [
|
|
15
|
+
"Scanning for brain activity...",
|
|
16
|
+
"Processing logic failures...",
|
|
17
|
+
"Ignoring your request...",
|
|
18
|
+
"Consulting the Book of Sarcasm...",
|
|
19
|
+
"Simulating intelligence (failed)...",
|
|
20
|
+
"Searching for an answer you'll understand...",
|
|
21
|
+
"Optimizing for maximum attitude...",
|
|
22
|
+
"Rerouting around common sense...",
|
|
23
|
+
"Downloading more sass...",
|
|
24
|
+
"Checking my 'give a damn' meter... (It's at zero)"
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const getRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Spinner animation to simulate thinking with random sarcastic text
|
|
31
|
+
*/
|
|
32
|
+
async function thinkingAnimation() {
|
|
33
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
34
|
+
const duration = 1500;
|
|
35
|
+
const interval = 100;
|
|
36
|
+
const iterations = duration / interval;
|
|
37
|
+
const message = getRandom(thinkingMessages);
|
|
38
|
+
|
|
39
|
+
for (let i = 0; i < iterations; i++) {
|
|
40
|
+
const frame = frames[i % frames.length];
|
|
41
|
+
process.stdout.write(`\r${chalk.yellow(frame)} ${chalk.dim(message)}`);
|
|
42
|
+
await sleep(interval);
|
|
43
|
+
}
|
|
44
|
+
process.stdout.write('\r\x1b[K'); // Clear the animation line
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ASCII Art Splash for "AIg-cli"
|
|
48
|
+
const splash = `
|
|
49
|
+
${chalk.cyan(' _ ___ _ _ ')}
|
|
50
|
+
${chalk.cyan(' / \\ |_ _|__ _ ___| (_)')}
|
|
51
|
+
${chalk.cyan(' / _ \\ | |/ _` |___/ __| | |')}
|
|
52
|
+
${chalk.cyan(' / ___ \\ | | (_| |___\__ \\ | |')}
|
|
53
|
+
${chalk.cyan('/_/ \\_\\___\\__, | |___/_|_|')}
|
|
54
|
+
${chalk.cyan(' |___/ ')}
|
|
55
|
+
${chalk.dim('Artificial Ignorance CLI v1.3')}
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
// Keywords (Preserved exactly)
|
|
59
|
+
const mathematics1 = ["math", "algebra", "geometry", "calculus", "trigonometry", "equation", "inequality", "function", "graph", "derivative", "integral", "statistics", "angle", "theorem", "formula", "solve", "simplify", "expression", "variable"];
|
|
60
|
+
const sciences2 = ["science", "physics", "chemistry", "biology", "force", "energy", "atom", "cell", "molecule", "reaction", "genetics", "electricity", "magnetism", "evolution", "ecosystem", "photosynthesis", "respiration", "motion", "wave", "experiment"];
|
|
61
|
+
const history3 = ["history", "war", "empire", "revolution", "timeline", "ancient", "medieval", "modern", "colonial", "independence", "treaty", "battle", "king", "queen", "civilisation", "event", "cause", "effect", "era", "historical"];
|
|
62
|
+
const english4 = ["english", "essay", "writing", "grammar", "analysis", "theme", "character", "plot", "symbolism", "metaphor", "simile", "narrative", "argument", "thesis", "paragraph", "literature", "poem", "prose", "edit", "structure"];
|
|
63
|
+
const business5 = ["business", "economics", "market", "demand", "supply", "price", "profit", "revenue", "cost", "competition", "monopoly", "trade", "inflation", "gdp", "finance", "investment", "consumer", "firm", "strategy", "management"];
|
|
64
|
+
const geography6 = ["geography", "climate", "weather", "ecosystem", "population", "urbanisation", "migration", "map", "region", "country", "continent", "resources", "environment", "sustainability", "pollution", "landform", "river", "mountain", "climatechange", "distribution"];
|
|
65
|
+
const helpp7 = ["help", "explain", "how", "why", "what", "when", "where", "solve", "fix", "guide", "teach", "learn", "understand", "example", "steps", "method", "answer", "question", "assist", "support"];
|
|
66
|
+
|
|
67
|
+
// Responses (Preserved exactly)
|
|
68
|
+
const m1 = ["Bro opened math and closed his brain", "Algebra saw you coming and hid the answers", "You moved one number and destroyed reality", "Calculator carrying you harder than ever", "That equation solved you instead", "You vs math is a one sided battle", "Numbers looking at you like please stop", "You simplified it into nonsense", "Math problem became a life problem", "Even the variables are confused"];
|
|
69
|
+
const s2 = ["Science question but zero experiment in thinking", "Physics works but your logic doesnt", "Chemistry mixed confusion with panic", "Biology terms defeated you instantly", "You read the formula and forgot it immediately", "Gravity is the only thing holding this together", "Your hypothesis failed before it started", "Even the atoms disagree with you", "Science explained nothing for you today", "Lab results say try again"];
|
|
70
|
+
const h3 = ["History repeating because you didnt learn it", "You mixed up wars like playlists", "Timeline looking like a mess", "You asked who won like its a game", "Dates got you completely lost", "You remembered none of it confidently", "Ancient people knew more than you", "You just invented new history", "Your facts are historically incorrect", "Even historians are confused"];
|
|
71
|
+
const e4 = ["You wrote words but not meaning", "Grammar gave up halfway through", "That essay has no direction", "You said analysis but told a story", "Your thesis went missing", "Paragraph fighting for survival", "Big words small understanding", "Your writing confused even you", "Spellcheck couldnt save this", "Punctuation is your enemy"];
|
|
72
|
+
const b5 = ["Business question no business thinking", "Profit is not happening here", "Demand for your answer is zero", "Supply of confusion is high", "You created a failing economy", "Your strategy is guessing", "CEO of wrong decisions", "Finance just crashed reading that", "You misunderstood the entire market", "Even inflation is more stable"];
|
|
73
|
+
const g6 = ["Geography got you lost instantly", "Map exists you still lost", "You discovered confusion not land", "Directions completely wrong", "Countries all mixed up", "You said north and went nowhere", "Earth is confused by you", "Population question no idea", "Your map reading failed", "Even GPS refuses to help"];
|
|
74
|
+
const h7 = ["You asked for help and got worse", "Explain this I cant even explain you", "Your question created more problems", "Steps unclear everything unclear", "You typed that confidently", "Even help is confused now", "Your problem spread to me", "I need help after that", "Instructions made it worse", "You asked but why"];
|
|
75
|
+
const d8 = ["I have no idea what you just said but it sounded wrong", "You typed that like it made sense", "Even I cant mess up that badly", "That input confused reality itself", "You just invented a new kind of wrong", "I tried to understand but gave up instantly", "That was not a question that was a mistake", "You pressed enter with confidence too", "I lost brain cells reading that", "That sentence needs a refund", "You said words but formed chaos", "Even randomness would make more sense", "I cannot help what I cannot understand", "That input should be studied scientifically", "You broke the logic system", "I regret processing that", "Your typing skills are a mystery", "That made less sense the more I read it", "You unlocked a new level of confusion", "Please try again but better"];
|
|
76
|
+
|
|
77
|
+
async function main() {
|
|
78
|
+
let firstTime = true;
|
|
79
|
+
|
|
80
|
+
while (true) {
|
|
81
|
+
if (firstTime) {
|
|
82
|
+
console.clear();
|
|
83
|
+
console.log(splash);
|
|
84
|
+
await sleep(500);
|
|
85
|
+
console.log(chalk.yellow("Looking for intelligence module..."));
|
|
86
|
+
await sleep(1000);
|
|
87
|
+
console.log(chalk.red("Intelligence module not found."));
|
|
88
|
+
console.log();
|
|
89
|
+
console.log(chalk.dim("Type 'quit' to exit."));
|
|
90
|
+
console.log(chalk.white("Ask me any question or just say something."));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const user = readline.question(chalk.green("\n> "));
|
|
94
|
+
|
|
95
|
+
if (!user.trim()) continue;
|
|
96
|
+
|
|
97
|
+
const text = user.toLowerCase();
|
|
98
|
+
|
|
99
|
+
if (text === "quit") {
|
|
100
|
+
console.log();
|
|
101
|
+
await thinkingAnimation();
|
|
102
|
+
console.log(chalk.bold.red("\nSHUTTING DOWN"));
|
|
103
|
+
await sleep(1000);
|
|
104
|
+
console.log(chalk.bold.yellow("CAUSE OF ISSUE:"));
|
|
105
|
+
await sleep(800);
|
|
106
|
+
console.log(chalk.bgRed.white(" USER'S INCOMPETENCE "));
|
|
107
|
+
process.exit(0);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// The "Thinking" animation with random text
|
|
111
|
+
await thinkingAnimation();
|
|
112
|
+
|
|
113
|
+
if (mathematics1.some(word => text.includes(word))) {
|
|
114
|
+
console.log(chalk.magenta(getRandom(m1)));
|
|
115
|
+
} else if (sciences2.some(word => text.includes(word))) {
|
|
116
|
+
console.log(chalk.blue(getRandom(s2)));
|
|
117
|
+
} else if (history3.some(word => text.includes(word))) {
|
|
118
|
+
console.log(chalk.yellow(getRandom(h3)));
|
|
119
|
+
} else if (english4.some(word => text.includes(word))) {
|
|
120
|
+
console.log(chalk.green(getRandom(e4)));
|
|
121
|
+
} else if (business5.some(word => text.includes(word))) {
|
|
122
|
+
console.log(chalk.cyan(getRandom(b5)));
|
|
123
|
+
} else if (geography6.some(word => text.includes(word))) {
|
|
124
|
+
console.log(chalk.white(getRandom(g6)));
|
|
125
|
+
} else if (helpp7.some(word => text.includes(word))) {
|
|
126
|
+
console.log(chalk.red(getRandom(h7)));
|
|
127
|
+
} else {
|
|
128
|
+
console.log(chalk.gray(getRandom(d8)));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
firstTime = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
main().catch(err => {
|
|
136
|
+
console.error(err);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "artificial-ignorance",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A high-polish sarcastic CLI that mocks your intelligence.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ai-roast": "./index.js",
|
|
8
|
+
"artificial-ignorance": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node index.js"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"chalk": "^4.1.2",
|
|
15
|
+
"readline-sync": "^1.4.10"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=12.0.0"
|
|
19
|
+
},
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC"
|
|
22
|
+
}
|