aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant/Files.js
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/assistant/Files.js')
-rw-r--r--desktop/assistant/Files.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/desktop/assistant/Files.js b/desktop/assistant/Files.js
index bcfe1f0..825aed1 100644
--- a/desktop/assistant/Files.js
+++ b/desktop/assistant/Files.js
@@ -17,17 +17,20 @@
// ponytail: the daemon also takes any text/* mime type; a file of such a
// type with a suffix not listed here reads as "other" and is not offered
// chat. Add the suffix when one shows up.
-const TEXT = [".py", ".c", ".h", ".cpp", ".hpp", ".rs", ".go", ".js", ".ts", ".jsx",
+// Text splits into prose and data (text) and code or configuration (code),
+// so each gets the presets that fit it; the daemon sees one text kind.
+const TEXT = [".md", ".rst", ".txt", ".csv"];
+const CODE = [".py", ".c", ".h", ".cpp", ".hpp", ".rs", ".go", ".js", ".ts", ".jsx",
".tsx", ".sh", ".bash", ".zsh", ".lua", ".rb", ".pl", ".php", ".java",
".kt", ".swift", ".sql", ".toml", ".yaml", ".yml", ".json", ".ini",
- ".cfg", ".conf", ".md", ".rst", ".txt", ".csv", ".xml", ".html", ".css",
+ ".cfg", ".conf", ".xml", ".html", ".css",
".diff", ".patch", ".slackbuild", ".info", ".desktop", ".service", ".qml"];
const IMAGE = [".png", ".jpg", ".jpeg", ".gif", ".webp"];
const VIDEO = [".mp4", ".mkv", ".webm", ".mov", ".avi", ".m4v"];
const ARCHIVE = [".zip", ".tar", ".gz", ".tgz", ".xz", ".txz", ".bz2", ".zst", ".7z", ".rar"];
// Kinds chat takes; the rest only get local actions.
-const CHAT = ["text", "image", "pdf"];
+const CHAT = ["text", "code", "image", "pdf"];
function name(path) { return path.slice(path.lastIndexOf("/") + 1); }
@@ -40,6 +43,7 @@ function kind(path) {
if (VIDEO.includes(ext)) return "video";
if (ARCHIVE.includes(ext)) return "archive";
if (TEXT.includes(ext)) return "text";
+ if (CODE.includes(ext)) return "code";
return "other";
}