#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2025 Jiri Vyskocil
# SPDX-License-Identifier: Apache-2.0
# terok:container — this file is deployed into task containers, not used on the host.

# ACP wrapper for OpenCode (base, non-provider variant).
#
# Sets up per-agent git identity before exec-ing the native opencode
# acp adapter.
#
# Instructions: delivered via "instructions" array in opencode.json pointing
# to /home/dev/.terok/instructions.md.  Injected on the host by
# prepare_agent_config_dir → _inject_opencode_instructions.
#
# Unrestricted mode: OPENCODE_PERMISSION env var is set at container level
# by task_runners.py.  opencode reads process.env directly in ACP mode.

set -euo pipefail

_AGENT_NAME="OpenCode"
_AGENT_EMAIL="noreply@opencode.ai"
. /usr/local/share/terok/terok-acp-env.sh

exec opencode acp "$@"
