executor はツール以外にケイパビリティリクエストも処理できます。長時間動くプロセス(process.*)、PTY ターミナル(terminal.*)、スキルのインストール、ワークスペースのバックアップです。それぞれケイパビリティビットで宣言し、型付きハンドラーで処理します。宣言していないケイパビリティへのリクエストは capability_unavailable(-32012)で拒否されます。Go の実行コアは process.* と skill.install を代わりに処理します(実行コアを参照)。
bma-executor-sdk 1.12.2 とその契約(contracts/bma/executor、プロトコル bma.executor.v1.1)から生成しています。インストール、認証情報、クイックスタートは bma-executor-sdk の概要、プロトコル自体は Executor Protocol を参照してください。

メソッド

process.start

プロセスを開始します。 Harness to executor request (v1.1 §3.3). Idempotent by (session_id, process_id): a repeat returns the live state. wait_ms waits up to that long for the process to end before answering. A spawn failure is an error with data.reason “spawn_failed”. io_mode, file_transfer, package_install and git_credentials each require the matching process capability bit. 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 冪等キー: session_id+process_id · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessState SDK での使い方

process.read

カーソル位置からプロセスの出力を読みます。 Harness to executor request (v1.1 §3.4). Long-polls up to wait_ms for new bytes. gap=true when bytes before earliest_cursor were dropped from the ring buffer. 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessReadResult SDK での使い方

process.write

プロセスの stdin に書き込みます。 Harness to executor request (v1.1 §3.5). Exactly one of data (base64, at most 32 KiB decoded) or close_stdin. close_stdin is rejected for io_mode “pty”. 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessWriteResult SDK での使い方

process.interrupt

プロセスに割り込みます(SIGINT)。 Harness to executor request (v1.1 §3.6). 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessState SDK での使い方

process.terminate

プロセスを終了します(SIGTERM、grace_ms 後に SIGKILL)。 Harness to executor request (v1.1 §3.6). 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessState SDK での使い方

process.list

セッションのプロセスを一覧します。 Harness to executor request (v1.1 §3.7). A new connection starts with an empty process table. 方向: harness → executor · 種類: request · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 ProcessListResult SDK での使い方

process.status

プロセスの状態変化を通知します。 Executor to harness notification (v1.1 §3.8). Advisory: the harness confirms state with process.read or process.list. 方向: executor → harness · 種類: notification · ケイパビリティ: process.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 結果なし(通知)。 SDK での使い方

terminal.open

PTY を作成または再利用します。 Harness to executor request (machine-scoped). Returns the live PTY with the same terminal_id; rows/cols only size a new PTY, and the rest of the spec must match a live terminal or the executor answers -32013. 方向: harness → executor · 種類: request · ケイパビリティ: terminal.enabled · 冪等キー: terminal_id · 導入バージョン: bma.executor.v1.1 パラメーター 結果 TerminalOpenResult SDK での使い方

terminal.attach

稼働中の PTY に利用者を 1 つ接続します。 Harness to executor request. The executor dials host.url with the ticket, offering subprotocol bma.terminal.v1, and answers after the attached frame was written. from_seq/ack_seq resume output exactly as the bma.terminal.v1 attach frame does; can_write requests the single writer lease. Closing the host socket detaches; the PTY survives. 方向: harness → executor · 種類: request · ケイパビリティ: terminal.enabled · 導入バージョン: bma.executor.v1.1 パラメーター 結果 TerminalAttachResult SDK での使い方

terminal.close

PTY を閉じます。 Harness to executor request. Idempotent. 方向: harness → executor · 種類: request · ケイパビリティ: terminal.enabled · 冪等キー: terminal_id · 導入バージョン: bma.executor.v1.1 パラメーター 結果 TerminalCloseResult SDK での使い方

skill.install

マシンにスキルのリビジョンを 1 つインストールします。 Harness to executor request (machine-scoped). The executor downloads the revision archive with download_token, verifies digest, and installs it. Idempotent by (skill_id, revision_id, digest). 方向: harness → executor · 種類: request · ケイパビリティ: skills.install · 冪等キー: skill_id+revision_id+digest · 導入バージョン: bma.executor.v1.1 パラメーター 結果 SkillInstallResult SDK での使い方

workspace.backup

マシンのワークスペースのバックアップを 1 つアップロードします。 Harness to executor request (machine-scoped). The executor walks paths (absolute), skipping exclude entries and its own BMA_HOME, and streams a tar+zstd archive with PUT to /daemon/machine-backups/{backup_id}/archive over the machine token, with the tree fingerprint in X-BMA-Backup-Fingerprint. When the fingerprint equals skip_if_fingerprint nothing is uploaded and the result is “unchanged”. Restore has no method; a recreated executor fetches /daemon/machine-backup-restore before executor.register. 方向: harness → executor · 種類: request · ケイパビリティ: workspace.backup · 冪等キー: backup_id · 導入バージョン: bma.executor.v1.1 パラメーター 結果 WorkspaceBackupResult SDK での使い方