Commit c0ca4ed
docs(ai): declare label?/onRetry? in the provider-dispatch typedefs (PR #45 review)
streamChat/complete/streamAgentTurn read o.label and o.onRetry, and pass onRetry as an
object literal into the openaiCompat adapters — but the @PARAM typedefs for both didn't
list them. Under // @ts-check that is 9 real diagnostics: TS2339 (property does not exist)
on each o.label / o.onRetry read, plus TS2353 (excess property) on each adapter literal.
Added label?:string and onRetry?:(info:{attempt,retries,status})=>void to the three
router typedefs, and onRetry? to the three adapter typedefs (they already carried label?).
The reviewer flagged label; onRetry has the same defect (added by the retry commit) and is
fixed in the same pass.
Verified with a real tsc 5.6 checkJs run — and not the vacuous kind: a synthetic probe
first confirmed tsc actually enforces TS2339/TS2353 here (an earlier npx form was silently
not running tsc at all), then stashing the fix gave BEFORE=9 label/onRetry errors, restoring
it gave AFTER=0. JSDoc-only; runtime unchanged (full gate 24 suites, 28 provider tests).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent a38092e commit c0ca4ed
2 files changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
198 | | - | |
| 200 | + | |
199 | 201 | | |
200 | | - | |
| 202 | + | |
| 203 | + | |
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
251 | | - | |
| 253 | + | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
| |||
0 commit comments