@voltro/game-stack 0.0.0-stage → 0.87.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/LICENSE ADDED
@@ -0,0 +1,61 @@
1
+ Voltro — Proprietary Software License
2
+
3
+ Copyright (c) 2026 Voltro UG. All rights reserved.
4
+
5
+ This software and all associated source code, documentation, and other
6
+ materials (the "Software") are the proprietary property of Voltro UG
7
+ ("Voltro"). This is NOT open-source software.
8
+
9
+ Your access to and use of the Software is governed exclusively by the Voltro
10
+ Terms of Service at:
11
+
12
+ https://voltro.cloud/legal/terms
13
+
14
+ By downloading, installing, or using the Software you agree to those Terms.
15
+ Subject to and conditioned on your continued compliance with them, Voltro
16
+ grants you a limited, non-exclusive, non-transferable, non-sublicensable,
17
+ revocable license to use the Software. The license covers use by your
18
+ authorised named users only, up to the number of seats (or other billing metric)
19
+ your plan or order covers; each named user must be an identified individual
20
+ using their own personal account, and accounts, access credentials and seats
21
+ must not be shared. All rights not expressly granted in the
22
+ Terms are reserved by Voltro. If you do not agree to the Terms, you have no
23
+ license and may not use the Software.
24
+
25
+ The Terms of Service — including the scope of permitted use, plan
26
+ entitlements, fees, and pricing — may change from time to time. The version in
27
+ force is the one published at the URL above. Commercial terms and pricing are
28
+ NOT part of this notice and are not fixed by, or granted in perpetuity by, the
29
+ version of the Software in which this file appears.
30
+
31
+ Permitted use — your own software. Voltro is a development framework. You may
32
+ use the Software to build, run, and commercially distribute your own
33
+ applications and services, and to charge your own customers for them, without
34
+ owing Voltro any share of that revenue or any further permission beyond the
35
+ Terms. Applications you build with the Software are yours.
36
+
37
+ Prohibited use — reselling Voltro. You may NOT redistribute, resell,
38
+ sublicense, publish, or otherwise provide the Software itself — in whole or in
39
+ part, in source or compiled form — to third parties as a library, framework,
40
+ SDK, template, starter, or development tool for them to build upon, whether
41
+ standalone or repackaged. Shipping the Software as a non-separable, bundled
42
+ dependency inside an application you deliver (for example, compiled into your
43
+ deployed app) is permitted; extracting or re-exposing it as a reusable
44
+ component for others is not.
45
+
46
+ Except as expressly permitted above or by the Terms, you may not copy, modify,
47
+ merge, publish, sublicense, sell, distribute, or create derivative works of the
48
+ Software, in whole or in part.
49
+
50
+ Third-party open-source components distributed alongside the Software are the
51
+ property of their respective owners and are licensed under their own terms; see
52
+ THIRD-PARTY-NOTICES.md where provided. Nothing in this notice limits your
53
+ rights, or extends Voltro's, in those components.
54
+
55
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
58
+ VOLTRO BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM,
59
+ OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
60
+
61
+ For licensing inquiries, contact Voltro UG.
package/README.md CHANGED
@@ -1,3 +1,225 @@
1
- # Temporary Holding Version
1
+ # Game-stack composition
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The game stack composes existing game-system plugins through `gameStack()`. It
4
+ is not yet the complete runnable `game` starter. No budget or capacity claim
5
+ follows from this package.
6
+
7
+ ```ts
8
+ import { gameStack, describeGameStack } from '@voltro/game-stack'
9
+ import type { GameStackOptions } from '@voltro/game-stack'
10
+
11
+ export const gamePlugins = (configuration: GameStackOptions) =>
12
+ gameStack(configuration)
13
+
14
+ export const gameDependencies = (configuration: GameStackOptions) =>
15
+ describeGameStack(configuration)
16
+ ```
17
+
18
+ ## Visible ordinary plugin composition
19
+
20
+ The result is a frozen array of ordinary `VoltroPlugin` objects for the normal
21
+ `plugins` configuration. Each selected system invokes its actual single-plugin
22
+ factory. Schema, routes, services, privacy, inspect endpoints and app-shaped
23
+ sources stay owned by that plugin. The preset creates no second SQL path, private
24
+ Runtime, pool, scheduler, host or data store. Its root entry is server-only;
25
+ `./systems` and `./errors` contain browser-safe catalogue/diagnostic schemas;
26
+ `./fight` is a separate pure gameplay reference entry.
27
+
28
+ The typed fields are `auth`, `players`, `sanctions`, `social`, `chat`, `guilds`,
29
+ `inventory`, `economy`, `progression`, `liveops`, `saves`, `rooms`, `matchmaking`,
30
+ `leaderboards`, plus `preset` and `additionalPlugins`. Each system takes its real
31
+ factory options or `false`. The actual optional-configuration factories for
32
+ Players/Sanctions/Social/Chat/Guilds also accept `true` to use their own
33
+ ordinary defaults. Strategy callbacks, custom Ports, schema declarations and
34
+ provider participants are passed through the existing factory API, not translated
35
+ into a second rule vocabulary. Factory validation remains authoritative. Rooms needs explicit
36
+ options including `bindApi`: `roomsPlugin()` without a binding refuses to boot, so
37
+ selecting Rooms without them reports `missing_configuration`.
38
+
39
+ Guest `auth` uses the actual `guestAuthPlugin` options: project-owned tenant and
40
+ actual secret source, not a boolean combined with invented social providers.
41
+ Provider/account auth, CMS, notifications or app bridges can be explicit
42
+ `additionalPlugins`. The guest plugin retains normal required-secret declaration
43
+ and lifecycle validation; no secret is minted, read or copied by the preset.
44
+ Missing production credentials still belong to normal boot validation.
45
+
46
+ ## Selection and removal diagnostics
47
+
48
+ Six composition selectors are `arena`, `cards`, `quiz`, `world`, `fight`,
49
+ `minimal`; default is `arena`. Non-minimal selectors currently select the fourteen
50
+ meta/Rooms systems. `minimal` selects Guest Auth, Rooms, Matchmaking and Leaderboards.
51
+ These selectors describe plugin composition only. They do not automatically install
52
+ world/fight/reference-game simulations, renderer, screens or hosting artifacts.
53
+ The optional explicit `./fight` reference is described below.
54
+ Explicit configuration enables a system outside the selected set; `false` removes
55
+ it. The preset never secretly adds a removed system. Every system can be removed,
56
+ including all systems, which yields an empty plugin list.
57
+
58
+ `describeGameStack()` returns only preset/system selection and deterministic
59
+ `missing_configuration`/`missing_system` diagnostics. `./systems` exposes the
60
+ same browser-safe catalogue through `GAME_SYSTEMS`, `GAME_SYSTEM_IDS`,
61
+ `GAME_PRESET_IDS`, `presetGameSystems()` and `describeGameSystems()`. No probe,
62
+ SQL read, service invocation, owner/provider data, options or credentials appear
63
+ in diagnostics. The dependency list names program integration requirements;
64
+ it does not infer that an external participant or policy is actually operating.
65
+ Removed Social/Sanctions next to Chat/Matchmaking remain visible as diagnostics.
66
+
67
+ Selected Guest Auth, Inventory, Economy, Progression, LiveOps, Saves, Matchmaking
68
+ and Leaderboards require their actual author/project/content options. Missing
69
+ configuration refuses with `GameStackError` before constructing any plugin. The
70
+ complete default starter content that would make those fields accept `true`
71
+ is still open; no empty currency/catalog/track/policy is fabricated. Dependency
72
+ removal warnings do not add systems or silently supply successful guard callbacks.
73
+
74
+ Root selection and extra-plugin arrays reject unknown fields, accessors, sparse
75
+ entries and invalid selectors before invoking getters or constructing plugins.
76
+ Additional plugins follow ordinary framework conventions. Duplicate final plugin
77
+ names refuse. Selection is captured once; each actual factory owns capture and
78
+ validation of its nested options. The resulting array preserves normal plugin
79
+ objects/services rather than freezing private mutable runtime data.
80
+
81
+ ## Existing resource participants
82
+
83
+ When both Inventory and a configured default Economy Shop are selected, the
84
+ composer supplies the actual Inventory `prepareGrant` participant only if Shop
85
+ has none. The normal prepared-unit contract requires the same physical SQL
86
+ store. External Inventory replacements and different stores do not acquire a
87
+ private default SQL adapter; the real participant refuses incompatible work.
88
+ Explicit Shop participants and full root/Shop replacements retain precedence.
89
+ Removing Inventory never silently reinstalls it.
90
+
91
+ For an already configured Progression `delivery`, missing Inventory/Economy
92
+ destinations borrow those selected plugins' actual service facades. Explicit
93
+ ports and full root/delivery replacements win. No delivery, funding account,
94
+ content, worker or self-XP destination is invented. Factory and port admission
95
+ remain authoritative; an installed unavailable destination stays unavailable.
96
+
97
+ Amounts/content are illustrative test-owned configuration, not commercial
98
+ default prices. Direct fixture delivery is not durable workflow, guest/Gateway,
99
+ compiled boot or whole starter evidence.
100
+
101
+ The same missing-participant rule applies to configured Codes, Containers and
102
+ Subscriptions using `prepareGrant`, and to Trades using the actual Inventory
103
+ reservation/transfer/evidence methods. Absent child systems stay absent. This
104
+ does not supply Trade authority, container eligibility/randomness or subscription
105
+ consent; their existing factories require actual providers.
106
+
107
+ A selected default LiveOps Inbox with an explicit nondefault `version` and no
108
+ `grants` borrows the existing `economyInboxGrants` adapter from selected
109
+ Inventory/Economy prepared facades. Its normal `inbox` funding namespace belongs
110
+ to that adapter. An absent/explicit `default.v1` version retains the ordinary
111
+ no-participant shape; explicit grants or full Inbox replacement win. Receipt,
112
+ claim and all attached mutations share the ordinary physical-store SQL commit.
113
+ Removing participants never installs private destinations.
114
+
115
+ The resource fixture now includes real Codes redemption and Inbox currency/item
116
+ claim with stable replay, foreign-tenant refusal and scoped privacy alongside
117
+ Shop and Progression. Private redemption values are minted only at fixture
118
+ execution.
119
+
120
+ ## Source Doctor and explicit file ownership
121
+
122
+ `voltro doctor [app] --game [--json]` diagnoses the real source selection
123
+ through the same catalogue without evaluating app configuration or probing
124
+ participants. Normal Doctor also exposes this section. Dynamic selections are
125
+ unavailable, never a claim that policies or workers are operating. `voltro game
126
+ track`, `game remove` and `game restore` capture explicit ownership, plan/apply
127
+ removal and restore retained source bytes only while their hashes agree. They
128
+ are documented in [Game source commands](/docs/cli/game).
129
+
130
+ ## Authority and data boundaries
131
+
132
+ `economy.realMoney:false` passes unchanged to the real economy factory, including
133
+ its in-game price path. The preset invents no price, region, provider, currency,
134
+ reward or successful grant callback. Real Room, Inbox, rating and other progression
135
+ participants remain explicit actual bindings; their
136
+ complete cross-system defaults and process proofs are not established here.
137
+ Hot data and multi-node refusal remain the actual plugins' HotStore/Connection-
138
+ Registry contracts. Tick simulation still belongs to the Rooms lane; this package
139
+ has no tick executor or store operation.
140
+
141
+ ## Deferred verification and remaining construction
142
+
143
+ A common actual four-plugin Players/Sanctions/Social/Chat fixture additionally
144
+ exercises real bound SQL, installed Ports, route executors, block/mute refusal,
145
+ tenant isolation, idempotent messages and coordinated erase. Fixture
146
+ Subjects/lifecycle and a real single-node Memory HotStore do not establish
147
+ normal guest/Gateway or Redis/ multi-node/production behavior. No fake SQL,
148
+ worker, provider, Room or completed reward is used to claim a pass.
149
+
150
+ The next construction joins actual starter content and durable cross-system
151
+ participants, complete per-template manifests and focused shared source files,
152
+ then real player/admin screens and whole-stack fixtures. Owner
153
+ prices/regions/DNS/TLS/showcase/engine prerequisites remain explicit owner
154
+ decisions.
155
+
156
+ ## Optional Fight reference sources
157
+
158
+ The explicit browser-safe `@voltro/game-stack/fight` source entry adds a
159
+ two-player reference on the actual Rooms fixed math and captured simulation.
160
+ This entry installs no plugin, API binding, host, preset, renderer or transport.
161
+ The `fight` composition selector still does not automatically install reference
162
+ content.
163
+
164
+ ```ts
165
+ import type { DeclaredAccess } from '@voltro/protocol'
166
+ import { createFightRoom, createFightOptions } from '@voltro/game-stack/fight'
167
+ import { createSimulationRunner } from '@voltro/plugin-rooms/simulation'
168
+
169
+ export function fightReference(guards: DeclaredAccess,
170
+ serverSelectedPlayerIds: ReadonlyArray<number>) {
171
+ const room = createFightRoom({ guards })
172
+ const options = createFightOptions(serverSelectedPlayerIds)
173
+ const runner = createSimulationRunner(room.simulation, 42, options)
174
+ return { room, options, runner }
175
+ }
176
+ ```
177
+
178
+ The caller supplies its actual access declaration and server-selected public
179
+ player IDs. `createFightOptions` captures exactly two distinct unsigned-32-bit
180
+ IDs in canonical numeric order and owns complete tuning. State stores IDs as
181
+ 16-bit `hi`/`lo` words so even IDs above the signed state-integer range remain
182
+ lossless. The reference refuses incomplete or foreign intent matrices while
183
+ running. Its initial option IDs must match the real host's admitted roster;
184
+ ordinary API/default allocation and template/bootstrap mapping remain open.
185
+ The local runner example does not allocate Seats or authenticate players.
186
+
187
+ `FightInputSchema` accepts only `move: -1 | 0 | 1`, `jump`, `strike` and `block`.
188
+ Positions, velocity, health, stamina, facing, cooldown and round outcome come from
189
+ the simulation. All spatial state uses Q16.16 raw integers. Movement is bounded
190
+ by the stage, grounded jumps need a fresh button edge, gravity and ceiling/ground
191
+ contact use the same fixed math, and body separation resolves in a canonical
192
+ order. Strikes need a fresh button edge, stamina and an expired cooldown; even
193
+ a whiff costs stamina. Blocking prevents striking and charges its actual cost
194
+ when hit. Stun prevents the next configured action ticks.
195
+
196
+ Both movement candidates are captured first. Both hit outcomes then see the
197
+ same pre-damage target snapshots before either is applied, permitting a
198
+ simultaneous knock-out draw. A timeout compares remaining health. Terminal
199
+ state stays stable; its retained finish event must be consumed with an
200
+ `elapsedTicks`/event-index cursor rather than emitted again for every snapshot.
201
+ Per-transition `events` (`jump`, `strike`, `hit`, `block`, `finish`) are bounded
202
+ authoritative state for observation outside simulation work, not an event-bus
203
+ write or durable reward/sanction delivery. No Store/read/write enters the step.
204
+
205
+ `defaultFightRules` is exported illustrative gameplay content.
206
+ `createFightOptions(ids, partialRules)` changes raw speeds, stage/body sizes,
207
+ range, damage, health/stamina/costs, cooldown/stun and round duration through
208
+ strict own-data/range admission. Full rules are in the authoritative state and
209
+ its hash, not hidden factory configuration. Rule ceilings and the reference's
210
+ 16-element collection, 4096-node, 65536-byte and field-ID64 limits are work
211
+ budgets, not measured capacity or deterministic engine support.
212
+
213
+ `createFightSimulation({ strategies: { movement, hit } })` accepts pure
214
+ synchronous overrides. The exported `defaultFightMovement` and
215
+ `defaultFightHit` can be composed directly. Contexts contain detached frozen
216
+ fighters, rules and actual tick; outputs are exact bounded own data, copied
217
+ before application. Promise outputs and malformed/getter outputs refuse.
218
+ `describeFightStrategies` reports default/custom for that genuine descriptor
219
+ only. Complete simulation replacement uses the actual captured `simulation`
220
+ field of `createFightRoom`; simultaneous replacement and rule-slot overrides
221
+ refuse ambiguous configuration. The factory requires a nonempty actual access
222
+ declaration, defaults to a two-player `referee` Room, and passes normal
223
+ lockstep, budget, tick-rate and reconnect options to the existing declaration.
224
+ A different gameplay model can use ordinary `defineSimulation`/`defineRoom`
225
+ without this optional reference. No new service Port is needed for this pure leaf.
package/SECURITY.md ADDED
@@ -0,0 +1,56 @@
1
+ # Security Policy
2
+
3
+ We take the security of Voltro and the applications built on it seriously. This
4
+ document explains how to report a vulnerability and what to expect in return.
5
+
6
+ ## Reporting a vulnerability
7
+
8
+ **Please do not open public issues or discuss suspected vulnerabilities in
9
+ public channels.** Report them privately by email:
10
+
11
+ **security contact: [support@voltro.dev](mailto:support@voltro.dev)**
12
+ (subject line: `SECURITY`).
13
+
14
+ Include, where you can:
15
+
16
+ - the affected package(s) and version(s) (e.g. `@voltro/runtime@x.y.z`);
17
+ - a description of the issue and its impact;
18
+ - a minimal reproduction or proof of concept;
19
+ - any suggested remediation.
20
+
21
+ If you'd like to encrypt your report, ask in a first plain email and we'll
22
+ arrange a key.
23
+
24
+ ## What to expect
25
+
26
+ - **Acknowledgement** of your report within **3 business days**.
27
+ - An initial assessment (severity, affected surface) and a remediation plan as
28
+ soon as we've reproduced the issue.
29
+ - **Coordinated disclosure:** we'll agree a disclosure timeline with you and
30
+ credit you in the release notes if you wish. Please give us reasonable time to
31
+ ship a fix before any public disclosure.
32
+
33
+ We do not currently run a paid bug-bounty program, but we genuinely appreciate
34
+ responsible disclosure and will credit reporters.
35
+
36
+ ## Software Bill of Materials (SBOM)
37
+
38
+ A CycloneDX SBOM of the third-party runtime dependency graph is generated for the
39
+ published packages (`pnpm gen:sbom` → `sbom.cdx.json`). If your procurement or
40
+ security team needs it, request it at
41
+ [support@voltro.dev](mailto:support@voltro.dev).
42
+
43
+ ## Supported versions
44
+
45
+ Voltro is pre-1.0 and ships in lockstep: **only the latest published minor of
46
+ each `@voltro/*` package receives security fixes.** Please upgrade to the latest
47
+ release before reporting, and pin exact versions in production.
48
+
49
+ ## Scope
50
+
51
+ In scope: the published `@voltro/*` packages and the framework's own code.
52
+
53
+ Out of scope: vulnerabilities in third-party dependencies that are already
54
+ tracked upstream (we monitor these via a production-dependency audit gate in
55
+ CI), and issues that require a non-default, explicitly-unsafe configuration. If
56
+ you're unsure, report it anyway — we'd rather hear about it.