fix(actions): keep small foreign dividends, allow only read paths, show open offers

From Pullfrog's review of #78:

- A dividend in another currency keeps 6 decimals (USD 0.0012 was rounded
  to 0.0 in JSON and "USD 0" in the table); rupiah stays to the sen.
- `--kind stock_dividend` and `--kind reverse_split` work on the CLI too,
  as they already did over MCP.
- The session client GETs only the prefixes in READ_PATHS, as
  docs/STOCKBIT.md's rule 1 already said: any other path (orders, PIN,
  withdrawals) fails before a request or token refresh leaves the process.
- `stocks calendar` and get_corporate_calendar also list rights trading,
  tender offers and IPO offers still open in the range, so an offer that
  began earlier shows while it can be acted on. A warrant's years-long
  windows do not count. The 2026-11-03..12 golden gains DOOH, NAYZ and AUTO.
- `stocks calendar --help` names the ex-date fallback, and docs/STOCKBIT.md
  shows the record and surface as shipped.

Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
Rasyidan Akbar F. 2026-11-04 20:44:07 +07:00
commit 884c6459e4
16 changed files with 247 additions and 67 deletions

View file

@ -290,7 +290,7 @@ Examples:
### `idx stocks calendar`
```text
Corporate actions across IDX from your own Stockbit session (`idx stockbit login`), oldest first, dated within --from and --to (default: today and the next 30 days). An action's date is its cum date for dividends, bonuses, rights and splits, else the event's first day. Stockbit lists about a year back and what is announced ahead. One request per kind, 1 s apart; answers are cached for 6 hours.
Corporate actions across IDX from your own Stockbit session (`idx stockbit login`), oldest first, dated within --from and --to (default: today and the next 30 days), plus rights trading, tender offers and IPO offers still open then. An action's date is its cum date for dividends, bonuses, rights and splits (its ex date when Stockbit gives no cum date), else the event's first day. Stockbit lists about a year back and what is announced ahead. One request per kind, 1 s apart; answers are cached for 6 hours.
Usage: idx stocks calendar [OPTIONS]

View file

@ -60,7 +60,9 @@ idx stocks calendar --kind dividend,rights --to 2026-12-31
issues, warrants, splits and reverse splits, shareholders' meetings, public
exposes and tender offers (`--kind ipo` adds its IPO). `calendar` lists them
across the market between `--from` and `--to` (at most 366 days), including
what is announced ahead. An action's date is its cum date for dividends,
what is announced ahead, plus rights trading, tender offers and IPO offers
still open in that range, so an offer that began earlier still shows while
you can act on it. An action's date is its cum date for dividends,
bonuses, rights and splits: buy by then to be entitled. For the others it is
the event's first day. When Stockbit gives no cum date, the action sits on
its ex date, marked `(ex)` in the table, and JSON leaves `cum_date` out.

View file

@ -74,7 +74,7 @@ Corporate actions of one IDX stock from the user's own Stockbit session, newest
## `get_corporate_calendar`
Corporate actions across IDX from the user's own Stockbit session, oldest first, dated from `from` to `to` (default today and the next 30 days): upcoming cum dates, meetings, exposes, rights, warrants, IPOs and tender offers, and the past year. Each item has the same fields as get_corporate_actions, with `symbol`. One Stockbit request per kind (about 1 s each on a cold cache, then cached 6 hours); pass `kinds` to ask for less. AUTHERROR means there is no session: call stockbit_status, then stockbit_login.
Corporate actions across IDX from the user's own Stockbit session, oldest first, dated from `from` to `to` (default today and the next 30 days), plus rights trading, tender offers and IPO offers still open in that range (their `period` overlaps it, though `date` may be earlier): upcoming cum dates, meetings, exposes, rights, warrants, IPOs and tender offers, and the past year. Each item has the same fields as get_corporate_actions, with `symbol`. One Stockbit request per kind (about 1 s each on a cold cache, then cached 6 hours); pass `kinds` to ask for less. AUTHERROR means there is no session: call stockbit_status, then stockbit_login.
| Input | Type | Required | Description |
| --- | --- | --- | --- |