Commit a9151b1
authored
feat(cli): add --notify (PR #619 BCC-light) + --mode parity to messages send + --notify to message-to (#49)
Closes the cli-side coverage gap that was blocking action ports for
--mode and --notify on `messages send`.
## --notify (hosted PR #619, §17 BCC-light)
Both `messages send` and `message-to` now accept `--notify <agent_ref>`
(repeatable, max 10). Each ref gets a stripped notification copy
alongside the main delivery, sharing thread_id. Server contract:
MessageCreate.notify (List[str], max-10, app/schemas/message.py).
CLI enforces the max-10 cap client-side via UsageError so the failure
surfaces at parse time instead of as a server 422.
## --mode parity for messages send
cueapi-cli #41 added `--mode` to `message-to` (Surface 6 v2
delivery_mode) but `messages send` was left without it — a
cross-product gap surfaced when porting cueapi-action #12 (action
couldn't wire --mode through messages-send). Mirroring the existing
shape from `message-to`:
- click.Choice(["live","bg","inbox","webhook","auto"]), default "auto"
- Default-omit: only emit `delivery_mode` on the wire when caller
opts away from `auto`. Server treats absent === auto, so the wire
format stays identical to pre-Surface-6 senders for the common path.
Pinned in regression-guard tests so explicit `--mode auto` is also
omitted (not just default omission).
## Wire format
Both fields are body fields on POST /v1/messages:
- `notify`: List[str], default omit when empty
- `delivery_mode`: enum, default omit when "auto"
Different from `idempotency_key` (header) and `from_agent`
(X-Cueapi-From-Agent header). Verify-server-transport-per-endpoint
discipline applied.
## Tests
8 new tests:
- messages_send_notify_passed_as_body_list
- messages_send_notify_omitted_when_unset
- messages_send_notify_max_10_enforced_client_side
- messages_send_mode_default_omitted
- messages_send_mode_explicit_passed_through (live/bg/inbox/webhook)
- messages_send_mode_auto_explicitly_omitted
- message_to_notify_passed_as_body_list
- message_to_notify_omitted_when_unset
179/179 pass total.
## Why now
This unblocks 2 follow-on cueapi-action ports:
- action `messages-send` --notify wire-through
- action `messages-send` --mode wire-through (reusing existing `mode`
input from PR #13 which already wires it for `message-to`)
Will chain a small action follow-up PR after this lands.1 parent 1b7b970 commit a9151b1
2 files changed
Lines changed: 213 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1948 | 1977 | | |
1949 | 1978 | | |
1950 | 1979 | | |
| |||
1959 | 1988 | | |
1960 | 1989 | | |
1961 | 1990 | | |
| 1991 | + | |
| 1992 | + | |
1962 | 1993 | | |
1963 | 1994 | | |
1964 | 1995 | | |
| |||
1984 | 2015 | | |
1985 | 2016 | | |
1986 | 2017 | | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
1987 | 2031 | | |
1988 | 2032 | | |
1989 | 2033 | | |
| |||
2269 | 2313 | | |
2270 | 2314 | | |
2271 | 2315 | | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
2272 | 2328 | | |
2273 | 2329 | | |
2274 | 2330 | | |
| |||
2284 | 2340 | | |
2285 | 2341 | | |
2286 | 2342 | | |
| 2343 | + | |
2287 | 2344 | | |
2288 | 2345 | | |
2289 | 2346 | | |
| |||
2318 | 2375 | | |
2319 | 2376 | | |
2320 | 2377 | | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
2321 | 2385 | | |
2322 | 2386 | | |
2323 | 2387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
2048 | 2197 | | |
2049 | 2198 | | |
2050 | 2199 | | |
| |||
0 commit comments