File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# The function extracts common fields (session_id, cwd, project) from the
1414# hook's stdin JSON (passed as $1), then merges any extra jq args you pass.
1515
16- # The maximum protocol version this plugin knows how to produce.
17- PLUGIN_MAX_PROTOCOL_VERSION =1
16+ # The current protocol version this plugin knows how to produce.
17+ PLUGIN_CURRENT_PROTOCOL_VERSION =1
1818
1919# Negotiate the protocol version with Warp.
20- # Uses min(plugin_max , warp_declared), falling back to 1 if Warp doesn't advertise a version.
20+ # Uses min(plugin_current , warp_declared), falling back to 1 if Warp doesn't advertise a version.
2121negotiate_protocol_version () {
2222 local warp_version=" ${WARP_CLI_AGENT_PROTOCOL_VERSION:- 1} "
23- if [ " $warp_version " -lt " $PLUGIN_MAX_PROTOCOL_VERSION " ] 2> /dev/null; then
23+ if [ " $warp_version " -lt " $PLUGIN_CURRENT_PROTOCOL_VERSION " ] 2> /dev/null; then
2424 echo " $warp_version "
2525 else
26- echo " $PLUGIN_MAX_PROTOCOL_VERSION "
26+ echo " $PLUGIN_CURRENT_PROTOCOL_VERSION "
2727 fi
2828}
2929
Original file line number Diff line number Diff line change @@ -125,19 +125,19 @@ export WARP_CLI_AGENT_PROTOCOL_VERSION=1
125125PAYLOAD=$( build_payload ' {"session_id":"s1","cwd":"/tmp"}' " stop" )
126126assert_json_field " v1 when warp declares 1" " $PAYLOAD " " .v" " 1"
127127
128- # Warp declares a higher version than the plugin knows → capped to plugin max
128+ # Warp declares a higher version than the plugin knows → capped to plugin current
129129export WARP_CLI_AGENT_PROTOCOL_VERSION=99
130130PAYLOAD=$( build_payload ' {"session_id":"s1","cwd":"/tmp"}' " stop" )
131- assert_json_field " capped to plugin max when warp is ahead" " $PAYLOAD " " .v" " 1"
131+ assert_json_field " capped to plugin current when warp is ahead" " $PAYLOAD " " .v" " 1"
132132
133133# Warp declares a lower version than the plugin knows → use warp's version
134134# (not testable with PLUGIN_MAX=1 since there's no v0, but we verify the min logic
135135# by temporarily overriding the variable)
136- PLUGIN_MAX_PROTOCOL_VERSION =5
136+ PLUGIN_CURRENT_PROTOCOL_VERSION =5
137137export WARP_CLI_AGENT_PROTOCOL_VERSION=3
138138PAYLOAD=$( build_payload ' {"session_id":"s1","cwd":"/tmp"}' " stop" )
139139assert_json_field " uses warp version when plugin is ahead" " $PAYLOAD " " .v" " 3"
140- PLUGIN_MAX_PROTOCOL_VERSION =1
140+ PLUGIN_CURRENT_PROTOCOL_VERSION =1
141141
142142# Clean up
143143unset WARP_CLI_AGENT_PROTOCOL_VERSION
You can’t perform that action at this time.
0 commit comments