Origin of "the works" meaning the full range of possibilities; everything

Q: What did a Zen Buddhist say to the hot dog vendor?
A: Make me one with everything (aka “the works” but that wouldn’t be funny).

Q: And what did the hot dog vendor say to the Zen Buddhist when he asked for his change?
A: Change comes from within.

The OED takes it back to 1899, says it was US slang, and implies that the original was “the (whole) works.”