mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-15 21:11:08 +02:00
ensure agent-slack is available at startup
This commit is contained in:
parent
79be8fbf42
commit
1dd622449e
2 changed files with 19 additions and 1 deletions
|
|
@ -24,9 +24,12 @@ import { init as initAgentRunner } from "@x/core/dist/agent-schedule/runner.js";
|
||||||
import { init as initAgentNotes } from "@x/core/dist/knowledge/agent_notes.js";
|
import { init as initAgentNotes } from "@x/core/dist/knowledge/agent_notes.js";
|
||||||
import { initConfigs } from "@x/core/dist/config/initConfigs.js";
|
import { initConfigs } from "@x/core/dist/config/initConfigs.js";
|
||||||
import started from "electron-squirrel-startup";
|
import started from "electron-squirrel-startup";
|
||||||
import { execSync } from "node:child_process";
|
import { execSync, exec } from "node:child_process";
|
||||||
|
import { promisify } from "node:util";
|
||||||
import { init as initChromeSync } from "@x/core/dist/knowledge/chrome-extension/server/server.js";
|
import { init as initChromeSync } from "@x/core/dist/knowledge/chrome-extension/server/server.js";
|
||||||
|
|
||||||
|
const execAsync = promisify(exec);
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
|
|
@ -185,6 +188,19 @@ app.whenReady().then(async () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure agent-slack CLI is available
|
||||||
|
try {
|
||||||
|
execSync('agent-slack --version', { stdio: 'ignore', timeout: 5000 });
|
||||||
|
} catch {
|
||||||
|
try {
|
||||||
|
console.log('agent-slack not found, installing...');
|
||||||
|
await execAsync('npm install -g agent-slack', { timeout: 60000 });
|
||||||
|
console.log('agent-slack installed successfully');
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed to install agent-slack:', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize all config files before UI can access them
|
// Initialize all config files before UI can access them
|
||||||
await initConfigs();
|
await initConfigs();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { WorkDir } from "./config.js";
|
||||||
export const SECURITY_CONFIG_PATH = path.join(WorkDir, "config", "security.json");
|
export const SECURITY_CONFIG_PATH = path.join(WorkDir, "config", "security.json");
|
||||||
|
|
||||||
const DEFAULT_ALLOW_LIST = [
|
const DEFAULT_ALLOW_LIST = [
|
||||||
|
"agent-slack",
|
||||||
"awk",
|
"awk",
|
||||||
"basename",
|
"basename",
|
||||||
"cat",
|
"cat",
|
||||||
|
|
@ -25,6 +26,7 @@ const DEFAULT_ALLOW_LIST = [
|
||||||
"jq",
|
"jq",
|
||||||
"ls",
|
"ls",
|
||||||
"printenv",
|
"printenv",
|
||||||
|
"printf",
|
||||||
"pwd",
|
"pwd",
|
||||||
"readlink",
|
"readlink",
|
||||||
"realpath",
|
"realpath",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue