Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
Fix cross-platform npm install for CI testing
trohitgddf21bd8ce85
diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.ymlindex 1c5d4891..099cda18 100644--- a/.github/workflows/test-install.yml+++ b/.github/workflows/test-install.yml@@ -29,27 +29,17 @@ jobs:with:node-version: ${{ matrix.node-version }}- - name: Setup Python 3.12- uses: actions/setup-python@v5- with:- python-version: '3.12'-- - name: Install uv- uses: astral-sh/setup-uv@v5+ # Python and uv are NOT pre-installed - install.js handles them+ # This tests the real user experience of `npm install -g machinaos`- name: Pack npm packagerun: npm pack- name: Test global installshell: bash- env:- CI: ''- GITHUB_ACTIONS: ''run: |- # Unset CI vars so postinstall runs fully- unset CI GITHUB_ACTIONS-# Install the packed tarball globally+ # This tests the full installation flow including Python/uv detection and installationnpm install -g machinaos-*.tgz# Verify CLI is available@@ -92,3 +82,24 @@ jobs:elseecho "Warning: client/dist not found"fi++ - name: Test machinaos start+ shell: bash+ timeout-minutes: 2+ run: |+ # Start machinaos in background and verify it starts successfully+ machinaos start &+ PID=$!++ # Wait a few seconds for startup+ sleep 10++ # Check if process is still running (it should be)+ if kill -0 $PID 2>/dev/null; then+ echo "machinaos start: OK - process running"+ # Clean shutdown+ kill $PID 2>/dev/null || true+ else+ echo "machinaos start: FAILED - process exited"+ exit 1+ fidiff --git a/client/src/components/ToolkitNode.tsx b/client/src/components/ToolkitNode.tsxindex 42c02cb0..30e76aaa 100644--- a/client/src/components/ToolkitNode.tsx+++ b/client/src/components/ToolkitNode.tsx@@ -1,10 +1,13 @@/**- * ToolkitNode - A node component with top/bottom connectors for aggregating services.- * Used by Android Toolkit to receive Android service nodes from bottom and output to AI Agent from top.+ * ToolkitNode - A node component for skill nodes and toolkit nodes with vertical handle layout.*- * Based on SquareNode but with vertical handle layout:- * - Input handle at BOTTOM (receives from Android service nodes)- * - Output handle at TOP (connects to AI Agent's input-tools)+ * Skill nodes (whatsappSkill, memorySkill, etc.): Square (60x60px)+ * - Output handle at TOP (connects to agent's skill input)+ * - No input handle (passive nodes)+ *+ * Toolkit nodes (androidTool): Rectangular (100x60px)+ * - Output handle at TOP (connects to AI Agent's tool input)+ * - Input handle at BOTTOM (receives Android service nodes)*/import React, { useState, useEffect, useRef, useCallback } from 'react';@@ -14,7 +17,9 @@ import { useAppStore } from '../store/useAppStore';import { nodeDefinitions } from '../nodeDefinitions';import { useAppTheme } from '../hooks/useAppTheme';import { useWebSocket } from '../contexts/WebSocketContext';-import { SKILL_NODE_TYPES } from '../nodeDefinitions/skillNodes';++// Toolkit node types that render rectangular (wider than tall)+const TOOLKIT_NODE_TYPES = ['androidTool'];const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectable, selected }) => {const theme = useAppTheme();@@ -32,8 +37,8 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaconst definition = nodeDefinitions[type as keyof typeof nodeDefinitions];- // Check if this is a skill node (skill nodes don't have bottom input handle)- const isSkillNode = type ? SKILL_NODE_TYPES.includes(type) : false;+ // Check if this is a toolkit node (rectangular) vs skill node (square)+ const isToolkitNode = type ? TOOLKIT_NODE_TYPES.includes(type) : false;// Execution stateconst isExecuting = executionStatus === 'executing' || executionStatus === 'waiting';@@ -150,12 +155,12 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectacursor: 'pointer',}}>- {/* Main Square Node */}+ {/* Main Node - rectangular for toolkit, square for skills */}<divstyle={{position: 'relative',- width: theme.nodeSize.square,- height: theme.nodeSize.square,+ width: isToolkitNode ? theme.nodeSize.toolkitWidth : theme.nodeSize.square,+ height: isToolkitNode ? theme.nodeSize.toolkitHeight : theme.nodeSize.square,borderRadius: theme.borderRadius.lg,background: theme.isDarkMode? `linear-gradient(135deg, ${nodeColor}25 0%, ${theme.colors.background} 100%)`@@ -241,7 +246,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectatitle={isExecuting ? 'Executing...' : 'Toolkit ready'}/>- {/* TOP Output Handle - connects to AI Agent/Zeenie */}+ {/* TOP Output Handle - connects to AI Agent's tool/skill input */}<Handleid="output-main"type="source"@@ -259,13 +264,13 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaborderRadius: '50%',zIndex: 20}}- title={isSkillNode ? "Connect to Zeenie's skill input" : "Connect to AI Agent's tool input"}+ title={isToolkitNode ? "Connect to AI Agent's tool input" : "Connect to agent's skill input"}/>- {/* BOTTOM Input Handle - receives from Android nodes (not shown for skill nodes) */}- {!isSkillNode && (+ {/* BOTTOM Input Handle - only for toolkit nodes (receives Android service nodes) */}+ {isToolkitNode && (<Handle- id="input-main"+ id="input-services"type="target"position={Position.Bottom}isConnectable={isConnectable}@@ -281,7 +286,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaborderRadius: '50%',zIndex: 20}}- title="Connect Android service nodes here"+ title="Connect Android service nodes"/>)}diff --git a/client/src/styles/theme.ts b/client/src/styles/theme.tsindex 4c2d73ed..3fdbdaed 100644--- a/client/src/styles/theme.ts+++ b/client/src/styles/theme.ts@@ -239,6 +239,8 @@ export const theme = {nodeSize: {square: '60px', // SquareNode, BaseChatModelNode, ModelNodesquareIcon: '28px', // Icon inside square node+ toolkitWidth: '120px', // ToolkitNode width (rectangular, wider)+ toolkitHeight: '50px', // ToolkitNode height (shorter)handle: '8px', // Connection handlesstatusIndicator: '10px', // Status dotparamButton: '16px', // Parameters gear buttondiff --git a/scripts/install.js b/scripts/install.jsindex fff0cb79..b776c694 100644--- a/scripts/install.js+++ b/scripts/install.js@@ -18,8 +18,8 @@ const isMac = process.platform === 'darwin';process.env.PYTHONUTF8 = '1';-function run(cmd, cwd = ROOT) {- execSync(cmd, { cwd, stdio: 'inherit', shell: true });+function run(cmd, cwd = ROOT, timeoutMs = 300000) {+ execSync(cmd, { cwd, stdio: 'inherit', shell: true, timeout: timeoutMs });}function runSilent(cmd) {@@ -67,10 +67,12 @@ function checkGo() {function installPython() {console.log('Installing Python 3.11+...');if (isWindows) {- if (runSilent('winget --version')) {- run('winget install Python.Python.3.12 --accept-package-agreements --accept-source-agreements');- } else if (runSilent('choco --version')) {+ // choco is pre-installed on GitHub Actions Windows runners+ // winget is only on windows-2025, not windows-2022 (windows-latest)+ if (runSilent('choco --version')) {run('choco install python312 -y');+ } else if (runSilent('winget --version')) {+ run('winget install Python.Python.3.12 --accept-package-agreements --accept-source-agreements --disable-interactivity');} else {console.log('ERROR: Cannot auto-install Python. Please install manually:');console.log(' https://python.org/downloads/');@@ -102,12 +104,16 @@ function installPython() {}}-function installUv() {+function installUv(pythonCmd) {console.log('Installing uv...');if (isWindows) {- run('powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"');- process.env.PATH = `${process.env.USERPROFILE}\\.local\\bin;${process.env.PATH}`;+ // Use pip on Windows (no PEP 668 issues)+ run(`${pythonCmd} -m pip install uv`);+ } else if (isMac) {+ // Use pip on macOS (no PEP 668 issues with Homebrew Python)+ run(`${pythonCmd} -m pip install uv`);} else {+ // Linux: use official installer (avoids PEP 668 externally-managed-environment)run('curl -LsSf https://astral.sh/uv/install.sh | sh');process.env.PATH = `${process.env.HOME}/.local/bin:${process.env.PATH}`;}@@ -143,7 +149,7 @@ let uvVersion = checkUv();if (uvVersion) {console.log(` uv: ${uvVersion}`);} else {- installUv();+ installUv(python.cmd);uvVersion = checkUv();if (uvVersion) {console.log(` uv: ${uvVersion}`);@@ -178,22 +184,22 @@ try {// Install client dependenciesconsole.log('[2/5] Installing client dependencies...');- run('npm install', resolve(ROOT, 'client'));+ run('npm install', resolve(ROOT, 'client'), 600000); // 10 min timeout// Build clientconsole.log('[3/5] Building client...');- run('npm run build', resolve(ROOT, 'client'));+ run('npm run build', resolve(ROOT, 'client'), 600000); // 10 min timeout// Install Python dependenciesconsole.log('[4/5] Installing Python dependencies...');const serverDir = resolve(ROOT, 'server');- run('uv venv', serverDir);- run('uv sync', serverDir);+ run('uv venv', serverDir); // 5 min default+ run('uv sync', serverDir, 600000); // 10 min timeout// WhatsApp serviceconsole.log('[5/5] Setting up WhatsApp service...');const whatsappDir = resolve(ROOT, 'server/whatsapp-rpc');- run('npm install', whatsappDir);+ run('npm install', whatsappDir); // 5 min defaultconst binPath = resolve(whatsappDir, 'bin', isWindows ? 'whatsapp-rpc-server.exe' : 'whatsapp-rpc-server');if (!existsSync(binPath) && go) {