Commit graph

3 commits

Author SHA1 Message Date
caf4a2e026 feat(codechef): implement login and submit
Problem: CodeChef login and submit were stub-only. Language IDs were
also missing for USACO, Kattis, and CodeChef.

Solution: Add StealthySession browser-based login (checks `__NEXT_DATA__`
for current user, fills email/password form) and submit (navigates to
`/{contest_id}/submit/{problem_id}`, selects language via select element
or custom dropdown fallback, sets code via Monaco/CodeMirror/textarea JS,
clicks submit). Cookie cache at `~/.cache/cp-nvim/codechef-cookies.json`.
Add language IDs for all three new platforms to `language_ids.py`.
2026-03-06 00:05:17 -05:00
Barrett Ruth
c194f12eee
feat(atcoder): extract submit helpers; add live status notifications (#294)
## Problem

`_submit_sync` was a 170-line nested closure with `_solve_turnstile` and
the browser-install block further nested inside it. Status events went
to
stderr, which `run_scraper()` silently discards, leaving the user with a
10–30s silent hang after credential entry. The NDJSON spawn path also
lacked stdin support, so submit had no streaming path at all.

## Solution

Extract `_TURNSTILE_JS`, `_solve_turnstile`, `_ensure_browser`, and
`_submit_headless` to module level in `atcoder.py`; status events
(`installing_browser`, `checking_login`, `logging_in`, `submitting`) now
print to stdout as NDJSON. Add stdin pipe support to the NDJSON spawn
path in `scraper.lua` and switch `M.submit` to streaming with an
`on_status` callback. Wire `on_status` in `submit.lua` to fire
`vim.notify` for each phase transition.
2026-03-04 19:27:29 -05:00
a75694e9e0 feat(submit): add solution submission UI
Add submit.lua that reads credentials from a local JSON store (prompting
via vim.ui.input/inputsecret on first use), reads the source file, and
delegates to scraper.submit(). Add language_ids.py with platform-to-
language-ID mappings for atcoder, codeforces, and cses.
2026-03-03 15:09:41 -05:00