@voltro/plugin-matchmaking 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.
Files changed (47) hide show
  1. package/CHANGELOG.md +24492 -0
  2. package/LICENSE +61 -0
  3. package/README.md +272 -2
  4. package/SECURITY.md +56 -0
  5. package/THIRD-PARTY-NOTICES.md +8333 -0
  6. package/dist/admission.entity.js +17 -0
  7. package/dist/assignment.js +125 -0
  8. package/dist/avoidPairs.js +4 -0
  9. package/dist/contract.js +105 -0
  10. package/dist/director-app/matchmaking.director.workflow.server.tsx +5 -0
  11. package/dist/director-app/matchmaking.director.workflow.tsx +13 -0
  12. package/dist/director.js +72 -0
  13. package/dist/directorContract.js +15 -0
  14. package/dist/directorWorkflow.js +5 -0
  15. package/dist/errors.d.ts +13 -0
  16. package/dist/errors.js +20 -0
  17. package/dist/index.d.ts +523 -0
  18. package/dist/index.js +12 -0
  19. package/dist/inspect.js +40 -0
  20. package/dist/packing.js +71 -0
  21. package/dist/parties.js +316 -0
  22. package/dist/party.entity.js +33 -0
  23. package/dist/partyComponents.js +176 -0
  24. package/dist/partyContract.js +24 -0
  25. package/dist/plugin.js +257 -0
  26. package/dist/port.d.ts +116 -0
  27. package/dist/port.js +4 -0
  28. package/dist/queue.d.ts +91 -0
  29. package/dist/queue.js +79 -0
  30. package/dist/queueDeclarations.js +27 -0
  31. package/dist/roomsAllocator.d.ts +67 -0
  32. package/dist/roomsAllocator.js +75 -0
  33. package/dist/rpc.d.ts +247 -0
  34. package/dist/rpc.js +201 -0
  35. package/dist/server.d.ts +337 -0
  36. package/dist/server.js +8 -0
  37. package/dist/service.js +369 -0
  38. package/dist/strategies.d.ts +97 -0
  39. package/dist/strategies.js +140 -0
  40. package/dist/testing.d.ts +296 -0
  41. package/dist/testing.js +151 -0
  42. package/dist/ticketContract.d.ts +52 -0
  43. package/dist/ticketContract.js +30 -0
  44. package/dist/tickets.entity.js +49 -0
  45. package/dist/web.d.ts +279 -0
  46. package/dist/web.js +7 -0
  47. package/package.json +104 -4
@@ -0,0 +1,75 @@
1
+ import { matchmakingError as e } from "./errors.js";
2
+ import { Effect as t } from "effect";
3
+ import { resolveIdentityAuthority as n } from "@voltro/protocol";
4
+ import { RoomReservePort as r } from "@voltro/plugin-rooms/ports";
5
+ // src/roomsAllocator.ts
6
+ var i = (i) => {
7
+ if (!i?.rooms?.services || typeof i.room != "function") throw e("invalid_queue");
8
+ let a = i.maxRetained ?? 1024;
9
+ if (!Number.isSafeInteger(a) || a < 1 || a > 65536) throw e("invalid_queue");
10
+ let o = /* @__PURE__ */ new Map(), s = (e, t) => {
11
+ for (o.delete(e), o.set(e, t); o.size > a;) o.delete(o.keys().next().value);
12
+ }, c = (r, a) => t.flatMap(t.tryPromise({
13
+ try: () => n({
14
+ type: "user",
15
+ id: a,
16
+ tenantId: r
17
+ }, {
18
+ origin: "workflow",
19
+ headers: {},
20
+ clientId: void 0,
21
+ store: i.getStore?.()
22
+ }, i.authority),
23
+ catch: () => e("unavailable")
24
+ }), (n) => n.kind === "resolved" ? t.succeed(n.subject) : t.fail(e(n.kind === "vetoed" ? "forbidden" : "unavailable"))), l = (n) => t.flatMap(r, n).pipe(t.provide(i.rooms.services), t.mapError((t) => t instanceof Error && t._tag === "MatchmakingError" ? t : e("unavailable")));
25
+ return {
26
+ allocate: (n) => t.gen(function* () {
27
+ let r = n.teams.flat();
28
+ if (r.length === 0) return yield* t.fail(e("invalid_proposal"));
29
+ let a = i.room(n), o = yield* t.forEach(r, (e) => c(n.tenantId, e));
30
+ return yield* l((r) => t.gen(function* () {
31
+ let i = a.pool === void 0 ? {} : { pool: a.pool }, c = [], l;
32
+ if (r.prepareMatch) l = (yield* r.prepareMatch({
33
+ requestId: n.requestId,
34
+ room: a.room,
35
+ options: a.options,
36
+ ...i
37
+ }, o[0])).roomId;
38
+ else {
39
+ let e = yield* r.reserve({
40
+ mode: "create",
41
+ room: a.room,
42
+ options: a.options,
43
+ ...i
44
+ }, o[0]);
45
+ l = e.roomId, c.push({
46
+ subject: o[0],
47
+ sessionId: e.sessionId,
48
+ token: e.token
49
+ });
50
+ }
51
+ for (let n of o.slice(c.length)) {
52
+ let i = yield* r.reserve({
53
+ mode: "joinById",
54
+ roomId: l
55
+ }, n);
56
+ if (i.roomId !== l) return yield* t.fail(e("unavailable"));
57
+ c.push({
58
+ subject: n,
59
+ sessionId: i.sessionId,
60
+ token: i.token
61
+ });
62
+ }
63
+ return s(n.requestId, c), Object.freeze({
64
+ roomId: l,
65
+ seats: Object.freeze(Object.fromEntries(c.map((e) => [e.subject.id, e.sessionId])))
66
+ });
67
+ }));
68
+ }),
69
+ release: (e) => t.suspend(() => {
70
+ let n = o.get(e.requestId);
71
+ return n ? (o.delete(e.requestId), l((e) => t.forEach(n, (n) => t.ignore(e.leave(n.sessionId, n.token, n.subject)), { discard: !0 }))) : t.void;
72
+ })
73
+ };
74
+ };
75
+ export { i as roomsAllocator };
package/dist/rpc.d.ts ADDED
@@ -0,0 +1,247 @@
1
+ import { ActionProcedureDescriptor } from '@voltro/protocol';
2
+ import { PluginRpcClientDescriptor } from '@voltro/protocol';
3
+ import { QueryProcedureDescriptor } from '@voltro/protocol';
4
+ import { Schema } from 'effect';
5
+ import { YieldableError } from 'effect/Cause';
6
+
7
+ /** The caller's own Room seats from matches; redeem `sessionId` with `rooms.resume`. */
8
+ export declare const assignmentsDescriptor: QueryProcedureDescriptor<"matchmaking.assignments", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
9
+ readonly ticketId: Schema.String;
10
+ readonly queue: Schema.String;
11
+ readonly roomId: Schema.String;
12
+ readonly sessionId: Schema.String;
13
+ readonly createdAt: Schema.Number;
14
+ }>>, typeof MatchmakingError>;
15
+
16
+ export declare const BASE_NAME = "@voltro/plugin-matchmaking";
17
+
18
+ export declare const cancelDescriptor: ActionProcedureDescriptor<"matchmaking.cancel", Schema.Struct<{
19
+ readonly ticketId: Schema.NonEmptyString;
20
+ }>, Schema.Void, typeof MatchmakingError>;
21
+
22
+ export declare const enqueueDescriptor: ActionProcedureDescriptor<"matchmaking.enqueue", Schema.Struct<{
23
+ readonly queue: Schema.NonEmptyString;
24
+ readonly requestId: Schema.NonEmptyString;
25
+ readonly preferences: Schema.$Record<Schema.String, Schema.Unknown>;
26
+ }>, Schema.Struct<{
27
+ readonly id: Schema.String;
28
+ readonly queue: Schema.String;
29
+ readonly state: Schema.Literals<readonly ["open", "matched", "assigned", "cancelled", "expired"]>;
30
+ readonly members: Schema.$Array<Schema.String>;
31
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
32
+ readonly createdAt: Schema.Number;
33
+ readonly expiresAt: Schema.Number;
34
+ readonly closedAt: Schema.NullOr<Schema.Number>;
35
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
36
+ }>, typeof MatchmakingError>;
37
+
38
+ /** Expected wait for a declared queue from recent matched searches of the caller's tenant; no identity is exposed. */
39
+ export declare const estimateDescriptor: QueryProcedureDescriptor<"matchmaking.estimate", Schema.Struct<{
40
+ readonly queue: Schema.NonEmptyString;
41
+ }>, Schema.Struct<{
42
+ readonly queue: Schema.String;
43
+ readonly waitMs: Schema.NullOr<Schema.Number>;
44
+ readonly samples: Schema.Number;
45
+ }>, typeof MatchmakingError>;
46
+
47
+ /** A scheduled Director run: `runKey` makes the run idempotent; `maxPairs` bounds tenant×queue work per run. */
48
+ export declare const MatchmakingDirectorPayload: Schema.Struct<{
49
+ readonly runKey: Schema.NonEmptyString;
50
+ readonly maxPairs: Schema.Number;
51
+ }>;
52
+
53
+ export declare type MatchmakingDirectorPayload = typeof MatchmakingDirectorPayload.Type;
54
+
55
+ export declare const MatchmakingDirectorResult: Schema.Struct<{
56
+ readonly cycles: Schema.Number;
57
+ readonly assigned: Schema.Number;
58
+ readonly skipped: Schema.Number;
59
+ readonly failed: Schema.Number;
60
+ }>;
61
+
62
+ export declare type MatchmakingDirectorResult = typeof MatchmakingDirectorResult.Type;
63
+
64
+ declare class MatchmakingError extends MatchmakingError_base {
65
+ }
66
+
67
+ declare const MatchmakingError_base: Schema.Class<MatchmakingError, Schema.TaggedStruct<"MatchmakingError", {
68
+ readonly code: Schema.Literals<readonly ["invalid_input", "invalid_queue", "invalid_proposal", "unavailable", "identity_required", "not_found", "already_searching", "conflict", "queue_full", "erased", "export_limit", "forbidden", "party_full", "already_in_party", "party_not_ready"]>;
69
+ }>, YieldableError>;
70
+
71
+ export declare const matchmakingRpcClientImports: ReadonlyArray<PluginRpcClientDescriptor>;
72
+
73
+ export declare const partyCancelSearchDescriptor: ActionProcedureDescriptor<"matchmaking.parties.cancelSearch", Schema.Struct<{
74
+ readonly partyId: Schema.NonEmptyString;
75
+ }>, Schema.Struct<{
76
+ readonly id: Schema.String;
77
+ readonly leaderId: Schema.String;
78
+ readonly maxSize: Schema.Number;
79
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
80
+ readonly createdAt: Schema.Number;
81
+ readonly members: Schema.$Array<Schema.Struct<{
82
+ readonly subjectId: Schema.String;
83
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
84
+ readonly ready: Schema.Boolean;
85
+ readonly joinedAt: Schema.Number;
86
+ }>>;
87
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
88
+ }>, typeof MatchmakingError>;
89
+
90
+ export declare const partyCreateDescriptor: ActionProcedureDescriptor<"matchmaking.parties.create", Schema.Struct<{
91
+ readonly requestId: Schema.NonEmptyString;
92
+ readonly maxSize: Schema.optional<Schema.Number>;
93
+ readonly approval: Schema.optional<Schema.Literals<readonly ["open", "leader"]>>;
94
+ }>, Schema.Struct<{
95
+ readonly id: Schema.String;
96
+ readonly leaderId: Schema.String;
97
+ readonly maxSize: Schema.Number;
98
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
99
+ readonly createdAt: Schema.Number;
100
+ readonly members: Schema.$Array<Schema.Struct<{
101
+ readonly subjectId: Schema.String;
102
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
103
+ readonly ready: Schema.Boolean;
104
+ readonly joinedAt: Schema.Number;
105
+ }>>;
106
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
107
+ }>, typeof MatchmakingError>;
108
+
109
+ export declare const partyInviteDescriptor: ActionProcedureDescriptor<"matchmaking.parties.invite", Schema.Struct<{
110
+ readonly partyId: Schema.NonEmptyString;
111
+ readonly subjectId: Schema.NonEmptyString;
112
+ }>, Schema.Struct<{
113
+ readonly partyId: Schema.String;
114
+ readonly inviterId: Schema.String;
115
+ readonly expiresAt: Schema.Number;
116
+ }>, typeof MatchmakingError>;
117
+
118
+ export declare const partyInvitesDescriptor: QueryProcedureDescriptor<"matchmaking.parties.invites", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
119
+ readonly partyId: Schema.String;
120
+ readonly inviterId: Schema.String;
121
+ readonly expiresAt: Schema.Number;
122
+ }>>, typeof MatchmakingError>;
123
+
124
+ export declare const partyJoinDescriptor: ActionProcedureDescriptor<"matchmaking.parties.join", Schema.Struct<{
125
+ readonly partyId: Schema.NonEmptyString;
126
+ }>, Schema.Struct<{
127
+ readonly id: Schema.String;
128
+ readonly leaderId: Schema.String;
129
+ readonly maxSize: Schema.Number;
130
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
131
+ readonly createdAt: Schema.Number;
132
+ readonly members: Schema.$Array<Schema.Struct<{
133
+ readonly subjectId: Schema.String;
134
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
135
+ readonly ready: Schema.Boolean;
136
+ readonly joinedAt: Schema.Number;
137
+ }>>;
138
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
139
+ }>, typeof MatchmakingError>;
140
+
141
+ export declare const partyKickDescriptor: ActionProcedureDescriptor<"matchmaking.parties.kick", Schema.Struct<{
142
+ readonly partyId: Schema.NonEmptyString;
143
+ readonly subjectId: Schema.NonEmptyString;
144
+ }>, Schema.Struct<{
145
+ readonly id: Schema.String;
146
+ readonly leaderId: Schema.String;
147
+ readonly maxSize: Schema.Number;
148
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
149
+ readonly createdAt: Schema.Number;
150
+ readonly members: Schema.$Array<Schema.Struct<{
151
+ readonly subjectId: Schema.String;
152
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
153
+ readonly ready: Schema.Boolean;
154
+ readonly joinedAt: Schema.Number;
155
+ }>>;
156
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
157
+ }>, typeof MatchmakingError>;
158
+
159
+ export declare const partyLeaveDescriptor: ActionProcedureDescriptor<"matchmaking.parties.leave", Schema.Struct<{
160
+ readonly partyId: Schema.NonEmptyString;
161
+ }>, Schema.Void, typeof MatchmakingError>;
162
+
163
+ export declare const partyMineDescriptor: QueryProcedureDescriptor<"matchmaking.parties.mine", Schema.Struct<{}>, Schema.NullOr<Schema.Struct<{
164
+ readonly id: Schema.String;
165
+ readonly leaderId: Schema.String;
166
+ readonly maxSize: Schema.Number;
167
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
168
+ readonly createdAt: Schema.Number;
169
+ readonly members: Schema.$Array<Schema.Struct<{
170
+ readonly subjectId: Schema.String;
171
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
172
+ readonly ready: Schema.Boolean;
173
+ readonly joinedAt: Schema.Number;
174
+ }>>;
175
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
176
+ }>>, typeof MatchmakingError>;
177
+
178
+ export declare const partyRpcClientImports: ReadonlyArray<PluginRpcClientDescriptor>;
179
+
180
+ export declare const partySearchDescriptor: ActionProcedureDescriptor<"matchmaking.parties.search", Schema.Struct<{
181
+ readonly partyId: Schema.NonEmptyString;
182
+ readonly queue: Schema.NonEmptyString;
183
+ readonly requestId: Schema.NonEmptyString;
184
+ readonly preferences: Schema.$Record<Schema.String, Schema.Unknown>;
185
+ }>, Schema.Struct<{
186
+ readonly id: Schema.String;
187
+ readonly queue: Schema.String;
188
+ readonly state: Schema.Literals<readonly ["open", "matched", "assigned", "cancelled", "expired"]>;
189
+ readonly members: Schema.$Array<Schema.String>;
190
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
191
+ readonly createdAt: Schema.Number;
192
+ readonly expiresAt: Schema.Number;
193
+ readonly closedAt: Schema.NullOr<Schema.Number>;
194
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
195
+ }>, typeof MatchmakingError>;
196
+
197
+ export declare const partySetReadyDescriptor: ActionProcedureDescriptor<"matchmaking.parties.setReady", Schema.Struct<{
198
+ readonly partyId: Schema.NonEmptyString;
199
+ readonly ready: Schema.Boolean;
200
+ }>, Schema.Struct<{
201
+ readonly id: Schema.String;
202
+ readonly leaderId: Schema.String;
203
+ readonly maxSize: Schema.Number;
204
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
205
+ readonly createdAt: Schema.Number;
206
+ readonly members: Schema.$Array<Schema.Struct<{
207
+ readonly subjectId: Schema.String;
208
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
209
+ readonly ready: Schema.Boolean;
210
+ readonly joinedAt: Schema.Number;
211
+ }>>;
212
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
213
+ }>, typeof MatchmakingError>;
214
+
215
+ export declare const partyTransferLeaderDescriptor: ActionProcedureDescriptor<"matchmaking.parties.transferLeader", Schema.Struct<{
216
+ readonly partyId: Schema.NonEmptyString;
217
+ readonly subjectId: Schema.NonEmptyString;
218
+ }>, Schema.Struct<{
219
+ readonly id: Schema.String;
220
+ readonly leaderId: Schema.String;
221
+ readonly maxSize: Schema.Number;
222
+ readonly approval: Schema.Literals<readonly ["open", "leader"]>;
223
+ readonly createdAt: Schema.Number;
224
+ readonly members: Schema.$Array<Schema.Struct<{
225
+ readonly subjectId: Schema.String;
226
+ readonly role: Schema.Literals<readonly ["leader", "member"]>;
227
+ readonly ready: Schema.Boolean;
228
+ readonly joinedAt: Schema.Number;
229
+ }>>;
230
+ readonly searchTicketId: Schema.NullOr<Schema.String>;
231
+ }>, typeof MatchmakingError>;
232
+
233
+ export declare const statusDescriptor: QueryProcedureDescriptor<"matchmaking.status", Schema.Struct<{
234
+ readonly ticketId: Schema.NonEmptyString;
235
+ }>, Schema.Struct<{
236
+ readonly id: Schema.String;
237
+ readonly queue: Schema.String;
238
+ readonly state: Schema.Literals<readonly ["open", "matched", "assigned", "cancelled", "expired"]>;
239
+ readonly members: Schema.$Array<Schema.String>;
240
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
241
+ readonly createdAt: Schema.Number;
242
+ readonly expiresAt: Schema.Number;
243
+ readonly closedAt: Schema.NullOr<Schema.Number>;
244
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
245
+ }>, typeof MatchmakingError>;
246
+
247
+ export { }
package/dist/rpc.js ADDED
@@ -0,0 +1,201 @@
1
+ import { MatchmakingError as e } from "./errors.js";
2
+ import { PARTIES_TABLE as t, PARTY_INVITES_TABLE as n, PARTY_MEMBERS_TABLE as r, PartyInviteSchema as i, PartySchema as a } from "./partyContract.js";
3
+ import { ASSIGNMENTS_TABLE as o, MatchmakingAssignmentSchema as s, MatchmakingEstimateSchema as c, MatchmakingTicketSchema as l, TICKETS_TABLE as u } from "./ticketContract.js";
4
+ import { MatchmakingDirectorPayload as d, MatchmakingDirectorResult as f } from "./directorContract.js";
5
+ import { Schema as p } from "effect";
6
+ import { defineAction as m, defineQuery as h } from "@voltro/protocol";
7
+ // src/rpc.ts
8
+ var g = "@voltro/plugin-matchmaking", _ = "Verified human identity and tenant come from the request; the service admits and reads only the caller-owned search.", v = m({
9
+ name: "matchmaking.enqueue",
10
+ input: p.Struct({
11
+ queue: p.NonEmptyString,
12
+ requestId: p.NonEmptyString,
13
+ preferences: p.Record(p.String, p.Unknown)
14
+ }),
15
+ output: l,
16
+ error: e,
17
+ openAccess: _
18
+ }), y = m({
19
+ name: "matchmaking.cancel",
20
+ input: p.Struct({ ticketId: p.NonEmptyString }),
21
+ output: p.Void,
22
+ error: e,
23
+ openAccess: _
24
+ }), b = h({
25
+ name: "matchmaking.status",
26
+ input: p.Struct({ ticketId: p.NonEmptyString }),
27
+ output: l,
28
+ source: u,
29
+ error: e,
30
+ openAccess: _
31
+ }), x = h({
32
+ name: "matchmaking.estimate",
33
+ input: p.Struct({ queue: p.NonEmptyString }),
34
+ output: c,
35
+ source: u,
36
+ error: e,
37
+ openAccess: "An aggregate over matched searches of the verified caller's tenant for a declared queue: a median wait and a sample count, never ticket rows or identities."
38
+ }), S = h({
39
+ name: "matchmaking.assignments",
40
+ input: p.Struct({}),
41
+ output: p.Array(s),
42
+ source: o,
43
+ error: e,
44
+ openAccess: _
45
+ }), C = "The handler takes the verified caller as leader/member; inputs are intentions and the server owns roster, leader and capacity.", w = p.Struct({ partyId: p.NonEmptyString.pipe(p.check(p.isMaxLength(64))) }), T = p.Struct({
46
+ partyId: p.NonEmptyString.pipe(p.check(p.isMaxLength(64))),
47
+ subjectId: p.NonEmptyString.pipe(p.check(p.isMaxLength(256)))
48
+ }), E = m({
49
+ name: "matchmaking.parties.create",
50
+ input: p.Struct({
51
+ requestId: p.NonEmptyString.pipe(p.check(p.isMaxLength(256))),
52
+ maxSize: p.optional(p.Number.pipe(p.check(p.isInt()), p.check(p.isBetween({
53
+ minimum: 1,
54
+ maximum: 256
55
+ })))),
56
+ approval: p.optional(p.Literals(["open", "leader"]))
57
+ }),
58
+ output: a,
59
+ error: e,
60
+ openAccess: C
61
+ }), D = m({
62
+ name: "matchmaking.parties.invite",
63
+ input: T,
64
+ output: i,
65
+ error: e,
66
+ openAccess: C
67
+ }), O = m({
68
+ name: "matchmaking.parties.join",
69
+ input: w,
70
+ output: a,
71
+ error: e,
72
+ openAccess: C
73
+ }), k = m({
74
+ name: "matchmaking.parties.leave",
75
+ input: w,
76
+ output: p.Void,
77
+ error: e,
78
+ openAccess: C
79
+ }), A = m({
80
+ name: "matchmaking.parties.kick",
81
+ input: T,
82
+ output: a,
83
+ error: e,
84
+ openAccess: C
85
+ }), j = m({
86
+ name: "matchmaking.parties.setReady",
87
+ input: p.Struct({
88
+ partyId: p.NonEmptyString.pipe(p.check(p.isMaxLength(64))),
89
+ ready: p.Boolean
90
+ }),
91
+ output: a,
92
+ error: e,
93
+ openAccess: C
94
+ }), M = m({
95
+ name: "matchmaking.parties.transferLeader",
96
+ input: T,
97
+ output: a,
98
+ error: e,
99
+ openAccess: C
100
+ }), N = m({
101
+ name: "matchmaking.parties.search",
102
+ input: p.Struct({
103
+ partyId: p.NonEmptyString.pipe(p.check(p.isMaxLength(64))),
104
+ queue: p.NonEmptyString,
105
+ requestId: p.NonEmptyString,
106
+ preferences: p.Record(p.String, p.Unknown)
107
+ }),
108
+ output: l,
109
+ error: e,
110
+ openAccess: C
111
+ }), P = m({
112
+ name: "matchmaking.parties.cancelSearch",
113
+ input: w,
114
+ output: a,
115
+ error: e,
116
+ openAccess: C
117
+ }), F = h({
118
+ name: "matchmaking.parties.mine",
119
+ input: p.Struct({}),
120
+ output: p.NullOr(a),
121
+ source: [
122
+ t,
123
+ r,
124
+ u
125
+ ],
126
+ error: e,
127
+ openAccess: C
128
+ }), I = h({
129
+ name: "matchmaking.parties.invites",
130
+ input: p.Struct({}),
131
+ output: p.Array(i),
132
+ source: [n],
133
+ error: e,
134
+ openAccess: C
135
+ }), L = [...[
136
+ "create",
137
+ "invite",
138
+ "join",
139
+ "leave",
140
+ "kick",
141
+ "setReady",
142
+ "transferLeader",
143
+ "search",
144
+ "cancelSearch"
145
+ ].map((e) => ({
146
+ tag: "matchmaking.parties." + e,
147
+ kind: "action",
148
+ import: {
149
+ module: "@voltro/plugin-matchmaking/rpc",
150
+ name: "party" + e[0].toUpperCase() + e.slice(1) + "Descriptor"
151
+ }
152
+ })), ...["mine", "invites"].map((e) => ({
153
+ tag: "matchmaking.parties." + e,
154
+ kind: "query",
155
+ import: {
156
+ module: "@voltro/plugin-matchmaking/rpc",
157
+ name: "party" + e[0].toUpperCase() + e.slice(1) + "Descriptor"
158
+ }
159
+ }))], R = [
160
+ {
161
+ tag: "matchmaking.enqueue",
162
+ kind: "action",
163
+ import: {
164
+ module: "@voltro/plugin-matchmaking/rpc",
165
+ name: "enqueueDescriptor"
166
+ }
167
+ },
168
+ {
169
+ tag: "matchmaking.cancel",
170
+ kind: "action",
171
+ import: {
172
+ module: "@voltro/plugin-matchmaking/rpc",
173
+ name: "cancelDescriptor"
174
+ }
175
+ },
176
+ {
177
+ tag: "matchmaking.status",
178
+ kind: "query",
179
+ import: {
180
+ module: "@voltro/plugin-matchmaking/rpc",
181
+ name: "statusDescriptor"
182
+ }
183
+ },
184
+ {
185
+ tag: "matchmaking.estimate",
186
+ kind: "query",
187
+ import: {
188
+ module: "@voltro/plugin-matchmaking/rpc",
189
+ name: "estimateDescriptor"
190
+ }
191
+ },
192
+ {
193
+ tag: "matchmaking.assignments",
194
+ kind: "query",
195
+ import: {
196
+ module: "@voltro/plugin-matchmaking/rpc",
197
+ name: "assignmentsDescriptor"
198
+ }
199
+ }
200
+ ];
201
+ export { g as BASE_NAME, d as MatchmakingDirectorPayload, f as MatchmakingDirectorResult, S as assignmentsDescriptor, y as cancelDescriptor, v as enqueueDescriptor, x as estimateDescriptor, R as matchmakingRpcClientImports, P as partyCancelSearchDescriptor, E as partyCreateDescriptor, D as partyInviteDescriptor, I as partyInvitesDescriptor, O as partyJoinDescriptor, A as partyKickDescriptor, k as partyLeaveDescriptor, F as partyMineDescriptor, L as partyRpcClientImports, N as partySearchDescriptor, j as partySetReadyDescriptor, M as partyTransferLeaderDescriptor, b as statusDescriptor };