Adjusted action list, removed open-directory for now

This commit is contained in:
2026-03-07 21:35:23 +01:00
parent 2bf658dc5f
commit b83ae686c4

View File

@@ -1,6 +1,7 @@
// Action registry — defines all available actions, their parameters, and policies. // Action registry — defines all available actions, their parameters, and policies.
// policy: "auto-accept" | "auto-deny" | "queue" // policy: "auto-accept" | "auto-deny" | "queue"
import { resolve_path, exec } from "./helpers.mjs"; import { resolve_path, exec } from "./helpers.mjs";
export const actions = { export const actions = {
@@ -24,21 +25,23 @@ export const actions = {
policy: "auto-accept", policy: "auto-accept",
handler: async ({ filename }) => { handler: async ({ filename }) => {
const resolved = resolve_path(filename); const resolved = resolve_path(filename);
await exec("xdg-open", [resolved]); await exec('subl3', [resolved]);
return { opened: resolved }; return { opened: resolved };
}, },
}, },
/*
"open-directory": { "open-directory": {
description: "Open a directory in the file manager", description: "Open a directory in the file manager",
params: [{ name: "path", required: true, type: "path" }], params: [{ name: "path", required: true, type: "path" }],
policy: "auto-accept", policy: 'queue',
handler: async ({ path }) => { handler: async ({ path }) => {
const resolved = resolve_path(path); const resolved = resolve_path(path);
await exec("xdg-open", [resolved]); // await exec( ... );
return { opened: resolved }; return { opened: resolved };
}, },
}, },
*/
"open-browser": { "open-browser": {
description: "Open a URL in the web browser", description: "Open a URL in the web browser",
@@ -53,10 +56,10 @@ export const actions = {
"open-terminal": { "open-terminal": {
description: "Open a terminal in a given directory", description: "Open a terminal in a given directory",
params: [{ name: "path", required: false, type: "path" }], params: [{ name: "path", required: false, type: "path" }],
policy: "queue", policy: 'queue',
handler: async ({ path }) => { handler: async ({ path }) => {
const resolved = path ? resolve_path(path) : process.env.HOME; const resolved = resolve_path(path ?? 'workspace');
await exec("xdg-open", [resolved]); await exec('konsole', ['--workdir', resolved, '-e', 'bash']);
return { opened: resolved }; return { opened: resolved };
}, },
}, },