Skip to main content

Mastra Deployment

In checkouts that include the Mastra app source, the app is developed under:

apps/mastra-orchestrator/

Some X4 checkouts contain only the docs, mirror workflow, and integration contracts. In that case, use the mirrored or deployed Mastra checkout for the build commands below.

The running service may be deployed from a mirrored path such as:

/srv/x4/mastra-orchestrator/app

Build And Validate​

cd apps/mastra-orchestrator
npm run typecheck
npm test -- tests/shared/unit/code-assist
npm run build

Service Runtime​

The deployed service uses systemd and an external env file. Typical runtime variables include:

VariablePurpose
PORT / MASTRA_PORTHTTP port.
CODE_ASSIST_APP_ROOTApp root for schemas and state paths.
CODE_ASSIST_REPO_ROOTLocal repo root for configured repos.
CODE_ASSIST_DB_PATHSQLite state path.
CODE_ASSIST_CODEX_BINCodex executable path.
CODE_ASSIST_CODEX_SANDBOXCodex sandbox mode.
CODE_ASSIST_GITHUB_APP_IDGitHub App ID.
CODE_ASSIST_GITHUB_APP_INSTALLATION_IDGitHub App installation.
CODE_ASSIST_GITHUB_APP_PRIVATE_KEY_PATHPrivate key path.

Do not commit real env files or private keys.

Health Check​

curl -sS http://127.0.0.1:4112/code-assist/health

Expected shape:

{
"status": "healthy",
"configured": true,
"timestamp": "..."
}

Workflow Listing​

curl -sS http://127.0.0.1:4112/api/workflows | jq -r 'keys[]'

The Code Assist workflows should appear in the output.

Canonical Repository​

X4Org/Mastra-Agent-Framework is the canonical Mastra repository. The former Machenta/Mastra-Agent-Framework source is deprecated and no synchronization job is allowed to force-push or prune X4Org branches from it.