feat(cli): add wrap command for a should-I-wrap-now advisor#283
Open
jongio wants to merge 1 commit into
Open
Conversation
Add a `wrap` command that reads the trailing probe history for a device and calls whether to wrap the cook now (the Texas crutch). It combines the current temperature, the wrap window, stall detection, and rate of climb into one call: wrap-now, hold, below-window, at-target, or no-data. The logic lives in a pure SDK helper `assessWrap` so it stays testable and reuses the existing stall and rate-of-change detectors. Readings come from the device history series, the same source as `history` and `graph`. Closes #282 Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
thermoworks wrap <serial> --target <F>command that advises whether to wrap the cook now (the Texas crutch). Wrapping in foil or butcher paper pushes meat through the stall faster and protects the bark, but wrap too early and the bark never sets.The command reads the trailing probe history for a device and combines the current temperature, the wrap window, stall detection, and rate of climb into one call:
wrap-now: inside the wrap window and either stalled or barely climbinghold: inside the window but still climbing well, so wrapping is optionalbelow-window: under the wrap temperature, let the bark set firstat-target: at or above the target, pull and rest insteadno-data: no readings yetHow
assessWrapinpackages/sdk/src/wrap-advisor.ts. It reuses the existingdetectStallanddetectRapidChangedetectors, so awrap-nowcall lines up with an active stall. Side-effect free and unit tested.packages/cli/src/commands/wrap.tsreadsclient.getHistory(serial), converts readings to Fahrenheit, and prints a human summary or--json.historyandgraph.Flags
--target F(required): target internal temperature--wrap-at F: temperature where the wrap window opens (default 160)--limit N: look at only the most recent N readings--json: machine-readable outputTests
packages/sdk/tests/wrap-advisor.test.ts: all five call paths plus custom wrap window and slow-rate threshold.packages/cli/tests/wrap.test.ts: arg parsing, formatting, Celsius conversion, limit, and the login/usage guards.pnpm lintclean.Closes #282