aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/assistant')
-rw-r--r--desktop/assistant/Assistant.qml15
-rw-r--r--desktop/assistant/Files.js5
-rw-r--r--desktop/assistant/test_files.js4
3 files changed, 7 insertions, 17 deletions
diff --git a/desktop/assistant/Assistant.qml b/desktop/assistant/Assistant.qml
index d6863a0..7d299eb 100644
--- a/desktop/assistant/Assistant.qml
+++ b/desktop/assistant/Assistant.qml
@@ -49,7 +49,7 @@ Scope {
property int opChars: 0
property var opOut: []
property string opError: ""
- // Results folder: $(xdg-user-dir DOCUMENTS)/Assistant, read once.
+ // Results folder: the daemon's out_dir, from hello; this until then.
property string outDir: (Quickshell.env("HOME") || "") + "/Documents/Assistant"
readonly property string fileops:
decodeURIComponent(Qt.resolvedUrl("fileops").toString().replace(/^file:\/\//, ""))
@@ -281,18 +281,6 @@ Scope {
}
}
- Process {
- running: true
- command: ["xdg-user-dir", "DOCUMENTS"]
- stdout: StdioCollector {
- // With no documents folder set, xdg-user-dir answers $HOME itself.
- onStreamFinished: {
- const d = text.trim();
- if (d.startsWith("/") && d !== Quickshell.env("HOME")) root.outDir = d + "/Assistant";
- }
- }
- }
-
// deck-it's Assistant tab look, from its config's [assistant] keys: the
// backdrop picture, the user's avatar, and where the assistant's face is
// in the backdrop ([centre x, centre y, size] in its pixels). Empty: no
@@ -442,6 +430,7 @@ print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""),
root.runningTool = e.state === "tool" ? e.tool : "";
root.model = e.model ?? "";
root.chatModel = e.chat_model ?? "";
+ if (e.out_dir) root.outDir = e.out_dir;
root.ctxUsed = e.ctx_used;
root.ctxMax = e.ctx_max;
root.load(e.id, e.turns, e.pending);
diff --git a/desktop/assistant/Files.js b/desktop/assistant/Files.js
index bcbd9bc..bea1841 100644
--- a/desktop/assistant/Files.js
+++ b/desktop/assistant/Files.js
@@ -28,8 +28,9 @@ 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", "code", "image", "pdf"];
+// Kinds chat takes; the rest only get local actions. A video goes as its
+// path only, for the video tool.
+const CHAT = ["text", "code", "image", "pdf", "video"];
function name(path) { return path.slice(path.lastIndexOf("/") + 1); }
diff --git a/desktop/assistant/test_files.js b/desktop/assistant/test_files.js
index f2a65ca..f6ed058 100644
--- a/desktop/assistant/test_files.js
+++ b/desktop/assistant/test_files.js
@@ -29,8 +29,8 @@ const cases = {
};
for (const [p, k] of Object.entries(cases)) assert.strictEqual(F.kind(p), k, p);
-assert.ok(F.chats("pdf") && F.chats("image") && F.chats("text") && F.chats("code"));
-assert.ok(!F.chats("video") && !F.chats("archive") && !F.chats("other"));
+assert.ok(F.chats("pdf") && F.chats("image") && F.chats("text") && F.chats("code") && F.chats("video"));
+assert.ok(!F.chats("archive") && !F.chats("other"));
assert.strictEqual(F.fromUrl("file:///home/you/My%20Docs/caf%C3%A9.pdf"), "/home/you/My Docs/café.pdf");
assert.strictEqual(F.fromUrl("file:///tmp/a.txt"), "/tmp/a.txt");