Make functions:test-function block-and-show-sends; surface watch/wait in help text#83
Conversation
Greptile SummaryThis PR closes two discoverability gaps: it introduces a hand-rolled
Confidence Score: 5/5Safe to merge; the new command adds polling on top of existing API endpoints with correct timeout/exit-code handling, and all package description updates are consistent across both packages. The hand-rolled command follows the established pattern for other CLI shortcuts, the two-phase polling correctly uses poll_since to anchor the search window, terminal webhook states are well-defined, and the OVERRIDDEN_OPERATION_IDS filter cleanly prevents the auto-generated duplicate from being registered. The previous finding about cli-node/package.json carrying stale help text is now fully addressed. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "Bump cli-node and sdk-node to 0.26.1 for..." | Re-trigger Greptile |
d5dcd31 to
54aa5c1
Compare
Summary
Closes two AGX-discoverability gaps in one PR. Targets a 0.26.1 patch release (0.26.0 already published from #82).
functions:test-function --wait --show-sends
Hand-rolled override that wraps the auto-generated POST /functions/{id}/test with the wait-and-show-sends flow AGX walkthroughs flagged as the single biggest verification time-sink. Today an agent has to triple-thread the queued send id, emails:wait, getEmail, and sending:list-sent-emails to verify a function ran and see what it emitted. Now:
Implementation polls two existing endpoints: `searchEmails({to, since})` to find the test inbound row, then `getEmail({id})` until `webhook_status` is terminal. The `replies` field on EmailDetail already carries the outbound correlation so no new server surface is needed.
The auto-generated functions:test-function entry is filtered out of `generatedCommands` so the hand-rolled command owns the id without a name collision.
Surface emails:wait and emails:watch in emails topic help text
The `emails` oclif topic description previously only mentioned `emails:latest`. `emails:wait` and `emails:watch` have been shipped since #56 but weren't discoverable via `primitive --help` or `primitive emails --help`. Description rewritten to also call out wait (block-until-arrives, bounded by --timeout/--number) and watch (stream forever).
The description is duplicated in both `cli-node/package.json` (canonical `@primitivedotdev/cli`) and `sdk-node/package.json` (deprecated alias that still ships the CLI). Both are updated so users on either package see the new copy.
Version bumps
Patch level rather than minor because pre-1.0 caret matching (`^0.26.0`) already gives existing consumers automatic uptake of the new flag, no need to inflate the minor for a targeted CLI add-on. `CLI_VERSION_RANGE` in the functions:init scaffolder stays at `^0.26.0` since it still satisfies the bumped CLI version.
`sdk-python` and `sdk-go` are untouched in this PR; their 0.26.0 releases stand.
Test plan