From 1ed0582661d4f3641fc7f4a5cd0d9a524c2497a9 Mon Sep 17 00:00:00 2001 From: FamALouiz Date: Sat, 30 Aug 2025 09:13:44 +0200 Subject: [PATCH] feat: updated list of keywords --- app/api/chat/route.ts | 53 +- data/keywords.ts | 1369 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1370 insertions(+), 52 deletions(-) create mode 100644 data/keywords.ts diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 38fa1f4..ff4af92 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -3,6 +3,7 @@ import { Ollama } from "ollama"; import { z } from "zod"; import { exec } from "child_process"; import { promisify } from "util"; +import { commandKeywords } from "@/data/keywords"; const execAsync = promisify(exec); @@ -119,58 +120,6 @@ export async function POST(request: NextRequest) { const { message, context } = await request.json(); // Determine if this is a command request or general query - const commandKeywords = [ - "command", - "execute", - "run", - "apply", - "block", - "allow", - "rule", - "iptables", - "add", - "remove", - "delete", - "create", - "configure", - "set", - "enable", - "disable", - "drop", - "accept", - "reject", - "forward", - "input", - "output", - "chain", - "table", - "flush", - "policy", - "insert", - "append", - "firewall", - "route", - "redirect", - "nat", - "masquerade", - "port", - "protocol", - "tcp", - "udp", - "icmp", - "ssh", - "http", - "https", - "connect", - "disconnect", - "link", - "unlink", - "bridge", - "subnet", - "vlan", - "interface", - ]; - const isCommandRequest = commandKeywords.some((keyword) => message.toLowerCase().includes(keyword) ); diff --git a/data/keywords.ts b/data/keywords.ts new file mode 100644 index 0000000..4e874c9 --- /dev/null +++ b/data/keywords.ts @@ -0,0 +1,1369 @@ +export const commandKeywords = [ + "command", + "execute", + "run", + "apply", + "block", + "allow", + "rule", + "iptables", + "add", + "remove", + "delete", + "create", + "configure", + "set", + "enable", + "disable", + "drop", + "accept", + "reject", + "forward", + "input", + "output", + "chain", + "table", + "flush", + "policy", + "insert", + "append", + "firewall", + "route", + "redirect", + "nat", + "masquerade", + "port", + "protocol", + "tcp", + "udp", + "icmp", + "ssh", + "http", + "https", + "connect", + "disconnect", + "link", + "unlink", + "bridge", + "subnet", + "vlan", + "interface", + "stop", + "prevent", + "deny", + "restrict", + "limit", + "permit", + "grant", + "give access", + "open", + "close", + "shut down", + "turn on", + "turn off", + "activate", + "deactivate", + "start", + "begin", + "end", + "finish", + "setup", + "install", + "uninstall", + "change", + "modify", + "update", + "edit", + "fix", + "repair", + "make", + "build", + "establish", + "form", + "cut", + "break", + "sever", + "join", + "merge", + "combine", + "isolate", + "separate", + "protect", + "secure", + "lock", + "unlock", + "access", + "reach", + "contact", + "communicate", + "send", + "receive", + "transmit", + "transfer", + "move", + "copy", + "share", + "hide", + "expose", + "reveal", + "show", + "display", + "monitor", + "watch", + "check", + "test", + "verify", + "validate", + "confirm", + "ensure", + "guarantee", + "force", + "enforce", + "implement", + "deploy", + "launch", + "initiate", + "trigger", + "activate", + "engage", + "disengage", + "bypass", + "override", + "cancel", + "abort", + "terminate", + "kill", + "restart", + "reset", + "clear", + "clean", + "purge", + "filter", + "sort", + "organize", + "arrange", + "redirect", + "reroute", + "forward", + "bounce", + "mirror", + "duplicate", + "clone", + "backup", + "restore", + "recover", + "save", + "load", + "import", + "export", + "sync", + "match", + "compare", + "scan", + "search", + "find", + "locate", + "identify", + "detect", + "discover", + "analyze", + "examine", + "inspect", + "review", + "evaluate", + "assess", + "measure", + "count", + "calculate", + "compute", + "process", + "handle", + "manage", + "control", + "direct", + "guide", + "navigate", + "route", + "path", + "way", + "method", + "approach", + "technique", + "strategy", + "plan", + "design", + "architect", + "structure", + "framework", + "model", + "template", + "pattern", + "rule", + "regulation", + "policy", + "procedure", + "protocol", + "standard", + "specification", + "requirement", + "condition", + "criteria", + "parameter", + "setting", + "option", + "choice", + "selection", + "preference", + "priority", + "order", + "sequence", + "series", + "chain", + "link", + "connection", + "relationship", + "association", + "binding", + "attachment", + "integration", + "incorporation", + "inclusion", + "addition", + "extension", + "expansion", + "enhancement", + "improvement", + "optimization", + "tuning", + "adjustment", + "calibration", + "alignment", + "balance", + "stability", + "consistency", + "reliability", + "availability", + "accessibility", + "visibility", + "transparency", + "clarity", + "simplicity", + "complexity", + "sophistication", + "advanced", + "basic", + "simple", + "easy", + "difficult", + "hard", + "tough", + "challenging", + "problematic", + "issue", + "problem", + "error", + "fault", + "bug", + "glitch", + "failure", + "breakdown", + "malfunction", + "disruption", + "interruption", + "interference", + "conflict", + "collision", + "clash", + "incompatibility", + "mismatch", + "inconsistency", + "discrepancy", + "difference", + "variation", + "deviation", + "exception", + "anomaly", + "irregularity", + "abnormality", + "unusual", + "strange", + "weird", + "odd", + "peculiar", + "suspicious", + "questionable", + "doubtful", + "uncertain", + "unclear", + "ambiguous", + "vague", + "confusing", + "puzzling", + "mysterious", + "unknown", + "unfamiliar", + "new", + "fresh", + "recent", + "latest", + "current", + "present", + "existing", + "available", + "ready", + "prepared", + "set", + "configured", + "established", + "operational", + "functional", + "working", + "active", + "live", + "online", + "connected", + "linked", + "joined", + "attached", + "bound", + "tied", + "fastened", + "secured", + "locked", + "closed", + "sealed", + "protected", + "defended", + "guarded", + "shielded", + "covered", + "hidden", + "concealed", + "masked", + "disguised", + "camouflaged", + "invisible", + "transparent", + "clear", + "obvious", + "evident", + "apparent", + "visible", + "noticeable", + "detectable", + "recognizable", + "identifiable", + "distinguishable", + "unique", + "special", + "specific", + "particular", + "individual", + "personal", + "private", + "confidential", + "secret", + "classified", + "restricted", + "limited", + "exclusive", + "selective", + "discriminating", + "filtering", + "screening", + "checking", + "verifying", + "validating", + "confirming", + "approving", + "authorizing", + "permitting", + "allowing", + "enabling", + "empowering", + "facilitating", + "supporting", + "assisting", + "helping", + "aiding", + "backing", + "endorsing", + "promoting", + "encouraging", + "motivating", + "inspiring", + "driving", + "pushing", + "pulling", + "dragging", + "lifting", + "raising", + "lowering", + "dropping", + "falling", + "rising", + "increasing", + "decreasing", + "growing", + "shrinking", + "expanding", + "contracting", + "stretching", + "compressing", + "squeezing", + "pressing", + "pushing", + "pulling", + "twisting", + "turning", + "rotating", + "spinning", + "revolving", + "circling", + "looping", + "cycling", + "repeating", + "iterating", + "recurring", + "returning", + "reversing", + "undoing", + "canceling", + "negating", + "neutralizing", + "balancing", + "compensating", + "offsetting", + "correcting", + "adjusting", + "fine-tuning", + "optimizing", + "improving", + "enhancing", + "upgrading", + "updating", + "modernizing", + "renovating", + "refurbishing", + "refreshing", + "renewing", + "revitalizing", + "rejuvenating", + "restoring", + "rehabilitating", + "recovering", + "healing", + "repairing", + "fixing", + "mending", + "patching", + "sealing", + "plugging", + "filling", + "completing", + "finishing", + "concluding", + "ending", + "terminating", + "stopping", + "halting", + "pausing", + "waiting", + "delaying", + "postponing", + "deferring", + "suspending", + "interrupting", + "breaking", + "splitting", + "dividing", + "separating", + "isolating", + "quarantining", + "containing", + "restricting", + "constraining", + "limiting", + "bounding", + "bordering", + "framing", + "enclosing", + "surrounding", + "encompassing", + "embracing", + "wrapping", + "covering", + "coating", + "layering", + "stacking", + "piling", + "accumulating", + "collecting", + "gathering", + "assembling", + "building", + "constructing", + "creating", + "generating", + "producing", + "manufacturing", + "making", + "crafting", + "forming", + "shaping", + "molding", + "designing", + "planning", + "preparing", + "organizing", + "arranging", + "coordinating", + "synchronizing", + "aligning", + "matching", + "pairing", + "coupling", + "binding", + "connecting", + "linking", + "joining", + "merging", + "combining", + "mixing", + "blending", + "integrating", + "unifying", + "consolidating", + "centralizing", + "focusing", + "concentrating", + "targeting", + "aiming", + "directing", + "pointing", + "orienting", + "positioning", + "placing", + "locating", + "situating", + "setting", + "establishing", + "founding", + "instituting", + "initiating", + "starting", + "beginning", + "commencing", + "launching", + "deploying", + "implementing", + "executing", + "performing", + "carrying out", + "accomplishing", + "achieving", + "attaining", + "reaching", + "obtaining", + "acquiring", + "gaining", + "earning", + "winning", + "succeeding", + "thriving", + "flourishing", + "prospering", + "advancing", + "progressing", + "developing", + "evolving", + "growing", + "maturing", + "aging", + "weathering", + "enduring", + "lasting", + "persisting", + "continuing", + "maintaining", + "sustaining", + "supporting", + "upholding", + "preserving", + "conserving", + "protecting", + "safeguarding", + "defending", + "securing", + "fortifying", + "strengthening", + "reinforcing", + "bolstering", + "backing", + "supporting", + "assisting", + "helping", + "aiding", + "facilitating", + "enabling", + "empowering", + "authorizing", + "approving", + "permitting", + "allowing", + "granting", + "giving", + "providing", + "supplying", + "delivering", + "transferring", + "transmitting", + "sending", + "shipping", + "transporting", + "moving", + "relocating", + "shifting", + "migrating", + "traveling", + "journeying", + "navigating", + "routing", + "directing", + "guiding", + "leading", + "steering", + "controlling", + "managing", + "administering", + "governing", + "ruling", + "regulating", + "monitoring", + "supervising", + "overseeing", + "watching", + "observing", + "tracking", + "following", + "pursuing", + "chasing", + "hunting", + "searching", + "seeking", + "looking", + "finding", + "discovering", + "uncovering", + "revealing", + "exposing", + "showing", + "displaying", + "presenting", + "demonstrating", + "illustrating", + "explaining", + "describing", + "detailing", + "specifying", + "defining", + "clarifying", + "elucidating", + "illuminating", + "highlighting", + "emphasizing", + "stressing", + "accentuating", + "underscoring", + "marking", + "noting", + "recording", + "documenting", + "logging", + "tracking", + "monitoring", + "measuring", + "gauging", + "assessing", + "evaluating", + "analyzing", + "examining", + "inspecting", + "reviewing", + "studying", + "researching", + "investigating", + "exploring", + "probing", + "testing", + "experimenting", + "trying", + "attempting", + "endeavoring", + "striving", + "working", + "laboring", + "toiling", + "struggling", + "fighting", + "battling", + "competing", + "contending", + "challenging", + "confronting", + "facing", + "meeting", + "encountering", + "experiencing", + "undergoing", + "enduring", + "suffering", + "tolerating", + "accepting", + "acknowledging", + "recognizing", + "admitting", + "confessing", + "declaring", + "announcing", + "proclaiming", + "stating", + "asserting", + "claiming", + "maintaining", + "insisting", + "demanding", + "requiring", + "needing", + "wanting", + "desiring", + "wishing", + "hoping", + "expecting", + "anticipating", + "predicting", + "forecasting", + "projecting", + "estimating", + "calculating", + "computing", + "determining", + "deciding", + "choosing", + "selecting", + "picking", + "opting", + "preferring", + "favoring", + "liking", + "loving", + "appreciating", + "valuing", + "treasuring", + "cherishing", + "prizing", + "honoring", + "respecting", + "admiring", + "praising", + "commending", + "congratulating", + "celebrating", + "rejoicing", + "enjoying", + "relishing", + "savoring", + "tasting", + "sampling", + "testing", + "trying", + "using", + "utilizing", + "employing", + "applying", + "implementing", + "executing", + "performing", + "operating", + "functioning", + "working", + "running", + "going", + "moving", + "flowing", + "streaming", + "pouring", + "flooding", + "overflowing", + "spilling", + "leaking", + "dripping", + "dropping", + "falling", + "cascading", + "tumbling", + "rolling", + "sliding", + "gliding", + "slipping", + "skidding", + "skating", + "skiing", + "surfing", + "riding", + "driving", + "piloting", + "steering", + "navigating", + "sailing", + "flying", + "soaring", + "climbing", + "ascending", + "rising", + "elevating", + "lifting", + "hoisting", + "raising", + "erecting", + "building", + "constructing", + "assembling", + "installing", + "mounting", + "attaching", + "connecting", + "linking", + "joining", + "fastening", + "securing", + "locking", + "closing", + "shutting", + "sealing", + "blocking", + "obstructing", + "hindering", + "impeding", + "preventing", + "stopping", + "halting", + "ceasing", + "ending", + "finishing", + "completing", + "concluding", + "terminating", + "closing", + "shutting down", + "powering off", + "switching off", + "turning off", + "deactivating", + "disabling", + "disconnecting", + "unplugging", + "detaching", + "removing", + "taking away", + "eliminating", + "deleting", + "erasing", + "wiping", + "clearing", + "cleaning", + "purging", + "flushing", + "draining", + "emptying", + "vacating", + "abandoning", + "leaving", + "departing", + "exiting", + "quitting", + "resigning", + "retiring", + "withdrawing", + "retreating", + "backing away", + "stepping back", + "moving back", + "going back", + "returning", + "coming back", + "reversing", + "undoing", + "canceling", + "aborting", + "stopping", + "interrupting", + "pausing", + "suspending", + "freezing", + "holding", + "keeping", + "retaining", + "maintaining", + "preserving", + "conserving", + "saving", + "storing", + "archiving", + "backing up", + "copying", + "duplicating", + "replicating", + "cloning", + "mirroring", + "reflecting", + "echoing", + "repeating", + "reproducing", + "recreating", + "regenerating", + "restoring", + "recovering", + "retrieving", + "reclaiming", + "regaining", + "reacquiring", + "retaking", + "recapturing", + "seizing", + "grabbing", + "catching", + "capturing", + "trapping", + "ensnaring", + "entangling", + "binding", + "tying", + "fastening", + "securing", + "anchoring", + "mooring", + "docking", + "parking", + "positioning", + "placing", + "putting", + "setting", + "laying", + "depositing", + "dropping", + "releasing", + "letting go", + "freeing", + "liberating", + "unleashing", + "unloosing", + "untying", + "unfastening", + "unlocking", + "opening", + "unsealing", + "uncovering", + "unveiling", + "revealing", + "exposing", + "displaying", + "showing", + "presenting", + "offering", + "providing", + "giving", + "granting", + "awarding", + "bestowing", + "conferring", + "endowing", + "enriching", + "enhancing", + "improving", + "upgrading", + "modernizing", + "updating", + "refreshing", + "renovating", + "refurbishing", + "restoring", + "repairing", + "fixing", + "mending", + "healing", + "curing", + "treating", + "addressing", + "handling", + "dealing with", + "managing", + "coping with", + "tackling", + "confronting", + "facing", + "meeting", + "encountering", + "experiencing", + "living through", + "going through", + "passing through", + "traversing", + "crossing", + "bridging", + "spanning", + "reaching across", + "extending", + "stretching", + "expanding", + "growing", + "increasing", + "multiplying", + "amplifying", + "magnifying", + "enlarging", + "widening", + "broadening", + "deepening", + "heightening", + "elevating", + "raising", + "boosting", + "promoting", + "advancing", + "forwarding", + "progressing", + "developing", + "evolving", + "transforming", + "changing", + "altering", + "modifying", + "adjusting", + "adapting", + "customizing", + "tailoring", + "personalizing", + "individualizing", + "specializing", + "focusing", + "concentrating", + "zeroing in", + "homing in", + "targeting", + "aiming", + "directing", + "pointing", + "orienting", + "aligning", + "adjusting", + "calibrating", + "fine-tuning", + "tweaking", + "polishing", + "refining", + "perfecting", + "optimizing", + "maximizing", + "minimizing", + "reducing", + "decreasing", + "lowering", + "cutting", + "trimming", + "pruning", + "clipping", + "cropping", + "shortening", + "abbreviating", + "condensing", + "compressing", + "compacting", + "consolidating", + "merging", + "combining", + "uniting", + "integrating", + "incorporating", + "including", + "adding", + "inserting", + "injecting", + "introducing", + "importing", + "bringing in", + "taking in", + "accepting", + "receiving", + "welcoming", + "embracing", + "adopting", + "assuming", + "undertaking", + "embarking on", + "beginning", + "starting", + "initiating", + "launching", + "kicking off", + "commencing", + "opening", + "inaugurating", + "establishing", + "founding", + "creating", + "forming", + "organizing", + "setting up", + "building", + "constructing", + "developing", + "designing", + "planning", + "preparing", + "arranging", + "coordinating", + "managing", + "overseeing", + "supervising", + "monitoring", + "tracking", + "following", + "observing", + "watching", + "viewing", + "seeing", + "looking at", + "examining", + "inspecting", + "checking", + "reviewing", + "analyzing", + "studying", + "researching", + "investigating", + "exploring", + "discovering", + "finding", + "locating", + "identifying", + "recognizing", + "detecting", + "spotting", + "noticing", + "perceiving", + "sensing", + "feeling", + "experiencing", + "encountering", + "meeting", + "coming across", + "running into", + "bumping into", + "stumbling upon", + "happening upon", + "chancing upon", + "discovering", + "uncovering", + "revealing", + "exposing", + "bringing to light", + "shedding light on", + "illuminating", + "clarifying", + "explaining", + "describing", + "outlining", + "detailing", + "elaborating", + "expanding on", + "developing", + "building on", + "adding to", + "contributing to", + "enhancing", + "improving", + "bettering", + "upgrading", + "advancing", + "progressing", + "moving forward", + "going ahead", + "proceeding", + "continuing", + "carrying on", + "persisting", + "persevering", + "enduring", + "lasting", + "surviving", + "thriving", + "flourishing", + "succeeding", + "achieving", + "accomplishing", + "attaining", + "reaching", + "arriving at", + "getting to", + "coming to", + "approaching", + "nearing", + "closing in on", + "homing in on", + "zeroing in on", + "focusing on", + "concentrating on", + "targeting", + "aiming for", + "striving for", + "working towards", + "heading for", + "moving towards", + "going for", + "pursuing", + "chasing", + "following", + "tracking", + "hunting", + "seeking", + "searching for", + "looking for", + "trying to find", + "attempting to locate", + "endeavoring to discover", + "working to uncover", + "laboring to reveal", + "struggling to expose", + "fighting to bring to light", + "battling to illuminate", + "competing to clarify", + "contending to explain", + "vying to describe", + "racing to outline", + "rushing to detail", + "hurrying to elaborate", + "speeding to expand", + "accelerating to develop", + "quickening to build", + "hastening to add", + "expediting to contribute", + "facilitating to enhance", + "enabling to improve", + "empowering to better", + "authorizing to upgrade", + "permitting to advance", + "allowing to progress", + "granting to move forward", + "giving permission to go ahead", + "providing authorization to proceed", + "supplying approval to continue", + "delivering consent to carry on", + "transferring agreement to persist", + "transmitting endorsement to persevere", + "sending support to endure", + "shipping backing to last", + "transporting assistance to survive", + "moving help to thrive", + "relocating aid to flourish", + "shifting support to succeed", + "migrating assistance to achieve", + "traveling help to accomplish", + "journeying aid to attain", + "navigating support to reach", + "routing assistance to arrive", + "directing help to get", + "guiding aid to come", + "leading support to approach", + "steering assistance to near", + "controlling help to close in", + "managing aid to home in", + "administering support to zero in", + "governing assistance to focus", + "ruling help to concentrate", + "regulating aid to target", + "monitoring support to aim", + "supervising assistance to strive", + "overseeing help to work", + "watching aid to head", + "observing support to move", + "tracking assistance to go", + "following help to pursue", + "pursuing aid to chase", + "chasing support to follow", + "hunting assistance to track", + "seeking help to hunt", + "searching aid to seek", + "looking support to search", + "finding assistance to look", + "discovering help to find", + "uncovering aid to discover", + "revealing support to uncover", + "exposing assistance to reveal", + "bringing help to expose", + "shedding aid to bring", + "illuminating support to shed", + "clarifying assistance to illuminate", + "explaining help to clarify", + "describing aid to explain", + "outlining support to describe", + "detailing assistance to outline", + "elaborating help to detail", + "expanding aid to elaborate", + "developing support to expand", + "building assistance to develop", + "adding help to build", + "contributing aid to add", + "enhancing support to contribute", + "improving assistance to enhance", + "bettering help to improve", + "upgrading aid to better", + "advancing support to upgrade", + "progressing assistance to advance", + "moving help to progress", + "going aid to move", + "proceeding support to go", + "continuing assistance to proceed", + "carrying help to continue", + "persisting aid to carry", + "persevering support to persist", + "enduring assistance to persevere", + "lasting help to endure", + "surviving aid to last", + "thriving support to survive", + "flourishing assistance to thrive", + "succeeding help to flourish", + "achieving aid to succeed", + "accomplishing support to achieve", + "attaining assistance to accomplish", + "reaching help to attain", + "arriving aid to reach", + "getting support to arrive", + "coming assistance to get", + "approaching help to come", + "nearing aid to approach", + "closing support to near", + "homing assistance to close", + "zeroing help to home", + "focusing aid to zero", + "concentrating support to focus", + "targeting assistance to concentrate", + "aiming help to target", + "striving aid to aim", + "working support to strive", + "heading assistance to work", + "moving help to head", + "going aid to move", + "pursuing support to go", + "chasing assistance to pursue", + "following help to chase", + "tracking aid to follow", + "hunting support to track", + "seeking assistance to hunt", + "searching help to seek", + "looking aid to search", + "trying support to look", + "attempting assistance to try", + "endeavoring help to attempt", + "working aid to endeavor", +];