machinaos 0.0.81 → 0.0.83
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/client/package.json +1 -1
- package/package.json +2 -1
- package/pyproject.toml +57 -0
- package/scripts/install.js +33 -9
package/client/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "machinaos",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"description": "Open source workflow automation platform with AI agents, React Flow, and n8n-inspired architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"!**/node_modules/",
|
|
54
54
|
"!**/.vite/",
|
|
55
55
|
".env.template",
|
|
56
|
+
"pyproject.toml",
|
|
56
57
|
"README.md",
|
|
57
58
|
"install.sh",
|
|
58
59
|
"install.ps1"
|
package/pyproject.toml
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "machinaos-cli"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MachinaOS project supervisor CLI (machina)."
|
|
5
|
+
requires-python = ">=3.12"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"typer>=0.12",
|
|
8
|
+
"rich>=13",
|
|
9
|
+
"anyio>=4",
|
|
10
|
+
"psutil>=6",
|
|
11
|
+
# OS-native user data / cache / config / log dirs. Soft dependency
|
|
12
|
+
# in the CLI (``cli/platform_.py`` imports it inside a try/except
|
|
13
|
+
# and falls back to a stdlib implementation if the wheel isn't
|
|
14
|
+
# available) so ``machina clean`` / ``machina build`` still work
|
|
15
|
+
# immediately after a wipe, before ``pip install`` has had a
|
|
16
|
+
# chance to materialise it.
|
|
17
|
+
"platformdirs>=4.0",
|
|
18
|
+
# Required on Windows for the supervisor's Job Object (cli/tree.py).
|
|
19
|
+
# Without it, child processes survive abnormal supervisor exit
|
|
20
|
+
# (SIGKILL, BSOD, console close) and accumulate as orphans across
|
|
21
|
+
# dev restarts. Floor 308 is the first release shipping prebuilt
|
|
22
|
+
# wheels for Python 3.13.
|
|
23
|
+
"pywin32>=308; platform_system == 'Windows'",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
machina = "cli.cli:app"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["hatchling"]
|
|
31
|
+
build-backend = "hatchling.build"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["cli"]
|
|
35
|
+
|
|
36
|
+
# The CLI runs under the user's global / pipx-managed Python — it is
|
|
37
|
+
# NOT a uv-managed project. ``managed = false`` tells ``uv`` to leave
|
|
38
|
+
# this project alone: ``uv sync`` at the repo root is a no-op, no
|
|
39
|
+
# ``<repo>/.venv/`` is created, ``python`` on PATH resolves to the
|
|
40
|
+
# user's global interpreter instead of being shadowed by a workspace
|
|
41
|
+
# venv. The server is the only uv-managed project (``server/.venv``).
|
|
42
|
+
[tool.uv]
|
|
43
|
+
managed = false
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = []
|
|
47
|
+
|
|
48
|
+
# ``machinaos-cli`` is a standalone Python CLI package -- installable
|
|
49
|
+
# via ``pipx install .`` / ``pip install .`` against any Python >=3.12
|
|
50
|
+
# without involving uv. It depends on nothing from ``server/``. The
|
|
51
|
+
# server has its own uv-managed venv at ``server/.venv``; the CLI
|
|
52
|
+
# invokes server-side commands by shelling out via ``cli.run.uv_run``
|
|
53
|
+
# (which runs ``uv run --no-sync ...`` with ``cwd=server/`` so uv
|
|
54
|
+
# discovers ``server/pyproject.toml`` and activates ``server/.venv``).
|
|
55
|
+
# Keeping the CLI independent of the uv workspace means contributors
|
|
56
|
+
# can install / run / debug ``machina`` on whatever interpreter is on
|
|
57
|
+
# PATH -- no per-checkout venv activation required.
|
package/scripts/install.js
CHANGED
|
@@ -23,12 +23,20 @@ const ROOT = resolve(__dirname, '..');
|
|
|
23
23
|
process.env.PYTHONUTF8 = '1';
|
|
24
24
|
|
|
25
25
|
function run(cmd, cwd = ROOT, timeoutMs = 300000) {
|
|
26
|
+
// Strip VIRTUAL_ENV from the spawned env. When the user runs
|
|
27
|
+
// ``npm install -g machinaos`` from a shell that has activated a
|
|
28
|
+
// venv (very common during dev), uv emits a noisy ``VIRTUAL_ENV
|
|
29
|
+
// ... does not match the project environment path`` warning per
|
|
30
|
+
// invocation. uv only honours VIRTUAL_ENV with ``--active``, which
|
|
31
|
+
// we never pass, so dropping it at the source is the documented
|
|
32
|
+
// workaround. Same fix applied to cli/supervisor.py's _full_env.
|
|
33
|
+
const { VIRTUAL_ENV, ...cleanEnv } = process.env;
|
|
26
34
|
execSync(cmd, {
|
|
27
35
|
cwd,
|
|
28
36
|
stdio: 'inherit',
|
|
29
37
|
shell: true,
|
|
30
38
|
timeout: timeoutMs,
|
|
31
|
-
env: { ...
|
|
39
|
+
env: { ...cleanEnv, MACHINAOS_INSTALLING: 'true' }
|
|
32
40
|
});
|
|
33
41
|
}
|
|
34
42
|
|
|
@@ -118,16 +126,20 @@ if (uvVersion) {
|
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
|
|
121
|
-
// Temporal binary: downloaded
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
129
|
+
// Temporal binary: downloaded eagerly during install (step [6/6])
|
|
130
|
+
// by ``python -m services.temporal._install``, same call ``machina
|
|
131
|
+
// build`` already makes. The pooch cache (~/.cache/MachinaOs/...)
|
|
132
|
+
// makes re-runs sub-second. Done eagerly because
|
|
133
|
+
// ``TemporalServerRuntime._pre_spawn`` unconditionally calls
|
|
134
|
+
// ``ensure_temporal_binaries`` -- the runtime always uses the
|
|
135
|
+
// pooch-downloaded binary regardless of any system ``temporal`` on
|
|
136
|
+
// PATH -- so pre-fetching here eliminates a 30-90 s stall on the
|
|
137
|
+
// user's first ``machina start``.
|
|
126
138
|
let temporalVersion = getVersion('temporal --version');
|
|
127
139
|
console.log(
|
|
128
140
|
temporalVersion
|
|
129
|
-
? ` temporal: ${temporalVersion} (system install,
|
|
130
|
-
: ' temporal:
|
|
141
|
+
? ` temporal: ${temporalVersion} (system install, pooch copy installed below)`
|
|
142
|
+
: ' temporal: not on PATH, pooch copy installed below',
|
|
131
143
|
);
|
|
132
144
|
|
|
133
145
|
// agent-browser is managed by the Python backend
|
|
@@ -148,7 +160,7 @@ try {
|
|
|
148
160
|
// Calculate total steps
|
|
149
161
|
let totalSteps = 1; // .env always
|
|
150
162
|
if (!clientDistExists) totalSteps += 2; // client deps + build
|
|
151
|
-
totalSteps +=
|
|
163
|
+
totalSteps += 4; // Python deps + bytecode compile + CLI venv + Temporal binary
|
|
152
164
|
let step = 0;
|
|
153
165
|
|
|
154
166
|
// Create .env if needed
|
|
@@ -220,6 +232,18 @@ try {
|
|
|
220
232
|
}
|
|
221
233
|
run(`uv pip install --python "${cliVenvPython}" --quiet -e .`, ROOT);
|
|
222
234
|
|
|
235
|
+
// Eagerly fetch the official Temporal CLI binary (~90 MB tarball
|
|
236
|
+
// from temporal.download/cli/archive/latest). Same call ``machina
|
|
237
|
+
// build`` step [6/6] makes. The runtime supervisor unconditionally
|
|
238
|
+
// uses this pooch-cached copy via
|
|
239
|
+
// ``TemporalServerRuntime._pre_spawn`` -- it ignores any system
|
|
240
|
+
// ``temporal`` on PATH -- so pre-fetching at install time turns a
|
|
241
|
+
// 30-90 s stall on first ``machina start`` into a sub-second
|
|
242
|
+
// cache hit. Idempotent on re-install (pooch cache).
|
|
243
|
+
step++;
|
|
244
|
+
console.log(`[${step}/${totalSteps}] Installing Temporal binaries...`);
|
|
245
|
+
run('uv run python -m services.temporal._install', serverDir, 600000);
|
|
246
|
+
|
|
223
247
|
// WhatsApp RPC is now an npm dependency - binary downloaded via postinstall
|
|
224
248
|
console.log('');
|
|
225
249
|
console.log('Done!');
|