machinaos 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -6
- package/bin/cli.js +0 -0
- package/client/dist/assets/index-5BWZnM6b.js +703 -0
- package/client/dist/index.html +1 -1
- package/client/package.json +1 -1
- package/client/src/Dashboard.tsx +12 -5
- package/client/src/ParameterPanel.tsx +6 -5
- package/client/src/components/AIAgentNode.tsx +35 -16
- package/client/src/components/CredentialsModal.tsx +450 -5
- package/client/src/components/TeamMonitorNode.tsx +269 -0
- package/client/src/components/parameterPanel/InputSection.tsx +25 -0
- package/client/src/contexts/WebSocketContext.tsx +38 -0
- package/client/src/hooks/useApiKeys.ts +44 -0
- package/client/src/nodeDefinitions/specializedAgentNodes.ts +59 -3
- package/client/src/nodeDefinitions/twitterNodes.ts +441 -0
- package/client/src/nodeDefinitions/utilityNodes.ts +45 -1
- package/client/src/nodeDefinitions.ts +7 -1
- package/client/src/services/executionService.ts +4 -1
- package/install.sh +63 -1
- package/package.json +5 -2
- package/scripts/build.js +0 -0
- package/scripts/clean.js +0 -0
- package/scripts/daemon.js +0 -0
- package/scripts/docker.js +0 -0
- package/scripts/install.js +0 -0
- package/scripts/postinstall.js +29 -0
- package/scripts/preinstall.js +67 -0
- package/scripts/serve-client.js +0 -0
- package/scripts/start.js +0 -0
- package/scripts/stop.js +0 -0
- package/scripts/sync-version.js +0 -0
- package/server/Dockerfile +10 -15
- package/server/constants.py +20 -0
- package/server/core/database.py +443 -3
- package/server/main.py +9 -1
- package/server/models/database.py +112 -2
- package/server/pyproject.toml +3 -0
- package/server/requirements.txt +3 -0
- package/server/routers/twitter.py +390 -0
- package/server/routers/websocket.py +320 -0
- package/server/services/agent_team.py +266 -0
- package/server/services/ai.py +43 -0
- package/server/services/compaction.py +39 -4
- package/server/services/event_waiter.py +41 -0
- package/server/services/handlers/__init__.py +13 -0
- package/server/services/handlers/ai.py +66 -2
- package/server/services/handlers/tools.py +84 -0
- package/server/services/handlers/twitter.py +297 -0
- package/server/services/handlers/utility.py +91 -0
- package/server/services/node_executor.py +15 -1
- package/server/services/pricing.py +270 -0
- package/server/services/status_broadcaster.py +79 -0
- package/server/services/twitter_oauth.py +410 -0
- package/server/skills/social_agent/twitter-search-skill/SKILL.md +146 -0
- package/server/skills/social_agent/twitter-send-skill/SKILL.md +142 -0
- package/server/skills/social_agent/twitter-user-skill/SKILL.md +165 -0
- package/workflows/Zeenie_full.json +459 -0
- package/workflows/Zeenie_small.json +459 -0
- package/client/dist/assets/index-YVvAiByx.js +0 -703
- package/server/requirements-docker.txt +0 -86
package/scripts/postinstall.js
CHANGED
|
@@ -8,10 +8,36 @@
|
|
|
8
8
|
import { spawn } from 'child_process';
|
|
9
9
|
import { resolve, dirname } from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
|
+
import { existsSync, chmodSync } from 'fs';
|
|
11
12
|
|
|
12
13
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
14
|
const ROOT = resolve(__dirname, '..');
|
|
14
15
|
|
|
16
|
+
// Fix executable permissions on Unix (npm doesn't preserve them from git)
|
|
17
|
+
function fixPermissions() {
|
|
18
|
+
if (process.platform === 'win32') return;
|
|
19
|
+
|
|
20
|
+
const files = [
|
|
21
|
+
resolve(ROOT, 'bin/cli.js'),
|
|
22
|
+
resolve(ROOT, 'scripts/start.js'),
|
|
23
|
+
resolve(ROOT, 'scripts/stop.js'),
|
|
24
|
+
resolve(ROOT, 'scripts/build.js'),
|
|
25
|
+
resolve(ROOT, 'scripts/clean.js'),
|
|
26
|
+
resolve(ROOT, 'scripts/install.js'),
|
|
27
|
+
resolve(ROOT, 'install.sh'),
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
if (existsSync(file)) {
|
|
32
|
+
try {
|
|
33
|
+
chmodSync(file, 0o755);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// Ignore permission errors
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
15
41
|
const isCI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
|
|
16
42
|
|
|
17
43
|
if (isCI) {
|
|
@@ -46,6 +72,9 @@ function runScript(scriptPath) {
|
|
|
46
72
|
|
|
47
73
|
async function main() {
|
|
48
74
|
try {
|
|
75
|
+
// Fix executable permissions on Unix
|
|
76
|
+
fixPermissions();
|
|
77
|
+
|
|
49
78
|
// Run full installation
|
|
50
79
|
console.log('Installing dependencies...');
|
|
51
80
|
await runScript(resolve(__dirname, 'install.js'));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Preinstall cleanup script for MachinaOS.
|
|
4
|
+
*
|
|
5
|
+
* Fixes npm ENOTEMPTY error by cleaning up leftover temp directories
|
|
6
|
+
* that npm fails to remove during failed install/uninstall operations.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/anthropics/claude-code/issues/7373
|
|
9
|
+
* @see https://bobbyhadz.com/blog/npm-err-code-enotempty
|
|
10
|
+
*/
|
|
11
|
+
import { readdirSync, rmSync, statSync } from 'fs';
|
|
12
|
+
import { resolve, dirname } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
import { execSync } from 'child_process';
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
|
|
18
|
+
// Skip in CI
|
|
19
|
+
if (process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true') {
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getGlobalNodeModules() {
|
|
24
|
+
try {
|
|
25
|
+
const prefix = execSync('npm config get prefix', {
|
|
26
|
+
encoding: 'utf-8',
|
|
27
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
28
|
+
}).trim();
|
|
29
|
+
|
|
30
|
+
if (prefix) {
|
|
31
|
+
return process.platform === 'win32'
|
|
32
|
+
? resolve(prefix, 'node_modules')
|
|
33
|
+
: resolve(prefix, 'lib', 'node_modules');
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
// Ignore
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function cleanup() {
|
|
42
|
+
const nodeModules = getGlobalNodeModules();
|
|
43
|
+
if (!nodeModules) return;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const entries = readdirSync(nodeModules);
|
|
47
|
+
|
|
48
|
+
// Clean .machinaos-* temp directories
|
|
49
|
+
for (const name of entries) {
|
|
50
|
+
if (name.startsWith('.machinaos-')) {
|
|
51
|
+
const fullPath = resolve(nodeModules, name);
|
|
52
|
+
try {
|
|
53
|
+
if (statSync(fullPath).isDirectory()) {
|
|
54
|
+
rmSync(fullPath, { recursive: true, force: true });
|
|
55
|
+
console.log(`Cleaned: ${name}`);
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
// Can't read node_modules - that's fine
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
cleanup();
|
package/scripts/serve-client.js
CHANGED
|
File without changes
|
package/scripts/start.js
CHANGED
|
File without changes
|
package/scripts/stop.js
CHANGED
|
File without changes
|
package/scripts/sync-version.js
CHANGED
|
File without changes
|
package/server/Dockerfile
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
# Python FastAPI Backend
|
|
1
|
+
# Python FastAPI Backend
|
|
2
2
|
FROM python:3.12-slim
|
|
3
3
|
|
|
4
4
|
WORKDIR /app
|
|
5
5
|
|
|
6
|
-
# Install system dependencies
|
|
6
|
+
# Install system dependencies and uv
|
|
7
7
|
RUN apt-get update && apt-get install -y \
|
|
8
8
|
curl \
|
|
9
9
|
gcc \
|
|
10
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
11
|
+
&& pip install uv
|
|
11
12
|
|
|
12
|
-
# Copy
|
|
13
|
-
|
|
14
|
-
COPY requirements-docker.txt .
|
|
13
|
+
# Copy dependency files first for better caching
|
|
14
|
+
COPY pyproject.toml .
|
|
15
15
|
|
|
16
|
-
# Install Python dependencies
|
|
17
|
-
|
|
18
|
-
RUN pip install --no-cache-dir -r requirements-docker.txt
|
|
16
|
+
# Install Python dependencies using uv
|
|
17
|
+
RUN uv pip install --system -e .
|
|
19
18
|
|
|
20
19
|
# Copy application code
|
|
21
20
|
COPY . .
|
|
@@ -24,19 +23,15 @@ COPY . .
|
|
|
24
23
|
RUN mkdir -p /app/data
|
|
25
24
|
|
|
26
25
|
# Compile Python files to optimized bytecode for faster imports
|
|
27
|
-
# Keep .py files since Python imports require them or __pycache__/*.pyc
|
|
28
|
-
# -O: optimize (remove assert statements)
|
|
29
|
-
# -q: quiet mode
|
|
30
|
-
# -f: force rebuild
|
|
31
26
|
RUN python -O -m compileall -q -f .
|
|
32
27
|
|
|
33
28
|
# Default port (overridden by environment)
|
|
34
29
|
ENV PORT=3010
|
|
35
30
|
|
|
36
|
-
# Expose default port
|
|
31
|
+
# Expose default port
|
|
37
32
|
EXPOSE 3010
|
|
38
33
|
|
|
39
|
-
# Health check
|
|
34
|
+
# Health check
|
|
40
35
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
|
41
36
|
CMD sh -c "curl -f http://localhost:\${PORT}/health || exit 1"
|
|
42
37
|
|
package/server/constants.py
CHANGED
|
@@ -34,6 +34,7 @@ AI_AGENT_TYPES: FrozenSet[str] = frozenset([
|
|
|
34
34
|
'consumer_agent',
|
|
35
35
|
'autonomous_agent',
|
|
36
36
|
'orchestrator_agent',
|
|
37
|
+
'ai_employee',
|
|
37
38
|
])
|
|
38
39
|
|
|
39
40
|
AI_MEMORY_TYPES: FrozenSet[str] = frozenset([
|
|
@@ -148,6 +149,24 @@ WHATSAPP_TYPES: FrozenSet[str] = frozenset([
|
|
|
148
149
|
'whatsappDb',
|
|
149
150
|
])
|
|
150
151
|
|
|
152
|
+
# =============================================================================
|
|
153
|
+
# TWITTER NODE TYPES
|
|
154
|
+
# =============================================================================
|
|
155
|
+
|
|
156
|
+
TWITTER_TYPES: FrozenSet[str] = frozenset([
|
|
157
|
+
'twitterSend',
|
|
158
|
+
'twitterReceive',
|
|
159
|
+
'twitterSearch',
|
|
160
|
+
'twitterUser',
|
|
161
|
+
])
|
|
162
|
+
|
|
163
|
+
# Dual-purpose Twitter nodes (workflow node + AI tool)
|
|
164
|
+
TWITTER_TOOL_TYPES: FrozenSet[str] = frozenset([
|
|
165
|
+
'twitterSend',
|
|
166
|
+
'twitterSearch',
|
|
167
|
+
'twitterUser',
|
|
168
|
+
])
|
|
169
|
+
|
|
151
170
|
# =============================================================================
|
|
152
171
|
# SOCIAL NODE TYPES (unified messaging)
|
|
153
172
|
# =============================================================================
|
|
@@ -207,6 +226,7 @@ WORKFLOW_CONTROL_TYPES: FrozenSet[str] = frozenset([
|
|
|
207
226
|
EVENT_TRIGGER_TYPES: FrozenSet[str] = frozenset([
|
|
208
227
|
'webhookTrigger',
|
|
209
228
|
'whatsappReceive',
|
|
229
|
+
'twitterReceive',
|
|
210
230
|
'workflowTrigger',
|
|
211
231
|
'chatTrigger',
|
|
212
232
|
'taskTrigger',
|