@orangecharts/wrun-chart-host 0.7.0 → 0.7.1

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 CHANGED
@@ -106,6 +106,7 @@ What each published version holds. A host installs a version with the peers of i
106
106
 
107
107
  | Version | Peers | What changed |
108
108
  | --- | --- | --- |
109
+ | 0.7.1 | `@orangecharts/indicator-kit` 0.88.0, `@orangecharts/orange-v2-pb-common` 12.72.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | A line's template carries its label. The nine types whose style places a label (`textVerticalPosition`) keep `text` in the template lane (`TOOL_TEMPLATE_RULES.label`), never in the default lane, so Save as default still starts a new line blank; an empty label is neither captured nor written (`FieldSpec.label`), so a template saved without one leaves a drawing's label alone. Cut from 0.7.0's tree (web 7f5c0eb8fc) with only the package half of web 21df2c79c7; peers unchanged. Web main's next release is 0.8.0, its peers having moved. |
109
110
  | 0.7.0 | `@orangecharts/indicator-kit` 0.88.0, `@orangecharts/orange-v2-pb-common` 12.72.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The options lanes of OPTIONS-PORT P7: `options_flow` becomes a chain lane, and with `option_prints` and `option_contract_flow` it reads the chart's option chain on a crypto option venue and on a CME futures chart as well as on OPRA; option contract flow plans to one source answer budget every layer reads (`utility/chart/kscript-source-answer-budget.leaf`). The run schedule (`utility/wrun/run-schedule/`, six modules): each lane group is sent at its own plan, held or in-flight reads are reused, and a host's door can dial the chart's gate reader before an add (`warmWrunSheetGateReaders`) or when a surface opens (`warmWrunChartGateReaderOnIntent`). Row lanes ask end-exclusive (`WrunSourceFetchOptions.endExclusive`) and keep held bars over budget markers; panel rows paint with missing readings, and a lane is asked only within its reach (`WrunWarmupEvidence.sourceReachFromTs`, the `source-reach` backfill outcome). Trading-day opens are solved as titan solves them across DST edges, and each zone's offset is read once a day (`utility/chart/ny-calendar.util`). Crypto indices chart as main symbols (`utility/chart/crypto-index.leaf`); the symbol comparison keeps its user label as instance state in the settings templates; a run no longer loads the kit on the main thread (`utility/wrun/wrun-kit-run-tables.util`). Every failed run names its cause: `WRUN_FAILURE_CAUSES` gains eight words (`package-withdrawn`, `package-hosted`, `compile-failed`, `twin-declined` and `integration-error` for what stopped a package before it ran; `source-budget`, `source-failed` and `source-declined` for a source lane the ladder gave up on), a package the registry no longer serves shows "no longer available from its publisher" with Remove and never Retry, and a source chip names the feed and what happened (the words under `wrun.unavailable` and `kscript.legend.card.removeIndicator`, which a host's word table needs). A lane's budget counts from its dispatch until the transport reports the request's wire send (`WrunSourceFetchOptions.onSent`, optional: a transport that never reports keeps the dispatch budget), then from the send, 60 s at most from the dispatch; the ladder never ends a lane while a late read is out, and the record it ends on names its cause and the episode that armed it (a restore, a person's add, a live rebuild). The transient grace holds a failure only for an overlay a rerun driver runs, unless the host declares that it reruns the overlay itself (`holdWrunTransientRefusal(target, onExpire, { hostReruns: true })`, `WrunTransientHoldOptions`; off by default): the mobile app's protected run heal does, so its Marketplace indicators load through an outage instead of showing their chip at once. `onWrunOverlayRunSettled` announces a run of a standing overlay only: a run that settles after its overlay's teardown (typically dropped by the teardown's cancel of its pending row-source ask) is the ring's alone, so a same-id remount no longer reads its predecessor's dropped run as its own first run. OPTLOAD G5: an `options_chain` or `option_contract_state` input may declare chain page views (`page_view`, `page_views`; `utility/wrun/wrun-option-views.util`), which ride the lane's ask as view fields for the host's chain transport to send in one chain summary read; a fold view refuses by name (`wrun_option_view_unread`) and a view param's `"@<param>"` handle is painted like `ticks_per_bar`. On the OPRA plane both lanes hold the plane's chain by coin instead of reading the chain directory (`wrunHeldOpraPlaneChain`). One loader view widens: the module `transport.loadV2Service()` answers gains `warmGateReaderFor(exchange)` and `warmGateReaderOnIntent(exchange, surface)`; the env keeps its 133 members, and no package code reads `transport.loadWrunKit` any more. 11 modules join, all in the entry, and `utility/wrun/wrun-opra-underlying.util` goes with its `WrunOpraUnderlyingContext`: 416 dist modules (406 at 0.6.0), 33 by subpath only. `utility/wrun/sources/opra-option-lanes.util` drops `resolveWrunOpraLaneUnderlying` and `resolveWrunLaneOpraChain`; a lane resolves its chain through `resolveWrunLaneChainChart` and `decideWrunLaneChain`. The kit peer moves from 0.87.0 to 0.88.0 and the protocol enums peer from 12.69.0 to 12.72.0. |
110
111
  | 0.6.0 | `@orangecharts/indicator-kit` 0.87.0, `@orangecharts/orange-v2-pb-common` 12.69.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The shared engine protocol: a module's bytes cross `postMessage` (the mobile app's portability rule) and the engine worker hashes them (`utility/wrun/wrun-sha256.leaf`), checks the sheet's pin, clamps, prepares and compiles them, caching up to 16 compiled modules per worker, so the main thread neither hashes nor compiles. `compileModule` becomes `loadModule`, which answers an opaque `WrunModuleHandle` (key, sha256, ABI, imports as `{ module, name }` pairs; no bytes); every full run and live-start carries the module's key, ABI and bytes (copied, never transferred), and the worker reuses its cached module or compiles the bytes on a miss, so a respawned worker compiles again. A request runs on two 20 s clocks, the start ceiling from the post (queue plus compile) and the run deadline from the worker's `running`; `loadModule` rejects a failed compile as a `WebAssembly.CompileError` with the worker's words and a pin mismatch with the words it had before 0.6.0. The `run` namespace goes with its three loaders (`run.loadOverlayLifecycleDoor`, `run.loadRefusalSurface`, `run.loadSeriesStream`, retired at 0.5.0), `WrunHostRun` and their three loader views in `host-ports.types`: 131 members by the contract's count, 133 with 0.5.0's two optional ones. Peers unchanged. |
111
112
  | 0.5.0 | `@orangecharts/indicator-kit` 0.87.0, `@orangecharts/orange-v2-pb-common` 12.69.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Phase 2: the live session (the live tick, intake, hidden-tab hold, coin lane live channels, series stream), the drivers and the heal ladder (the lifecycle door, `utility/wrun/wrun-overlay-lifecycle.lazy` by subpath, its runtime and the recovery ladders), the prefix runs, the engine (`workers/wrun/wrun-abi-host`, `workers/wrun/wrun-engine-handler`, the browser host), the host facts and the executor (`utility/wrun/wrun-overlay-run.util`, by subpath) with its row sources: 135 modules, 398 in all. The env gains the 84 phase 2 members, the `ui` and `engine` namespaces and the optional `clock.watchHostSuspended` and `chart.commonStore`; the three `run` loaders turn optional (gone at 0.6.0). The panel mount reads a host's planned pane heights on every cell and retranslates an unchanged child in place, keeping a reader's expanded pane through a retire. The entry no longer serves `utility/wrun/wrun-overlay-identity.util` (by subpath; above). The kit peer moves from 0.86.3 to 0.87.0 (`option_multiplier`); the other peers are unchanged. |
@@ -12,6 +12,8 @@ export interface FieldSpec {
12
12
  instance?: boolean;
13
13
  /** An absolute in the market's own units: written only onto the market the template was saved on. */
14
14
  marketBound?: boolean;
15
+ /** A drawing's label (the tool rules' `label`): an empty one is neither captured nor written over the destination's. */
16
+ label?: boolean;
15
17
  /** The serialisable value a capture writes where the engine holds none ("all"), when the field declares one. */
16
18
  unset?: unknown;
17
19
  }
@@ -73,6 +73,7 @@ const RESERVED_INPUT_NAMES = new Set(RESERVED_SCRIPT_INPUT_NAMES);
73
73
  /** Names an object prototype reserves: never a field, whatever a script declares (a write would reach the prototype). */
74
74
  const PROTOTYPE_NAMES = new Set(['__proto__', 'constructor', 'prototype']);
75
75
  const TOOL_INSTANCE_KEYS = TOOL_TEMPLATE_RULES.instanceKeys;
76
+ const LABEL_KEY = TOOL_TEMPLATE_RULES.label.key;
76
77
  const INTERVAL_BOUND_TYPES = new Set(TOOL_TEMPLATE_RULES.intervalBoundTypes);
77
78
  const DEFAULT_EXCLUDED_KEYS = new Set(TOOL_TEMPLATE_RULES.defaultExcludedKeys);
78
79
  const DEFAULT_EXCLUDED_TYPES = new Set(TOOL_TEMPLATE_RULES.defaultExcludedTypes);
@@ -94,6 +95,8 @@ function specOf(key, field) {
94
95
  spec.instance = true;
95
96
  if (field.marketBound)
96
97
  spec.marketBound = true;
98
+ if (field.label)
99
+ spec.label = true;
97
100
  if (field.unset !== undefined)
98
101
  spec.unset = field.unset;
99
102
  return Object.freeze(spec);
@@ -110,9 +113,9 @@ function indicatorSpecs(type) {
110
113
  }
111
114
  /**
112
115
  * A drawing type's fields, from the generated tables: its style (registry defaultStyle and held extras) and "Show on"
113
- * in the template lane, its style minus the geometry and financial inputs in the default lane, and the per-drawing
114
- * instance keys. The FRVP's are its own table (box and profile). A type the registry does not know declares only the
115
- * instance keys: nothing of it is taken from a template.
116
+ * in the template lane, its style minus the geometry and financial inputs in the default lane, a label type's label
117
+ * in the template lane only, and the per-drawing instance keys. The FRVP's are its own table (box and profile). A type
118
+ * the registry does not know declares only the instance keys: nothing of it is taken from a template.
116
119
  */
117
120
  function toolSpecs(type) {
118
121
  if (type === FRVP_TOOL_TYPE)
@@ -120,10 +123,16 @@ function toolSpecs(type) {
120
123
  const style = ownRecord(TOOL_DEFAULT_STYLE, type);
121
124
  const templateKeys = new Set(ownRecord(TOOL_TEMPLATE_KEYS, type) ?? []);
122
125
  const keepsDefaults = !DEFAULT_EXCLUDED_TYPES.has(type);
126
+ const labelled = templateKeys.has(LABEL_KEY);
127
+ const instanceKeys = labelled ? TOOL_INSTANCE_KEYS.filter((key) => key !== LABEL_KEY) : TOOL_INSTANCE_KEYS;
123
128
  const specs = [];
124
129
  for (const key of new Set([...Object.keys(style ?? {}), ...templateKeys])) {
125
- if (key === VISIBLE_INTERVALS_KEY || TOOL_INSTANCE_KEYS.includes(key))
130
+ if (key === VISIBLE_INTERVALS_KEY || instanceKeys.includes(key))
126
131
  continue;
132
+ if (labelled && key === LABEL_KEY) {
133
+ specs.push(specOf(key, { lanes: ['template'], label: true }));
134
+ continue;
135
+ }
127
136
  const lanes = [];
128
137
  if (templateKeys.has(key))
129
138
  lanes.push('template');
@@ -136,7 +145,7 @@ function toolSpecs(type) {
136
145
  else if (templateKeys.has(VISIBLE_INTERVALS_KEY)) {
137
146
  specs.push(specOf(VISIBLE_INTERVALS_KEY, { lanes: ['template'], unset: Object.freeze([]) }));
138
147
  }
139
- for (const key of TOOL_INSTANCE_KEYS)
148
+ for (const key of instanceKeys)
140
149
  specs.push(specOf(key, { lanes: [], instance: true }));
141
150
  return specs;
142
151
  }
@@ -243,6 +252,8 @@ function capturedValue(spec, source) {
243
252
  value = carriedVenueChoice(value);
244
253
  else if (value === null && (isFrvpOwner(spec.owner) || spec.key === VISIBLE_INTERVALS_KEY))
245
254
  value = undefined;
255
+ else if (spec.label && nonEmpty(value) === undefined)
256
+ value = undefined;
246
257
  if (value === undefined)
247
258
  return spec.unset === undefined ? undefined : cloneDeep(spec.unset);
248
259
  return cloneDeep(value);
@@ -293,6 +304,9 @@ function patchedValue(spec, value) {
293
304
  }
294
305
  if (value === undefined || (value === null && isFrvpOwner(spec.owner)))
295
306
  return undefined;
307
+ // A template saved with no label leaves the destination's own.
308
+ if (spec.label)
309
+ return nonEmpty(value);
296
310
  return cloneDeep(value);
297
311
  }
298
312
  /**
@@ -24,6 +24,8 @@ export interface DeclaredField {
24
24
  readonly lanes: readonly ('row' | 'template' | 'default' | 'mirror')[];
25
25
  readonly instance?: true;
26
26
  readonly marketBound?: true;
27
+ /** A drawing's label: an empty one is neither captured nor written over the destination's own. */
28
+ readonly label?: true;
27
29
  /** The value a capture writes where the engine holds none (a serialisable value: "all", never "absent"). */
28
30
  readonly unset?: unknown;
29
31
  }
@@ -14,10 +14,20 @@
14
14
  export declare const TOOL_TEMPLATE_RULES: {
15
15
  /**
16
16
  * Per-drawing state a template never carries and never writes: lock, hide, layer and name are the drawing's own
17
- * (the rule Save as default already followed), and `text` is the drawing's content, not its style (product default,
18
- * TEMPLATES-PLAN decision 6).
17
+ * (the rule Save as default already followed), and `text` is the drawing's content (TEMPLATES-PLAN decision 6), but
18
+ * on a label type a template carries it (`label`).
19
19
  */
20
20
  readonly instanceKeys: readonly ["isLocked", "isHidden", "zPriority", "name", "text"];
21
+ /**
22
+ * A label a template carries: `key` on every type whose registry style places a label on the drawing (holds
23
+ * `placedBy`: the line family and the Rectangle). TradingView parity: a "CALL WALL" template draws its label
24
+ * (decision 6 revised 2026-10-21, ticket #248). It is never style: no seed and no Save as default keeps it, and a
25
+ * template that holds no label leaves the drawing's own. A text tool's text (Text, Note, Callout) stays its content.
26
+ */
27
+ readonly label: {
28
+ readonly key: "text";
29
+ readonly placedBy: "textVerticalPosition";
30
+ };
21
31
  /**
22
32
  * Drawings whose legs or captured bars read wrong on another interval (a GhostFeed's legs, a Bar Pattern's bars, a
23
33
  * fixed Gann Square's per-bar price): each keeps the "Show on" intervals it was drawn with, so a template neither
@@ -14,10 +14,17 @@
14
14
  export const TOOL_TEMPLATE_RULES = {
15
15
  /**
16
16
  * Per-drawing state a template never carries and never writes: lock, hide, layer and name are the drawing's own
17
- * (the rule Save as default already followed), and `text` is the drawing's content, not its style (product default,
18
- * TEMPLATES-PLAN decision 6).
17
+ * (the rule Save as default already followed), and `text` is the drawing's content (TEMPLATES-PLAN decision 6), but
18
+ * on a label type a template carries it (`label`).
19
19
  */
20
20
  instanceKeys: ['isLocked', 'isHidden', 'zPriority', 'name', 'text'],
21
+ /**
22
+ * A label a template carries: `key` on every type whose registry style places a label on the drawing (holds
23
+ * `placedBy`: the line family and the Rectangle). TradingView parity: a "CALL WALL" template draws its label
24
+ * (decision 6 revised 2026-10-21, ticket #248). It is never style: no seed and no Save as default keeps it, and a
25
+ * template that holds no label leaves the drawing's own. A text tool's text (Text, Note, Callout) stays its content.
26
+ */
27
+ label: { key: 'text', placedBy: 'textVerticalPosition' },
21
28
  /**
22
29
  * Drawings whose legs or captured bars read wrong on another interval (a GhostFeed's legs, a Bar Pattern's bars, a
23
30
  * fixed Gann Square's per-bar price): each keeps the "Show on" intervals it was drawn with, so a template neither
@@ -1116,6 +1116,7 @@ export const TOOL_TEMPLATE_KEYS = {
1116
1116
  'textVerticalPosition',
1117
1117
  'fontWeight',
1118
1118
  'fontStyle',
1119
+ 'text',
1119
1120
  'visibleIntervalsMs',
1120
1121
  ],
1121
1122
  FibChannel: [
@@ -1347,6 +1348,7 @@ export const TOOL_TEMPLATE_KEYS = {
1347
1348
  'fontWeight',
1348
1349
  'fontStyle',
1349
1350
  'highlight',
1351
+ 'text',
1350
1352
  'visibleIntervalsMs',
1351
1353
  ],
1352
1354
  HorizontalRay: [
@@ -1360,6 +1362,7 @@ export const TOOL_TEMPLATE_KEYS = {
1360
1362
  'fontWeight',
1361
1363
  'fontStyle',
1362
1364
  'highlight',
1365
+ 'text',
1363
1366
  'visibleIntervalsMs',
1364
1367
  ],
1365
1368
  Icon: ['color', 'visibleIntervalsMs'],
@@ -1383,6 +1386,7 @@ export const TOOL_TEMPLATE_KEYS = {
1383
1386
  'stats',
1384
1387
  'statsPosition',
1385
1388
  'alwaysShowStats',
1389
+ 'text',
1386
1390
  'visibleIntervalsMs',
1387
1391
  ],
1388
1392
  InsidePitchfork: [
@@ -1438,6 +1442,7 @@ export const TOOL_TEMPLATE_KEYS = {
1438
1442
  'fontStyle',
1439
1443
  'fillBackground',
1440
1444
  'middleLine',
1445
+ 'text',
1441
1446
  'visibleIntervalsMs',
1442
1447
  ],
1443
1448
  Path: ['color', 'visibleIntervalsMs'],
@@ -1489,6 +1494,7 @@ export const TOOL_TEMPLATE_KEYS = {
1489
1494
  'textVerticalPosition',
1490
1495
  'fontWeight',
1491
1496
  'fontStyle',
1497
+ 'text',
1492
1498
  'visibleIntervalsMs',
1493
1499
  ],
1494
1500
  Rectangle: [
@@ -1505,6 +1511,7 @@ export const TOOL_TEMPLATE_KEYS = {
1505
1511
  'fontSize',
1506
1512
  'textPosition',
1507
1513
  'textVerticalPosition',
1514
+ 'text',
1508
1515
  'visibleIntervalsMs',
1509
1516
  ],
1510
1517
  RegressionTrend: [
@@ -1623,6 +1630,7 @@ export const TOOL_TEMPLATE_KEYS = {
1623
1630
  'stats',
1624
1631
  'statsPosition',
1625
1632
  'alwaysShowStats',
1633
+ 'text',
1626
1634
  'visibleIntervalsMs',
1627
1635
  ],
1628
1636
  Triangle: [
@@ -1653,6 +1661,7 @@ export const TOOL_TEMPLATE_KEYS = {
1653
1661
  'textVerticalPosition',
1654
1662
  'fontWeight',
1655
1663
  'fontStyle',
1664
+ 'text',
1656
1665
  'visibleIntervalsMs',
1657
1666
  ],
1658
1667
  Whisper: ['color', 'highlight', 'lineWidth', 'visibleIntervalsMs'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangecharts/wrun-chart-host",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "The wrun chart-host layer shared by the kiyotaka web app and the mobile app: the wrun result reader and painter model, cut from the web app (its reference implementation).",
5
5
  "type": "module",
6
6
  "files": [