harn-hostlib 0.8.26

Opt-in code-intelligence and deterministic-tool host builtins for the Harn VM
Documentation
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://harnlang.com/schemas/hostlib/tools/run_command.request.json",
  "title": "tools.run_command request",
  "type": "object",
  "properties": {
    "mode": { "type": "string", "enum": ["argv", "shell"], "default": "argv" },
    "argv": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" }
    },
    "command": { "type": "string" },
    "shell_id": {
      "type": "string",
      "description": "Stable id from process.list_shells / process.get_default_shell. If omitted in shell mode, the host default shell is used."
    },
    "shell": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "label": { "type": "string" },
        "path": { "type": "string" },
        "platform": { "type": "string" },
        "available": { "type": "boolean" },
        "supports_login": { "type": "boolean" },
        "supports_interactive": { "type": "boolean" },
        "default_args": {
          "type": "array",
          "items": { "type": "string" }
        },
        "login_args": {
          "type": "array",
          "items": { "type": "string" }
        },
        "source": { "type": "string" }
      },
      "additionalProperties": false
    },
    "login": { "type": "boolean", "default": false },
    "interactive": { "type": "boolean", "default": false },
    "cwd": { "type": "string" },
    "env": {
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "env_mode": {
      "type": "string",
      "enum": ["inherit_clean", "replace", "patch"],
      "default": "inherit_clean"
    },
    "stdin": { "type": "string" },
    "timeout_ms": { "type": "integer", "minimum": 0 },
    "background": { "type": "boolean", "default": false },
    "background_after_ms": {
      "type": "integer",
      "minimum": 0,
      "description": "Spawn the command in the background, wait this many milliseconds for an initial progress snapshot, then return either the snapshot or the running handle."
    },
    "progress_interval_ms": {
      "type": "integer",
      "minimum": 0,
      "description": "When the command runs in the background, publish progress feedback at this interval."
    },
    "progress_max_inline_bytes": {
      "type": "integer",
      "minimum": 0,
      "description": "Maximum stdout/stderr bytes included inline in each background progress item."
    },
    "long_running": {
      "type": "boolean",
      "default": false,
      "deprecated": true,
      "description": "Deprecated alias for background."
    },
    "capture": {
      "type": "object",
      "properties": {
        "stdout": { "type": "boolean", "default": true },
        "stderr": { "type": "boolean", "default": true },
        "merge_stderr": { "type": "boolean", "default": false },
        "max_inline_bytes": { "type": "integer", "minimum": 0, "default": 50000 }
      },
      "additionalProperties": false
    },
    "capture_stderr": {
      "type": "boolean",
      "default": true,
      "deprecated": true,
      "description": "Deprecated compatibility flag; false maps to capture.merge_stderr."
    },
    "max_inline_bytes": {
      "type": "integer",
      "minimum": 0,
      "deprecated": true
    },
    "policy_context": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "oneOf": [
    {
      "properties": { "mode": { "const": "argv" } },
      "required": ["argv"]
    },
    {
      "properties": { "mode": { "const": "shell" } },
      "required": ["mode", "command"]
    }
  ],
  "additionalProperties": false
}