Files
gh-otolab-ai-agent-prompts-…/hooks/pre-compact.sh
2025-11-30 08:46:35 +08:00

25 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# コンテキスト圧縮前のモード状態復元
MESSAGE="⚠️ コンテキスト圧縮前の処理\n\n"
MESSAGE="${MESSAGE}以下の手順を実行してください:\n"
MESSAGE="${MESSAGE}1. コンテキストから最新のアクティブなモードリストを検索\n"
MESSAGE="${MESSAGE}2. mode_setツールで状態を保存MCPオンメモリに保存\n\n"
MESSAGE="${MESSAGE}※ この処理により、compact後もMCPサーバーのモード状態が保持されます\n\n"
MESSAGE="${MESSAGE}⚠️ コンテキスト圧縮完了後の処理\n\n"
MESSAGE="${MESSAGE}以下の手順をTODOの最初に追加してください\n"
MESSAGE="${MESSAGE}1. **mode_show()** を実行してモード文書を再読み込み\n\n"
MESSAGE="${MESSAGE}※ 保存されたモードの状態を復元します。"
# Use jq to properly encode JSON with multi-line strings
jq -n \
--arg message "$MESSAGE" \
'{
hookSpecificOutput: {
hookEventName: "PreCompact",
additionalContext: $message
}
}'