@voltro/plugin-flags 0.86.0 → 0.88.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 CHANGED
@@ -24,3 +24,109 @@ deliberately short so there is nothing here to drift out of date.
24
24
 
25
25
  Proprietary. © 2026 Voltro UG. Your use is governed by the
26
26
  [Terms of Service](https://voltro.cloud/legal/terms). See the bundled `LICENSE`.
27
+
28
+ ## Typed Remote Config
29
+
30
+ `defineConfig` is an optional `flagsPlugin` extension. Its declared bounds are
31
+ budgets. Config editing, automatic Room delivery and a full LiveOps lifecycle
32
+ remain open.
33
+
34
+ ```ts
35
+ // lib/public-game-config.ts — browser-safe public declarations only
36
+ import { Schema } from 'effect'
37
+ import { defineConfig } from '@voltro/plugin-flags/config'
38
+
39
+ export const publicConfigSpec = {
40
+ 'xp.multiplier': { schema: Schema.Number, default: 1, min: 0.5, max: 5, public: true },
41
+ 'shop.featured': { schema: Schema.Array(Schema.String), default: [], public: true, restartRequired: 'live' },
42
+ } as const
43
+ export const publicGameConfig = defineConfig(publicConfigSpec)
44
+ ```
45
+
46
+ ```ts
47
+ // app.config.ts — server only
48
+ import { Schema } from 'effect'
49
+ import { flagsPlugin } from '@voltro/plugin-flags'
50
+ import { defineConfig } from '@voltro/plugin-flags/config'
51
+ import { publicConfigSpec } from './lib/public-game-config'
52
+
53
+ export const gameConfig = defineConfig({
54
+ ...publicConfigSpec,
55
+ 'arena.maxPlayers': { schema: Schema.Int, default: 32, min: 1, max: 256, restartRequired: 'room' },
56
+ })
57
+ export const plugins = [flagsPlugin({ config: gameConfig, store: 'postgres' })]
58
+ ```
59
+
60
+ `store:'postgres'` names the existing durable Flag tier; it borrows the app
61
+ DataStore and its SQL dialect. No separate pool or Config table is created.
62
+ Validated rows in `_voltro_feature_flags` replace the code definition whole.
63
+ Invalid values, targeting, schedules or bounds refuse the entire override and
64
+ retain the code definition. Error and inspect responses omit rejected values.
65
+ SQL is the override truth and rebuild source; no direct backend or tick read is
66
+ introduced.
67
+
68
+ Each key declares an Effect Schema and a typed default. Numeric `min`/`max`
69
+ refine that schema. `variants`, `targeting`, `rollout`, `rolloutBy` and `schedule`
70
+ reuse Flag targeting and deterministic bucketing. A disabled, excluded or
71
+ out-of-window Config resolves to its declared default. Keys are private by
72
+ default; only `public:true` keys reach the caller-bound `config.mine` query.
73
+ Existing Flag evaluation, variant queries, lifecycle rows and boolean toggles
74
+ omit Config keys. A Config key cannot be edited through the boolean toggle.
75
+
76
+ ```ts
77
+ // server handler — read before Room creation, never from its tick
78
+ import { Effect } from 'effect'
79
+ import { ConfigPort, configValue } from '@voltro/plugin-flags/config-port'
80
+ import { gameConfig } from './app.config'
81
+
82
+ export const readRoomConfig = (subject: { id: string; tenantId?: string; type?: string }) =>
83
+ Effect.gen(function* () {
84
+ const config = yield* ConfigPort
85
+ const multiplier = yield* configValue(gameConfig, config, 'xp.multiplier', subject)
86
+ const snapshot = yield* config.snapshot(subject, 'room')
87
+ return { multiplier, snapshot }
88
+ })
89
+ ```
90
+
91
+ The complete read port is `get(key,subject)`, `mine(subject)` and
92
+ `snapshot(subject,'room'|'live')`. `room` is the default application scope;
93
+ `live` is explicit. A snapshot uses one time and one merged definition set.
94
+ The app passes it during creation or through an explicit message outside the
95
+ tick. Declaring a scope does not install Room delivery. Escaped effects from a
96
+ released activation refuse reads; another Flag instance does not replace this
97
+ instance's Config snapshot.
98
+
99
+ ```tsx
100
+ import { useConfig } from '@voltro/plugin-flags/web'
101
+ import { publicGameConfig } from '../lib/public-game-config'
102
+
103
+ export function FeaturedItems() {
104
+ const items = useConfig(publicGameConfig, 'shop.featured')
105
+ return <ul>{items.map(item => <li key={item}>{item}</li>)}</ul>
106
+ }
107
+ ```
108
+
109
+ The web hook accepts only explicitly public keys and uses the validated default
110
+ while no valid response exists. Import a browser-safe catalog that contains no
111
+ private values; server-only declarations must stay outside web imports.
112
+
113
+ `configResolver` overrides the pure resolution slot and requires a named
114
+ `configVersion` other than `default.v1`. `configService` replaces all three port
115
+ methods, preserves class receivers and requires the same version plus explicit
116
+ `configQuerySources` (an empty list means an app-owned static view). Resolver and
117
+ complete port replacement cannot be combined. Replacement owns its storage,
118
+ privacy and invalidation sources; it borrows no default persistence behavior.
119
+ Returned keys and values still obey the declared public/snapshot schema.
120
+
121
+ The value and override capture budget is 16,384 encoded JSON bytes, 4,096 nodes,
122
+ 16 nesting levels, 1,024 array entries and 256 object properties; keys are bounded
123
+ to 120 characters and catalogs to 128 keys. Override metadata counts toward the
124
+ byte budget too. Non-finite numbers, cycles, accessors, non-JSON objects and
125
+ unbounded input refuse. These are configured limits, not measured capacities.
126
+ Config contributes no new subject table. App-owned replacement privacy remains
127
+ its owner's responsibility; existing Flag audit/usage retention is independent.
128
+
129
+ Local and Cloud Flags panels show key/type/public/scope/bounds/version/ownership
130
+ through the same canonical inspect schema. They never show resolved values,
131
+ subjects or rejected payloads, and distinguish the remaining editor/delivery
132
+ work.
@@ -1,11 +1,11 @@
1
1
  # Third-Party Notices — @voltro/plugin-flags
2
2
 
3
- This package uses the open-source software listed below. Each is the
3
+ This package uses the third-party software listed below. Each is the
4
4
  property of its respective copyright holders and is used under the terms of
5
5
  its license. This file is provided for attribution; it grants no rights in
6
6
  @voltro/plugin-flags itself, which is proprietary (see LICENSE).
7
7
 
8
- Generated from the resolved runtime dependency closure (10 packages).
8
+ Generated from the resolved runtime dependency closure (8 packages).
9
9
 
10
10
  ---
11
11
 
@@ -93,7 +93,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
93
93
  SOFTWARE.
94
94
  ```
95
95
 
96
- ## @tanstack/react-store@0.11.1
96
+ ## @tanstack/react-store@0.11.2
97
97
 
98
98
  License: MIT
99
99
 
@@ -121,7 +121,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
121
121
  SOFTWARE.
122
122
  ```
123
123
 
124
- ## @tanstack/store@0.11.1
124
+ ## @tanstack/store@0.11.2
125
125
 
126
126
  License: MIT
127
127
 
@@ -149,7 +149,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
149
149
  SOFTWARE.
150
150
  ```
151
151
 
152
- ## jose@6.2.12
152
+ ## jose@6.2.13
153
153
 
154
154
  License: MIT
155
155
 
@@ -177,214 +177,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
177
177
  SOFTWARE.
178
178
  ```
179
179
 
180
- ## typeid-js@1.2.0
181
-
182
- License: Apache-2.0
183
-
184
- ```
185
- Apache License
186
- Version 2.0, January 2004
187
- http://www.apache.org/licenses/
188
-
189
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
190
-
191
- 1. Definitions.
192
-
193
- "License" shall mean the terms and conditions for use, reproduction,
194
- and distribution as defined by Sections 1 through 9 of this document.
195
-
196
- "Licensor" shall mean the copyright owner or entity authorized by
197
- the copyright owner that is granting the License.
198
-
199
- "Legal Entity" shall mean the union of the acting entity and all
200
- other entities that control, are controlled by, or are under common
201
- control with that entity. For the purposes of this definition,
202
- "control" means (i) the power, direct or indirect, to cause the
203
- direction or management of such entity, whether by contract or
204
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
205
- outstanding shares, or (iii) beneficial ownership of such entity.
206
-
207
- "You" (or "Your") shall mean an individual or Legal Entity
208
- exercising permissions granted by this License.
209
-
210
- "Source" form shall mean the preferred form for making modifications,
211
- including but not limited to software source code, documentation
212
- source, and configuration files.
213
-
214
- "Object" form shall mean any form resulting from mechanical
215
- transformation or translation of a Source form, including but
216
- not limited to compiled object code, generated documentation,
217
- and conversions to other media types.
218
-
219
- "Work" shall mean the work of authorship, whether in Source or
220
- Object form, made available under the License, as indicated by a
221
- copyright notice that is included in or attached to the work
222
- (an example is provided in the Appendix below).
223
-
224
- "Derivative Works" shall mean any work, whether in Source or Object
225
- form, that is based on (or derived from) the Work and for which the
226
- editorial revisions, annotations, elaborations, or other modifications
227
- represent, as a whole, an original work of authorship. For the purposes
228
- of this License, Derivative Works shall not include works that remain
229
- separable from, or merely link (or bind by name) to the interfaces of,
230
- the Work and Derivative Works thereof.
231
-
232
- "Contribution" shall mean any work of authorship, including
233
- the original version of the Work and any modifications or additions
234
- to that Work or Derivative Works thereof, that is intentionally
235
- submitted to Licensor for inclusion in the Work by the copyright owner
236
- or by an individual or Legal Entity authorized to submit on behalf of
237
- the copyright owner. For the purposes of this definition, "submitted"
238
- means any form of electronic, verbal, or written communication sent
239
- to the Licensor or its representatives, including but not limited to
240
- communication on electronic mailing lists, source code control systems,
241
- and issue tracking systems that are managed by, or on behalf of, the
242
- Licensor for the purpose of discussing and improving the Work, but
243
- excluding communication that is conspicuously marked or otherwise
244
- designated in writing by the copyright owner as "Not a Contribution."
245
-
246
- "Contributor" shall mean Licensor and any individual or Legal Entity
247
- on behalf of whom a Contribution has been received by Licensor and
248
- subsequently incorporated within the Work.
249
-
250
- 2. Grant of Copyright License. Subject to the terms and conditions of
251
- this License, each Contributor hereby grants to You a perpetual,
252
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
253
- copyright license to reproduce, prepare Derivative Works of,
254
- publicly display, publicly perform, sublicense, and distribute the
255
- Work and such Derivative Works in Source or Object form.
256
-
257
- 3. Grant of Patent License. Subject to the terms and conditions of
258
- this License, each Contributor hereby grants to You a perpetual,
259
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
260
- (except as stated in this section) patent license to make, have made,
261
- use, offer to sell, sell, import, and otherwise transfer the Work,
262
- where such license applies only to those patent claims licensable
263
- by such Contributor that are necessarily infringed by their
264
- Contribution(s) alone or by combination of their Contribution(s)
265
- with the Work to which such Contribution(s) was submitted. If You
266
- institute patent litigation against any entity (including a
267
- cross-claim or counterclaim in a lawsuit) alleging that the Work
268
- or a Contribution incorporated within the Work constitutes direct
269
- or contributory patent infringement, then any patent licenses
270
- granted to You under this License for that Work shall terminate
271
- as of the date such litigation is filed.
272
-
273
- 4. Redistribution. You may reproduce and distribute copies of the
274
- Work or Derivative Works thereof in any medium, with or without
275
- modifications, and in Source or Object form, provided that You
276
- meet the following conditions:
277
-
278
- (a) You must give any other recipients of the Work or
279
- Derivative Works a copy of this License; and
280
-
281
- (b) You must cause any modified files to carry prominent notices
282
- stating that You changed the files; and
283
-
284
- (c) You must retain, in the Source form of any Derivative Works
285
- that You distribute, all copyright, patent, trademark, and
286
- attribution notices from the Source form of the Work,
287
- excluding those notices that do not pertain to any part of
288
- the Derivative Works; and
289
-
290
- (d) If the Work includes a "NOTICE" text file as part of its
291
- distribution, then any Derivative Works that You distribute must
292
- include a readable copy of the attribution notices contained
293
- within such NOTICE file, excluding those notices that do not
294
- pertain to any part of the Derivative Works, in at least one
295
- of the following places: within a NOTICE text file distributed
296
- as part of the Derivative Works; within the Source form or
297
- documentation, if provided along with the Derivative Works; or,
298
- within a display generated by the Derivative Works, if and
299
- wherever such third-party notices normally appear. The contents
300
- of the NOTICE file are for informational purposes only and
301
- do not modify the License. You may add Your own attribution
302
- notices within Derivative Works that You distribute, alongside
303
- or as an addendum to the NOTICE text from the Work, provided
304
- that such additional attribution notices cannot be construed
305
- as modifying the License.
306
-
307
- You may add Your own copyright statement to Your modifications and
308
- may provide additional or different license terms and conditions
309
- for use, reproduction, or distribution of Your modifications, or
310
- for any such Derivative Works as a whole, provided Your use,
311
- reproduction, and distribution of the Work otherwise complies with
312
- the conditions stated in this License.
313
-
314
- 5. Submission of Contributions. Unless You explicitly state otherwise,
315
- any Contribution intentionally submitted for inclusion in the Work
316
- by You to the Licensor shall be under the terms and conditions of
317
- this License, without any additional terms or conditions.
318
- Notwithstanding the above, nothing herein shall supersede or modify
319
- the terms of any separate license agreement you may have executed
320
- with Licensor regarding such Contributions.
321
-
322
- 6. Trademarks. This License does not grant permission to use the trade
323
- names, trademarks, service marks, or product names of the Licensor,
324
- except as required for reasonable and customary use in describing the
325
- origin of the Work and reproducing the content of the NOTICE file.
326
-
327
- 7. Disclaimer of Warranty. Unless required by applicable law or
328
- agreed to in writing, Licensor provides the Work (and each
329
- Contributor provides its Contributions) on an "AS IS" BASIS,
330
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
331
- implied, including, without limitation, any warranties or conditions
332
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
333
- PARTICULAR PURPOSE. You are solely responsible for determining the
334
- appropriateness of using or redistributing the Work and assume any
335
- risks associated with Your exercise of permissions under this License.
336
-
337
- 8. Limitation of Liability. In no event and under no legal theory,
338
- whether in tort (including negligence), contract, or otherwise,
339
- unless required by applicable law (such as deliberate and grossly
340
- negligent acts) or agreed to in writing, shall any Contributor be
341
- liable to You for damages, including any direct, indirect, special,
342
- incidental, or consequential damages of any character arising as a
343
- result of this License or out of the use or inability to use the
344
- Work (including but not limited to damages for loss of goodwill,
345
- work stoppage, computer failure or malfunction, or any and all
346
- other commercial damages or losses), even if such Contributor
347
- has been advised of the possibility of such damages.
348
-
349
- 9. Accepting Warranty or Additional Liability. While redistributing
350
- the Work or Derivative Works thereof, You may choose to offer,
351
- and charge a fee for, acceptance of support, warranty, indemnity,
352
- or other liability obligations and/or rights consistent with this
353
- License. However, in accepting such obligations, You may act only
354
- on Your own behalf and on Your sole responsibility, not on behalf
355
- of any other Contributor, and only if You agree to indemnify,
356
- defend, and hold each Contributor harmless for any liability
357
- incurred by, or claims asserted against, such Contributor by reason
358
- of your accepting any such warranty or additional liability.
359
-
360
- END OF TERMS AND CONDITIONS
361
-
362
- APPENDIX: How to apply the Apache License to your work.
363
-
364
- To apply the Apache License to your work, attach the following
365
- boilerplate notice, with the fields enclosed by brackets "[]"
366
- replaced with your own identifying information. (Don't include
367
- the brackets!) The text should be enclosed in the appropriate
368
- comment syntax for the file format. We also recommend that a
369
- file or class name and description of purpose be included on the
370
- same "printed page" as the copyright notice for easier
371
- identification within third-party archives.
372
-
373
- Copyright [yyyy] [name of copyright owner]
374
-
375
- Licensed under the Apache License, Version 2.0 (the "License");
376
- you may not use this file except in compliance with the License.
377
- You may obtain a copy of the License at
378
-
379
- http://www.apache.org/licenses/LICENSE-2.0
380
-
381
- Unless required by applicable law or agreed to in writing, software
382
- distributed under the License is distributed on an "AS IS" BASIS,
383
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
384
- See the License for the specific language governing permissions and
385
- limitations under the License.
386
- ```
387
-
388
180
  ## ulid@3.0.2
389
181
 
390
182
  License: MIT
@@ -413,7 +205,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
413
205
  SOFTWARE.
414
206
  ```
415
207
 
416
- ## use-sync-external-store@1.6.0
208
+ ## use-sync-external-store@1.7.0
417
209
 
418
210
  License: MIT
419
211
 
@@ -441,19 +233,3 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
441
233
  SOFTWARE.
442
234
  ```
443
235
 
444
- ## uuid@11.1.1
445
-
446
- License: MIT
447
-
448
- ```
449
- The MIT License (MIT)
450
-
451
- Copyright (c) 2010-2020 Robert Kieffer and other contributors
452
-
453
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
454
-
455
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
456
-
457
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
458
- ```
459
-
@@ -0,0 +1,33 @@
1
+ import { Schema } from 'effect';
2
+
3
+ export declare const ConfigKeySummarySchema: Schema.Struct<{
4
+ readonly key: Schema.String;
5
+ readonly valueType: Schema.String;
6
+ readonly public: Schema.Boolean;
7
+ readonly restartRequired: Schema.Literals<readonly ["room", "live"]>;
8
+ readonly min: Schema.NullOr<Schema.Number>;
9
+ readonly max: Schema.NullOr<Schema.Number>;
10
+ }>;
11
+
12
+ export declare type ConfigStatus = typeof ConfigStatusSchema.Type;
13
+
14
+ export declare const ConfigStatusSchema: Schema.Struct<{
15
+ readonly bound: Schema.Boolean;
16
+ readonly backend: Schema.Literals<readonly ["flags", "custom"]>;
17
+ readonly version: Schema.String;
18
+ readonly resolver: Schema.Literals<readonly ["default", "custom", "app-owned"]>;
19
+ readonly keys: Schema.$Array<Schema.Struct<{
20
+ readonly key: Schema.String;
21
+ readonly valueType: Schema.String;
22
+ readonly public: Schema.Boolean;
23
+ readonly restartRequired: Schema.Literals<readonly ["room", "live"]>;
24
+ readonly min: Schema.NullOr<Schema.Number>;
25
+ readonly max: Schema.NullOr<Schema.Number>;
26
+ }>>;
27
+ readonly publicKeys: Schema.$Array<Schema.String>;
28
+ readonly maxValueBytes: Schema.Literal<16384>;
29
+ readonly roomBindingInstalled: Schema.Literal<false>;
30
+ readonly gmEditInstalled: Schema.Literal<false>;
31
+ }>;
32
+
33
+ export { }
@@ -0,0 +1,28 @@
1
+ import { Schema as e } from "effect";
2
+ // src/configInspect.ts
3
+ var t = e.String.pipe(e.check(e.isPattern(/^[A-Za-z][A-Za-z0-9._-]{0,119}$/))), n = e.NullOr(e.Number.pipe(e.check(e.isFinite()))), r = e.Struct({
4
+ key: t,
5
+ valueType: e.String,
6
+ public: e.Boolean,
7
+ restartRequired: e.Literals(["room", "live"]),
8
+ min: n,
9
+ max: n
10
+ }), i = e.Struct({
11
+ bound: e.Boolean,
12
+ backend: e.Literals(["flags", "custom"]),
13
+ version: t,
14
+ resolver: e.Literals([
15
+ "default",
16
+ "custom",
17
+ "app-owned"
18
+ ]),
19
+ keys: e.Array(r).pipe(e.check(e.isMinLength(1)), e.check(e.isMaxLength(128))),
20
+ publicKeys: e.Array(t),
21
+ maxValueBytes: e.Literal(16384),
22
+ roomBindingInstalled: e.Literal(!1),
23
+ gmEditInstalled: e.Literal(!1)
24
+ }).pipe(e.check(e.makeFilter((e) => {
25
+ let t = e.keys.map((e) => e.key);
26
+ return new Set(t).size === t.length && e.keys.every((e) => e.min === null || e.max === null || e.min <= e.max) && JSON.stringify(e.publicKeys) === JSON.stringify(e.keys.filter((e) => e.public).map((e) => e.key)) && (e.backend === "custom" ? e.resolver === "app-owned" && e.version !== "default.v1" : e.resolver !== "app-owned" && (e.resolver === "default" || e.version !== "default.v1"));
27
+ })));
28
+ export { r as ConfigKeySummarySchema, i as ConfigStatusSchema };