@exulu/backend 1.63.2 → 1.64.0

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.
@@ -0,0 +1,8 @@
1
+ # EXAMPLE ONLY — Exulu generates the real .env per profile at runtime (mode 0600).
2
+ # Profile-local secrets referenced by ${VAR} in config.yaml.
3
+ #
4
+ # Runtime API-server params (API_SERVER_ENABLED / HOST / PORT / KEY) are NOT
5
+ # stored here — the supervisor injects them via the child process environment so
6
+ # port and key allocation stay owned by Exulu and a profile dir is portable.
7
+
8
+ LITELLM_MASTER_KEY=replace-with-your-litellm-master-key
@@ -0,0 +1,44 @@
1
+ # Hermes Agent profiles (advanced agent mode)
2
+
3
+ This directory documents the per-profile files Exulu generates for the
4
+ [Hermes Agent](https://hermes-agent.nousresearch.com) harness when an Exulu
5
+ agent has **advanced mode** enabled. You do **not** edit anything here — Exulu's
6
+ provisioner writes the real files at runtime under `${HERMES_HOME}/profiles/<id>/`.
7
+
8
+ ## How it fits together
9
+
10
+ - One Hermes **profile** per Exulu agent (`<agentId>`), or per agent/user
11
+ (`<agentId>/<userId>`) when the agent's
12
+ `advanced_agent_profile_scope` is `private`.
13
+ - Each in-use profile runs its own `hermes gateway` process on its own port,
14
+ supervised by `src/exulu/hermes/supervisor.ts` (lazy start + idle eviction).
15
+ - Every model call still flows through the LiteLLM proxy — Hermes' `model`
16
+ block points `base_url` at LiteLLM.
17
+
18
+ ## Enabling
19
+
20
+ 1. `ENABLE_HERMES_AGENT=true` (gates install + the whole code path).
21
+ 2. Run `npm run python:setup` — installs the `hermes` binary when the flag is on.
22
+ 3. Toggle **advanced mode** on an individual agent in the agent form.
23
+
24
+ ## Env vars
25
+
26
+ | Var | Default | Purpose |
27
+ | --- | --- | --- |
28
+ | `ENABLE_HERMES_AGENT` | (unset) | Global gate for advanced mode. |
29
+ | `HERMES_HOME` | `~/.hermes` | Root for profile directories. |
30
+ | `HERMES_BIN` | (auto) | Override path to the `hermes` binary. |
31
+ | `HERMES_PORT_RANGE` | `8642-8700` | Gateway port pool. |
32
+ | `HERMES_MAX_GATEWAYS` | `20` | LRU cap on concurrent gateways. |
33
+ | `HERMES_IDLE_TIMEOUT_MS` | `900000` | Idle eviction threshold (15 min). |
34
+ | `HERMES_APPROVALS_MODE` | `smart` | Tool-approval policy written to config.yaml. |
35
+ | `HERMES_TERMINAL_BACKEND` | `docker` | Backend that runs native shell/file tools (`docker` isolates without host user namespaces; `local`/`ssh`/`modal`/`daytona`/`singularity` also selectable). Docker must be available to the host process. |
36
+ | `HERMES_DOCKER_IMAGE` | `nikolaik/python-nodejs:python3.11-nodejs20` | Image for the docker backend (needs python + node). |
37
+ | `BACKEND` | `http://127.0.0.1:<PORT>` | URL a gateway uses to reach Exulu's `/mcp/:agentId` (set this if the host app's port isn't `PORT`/`EXULU_PORT`). |
38
+ | `EXULU_MCP_KEY` | `LITELLM_MASTER_KEY` | Bearer token guarding the ExuluTools MCP endpoint. |
39
+
40
+ ExuluTools reach the agent over HTTP MCP at `/mcp/<agentId>` and **add to** Hermes'
41
+ native tools (bash, filesystem, …) rather than replacing them.
42
+
43
+ See `config.yaml.example`, `.env.example`, and `SOUL.md.example` in this folder
44
+ for the shape of the generated files.
@@ -0,0 +1,8 @@
1
+ <!-- EXAMPLE ONLY — Exulu generates the real SOUL.md per profile from the agent's
2
+ `instructions`. SOUL.md is slot #1 of the Hermes system prompt and defines
3
+ who the agent is. Exulu owns this file and rewrites it whenever the agent's
4
+ instructions change (Hermes never overwrites an existing SOUL.md). -->
5
+
6
+ You are Acme Corp's research assistant. You are precise, cite your sources, and
7
+ prefer primary documents over summaries. When unsure, you say so rather than
8
+ guessing.
@@ -0,0 +1,55 @@
1
+ # EXAMPLE ONLY — Exulu generates the real config.yaml per profile at runtime.
2
+ # Documentation: https://hermes-agent.nousresearch.com/docs/user-guide/configuration
3
+ #
4
+ # The model block points Hermes at the LiteLLM proxy so every model call still
5
+ # flows through the single model gateway. NOTE: the model-name key is `default`,
6
+ # not `model`. When base_url is set, Hermes calls it directly using api_key.
7
+
8
+ model:
9
+ default: "claude-haiku" # a LiteLLM model_name from config.litellm.yaml
10
+ provider: custom
11
+ base_url: "http://127.0.0.1:4000/v1"
12
+ api_key: "${LITELLM_MASTER_KEY}" # resolved from the profile .env / process env
13
+ api_mode: chat_completions
14
+
15
+ # Tool-approval policy: `smart` auto-approves low-risk actions and emits an
16
+ # approval event (requiring a decision) before destructive ones.
17
+ approvals:
18
+ mode: smart
19
+
20
+ # Native shell/file tools run via this backend. Default is `docker`: a hardened,
21
+ # Hermes-managed container (cap-drop ALL, no-new-privileges) that isolates the
22
+ # tools from the host WITHOUT needing user namespaces — so it behaves the same
23
+ # on macOS (Docker Desktop) and Linux. Volumes are bind-mounted host->same path
24
+ # so the absolute cwd / skills.external_dirs resolve inside the container;
25
+ # secrets are not mounted. Set HERMES_TERMINAL_BACKEND=local to disable.
26
+ terminal:
27
+ backend: docker
28
+ # No bind mount: the Files panel talks to the container's /root directly via
29
+ # docker exec/cp. We stamp a deterministic label so Exulu can find the
30
+ # container (docker ps --filter label=exulu-profile=<profileId>), and keep it
31
+ # persistent so files survive between runs.
32
+ docker_image: "nikolaik/python-nodejs:python3.11-nodejs20"
33
+ container_persistent: true
34
+ lifetime_seconds: 86400
35
+ # Run as root (home /root) so the agent's working dir is a predictable /root
36
+ # the Files panel reads — NOT the host user's home (e.g. /Users/<you>), which
37
+ # is what docker_run_as_host_user (default) would replicate.
38
+ docker_run_as_host_user: false
39
+ docker_mount_cwd_to_workspace: false
40
+ docker_extra_args: ["--label", "exulu-profile=<profileId>"]
41
+ - "/abs/.../profiles/<profileId>/exulu-skills:/abs/.../profiles/<profileId>/exulu-skills:ro"
42
+
43
+ # Added in Phase 3 — ExuluTools exposed over HTTP MCP at /mcp/<agentId>:
44
+ # mcp_servers:
45
+ # exulu:
46
+ # url: "http://127.0.0.1:<exulu-port>/mcp/<agentId>"
47
+ # headers:
48
+ # Authorization: "Bearer ${EXULU_MCP_KEY}"
49
+
50
+ # Enabled Exulu skills, synced from S3 into the profile (Anthropic Agent Skills
51
+ # format). ADDS to Hermes' own skills home (learned/bundled skills); only
52
+ # written when the agent has skills enabled.
53
+ # skills:
54
+ # external_dirs:
55
+ # - "/abs/path/to/${HERMES_HOME}/profiles/<profileId>/exulu-skills"
@@ -253,6 +253,46 @@ if [ -n "$LITELLM_PROXY_DIR" ] && [ -f "$LITELLM_PROXY_DIR/schema.prisma" ]; the
253
253
  || print_warning "Prisma generate failed; LiteLLM database mode (database_url in config.litellm.yaml) may not work until you run 'cd $LITELLM_PROXY_DIR && PATH=$VENV_DIR/bin:\$PATH $VENV_DIR/bin/prisma generate'"
254
254
  fi
255
255
 
256
+ # Step 6.6: Install the Hermes Agent harness (advanced agent mode).
257
+ # Opt-in via ENABLE_HERMES_AGENT=true. Hermes is NOT a pip package — it ships
258
+ # as a standalone binary via Nous Research's official installer (lands in
259
+ # ~/.local/bin/hermes). We only install if it's not already present so re-runs
260
+ # are fast, and we never fail the whole setup if the install fails (advanced
261
+ # mode is optional; the operator can install it manually and retry).
262
+ if [ "${ENABLE_HERMES_AGENT}" = "true" ]; then
263
+ echo ""
264
+ echo "Step 6.6: Installing Hermes Agent harness (ENABLE_HERMES_AGENT=true)..."
265
+ if command -v hermes &> /dev/null || [ -x "$HOME/.local/bin/hermes" ]; then
266
+ HERMES_VERSION=$( (command -v hermes &> /dev/null && hermes --version 2>/dev/null) || "$HOME/.local/bin/hermes" --version 2>/dev/null || echo "unknown")
267
+ print_success "Hermes already installed ($HERMES_VERSION) — skipping installer"
268
+ else
269
+ print_info "Running Hermes official installer..."
270
+ if curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash; then
271
+ print_success "Hermes Agent installed (binary at ~/.local/bin/hermes)"
272
+ else
273
+ print_warning "Hermes installer failed. Advanced agent mode will be unavailable until 'hermes' is on PATH. Install manually: https://hermes-agent.nousresearch.com/docs/getting-started/installation"
274
+ fi
275
+ fi
276
+
277
+ # Pre-pull the docker terminal-backend image so the first agent request
278
+ # isn't blocked on a cold image pull (~minute). Only when the backend is
279
+ # docker (the default) and docker is available; non-fatal otherwise.
280
+ HERMES_BACKEND="${HERMES_TERMINAL_BACKEND:-docker}"
281
+ if [ "${HERMES_BACKEND}" = "docker" ]; then
282
+ HERMES_IMG="${HERMES_DOCKER_IMAGE:-nikolaik/python-nodejs:python3.11-nodejs20}"
283
+ if command -v docker &> /dev/null; then
284
+ print_info "Pre-pulling Hermes docker backend image: ${HERMES_IMG}..."
285
+ if docker pull "${HERMES_IMG}" > /dev/null 2>&1; then
286
+ print_success "Docker backend image ready (${HERMES_IMG})"
287
+ else
288
+ print_warning "Could not pre-pull ${HERMES_IMG}; the first advanced-mode request will pull it (slower)."
289
+ fi
290
+ else
291
+ print_warning "Docker not found, but HERMES_TERMINAL_BACKEND=docker. Install Docker, or set HERMES_TERMINAL_BACKEND=local (unsandboxed)."
292
+ fi
293
+ fi
294
+ fi
295
+
256
296
  # Step 7: Validate installation
257
297
  echo ""
258
298
  echo "Step 7: Validating installation..."
@@ -269,6 +309,15 @@ $PYTHON_CMD -c "import whisperx" 2>/dev/null && print_success "whisperx imported
269
309
  $PYTHON_CMD -c "import pyannote.audio" 2>/dev/null && print_success "pyannote.audio imported successfully" || print_warning "pyannote.audio not importable (diarization will be disabled even with HF_AUTH_TOKEN)"
270
310
  $PYTHON_CMD -c "import fastapi, uvicorn" 2>/dev/null && print_success "fastapi/uvicorn imported successfully" || print_warning "fastapi/uvicorn not importable (transcription server will not start)"
271
311
 
312
+ # Hermes Agent binary check (advanced agent mode) — only when opted in.
313
+ if [ "${ENABLE_HERMES_AGENT}" = "true" ]; then
314
+ if command -v hermes &> /dev/null || [ -x "$HOME/.local/bin/hermes" ]; then
315
+ print_success "hermes binary available (advanced agent mode ready)"
316
+ else
317
+ print_warning "hermes binary not found (advanced agent mode will be unavailable)"
318
+ fi
319
+ fi
320
+
272
321
  # Step 8: Display summary
273
322
  echo ""
274
323
  echo -e "${GREEN}========================================${NC}"
package/ee/schemas.ts CHANGED
@@ -73,6 +73,10 @@ export const rolesSchema: ExuluTableDefinition = {
73
73
  name: "evals",
74
74
  type: "text", // write | read access to evals
75
75
  },
76
+ {
77
+ name: "budget_management",
78
+ type: "text", // write | read access to budgets
79
+ },
76
80
  ],
77
81
  };
78
82
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exulu/backend",
3
3
  "author": "Qventu Bv.",
4
- "version": "1.63.2",
4
+ "version": "1.64.0",
5
5
  "main": "./dist/index.js",
6
6
  "private": false,
7
7
  "publishConfig": {