@vnejs/docs 0.2.81 → 0.2.82

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
@@ -32,21 +32,21 @@ The package has two scenario entries. Compare them and pick one. Both link to `p
32
32
 
33
33
  ## Monorepo map
34
34
 
35
- | Directory | Role |
36
- | --------------------------------------------------- | ------------------------------------------ |
37
- | [`packages/`](./architecture/packages.md) | Runtime: `registry`, `observer`, `core`, … |
38
- | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
- | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
- | [`contracts/`](./architecture/contracts.md) | Public plugin API |
41
- | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
- | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
- | [`bridge/`](./architecture/bridge.md) | Link between plugins |
44
- | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
- | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
- | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
- | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
- | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
- | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
- | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
35
+ | Directory | Role |
36
+ | -------------------------------------------------- | ------------------------------------------ |
37
+ | [`packages/`](./architecture/packages.md) | Runtime: `registry`, `observer`, `core`, … |
38
+ | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
+ | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
+ | [`contracts/`](./architecture/contracts.md) | Public API of plugins and bridge |
41
+ | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
+ | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
+ | [`bridge/`](./architecture/bridge.md) | Link between plugins |
44
+ | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
+ | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
+ | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
+ | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
+ | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
+ | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
+ | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
51
51
 
52
52
  A game imports one `bundles/` package and gets `VneCore`, the engine entry. That bundle lists the matching `@vnejs/shared.*` package in `dependencies`. Menu factories still come from `@vnejs/shared.*` in the game script.
@@ -4,10 +4,11 @@
4
4
 
5
5
  - One module. It extends `ModuleCore`. The class lives in `src/modules/`. `src/index.ts` only imports and calls `regPlugin`.
6
6
  - In **`subscribe`** it listens to A and emits B.
7
- - **`regPlugin`** with an empty shape. The namespace is `BRIDGE_PLUGIN_{PLUGIN_NAME_1}_PLUGIN_{PLUGIN_NAME_2}`. There is no package in `contracts/` for the bridge.
8
- - It depends only on **contracts** from `contracts/`, not on implementations in `plugins/`.
7
+ - A contract in `contracts/bridge/` mirrors this package. `PLUGIN_NAME` is the namespace `BRIDGE_PLUGIN_{PLUGIN_NAME_1}_PLUGIN_{PLUGIN_NAME_2}`.
8
+ - **`regPlugin`** takes the shape from that contract. The shape is empty when the bridge adds no constants, events, params, or settings. When it owns some, it passes those fields. The choose↔qte bridge passes `constants` and extends `ChooseOption` with `qte`.
9
+ - It depends on its contract and on the contracts of the plugins it links. It does not import implementations from `plugins/`.
9
10
 
10
- Naming: `@vnejs/bridge.plugins.{package-1}.plugins.{package-2}` → path `bridge/plugins.{package-1}/plugins.{package-2}/`. The two segments are the real plugin package names, without the `@vnejs/` scope.
11
+ Naming: `@vnejs/bridge.plugins.{package-1}.plugins.{package-2}` → path `bridge/plugins.{package-1}/plugins.{package-2}/`. The contract is `@vnejs/contracts.bridge.plugins.{package-1}.plugins.{package-2}` at `contracts/bridge/plugins.{package-1}/plugins.{package-2}/`. The two segments are the real plugin package names, without the `@vnejs/` scope.
11
12
 
12
13
  ```mermaid
13
14
  flowchart LR
@@ -17,6 +18,7 @@ flowchart LR
17
18
  OBS --> PB[plugins/ B]
18
19
 
19
20
  PA -.->|"does not import"| PB
21
+ BR --> CT[contracts/bridge]
20
22
  BR --> CTA[contracts/ A]
21
23
  BR --> CTB[contracts/ B]
22
24
  ```
@@ -1,11 +1,11 @@
1
1
  # contracts/
2
2
 
3
- A **contract** is the public API of one plugin. It is a **specification**, not behavior.
3
+ A **contract** is the public API of one plugin or one bridge. It is a **specification**, not behavior.
4
4
 
5
5
  ### What a contract holds
6
6
 
7
7
  - **`PLUGIN_NAME`** — the namespace in the `VNE` registry.
8
- - **`CONSTANTS`**, **`SUBSCRIBE_EVENTS`**, **`PARAMS`**, **`SETTINGS_KEYS`**.
8
+ - **`CONSTANTS`**, **`SUBSCRIBE_EVENTS`**, **`PARAMS`**, **`SETTINGS_KEYS`** — when that package owns them.
9
9
  - **Types** — event payloads, the shape of global state, shared fields.
10
10
 
11
11
  ### TypeScript augmentation
@@ -18,13 +18,15 @@ A contract extends types through `declare module`:
18
18
 
19
19
  ### Principles
20
20
 
21
- - One contract usually matches **one plugin** in `plugins/` (1:1).
22
- - A contract **does not import** an implementation from `plugins/`.
23
- - The folder layout of `contracts/` mirrors the `plugins/` taxonomy.
21
+ - One contract matches **one plugin** in `plugins/` or **one bridge** in `bridge/` (1:1).
22
+ - A contract **does not import** an implementation from `plugins/` or `bridge/`.
23
+ - Plugin contracts mirror the `plugins/` taxonomy (`contracts/text/text/` for `plugins/text/text/`).
24
+ - Bridge contracts live under `contracts/bridge/` and mirror the `bridge/` path.
24
25
 
25
26
  ```mermaid
26
27
  flowchart LR
27
28
  CT[contracts/] -->|"declare module"| TS[VNE / Module types]
28
- CT -->|"CONSTANTS, EVENTS, PARAMS"| REG[regPlugin when plugins/ load]
29
+ CT -->|"CONSTANTS, EVENTS, PARAMS"| REG[regPlugin when plugins/ or bridge/ load]
29
30
  PL[plugins/] -->|"import"| CT
31
+ BR[bridge/] -->|"import"| CT
30
32
  ```
@@ -25,19 +25,19 @@ flowchart TD
25
25
 
26
26
  **Dependency direction:**
27
27
 
28
- | From | To | Meaning |
29
- | ---------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
30
- | `games/` | `bundles/`, `cli/`, `shared/` | Build goes through `cli/`. The game script imports `shared/` factories. The game `package.json` does not list them |
31
- | `games/` | `backends/` | HTTP to the token and label workers. No package import |
32
- | `bundles/` | `plugins/`, `bridge/` | The plugin set |
33
- | `bundles/` | `shared/` | The bundle lists `@vnejs/shared.*` in `dependencies` when it includes that plugin. The bundle does not re-export factories |
34
- | `shared/` | `contracts/` | Setup factories read events, not implementations |
35
- | `plugins/` | `contracts/` | The implementation follows the declared API |
36
- | `plugins/` | `modules_extensions/` → `packages/` | Modules extend bases. Bases rest on registry and observer |
37
- | `bridge/` | `contracts/` (2+) | A link by events. No import of implementations |
38
- | `plugins/` | `helpers/`, `uis/` | Shared utils and UI |
39
- | `plugins/` | — another `plugins/` | **No direct dependency** |
40
- | `configs/` | workspace packages | Shared tsconfig. Not runtime |
28
+ | From | To | Meaning |
29
+ | ---------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
30
+ | `games/` | `bundles/`, `cli/`, `shared/` | Build goes through `cli/`. The game script imports `shared/` factories. The game `package.json` does not list them |
31
+ | `games/` | `backends/` | HTTP to the token and label workers. No package import |
32
+ | `bundles/` | `plugins/`, `bridge/` | The plugin set |
33
+ | `bundles/` | `shared/` | The bundle lists `@vnejs/shared.*` in `dependencies` when it includes that plugin. The bundle does not re-export factories |
34
+ | `shared/` | `contracts/` | Setup factories read events, not implementations |
35
+ | `plugins/` | `contracts/` | The implementation follows the declared API |
36
+ | `plugins/` | `modules_extensions/` → `packages/` | Modules extend bases. Bases rest on registry and observer |
37
+ | `bridge/` | `contracts/` | Its contract in `contracts/bridge/`, plus the plugin contracts it links. No import of implementations |
38
+ | `plugins/` | `helpers/`, `uis/` | Shared utils and UI |
39
+ | `plugins/` | — another `plugins/` | **No direct dependency** |
40
+ | `configs/` | workspace packages | Shared tsconfig. Not runtime |
41
41
 
42
42
  ## Summary
43
43
 
@@ -46,7 +46,7 @@ flowchart TD
46
46
  | **`packages/`** | Registry, bus, VneCore |
47
47
  | **`modules_extensions/`** | Base classes for modules |
48
48
  | **`configs/`** | Shared tsconfig |
49
- | **`contracts/`** | Plugin API: events and types |
49
+ | **`contracts/`** | Plugin and bridge API |
50
50
  | **`shared/`** | Plugin setup presets |
51
51
  | **`plugins/`** | Behavior on the bus |
52
52
  | **`bridge/`** | Opt-in link between two plugins |
@@ -37,6 +37,7 @@ flowchart LR
37
37
  ```
38
38
  plugins/core/system/ → @vnejs/plugins.core.system
39
39
  contracts/text/text/ → @vnejs/contracts.text
40
+ contracts/bridge/plugins.text/plugins.scenario.autoread/ → @vnejs/contracts.bridge.plugins.text.plugins.scenario.autoread
40
41
  shared/views.screens/gamemenu/ → @vnejs/shared.views.screens.gamemenu
41
42
  bridge/plugins.text/plugins.scenario.autoread/ → @vnejs/bridge.plugins.text.plugins.scenario.autoread
42
43
  ```
@@ -0,0 +1,4 @@
1
+ # 0.2.82
2
+
3
+ - `contracts/bridge/plugins.scenario.choose/plugins.scenario.qte` — public contract `@vnejs/contracts.bridge.plugins.scenario.choose.plugins.scenario.qte` for the choose↔qte bridge. API: `PLUGIN_NAME` `BRIDGE_PLUGIN_CHOOSE_PLUGIN_QTE`, `CONSTANTS.LOGS_ACTIONS.MISSING` (`"missing"`), `CONSTANTS.LOGS_ACTIONS.MISSING_FALLBACK` (`"missing_fallback"`). `ChooseOption.qte` is declared on `@vnejs/contracts.scenario.choose`. The bridge `regPlugin` passes these `constants`.
4
+ - `contracts/bridge/` — every other bridge has a contract `@vnejs/contracts.` plus the bridge package name without `@vnejs/`. Each contract exports `PLUGIN_NAME` only. The bridge imports that name. `regPlugin` still passes an empty shape. Names: `BRIDGE_PLUGIN_LAY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XT_INJECT_PLUGIN_VARS_COUNTERS`, `BRIDGE_PLUGIN_TEXT_INJECT_PLUGIN_VARS_FLAGS`, `BRIDGE_PLUGIN_TEXT_SMOOTH_PLUGIN_FASTFORWARD`, `BRIDGE_PLUGIN_TIME_PLUGIN_DATE`, `BRIDGE_PLUGIN_CHOOSE_VIEW_PLUGIN_INTERFACE`, `BRIDGE_PLUGIN_CHOOSE_VIEW_PLUGIN_INTERFACE_FASTFORWARD_VIEW`, `BRIDGE_PLUGIN_INTERFACE_PLUGIN_TEXT`, `BRIDGE_PLUGIN_INTERFACE_PLUGIN_TEXT_SMOOTH`, `BRIDGE_PLUGIN_INTERFACE_PLUGIN_TEXT_WALL`, `BRIDGE_PLUGIN_POINT_AND_CLICK_VIEW_PLUGIN_INTERFACE`, `BRIDGE_PLUGIN_QTE_VIEW_PLUGIN_INTERFACE`.
@@ -2,6 +2,7 @@
2
2
 
3
3
  Engine and public API changes. One file per `@vnejs/docs` release. Newest first.
4
4
 
5
+ - [0.2.82](./0.2.82.md)
5
6
  - [0.2.81](./0.2.81.md)
6
7
  - [0.2.80](./0.2.80.md)
7
8
  - [0.2.79](./0.2.79.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/docs",
3
- "version": "0.2.81",
3
+ "version": "0.2.82",
4
4
  "description": "VNEJS documentation for engine consumers and coding agents",
5
5
  "files": [
6
6
  "*.md",
@@ -19,10 +19,10 @@ Handler payloads and results are typed through module augmentation of the contra
19
19
 
20
20
  ## Constants
21
21
 
22
- | Key | Meaning |
23
- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
22
+ | Key | Meaning |
23
+ | ---------------------------- | ------------------------------------------------------------------------------------------- |
24
24
  | `LINE_KEYWORDS.QTE_FALLBACK` | `"qte-fallback"`: keyword on `% choose.option` for QTE fail branch (via choose↔qte bridge). |
25
- | `LOGS_ACTIONS` | Log labels: `EMIT` (`emit`), `RESULT` (`result`), `MISSING` (`missing`). |
25
+ | `LOGS_ACTIONS` | Log labels: `EMIT` (`emit`), `RESULT` (`result`), `MISSING` (`missing`). |
26
26
 
27
27
  ## Parameters
28
28
 
@@ -76,9 +76,16 @@ On `EMIT` with `skipScenario: true` sets `shared.qteScenarioSkip`; on `RESULT` m
76
76
 
77
77
  Package: `@vnejs/bridge.plugins.scenario.choose.plugins.scenario.qte`
78
78
 
79
+ Contract: `@vnejs/contracts.bridge.plugins.scenario.choose.plugins.scenario.qte` · namespace: `BRIDGE_PLUGIN_CHOOSE_PLUGIN_QTE`
80
+
79
81
  On `CHOOSE.OPTION_REPLACE`: when the option has `qte: <id>`, runs QTE with `skipScenario: true`. Success — same option index; fail — index of the option whose `keywords` include `LINE_KEYWORDS.QTE_FALLBACK` (`qte-fallback`; if none — original index + `EVENTS.LOGS.EMIT`).
80
82
 
81
- Extends `ChooseOption` with field `qte?: string`. Keyword `| qte-fallback` lands in `ChooseOption.keywords` via choose.
83
+ The contract extends `ChooseOption` with field `qte?: string`. Keyword `| qte-fallback` lands in `ChooseOption.keywords` via choose.
84
+
85
+ | Constant | Value |
86
+ | ----------------------------------------- | -------------------------------------------------------------- |
87
+ | `CONSTANTS.LOGS_ACTIONS.MISSING` | `"missing"` — `PARAMS.QTE.ITEMS` has no id. |
88
+ | `CONSTANTS.LOGS_ACTIONS.MISSING_FALLBACK` | `"missing_fallback"` — fail, and no option has `qte-fallback`. |
82
89
 
83
90
  ```vne
84
91
  % choose