@tony01/astroneum 0.4.1-beta.2 → 0.4.1-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +280 -237
  2. package/LICENSE +21 -21
  3. package/README.md +250 -198
  4. package/dist/{Indicator-BBI3L_lx.d.ts → Indicator-BQQcVGGT.d.ts} +51 -227
  5. package/dist/astroneum.css +1 -1
  6. package/dist/chunk-47YGQEL5.js +399 -0
  7. package/dist/chunk-67XM5LOK.js +2 -0
  8. package/dist/{chunk-2YYGUSVX.js → chunk-DFJMDDL5.js} +1 -1
  9. package/dist/chunk-EFAS6F4C.js +59 -0
  10. package/dist/chunk-EHZN52CY.js +2 -0
  11. package/dist/chunk-HKLWNPMP.js +35 -0
  12. package/dist/chunk-ONPPQW65.js +2 -0
  13. package/dist/chunk-SCTHEM27.js +3 -0
  14. package/dist/chunk-UQXYMB6X.js +2 -0
  15. package/dist/chunk-WSIR5T2M.js +3 -0
  16. package/dist/entries/alerts.d.ts +36 -10
  17. package/dist/entries/alerts.js +1 -1
  18. package/dist/entries/datafeeds/crypto.d.ts +5 -1
  19. package/dist/entries/datafeeds/crypto.js +1 -1
  20. package/dist/entries/datafeeds/polygon.d.ts +3 -1
  21. package/dist/entries/datafeeds/polygon.js +1 -1
  22. package/dist/entries/headless.d.ts +78 -0
  23. package/dist/entries/headless.js +2 -0
  24. package/dist/entries/multichart.d.ts +12 -1
  25. package/dist/entries/multichart.js +1 -1
  26. package/dist/entries/replay.d.ts +3 -1
  27. package/dist/entries/script.d.ts +2 -68
  28. package/dist/entries/script.js +1 -1
  29. package/dist/entries/watchlist.d.ts +32 -2
  30. package/dist/entries/watchlist.js +1 -1
  31. package/dist/entries/workspace.d.ts +61 -0
  32. package/dist/entries/workspace.js +2 -0
  33. package/dist/index-BiXdqLA4.d.ts +45 -0
  34. package/dist/index-_JgHTy8X.d.ts +19 -0
  35. package/dist/index.d.ts +188 -27
  36. package/dist/index.js +1 -1
  37. package/dist/script-BU9StbN-.d.ts +120 -0
  38. package/dist/types-W6SIYQ9m.d.ts +232 -0
  39. package/dist/types-yETgeYsE.d.ts +28 -0
  40. package/dist/zh-CN-NDTUDZGZ.js +3 -0
  41. package/docs/MIRROR-PLAN-SYMBOL-SEARCH-WATCHLIST.md +255 -0
  42. package/docs/STRUCTURE.md +51 -37
  43. package/docs/TODO-DESIGN.md +111 -37
  44. package/docs/TODO.md +26 -16
  45. package/docs/WORKSTREAMS.md +55 -0
  46. package/docs/api.md +655 -528
  47. package/docs/datafeed-guide.md +329 -311
  48. package/docs/design-astroneum.md +204 -65
  49. package/docs/plugin-development.md +569 -565
  50. package/docs/tv-functions-skill.md +88 -64
  51. package/package.json +158 -147
  52. package/dist/chunk-4YOLQ5DC.js +0 -2
  53. package/dist/chunk-I4YQBP2M.js +0 -3
  54. package/dist/chunk-OOMZRONH.js +0 -35
  55. package/dist/chunk-PV2GAINM.js +0 -2
  56. package/dist/chunk-YW3STIPY.js +0 -653
  57. package/dist/zh-CN-Y2C6RSOI.js +0 -3
@@ -13,7 +13,7 @@ Every catalog row carries one of these six statuses. The status dictates what to
13
13
 
14
14
  | Bucket | Meaning | Action |
15
15
  |---|---|---|
16
- | `widget-native` | TV widget provides it; Astroneum just doesn't disable it | Ensure widget config flag is `true`; do not rebuild |
16
+ | `widget-native` | The Astroneum library/component already provides it | Use the existing prop, method, manager, plugin, or widget; do not rebuild |
17
17
  | `native-chrome` | Astroneum rebuilds it in surrounding chrome | Build per `docs/design-astroneum.md` §5 |
18
18
  | `api-bridged` | Existing backend API already mirrors it | Reuse; do not rebuild |
19
19
  | `v1-in-scope` | Spec'd for v1 per `design-astroneum.md` §11 | Build now |
@@ -24,7 +24,7 @@ Every catalog row carries one of these six statuses. The status dictates what to
24
24
 
25
25
  ## 2. Existing Astroneum API surface
26
26
 
27
- Astroneum is a **SEPARATE project** from Trading-Bot-V2 (different repo: `github.com/kowito/astroneum` vs `github.com/Tony1185/trading-bot-v2.git`). The Astroneum demo app (`/opt/astroneum/demo/`, the `astroneum-demo-next` Next.js app) is charting-first and has a minimal API surface. Trading-Bot-V2's webhook/positions/orders APIs are NOT available to Astroneum.
27
+ Astroneum is a **SEPARATE project** from Trading-Bot-V2 (different repo: `github.com/Tony1185/Astroneum` vs `github.com/Tony1185/trading-bot-v2.git`). The Astroneum demo app (`/opt/astroneum/demo/`, the `astroneum-demo-next` Next.js app) is charting-first and has a minimal API surface. Trading-Bot-V2's webhook/positions/orders APIs are NOT available to Astroneum.
28
28
 
29
29
  ### Astroneum demo app API routes (api-bridged)
30
30
 
@@ -34,14 +34,14 @@ Astroneum is a **SEPARATE project** from Trading-Bot-V2 (different repo: `github
34
34
 
35
35
  ### Astroneum library modules (astroneum-native, not API routes)
36
36
 
37
- These are client-side library modules from the `astroneum` npm package, not server API routes:
37
+ These are client-side library modules from the `@tony01/astroneum` npm package, not server API routes:
38
38
 
39
39
  | Subpath | Role |
40
40
  |---|---|
41
- | `astroneum/alerts` | `AlertManager` — price alert creation and monitoring (client-side). |
42
- | `astroneum/portfolio` | `PortfolioTracker` — position tracking and P&L (read-only display; not an execution path). |
43
- | `astroneum/watchlist` | `WatchlistManager` — symbol watchlist with live prices. |
44
- | `astroneum/datafeeds/crypto` | `createStandardCryptoDatafeed` + `BinanceAdapter` / `BitgetAdapter` / `OkxAdapter` — real-time crypto data. |
41
+ | `@tony01/astroneum/alerts` | `AlertManager` — price alert creation and monitoring (client-side). |
42
+ | `@tony01/astroneum/portfolio` | `PortfolioTracker` — position tracking and P&L (read-only display; not an execution path). |
43
+ | `@tony01/astroneum/watchlist` | `WatchlistManager` — symbol watchlist with live prices. |
44
+ | `@tony01/astroneum/datafeeds/crypto` | `createStandardCryptoDatafeed` + `BinanceAdapter` / `BitgetAdapter` / `OkxAdapter` — real-time crypto data. |
45
45
 
46
46
  ### Trading-Bot-V2 API surface (SEPARATE project — NOT available to Astroneum)
47
47
 
@@ -50,9 +50,9 @@ The following are in the Trading-Bot-V2 project (`/root/Trading-Bot-V2/` or `/op
50
50
  | Trading-Bot-V2 path | Role | Astroneum equivalent |
51
51
  |---|---|---|
52
52
  | `src/app/api/webhooks/tradingview/route.ts` | Ingests TV `alert()` POSTs (5 actions). | None — Astroneum has no webhook ingestion. v21 events are reference-only (see §3.12). |
53
- | `src/app/api/tv-positions/route.ts` | TV-reported positions. | None — use `astroneum/portfolio` `PortfolioTracker` for read-only display. |
53
+ | `src/app/api/tv-positions/route.ts` | TV-reported positions. | None — use `@tony01/astroneum/portfolio` `PortfolioTracker` for read-only display. |
54
54
  | `src/app/api/orders/route.ts` | Order creation (PaperTradingEngine + RiskManager). | None — Astroneum is charting-first; build new if trading is needed. |
55
- | `src/app/api/portfolio/route.ts` | Portfolio summary. | None — use `astroneum/portfolio` `PortfolioTracker`. |
55
+ | `src/app/api/portfolio/route.ts` | Portfolio summary. | None — use `@tony01/astroneum/portfolio` `PortfolioTracker`. |
56
56
  | `src/app/api/integrations/tradingview/route.ts` | Webhook token management. | None — not applicable to Astroneum. |
57
57
 
58
58
  ---
@@ -65,9 +65,9 @@ Row format: `| Function | TV behavior | Status | Pointer | Notes |`. Pointer = w
65
65
 
66
66
  | Function | TV behavior | Status | Pointer | Notes |
67
67
  |---|---|---|---|---|
68
- | Candles | OHLC candle body + wick | `widget-native` | `style:"1"` in widget config | v21 uses candles |
69
- | Hollow Candles | Body hollow on up | `widget-native` | `style:"9"` | |
70
- | Heikin Ashi | HA-transformed candles | `widget-native` | `style:"8"` | |
68
+ | Candles | OHLC candle body + wick | `widget-native` | `AstroneumChart` `barStyle` / `ChartTypeDropdown` | v21 uses candles |
69
+ | Hollow Candles | Body hollow on up | `v1-deferred` | ? | Not exposed in current demo selector |
70
+ | Heikin Ashi | HA-transformed candles | `widget-native` | `AstroneumChart` `barStyle="heikin_ashi"` / `ChartTypeDropdown` | |
71
71
  | Line | Close-price line | `widget-native` | `style:"2"` | |
72
72
  | Area | Line + fill | `widget-native` | `style:"3"` | |
73
73
  | Baseline | Line vs baseline threshold | `widget-native` | `style:"10"` | |
@@ -76,25 +76,25 @@ Row format: `| Function | TV behavior | Status | Pointer | Notes |`. Pointer = w
76
76
  | Point & Figure | X/O columns | `widget-native` | `style:"6"` | |
77
77
  | Line Break | N-line reversal | `widget-native` | `style:"7"` | |
78
78
  | Range | Range-bars | `widget-native` | `style:"12"` | |
79
- | Chart-type selector | Top-bar dropdown | `native-chrome` | `src/components/astroneum/TopBar.tsx` | Mirrors TV top-bar |
79
+ | Chart-type selector | Top-bar dropdown | `native-chrome` | `demo/src/app/components/ChartTypeDropdown.tsx` | Mirrors TV top-bar |
80
80
 
81
81
  ### 3.2 Timeframes
82
82
 
83
83
  | Function | TV behavior | Status | Pointer | Notes |
84
84
  |---|---|---|---|---|
85
- | 1s, 1m, 5m, 15m, 30m, 1h, 4h, 1D, 1W, 1M | Standard resolutions | `widget-native` | `interval` param | v21 runs on `240` (4h) |
86
- | Range bars | Price-range aggregation | `widget-native` | `interval="R"` | |
85
+ | 1s, 1m, 5m, 15m, 30m, 1h, 4h, 1D, 1W, 1M | Standard resolutions | `widget-native` | `AstroneumChart` `period` prop + `setPeriod()` | v21 runs on 4h |
86
+ | Range bars | Price-range aggregation | `widget-native` | `NonTimeBars` | |
87
87
  | Custom seconds/minutes | User-defined | `v1-deferred` | — | §12 |
88
- | Timeframe selector | Top-bar buttons | `native-chrome` | `TopBar.tsx` | Hotkeys `1`-`9` (§8 of design) |
88
+ | Timeframe selector | Top-bar buttons | `native-chrome` | `src/widget/period-bar` | Period buttons shipped; overflow dropdown + `,` hotkey remain a TODO-DESIGN gap |
89
89
 
90
90
  ### 3.3 Chart layouts / multi-chart
91
91
 
92
92
  | Function | TV behavior | Status | Pointer | Notes |
93
93
  |---|---|---|---|---|
94
- | Single pane | One chart | `widget-native` | default | v1 ships single only |
95
- | 2×1, 1×2, 2×2, 3×1, 3×2, 4×4 grids | Multi-pane | `v1-deferred` | — | §12; v2 rebuild |
96
- | Sync crosshair across panes | Linked | `v1-deferred` | — | |
97
- | Layout selector | Grid picker | `v1-deferred` | — | |
94
+ | Single pane | One chart | `widget-native` | `AstroneumChart` default | |
95
+ | 2×1, 1×2, 2×2, 4×2, 4×4 grids | Multi-pane | `native-chrome` | `MultiChartLayout`, `MultiChartView` | each pane restores its own serialized chart state |
96
+ | Sync crosshair across panes | Linked | `native-chrome` | `MultiChartLayout` | toggle persisted with the workspace |
97
+ | Layout selector | Grid picker | `native-chrome` | `LayoutPicker` | grid selection persisted with chart type |
98
98
 
99
99
  ### 3.4 Scales
100
100
 
@@ -178,18 +178,18 @@ v21 uses: BB, SMMA (RMA), SAR, ADX/DI, MACD, RSI, ATR, EMA(1D), Choppiness Index
178
178
 
179
179
  | Function | TV behavior | Status | Pointer | Notes |
180
180
  |---|---|---|---|---|
181
- | Inputs tab | Length, source, params | `v1-deferred` | — | Widget-provided when studies UI on |
181
+ | Inputs tab | Length, source, params | `v1-deferred` | ? | `IndicatorSettingModal` is partial; full Inputs/Style/Visibility parity remains deferred |
182
182
  | Style tab | Color, width, plot visibility | `v1-deferred` | — | |
183
183
  | Visibility tab | Per-timeframe show/hide | `v1-deferred` | — | |
184
184
 
185
185
  ### 3.10 Drawing tools (~50)
186
186
 
187
- Astroneum ships a left vertical toolbar (`src/components/astroneum/LeftToolbar.tsx`) mirroring TV's drawing-tool dock. Most tools are `widget-native` when TV's side toolbar is shown; Astroneum v1 keeps TV's side toolbar visible (`hide_side_toolbar: false` in widget config — see §5) and re-implements the dock selector as `native-chrome`.
187
+ Astroneum ships a left vertical toolbar (`src/widget/drawing-bar`) mirroring TV's drawing-tool dock. Drawing primitives live under `src/extension/` (32 overlays); the library owns the rail and the demo shell preserves it through the dock height, with internal scrolling on short viewports only (`@media max-height:620px`).
188
188
 
189
189
  | Tool | TV behavior | Status | Pointer |
190
190
  |---|---|---|---|
191
- | Cursor / pointer | Default select | `native-chrome` | `LeftToolbar.tsx` |
192
- | Trend line | Two-point line | `widget-native` | TV side toolbar |
191
+ | Cursor / pointer | Default select | `native-chrome` | `src/widget/drawing-bar` |
192
+ | Trend line | Two-point line | `widget-native` | `src/extension` |
193
193
  | Horizontal line | Price level | `widget-native` | |
194
194
  | Vertical line | Time marker | `widget-native` | |
195
195
  | Fibonacci retracement | Fib levels | `widget-native` | |
@@ -200,6 +200,18 @@ Astroneum ships a left vertical toolbar (`src/components/astroneum/LeftToolbar.t
200
200
  | Rectangle | Box shape | `widget-native` | |
201
201
  | Ellipse | Oval | `widget-native` | |
202
202
  | Triangle / polygon / arrow | Shapes | `widget-native` | |
203
+ | Long position | Risk/reward entry to stop to target | `native-chrome` | `src/extension/longPosition` |
204
+ | Short position | Inverted risk/reward | `native-chrome` | `src/extension/shortPosition` |
205
+ | Position forecast | Projection cone | `native-chrome` | `src/extension/positionForecast` |
206
+ | Bars pattern | Replay candles at new position | `native-chrome` | `src/extension/barsPattern` |
207
+ | Ghost feed | Translucent candle copy | `native-chrome` | `src/extension/ghostFeed` |
208
+ | Sector | Arc/fan from pivot | `native-chrome` | `src/extension/sector` |
209
+ | Anchored VWAP | Cumulative VWAP from anchor | `native-chrome` | `src/extension/anchoredVwap` |
210
+ | Fixed range volume profile | Horizontal histogram in range | `native-chrome` | `src/extension/fixedRangeVolumeProfile` |
211
+ | Anchored volume profile | Cumulative volume profile | `native-chrome` | `src/extension/anchoredVolumeProfile` |
212
+ | Price range | 2 price lines + delta label | `native-chrome` | `src/extension/priceRange` |
213
+ | Date range | 2 date lines + delta label | `native-chrome` | `src/extension/dateRange` |
214
+ | Date and price range | Rectangle + 4 labels | `native-chrome` | `src/extension/dateAndPriceRange` |
203
215
  | Brush / bezier / freehand | Free draw | `widget-native` | |
204
216
  | Text / note / label | Annotation | `widget-native` | |
205
217
  | Measure | Range + % tool | `widget-native` | |
@@ -209,7 +221,7 @@ Astroneum ships a left vertical toolbar (`src/components/astroneum/LeftToolbar.t
209
221
  | Hide all drawings | Toggle | `widget-native` | |
210
222
  | Show/Hide price/coordinate fields | Inputs | `widget-native` | |
211
223
  | Object tree | Layers panel | `v1-deferred` | — | §12 |
212
- | Drawing settings popover | Stroke/color/magnet | `native-chrome` | `LeftToolbar.tsx` (hover popover) | |
224
+ | Drawing settings popover | Stroke/color/magnet | `native-chrome` | `src/widget/drawing-bar` | |
213
225
 
214
226
  ### 3.11 Alerts (general)
215
227
 
@@ -268,7 +280,7 @@ All 25 `alert()` calls in the v21 source. Action × side × stage × reason. The
268
280
 
269
281
  ### 3.14 Pine Script functions — function-level reference
270
282
 
271
- Signatures + whether v21 uses it. Status: `widget-native` (TV runtime) for all; Astroneum does not host a Pine runtime.
283
+ Signatures + whether v21 uses it. Status: `widget-native` (TV runtime) for all; Astroneum does not host a Pine runtime. Astroneum additionally has a deliberately narrower `strategySignals()` contract in `ScriptEngine.compileStrategy()`; it is not a Pine `strategy.*` implementation.
272
284
 
273
285
  #### `strategy.*` (strategy context)
274
286
 
@@ -450,11 +462,11 @@ Signatures + whether v21 uses it. Status: `widget-native` (TV runtime) for all;
450
462
 
451
463
  | Function | TV behavior | Status | Pointer | Notes |
452
464
  |---|---|---|---|---|
453
- | Backtest engine | Replays trades on history | `widget-native` | | v21 is a `strategy()` — runs in tester |
454
- | Performance summary | Net profit, PF, expected payoff, B&H, drawdown, sharpe, sortino | `v1-deferred` | — | §12; widget-provided |
455
- | Trade list | Per-trade entry/exit/P&L | `v1-deferred` | — | |
456
- | Equity curve | Equity over time | `v1-deferred` | — | |
457
- | Drawdown curve | DD over time | `v1-deferred` | — | |
465
+ | Backtest engine | Replays trades on history | `native-chrome` | `src/strategy/BacktestEngine.ts` | Deterministic bar-close fills, commission, slippage, trades, equity, and drawdown; chart-replay bridge remains |
466
+ | Performance summary | Net profit, PF, expected payoff, B&H, drawdown, sharpe, sortino | `native-chrome` | `StrategyTesterPanel` | Runtime report is fed by compiled `strategySignals()` against chart history |
467
+ | Trade list | Per-trade entry/exit/P&L | `native-chrome` | `StrategyTesterPanel` | Runtime data; filtering/pagination remain deferred |
468
+ | Equity curve | Equity over time | `native-chrome` | `BacktestResult.equity` | Typed series available; chart visual remains |
469
+ | Drawdown curve | DD over time | `native-chrome` | `BacktestResult.equity` | Typed series available; chart visual remains |
458
470
  | Trade markers on chart | Arrows on entry/exit | `widget-native` | | |
459
471
  | Strategy properties | Commission, slippage, capital, sizing | `widget-native` | | v21 sets these in `strategy()` |
460
472
  | Currency conversion | Convert to display ccy | `v1-deferred` | — | |
@@ -507,13 +519,27 @@ The v21 strategy emits a `table.new` overlay with 38 rows. This is the strategy'
507
519
 
508
520
  ### 3.17 Watchlists
509
521
 
522
+ Behavioral evidence: `tv-mirror-reference/watchlist.md` (panel anatomy, control inventory, sortable-column and quote-state model, gaps).
523
+
510
524
  | Function | TV behavior | Status | Pointer | Notes |
511
525
  |---|---|---|---|---|
512
- | Multiple watchlists | Tabs of lists | `native-chrome` | `RightRail.tsx` / `Watchlist.tsx` | |
513
- | Add/remove symbol | Edit list | `native-chrome` | `Watchlist.tsx` | |
514
- | Reorder | Drag rows | `native-chrome` | | |
515
- | Details panel | OHLC + P&L + description | `native-chrome` | `RightRail.tsx` | Uses the demo app's own state (NOT `useTradingStore` — that's Trading-Bot-V2) |
516
- | Highlight selected | Active row | `native-chrome` | | 2px accent left-edge |
526
+ | Multiple watchlists | Tabs of lists | `native-chrome` | `demo/src/app/components/panels/WatchlistPanel.tsx`, `WatchlistManager` | Persisted horizontal tabs with one active list and an overflow selector at six lists. |
527
+ | Add/remove symbol | Edit list | `native-chrome` | `WatchlistPanel.tsx`, `WatchlistManager`, `SymbolSearchModal` | Validated search stores full metadata; context menu removes symbols. |
528
+ | Reorder | Drag rows | `native-chrome` | `WatchlistPanel.tsx`, `WatchlistManager` | Same-list and cross-list symbol drag ship; list-tab reorder remains. |
529
+ | Details panel | OHLC + P&L + description | `native-chrome` | `DetailsPanel` / `WatchlistPanel` sub-tab | Live OHLC + metadata ship; fundamentals and P&L remain 🟦 v1.1 pending data sources. |
530
+ | Highlight selected | Active row | `native-chrome` | `WatchlistPanel.tsx` | Indigo tint + 1px inset signal; tabular figures on numeric columns. |
531
+ | Last price column | Live last price per row | `native-chrome` | `WatchlistPanel.tsx`, `Datafeed.getQuotes?` | Right-aligned tabular figures with precision metadata and `—` fallback. |
532
+ | Column header + sort | Click to sort asc/desc | `native-chrome` | `WatchlistPanel.tsx`, `WatchlistManager.setSort` | Sticky accessible headers and per-list persistence ship. |
533
+ | Row context menu | Right-click actions | `v1-in-scope` | `WatchlistPanel.tsx` | Copy, alert, move, remove, and keyboard invocation ship; inferred Hide/Lock remain. |
534
+ | Header toolbar actions | Tabs + add + settings + more | `native-chrome` | `WatchlistPanel.tsx` | Add, settings, view preset, Rename/Delete/Duplicate/Export, and list colors ship. |
535
+ | Empty-state CTA | Add-symbol prompt | `native-chrome` | `WatchlistPanel.tsx` | Empty-state action opens validated symbol search. |
536
+ | Cross-list drag | Move symbol between lists | `native-chrome` | `WatchlistManager.moveSymbol` | Tab drop targets call persisted cross-list moves. |
537
+ | Per-list color dot | Visual list identifier | `native-chrome` | `WatchlistManager.setColor` | Six-color palette and list dots ship. |
538
+ | Advanced/Simple toggle | Column preset switch | `native-chrome` | `WatchlistPanel.tsx` | Per-list Simple and Advanced presets ship. |
539
+ | Column chooser popover | Toggle columns | `native-chrome` | `WatchlistManager.setColumns` | Persisted chooser with reset and keyboard dismissal ships. |
540
+ | Live quote polling | Multi-symbol price stream | `api-bridged` | `Datafeed.getQuotes?`, `StandardCryptoDatafeed`, `WatchlistManager.updateQuotes` | Binance/Bitget/OKX quotes poll every 2s while visible. |
541
+ | No-matches + retry | Error recovery | `native-chrome` | `WatchlistPanel.tsx`, `SymbolSearchModal` | Search no-match and quote Retry states ship. |
542
+ | News sub-tab | Symbol-filtered news | `v1-deferred` | `WatchlistPanel.tsx` | Folded into the panel with an honest empty state until a news provider is connected. |
517
543
 
518
544
  ### 3.18 Screener
519
545
 
@@ -544,12 +570,12 @@ The v21 strategy emits a `table.new` overlay with 38 rows. This is the strategy'
544
570
  | Paper trading | Simulated account | `v1-deferred` | — | §12; Astroneum is charting-first, no trading in v1 |
545
571
  | Broker connections | OAuth brokers | `v1-deferred` | — | §12 |
546
572
  | Order ticket (market/limit/stop/stop-limit) | Place order | `v1-deferred` | — | Astroneum has no `/api/orders`; build new in `/opt/astroneum/demo/src/app/api/` if needed. Do NOT reuse Trading-Bot-V2's `OrderPanel`. |
547
- | Positions list | Open positions | `v1-deferred` | — | Use `astroneum/portfolio` `PortfolioTracker` for read-only display. Do NOT reuse Trading-Bot-V2's `OpenPositions` or `/api/tv-positions`. |
573
+ | Positions list | Open positions | `v1-deferred` | — | Use `@tony01/astroneum/portfolio` `PortfolioTracker` for read-only display. Do NOT reuse Trading-Bot-V2's `OpenPositions` or `/api/tv-positions`. |
548
574
  | Orders list | Working orders | `v1-deferred` | — | Astroneum has no orders API; build new if needed. |
549
575
  | History | Filled/closed | `v1-deferred` | — | Build new in `/opt/astroneum/demo/src/app/api/` if needed. |
550
576
  | DOM / depth of market | L2 ladder | `v1-deferred` | — | §12; library supports it, APP defers surface. |
551
577
  | On-chart order dragging | Drag SL/TP | `v1-deferred` | — | §12 |
552
- | Account summary | Balance/equity/margin | `v1-deferred` | — | Use `astroneum/portfolio` `PortfolioTracker`. Do NOT use Trading-Bot-V2's `/api/portfolio`. |
578
+ | Account summary | Balance/equity/margin | `v1-deferred` | — | Use `@tony01/astroneum/portfolio` `PortfolioTracker`. Do NOT use Trading-Bot-V2's `/api/portfolio`. |
553
579
 
554
580
  ### 3.21 Replay
555
581
 
@@ -564,15 +590,15 @@ The v21 strategy emits a `table.new` overlay with 38 rows. This is the strategy'
564
590
 
565
591
  | Function | TV behavior | Status | Pointer | Notes |
566
592
  |---|---|---|---|---|
567
- | Save layout | Chart state | `v1-deferred` | — | v2 |
568
- | Load layout | Restore | `v1-deferred` | — | |
569
- | Chart templates | Indicator + settings preset | `v1-deferred` | — | |
593
+ | Save layout | Chart state | `native-chrome` | `ChartTemplateManager`, `SaveLoadMenu` | localStorage persistence with active-layout autosave |
594
+ | Load layout | Restore | `native-chrome` | `AstroneumChart.loadState()` | restores the active layout on reload with chart settings, indicators, and drawings |
595
+ | Chart templates | Indicator + settings preset | `native-chrome` | `ChartTemplateManager` | named local templates with rename, duplicate, timestamps, and confirmed delete |
570
596
 
571
597
  ### 3.23 Search
572
598
 
573
599
  | Function | TV behavior | Status | Pointer | Notes |
574
600
  |---|---|---|---|---|
575
- | Symbol search | Ticker picker | `native-chrome` | `SymbolSearch.tsx` | `/` hotkey, command-palette style |
601
+ | Symbol search | Ticker picker | `native-chrome` | `src/widget/symbol-search-modal`, `src/widget/period-bar` | `/` hotkey; PeriodBar trigger carries `title`, `data-semantic-id`, `apply-common-tooltip`, and mobile compact text behavior |
576
602
  | TV search (everything) | Global search | `v1-deferred` | — | |
577
603
  | Command palette | App-level actions | `native-chrome` | build in `/opt/astroneum/demo/src/app/_components/` | `Cmd/Ctrl-K`. Do NOT inherit from CryptoBot — separate project. |
578
604
 
@@ -622,26 +648,24 @@ Source: v21 Pine source. Single envelope; one `alert()` call per event. All even
622
648
 
623
649
  ---
624
650
 
625
- ## 5. Widget config flag map
651
+ ## 5. React prop / chrome hand-off map
626
652
 
627
- Every `TradingView.widget({...})` option that controls whether a TV function is `widget-native` vs `native-chrome`. From `design-astroneum.md` §6. All three "hand-off" flags must be set together.
653
+ Astroneum does not embed `TradingView.widget`. Configuration is via React props, instance methods, managers, and demo chrome. This map replaces the old widget-flag model.
628
654
 
629
- | Flag | Value | Effect | Hands off to Astroneum |
630
- |---|---|---|---|
631
- | `hide_top_toolbar` | `true` | Hides TV top bar | `TopBar.tsx` |
632
- | `hide_legend` | `true` | Hides TV OHLC legend | `OhlcLegend.tsx` (§11) |
633
- | `disable_native_context_menu` | `true` | Hides TV right-click menu | `ContextMenu.tsx` (§11) |
634
- | `hide_side_toolbar` | `false` | Keeps TV drawing toolbar visible | — (drawing tools remain `widget-native`) |
635
- | `allow_symbol_change` | `false` | Blocks in-widget symbol change | `SymbolSearch.tsx` |
636
- | `allow_popups_and_modify` | `false` | Blocks in-widget popups | — |
637
- | `withdateranges` | `true` | Shows date-range footer | — (kept `widget-native`) |
638
- | `theme` | `"dark"` | Locks theme | — (Astroneum is dark-only v1) |
639
- | `style` | `"1"` | Candles | user-controlled via `TopBar.tsx` |
640
- | `interval` | route param | Timeframe | user-controlled via `TopBar.tsx` |
641
- | `symbol` | `mapPairToTvSymbol(pair)` | Symbol | user-controlled via `Watchlist.tsx` |
642
- | `studies` | user prefs | Active indicators | user-controlled via indicators button |
643
- | `save_load_adapter` | `undefined` | No save/load | v1-deferred |
644
- | `details_modifiers` | `undefined` | No details overrides | — |
655
+ | Surface / behavior | Astroneum control | Native chrome owner |
656
+ |---|---|---|
657
+ | Top toolbar | Demo shell, `PeriodBar`, `ChartTypeDropdown`, modal triggers | `demo/src/app/components/ChartTerminal.tsx` |
658
+ | OHLC legend | Not built yet | `OhlcLegend.tsx` (section 11) |
659
+ | Right-click context menu | Not built yet | `ContextMenu.tsx` (section 11) |
660
+ | Left drawing toolbar | `drawingBarVisible`, `src/widget/drawing-bar`, `src/extension/*` (32 overlays) | Library-owned `DrawingBar` with 6 groups (cursor, singleLine, moreLine, polygon, fibonacci, wave) + forecasting group (12 tools in 3 sections); `TerminalShell` insets the dock to preserve the rail |
661
+ | Symbol change | `symbol` prop, `setSymbol()` | `src/widget/symbol-search-modal`, `PeriodBar`, `WatchlistPanel` |
662
+ | Date-range footer | `DateRangeNavigator` plus `ChartPlugin` engine bridge | `demo/src/app/components/DateRangeNavigator.tsx` |
663
+ | Theme | `theme` prop | v1 dark; high-contrast supported |
664
+ | Chart type | `barStyle` / chart-type state | `demo/src/app/components/ChartTypeDropdown.tsx` |
665
+ | Timeframe | `period` prop, `setPeriod()` | `src/widget/period-bar` |
666
+ | Indicators | `mainIndicators`, `subIndicators`, indicator widgets | `IndicatorModal`, `IndicatorSettingModal` |
667
+ | Save/load | `serializeState()`, `loadState()`, `ChartTemplateManager` | `demo/src/app/components/SaveLoadMenu.tsx` |
668
+ | Shell collapse | CSS grid vars + `localStorage` key `astroneum:shell` | `demo/src/app/components/TerminalShell.tsx` |
645
669
 
646
670
  ---
647
671
 
@@ -673,9 +697,9 @@ When working on `/astroneum`:
673
697
  1. Identify the TV function being mirrored.
674
698
  2. Find it in §3 (catalog).
675
699
  3. Read its status:
676
- - `widget-native` → ensure the widget flag in §5 is set correctly. Do not rebuild.
700
+ - `widget-native` -> use the existing Astroneum prop, method, manager, plugin, or widget. Do not rebuild.
677
701
  - `api-bridged` → reuse the path in §2. Do not rebuild.
678
- - `native-chrome` → build per `design-astroneum.md` §5, file in `src/components/astroneum/`.
702
+ - `native-chrome` -> build per `design-astroneum.md` ?5, usually in `demo/src/app/components/` or `src/widget/`.
679
703
  - `v1-in-scope` → build now per `design-astroneum.md` §11.
680
704
  - `v1-deferred` → do not build; note for v2.
681
705
  - `v2-future` → note only.
@@ -701,6 +725,6 @@ When working on `/astroneum`:
701
725
  - [ ] Every §3.12 webhook event maps 1:1 to an `alert()` call in the v21 source.
702
726
  - [ ] Every §3.16 dashboard row maps 1:1 to a `table.cell` call in the v21 source.
703
727
  - [ ] Every §11/§12 item in `design-astroneum.md` is linked from §6 of this doc.
704
- - [ ] Every §5 widget flag matches the config block in `design-astroneum.md` §6.
728
+ - [ ] Every ?5 React prop / chrome hand-off maps to the current demo or library source.
705
729
  - [ ] Every `api-bridged` pointer resolves to a file that exists under `src/app/api/` or `src/lib/`.
706
- - [ ] Every `native-chrome` pointer resolves to a planned file under `src/components/astroneum/` (per `design-astroneum.md` §10).
730
+ - [ ] Every `native-chrome` pointer resolves to a planned or existing file under `demo/src/app/components/` or `src/widget/`.