mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
977105b0f6
* feat(hackernews): add `read <id>` and surface item id on every listing Two related agent-flow gaps in the HN adapters: 1. `top`/`best`/`ask`/`new`/`show`/`jobs`/`search` all carry the HN item id internally (firebase items are fetched by id; algolia hits include `objectID`) but drop it before output. Without an id column the agent can see the title but has no handle to follow up with. 2. There was no way to read a story's discussion. The whole reason an agent looks at HN is the comments — and that capability was missing. This PR adds: - `id` column on every listing adapter (firebase items: numeric id; algolia search hits: `objectID` string). Existing column order is preserved otherwise. - `hackernews read <id>` — public/non-browser adapter that fetches the story plus a tree of top-level comments + inline replies via `https://hacker-news.firebaseio.com/v0/item/<id>.json`. Mirrors the `reddit read` shape (`type/author/score/text`) so agents can use both with one mental model. HTML-only fields (comment text) are converted to plain text with anchor URLs preserved. - Column-contract tests covering all listings + the new read adapter. - Doc entry under `docs/adapters/browser/hackernews.md`. Tested locally via `~/.opencli/clis/hackernews/` overrides: opencli hackernews top --limit 3 # id present opencli hackernews search rust --limit 2 # id (objectID) present opencli hackernews read 47999636 --limit 5 # threaded output * fix(hackernews): typed fail-fast for read