@orangecharts/wrun-chart-host 0.15.0 → 0.16.0
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.
- package/README.md +1 -0
- package/dist/constants/economic.constants.d.ts +2 -0
- package/dist/constants/economic.constants.js +2 -0
- package/dist/constants/feature-flags.constants.d.ts +10 -0
- package/dist/constants/feature-flags.constants.js +52 -4
- package/dist/constants/feature-limits.constants.d.ts +72 -4
- package/dist/constants/feature-limits.constants.js +98 -20
- package/dist/constants/interval.constants.js +5 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
- package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
- package/dist/constants/typed-width-fold.leaf.js +99 -0
- package/dist/constants/typed-width-source.leaf.d.ts +24 -0
- package/dist/constants/typed-width-source.leaf.js +126 -0
- package/dist/constants/typed-width.leaf.d.ts +57 -0
- package/dist/constants/typed-width.leaf.js +78 -0
- package/dist/host-env.d.ts +10 -0
- package/dist/host-env.js +7 -0
- package/dist/host-ports.types.d.ts +11 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +63 -3
- package/dist/interfaces/wrun-runtime.interface.js +11 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
- package/dist/market-data/billing.interface.d.ts +12 -45
- package/dist/market-data/billing.interface.js +2 -2
- package/dist/replay/replayLadder.js +7 -4
- package/dist/settings-templates/footprint-rows.d.ts +6 -0
- package/dist/settings-templates/footprint-rows.js +6 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/indicator-fields.js +31 -0
- package/dist/settings-templates/tool-tables.generated.js +19 -1
- package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +42 -0
- package/dist/utility/chart/cache-alignment.util.js +88 -18
- package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
- package/dist/utility/chart/calendar-interval.util.js +152 -4
- package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
- package/dist/utility/chart/candle-bar-end.util.js +17 -6
- package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
- package/dist/utility/chart/chart-time-domain.util.js +13 -4
- package/dist/utility/chart/feed-interval.util.d.ts +4 -2
- package/dist/utility/chart/feed-interval.util.js +5 -2
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
- package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
- package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
- package/dist/utility/chart/footprint-display-mode.util.js +5 -0
- package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
- package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
- package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
- package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
- package/dist/utility/chart/history-wall.util.d.ts +13 -2
- package/dist/utility/chart/history-wall.util.js +11 -4
- package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
- package/dist/utility/chart/interval-ladder.util.js +44 -4
- package/dist/utility/chart/interval-registry.util.d.ts +22 -1
- package/dist/utility/chart/interval-registry.util.js +50 -2
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
- package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
- package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
- package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
- package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
- package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
- package/dist/utility/chart/live-bucket.util.d.ts +29 -4
- package/dist/utility/chart/live-bucket.util.js +45 -12
- package/dist/utility/chart/market-session.util.d.ts +62 -10
- package/dist/utility/chart/market-session.util.js +93 -13
- package/dist/utility/chart/marketKind.util.d.ts +1 -7
- package/dist/utility/chart/marketKind.util.js +6 -8
- package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
- package/dist/utility/chart/om-target.util.js +6 -4
- package/dist/utility/chart/price-precision.util.d.ts +20 -6
- package/dist/utility/chart/price-precision.util.js +34 -7
- package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
- package/dist/utility/chart/profile-frame-window.util.js +12 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -1
- package/dist/utility/chart/rth-session.util.js +3 -1
- package/dist/utility/chart/script-source-session.util.d.ts +43 -0
- package/dist/utility/chart/script-source-session.util.js +61 -0
- package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
- package/dist/utility/chart/typed-width-grid.util.js +203 -0
- package/dist/utility/common/transformations.util.d.ts +6 -0
- package/dist/utility/common/transformations.util.js +28 -4
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +22 -4
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
- package/dist/utility/v2/v2-enums.leaf.js +3 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +65 -17
- package/dist/utility/wrun/wrun-canvases.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-canvases.util.js +7 -12
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-card-style.util.js +2 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
- package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
- package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
- package/dist/utility/wrun/wrun-frames.d.ts +1 -1
- package/dist/utility/wrun/wrun-frames.js +2 -2
- package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-handles.util.js +1 -1
- package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
- package/dist/utility/wrun/wrun-host.service.js +44 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
- package/dist/utility/wrun/wrun-live-tick.util.js +59 -4
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +3 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +274 -47
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-panel-mount.util.js +42 -13
- package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-refusal.util.js +102 -13
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
- package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
- package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
- package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
- package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
- package/dist/utility/wrun/wrun-style-words.util.js +46 -15
- package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
- package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
- package/dist/utility/wrun-display-name.util.d.ts +10 -0
- package/dist/utility/wrun-display-name.util.js +21 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
- package/dist/utils/replay/replay-buffer-math.js +2 -0
- package/dist/workers/constants/socket-slots.d.ts +1 -1
- package/dist/workers/utils/time.worker.util.js +2 -2
- package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
- package/dist/workers/utils/volume-profile.worker.util.js +20 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
- package/dist/workers/wrun/wrun-abi-host.js +82 -5
- package/dist/workers/wrun/wrun-engine-handler.js +53 -4
- package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
- package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -128,6 +128,7 @@ What each published version holds. A host installs a version with the peers of i
|
|
|
128
128
|
|
|
129
129
|
| Version | Peers | What changed |
|
|
130
130
|
| --- | --- | --- |
|
|
131
|
+
| 0.16.0 | `@orangecharts/indicator-kit` 0.119.0, `@orangecharts/orange-v2-pb-common` 12.84.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The peers web's /v3 step 3 moved to: the protocol enums peer from 12.82.0 to 12.84.0 and the kit peer from 0.116.1 (what npm's 0.15.0 declares) to 0.119.0. The package commits landed since 0.15.0 ride along (`git log 3bfefce876.. -- packages/wrun-chart-host` in the web repo). |
|
|
131
132
|
| 0.12.0 | `@orangecharts/indicator-kit` 0.107.0, `@orangecharts/orange-v2-pb-common` 12.80.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Contract F on `options_flow`: an input's `underlying` (`"auto"`, `"derived"`, a root in capitals or `"@<param>"`) reads that root's flow under scopes `ticker` and `prints` (`WRUN_UNDERLYING_CLASSES` gains `options_flow`). `utility/wrun/derived-roots.util` holds the planner step both planners call (`planWrunLaneUnderlying`, `WrunLaneUnderlyingPlan`, where the row lanes kept their own copy); `planWrunPollLanes` plans a root's input against the root's market and names the market in the instance's extras (`WRUN_POLL_LANE_UNDERLYING_FIELD`, `underlyingMarket`), so an `"auto"` input and a root's input are two instances, and an `"auto"` input's key is unchanged. The flow lane resolves one chart per run and market (a root's input never reads the chart's chain) and refuses a root beside a scope that spans underlyings by `wrun_option_knob_invalid` in om's words (`utility/wrun/wrun-options-flow-underlying.leaf`, a new module off the boot path: `WRUN_OPTIONS_FLOW_UNDERLYING_SCOPES`, `wrunOptionsFlowUnderlyingScopeTakes`), as `wrunUnderlyingKnob` does before any market. The knob's grammar (`wrunUnderlyingKnobOf`, `wrunUnderlyingSettingName`) moves to `utility/wrun/derived-roots.leaf`, re-exported by `derived-roots.util`, and the painted sheet writes a setting's pick into `underlying` (`laneWordWrites`, through `wrun-color-settings.util` `wrunSelectPickWord`, the read `resolveWrunUnderlyingSettingKnob` shares); availability (`wrunInputRequirements`) still judges every options read on the chart's own chain. `planWrunLaneUnderlying`, `wrunUnderlyingRootOf`, `wrunUnderlyingUnresolvedError` and `resolveWrunUnderlyingMarket` take the planner's fills last (optional, a celled input's `["empty"]` by default; `resolveWrunUnderlyingMarket` keeps `chartChain` fourth), so a refusal names the fill the input may declare. `wrunMetadataSourceCount` keys `options_flow` by its `underlying` too, and another root's print sums ride no print read's slot. The kit peer moves from 0.105.0 to 0.106.5 and the protocol enums peer from 12.78.0 to 12.79.0. The package commits landed since 0.11.0 ride along (`git log 099b00cf4f.. -- packages/wrun-chart-host` in the web repo). |
|
|
132
133
|
| 0.11.0 | `@orangecharts/indicator-kit` 0.105.0, `@orangecharts/orange-v2-pb-common` 12.78.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | D-DEDUPE phase 1b, the book folds on `options_chain`: an input's `page_view` / `page_views` may name the data plane's folds of the chain page's whole book (`numbers`, `vol_term`, `smile`, `surface`, `strike_profile`; kit scaffold 105), the numbers the built-in options panes draw. `utility/wrun/wrun-option-views.util` copies the kit's book tables, pinned to it (`WRUN_OPTION_BOOK_VIEWS`, `WRUN_OPTION_BOOK_VIEW_ROW_WIDTHS`, `WRUN_OPTION_BOOK_EXPIRIES_TAKES`, `WRUN_OPTION_BOOK_SCOPE_TAKES`, and `WRUN_OPTION_BOOK_SHARED_KNOBS`, the knobs a view of the block shares with a book fold) and rules (`wrunOptionViewWordsRowWidth`, `wrunOptionViewRowWidthsOf`, `wrunOptionViewsReadBlock`, `wrunOptionBookViewIssue`); the answer's half, `utility/wrun/wrun-option-book-rows.util` (`WRUN_OPTION_BOOK_LAYOUTS`, `WRUN_OPTION_BOOK_LAYOUT_WIDTHS`, `WRUN_OPTION_BOOK_STAMP_VERSION`, `wrunOptionBookViewRows`, `wrunOptionIsBookLayout`), loads with a host's chain transport alone, out of what the chart parses before its first candle; `wrunOptionViewSpec` answers a book word's spec, `WrunOptionKnobSpec` takes `zero` (a book fold's part turned off) and `WrunOptionView.view` widens to `WrunOptionPageViewWord`. A book fold plans (`wrunOptionViewsOfSource` judges its knobs by the kit's rules, `wrun_option_knob_invalid`; `wrunOptionViewUnread` still refuses the folds of the block, which read the chart's close), and its ask carries each view's declared params alone: `wrunOptionViewLaneFields` and `wrunOptionViewAskFieldsOf` drop the expiries word and the max-contracts size from an ask of book folds alone, and keep them for a mixed ask's views of the block. The input's block is the view block at the widest of its words (`wrunOptionInputTupleWidth`, `wrunOptionLaneTupleWidth`: 11, 12, 13 or 16 values a row). `wrunOptionViewsUnion` refuses by name one lane's inputs that read a book fold and different views (`wrun_option_book_views_one_ask`: the lane asks their union once, and a book row names no input) and a union of more than 16 views (`wrun_option_views_too_many`, the data plane's most). A host's chain transport lays an answer's book entries out with `wrunOptionBookViewRows` (one book stamp row, then each fold's rows; its refusals by name) and asks a book fold at no bar (web: the `k-options-chain` worker, keyed as the built-in panes and the Options panel head key the same folds, one read for all). The kit peer moves from 0.103.1 to 0.105.0. The package commits landed since 0.10.0 ride along (`git log 357b44995c.. -- packages/wrun-chart-host` in the web repo). |
|
|
133
134
|
| 0.10.0 | `@orangecharts/indicator-kit` 0.103.1, `@orangecharts/orange-v2-pb-common` 12.78.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | OPRA on the package side: stock perps and tokenized stocks read their stock's OPRA chain (`derived-roots.util`, `sources/opra-option-lanes.util`, `wrun-chart-gate-reader.util`); the OPRA plane's user-script decision (`kscript-venue-policy.util` `isOpraUserScriptRun`, the `opra-user-scripts` flag, `opra-user-scripts-gate.util`, `opra-read-access.leaf`, `wrun-opra-lane.util`); the OPRA registration path is gone (the gate registers delayed access itself on the first refusal, a refused read ends as the gated `opra-registration` outcome); the OPRA agreement notice shows once per app open; the chart's OPRA reader is dialled at chart load. `FeatureFlag` gains `Opra`, `OpraUserScripts` and `OpraAlerts`. Options: CME option reads group on the gateway's session and regular-hours anchors and name the chain's venue at every grouping call, and weekend rows of CME products that trade around the clock stay; the strike kit's gamma curve row; strike velocity wire decode; Options GEX levels in the chart's ink; the Options Heatmap's nodes look, dealer-flow metrics and first-paint reads (crypto, CME, OPRA); Skylit-parity node levels, boards and flow score; one numbers convention across the options panes; the heatmap's crypto arm can read the server strike rows (internal switch). wrun runs: every byte a run downloads is counted and reported on the attempt, an over-budget indicator reads its newest bars first and stops near 1 MB, one download budget per add, a folded read is bounded by its share; Big Trades floors CME charts in contracts and sizes in dollars or the market's own unit, and judges the size floor per aggressor order behind one switch; a row lane draws its newest sessions first; a colour member's `when` gate reaches its swatch and a row's `when` gate reads one clause over another row's value; house look and dismissal for HUD cards and panels; the order-flow family is refused on option contract charts; a gate reader that stops delivering is re-asked. Tools: Path line width and style, tool tables regenerated from chart-schema 0.5.2. The kit peer moves from 0.91.1 to 0.103.1 and the protocol enums peer from 12.73.0 (what npm's 0.9.0 declares; the 0.9.0 row says 12.72.0) to 12.78.0. The package commits landed since 0.9.0 ride along (`git log a840defa10.. -- packages/wrun-chart-host` in the web repo). |
|
|
@@ -22,6 +22,8 @@ export declare const ECONOMICS_EXCHANGE = "ECONOMICS";
|
|
|
22
22
|
export declare const ECONOMIC_PUBLISHER_EXCHANGES: readonly string[];
|
|
23
23
|
/** Every exchange code that resolves to the `'economic'` market kind. */
|
|
24
24
|
export declare const ECONOMIC_EXCHANGES: readonly string[];
|
|
25
|
+
/** `Exchange` members that publish macro series and list no market: no market read asks them as a venue. */
|
|
26
|
+
export declare const PUBLISHER_ONLY_EXCHANGES: ReadonlySet<string>;
|
|
25
27
|
/** Market-search wire types that answer with economic series rows (C12). */
|
|
26
28
|
export declare const ECONOMIC_SEARCH_TYPES: readonly string[];
|
|
27
29
|
/** Economic series are observed at most once a day: the interval floor, in ms. */
|
|
@@ -38,6 +38,8 @@ export const ECONOMIC_PUBLISHER_EXCHANGES = [
|
|
|
38
38
|
];
|
|
39
39
|
/** Every exchange code that resolves to the `'economic'` market kind. */
|
|
40
40
|
export const ECONOMIC_EXCHANGES = [FRED_EXCHANGE, ...ECONOMIC_PUBLISHER_EXCHANGES];
|
|
41
|
+
/** `Exchange` members that publish macro series and list no market: no market read asks them as a venue. */
|
|
42
|
+
export const PUBLISHER_ONLY_EXCHANGES = new Set([FRED_EXCHANGE, 'CFTC']);
|
|
41
43
|
/** Market-search wire types that answer with economic series rows (C12). */
|
|
42
44
|
export const ECONOMIC_SEARCH_TYPES = ['FRED_OBSERVATION', 'OBSERVATION'];
|
|
43
45
|
/** Economic series are observed at most once a day: the interval floor, in ms. */
|
|
@@ -14,6 +14,8 @@ export declare const FeatureFlag: {
|
|
|
14
14
|
readonly FuturesNinjaTrader: "futures-ninjatrader";
|
|
15
15
|
readonly FuturesNinjaTraderData: "futures-ninjatrader-data";
|
|
16
16
|
readonly CoinbaseDerivativesExecution: "coinbase-derivatives-execution";
|
|
17
|
+
readonly BrokerVenueLaneRithmic: "broker-venue-lane-rithmic";
|
|
18
|
+
readonly BrokerVenueLaneNinjaTrader: "broker-venue-lane-ninjatrader";
|
|
17
19
|
readonly PolymarketExecution: "polymarket-execution";
|
|
18
20
|
readonly TradingHub: "trading-hub";
|
|
19
21
|
readonly TradingVolume: "trading-volume";
|
|
@@ -42,6 +44,9 @@ export declare const FeatureFlag: {
|
|
|
42
44
|
readonly OptionsPanel: "options-panel";
|
|
43
45
|
readonly OpraUserScripts: "opra-user-scripts";
|
|
44
46
|
readonly CmeUserScripts: "cme-user-scripts";
|
|
47
|
+
readonly CmeLanes: "cme-lanes";
|
|
48
|
+
readonly OpraLanes: "opra-lanes";
|
|
49
|
+
readonly StocksLanes: "stocks-lanes";
|
|
45
50
|
readonly PlusUsdcAutopay: "plus-usdc-autopay";
|
|
46
51
|
readonly EmsHyperliquid: "ems-hyperliquid";
|
|
47
52
|
readonly AgentsSurface: "agents-surface";
|
|
@@ -60,6 +65,11 @@ export declare const FeatureFlag: {
|
|
|
60
65
|
readonly WrunDownloadBudgetCut: "wrun-download-budget-cut";
|
|
61
66
|
readonly WrunConvergingPrefix: "wrun-converging-prefix";
|
|
62
67
|
readonly ScreenshotLegacyCapture: "screenshot-legacy-capture";
|
|
68
|
+
readonly DrawingAlertOneClick: "drawing-alert-one-click";
|
|
69
|
+
readonly DrawingsUnderCandles: "drawings-under-candles";
|
|
70
|
+
readonly TypedIntervalWidths: "typed-interval-widths";
|
|
71
|
+
readonly DrawToTrade: "draw-to-trade";
|
|
72
|
+
readonly PaneSides: "pane-sides";
|
|
63
73
|
};
|
|
64
74
|
export type FeatureFlagKey = (typeof FeatureFlag)[keyof typeof FeatureFlag];
|
|
65
75
|
export declare const FEATURE_FLAG_KEYS: FeatureFlagKey[];
|
|
@@ -87,6 +87,13 @@ export const FeatureFlag = {
|
|
|
87
87
|
// `{"coinbase-derivatives-execution": true}`). Mint it enabled to open it up. A key this browser
|
|
88
88
|
// already holds keeps trading, and keeps its card to manage it.
|
|
89
89
|
CoinbaseDerivativesExecution: 'coinbase-derivatives-execution',
|
|
90
|
+
// The host-served broker venues' dark keys (trading-core 0.3.0, `rithmic` and `ninjatrader` in the venue
|
|
91
|
+
// registry): each venue descriptor states its key, read through `isOn` by `isCexVenueFlagOn`, so unminted,
|
|
92
|
+
// absent and guest all read off and no venue surface offers a broker yet. On, the broker trades through the
|
|
93
|
+
// shared venue surfaces (TRADING-UNIFY plan D13); the futures lane keeps riding `futures-trading` until then.
|
|
94
|
+
// The same string values as the package's `FeatureFlag` leaf, which the venue flag mirror hands to `isOn`.
|
|
95
|
+
BrokerVenueLaneRithmic: 'broker-venue-lane-rithmic',
|
|
96
|
+
BrokerVenueLaneNinjaTrader: 'broker-venue-lane-ninjatrader',
|
|
90
97
|
// Polymarket execution (docs/features/polymarket-execution/README.md): the prediction-market venue, a
|
|
91
98
|
// lane of its own beside the exchange seam. Its own key, read through `isOn` by
|
|
92
99
|
// `isPolymarketExecutionOn`: unminted, absent and guest all read off, so production ships it dark; the
|
|
@@ -289,20 +296,31 @@ export const FeatureFlag = {
|
|
|
289
296
|
// one decision; a chain wall reads `mayReadCmeChain`), and only for a viewer the CME plane serves (signed in, not
|
|
290
297
|
// a guest, the CME data terms not blocked; delayed and real-time both count, the tier is the gate's). Both facts
|
|
291
298
|
// reach the worker-safe venue policy through cme-user-scripts-gate.util (closed in a worker, for a guest and before
|
|
292
|
-
// a reader is handed over).
|
|
293
|
-
//
|
|
299
|
+
// a reader is handed over). Refused whatever it says while `cme-lanes` is dark (reversed 2026-11-11 behind it):
|
|
300
|
+
// hosted (Cloud) runs, protected scripts, indicator alerts, strategies and backtests. Refused always: a CME
|
|
301
|
+
// chain read from a chart off CME, the
|
|
294
302
|
// export of a study's results (console copies, clips), agent reads (chart_read and the MCP withhold the stamped
|
|
295
303
|
// study) and the publish cover's capture of a chart that carries CME data. A move of the flag, the account, the
|
|
296
304
|
// terms, the served access or the session stops a running study in place and keeps its source and settings. To be
|
|
297
305
|
// minted dark (admin panel); read with `isOn` (absent, unloaded and guest read off) and never read server-side:
|
|
298
|
-
//
|
|
306
|
+
// the server lanes judge a user run's CME reads on their own. QA:
|
|
299
307
|
// `localStorage.setItem('kiyo.flag-overrides', '{"cme-user-scripts":true}')`.
|
|
300
308
|
CmeUserScripts: 'cme-user-scripts',
|
|
309
|
+
// The governed-lanes cutover, one flag per licensed plane (governed-lanes-gate.util holds the one reader;
|
|
310
|
+
// kscript-venue-policy.util, the one decider). While a plane's flag is lit, that plane opens to the server
|
|
311
|
+
// lanes as well as the browser: hosted (Cloud) runs, protected scripts, strategy testing and every alert kind. While
|
|
312
|
+
// it is dark (the default), the plane reads exactly as it did before the cutover. Each plane keeps its own decision
|
|
313
|
+
// under a lit flag: CME still needs the `cme-user-scripts` gate (the flag, sign-in, the CME data terms) on every
|
|
314
|
+
// lane. To be minted dark (admin panel); read with `isOn` (absent, unloaded and guest read off), never forced on in
|
|
315
|
+
// dev. QA: `localStorage.setItem('kiyo.flag-overrides', '{"cme-lanes":true}')`.
|
|
316
|
+
CmeLanes: 'cme-lanes',
|
|
317
|
+
OpraLanes: 'opra-lanes',
|
|
318
|
+
StocksLanes: 'stocks-lanes',
|
|
301
319
|
// Kiyo Plus billed in USDC on Solana, auto-renewing (plan: PLUS-USDC-AUTOPAY-PLAN.md).
|
|
302
320
|
// Gates every surface of the lane: the third method button on /plus, the on-chain
|
|
303
321
|
// subscribe dialog, the on-chain billing card, and the USDC purchase mode in the
|
|
304
322
|
// upgrade dialog. Shipped dark; the orange routes answer 503 until their own
|
|
305
|
-
//
|
|
323
|
+
// payments.kiyoPlusOnchainEnabled flips, so a lit flag alone sells nothing. Flag off =
|
|
306
324
|
// the page is byte-identical in behaviour (pinned by a structural spec).
|
|
307
325
|
PlusUsdcAutopay: 'plus-usdc-autopay',
|
|
308
326
|
// The Hyperliquid EMS algo surfaces (Algo TWAP/VWAP in the ticket, the Algos tab, the signer
|
|
@@ -419,6 +437,36 @@ export const FeatureFlag = {
|
|
|
419
437
|
// through the legacy html2canvas path (a clone of the whole page, seconds of frozen page). Unminted and absent read
|
|
420
438
|
// off, so production takes the in-place engine; mint it ON only to roll the engine back without a deploy.
|
|
421
439
|
ScreenshotLegacyCapture: 'screenshot-legacy-capture',
|
|
440
|
+
// One-click alerts on drawings (docs/features/alerts/alert-targets.md, "One click"): the quick bar's labelled
|
|
441
|
+
// Alert pill arms at once with an Undo toast, its on state opens the Once / Every time / Turn off menu, the
|
|
442
|
+
// right-click row, the ink chip and Alt+A arm the same way, and the engine decor bridge runs. Off: the bell
|
|
443
|
+
// icon opens the alert dialog as before. Read through `isOn` (useDrawingAlertOneClickFlag): unminted, absent
|
|
444
|
+
// and guest read off, so production ships it dark; `kiyo.flag-overrides` -> `{"drawing-alert-one-click": true}`.
|
|
445
|
+
DrawingAlertOneClick: 'drawing-alert-one-click',
|
|
446
|
+
// Send behind candles / Bring in front of candles (docs/features/object-tree/persistence-and-undo.md): the row of
|
|
447
|
+
// the right-click Order submenu, the quick bar's "..." menu and the Objects row menu, and the action they share
|
|
448
|
+
// (drawing-selection-actions setDrawingsUnderCandles). Off: no row and no write; a drawing already saved under the
|
|
449
|
+
// candles still paints there (the engine reads `settings.underCandles`). Read through `isOn`
|
|
450
|
+
// (useDrawingsUnderCandlesFlag): unminted, absent and guest read off, so production ships it dark;
|
|
451
|
+
// `kiyo.flag-overrides` -> `{"drawings-under-candles": true}`.
|
|
452
|
+
DrawingsUnderCandles: 'drawings-under-candles',
|
|
453
|
+
// Typed candle widths (docs/features/chart/custom-intervals.md): a width off the ladder that divides a UTC day
|
|
454
|
+
// (`20m`, `90m`, typed-width.leaf), asked as CUSTOM plus `barSeconds`. Read through `isOn` (typedWidthsFlagOn) and
|
|
455
|
+
// mirrored to the data worker (typed-width-reads.util): unminted, absent and guest read off, so production ships it
|
|
456
|
+
// dark and a saved typed width is held on the rung at or below; `kiyo.flag-overrides` ->
|
|
457
|
+
// `{"typed-interval-widths": true}`.
|
|
458
|
+
TypedIntervalWidths: 'typed-interval-widths',
|
|
459
|
+
// Draw to trade (docs/features/hyperliquid/ticket.md, "Draw to trade"): the trade ticket's Draw button (one stroke on
|
|
460
|
+
// the chart fills side, take profit and stop loss, sized by Risk), the Position drawing's "Send to trade panel" on
|
|
461
|
+
// the quick bar and Super Search's "Draw a trade". Off: none of them shows. Read through `isOn`:
|
|
462
|
+
// unminted, absent and guest read off, so production ships it dark; `kiyo.flag-overrides` ->
|
|
463
|
+
// `{"draw-to-trade": true}`.
|
|
464
|
+
DrawToTrade: 'draw-to-trade',
|
|
465
|
+
// Pane on any side (PANES-ANY-SIDE-PLAN.md): an indicator's pane on the chart, left, right, top or bottom. Every
|
|
466
|
+
// surface reads ONE predicate, this key AND the built-in engine's `paneSides` capability
|
|
467
|
+
// (pane-sides-engine.util paneSidesActive). Read through `isOn`: unminted, absent and guest read off, so production
|
|
468
|
+
// ships it dark; `kiyo.flag-overrides` -> `{"pane-sides": true}`. A saved place survives with the key off.
|
|
469
|
+
PaneSides: 'pane-sides',
|
|
422
470
|
};
|
|
423
471
|
export const FEATURE_FLAG_KEYS = Object.values(FeatureFlag);
|
|
424
472
|
/**
|
|
@@ -5,8 +5,34 @@
|
|
|
5
5
|
* feature: add one row. To change a number: edit one value. Types enforce
|
|
6
6
|
* that every row has a value for every tier.
|
|
7
7
|
*/
|
|
8
|
-
export declare const TIERS: readonly ["free", "plus"];
|
|
8
|
+
export declare const TIERS: readonly ["free", "plus", "ultimate"];
|
|
9
9
|
export type Tier = (typeof TIERS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* THE raw plan name reader: the server's plan name (`plus_1m`, `plus_1y`, `ultimate_1m`, `ultimate_1y`, `free`,
|
|
12
|
+
* null, a quoted claim) collapsed to a Tier. `ultimate` or `ultimate_*` is tested before the plus test; every name
|
|
13
|
+
* it does not know is free, as before. Pure.
|
|
14
|
+
*/
|
|
15
|
+
export declare function tierOfPlanName(raw: unknown): Tier;
|
|
16
|
+
/** The plan a staff or partner role bypass gates as (the top plan). */
|
|
17
|
+
export declare const ROLE_BYPASS_TIER: Tier;
|
|
18
|
+
/** A paid plan is any plan that is not free (plus or ultimate). Pure. */
|
|
19
|
+
export declare function isPaidTier(tier: Tier): boolean;
|
|
20
|
+
/** The plan one rank up (free to plus, plus to ultimate), or null on the top plan. For "what the next plan gives". Pure. */
|
|
21
|
+
export declare function nextTierUp(tier: Tier): Tier | null;
|
|
22
|
+
/**
|
|
23
|
+
* The plan an upgrade prompt may offer from `tier` WITHOUT the price list, or null when it cannot know: free
|
|
24
|
+
* always gets Plus. Plus answers null because Ultimate is offered only while the price list sells it, and the
|
|
25
|
+
* start-up code cannot read that list; a Plus holder's prompt goes through the lazy decider
|
|
26
|
+
* (`utility/plan/ultimate-offer.lazy.ts`), which reads it. An Ultimate holder is never offered anything. Pure.
|
|
27
|
+
*/
|
|
28
|
+
export declare function upgradeOfferTier(tier: Tier): Tier | null;
|
|
29
|
+
/**
|
|
30
|
+
* The cheap start-up test before a Plus holder's prompt loads the lazy decider: the count limit `key` is higher
|
|
31
|
+
* one plan up from `tier`, and a prompt may say so. Not the full rule (the decider also asks whether the higher
|
|
32
|
+
* plan is on sale and whether its number waits on server capacity); it only keeps the decider's chunk from loading
|
|
33
|
+
* for a limit that is not higher one plan up. Pure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function countLimitRisesOneUp(key: CountFeatureKey, tier: Tier): boolean;
|
|
10
36
|
export declare const GATEWAY_TIER_MAX_BARS: Record<Tier, {
|
|
11
37
|
default: number;
|
|
12
38
|
intervals: Partial<Record<string, number>>;
|
|
@@ -19,74 +45,97 @@ export declare const FEATURE_LIMITS: {
|
|
|
19
45
|
readonly workspaces: {
|
|
20
46
|
readonly free: 10;
|
|
21
47
|
readonly plus: 50;
|
|
48
|
+
readonly ultimate: 500;
|
|
22
49
|
};
|
|
23
50
|
readonly indicatorsPerChart: {
|
|
24
51
|
readonly free: 3;
|
|
25
52
|
readonly plus: 10;
|
|
53
|
+
readonly ultimate: 40;
|
|
26
54
|
};
|
|
27
55
|
readonly privateKScripts: {
|
|
28
56
|
readonly free: 100;
|
|
29
57
|
readonly plus: 500;
|
|
58
|
+
readonly ultimate: 5000;
|
|
30
59
|
};
|
|
31
60
|
readonly multicharts: {
|
|
32
61
|
readonly free: 1;
|
|
33
62
|
readonly plus: 16;
|
|
63
|
+
readonly ultimate: 16;
|
|
34
64
|
};
|
|
35
65
|
readonly priceAlerts: {
|
|
36
66
|
readonly free: 200;
|
|
37
67
|
readonly plus: 500;
|
|
68
|
+
readonly ultimate: 2000;
|
|
38
69
|
};
|
|
39
70
|
readonly indicatorAlerts: {
|
|
40
71
|
readonly free: 5;
|
|
41
72
|
readonly plus: 50;
|
|
73
|
+
readonly ultimate: 500;
|
|
42
74
|
};
|
|
43
75
|
readonly widgetsPerLayout: {
|
|
44
76
|
readonly free: 3;
|
|
45
77
|
readonly plus: 10;
|
|
78
|
+
readonly ultimate: 40;
|
|
46
79
|
};
|
|
47
80
|
readonly publishedLayouts: {
|
|
48
81
|
readonly free: 10;
|
|
49
82
|
readonly plus: 50;
|
|
83
|
+
readonly ultimate: 50;
|
|
50
84
|
};
|
|
51
85
|
readonly replayReachBars: {
|
|
52
86
|
readonly free: number;
|
|
53
87
|
readonly plus: number;
|
|
88
|
+
readonly ultimate: number;
|
|
54
89
|
};
|
|
55
90
|
readonly heatmap4K: {
|
|
56
91
|
readonly free: true;
|
|
57
92
|
readonly plus: true;
|
|
93
|
+
readonly ultimate: true;
|
|
58
94
|
};
|
|
59
95
|
readonly fullOrderbookDepth: {
|
|
60
96
|
readonly free: false;
|
|
61
97
|
readonly plus: true;
|
|
98
|
+
readonly ultimate: true;
|
|
62
99
|
};
|
|
63
100
|
readonly oneSecondInterval: {
|
|
64
101
|
readonly free: false;
|
|
65
102
|
readonly plus: true;
|
|
103
|
+
readonly ultimate: true;
|
|
104
|
+
};
|
|
105
|
+
readonly typedIntervalWidths: {
|
|
106
|
+
readonly free: false;
|
|
107
|
+
readonly plus: true;
|
|
108
|
+
readonly ultimate: true;
|
|
66
109
|
};
|
|
67
110
|
readonly marketReplay: {
|
|
68
111
|
readonly free: true;
|
|
69
112
|
readonly plus: true;
|
|
113
|
+
readonly ultimate: true;
|
|
70
114
|
};
|
|
71
115
|
readonly replayBookLayers: {
|
|
72
116
|
readonly free: true;
|
|
73
117
|
readonly plus: true;
|
|
118
|
+
readonly ultimate: true;
|
|
74
119
|
};
|
|
75
120
|
readonly topCallersMyList: {
|
|
76
121
|
readonly free: false;
|
|
77
122
|
readonly plus: true;
|
|
123
|
+
readonly ultimate: true;
|
|
78
124
|
};
|
|
79
125
|
readonly hyperliquidAddress: {
|
|
80
126
|
readonly free: false;
|
|
81
127
|
readonly plus: true;
|
|
128
|
+
readonly ultimate: true;
|
|
82
129
|
};
|
|
83
130
|
readonly paneMerge: {
|
|
84
131
|
readonly free: true;
|
|
85
132
|
readonly plus: true;
|
|
133
|
+
readonly ultimate: true;
|
|
86
134
|
};
|
|
87
135
|
readonly cmeL3OrderFlow: {
|
|
88
136
|
readonly free: false;
|
|
89
137
|
readonly plus: true;
|
|
138
|
+
readonly ultimate: true;
|
|
90
139
|
};
|
|
91
140
|
};
|
|
92
141
|
type FeatureKey = keyof typeof FEATURE_LIMITS;
|
|
@@ -100,10 +149,20 @@ export type BinaryFeatureKey = {
|
|
|
100
149
|
}[FeatureKey];
|
|
101
150
|
/**
|
|
102
151
|
* What the data-indicator budget spans: one chart (`indicatorsPerChart` per
|
|
103
|
-
* chart
|
|
104
|
-
*
|
|
152
|
+
* chart: Plus and Ultimate) or the whole layout (ONE shared budget of the plan's
|
|
153
|
+
* `indicatorsPerChart` slots across every chart of the layout: Free under free
|
|
154
|
+
* tier v2).
|
|
105
155
|
*/
|
|
106
156
|
export type IndicatorBudgetScope = 'chart' | 'layout';
|
|
157
|
+
/**
|
|
158
|
+
* Two budgets: the most data-indicator slots a whole workspace holds on a plan that counts per chart. Ultimate
|
|
159
|
+
* counts 40 on each chart, as Plus counts 10, and no more than 80 across every chart of the workspace. Plus runs
|
|
160
|
+
* at most 60 at once (10 on each of the six charts of the largest layout that keeps a full budget), so the total
|
|
161
|
+
* stays above what any Plus workspace runs, and a wide layout cannot stack 40 on every chart. The app alone holds
|
|
162
|
+
* this total (the add gate and the load-time clamp); the servers judge a paid plan per chart. A plan without a row
|
|
163
|
+
* has no total.
|
|
164
|
+
*/
|
|
165
|
+
export declare const INDICATOR_WORKSPACE_CAP: Partial<Record<Tier, number>>;
|
|
107
166
|
/**
|
|
108
167
|
* Free rows that change under free tier v2 (`isFreeTierV2On()`; Plus rows never change).
|
|
109
168
|
* 16 = MAX_PANE_GRID_PANES, the largest grid (4x4). The free data budget keeps
|
|
@@ -117,8 +176,17 @@ export declare const FREE_TIER_V2_FREE_LIMITS: {
|
|
|
117
176
|
* overlay applied to the free tier while the flag is on. Pure.
|
|
118
177
|
*/
|
|
119
178
|
export declare function resolveCountLimit(key: CountFeatureKey, tier: Tier, freeTierV2: boolean): number;
|
|
120
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* THE scope decider over the GATING tier (role bypass = ultimate): Free's budget is ONE shared across every chart
|
|
181
|
+
* of the workspace while free tier v2 is on; a paid plan (Plus, Ultimate) counts per chart. Pure.
|
|
182
|
+
*/
|
|
121
183
|
export declare function indicatorBudgetScopeFor(gatingTier: Tier, freeTierV2: boolean): IndicatorBudgetScope;
|
|
184
|
+
/**
|
|
185
|
+
* THE workspace total read over the GATING tier: the second budget of a plan that counts per chart
|
|
186
|
+
* (INDICATOR_WORKSPACE_CAP), or null when the plan has none. A shared budget is its own total, so layout scope
|
|
187
|
+
* answers null. Pure.
|
|
188
|
+
*/
|
|
189
|
+
export declare function indicatorWorkspaceCapFor(gatingTier: Tier, freeTierV2: boolean): number | null;
|
|
122
190
|
/**
|
|
123
191
|
* English display labels for gated features, kept beside FEATURE_LIMITS so a
|
|
124
192
|
* new feature key forces a label in the same change (Record types enforce it).
|
|
@@ -6,7 +6,55 @@
|
|
|
6
6
|
* that every row has a value for every tier.
|
|
7
7
|
*/
|
|
8
8
|
import { MAX_PANE_GRID_PANES } from './pane-grid.constants.js';
|
|
9
|
-
|
|
9
|
+
// Ordered low to high (free < plus < ultimate): index order is plan rank.
|
|
10
|
+
export const TIERS = ['free', 'plus', 'ultimate'];
|
|
11
|
+
/**
|
|
12
|
+
* THE raw plan name reader: the server's plan name (`plus_1m`, `plus_1y`, `ultimate_1m`, `ultimate_1y`, `free`,
|
|
13
|
+
* null, a quoted claim) collapsed to a Tier. `ultimate` or `ultimate_*` is tested before the plus test; every name
|
|
14
|
+
* it does not know is free, as before. Pure.
|
|
15
|
+
*/
|
|
16
|
+
export function tierOfPlanName(raw) {
|
|
17
|
+
const name = typeof raw === 'string' ? raw.replace(/^"|"$/g, '') : '';
|
|
18
|
+
if (name === 'ultimate' || name.startsWith('ultimate_'))
|
|
19
|
+
return 'ultimate';
|
|
20
|
+
return name.startsWith('plus') ? 'plus' : 'free';
|
|
21
|
+
}
|
|
22
|
+
/** The plan a staff or partner role bypass gates as (the top plan). */
|
|
23
|
+
export const ROLE_BYPASS_TIER = 'ultimate';
|
|
24
|
+
/** A paid plan is any plan that is not free (plus or ultimate). Pure. */
|
|
25
|
+
export function isPaidTier(tier) {
|
|
26
|
+
return tier !== 'free';
|
|
27
|
+
}
|
|
28
|
+
/** The plan one rank up (free to plus, plus to ultimate), or null on the top plan. For "what the next plan gives". Pure. */
|
|
29
|
+
export function nextTierUp(tier) {
|
|
30
|
+
return TIERS[TIERS.indexOf(tier) + 1] ?? null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The plan an upgrade prompt may offer from `tier` WITHOUT the price list, or null when it cannot know: free
|
|
34
|
+
* always gets Plus. Plus answers null because Ultimate is offered only while the price list sells it, and the
|
|
35
|
+
* start-up code cannot read that list; a Plus holder's prompt goes through the lazy decider
|
|
36
|
+
* (`utility/plan/ultimate-offer.lazy.ts`), which reads it. An Ultimate holder is never offered anything. Pure.
|
|
37
|
+
*/
|
|
38
|
+
export function upgradeOfferTier(tier) {
|
|
39
|
+
return tier === 'free' ? 'plus' : null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The cheap start-up test before a Plus holder's prompt loads the lazy decider: the count limit `key` is higher
|
|
43
|
+
* one plan up from `tier`, and a prompt may say so. Not the full rule (the decider also asks whether the higher
|
|
44
|
+
* plan is on sale and whether its number waits on server capacity); it only keeps the decider's chunk from loading
|
|
45
|
+
* for a limit that is not higher one plan up. Pure.
|
|
46
|
+
*/
|
|
47
|
+
export function countLimitRisesOneUp(key, tier) {
|
|
48
|
+
const up = nextTierUp(tier);
|
|
49
|
+
if (up === null)
|
|
50
|
+
return false;
|
|
51
|
+
// A paid holder's indicator wall is Make room's (a full chart opens it). Make room carries the offer itself (a Plus
|
|
52
|
+
// holder's quiet "Run it with Ultimate" row, while Ultimate is on sale), so no second prompt offers the next plan
|
|
53
|
+
// for indicators (docs/features/billing/upgrade-prompts.md).
|
|
54
|
+
if (key === 'indicatorsPerChart' && isPaidTier(tier))
|
|
55
|
+
return false;
|
|
56
|
+
return FEATURE_LIMITS[key][up] > FEATURE_LIMITS[key][tier];
|
|
57
|
+
}
|
|
10
58
|
/**
|
|
11
59
|
* Mirror of the TSDB gateway's per-tier reach wall
|
|
12
60
|
* (tsdb-gateway `charts/tsdb-gateway-read/values.ore.yaml`,
|
|
@@ -31,9 +79,11 @@ const PLUS_GATEWAY_MAX_BARS = {
|
|
|
31
79
|
};
|
|
32
80
|
// Free shares the Plus reach since tsdb-gateway cee00f2 ("read: give the free
|
|
33
81
|
// tier Plus bar limits", 2026-09-29): history depth is no longer a plan feature.
|
|
82
|
+
// Ultimate shares the Plus reach too.
|
|
34
83
|
export const GATEWAY_TIER_MAX_BARS = {
|
|
35
84
|
free: PLUS_GATEWAY_MAX_BARS,
|
|
36
85
|
plus: PLUS_GATEWAY_MAX_BARS,
|
|
86
|
+
ultimate: PLUS_GATEWAY_MAX_BARS,
|
|
37
87
|
};
|
|
38
88
|
/** The tier's gateway reach in bars at the interval actually sent (a GATEWAY_TIER_MAX_BARS read). Pure. */
|
|
39
89
|
export function gatewayTierMaxBars(tier, requestInterval) {
|
|
@@ -42,13 +92,16 @@ export function gatewayTierMaxBars(tier, requestInterval) {
|
|
|
42
92
|
}
|
|
43
93
|
export const FEATURE_LIMITS = {
|
|
44
94
|
// Count-based (soft-block at creation)
|
|
45
|
-
workspaces: { free: 10, plus: 50 },
|
|
46
|
-
|
|
95
|
+
workspaces: { free: 10, plus: 50, ultimate: 500 },
|
|
96
|
+
// The data-indicator budget. `indicatorBudgetScopeFor` says what a number spans: a paid plan's is per chart (Plus
|
|
97
|
+
// 10, Ultimate 40); Free's 3 is one total for the whole workspace under free tier v2. Ultimate carries a second
|
|
98
|
+
// budget on top, INDICATOR_WORKSPACE_CAP. orange-v2-backend, collab-service and the phone app hold this row too.
|
|
99
|
+
indicatorsPerChart: { free: 3, plus: 10, ultimate: 40 },
|
|
47
100
|
// Mirrors the orange-v2-backend gateway quota (src/utility/feature-gate.ts
|
|
48
101
|
// FEATURE_LIMITS.privateKScripts); change both together or the UI gate and
|
|
49
102
|
// the server 403 disagree.
|
|
50
|
-
privateKScripts: { free: 100, plus: 500 },
|
|
51
|
-
multicharts: { free: 1, plus: 16 },
|
|
103
|
+
privateKScripts: { free: 100, plus: 500, ultimate: 5000 },
|
|
104
|
+
multicharts: { free: 1, plus: 16, ultimate: 16 },
|
|
52
105
|
// TWO independent alert quotas, one per kind (alert-kind.util.ts is the
|
|
53
106
|
// rule): price alerts are the native raw-level series alerts (price, open
|
|
54
107
|
// interest, funding, liquidations and the other native templates, no user
|
|
@@ -58,37 +111,39 @@ export const FEATURE_LIMITS = {
|
|
|
58
111
|
// and tharamine-user-service's agent-lane tier table
|
|
59
112
|
// (src/controllers/api-v2/kscript-alert.controller.ts): change all three
|
|
60
113
|
// together or the UI gate and the server 403 disagree.
|
|
61
|
-
priceAlerts: { free: 200, plus: 500 },
|
|
62
|
-
indicatorAlerts: { free: 5, plus: 50 },
|
|
63
|
-
widgetsPerLayout: { free: 3, plus: 10 },
|
|
64
|
-
publishedLayouts: { free: 10, plus: 50 },
|
|
114
|
+
priceAlerts: { free: 200, plus: 500, ultimate: 2000 },
|
|
115
|
+
indicatorAlerts: { free: 5, plus: 50, ultimate: 500 },
|
|
116
|
+
widgetsPerLayout: { free: 3, plus: 10, ultimate: 40 },
|
|
117
|
+
publishedLayouts: { free: 10, plus: 50, ultimate: 50 },
|
|
65
118
|
// Domain clamps (limit access without counting created resources)
|
|
66
|
-
replayReachBars: { free: Infinity, plus: Infinity },
|
|
119
|
+
replayReachBars: { free: Infinity, plus: Infinity, ultimate: Infinity },
|
|
67
120
|
// Binary (hide / disable)
|
|
68
121
|
// 4K heatmaps are open to free since 2026-10-01 at the free row count
|
|
69
122
|
// (getOptimalMaxDepth), so free 4K loads no more rows than free HD. Depth
|
|
70
123
|
// is what stays Plus (fullOrderbookDepth). orange mirrors this row for the
|
|
71
124
|
// workspace create gate.
|
|
72
|
-
heatmap4K: { free: true, plus: true },
|
|
73
|
-
fullOrderbookDepth: { free: false, plus: true },
|
|
125
|
+
heatmap4K: { free: true, plus: true, ultimate: true },
|
|
126
|
+
fullOrderbookDepth: { free: false, plus: true, ultimate: true },
|
|
74
127
|
// Seconds rungs (1s 5s 15s 30s), tape mode and the replay tick lane are open
|
|
75
128
|
// to free since 2026-10-08 everywhere but CME: the crypto plane serves free
|
|
76
129
|
// tokens the per-second book (tsdb-gateway 16a17f1), the CME plane still
|
|
77
130
|
// refuses it. So this row gates CME markets only (isTierGatedSecondsInterval);
|
|
78
131
|
// orange mirrors it for workspace create.
|
|
79
|
-
oneSecondInterval: { free: false, plus: true },
|
|
132
|
+
oneSecondInterval: { free: false, plus: true, ultimate: true },
|
|
133
|
+
// Typed candle widths (typed-width.leaf, `20m`, `90m`): the gateway serves CUSTOM to paid tokens only.
|
|
134
|
+
typedIntervalWidths: { free: false, plus: true, ultimate: true },
|
|
80
135
|
// Market replay is open to free since 2026-09-29 (entry, reach and book
|
|
81
136
|
// layers, gated in useChartReplay.enter and the replay plan gate). The tick
|
|
82
137
|
// lane rides oneSecondInterval, so it is Plus on CME only.
|
|
83
|
-
marketReplay: { free: true, plus: true },
|
|
84
|
-
replayBookLayers: { free: true, plus: true },
|
|
85
|
-
topCallersMyList: { free: false, plus: true },
|
|
86
|
-
hyperliquidAddress: { free: false, plus: true },
|
|
138
|
+
marketReplay: { free: true, plus: true, ultimate: true },
|
|
139
|
+
replayBookLayers: { free: true, plus: true, ultimate: true },
|
|
140
|
+
topCallersMyList: { free: false, plus: true, ultimate: true },
|
|
141
|
+
hyperliquidAddress: { free: false, plus: true, ultimate: true },
|
|
87
142
|
// Pane merge (shared off-chart panes + stacked member axes) is open to every
|
|
88
143
|
// plan since 2026-11-03 (it was never meant to be Plus). The row still feeds
|
|
89
144
|
// the engine-side acceptance gate (settings.paneMergeEnabled), the merge
|
|
90
145
|
// click and the scale menu, so all three answer from here.
|
|
91
|
-
paneMerge: { free: true, plus: true },
|
|
146
|
+
paneMerge: { free: true, plus: true, ultimate: true },
|
|
92
147
|
// CME L3 order flow (Orders column, strong levels, detector events, MBO
|
|
93
148
|
// Blocks, chart level badges) is Plus-only. The surfaces gate on
|
|
94
149
|
// isL3Entitled(), which is hasFeature('cmeL3OrderFlow') → THIS row, behind
|
|
@@ -96,9 +151,18 @@ export const FEATURE_LIMITS = {
|
|
|
96
151
|
// rule itself lives in OPA's roles.rego, which the data plane evaluates
|
|
97
152
|
// from the signed claims. This row also names the feature for the shared
|
|
98
153
|
// upgrade dialog the L3 plus-gate dialog's CTA hands off to.
|
|
99
|
-
cmeL3OrderFlow: { free: false, plus: true },
|
|
154
|
+
cmeL3OrderFlow: { free: false, plus: true, ultimate: true },
|
|
100
155
|
};
|
|
101
156
|
export const DOMAIN_FEATURE_KEYS = ['replayReachBars'];
|
|
157
|
+
/**
|
|
158
|
+
* Two budgets: the most data-indicator slots a whole workspace holds on a plan that counts per chart. Ultimate
|
|
159
|
+
* counts 40 on each chart, as Plus counts 10, and no more than 80 across every chart of the workspace. Plus runs
|
|
160
|
+
* at most 60 at once (10 on each of the six charts of the largest layout that keeps a full budget), so the total
|
|
161
|
+
* stays above what any Plus workspace runs, and a wide layout cannot stack 40 on every chart. The app alone holds
|
|
162
|
+
* this total (the add gate and the load-time clamp); the servers judge a paid plan per chart. A plan without a row
|
|
163
|
+
* has no total.
|
|
164
|
+
*/
|
|
165
|
+
export const INDICATOR_WORKSPACE_CAP = { ultimate: 80 };
|
|
102
166
|
/**
|
|
103
167
|
* Free rows that change under free tier v2 (`isFreeTierV2On()`; Plus rows never change).
|
|
104
168
|
* 16 = MAX_PANE_GRID_PANES, the largest grid (4x4). The free data budget keeps
|
|
@@ -119,10 +183,23 @@ export function resolveCountLimit(key, tier, freeTierV2) {
|
|
|
119
183
|
}
|
|
120
184
|
return FEATURE_LIMITS[key][tier];
|
|
121
185
|
}
|
|
122
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* THE scope decider over the GATING tier (role bypass = ultimate): Free's budget is ONE shared across every chart
|
|
188
|
+
* of the workspace while free tier v2 is on; a paid plan (Plus, Ultimate) counts per chart. Pure.
|
|
189
|
+
*/
|
|
123
190
|
export function indicatorBudgetScopeFor(gatingTier, freeTierV2) {
|
|
124
191
|
return freeTierV2 && gatingTier === 'free' ? 'layout' : 'chart';
|
|
125
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* THE workspace total read over the GATING tier: the second budget of a plan that counts per chart
|
|
195
|
+
* (INDICATOR_WORKSPACE_CAP), or null when the plan has none. A shared budget is its own total, so layout scope
|
|
196
|
+
* answers null. Pure.
|
|
197
|
+
*/
|
|
198
|
+
export function indicatorWorkspaceCapFor(gatingTier, freeTierV2) {
|
|
199
|
+
if (indicatorBudgetScopeFor(gatingTier, freeTierV2) !== 'chart')
|
|
200
|
+
return null;
|
|
201
|
+
return INDICATOR_WORKSPACE_CAP[gatingTier] ?? null;
|
|
202
|
+
}
|
|
126
203
|
/**
|
|
127
204
|
* English display labels for gated features, kept beside FEATURE_LIMITS so a
|
|
128
205
|
* new feature key forces a label in the same change (Record types enforce it).
|
|
@@ -147,6 +224,7 @@ export const BINARY_FEATURE_LABELS = {
|
|
|
147
224
|
heatmap4K: '4K Heatmap',
|
|
148
225
|
fullOrderbookDepth: 'Full Orderbook Depth',
|
|
149
226
|
oneSecondInterval: '1-Second Interval',
|
|
227
|
+
typedIntervalWidths: 'Typed Interval Widths',
|
|
150
228
|
marketReplay: 'Market Replay',
|
|
151
229
|
replayBookLayers: 'Book Replay',
|
|
152
230
|
topCallersMyList: 'Top Callers (My List)',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TYPED_WIDTH_SECONDS } from './typed-width.leaf.js';
|
|
1
2
|
export const Intervals = {
|
|
2
3
|
SECOND: 1000,
|
|
3
4
|
SECOND5: 5000,
|
|
@@ -85,6 +86,10 @@ export const Intervals = {
|
|
|
85
86
|
'3M': 7889400000, // 3 months (avg 91.3125 days) = 3 * 2629800000
|
|
86
87
|
'6M': 15778800000, // 6 months (avg 182.625 days) = 6 * 2629800000
|
|
87
88
|
'1Y': 31557600000, // 1 year (avg 365.25 days) = 12 * 2629800000
|
|
89
|
+
// Typed widths, read from typed-width.leaf (4m and 3h keep their place above): no ladder rung of their own, at
|
|
90
|
+
// most 20 stored candles a bar. 4w comes after the legacy 28-day '1mm', so a first-match scan of this table
|
|
91
|
+
// answers '1mm' for 28 days: read a length back through intervalLabelForMs instead.
|
|
92
|
+
...Object.fromEntries(Object.entries(TYPED_WIDTH_SECONDS).map(([label, seconds]) => [label, seconds * 1000])),
|
|
88
93
|
},
|
|
89
94
|
INTERVAL_ORDER: ['1s', '1m', '5m', '15m', '30m', '1h', '4h', '1d', '1w', '1M', '3M', '1Y'],
|
|
90
95
|
};
|
|
@@ -13,3 +13,15 @@ export interface IndicatorIntervalRestrictions {
|
|
|
13
13
|
export declare const ALLOWED_1S_INDICATORS: readonly string[];
|
|
14
14
|
export declare const KSCRIPT_DATA_INTERVAL_RESTRICTIONS: Readonly<IndicatorIntervalRestrictions>;
|
|
15
15
|
export declare const ROLLED_INTERVAL_RESTRICTED_KSCRIPT_DATA: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The indicator types a typed-width chart (typed-width.leaf) may fetch that the boot path itself names: the three
|
|
18
|
+
* computed in the browser from the chart's candles (VWAP's seed is a plain K_OHLCV candle read; a script's sources are
|
|
19
|
+
* each judged on their own, TYPED_WIDTH_ALLOWED_KSCRIPT_DATA), so their cached preview can paint before the rest of
|
|
20
|
+
* the app loads. Every other allowed type, and the cap on the widths that fold volume-profile rows, lives in the
|
|
21
|
+
* app's utility/chart/typed-width-indicator-rules.util, which loads with the indicator fetch pipeline: typed widths
|
|
22
|
+
* are opt-in, so their lists stay off the boot path. A type neither names is restricted;
|
|
23
|
+
* tests/utility/chart/typed-width-indicators.spec.ts names the restricted side and fails until a new indicator type
|
|
24
|
+
* is decided.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TYPED_WIDTH_BOOT_INDICATORS: readonly string[];
|
|
27
|
+
export declare const TYPED_WIDTH_ALLOWED_KSCRIPT_DATA: readonly string[];
|
|
@@ -38,3 +38,17 @@ export const KSCRIPT_DATA_INTERVAL_RESTRICTIONS = {
|
|
|
38
38
|
// The kScript data twin rides the same ETF_PREMIUM_RATE_AGG request as the native indicator, which the gateway
|
|
39
39
|
// refuses at every rolled preset (indicator.constants.ts `ROLLED_INTERVAL_RESTRICTED_INDICATORS`).
|
|
40
40
|
export const ROLLED_INTERVAL_RESTRICTED_KSCRIPT_DATA = ['ETF_PREMIUM_RATE'];
|
|
41
|
+
/**
|
|
42
|
+
* The indicator types a typed-width chart (typed-width.leaf) may fetch that the boot path itself names: the three
|
|
43
|
+
* computed in the browser from the chart's candles (VWAP's seed is a plain K_OHLCV candle read; a script's sources are
|
|
44
|
+
* each judged on their own, TYPED_WIDTH_ALLOWED_KSCRIPT_DATA), so their cached preview can paint before the rest of
|
|
45
|
+
* the app loads. Every other allowed type, and the cap on the widths that fold volume-profile rows, lives in the
|
|
46
|
+
* app's utility/chart/typed-width-indicator-rules.util, which loads with the indicator fetch pipeline: typed widths
|
|
47
|
+
* are opt-in, so their lists stay off the boot path. A type neither names is restricted;
|
|
48
|
+
* tests/utility/chart/typed-width-indicators.spec.ts names the restricted side and fails until a new indicator type
|
|
49
|
+
* is decided.
|
|
50
|
+
*/
|
|
51
|
+
export const TYPED_WIDTH_BOOT_INDICATORS = ['VWAP', 'MA_RIBBON', 'TECHNICAL_SCRIPT'];
|
|
52
|
+
// The kScript and wrun data sources a typed-width chart may read: K_OHLCV is a plain candle read (its prediction
|
|
53
|
+
// gapfill never meets a typed width, which no prediction venue serves). Every other source is restricted.
|
|
54
|
+
export const TYPED_WIDTH_ALLOWED_KSCRIPT_DATA = ['OHLCV'];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** The coarsest stored candle size (seconds) that divides `seconds`; NaN when none does. */
|
|
2
|
+
export declare function storedBarSecondsDividing(seconds: number): number;
|
|
3
|
+
/**
|
|
4
|
+
* The stored interval label a typed width is built from: 4m to 18m '1m'; 20m, 40m and 80m '5m'; 90m '15m'; 3h '1h';
|
|
5
|
+
* the day widths '1d'; the week widths '1w'. Undefined for any other label.
|
|
6
|
+
*/
|
|
7
|
+
export declare function storedDivisorLabel(label: unknown): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* The stored size (seconds) a typed width reads volume-profile rows at, or undefined when the label is not a typed
|
|
10
|
+
* width or the cap refuses it (`isTypedWidthProfileFoldAllowed`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function typedWidthProfileSourceSeconds(label: unknown): number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The row interval (ms) a per-candle profile read asks for on a chart of `chartMs`: a typed width's stored size, and
|
|
15
|
+
* any other length unchanged. It maps every typed width, capped or not: the indicator verdict decides whether the read
|
|
16
|
+
* happens at all.
|
|
17
|
+
*/
|
|
18
|
+
export declare function profileRowMsForChart(chartMs: number): number;
|
|
19
|
+
/** True when a chart bar of `lengthMs` is a typed width (the footprint workers hold the chart length, not its label). */
|
|
20
|
+
export declare function isTypedWidthLengthMs(lengthMs: number): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The closed end of a typed read, in ms: the end of a window that closed before the server's now. The gateway's range
|
|
23
|
+
* includes its end (`bucket <= to`), so a closed window ending at T brings back the stored row AT T. On a typed width
|
|
24
|
+
* that row opens the NEXT typed bar, and the fold would turn it into a bar stamped T holding 1 of its k rows (a short
|
|
25
|
+
* sum, the first value instead of the last, the mean of one row). The next (newer) window starts at T and owns that bar
|
|
26
|
+
* whole, so the bar is dropped (`keepBarsBeforeClosedEnd`).
|
|
27
|
+
*
|
|
28
|
+
* `tf` is the chart's interval: a label (the line workers' `payload.tf`) or the bar length in ms (the footprint
|
|
29
|
+
* workers' `chartTfMs`). Both forms go through the one rule below.
|
|
30
|
+
*
|
|
31
|
+
* Undefined (nothing to drop) for:
|
|
32
|
+
* - an interval that is not a typed width, so regular intervals keep every row the wire sends;
|
|
33
|
+
* - a floating window (`fromSec` 0, the gateway's "latest period"), whose end moves with the server clock;
|
|
34
|
+
* - a window with no end (`periodSec` undefined);
|
|
35
|
+
* - a window that reaches the server's now (end at or after `nowSec`), which keeps its forming bar.
|
|
36
|
+
*
|
|
37
|
+
* `fromSec` and `periodSec` are the window as asked; flooring the start (`typedWindowSec`) does not move the end, so
|
|
38
|
+
* either the floored or the unfloored window gives the same answer. `nowSec` is the server's now (`serverNowMs()` in the
|
|
39
|
+
* caller), passed in so this helper stays pure.
|
|
40
|
+
*/
|
|
41
|
+
export declare function typedClosedEndMs(fromSec: number, periodSec: number | undefined, tf: string | number, nowSec: number): number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The folded bars that start before a closed end (`typedClosedEndMs`), in the bars' own unit (`unit`, default
|
|
44
|
+
* `'ms'`; `closedEndMs` is always in ms). A bar's time is its first element unless `timeOf` reads it. With no closed end
|
|
45
|
+
* (a regular label, a floating window, a window that reaches now) it returns the SAME array, untouched.
|
|
46
|
+
*
|
|
47
|
+
* Apply it where the folded rows are final for the request: after the fold, and before anything that reads one bar to
|
|
48
|
+
* shape the next (`transformData`, a forward-fill, a resident merge) or posts the rows.
|
|
49
|
+
*/
|
|
50
|
+
export declare function keepBarsBeforeClosedEnd<T>(bars: T[], closedEndMs: number | undefined, unit?: 's' | 'ms', timeOf?: (bar: T) => number): T[];
|