@voltro/plugin-guilds 0.0.0-stage → 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/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,166 @@
1
- # Temporary Holding Version
1
+ # @voltro/plugin-guilds
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
+ ## Take
4
+
5
+ ```ts
6
+ import { guildsPlugin } from '@voltro/plugin-guilds'
7
+
8
+ const plugin = guildsPlugin()
9
+ ```
10
+
11
+ Eight SQL tables own guilds, members, roles, applications, invites, chronicle,
12
+ announcements and subject admission. Twenty-two typed RPCs and twelve web hooks
13
+ are authored. The server receives human intentions and trusted request identity;
14
+ anonymous/machine self calls refuse. Guest and registered users share stable IDs.
15
+ Guild-role bits are guild data; they never grant app/tenant RBAC permissions.
16
+
17
+ `guilds.create` takes a request ID, name, 3–5 ASCII alphanumeric tag, description,
18
+ membership policy, region and language. Deterministic sender/request IDs preserve
19
+ the exact creation claim. Name NFKC/space/case normalization and uppercase tags
20
+ use tenant-hashed unique SQL claims. This is no confusable-name proof. Name/tag
21
+ moderation composes the existing keyword provider; an empty denylist is no
22
+ classification coverage. This foundation creates guilds without currency charges.
23
+ Economy-backed optional creation cost and emblem Storage lifecycle remain open.
24
+
25
+ `guilds.mine`, `get`, `search`, `members`, `roles` read scoped state. Search is a
26
+ bounded exact name/tag or region/language query, not fuzzy search. Detailed member
27
+ and history reads require actual guild membership. Inputs never supply owner,
28
+ tenant, XP, membership rows or arbitrary metadata state.
29
+
30
+ Search projects a separate GuildSummary without owner identity, private metadata or creation claims; members-only get keeps the full scoped projection.
31
+
32
+ ## Configure
33
+
34
+ | Option | Default | Meaning |
35
+ |---|---|---|
36
+ | `baseMemberCap` | 50 | Initial guild member budget |
37
+ | `maximumMemberCap` | 500 | Level-curve member ceiling |
38
+ | `maxGuildsPerSubject` | 1 | SQL-serialized guild admission budget |
39
+ | `maxRoles` | 20 | Configured role count budget |
40
+ | `maxPending` | 100 | Pending application/invite budget per guild |
41
+ | `inviteTtlMs` | 7 days | Invitation acceptance lifetime |
42
+ | `inactiveAfterMs` | 30 days | Successor proposal threshold |
43
+ | `pageSize` | 50 | Bounded search/chronicle/announcement page |
44
+ | `maxExportRows` | 10,000 | Complete export/operation scan ceiling |
45
+ | `maxDescriptionLength` | 2,000 code points | Description/application budget |
46
+ | `maxAnnouncementLength` | 4,000 code points | Announcement body budget |
47
+ | `denyWords` | empty | Explicit existing keyword-provider policy |
48
+ | `strategies` | three defaults | Permission, level and inactivity rules |
49
+ | `now` | `Date.now` | Trusted rule/observation clock |
50
+
51
+ These are budgets, not measured capacity. Subject admission rows are inserted
52
+ outside transactions, then locked in deterministic hash order before the guild
53
+ writer row. Guild/member counts and role state are read after writer admission.
54
+ SQL owns cross-pool limits; there is no in-memory mutex or second hot truth.
55
+ This conservative serialization has not been measured under load.
56
+
57
+ ## Hook
58
+
59
+ `guilds.join`, `apply`, `decideApplication`, `invite`, `decideInvite` implement
60
+ open/application/invite admission. Invites expire and re-check the inviter's
61
+ current membership/permission before acceptance. `SocialBlockPort` controls
62
+ invite admission and blocks at acceptance when installed; a replacement Layer is
63
+ used, never Social tables. Cross-system block-race admission is not yet proven.
64
+
65
+ `kick`, `setRole`, `configureRole` enforce permission bits, strict rank order,
66
+ no peer/owner kick, no self-promotion and no second owner via normal role changes.
67
+ Only the committed owner transfers ownership through `transferOwner`. An owner's
68
+ departure chooses a remaining member by rank/join date/ID; the last departure
69
+ dissolves the guild and frees name/tag claims. `updateProfile` requires version
70
+ CAS; `announce` is moderated, permission-checked and request-idempotent.
71
+
72
+ `guilds.changed` is a discovered operator metadata event (`guilds:events:read`):
73
+ guild routing key plus log ID/kind, no body or personal detail. Committed SQL log
74
+ rows select the tenant; the normal once change claimer is used. CDC is best-effort,
75
+ not durable notification delivery. Player state comes through guarded Live Queries.
76
+ Named business events, Notifications and end-to-end discovery remain open.
77
+
78
+ `dataStoreGuilds(...).recordContribution` accepts only internal System or same-
79
+ tenant service account with `guilds:contributions:write`; stable request IDs
80
+ apply trusted XP once in a SQL transaction. It updates guild XP/level/member cap
81
+ and the real member contribution. Clients cannot award themselves XP. This is
82
+ not an economy wallet, war rule or periodic leaderboard aggregation.
83
+
84
+ ## Override
85
+
86
+ `./strategies` exports one default per slot: `bitSetGuildPermissions`,
87
+ `quadraticGuildLevels`, `highestActiveGuildSuccessor`. Permissions evaluate actual
88
+ guild role bits; owner/rank safety boundaries remain server invariants. The
89
+ level curve maps trusted XP to a validated level/member cap. Inactivity proposes
90
+ the highest active rank; it never transfers ownership automatically.
91
+
92
+ `inactivityProposal` requires System or a same-tenant service account with
93
+ `guilds:inactivity:read`. Custom proposals must name an existing candidate.
94
+ Activity currently comes from creation/join and trusted contribution; Presence-
95
+ driven activity, scheduled ownership offer and acknowledgement remain open.
96
+
97
+ ## Extend or replace
98
+
99
+ Guilds is currently a leaf with three strategies and events, no dependency port.
100
+ Other dependency integrations use their own ports. Exported table handles and
101
+ JSON metadata carry small extensions; export preserves actual contributed row
102
+ columns. Arbitrary mixin fields are not yet propagated by static wire schemas/UI.
103
+ Complete S4a, namespace composition and system removal remain open.
104
+
105
+ Treasury requires the Economy guild wallet. Guild chat/membership revocation,
106
+ Presence, leaderboards, min-level admission, emblem lifecycle, weekly events/
107
+ workflow and currency-backed creation are not yet integrated. No store I/O belongs
108
+ in a Room tick. Rooms may submit trusted contributions outside ticks.
109
+
110
+ ## Panel and GM
111
+
112
+ Plugin `GET /status`, shared `GuildsPage`, Local read-token HTTP provider and
113
+ Cloud authorized-app/replica proxy are authored together. Strict decoders show
114
+ dated configuration, rule-slot selection and current binding; no guild/member
115
+ data, health or measured capacity is disclosed. Full guild list/treasury/log,
116
+ rename/transfer/dissolve/emblem-removal GM actions and metrics remain open.
117
+
118
+ `./web` exposes `useGuild`, `useGuildList`, `useGuildMembers`, `useGuildRoles`,
119
+ `useGuildSearch`, `useGuildApplications`, `useGuildInvites`,
120
+ `useGuildAnnouncements`, `useGuildLog`, `useGuildCreate`, `useGuildJoin`,
121
+ `useGuildLeave`. Components are `GuildCard`, `GuildBrowser`, `GuildMemberList`,
122
+ `GuildCreateDialog`, `GuildLog`. They reuse ui-shadcn, en/de labels, escaped
123
+ text and explicit unknown identity. Parents provide trusted Players projections
124
+ and scoped data, permission projections, draft/request ID/pending state across
125
+ dialog close. Browser and creation use credential/tenant `scopeKey` and matching
126
+ `dataScopeKey`; old data/actions are hidden/refused. Mutation callbacks carry
127
+ target IDs/intent only; controls are not authorization. No automatic retry or
128
+ success clearing.
129
+
130
+ ## Tests
131
+
132
+ Written memory-adapter cases exercise stable guest identity, creation claims,
133
+ name/tag uniqueness, membership caps, roles/rank matrix, revoked invitations,
134
+ Social port replacement, moderation, profile CAS, trusted contribution receipts,
135
+ ownership erase, peer preservation and refused re-creation. Three slot fixtures
136
+ and `systemContractConformance` cover actual factory stages, events, metadata,
137
+ all eight tables' user/guest privacy and inspection. Native PostgreSQL/MySQL/
138
+ MariaDB/MSSQL/SQLite/Turso cases cover all tables, Unicode/JSON/date fields,
139
+ two-pool member/subject admission, version races and privacy/successor readback.
140
+ Missing native connection fields fail rather than silently skipping acceptance.
141
+ DOM/panel/provider contracts are written. None ran.
142
+
143
+ ## Membership port
144
+
145
+ `@voltro/plugin-guilds/port` exports `GuildMembershipPort`. The installed plugin
146
+ provides it through its service Layer, so other plugins and app code ask
147
+ `isMember(subject, guildId)` instead of reading Guild SQL. It answers `true`
148
+ only while the subject currently belongs to the guild in its own tenant;
149
+ strangers, other tenants, unknown guilds and anonymous callers get `false`, not
150
+ an error. It is the building block for guild chat, guild parties and guild
151
+ leaderboards; those bridges are not wired yet.
152
+
153
+ ## Privacy and limits
154
+
155
+ Export returns actual owned/referenced rows with a bounded complete scan. Erase
156
+ serializes the subject, locks affected guilds, removes membership, transfers
157
+ ownership or dissolves a solo guild, scrubs former-owned content/role metadata,
158
+ applications/invites, authored announcements and personal chronicle references.
159
+ Peer membership/history and other tenants survive. A redacted deterministic SQL
160
+ admission tombstone retains no subject ID and refuses re-created membership
161
+ under the erased subject, including retries. There is no reactivation/unlock API
162
+ yet.
163
+
164
+ Production activation now source-checks the actual deployment-wide plugin grant.
165
+ Declare actual Licensing first; development/test remains free. See the bilingual
166
+ Licensing contract and manual update migration.
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.