@voltro/plugin-social 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/CHANGELOG.md +24492 -0
- package/LICENSE +61 -0
- package/README.md +151 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +8333 -0
- package/dist/components.js +201 -0
- package/dist/contract.js +39 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +15 -0
- package/dist/eventProducer.d.ts +8 -0
- package/dist/eventProducer.js +19 -0
- package/dist/events.d.ts +22 -0
- package/dist/events.js +15 -0
- package/dist/index.d.ts +235 -0
- package/dist/index.js +134 -0
- package/dist/inspect.js +27 -0
- package/dist/port.d.ts +35 -0
- package/dist/port.js +4 -0
- package/dist/recent.entity.js +17 -0
- package/dist/relations.entity.js +29 -0
- package/dist/rpc.d.ts +150 -0
- package/dist/rpc.js +154 -0
- package/dist/rpcRoutes.js +69 -0
- package/dist/service.js +353 -0
- package/dist/settings.entity.js +19 -0
- package/dist/social-app/events/social.accepted.event.ts +1 -0
- package/dist/social-app/events/social.requested.event.ts +1 -0
- package/dist/social-app/subscribers/social.relations.subscribe.ts +4 -0
- package/dist/strategies.d.ts +85 -0
- package/dist/strategies.js +39 -0
- package/dist/testing.d.ts +122 -0
- package/dist/testing.js +85 -0
- package/dist/web.d.ts +162 -0
- package/dist/web.js +7 -0
- package/package.json +90 -4
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,152 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @voltro/plugin-social
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Take
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { socialPlugin } from '@voltro/plugin-social'
|
|
7
|
+
|
|
8
|
+
const plugin = socialPlugin()
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The factory declares `_voltro_social_relations`, `_voltro_social_recent` and
|
|
12
|
+
`_voltro_social_settings`, sixteen typed RPCs, `SocialBlockPort`, a configuration
|
|
13
|
+
inspect endpoint and user/guest export/erase hooks. SQL owns the durable graph.
|
|
14
|
+
Friendships have one canonical row; requests, blocks and favorites are directed.
|
|
15
|
+
A block in either direction refuses a request and invitation. Removing one block
|
|
16
|
+
does not remove the other person's block or recreate an old friendship.
|
|
17
|
+
|
|
18
|
+
Self routes require a verified human subject; guest upgrade keeps the stable ID.
|
|
19
|
+
The tenant and acting identity come from the request, never a client row.
|
|
20
|
+
Participants may request, accept incoming requests, decline, cancel, remove,
|
|
21
|
+
block, unblock, favorite or change their own settings. The query routes return
|
|
22
|
+
friends, the caller's directed favorites, requests, the caller's block list, recent peers, settings and suggestions.
|
|
23
|
+
|
|
24
|
+
## Configure
|
|
25
|
+
|
|
26
|
+
| Option | Default | Meaning |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `maxFriends` | 500 | Admission budget for both people |
|
|
29
|
+
| `maxPendingRequests` | 100 | Incoming plus outgoing requests per person |
|
|
30
|
+
| `recentLimit` | 50 | Retained rows per recent-player owner |
|
|
31
|
+
| `recentRetentionMs` | 30 days | Old rows excluded from reads and trimmed on writes |
|
|
32
|
+
| `maxMatchParticipants` | 64 | Server-authorized recent-pair/block-pair input budget |
|
|
33
|
+
| `requestLimit` | 10 | Request attempts per window |
|
|
34
|
+
| `requestWindowMs` | 60,000 | Rate window in milliseconds |
|
|
35
|
+
| `suggestionLimit` | 20 | Maximum suggestion output |
|
|
36
|
+
| `maxExportRows` | 10,000 | Bounded complete export; overflow refuses |
|
|
37
|
+
| `rateLimit` | Registry Redis | Existing rate-limiter connection/HotStore options |
|
|
38
|
+
| `strategies` | exported defaults | Three pure rule slots |
|
|
39
|
+
| `now` | `Date.now` | Clock used for retention and observations |
|
|
40
|
+
|
|
41
|
+
These are configured budgets, not measured capacity. Settings default to
|
|
42
|
+
`requestsFrom: 'anyone'`, private online/activity, and friend-only party invites.
|
|
43
|
+
A `friends-of-friends` request needs an actual mutual SQL friendship; `nobody`
|
|
44
|
+
refuses. Friendship and pending counts are read after SQL admission locks on both
|
|
45
|
+
people's settings rows. There is no process-local uniqueness or graph cache.
|
|
46
|
+
|
|
47
|
+
The limiter reuses `plugin-ratelimit`'s Registry-backed Redis/HotStore adapter.
|
|
48
|
+
The installing app owns connections and credentials. Missing activation or a
|
|
49
|
+
limiter fail-open observation refuses a request with `unavailable`; it does not
|
|
50
|
+
silently admit unlimited requests. Explicit injected HotStore state is admitted
|
|
51
|
+
only when deployment evidence does not declare multiple nodes. Multi-node
|
|
52
|
+
activation with an injected port is refused; use the Registry Redis path.
|
|
53
|
+
No independent Redis socket or counter implementation is added here.
|
|
54
|
+
|
|
55
|
+
## Hook
|
|
56
|
+
|
|
57
|
+
Installed source assets discover `social.requested` and `social.accepted` with
|
|
58
|
+
post-commit relation subscribers. A request uses the recipient routing key;
|
|
59
|
+
an accepted friendship emits to both participants. The payload only identifies
|
|
60
|
+
the relation. Listeners require the explicit operator scope `social:events:read`.
|
|
61
|
+
These are best-effort CDC notifications, not durable business delivery or a
|
|
62
|
+
public player event stream. Publication takes its tenant from committed rows.
|
|
63
|
+
Notification delivery, listener resource authorization, volatile event erasure
|
|
64
|
+
and a debounced Presence `social.friendOnline` transition remain to integrate.
|
|
65
|
+
|
|
66
|
+
`SocialBlockPort.recordRecent` accepts only an internal system subject or a
|
|
67
|
+
same-tenant service account with `social:recent:write`. Server input contains
|
|
68
|
+
`tenantId`, `participants`, `context` and optional `at`. It stores directed pairs,
|
|
69
|
+
refuses client/self invocation, suppresses blocked pairs and repeated context
|
|
70
|
+
rows, and trims per-owner retention/row limits transactionally. Rooms should call
|
|
71
|
+
this outside the tick, after disposal. `dataStoreSocial(...).pruneRecent` is an
|
|
72
|
+
explicit tenant service-account sweep; periodic scheduling remains open.
|
|
73
|
+
|
|
74
|
+
## Override
|
|
75
|
+
|
|
76
|
+
`strategies` accepts `suggestions`, `requestPolicy` and `recentPolicy`. Their
|
|
77
|
+
single exported defaults in `@voltro/plugin-social/strategies` are
|
|
78
|
+
`mutualMatchSuggestions`, `recipientRequestPolicy` and `distinctRecentPeers`.
|
|
79
|
+
Suggestions use mutual SQL friendships, matching recent rows, stable sorting and
|
|
80
|
+
a bounded output. Custom output must remain a subset of actual candidates;
|
|
81
|
+
fabricated identities or counts are refused. The panel labels custom/default slots.
|
|
82
|
+
|
|
83
|
+
`canMessage` admits existing friends or the recipient request policy, always after symmetric block refusal. This is the default DM admission seam.
|
|
84
|
+
|
|
85
|
+
## Extend or replace
|
|
86
|
+
|
|
87
|
+
`SocialBlockPort` from `@voltro/plugin-social/port` has five methods: `isBlocked`,
|
|
88
|
+
`blockPairs`, `canMessage`, `canInvite`, `recordRecent`. Chat, party and matchmaking integrations
|
|
89
|
+
should depend on that tag and provide a replacement Layer when needed. Scoped
|
|
90
|
+
service-account block-pair scans need `social:blocks:read`; a human scan returns
|
|
91
|
+
only pairs involving that human. A fake Layer is exported from `./testing`.
|
|
92
|
+
Social's own RPCs continue using its graph adapter; replacing the dependency port
|
|
93
|
+
does not remove the plugin's graph routes or tables.
|
|
94
|
+
|
|
95
|
+
All three server table handles are exported; their persisted `metadata` fields
|
|
96
|
+
carry small extensions. Export keeps actual custom row columns. Static query
|
|
97
|
+
schemas currently do not project arbitrary mixin columns. Full S4a propagation,
|
|
98
|
+
custom-column UI and the system-removal command remain open.
|
|
99
|
+
|
|
100
|
+
## Panel and GM
|
|
101
|
+
|
|
102
|
+
`GET /status`, shared `SocialPage`, Local HTTP provider and Cloud app-authorized,
|
|
103
|
+
replica-selected proxy form the four authored panel layers. They show dated
|
|
104
|
+
configuration, store binding and completed rate-backend activation. None is a
|
|
105
|
+
live SQL/Redis health or capacity assertion. Graph enumeration, request-volume/
|
|
106
|
+
block metrics, support relation removal and settings reset remain to build.
|
|
107
|
+
|
|
108
|
+
`./web` exports `useFriends`, `useFavoriteFriends`, `useFriendRequests`, `useBlockList`,
|
|
109
|
+
`useRecentPlayers`, `useSocialSuggestions`, `useSocialSettings`, `FriendsPanel`,
|
|
110
|
+
`FriendRow` and `AddFriendDialog`, with en/de labels. Components use `ui-shadcn`.
|
|
111
|
+
The application supplies trusted Players/Presence projections, not client roster
|
|
112
|
+
names. Unknown online status remains unknown. Party/DM/profile controls are
|
|
113
|
+
explicit callbacks sending only an identity intention; server admission remains
|
|
114
|
+
required. Exact-name lookup/search integration is not built by the dialog.
|
|
115
|
+
Its parent owns async state and search results; `FoundFriend.query` and
|
|
116
|
+
`FoundFriend.scopeKey` must match the current query/session before sending.
|
|
117
|
+
Closing never replays a request or clears its external pending state.
|
|
118
|
+
|
|
119
|
+
## Tests
|
|
120
|
+
|
|
121
|
+
Source includes transactional memory-store fixtures, native PostgreSQL/MySQL/
|
|
122
|
+
MariaDB/MSSQL/SQLite/Turso cases, two independent SQL pool admission cases,
|
|
123
|
+
symmetric blocks, tenant and guest identity, retention/retry, rate fail-closed,
|
|
124
|
+
privacy for all tables, real event schemas, component states and panel/proxy
|
|
125
|
+
contracts. Every strategy has default/override probes and the dependency port
|
|
126
|
+
has a fail-closed fake Layer. `systemContractConformance` is registered against
|
|
127
|
+
the real factory, descriptors, tables, slots, port, events and inspect handler.
|
|
128
|
+
Missing native connection settings fail the fixture instead of claiming acceptance.
|
|
129
|
+
|
|
130
|
+
No fixture has run.
|
|
131
|
+
|
|
132
|
+
## Privacy and limits
|
|
133
|
+
|
|
134
|
+
Export/erase covers both sides of relations and recent pairs, plus own settings,
|
|
135
|
+
for user and guest targets. Erase is transactional and repeatable, preserving
|
|
136
|
+
peer settings and other tenants; source fixtures encode these expectations. A
|
|
137
|
+
complete bounded scan refuses overflow. Hot rate counters contain hashed
|
|
138
|
+
identity tuples with window expiry; coordinated volatile counter deletion and
|
|
139
|
+
full deactivation/recreation fencing remain open integration work. Presence
|
|
140
|
+
joins, exact player directory lookup, periodic sweeps, notification/ Chat/party
|
|
141
|
+
enforcement, full GM tooling and the thin Social/Chat template are still
|
|
142
|
+
pending.
|
|
143
|
+
|
|
144
|
+
Production activation now source-checks the actual deployment-wide plugin grant.
|
|
145
|
+
Declare actual Licensing first; development/test remains free. See the bilingual
|
|
146
|
+
Licensing contract and manual update migration.
|
|
147
|
+
|
|
148
|
+
`social.favorites` reads only the current human subject’s directed favorite rows
|
|
149
|
+
in the current tenant. Reads use the existing `maxFriends` bound, refuse
|
|
150
|
+
overflow and recheck exact owner/tenant equality after SQL. `useFavoriteFriends`
|
|
151
|
+
consumes that live query; generated native facades capture it with the installed
|
|
152
|
+
alias.
|
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.
|