Repository navigation
Tags
Tags
fix(cli): -o downloads responses that came back as a download link (#34) * fix(cli): say when -o holds a download envelope; document it * chore: drop unrelated lockfile change * fix(cli): -o downloads responses that came back as a download link When a provider response is larger than the service's inline limit (256 KB for every overflow provider today), the API replaces the whole output with one key holding { download_link, content_type, link_expires_at, file_expires_at }. -o wrote that link object instead of the body, and the previous commit only added a human-mode note, which --json callers (agents) never see. -o now writes the body itself: when the output is exactly that overflow shape (one key, strict envelope keys, valid dates, an https link on sfs.monid.ai / sfs.<env>.monid.ai), the CLI streams the body from the link into the file (via a .part file, plain fetch so no API key goes to SFS, 5 min timeout). If the download fails, the file holds the link object and the command exits 1, with outputError in --json mode. File results are deliberately not downloaded: media envelopes next to provider fields (OpenAI image, ElevenLabs audio, Gemini video) and provider-hosted URLs (Seedance, Kling, ...) have no single shape, so they stay as JSON. The loose findDownloadEnvelope check and its note are removed; the skill paragraph shrinks to what -o now does. Verified: bun test (204 pass), tsc --noEmit, bun run build; a 1 MB chunked body streamed to the file under Bun; Readable.fromWeb + fetch under Node 26.
fix(cli): keep the run ID on --wait timeouts and poll failures (#23) When --wait ran out of time the only output was 'Polling timed out after 30s': no run ID, so the natural next step was to run (and pay) again even though the run was still going. - pollUntilDone throws PollTimeoutError carrying the last result seen. - MonidError carries an optional runId/status; withRunContext() attaches the run a failure belongs to. 'monid run' records the run as soon as the server creates it; 'monid runs get -w' has it from the argument. - handleError prints 'Run ID: <id> (status: RUNNING)' plus the exact 'monid runs get -r <id>' to resume with; in --json the error carries error.runId and error.status. Code POLL_TIMEOUT. Provider-error bodies are NOT handled here: a sync run the provider refused is returned as a run by #18 (acceptRunBody), so there is no error path to decorate.
feat: show endpoint health metrics in discover and inspect The API now returns an optional `metrics` block on discover results and inspect responses, carrying a server-computed health verdict and measured run-time percentiles. - discover: new `Health` column rendering the verdict plus the median run time (e.g. `healthy 4.4s`). The tail is deliberately left to inspect — two durations in a scan column have to be read positionally to tell median from tail, and reading them backwards inverts the decision they inform. - inspect: new `Health` section with both percentiles, labelled. - discover gains `-u/--include-unavailable`, wired to the existing API param. Endpoints in outage are filtered server-side, so without it the `outage` verdict is unreachable from the CLI. Unrecognized verdicts render verbatim rather than being dropped, so a status added server-side surfaces without a CLI release. This is load-bearing: `stable` reached the CLI through exactly this path while this change was being written. Skill version bumped to 0.1.7 — note this implies the next release is tagged v0.1.7, since the CLI version comes from the release tag and the skill requires the two to match.
PreviousNext