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