@exulu/backend 1.66.0 → 1.68.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.
- package/dist/chunk-VPSLTGZF.js +10267 -0
- package/dist/{convert-exulu-tools-to-ai-sdk-tools-ZFIN7A5V.js → convert-exulu-tools-to-ai-sdk-tools-CHQF36XW.js} +1 -2
- package/dist/index.cjs +23930 -22308
- package/dist/index.d.cts +401 -100
- package/dist/index.d.ts +401 -100
- package/dist/index.js +15215 -4233
- package/ee/agentic-retrieval/v3/agent-loop.ts +4 -4
- package/ee/agentic-retrieval/v3/index.ts +20 -6
- package/ee/python/documents/processing/doc_processor.ts +79 -34
- package/ee/python/requirements.txt +8 -1
- package/ee/python/setup.sh +0 -49
- package/ee/queues/decorator.ts +36 -0
- package/ee/queues/prune-job-results.ts +55 -0
- package/ee/schemas.ts +19 -0
- package/ee/workers.ts +59 -32
- package/package.json +1 -1
- package/dist/chunk-KQDNL5WU.js +0 -19399
- package/ee/agentic-retrieval/v4/agent-loop.ts +0 -208
- package/ee/agentic-retrieval/v4/context-sampler.ts +0 -79
- package/ee/agentic-retrieval/v4/index.ts +0 -690
- package/ee/agentic-retrieval/v4/types.ts +0 -58
- package/ee/python/.hermes/.env.example +0 -8
- package/ee/python/.hermes/README.md +0 -44
- package/ee/python/.hermes/SOUL.md.example +0 -8
- package/ee/python/.hermes/config.yaml.example +0 -55
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export type QueryType = "aggregate" | "list" | "targeted" | "exploratory";
|
|
2
|
-
|
|
3
|
-
export interface ClassificationResult {
|
|
4
|
-
queryType: QueryType;
|
|
5
|
-
language: string;
|
|
6
|
-
/** IDs of contexts most likely relevant. Empty means search all. */
|
|
7
|
-
suggestedContextIds: string[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ContextSample {
|
|
11
|
-
contextId: string;
|
|
12
|
-
contextName: string;
|
|
13
|
-
/** All field names available on items (standard + custom) */
|
|
14
|
-
fields: string[];
|
|
15
|
-
/** Up to 2 example item records */
|
|
16
|
-
exampleItems: Array<Record<string, any>>;
|
|
17
|
-
sampledAt: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ChunkResult {
|
|
21
|
-
item_name: string;
|
|
22
|
-
item_id: string;
|
|
23
|
-
context: string;
|
|
24
|
-
chunk_id?: string;
|
|
25
|
-
chunk_index?: number;
|
|
26
|
-
chunk_content?: string;
|
|
27
|
-
metadata?: Record<string, any>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface RetrievalStep {
|
|
31
|
-
stepNumber: number;
|
|
32
|
-
/** Text the model output during this step (reasoning) */
|
|
33
|
-
text: string;
|
|
34
|
-
toolCalls: Array<{ name: string; id: string; input: any }>;
|
|
35
|
-
chunks: ChunkResult[];
|
|
36
|
-
tokens: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface Reasoning {
|
|
40
|
-
text: string;
|
|
41
|
-
tools: {
|
|
42
|
-
name: string;
|
|
43
|
-
id: string;
|
|
44
|
-
input: any;
|
|
45
|
-
output: any;
|
|
46
|
-
}[]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface AgenticRetrievalOutput {
|
|
50
|
-
steps: RetrievalStep[];
|
|
51
|
-
reasoning: Reasoning[];
|
|
52
|
-
/** All chunks collected across all steps */
|
|
53
|
-
chunks: ChunkResult[];
|
|
54
|
-
usage: any[];
|
|
55
|
-
totalTokens: number;
|
|
56
|
-
/** Path to the trajectory JSON file written to disk, if any */
|
|
57
|
-
trajectoryFile?: string;
|
|
58
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1,44 +0,0 @@
|
|
|
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.
|
|
@@ -1,8 +0,0 @@
|
|
|
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.
|
|
@@ -1,55 +0,0 @@
|
|
|
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"
|