#!/usr/bin/env bash
set -euo pipefail
# Usage: bash thread-driver.sh CHECKOUT T3_HOME WORKSPACE enabled|tool|disabled
cd "$1"
proof_home=$2
proof_workspace=$3
proof_phase=$4
case "$proof_phase" in
 enabled) title='Enabled plugin'; prompt='Use the proof-gdocs skill. Do not search the filesystem for it. If the skill is unavailable, say SKILL_UNAVAILABLE.';;
 tool) title='Plugin tool'; prompt='Call the plugin_document_stamp MCP tool and report its result. If that tool is unavailable, say TOOL_UNAVAILABLE. Do not search the filesystem or use other tools.';;
 disabled) title='Disabled plugin'; prompt='Is the proof-gdocs skill or plugin_document_stamp MCP tool available? Do not search the filesystem or use other tools. If neither is available, say PLUGIN_DISABLED.';;
 *) exit 2;;
esac
node apps/server/src/bin.ts thread start --base-dir "$proof_home" --title "$title" --provider antigravity --model gemini-3.8-flash --json "$proof_workspace" "$prompt"
