Refreshes an expired AWS SSO token before Amazon Bedrock model requests in OpenCode V2, then continues the original request without adding a prompt.
Copy aws-sso-refresh.js to ~/.config/opencode/plugins/. AWS CLI v2 must be on the OpenCode server's PATH. OpenCode reloads plugins after a save; /reload forces a reload.
The plugin resolves the profile from the Bedrock provider settings, then AWS_PROFILE, then default. It supports legacy and sso_session profiles, respects AWS_CONFIG_FILE, and leaves explicit credentials, API keys, and bearer authentication alone.