feat: corporate actions from the Stockbit session (stocks actions, stocks calendar)

`idx stocks actions SYM [--kind ...]`: one stock's cash and stock
dividends, bonus shares, rights, warrants, splits and reverse splits,
meetings, public exposes and tender offers (`--kind ipo` adds its IPO),
newest first. `idx stocks calendar [--from] [--to] [--kind ...]`: the
market's actions dated in the range (default today and 30 days ahead),
oldest first. MCP: get_corporate_actions, get_corporate_calendar.

Stockbit's `/corpaction/{type}` serves one kind per request; each type has
its own field prefix and list key, so entitlements are read by field
suffix. An action's `date` is the cum date for entitlements, else the
event's first day. Dividends keep their decimals. One request per kind,
cached 6 hours. AUTHERROR without a session.

Fixtures are the 2026-11-03 recordings (market-wide ones trimmed to
October-December). Goldens added; help-stocks and completions-bash gain
the two subcommands, MCP tools.json the two tools (regenerated with
UPDATE_GOLDEN=1). The MCP docs counted 17 tools without stockbit_login;
now 20.

Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
Rasyidan Akbar F. 2026-11-03 14:35:20 +07:00
commit 43ff4aa433
55 changed files with 2026 additions and 34 deletions

View file

@ -46,6 +46,28 @@ value and trades, and foreign buy, sell and net once Stockbit marks them
current (not during trading, when they lag a day). Without one it answers
`AUTHERROR`. See [Stockbit](/cli/stockbit/#with-your-stockbit-login).
## Corporate actions (Stockbit login)
```bash
idx stocks actions BBCA # newest first
idx stocks actions TLKM --kind dividend
idx stocks calendar # today and the next 30 days
idx stocks calendar --kind dividend,rights --to 2026-12-31
```
`actions` lists one stock's cash and stock dividends, bonus shares, rights
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,
bonuses, rights and splits: buy by then to be entitled. For the others it is
the event's first day. Dividends per share keep their decimals (`Rp 3.8`).
Both need your Stockbit session and answer `AUTHERROR` without one. Stockbit
serves one kind per request, 1 s apart, so a first call with every kind takes
about ten seconds; answers are then cached for 6 hours. `--kind` asks for
less.
## Company data
| Command | What it shows |