The terminal connector is a bounded terminal device adapter for MD-OS (Artificial Prefrontal Cortex) v5.0 MD-OS APFC.
It demonstrates how a real connector can execute something useful while staying bounded and inspectable.
The terminal connector:
project_id, command_id, and connector IDs with a strict
allowlistPATHIt does not execute arbitrary shell strings.
md-os/os/terminal_connector.js connector implementation
md-os/ops/connectors/terminal_connector.json command allowlist
md-os/ops/sources/connectors/ generated snapshots
md-os/ops/artifacts/terminal/ raw command artifacts
md-os/ops/journal.ndjson connector run events
node md-os/os/terminal_connector.js list
Or:
npm run connector:terminal:list
node md-os/os/terminal_connector.js run <project_id> <command_id>
Example:
node md-os/os/terminal_connector.js run demo_general_system node_version
Or:
npm run connector:terminal:run:node-version
After a connector emits a snapshot, rebuild the affected project:
node md-os/os/build_project_state.js demo_general_system
node md-os/os/build_global_agenda.js
node md-os/os/build_markdown_graph.js
node md-os/os/build_global_index.js
Command profiles are configured in:
md-os/ops/connectors/terminal_connector.json
Example:
{
"schema_version": 1,
"connector_id": "terminal_executor",
"default_timeout_ms": 15000,
"max_stdout_bytes": 200000,
"max_stderr_bytes": 200000,
"redact_patterns": ["token=", "api_key=", "secret="],
"commands": [
{
"command_id": "node_version",
"argv": ["node", "--version"],
"cwd": ".",
"summary": "Capture the local Node.js version.",
"priority": "low",
"tags": ["terminal", "runtime", "version"],
"entities": ["node_runtime"]
}
]
}
The connector uses argv directly through spawnSync. It does not pass a shell
string for interpretation. cwd is resolved relative to the workspace and must
remain inside it.
Running the connector writes a file like:
md-os/ops/sources/connectors/demo_general_system__terminal__node_version.json
The snapshot includes:
connector_runtimeThe raw command output is written to:
md-os/ops/artifacts/terminal/
The artifact includes:
md-os/ops/connectors/terminal_connector.json.command_id, argv, cwd, and summary.node md-os/os/terminal_connector.js list
node md-os/os/terminal_connector.js run <project_id> <new_command_id>
node md-os/os/build_project_state.js <project_id>
argv arrays.cwd inside the workspace.