@voltro/plugin-progression 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/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +478 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +9189 -0
- package/dist/achievementComponents.js +92 -0
- package/dist/achievementStore.js +603 -0
- package/dist/achievementTables.entity.js +98 -0
- package/dist/achievements.d.ts +188 -0
- package/dist/achievements.js +205 -0
- package/dist/capture.js +64 -0
- package/dist/cmsQuests.d.ts +91 -0
- package/dist/cmsQuests.js +83 -0
- package/dist/components.d.ts +172 -0
- package/dist/components.js +4 -0
- package/dist/curve.d.ts +27 -0
- package/dist/curve.js +38 -0
- package/dist/daily.d.ts +152 -0
- package/dist/daily.js +126 -0
- package/dist/dailyStore.js +421 -0
- package/dist/dailySystem.fixture.js +138 -0
- package/dist/dailyTables.entity.js +90 -0
- package/dist/declarationFixtures.js +143 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +20 -0
- package/dist/index.d.ts +1833 -0
- package/dist/index.js +19 -0
- package/dist/pass.d.ts +186 -0
- package/dist/pass.js +122 -0
- package/dist/passRules.js +96 -0
- package/dist/passStore.js +485 -0
- package/dist/passTables.entity.js +96 -0
- package/dist/plugin.js +1086 -0
- package/dist/port.js +5 -0
- package/dist/progressionStore.js +706 -0
- package/dist/questComponents.js +163 -0
- package/dist/questPort.d.ts +126 -0
- package/dist/questPort.js +5 -0
- package/dist/questRefresh.js +56 -0
- package/dist/questRefresh.server.js +126 -0
- package/dist/questRerollJournal.js +77 -0
- package/dist/questStore.js +592 -0
- package/dist/questTables.entity.js +117 -0
- package/dist/quests.d.ts +142 -0
- package/dist/quests.js +153 -0
- package/dist/rank-app/schedules/progression.dispatchRankClosures.cron.tsx +19 -0
- package/dist/rank-app/workflows/progression.closeRankSeason.workflow.server.tsx +10 -0
- package/dist/rank-app/workflows/progression.closeRankSeason.workflow.tsx +1 -0
- package/dist/rankClosure.d.ts +69 -0
- package/dist/rankClosure.js +35 -0
- package/dist/rankClosure.server.js +139 -0
- package/dist/rankClosureWorkflow.d.ts +34 -0
- package/dist/rankClosureWorkflow.js +16 -0
- package/dist/rankReader.server.js +57 -0
- package/dist/rankRewardParent.server.js +65 -0
- package/dist/rankSeasons.d.ts +144 -0
- package/dist/rankSeasons.js +91 -0
- package/dist/rankStore.js +521 -0
- package/dist/rankSystem.fixture.js +170 -0
- package/dist/rankTables.entity.js +101 -0
- package/dist/ranks.d.ts +167 -0
- package/dist/ranks.js +219 -0
- package/dist/resourceStore.js +464 -0
- package/dist/resourceTables.entity.js +89 -0
- package/dist/resources.d.ts +105 -0
- package/dist/resources.js +60 -0
- package/dist/reward-app/schedules/progression.dispatchRewards.cron.tsx +19 -0
- package/dist/reward-app/workflows/progression.deliverReward.workflow.server.tsx +10 -0
- package/dist/reward-app/workflows/progression.deliverReward.workflow.tsx +1 -0
- package/dist/reward.d.ts +27 -0
- package/dist/reward.js +39 -0
- package/dist/rewardDelivery.d.ts +163 -0
- package/dist/rewardDelivery.js +38 -0
- package/dist/rewardDelivery.server.js +430 -0
- package/dist/rewardDeliveryRecord.js +48 -0
- package/dist/rewardDeliveryWorkflow.d.ts +36 -0
- package/dist/rewardDeliveryWorkflow.js +16 -0
- package/dist/rpc.d.ts +880 -0
- package/dist/rpc.js +498 -0
- package/dist/server.d.ts +2812 -0
- package/dist/server.js +21 -0
- package/dist/stats.js +45 -0
- package/dist/strategies.d.ts +131 -0
- package/dist/strategies.js +4 -0
- package/dist/systemFixtures.js +474 -0
- package/dist/tables.entity.js +155 -0
- package/dist/testing.d.ts +1566 -0
- package/dist/testing.js +11 -0
- package/dist/track.js +72 -0
- package/dist/tutorial.d.ts +157 -0
- package/dist/tutorial.js +110 -0
- package/dist/tutorialStore.js +496 -0
- package/dist/tutorialSystem.fixture.js +100 -0
- package/dist/tutorialTables.entity.js +91 -0
- package/dist/web.d.ts +363 -0
- package/dist/web.js +7 -0
- package/package.json +167 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1833 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import { EconomyService } from '@voltro/plugin-economy';
|
|
3
|
+
import { Effect } from 'effect';
|
|
4
|
+
import { InventoryService } from '@voltro/plugin-inventory';
|
|
5
|
+
import { PluginPrivacyTarget } from '@voltro/protocol';
|
|
6
|
+
import { Schema } from 'effect';
|
|
7
|
+
import { Subject } from '@voltro/protocol';
|
|
8
|
+
import { VoltroPlugin } from '@voltro/protocol';
|
|
9
|
+
import { WorkflowRunHandle } from '@voltro/protocol';
|
|
10
|
+
import { YieldableError } from 'effect/Cause';
|
|
11
|
+
|
|
12
|
+
export declare const acceptRankObservation: (season: RankSeason, ladder: RankLadder, beforeInput: RankSeasonState, rankInput: PlayerRank, rulesVersion: string) => RankSeasonState;
|
|
13
|
+
|
|
14
|
+
export declare interface Achievement {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly version: number;
|
|
17
|
+
readonly hidden: boolean;
|
|
18
|
+
readonly tiers: readonly AchievementTier[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare interface AchievementAudit {
|
|
22
|
+
readonly acceptedOperations: number;
|
|
23
|
+
readonly unlocked: number;
|
|
24
|
+
readonly rewardRows: number;
|
|
25
|
+
readonly matches: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare type AchievementCondition = StatThreshold | CompositeCondition;
|
|
29
|
+
|
|
30
|
+
export declare interface AchievementDefinition {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly version?: number;
|
|
33
|
+
readonly condition: AchievementCondition;
|
|
34
|
+
readonly tiers?: readonly AchievementTierDefinition[];
|
|
35
|
+
readonly hidden?: boolean;
|
|
36
|
+
readonly reward?: readonly ProgressionReward[];
|
|
37
|
+
readonly platform?: AchievementPlatform;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare interface AchievementEvaluation {
|
|
41
|
+
readonly met: boolean;
|
|
42
|
+
readonly progress: readonly AchievementProgress[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare type AchievementEvaluator = (input: {
|
|
46
|
+
readonly condition: AchievementCondition;
|
|
47
|
+
readonly stats: readonly AchievementStat[];
|
|
48
|
+
}) => AchievementEvaluation;
|
|
49
|
+
|
|
50
|
+
export declare interface AchievementPlatform {
|
|
51
|
+
readonly steam?: string;
|
|
52
|
+
readonly gameCenter?: string;
|
|
53
|
+
readonly playGames?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare interface AchievementPluginOptions extends Omit<AchievementStoreOptions, 'source'> {
|
|
57
|
+
readonly source?: AchievementStatSourceService;
|
|
58
|
+
readonly service?: AchievementService | undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare class AchievementPort extends AchievementPort_base {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const AchievementPort_base: Context.ServiceClass<AchievementPort, "@voltro/AchievementPort", AchievementService>;
|
|
65
|
+
|
|
66
|
+
export declare interface AchievementProgress extends AchievementStat {
|
|
67
|
+
readonly target: string;
|
|
68
|
+
readonly met: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare interface AchievementReceipt {
|
|
72
|
+
readonly operationId: string;
|
|
73
|
+
readonly throughSequence: number;
|
|
74
|
+
readonly unlockedIds: readonly string[];
|
|
75
|
+
readonly rewardsQueued: number;
|
|
76
|
+
readonly at: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare interface AchievementService {
|
|
80
|
+
readonly evaluate: (subject: Subject, input: EvaluateAchievementsInput) => Effect.Effect<AchievementReceipt, ProgressionError>;
|
|
81
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerAchievement[], ProgressionError>;
|
|
82
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
83
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare interface AchievementSqlService extends AchievementService {
|
|
87
|
+
readonly auditAchievements: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<AchievementAudit, ProgressionError>;
|
|
88
|
+
readonly rebuildAchievements: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<AchievementAudit, ProgressionError>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare interface AchievementStat {
|
|
92
|
+
readonly stat: string;
|
|
93
|
+
readonly period: 'lifetime' | 'season';
|
|
94
|
+
readonly seasonId: string | null;
|
|
95
|
+
readonly value: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare interface AchievementStatEvent extends AchievementStat {
|
|
99
|
+
readonly operationId: string;
|
|
100
|
+
readonly sequence: number;
|
|
101
|
+
readonly at: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare interface AchievementStatHistory {
|
|
105
|
+
readonly version: string;
|
|
106
|
+
readonly throughSequence: number;
|
|
107
|
+
readonly initial: readonly AchievementStat[];
|
|
108
|
+
readonly events: readonly AchievementStatEvent[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare class AchievementStatSource extends AchievementStatSource_base {
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare const AchievementStatSource_base: Context.ServiceClass<AchievementStatSource, "@voltro/AchievementStatSource", AchievementStatSourceService>;
|
|
115
|
+
|
|
116
|
+
export declare interface AchievementStatSourceService {
|
|
117
|
+
readonly history: (subject: Subject, input: {
|
|
118
|
+
readonly tenantId: string;
|
|
119
|
+
readonly ownerId: string;
|
|
120
|
+
readonly limit: number;
|
|
121
|
+
}) => Effect.Effect<AchievementStatHistory, ProgressionError>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare interface AchievementStoreOptions {
|
|
125
|
+
readonly definitions: readonly (AchievementDefinition | Achievement)[];
|
|
126
|
+
readonly source: AchievementStatSourceService;
|
|
127
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
128
|
+
readonly maxHistoryRows?: number | undefined;
|
|
129
|
+
readonly maxPendingRewards?: number | undefined;
|
|
130
|
+
readonly now?: (() => number) | undefined;
|
|
131
|
+
readonly strategies?: {
|
|
132
|
+
readonly achievementEvaluator?: AchievementEvaluator | undefined;
|
|
133
|
+
readonly version?: string;
|
|
134
|
+
} | undefined;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare interface AchievementTier {
|
|
138
|
+
readonly id: string;
|
|
139
|
+
readonly condition: AchievementCondition;
|
|
140
|
+
readonly reward: readonly ProgressionReward[];
|
|
141
|
+
readonly platform: AchievementPlatform;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare interface AchievementTierDefinition {
|
|
145
|
+
readonly id: string;
|
|
146
|
+
readonly condition: AchievementCondition;
|
|
147
|
+
readonly reward?: readonly ProgressionReward[];
|
|
148
|
+
readonly platform?: AchievementPlatform;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export declare interface ApplyStatInput {
|
|
152
|
+
readonly tenantId: string;
|
|
153
|
+
readonly ownerId: string;
|
|
154
|
+
readonly stat: string;
|
|
155
|
+
readonly period: 'lifetime' | 'season';
|
|
156
|
+
readonly seasonId?: string | null;
|
|
157
|
+
readonly operator: StatOperator;
|
|
158
|
+
readonly operand: ProgressValue;
|
|
159
|
+
readonly requestId: string;
|
|
160
|
+
readonly source: string;
|
|
161
|
+
readonly origin: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export declare const applyStatValue: (previous: ProgressValue | null, operand: ProgressValue, operator: StatOperator, stat: ProgressionStat) => string;
|
|
165
|
+
|
|
166
|
+
export declare interface ApplyXpInput {
|
|
167
|
+
readonly tenantId: string;
|
|
168
|
+
readonly ownerId: string;
|
|
169
|
+
readonly trackId: string;
|
|
170
|
+
readonly amount: ProgressValue;
|
|
171
|
+
readonly requestId: string;
|
|
172
|
+
readonly source: string;
|
|
173
|
+
readonly origin: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare interface AssignQuestsInput {
|
|
177
|
+
readonly tenantId: string;
|
|
178
|
+
readonly ownerId: string;
|
|
179
|
+
readonly poolId: string;
|
|
180
|
+
readonly requestId: string;
|
|
181
|
+
readonly expectedPoolDigest?: string;
|
|
182
|
+
readonly windowId: string;
|
|
183
|
+
readonly from: number;
|
|
184
|
+
readonly until: number;
|
|
185
|
+
readonly timezone: string;
|
|
186
|
+
readonly seed: number;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export declare const captureAchievementCondition: (input: unknown) => AchievementCondition;
|
|
190
|
+
|
|
191
|
+
export declare const captureAchievementPlatform: (input: unknown) => AchievementPlatform;
|
|
192
|
+
|
|
193
|
+
export declare const captureAchievementStats: (input: unknown) => readonly AchievementStat[];
|
|
194
|
+
|
|
195
|
+
/** Admit accepted custom-slot output for journal repair without calling historical strategies. */
|
|
196
|
+
export declare const capturePlayerRank: (input: unknown, ladder: RankLadder, rulesVersion: string) => PlayerRank;
|
|
197
|
+
|
|
198
|
+
export declare const captureRankRating: (input: unknown, pool: string) => RankRating;
|
|
199
|
+
|
|
200
|
+
export declare const captureRankSeasonState: (input: unknown, season: RankSeason, ladder: RankLadder, rulesVersion: string) => RankSeasonState;
|
|
201
|
+
|
|
202
|
+
export declare const closeRankSeasonState: (season: RankSeason, ladder: RankLadder, beforeInput: RankSeasonState, at: number, resetScore: number | null, rulesVersion: string) => RankSeasonState;
|
|
203
|
+
|
|
204
|
+
export declare const composite: (conditions: readonly AchievementCondition[], mode?: "all" | "any") => AchievementCondition;
|
|
205
|
+
|
|
206
|
+
export declare interface CompositeCondition {
|
|
207
|
+
readonly kind: 'composite';
|
|
208
|
+
readonly mode: 'all' | 'any';
|
|
209
|
+
readonly conditions: readonly AchievementCondition[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare interface DailyAudit {
|
|
213
|
+
readonly claims: number;
|
|
214
|
+
readonly rewardRows: number;
|
|
215
|
+
readonly calendars: number;
|
|
216
|
+
readonly matches: boolean;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare interface DailyClaimInput {
|
|
220
|
+
readonly calendarId: string;
|
|
221
|
+
readonly requestId: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare interface DailyClaimPlan {
|
|
225
|
+
readonly dayIndex: number;
|
|
226
|
+
readonly streak: number;
|
|
227
|
+
readonly protectionRemaining: number;
|
|
228
|
+
readonly cycle: number;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare type DailyClaimPolicy = (input: DailyClaimPolicyContext) => DailyClaimPlan;
|
|
232
|
+
|
|
233
|
+
export declare interface DailyClaimPolicyContext {
|
|
234
|
+
readonly calendar: LoginCalendar;
|
|
235
|
+
readonly previous: DailyState | null;
|
|
236
|
+
readonly window: DailyWindow;
|
|
237
|
+
readonly at: number;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export declare interface DailyPluginOptions extends DailyStoreOptions {
|
|
241
|
+
readonly service?: LoginCalendarService | undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export declare interface DailyProfile {
|
|
245
|
+
readonly timezone: string;
|
|
246
|
+
readonly version: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export declare class DailyProfileSource extends DailyProfileSource_base {
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare const DailyProfileSource_base: Context.ServiceClass<DailyProfileSource, "@voltro/DailyProfileSource", DailyProfileSourceService>;
|
|
253
|
+
|
|
254
|
+
export declare interface DailyProfileSourceService {
|
|
255
|
+
readonly read: (subject: Subject, scope: {
|
|
256
|
+
readonly tenantId: string;
|
|
257
|
+
readonly ownerId: string;
|
|
258
|
+
}) => Effect.Effect<DailyProfile, ProgressionError>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare interface DailyReceipt {
|
|
262
|
+
readonly operationId: string;
|
|
263
|
+
readonly claimId: string;
|
|
264
|
+
readonly calendarId: string;
|
|
265
|
+
readonly dayKey: string;
|
|
266
|
+
readonly after: DailyState;
|
|
267
|
+
readonly rewardsQueued: number;
|
|
268
|
+
readonly at: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare interface DailySqlService extends LoginCalendarService {
|
|
272
|
+
readonly auditDaily: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<DailyAudit, ProgressionError>;
|
|
273
|
+
readonly rebuildDaily: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<DailyAudit, ProgressionError>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export declare interface DailyState extends DailyWindow {
|
|
277
|
+
readonly calendarId: string;
|
|
278
|
+
readonly version: number;
|
|
279
|
+
readonly dayIndex: number;
|
|
280
|
+
readonly streak: number;
|
|
281
|
+
readonly protectionRemaining: number;
|
|
282
|
+
readonly cycle: number;
|
|
283
|
+
readonly at: number;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare interface DailyStoreOptions {
|
|
287
|
+
readonly calendars: readonly LoginCalendarDefinition[];
|
|
288
|
+
readonly profileSource: DailyProfileSourceService;
|
|
289
|
+
readonly now?: (() => number) | undefined;
|
|
290
|
+
readonly maxHistoryRows?: number | undefined;
|
|
291
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
292
|
+
readonly strategies?: {
|
|
293
|
+
readonly claimPolicy?: DailyClaimPolicy | undefined;
|
|
294
|
+
readonly version?: string;
|
|
295
|
+
} | undefined;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export declare interface DailyWindow {
|
|
299
|
+
readonly dayKey: string;
|
|
300
|
+
readonly dayOrdinal: number;
|
|
301
|
+
readonly from: number;
|
|
302
|
+
readonly until: number;
|
|
303
|
+
readonly timezone: string;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export declare const defaultAchievementEvaluator: AchievementEvaluator;
|
|
307
|
+
|
|
308
|
+
export declare const defaultDailyClaimPolicy: DailyClaimPolicy;
|
|
309
|
+
|
|
310
|
+
/** Effect Cron owns the timezone/DST boundary; day ordinals count civil dates, not 24-hour intervals. */
|
|
311
|
+
export declare const defaultDailyWindow: (input: {
|
|
312
|
+
readonly timezone: string;
|
|
313
|
+
readonly at: number;
|
|
314
|
+
}) => DailyWindow;
|
|
315
|
+
|
|
316
|
+
export declare const defaultPassCatchUp: PassCatchUp;
|
|
317
|
+
|
|
318
|
+
export declare const defaultQuestProgressResolver: QuestProgressResolver;
|
|
319
|
+
|
|
320
|
+
/** Deterministic weighted selection without replacement; a trusted seed is not a security RNG. */
|
|
321
|
+
export declare const defaultQuestSelector: QuestSelector;
|
|
322
|
+
|
|
323
|
+
/** Effect's timezone-aware Cron is the single parser/calendar implementation. */
|
|
324
|
+
export declare const defaultQuestWindow: QuestWindowResolver;
|
|
325
|
+
|
|
326
|
+
/** A read-only displayed score; it never writes or claims to decay the Ratings SQL pool. */
|
|
327
|
+
export declare const defaultRankDecay: RankDecayResolver;
|
|
328
|
+
|
|
329
|
+
export declare const defaultRankGrade: RankGradeResolver;
|
|
330
|
+
|
|
331
|
+
export declare const defaultRankScore: RankScoreResolver;
|
|
332
|
+
|
|
333
|
+
export declare const defaultRankSeasonReset: RankSeasonReset;
|
|
334
|
+
|
|
335
|
+
export declare const defaultResourceRegen: ResourceRegenResolver;
|
|
336
|
+
|
|
337
|
+
export declare const defaultRewardResolver: RewardResolver;
|
|
338
|
+
|
|
339
|
+
export declare const defaultTutorialStepPolicy: TutorialStepPolicy;
|
|
340
|
+
|
|
341
|
+
export declare const defaultXpCurve: XpCurve;
|
|
342
|
+
|
|
343
|
+
export declare const defineAchievement: (input: AchievementDefinition | Achievement) => Achievement;
|
|
344
|
+
|
|
345
|
+
export declare const defineLoginCalendar: (input: LoginCalendarDefinition) => LoginCalendar;
|
|
346
|
+
|
|
347
|
+
export declare const defineProgression: (input: ProgressionDefinition) => ProgressionTrack;
|
|
348
|
+
|
|
349
|
+
export declare const defineQuest: (input: QuestDefinition) => QuestDefinition;
|
|
350
|
+
|
|
351
|
+
export declare const defineQuestPool: (input: QuestPoolDefinition) => QuestPool;
|
|
352
|
+
|
|
353
|
+
export declare const defineRankLadder: (input: RankLadderDefinition | RankLadder) => RankLadder;
|
|
354
|
+
|
|
355
|
+
export declare const defineRankSeason: (input: RankSeasonDefinition | RankSeason, ladder: RankLadder) => RankSeason;
|
|
356
|
+
|
|
357
|
+
export declare const defineRegenResource: (input: RegenResourceDefinition | RegenResource) => RegenResource;
|
|
358
|
+
|
|
359
|
+
/** UTC elapsed days govern pass catch-up; player timezone does not change a season. */
|
|
360
|
+
export declare const defineSeasonPass: (input: SeasonPassDefinition | SeasonPass) => SeasonPass;
|
|
361
|
+
|
|
362
|
+
export declare const defineStat: (input: StatDefinition) => ProgressionStat;
|
|
363
|
+
|
|
364
|
+
export declare const defineTutorial: (input: TutorialDefinition | Tutorial) => Tutorial;
|
|
365
|
+
|
|
366
|
+
export declare interface EvaluateAchievementsInput {
|
|
367
|
+
readonly tenantId: string;
|
|
368
|
+
readonly ownerId: string;
|
|
369
|
+
readonly requestId: string;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export declare const explicitLevelCurve: (thresholds: readonly ProgressValue[]) => LevelCurve;
|
|
373
|
+
|
|
374
|
+
export declare const grant: (currency: string, amount: ProgressValue) => ProgressionReward;
|
|
375
|
+
|
|
376
|
+
export declare const grantItem: (itemId: string, qty?: number) => ProgressionReward;
|
|
377
|
+
|
|
378
|
+
export declare type InitializeResourceInput = Omit<ResourceChangeInput, 'amount'>;
|
|
379
|
+
|
|
380
|
+
export declare const initialRankSeasonState: (season: RankSeason) => RankSeasonState;
|
|
381
|
+
|
|
382
|
+
export declare interface LevelCurve {
|
|
383
|
+
readonly thresholds: readonly string[];
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Recurrence rounds the next per-level requirement up using an exact decimal ratio. */
|
|
387
|
+
export declare const levelCurve: (input: {
|
|
388
|
+
readonly base: ProgressValue;
|
|
389
|
+
readonly growth: number;
|
|
390
|
+
readonly maxLevel: number;
|
|
391
|
+
}) => LevelCurve;
|
|
392
|
+
|
|
393
|
+
declare interface LevelReward {
|
|
394
|
+
readonly level: number;
|
|
395
|
+
readonly reward: ProgressionReward;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export declare interface LoginCalendar {
|
|
399
|
+
readonly id: string;
|
|
400
|
+
readonly version: number;
|
|
401
|
+
readonly days: readonly (readonly ProgressionReward[])[];
|
|
402
|
+
readonly streakProtection: number;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export declare interface LoginCalendarDefinition {
|
|
406
|
+
readonly id: string;
|
|
407
|
+
readonly version?: number;
|
|
408
|
+
readonly days: readonly (readonly ProgressionReward[])[];
|
|
409
|
+
readonly streakProtection?: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export declare class LoginCalendarPort extends LoginCalendarPort_base {
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
declare const LoginCalendarPort_base: Context.ServiceClass<LoginCalendarPort, "@voltro/LoginCalendarPort", LoginCalendarService>;
|
|
416
|
+
|
|
417
|
+
export declare interface LoginCalendarService {
|
|
418
|
+
readonly claim: (subject: Subject, input: DailyClaimInput) => Effect.Effect<DailyReceipt, ProgressionError>;
|
|
419
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerDaily[], ProgressionError>;
|
|
420
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
421
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare interface PassAudit {
|
|
425
|
+
readonly operations: number;
|
|
426
|
+
readonly passes: number;
|
|
427
|
+
readonly rewardRows: number;
|
|
428
|
+
readonly matches: boolean;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export declare type PassCatchUp = (input: PassCatchUpContext) => ProgressValue;
|
|
432
|
+
|
|
433
|
+
export declare interface PassCatchUpContext {
|
|
434
|
+
readonly pass: SeasonPass;
|
|
435
|
+
readonly amount: string;
|
|
436
|
+
readonly at: number;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export declare interface PassClaimInput {
|
|
440
|
+
readonly passId: string;
|
|
441
|
+
readonly tier: number;
|
|
442
|
+
readonly track: PassTrack;
|
|
443
|
+
readonly requestId: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare interface PassCloseInput {
|
|
447
|
+
readonly tenantId: string;
|
|
448
|
+
readonly ownerId: string;
|
|
449
|
+
readonly passId: string;
|
|
450
|
+
readonly requestId: string;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export declare interface PassPluginOptions extends PassStoreOptions {
|
|
454
|
+
readonly service?: SeasonPassService | undefined;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export declare interface PassPremiumInput {
|
|
458
|
+
readonly tenantId: string;
|
|
459
|
+
readonly ownerId: string;
|
|
460
|
+
readonly passId: string;
|
|
461
|
+
readonly offerId: string;
|
|
462
|
+
readonly fulfillmentId: string;
|
|
463
|
+
readonly requestId: string;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export declare interface PassReceipt {
|
|
467
|
+
readonly operationId: string;
|
|
468
|
+
readonly kind: 'xp' | 'premium' | 'claim' | 'close';
|
|
469
|
+
readonly after: PassState;
|
|
470
|
+
readonly claims: readonly PassTierClaim[];
|
|
471
|
+
readonly rewardsQueued: number;
|
|
472
|
+
readonly at: number;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare interface PassSqlService extends SeasonPassService {
|
|
476
|
+
readonly auditPasses: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<PassAudit, ProgressionError>;
|
|
477
|
+
readonly rebuildPasses: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<PassAudit, ProgressionError>;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export declare interface PassState {
|
|
481
|
+
readonly passId: string;
|
|
482
|
+
readonly version: number;
|
|
483
|
+
readonly xp: string;
|
|
484
|
+
readonly claimedFree: string;
|
|
485
|
+
readonly claimedPremium: string;
|
|
486
|
+
readonly premium: boolean;
|
|
487
|
+
readonly purchasedAt: number | null;
|
|
488
|
+
readonly fulfillmentId: string | null;
|
|
489
|
+
readonly closed: boolean;
|
|
490
|
+
readonly updatedAt: number;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
declare interface PassStoreOptions {
|
|
494
|
+
readonly definitions: readonly (SeasonPassDefinition | SeasonPass)[];
|
|
495
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
496
|
+
readonly now?: (() => number) | undefined;
|
|
497
|
+
readonly maxHistoryRows?: number | undefined;
|
|
498
|
+
readonly maxPendingRewards?: number | undefined;
|
|
499
|
+
readonly strategies?: {
|
|
500
|
+
readonly passCatchUp?: PassCatchUp | undefined;
|
|
501
|
+
readonly version?: string;
|
|
502
|
+
} | undefined;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export declare interface PassTierClaim {
|
|
506
|
+
readonly tier: number;
|
|
507
|
+
readonly track: PassTrack;
|
|
508
|
+
readonly rewards: readonly ProgressionReward[];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export declare type PassTrack = 'free' | 'premium';
|
|
512
|
+
|
|
513
|
+
export declare interface PassXpInput {
|
|
514
|
+
readonly tenantId: string;
|
|
515
|
+
readonly ownerId: string;
|
|
516
|
+
readonly passId: string;
|
|
517
|
+
readonly amount: ProgressValue;
|
|
518
|
+
readonly source: string;
|
|
519
|
+
readonly originId: string;
|
|
520
|
+
readonly requestId: string;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export declare interface PlayerAchievement {
|
|
524
|
+
readonly achievementId: string;
|
|
525
|
+
readonly version: number;
|
|
526
|
+
readonly tierId: string;
|
|
527
|
+
readonly unlocked: boolean;
|
|
528
|
+
readonly unlockedAt: number | null;
|
|
529
|
+
readonly progress: readonly AchievementProgress[];
|
|
530
|
+
readonly platform: AchievementPlatform | null;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export declare interface PlayerDaily {
|
|
534
|
+
readonly calendarId: string;
|
|
535
|
+
readonly version: number;
|
|
536
|
+
readonly dayKey: string;
|
|
537
|
+
readonly timezone: string;
|
|
538
|
+
readonly from: number;
|
|
539
|
+
readonly until: number;
|
|
540
|
+
readonly observedAt: number;
|
|
541
|
+
readonly claimed: boolean;
|
|
542
|
+
readonly dayIndex: number;
|
|
543
|
+
readonly streak: number;
|
|
544
|
+
readonly protectionRemaining: number;
|
|
545
|
+
readonly reward: readonly ProgressionReward[];
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export declare interface PlayerPass extends PassState {
|
|
549
|
+
readonly tier: number;
|
|
550
|
+
readonly from: number;
|
|
551
|
+
readonly until: number;
|
|
552
|
+
readonly observedAt: number;
|
|
553
|
+
readonly active: boolean;
|
|
554
|
+
readonly premiumOffer: string | null;
|
|
555
|
+
readonly claimable: readonly PassTierClaim[];
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export declare interface PlayerQuest {
|
|
559
|
+
readonly id: string;
|
|
560
|
+
readonly poolId: string;
|
|
561
|
+
readonly windowId: string;
|
|
562
|
+
readonly quest: QuestDefinition;
|
|
563
|
+
readonly progress: readonly number[];
|
|
564
|
+
readonly state: 'active' | 'completed';
|
|
565
|
+
readonly assignedAt: number;
|
|
566
|
+
readonly expiresAt: number;
|
|
567
|
+
readonly rerollsUsed: number;
|
|
568
|
+
readonly rerollsAllowed: number;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export declare interface PlayerRank {
|
|
572
|
+
readonly ladderId: string;
|
|
573
|
+
readonly version: number;
|
|
574
|
+
readonly pool: string;
|
|
575
|
+
readonly games: number;
|
|
576
|
+
readonly placementsRemaining: number;
|
|
577
|
+
readonly rawScore: number;
|
|
578
|
+
readonly score: number;
|
|
579
|
+
readonly grade: RankGrade | null;
|
|
580
|
+
readonly ratingUpdatedAt: number | null;
|
|
581
|
+
readonly observedAt: number;
|
|
582
|
+
readonly rulesVersion: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export declare interface PlayerResource {
|
|
586
|
+
readonly resourceId: string;
|
|
587
|
+
readonly value: string;
|
|
588
|
+
readonly max: string;
|
|
589
|
+
readonly initialized: boolean;
|
|
590
|
+
readonly observedAt: number;
|
|
591
|
+
readonly nextRegenAt: number | null;
|
|
592
|
+
readonly refillOffer?: string;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export declare interface PlayerStat {
|
|
596
|
+
readonly stat: string;
|
|
597
|
+
readonly period: 'lifetime' | 'season';
|
|
598
|
+
readonly seasonId: string | null;
|
|
599
|
+
readonly value: string;
|
|
600
|
+
readonly updatedAt: number;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export declare interface PlayerTrack {
|
|
604
|
+
readonly trackId: string;
|
|
605
|
+
readonly xp: string;
|
|
606
|
+
readonly level: number;
|
|
607
|
+
readonly prestige: number;
|
|
608
|
+
readonly updatedAt: number | null;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export declare interface PlayerTutorial extends TutorialState {
|
|
612
|
+
readonly nextStep: string | null;
|
|
613
|
+
readonly skippable: boolean;
|
|
614
|
+
readonly hints: string | null;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
export declare const progressionAchievementsSystemContract: Readonly<{
|
|
618
|
+
slots: {
|
|
619
|
+
achievementEvaluator: {
|
|
620
|
+
defaultExport: string;
|
|
621
|
+
fixtureExport: string;
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
ports: {
|
|
625
|
+
achievements: {
|
|
626
|
+
tagExport: string;
|
|
627
|
+
fakeLayerExport: string;
|
|
628
|
+
fixtureExport: string;
|
|
629
|
+
};
|
|
630
|
+
achievementStatSource: {
|
|
631
|
+
tagExport: string;
|
|
632
|
+
fakeLayerExport: string;
|
|
633
|
+
fixtureExport: string;
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
events: readonly string[];
|
|
637
|
+
}>;
|
|
638
|
+
|
|
639
|
+
declare interface ProgressionAudit {
|
|
640
|
+
readonly tracks: number;
|
|
641
|
+
readonly stats: number;
|
|
642
|
+
readonly acceptedOperations: number;
|
|
643
|
+
readonly xpLedgerRows: number;
|
|
644
|
+
readonly statLedgerRows: number;
|
|
645
|
+
readonly rewardRows: number;
|
|
646
|
+
readonly matches: boolean;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
declare type ProgressionChange = {
|
|
650
|
+
readonly kind: 'xp';
|
|
651
|
+
readonly trackId: string;
|
|
652
|
+
readonly xp: string;
|
|
653
|
+
readonly delta: string;
|
|
654
|
+
readonly fromLevel: number;
|
|
655
|
+
readonly toLevel: number;
|
|
656
|
+
} | {
|
|
657
|
+
readonly kind: 'stat';
|
|
658
|
+
readonly stat: string;
|
|
659
|
+
readonly period: 'lifetime' | 'season';
|
|
660
|
+
readonly seasonId: string | null;
|
|
661
|
+
readonly value: string;
|
|
662
|
+
readonly operator: StatOperator;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
export declare const progressionDailySystemContract: Readonly<{
|
|
666
|
+
slots: {
|
|
667
|
+
dailyClaimPolicy: {
|
|
668
|
+
defaultExport: string;
|
|
669
|
+
fixtureExport: string;
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
ports: {
|
|
673
|
+
daily: {
|
|
674
|
+
tagExport: string;
|
|
675
|
+
fakeLayerExport: string;
|
|
676
|
+
fixtureExport: string;
|
|
677
|
+
};
|
|
678
|
+
dailyProfileSource: {
|
|
679
|
+
tagExport: string;
|
|
680
|
+
fakeLayerExport: string;
|
|
681
|
+
fixtureExport: string;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
events: readonly string[];
|
|
685
|
+
}>;
|
|
686
|
+
|
|
687
|
+
export declare interface ProgressionDefinition {
|
|
688
|
+
readonly id: string;
|
|
689
|
+
readonly version?: number;
|
|
690
|
+
readonly xpCurve: LevelCurve;
|
|
691
|
+
readonly sources: readonly string[];
|
|
692
|
+
readonly rewards?: Readonly<Record<string, readonly ProgressionReward[] | Readonly<Record<string, readonly ProgressionReward[]>>>>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export declare class ProgressionError extends ProgressionError_base {
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
declare const ProgressionError_base: Schema.Class<ProgressionError, Schema.TaggedStruct<"ProgressionError", {
|
|
699
|
+
readonly code: Schema.Literals<readonly ["invalid_input", "invalid_record", "invalid_curve", "invalid_reward", "invalid_track", "invalid_stat", "overflow", "insufficient_resource", "forbidden", "conflict", "erased", "not_found", "limit_exceeded", "unavailable"]>;
|
|
700
|
+
}>, YieldableError>;
|
|
701
|
+
|
|
702
|
+
export declare const progressionPassesSystemContract: Readonly<{
|
|
703
|
+
slots: {
|
|
704
|
+
passCatchUp: {
|
|
705
|
+
defaultExport: string;
|
|
706
|
+
fixtureExport: string;
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
ports: {
|
|
710
|
+
passes: {
|
|
711
|
+
tagExport: string;
|
|
712
|
+
fakeLayerExport: string;
|
|
713
|
+
fixtureExport: string;
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
events: readonly string[];
|
|
717
|
+
}>;
|
|
718
|
+
|
|
719
|
+
export declare interface ProgressionPlugin extends VoltroPlugin {
|
|
720
|
+
readonly progression: {
|
|
721
|
+
readonly service: () => ProgressionService;
|
|
722
|
+
readonly auditProgression: ProgressionSqlService['auditProgression'];
|
|
723
|
+
readonly rebuildProgression: ProgressionSqlService['rebuildProgression'];
|
|
724
|
+
readonly quests: () => QuestService;
|
|
725
|
+
readonly questRefresh: () => QuestRefreshService;
|
|
726
|
+
readonly ranks: () => RankSeasonService;
|
|
727
|
+
readonly rankClosure: () => RankClosureService;
|
|
728
|
+
readonly auditRanks: RankSqlService['auditRanks'];
|
|
729
|
+
readonly rebuildRanks: RankSqlService['rebuildRanks'];
|
|
730
|
+
readonly tutorials: () => TutorialService;
|
|
731
|
+
readonly auditTutorials: TutorialSqlService['auditTutorials'];
|
|
732
|
+
readonly rebuildTutorials: TutorialSqlService['rebuildTutorials'];
|
|
733
|
+
readonly passes: () => SeasonPassService;
|
|
734
|
+
readonly auditPasses: PassSqlService['auditPasses'];
|
|
735
|
+
readonly rebuildPasses: PassSqlService['rebuildPasses'];
|
|
736
|
+
readonly daily: () => LoginCalendarService;
|
|
737
|
+
readonly auditDaily: DailySqlService['auditDaily'];
|
|
738
|
+
readonly rebuildDaily: DailySqlService['rebuildDaily'];
|
|
739
|
+
readonly delivery: () => RewardDeliveryService;
|
|
740
|
+
readonly achievements: () => AchievementService;
|
|
741
|
+
readonly auditAchievements: AchievementSqlService['auditAchievements'];
|
|
742
|
+
readonly rebuildAchievements: AchievementSqlService['rebuildAchievements'];
|
|
743
|
+
readonly resources: () => RegenResourceService;
|
|
744
|
+
readonly auditResources: ResourceSqlService['auditResources'];
|
|
745
|
+
readonly rebuildResources: ResourceSqlService['rebuildResources'];
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export declare const progressionPlugin: (input: ProgressionPluginOptions) => ProgressionPlugin;
|
|
750
|
+
|
|
751
|
+
export declare interface ProgressionPluginOptions extends ProgressionStoreOptions {
|
|
752
|
+
readonly service?: ProgressionService | undefined;
|
|
753
|
+
readonly quests?: QuestPluginOptions;
|
|
754
|
+
readonly resources?: ResourcePluginOptions;
|
|
755
|
+
readonly achievements?: AchievementPluginOptions;
|
|
756
|
+
readonly delivery?: RewardDeliveryOptions;
|
|
757
|
+
readonly daily?: DailyPluginOptions;
|
|
758
|
+
readonly passes?: PassPluginOptions;
|
|
759
|
+
readonly tutorials?: TutorialPluginOptions;
|
|
760
|
+
readonly ranks?: RankPluginOptions;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export declare class ProgressionPort extends ProgressionPort_base {
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
declare const ProgressionPort_base: Context.ServiceClass<ProgressionPort, "@voltro/ProgressionPort", ProgressionService>;
|
|
767
|
+
|
|
768
|
+
/** System21 manifest of the installed core track/stat system. Optional quests, resources, achievements,
|
|
769
|
+
* daily calendars, passes and ranks contribute their own slots, ports and tables. */
|
|
770
|
+
export declare const progressionQuestsSystemContract: Readonly<{
|
|
771
|
+
slots: {
|
|
772
|
+
questSelector: {
|
|
773
|
+
defaultExport: string;
|
|
774
|
+
fixtureExport: string;
|
|
775
|
+
};
|
|
776
|
+
questProgressResolver: {
|
|
777
|
+
defaultExport: string;
|
|
778
|
+
fixtureExport: string;
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
ports: {
|
|
782
|
+
quests: {
|
|
783
|
+
tagExport: string;
|
|
784
|
+
fakeLayerExport: string;
|
|
785
|
+
fixtureExport: string;
|
|
786
|
+
};
|
|
787
|
+
questSource: {
|
|
788
|
+
tagExport: string;
|
|
789
|
+
fakeLayerExport: string;
|
|
790
|
+
fixtureExport: string;
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
events: readonly string[];
|
|
794
|
+
}>;
|
|
795
|
+
|
|
796
|
+
export declare const progressionRanksSystemContract: Readonly<{
|
|
797
|
+
slots: {
|
|
798
|
+
rankScore: {
|
|
799
|
+
defaultExport: string;
|
|
800
|
+
fixtureExport: string;
|
|
801
|
+
};
|
|
802
|
+
rankDecay: {
|
|
803
|
+
defaultExport: string;
|
|
804
|
+
fixtureExport: string;
|
|
805
|
+
};
|
|
806
|
+
rankGrade: {
|
|
807
|
+
defaultExport: string;
|
|
808
|
+
fixtureExport: string;
|
|
809
|
+
};
|
|
810
|
+
rankSeasonReset: {
|
|
811
|
+
defaultExport: string;
|
|
812
|
+
fixtureExport: string;
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
ports: {
|
|
816
|
+
ranks: {
|
|
817
|
+
tagExport: string;
|
|
818
|
+
fakeLayerExport: string;
|
|
819
|
+
fixtureExport: string;
|
|
820
|
+
};
|
|
821
|
+
rankRatingSource: {
|
|
822
|
+
tagExport: string;
|
|
823
|
+
fakeLayerExport: string;
|
|
824
|
+
fixtureExport: string;
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
events: readonly string[];
|
|
828
|
+
}>;
|
|
829
|
+
|
|
830
|
+
export declare interface ProgressionReceipt {
|
|
831
|
+
readonly operationId: string;
|
|
832
|
+
readonly at: number;
|
|
833
|
+
readonly change: ProgressionChange;
|
|
834
|
+
readonly rewardsQueued: number;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export declare const progressionResourcesSystemContract: Readonly<{
|
|
838
|
+
slots: {
|
|
839
|
+
resourceRegen: {
|
|
840
|
+
defaultExport: string;
|
|
841
|
+
fixtureExport: string;
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
ports: {
|
|
845
|
+
resources: {
|
|
846
|
+
tagExport: string;
|
|
847
|
+
fakeLayerExport: string;
|
|
848
|
+
fixtureExport: string;
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
events: readonly string[];
|
|
852
|
+
}>;
|
|
853
|
+
|
|
854
|
+
export declare type ProgressionReward = {
|
|
855
|
+
readonly kind: 'currency';
|
|
856
|
+
readonly currency: string;
|
|
857
|
+
readonly amount: string;
|
|
858
|
+
} | {
|
|
859
|
+
readonly kind: 'item';
|
|
860
|
+
readonly itemId: string;
|
|
861
|
+
readonly qty: number;
|
|
862
|
+
} | {
|
|
863
|
+
readonly kind: 'xp';
|
|
864
|
+
readonly trackId: string;
|
|
865
|
+
readonly amount: string;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
export declare interface ProgressionService {
|
|
869
|
+
readonly applyXp: (subject: Subject, input: ApplyXpInput) => Effect.Effect<ProgressionReceipt, ProgressionError>;
|
|
870
|
+
readonly applyStat: (subject: Subject, input: ApplyStatInput) => Effect.Effect<ProgressionReceipt, ProgressionError>;
|
|
871
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerTrack[], ProgressionError>;
|
|
872
|
+
readonly stats: (subject: Subject) => Effect.Effect<readonly PlayerStat[], ProgressionError>;
|
|
873
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
874
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare interface ProgressionSqlService extends ProgressionService {
|
|
878
|
+
readonly achievementHistory: (subject: Subject, tenantId: string, ownerId: string, limit: number) => Effect.Effect<AchievementStatHistory, ProgressionError>;
|
|
879
|
+
readonly auditProgression: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ProgressionAudit, ProgressionError>;
|
|
880
|
+
readonly rebuildProgression: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ProgressionAudit, ProgressionError>;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export declare interface ProgressionStat {
|
|
884
|
+
readonly id: string;
|
|
885
|
+
readonly initial: string;
|
|
886
|
+
readonly cap: string;
|
|
887
|
+
readonly operators: readonly StatOperator[];
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
declare interface ProgressionStoreOptions {
|
|
891
|
+
readonly tracks: readonly ProgressionDefinition[];
|
|
892
|
+
readonly stats?: readonly StatDefinition[] | undefined;
|
|
893
|
+
readonly statSources?: readonly string[] | undefined;
|
|
894
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
895
|
+
readonly maxHistoryRows?: number | undefined;
|
|
896
|
+
readonly maxPendingRewards?: number | undefined;
|
|
897
|
+
readonly now?: (() => number) | undefined;
|
|
898
|
+
readonly strategies?: {
|
|
899
|
+
readonly xpCurve?: XpCurve | undefined;
|
|
900
|
+
readonly rewardResolver?: RewardResolver;
|
|
901
|
+
readonly version?: string;
|
|
902
|
+
} | undefined;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
export declare const progressionSystemContract: Readonly<{
|
|
906
|
+
slots: {
|
|
907
|
+
xpCurve: {
|
|
908
|
+
defaultExport: string;
|
|
909
|
+
fixtureExport: string;
|
|
910
|
+
};
|
|
911
|
+
rewardResolver: {
|
|
912
|
+
defaultExport: string;
|
|
913
|
+
fixtureExport: string;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
ports: {
|
|
917
|
+
progression: {
|
|
918
|
+
tagExport: string;
|
|
919
|
+
fakeLayerExport: string;
|
|
920
|
+
fixtureExport: string;
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
events: readonly string[];
|
|
924
|
+
}>;
|
|
925
|
+
|
|
926
|
+
export declare interface ProgressionTrack {
|
|
927
|
+
readonly id: string;
|
|
928
|
+
readonly version: number;
|
|
929
|
+
readonly xpCurve: LevelCurve;
|
|
930
|
+
readonly sources: readonly string[];
|
|
931
|
+
readonly rewards: Readonly<Record<string, readonly ProgressionReward[]>>;
|
|
932
|
+
readonly every: Readonly<Record<string, readonly ProgressionReward[]>>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
export declare const progressionTutorialsSystemContract: Readonly<{
|
|
936
|
+
slots: {
|
|
937
|
+
tutorialStepPolicy: {
|
|
938
|
+
defaultExport: string;
|
|
939
|
+
fixtureExport: string;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
ports: {
|
|
943
|
+
tutorials: {
|
|
944
|
+
tagExport: string;
|
|
945
|
+
fakeLayerExport: string;
|
|
946
|
+
fixtureExport: string;
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
events: readonly string[];
|
|
950
|
+
}>;
|
|
951
|
+
|
|
952
|
+
declare type ProgressValue = string | number | bigint;
|
|
953
|
+
|
|
954
|
+
export declare interface QuestDefinition {
|
|
955
|
+
readonly id: string;
|
|
956
|
+
readonly titleKey?: string;
|
|
957
|
+
readonly objectives: readonly QuestObjective[];
|
|
958
|
+
readonly reward: readonly ProgressionReward[];
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
declare type QuestObjective = {
|
|
962
|
+
readonly stat: string;
|
|
963
|
+
readonly target: number;
|
|
964
|
+
} | {
|
|
965
|
+
readonly event: string;
|
|
966
|
+
readonly target: number;
|
|
967
|
+
readonly where?: Readonly<Record<string, QuestScalar>>;
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
/** Trusted profile data, obtained from the owning player service; never client input. */
|
|
971
|
+
export declare interface QuestPlayer {
|
|
972
|
+
readonly tenantId: string;
|
|
973
|
+
readonly ownerId: string;
|
|
974
|
+
readonly timezone: string;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export declare class QuestPlayerSource extends QuestPlayerSource_base {
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
declare const QuestPlayerSource_base: Context.ServiceClass<QuestPlayerSource, "@voltro/QuestPlayerSource", QuestPlayerSourceService>;
|
|
981
|
+
|
|
982
|
+
export declare interface QuestPlayerSourceService {
|
|
983
|
+
/** Complete bounded roster. Return over-limit as an error; do not truncate it silently. */
|
|
984
|
+
readonly read: (input: {
|
|
985
|
+
readonly limit: number;
|
|
986
|
+
}) => Effect.Effect<readonly QuestPlayer[], ProgressionError>;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export declare interface QuestPluginOptions extends QuestStoreOptions {
|
|
990
|
+
readonly service?: QuestService | undefined;
|
|
991
|
+
readonly refresh?: QuestRefreshOptions;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export declare interface QuestPool extends QuestPoolDefinition {
|
|
995
|
+
readonly version: number;
|
|
996
|
+
readonly rerolls: number;
|
|
997
|
+
readonly weights: Readonly<Record<string, number>>;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
export declare interface QuestPoolDefinition {
|
|
1001
|
+
readonly id: string;
|
|
1002
|
+
readonly version?: number;
|
|
1003
|
+
readonly slots: number;
|
|
1004
|
+
readonly rerolls?: number;
|
|
1005
|
+
readonly refresh: {
|
|
1006
|
+
readonly cron: string;
|
|
1007
|
+
readonly timezone: string;
|
|
1008
|
+
};
|
|
1009
|
+
readonly quests: readonly QuestDefinition[];
|
|
1010
|
+
readonly weights?: Readonly<Record<string, number>>;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
export declare class QuestPort extends QuestPort_base {
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
declare const QuestPort_base: Context.ServiceClass<QuestPort, "@voltro/QuestPort", QuestService>;
|
|
1017
|
+
|
|
1018
|
+
declare interface QuestProgressContext {
|
|
1019
|
+
readonly quest: QuestDefinition;
|
|
1020
|
+
readonly progress: readonly number[];
|
|
1021
|
+
readonly signal: QuestSignal;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
export declare type QuestProgressResolver = (context: QuestProgressContext) => readonly number[];
|
|
1025
|
+
|
|
1026
|
+
export declare interface QuestReceipt {
|
|
1027
|
+
readonly operationId: string;
|
|
1028
|
+
readonly kind: 'assign' | 'record' | 'reroll';
|
|
1029
|
+
readonly assignmentIds: readonly string[];
|
|
1030
|
+
readonly completedIds: readonly string[];
|
|
1031
|
+
readonly rewardsQueued: number;
|
|
1032
|
+
readonly at: number;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export declare interface QuestRefreshOptions {
|
|
1036
|
+
readonly players: QuestPlayerSourceService;
|
|
1037
|
+
readonly intervalMs?: number;
|
|
1038
|
+
readonly maxPlayers?: number;
|
|
1039
|
+
readonly strategies?: {
|
|
1040
|
+
readonly questWindow?: QuestWindowResolver | undefined;
|
|
1041
|
+
readonly questSeed?: QuestSeedResolver;
|
|
1042
|
+
readonly version?: string;
|
|
1043
|
+
} | undefined;
|
|
1044
|
+
readonly service?: QuestRefreshService | undefined;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
export declare class QuestRefreshPort extends QuestRefreshPort_base {
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare const QuestRefreshPort_base: Context.ServiceClass<QuestRefreshPort, "@voltro/QuestRefreshPort", QuestRefreshService>;
|
|
1051
|
+
|
|
1052
|
+
export declare interface QuestRefreshReport {
|
|
1053
|
+
readonly players: number;
|
|
1054
|
+
readonly assignments: number;
|
|
1055
|
+
readonly erased: number;
|
|
1056
|
+
readonly failures: readonly ProgressionError['code'][];
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
export declare interface QuestRefreshService {
|
|
1060
|
+
readonly refreshOwner: (subject: Subject, player: QuestPlayer) => Effect.Effect<readonly QuestReceipt[], ProgressionError>;
|
|
1061
|
+
readonly refreshAll: (subject: Subject) => Effect.Effect<QuestRefreshReport, ProgressionError>;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
declare type QuestScalar = string | number | boolean | null;
|
|
1065
|
+
|
|
1066
|
+
export declare interface QuestSeedContext extends QuestWindowContext {
|
|
1067
|
+
readonly window: QuestWindow;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
export declare type QuestSeedResolver = (input: QuestSeedContext) => number;
|
|
1071
|
+
|
|
1072
|
+
export declare type QuestSelector = (context: QuestSelectorContext) => readonly string[];
|
|
1073
|
+
|
|
1074
|
+
declare interface QuestSelectorContext {
|
|
1075
|
+
readonly pool: QuestPool;
|
|
1076
|
+
readonly count: number;
|
|
1077
|
+
readonly seed: number;
|
|
1078
|
+
readonly excluded: readonly string[];
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
export declare interface QuestService {
|
|
1082
|
+
readonly assign: (subject: Subject, input: AssignQuestsInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1083
|
+
readonly record: (subject: Subject, input: RecordQuestInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1084
|
+
readonly reroll: (subject: Subject, input: RerollQuestInput) => Effect.Effect<QuestReceipt, ProgressionError>;
|
|
1085
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerQuest[], ProgressionError>;
|
|
1086
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1087
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
declare type QuestSignal = {
|
|
1091
|
+
readonly kind: 'stat';
|
|
1092
|
+
readonly stat: string;
|
|
1093
|
+
readonly delta: string;
|
|
1094
|
+
} | {
|
|
1095
|
+
readonly kind: 'event';
|
|
1096
|
+
readonly event: string;
|
|
1097
|
+
readonly data: Readonly<Record<string, QuestScalar>>;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
export declare type QuestSignalInput = {
|
|
1101
|
+
readonly kind: 'stat';
|
|
1102
|
+
readonly stat: string;
|
|
1103
|
+
readonly delta: ProgressValue;
|
|
1104
|
+
} | {
|
|
1105
|
+
readonly kind: 'event';
|
|
1106
|
+
readonly event: string;
|
|
1107
|
+
readonly data?: Readonly<Record<string, QuestScalar>>;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
export declare class QuestSource extends QuestSource_base {
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare const QuestSource_base: Context.ServiceClass<QuestSource, "@voltro/QuestSource", QuestSourceService>;
|
|
1114
|
+
|
|
1115
|
+
declare interface QuestSourceScope {
|
|
1116
|
+
readonly tenantId: string;
|
|
1117
|
+
readonly channel: string;
|
|
1118
|
+
readonly locale: string;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export declare interface QuestSourceService {
|
|
1122
|
+
readonly read: (scope: QuestSourceScope) => Effect.Effect<{
|
|
1123
|
+
readonly revision: string;
|
|
1124
|
+
readonly pools: readonly QuestPool[];
|
|
1125
|
+
}, ProgressionError>;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
declare interface QuestStoreOptions {
|
|
1129
|
+
readonly source: QuestSourceService;
|
|
1130
|
+
readonly channel: string;
|
|
1131
|
+
readonly locale: string;
|
|
1132
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1133
|
+
readonly eventSources?: readonly string[] | undefined;
|
|
1134
|
+
readonly statSources?: readonly string[] | undefined;
|
|
1135
|
+
readonly maxWorkRows?: number | undefined;
|
|
1136
|
+
readonly now?: (() => number) | undefined;
|
|
1137
|
+
readonly strategies?: {
|
|
1138
|
+
readonly questSelector?: QuestSelector | undefined;
|
|
1139
|
+
readonly questProgressResolver?: QuestProgressResolver;
|
|
1140
|
+
readonly version?: string;
|
|
1141
|
+
} | undefined;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
declare interface QuestWindow {
|
|
1145
|
+
readonly from: number;
|
|
1146
|
+
readonly until: number;
|
|
1147
|
+
readonly timezone: string;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export declare interface QuestWindowContext {
|
|
1151
|
+
readonly pool: QuestPool;
|
|
1152
|
+
readonly player: QuestPlayer;
|
|
1153
|
+
readonly at: number;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export declare type QuestWindowResolver = (input: QuestWindowContext) => QuestWindow;
|
|
1157
|
+
|
|
1158
|
+
declare interface RankAudit {
|
|
1159
|
+
readonly operations: number;
|
|
1160
|
+
readonly seasons: number;
|
|
1161
|
+
readonly rewardRows: number;
|
|
1162
|
+
readonly matches: boolean;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
export declare interface RankCloseInput extends RankObserveInput {
|
|
1166
|
+
readonly tenantId: string;
|
|
1167
|
+
readonly ownerId: string;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
declare interface RankClosureDispatchInput {
|
|
1171
|
+
readonly limit?: number;
|
|
1172
|
+
readonly after?: string;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
declare interface RankClosureDispatchResult {
|
|
1176
|
+
readonly scanned: number;
|
|
1177
|
+
readonly admitted: number;
|
|
1178
|
+
readonly failed: readonly string[];
|
|
1179
|
+
readonly next: string | null;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
declare interface RankClosureOptions {
|
|
1183
|
+
readonly service?: RankClosureService | undefined;
|
|
1184
|
+
readonly now?: (() => number) | undefined;
|
|
1185
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
declare interface RankClosureReceipt {
|
|
1189
|
+
readonly unitId: string;
|
|
1190
|
+
readonly status: 'closed' | 'erased';
|
|
1191
|
+
readonly operationId: string | null;
|
|
1192
|
+
readonly rewardsQueued: number;
|
|
1193
|
+
readonly at: number;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
declare interface RankClosureRequest {
|
|
1197
|
+
readonly unitId: string;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
declare interface RankClosureService {
|
|
1201
|
+
readonly execute: (subject: Subject, input: RankClosureRequest) => Effect.Effect<RankClosureReceipt, ProgressionError>;
|
|
1202
|
+
readonly dispatch: (subject: Subject, input: RankClosureDispatchInput, start: (payload: RankClosureRequest) => Effect.Effect<WorkflowRunHandle, unknown>) => Effect.Effect<RankClosureDispatchResult, ProgressionError>;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
export declare interface RankContext {
|
|
1206
|
+
readonly ladder: RankLadder;
|
|
1207
|
+
readonly rating: RankRating;
|
|
1208
|
+
readonly at: number;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
export declare interface RankDecayDefinition {
|
|
1212
|
+
readonly afterDays: number;
|
|
1213
|
+
readonly perDay: number;
|
|
1214
|
+
readonly floor: number;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export declare type RankDecayResolver = (input: RankGradeContext) => number;
|
|
1218
|
+
|
|
1219
|
+
export declare interface RankGrade {
|
|
1220
|
+
readonly index: number;
|
|
1221
|
+
readonly tier: string;
|
|
1222
|
+
readonly tierIndex: number;
|
|
1223
|
+
readonly division: number;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
export declare interface RankGradeContext extends RankContext {
|
|
1227
|
+
readonly score: number;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
export declare type RankGradeResolver = (input: RankGradeContext) => RankGrade | null;
|
|
1231
|
+
|
|
1232
|
+
export declare interface RankLadder {
|
|
1233
|
+
readonly id: string;
|
|
1234
|
+
readonly version: number;
|
|
1235
|
+
readonly rating: string;
|
|
1236
|
+
readonly tiers: readonly string[];
|
|
1237
|
+
readonly divisions: number;
|
|
1238
|
+
readonly thresholds: readonly number[];
|
|
1239
|
+
readonly placements: number;
|
|
1240
|
+
readonly confidence: number;
|
|
1241
|
+
readonly decay: RankDecayDefinition | null;
|
|
1242
|
+
readonly softReset: RankResetDefinition | null;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
export declare interface RankLadderDefinition {
|
|
1246
|
+
readonly id?: string;
|
|
1247
|
+
readonly version?: number;
|
|
1248
|
+
readonly rating: string;
|
|
1249
|
+
readonly tiers: readonly string[];
|
|
1250
|
+
readonly divisions?: number;
|
|
1251
|
+
/** Ascending cutoffs for each boundary, lowest division to highest. No hidden balancing values. */
|
|
1252
|
+
readonly thresholds: readonly number[];
|
|
1253
|
+
readonly placements?: number;
|
|
1254
|
+
readonly confidence?: number;
|
|
1255
|
+
readonly decay?: RankDecayDefinition | null;
|
|
1256
|
+
readonly softReset?: RankResetDefinition | null;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
export declare interface RankObserveInput {
|
|
1260
|
+
readonly seasonId: string;
|
|
1261
|
+
readonly requestId: string;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
export declare interface RankPluginOptions extends RankStoreOptions {
|
|
1265
|
+
readonly service?: RankSeasonService | undefined;
|
|
1266
|
+
readonly closure?: RankClosureOptions;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
export declare class RankPort extends RankPort_base {
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
declare const RankPort_base: Context.ServiceClass<RankPort, "@voltro/RankPort", RankSeasonService>;
|
|
1273
|
+
|
|
1274
|
+
export declare interface RankRating {
|
|
1275
|
+
readonly pool: string;
|
|
1276
|
+
readonly state: RankRatingState;
|
|
1277
|
+
readonly games: number;
|
|
1278
|
+
readonly updatedAt: number | null;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
export declare class RankRatingSource extends RankRatingSource_base {
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
declare const RankRatingSource_base: Context.ServiceClass<RankRatingSource, "@voltro/RankRatingSource", RankRatingSourceService>;
|
|
1285
|
+
|
|
1286
|
+
export declare interface RankRatingSourceService {
|
|
1287
|
+
readonly read: (subject: Subject, pool: string) => Effect.Effect<RankRating, ProgressionError>;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/** SQL Ratings remain the authority; this detached shape matches Ratings.myRating. */
|
|
1291
|
+
export declare type RankRatingState = {
|
|
1292
|
+
readonly algorithm: 'elo';
|
|
1293
|
+
readonly rating: number;
|
|
1294
|
+
} | {
|
|
1295
|
+
readonly algorithm: 'openskill';
|
|
1296
|
+
readonly mu: number;
|
|
1297
|
+
readonly sigma: number;
|
|
1298
|
+
} | {
|
|
1299
|
+
readonly algorithm: 'glicko2';
|
|
1300
|
+
readonly rating: number;
|
|
1301
|
+
readonly deviation: number;
|
|
1302
|
+
readonly volatility: number;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
export declare interface RankReaderService {
|
|
1306
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerRank[], ProgressionError>;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export declare interface RankResetContext {
|
|
1310
|
+
readonly ladder: RankLadder;
|
|
1311
|
+
readonly score: number;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
export declare interface RankResetDefinition {
|
|
1315
|
+
readonly target: number;
|
|
1316
|
+
readonly retain: number;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
export declare type RankScoreResolver = (input: RankContext) => number;
|
|
1320
|
+
|
|
1321
|
+
export declare interface RankSeason {
|
|
1322
|
+
readonly id: string;
|
|
1323
|
+
readonly version: number;
|
|
1324
|
+
readonly ladderId: string;
|
|
1325
|
+
readonly from: number;
|
|
1326
|
+
readonly until: number;
|
|
1327
|
+
readonly rewards: readonly (readonly ProgressionReward[])[];
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
export declare interface RankSeasonDefinition {
|
|
1331
|
+
readonly id: string;
|
|
1332
|
+
readonly version?: number;
|
|
1333
|
+
readonly ladderId: string;
|
|
1334
|
+
readonly from: number;
|
|
1335
|
+
readonly until: number;
|
|
1336
|
+
readonly rewards: readonly (readonly ProgressionReward[])[];
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
export declare interface RankSeasonReceipt {
|
|
1340
|
+
readonly operationId: string;
|
|
1341
|
+
readonly kind: 'observe' | 'close';
|
|
1342
|
+
readonly after: RankSeasonState;
|
|
1343
|
+
readonly rewardsQueued: number;
|
|
1344
|
+
readonly at: number;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
export declare type RankSeasonReset = (input: RankResetContext) => number;
|
|
1348
|
+
|
|
1349
|
+
export declare interface RankSeasonService {
|
|
1350
|
+
readonly observe: (subject: Subject, input: RankObserveInput) => Effect.Effect<RankSeasonReceipt, ProgressionError>;
|
|
1351
|
+
readonly close: (subject: Subject, input: RankCloseInput) => Effect.Effect<RankSeasonReceipt, ProgressionError>;
|
|
1352
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly RankSeasonState[], ProgressionError>;
|
|
1353
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1354
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
export declare interface RankSeasonState {
|
|
1358
|
+
readonly seasonId: string;
|
|
1359
|
+
readonly version: number;
|
|
1360
|
+
readonly ladderId: string;
|
|
1361
|
+
readonly observations: number;
|
|
1362
|
+
readonly last: PlayerRank | null;
|
|
1363
|
+
readonly highest: RankGrade | null;
|
|
1364
|
+
readonly closedAt: number | null;
|
|
1365
|
+
readonly resetScore: number | null;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
declare interface RankSqlService extends RankSeasonService {
|
|
1369
|
+
readonly auditRanks: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<RankAudit, ProgressionError>;
|
|
1370
|
+
readonly rebuildRanks: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<RankAudit, ProgressionError>;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
declare interface RankStoreOptions {
|
|
1374
|
+
readonly ladders: readonly (RankLadderDefinition | RankLadder)[];
|
|
1375
|
+
readonly seasons: readonly (RankSeasonDefinition | RankSeason)[];
|
|
1376
|
+
readonly source: RankRatingSourceService;
|
|
1377
|
+
readonly strategies?: RankStrategies | undefined;
|
|
1378
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1379
|
+
readonly maxHistoryRows?: number | undefined;
|
|
1380
|
+
readonly maxPendingRewards?: number | undefined;
|
|
1381
|
+
readonly now?: (() => number) | undefined;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
export declare interface RankStrategies {
|
|
1385
|
+
readonly version?: string;
|
|
1386
|
+
readonly score?: RankScoreResolver;
|
|
1387
|
+
readonly decay?: RankDecayResolver;
|
|
1388
|
+
readonly grade?: RankGradeResolver;
|
|
1389
|
+
readonly seasonReset?: RankSeasonReset;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
export declare interface RecordQuestInput {
|
|
1393
|
+
readonly tenantId: string;
|
|
1394
|
+
readonly ownerId: string;
|
|
1395
|
+
readonly poolId: string;
|
|
1396
|
+
readonly windowId: string;
|
|
1397
|
+
readonly requestId: string;
|
|
1398
|
+
readonly source: string;
|
|
1399
|
+
readonly origin: string;
|
|
1400
|
+
readonly signal: QuestSignalInput;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export declare interface RegenResource {
|
|
1404
|
+
readonly id: string;
|
|
1405
|
+
readonly version: number;
|
|
1406
|
+
readonly max: string;
|
|
1407
|
+
readonly initial: string;
|
|
1408
|
+
readonly regenPer: string;
|
|
1409
|
+
readonly regenAmount: string;
|
|
1410
|
+
readonly regenEveryMs: number;
|
|
1411
|
+
readonly refillOffer?: string;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export declare interface RegenResourceDefinition {
|
|
1415
|
+
readonly id: string;
|
|
1416
|
+
readonly version?: number;
|
|
1417
|
+
readonly max: ProgressValue;
|
|
1418
|
+
readonly initial?: ProgressValue;
|
|
1419
|
+
readonly regenPer: string;
|
|
1420
|
+
readonly regenAmount?: ProgressValue;
|
|
1421
|
+
readonly refillOffer?: string;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
export declare class RegenResourcePort extends RegenResourcePort_base {
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
declare const RegenResourcePort_base: Context.ServiceClass<RegenResourcePort, "@voltro/RegenResourcePort", RegenResourceService>;
|
|
1428
|
+
|
|
1429
|
+
export declare interface RegenResourceService {
|
|
1430
|
+
readonly initialize: (subject: Subject, input: InitializeResourceInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
1431
|
+
readonly consume: (subject: Subject, input: ResourceChangeInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
1432
|
+
readonly grant: (subject: Subject, input: ResourceChangeInput) => Effect.Effect<ResourceReceipt, ProgressionError>;
|
|
1433
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerResource[], ProgressionError>;
|
|
1434
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1435
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
export declare interface RerollQuestInput {
|
|
1439
|
+
readonly poolId: string;
|
|
1440
|
+
readonly windowId: string;
|
|
1441
|
+
readonly assignmentId: string;
|
|
1442
|
+
readonly requestId: string;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/** A custom evaluator may change fulfillment; it must retain truthful threshold progress. */
|
|
1446
|
+
export declare const resolveAchievementEvaluation: (condition: AchievementCondition, stats: readonly AchievementStat[], slot?: AchievementEvaluator) => AchievementEvaluation;
|
|
1447
|
+
|
|
1448
|
+
export declare const resolveDailyClaim: (input: DailyClaimPolicyContext, slot?: DailyClaimPolicy) => DailyState;
|
|
1449
|
+
|
|
1450
|
+
export declare const resolvePassCatchUp: (input: PassCatchUpContext, slot?: PassCatchUp) => string;
|
|
1451
|
+
|
|
1452
|
+
export declare const resolveQuestProgress: (input: QuestProgressContext, slot?: QuestProgressResolver) => readonly number[];
|
|
1453
|
+
|
|
1454
|
+
export declare const resolveQuestWindow: (input: QuestWindowContext, slot?: QuestWindowResolver) => QuestWindow;
|
|
1455
|
+
|
|
1456
|
+
export declare const resolveRank: (input: RankContext, strategies?: RankStrategies) => PlayerRank;
|
|
1457
|
+
|
|
1458
|
+
export declare const resolveRankSeasonReset: (ladderInput: RankLadder, value: number, strategies?: RankStrategies) => number;
|
|
1459
|
+
|
|
1460
|
+
export declare const resolveRankStrategies: (input?: RankStrategies) => Readonly<{
|
|
1461
|
+
version: string;
|
|
1462
|
+
score: RankScoreResolver;
|
|
1463
|
+
decay: RankDecayResolver;
|
|
1464
|
+
grade: RankGradeResolver;
|
|
1465
|
+
seasonReset: RankSeasonReset;
|
|
1466
|
+
}>;
|
|
1467
|
+
|
|
1468
|
+
export declare const resolveResourceRegen: (input: ResourceRegenContext, slot?: ResourceRegenResolver) => ResourceState;
|
|
1469
|
+
|
|
1470
|
+
export declare const resolveRewards: (context: RewardResolverContext, slot?: RewardResolver) => readonly LevelReward[];
|
|
1471
|
+
|
|
1472
|
+
export declare const resolveTutorialSkip: (tutorial: Tutorial, input: TutorialState, atInput: number) => TutorialState;
|
|
1473
|
+
|
|
1474
|
+
export declare const resolveTutorialStep: (input: TutorialStepPolicyContext, policy?: TutorialStepPolicy) => TutorialState;
|
|
1475
|
+
|
|
1476
|
+
export declare const resolveXpCurve: (xp: ProgressValue, curve: LevelCurve, slot?: XpCurve) => number;
|
|
1477
|
+
|
|
1478
|
+
declare interface ResourceAudit {
|
|
1479
|
+
readonly acceptedOperations: number;
|
|
1480
|
+
readonly resources: number;
|
|
1481
|
+
readonly matches: boolean;
|
|
1482
|
+
readonly at: number;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
export declare interface ResourceChangeInput {
|
|
1486
|
+
readonly tenantId: string;
|
|
1487
|
+
readonly ownerId: string;
|
|
1488
|
+
readonly resourceId: string;
|
|
1489
|
+
readonly requestId: string;
|
|
1490
|
+
readonly source: string;
|
|
1491
|
+
readonly origin: string;
|
|
1492
|
+
readonly amount: ProgressValue;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
export declare interface ResourcePluginOptions extends ResourceStoreOptions {
|
|
1496
|
+
readonly service?: RegenResourceService | undefined;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
export declare interface ResourceReceipt {
|
|
1500
|
+
readonly operationId: string;
|
|
1501
|
+
readonly kind: 'initialize' | 'consume' | 'grant';
|
|
1502
|
+
readonly resourceId: string;
|
|
1503
|
+
readonly amount: string;
|
|
1504
|
+
readonly regenerated: string;
|
|
1505
|
+
readonly after: ResourceState;
|
|
1506
|
+
readonly at: number;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
declare interface ResourceRegenContext {
|
|
1510
|
+
readonly resource: RegenResource;
|
|
1511
|
+
readonly state: ResourceState;
|
|
1512
|
+
readonly at: number;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export declare type ResourceRegenResolver = (input: ResourceRegenContext) => ResourceState;
|
|
1516
|
+
|
|
1517
|
+
declare interface ResourceSqlService extends RegenResourceService {
|
|
1518
|
+
readonly auditResources: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ResourceAudit, ProgressionError>;
|
|
1519
|
+
readonly rebuildResources: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<ResourceAudit, ProgressionError>;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
export declare interface ResourceState {
|
|
1523
|
+
readonly value: string;
|
|
1524
|
+
readonly anchorAt: number;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
declare interface ResourceStoreOptions {
|
|
1528
|
+
readonly definitions: readonly RegenResourceDefinition[];
|
|
1529
|
+
readonly sources: readonly string[];
|
|
1530
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1531
|
+
readonly maxHistoryRows?: number | undefined;
|
|
1532
|
+
readonly now?: (() => number) | undefined;
|
|
1533
|
+
readonly strategies?: {
|
|
1534
|
+
readonly regen?: ResourceRegenResolver | undefined;
|
|
1535
|
+
readonly version?: string;
|
|
1536
|
+
} | undefined;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
export declare interface RewardDeliveryOptions {
|
|
1540
|
+
/** An explicit app-owned funding account; never a balance/price/credential. */
|
|
1541
|
+
readonly systemAccount: string;
|
|
1542
|
+
readonly economy?: EconomyService | undefined;
|
|
1543
|
+
readonly inventory?: InventoryService | undefined;
|
|
1544
|
+
readonly progression?: ProgressionService | undefined;
|
|
1545
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1546
|
+
readonly now?: (() => number) | undefined;
|
|
1547
|
+
readonly version?: string;
|
|
1548
|
+
/** Full replacement must own queue/privacy semantics of its source ports. */
|
|
1549
|
+
readonly service?: RewardDeliveryService | undefined;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
export declare class RewardDeliveryPort extends RewardDeliveryPort_base {
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
declare const RewardDeliveryPort_base: Context.ServiceClass<RewardDeliveryPort, "@voltro/RewardDeliveryPort", RewardDeliveryService>;
|
|
1556
|
+
|
|
1557
|
+
export declare interface RewardDeliveryReceipt extends RewardDeliveryRequest {
|
|
1558
|
+
readonly status: 'delivered' | 'erased';
|
|
1559
|
+
readonly outputKind: 'currency' | 'item' | 'xp' | null;
|
|
1560
|
+
readonly externalOperationId: string | null;
|
|
1561
|
+
readonly at: number;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
export declare interface RewardDeliveryRequest {
|
|
1565
|
+
readonly kind: RewardSourceKind;
|
|
1566
|
+
readonly rewardId: string;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
export declare interface RewardDeliveryService {
|
|
1570
|
+
readonly execute: (subject: Subject, input: RewardDeliveryRequest) => Effect.Effect<RewardDeliveryReceipt, ProgressionError>;
|
|
1571
|
+
readonly dispatch: (subject: Subject, input: RewardDispatchInput, start: (payload: RewardDeliveryRequest) => Promise<WorkflowRunHandle>) => Effect.Effect<RewardDispatchResult, ProgressionError>;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
export declare interface RewardDispatchCursor extends RewardDeliveryRequest {
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
export declare interface RewardDispatchInput {
|
|
1578
|
+
readonly limit: number;
|
|
1579
|
+
readonly after?: RewardDispatchCursor;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
export declare interface RewardDispatchResult {
|
|
1583
|
+
readonly submitted: readonly {
|
|
1584
|
+
readonly request: RewardDeliveryRequest;
|
|
1585
|
+
readonly status: WorkflowRunHandle['status'];
|
|
1586
|
+
}[];
|
|
1587
|
+
readonly failed: readonly RewardDeliveryRequest[];
|
|
1588
|
+
readonly next: RewardDispatchCursor | null;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
export declare type RewardResolver = (context: RewardResolverContext) => readonly LevelReward[];
|
|
1592
|
+
|
|
1593
|
+
declare interface RewardResolverContext {
|
|
1594
|
+
readonly track: ProgressionTrack;
|
|
1595
|
+
readonly fromLevel: number;
|
|
1596
|
+
readonly toLevel: number;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
export declare type RewardSourceKind = 'level' | 'quest' | 'achievement' | 'daily' | 'pass' | 'tutorial' | 'rank';
|
|
1600
|
+
|
|
1601
|
+
export declare interface SeasonPass {
|
|
1602
|
+
readonly id: string;
|
|
1603
|
+
readonly version: number;
|
|
1604
|
+
readonly from: number;
|
|
1605
|
+
readonly until: number;
|
|
1606
|
+
readonly tiers: number;
|
|
1607
|
+
readonly xpPerTier: string;
|
|
1608
|
+
readonly tracks: {
|
|
1609
|
+
readonly free: readonly (readonly ProgressionReward[])[];
|
|
1610
|
+
readonly premium: readonly (readonly ProgressionReward[])[];
|
|
1611
|
+
};
|
|
1612
|
+
readonly premiumOffer: string | null;
|
|
1613
|
+
readonly sources: readonly string[];
|
|
1614
|
+
readonly catchUp: {
|
|
1615
|
+
readonly xpBoostAfterDay: number;
|
|
1616
|
+
readonly multiplier: number;
|
|
1617
|
+
} | null;
|
|
1618
|
+
readonly autoClaim: boolean;
|
|
1619
|
+
readonly expireUnclaimed: 'mail' | 'forfeit';
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
export declare interface SeasonPassDefinition {
|
|
1623
|
+
readonly id: string;
|
|
1624
|
+
readonly version?: number;
|
|
1625
|
+
readonly from: number;
|
|
1626
|
+
readonly until: number;
|
|
1627
|
+
readonly tiers: number;
|
|
1628
|
+
readonly xpPerTier: ProgressValue;
|
|
1629
|
+
readonly tracks: {
|
|
1630
|
+
readonly free: readonly (readonly ProgressionReward[])[];
|
|
1631
|
+
readonly premium: readonly (readonly ProgressionReward[])[];
|
|
1632
|
+
};
|
|
1633
|
+
readonly premiumOffer?: string;
|
|
1634
|
+
readonly sources: readonly string[];
|
|
1635
|
+
readonly catchUp?: {
|
|
1636
|
+
readonly xpBoostAfterDay: number;
|
|
1637
|
+
readonly multiplier?: number;
|
|
1638
|
+
};
|
|
1639
|
+
readonly autoClaim?: boolean;
|
|
1640
|
+
readonly expireUnclaimed?: 'mail' | 'forfeit';
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
export declare class SeasonPassPort extends SeasonPassPort_base {
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
declare const SeasonPassPort_base: Context.ServiceClass<SeasonPassPort, "@voltro/SeasonPassPort", SeasonPassService>;
|
|
1647
|
+
|
|
1648
|
+
export declare interface SeasonPassService {
|
|
1649
|
+
readonly applyXp: (subject: Subject, input: PassXpInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
1650
|
+
readonly grantPremium: (subject: Subject, input: PassPremiumInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
1651
|
+
readonly claim: (subject: Subject, input: PassClaimInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
1652
|
+
readonly close: (subject: Subject, input: PassCloseInput) => Effect.Effect<PassReceipt, ProgressionError>;
|
|
1653
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerPass[], ProgressionError>;
|
|
1654
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1655
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
export declare const selectQuests: (input: QuestSelectorContext, slot?: QuestSelector) => readonly string[];
|
|
1659
|
+
|
|
1660
|
+
declare const STAT_OPERATORS: readonly ["increment", "max", "min", "set"];
|
|
1661
|
+
|
|
1662
|
+
export declare const statAtLeast: (stat: string, target: ProgressValue, scope?: {
|
|
1663
|
+
readonly period?: "lifetime" | "season";
|
|
1664
|
+
readonly seasonId?: string | null;
|
|
1665
|
+
}) => StatThreshold;
|
|
1666
|
+
|
|
1667
|
+
export declare interface StatDefinition {
|
|
1668
|
+
readonly id: string;
|
|
1669
|
+
readonly initial?: ProgressValue;
|
|
1670
|
+
readonly cap?: ProgressValue;
|
|
1671
|
+
readonly operators?: readonly StatOperator[];
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
export declare const staticQuestSource: (input: readonly QuestPoolDefinition[], revision?: string) => QuestSourceService;
|
|
1675
|
+
|
|
1676
|
+
export declare type StatOperator = typeof STAT_OPERATORS[number];
|
|
1677
|
+
|
|
1678
|
+
export declare interface StatThreshold {
|
|
1679
|
+
readonly kind: 'statAtLeast';
|
|
1680
|
+
readonly stat: string;
|
|
1681
|
+
readonly target: string;
|
|
1682
|
+
readonly period: 'lifetime' | 'season';
|
|
1683
|
+
readonly seasonId: string | null;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
export declare interface Tutorial {
|
|
1687
|
+
readonly id: string;
|
|
1688
|
+
readonly version: number;
|
|
1689
|
+
readonly steps: readonly string[];
|
|
1690
|
+
readonly skippable: boolean;
|
|
1691
|
+
readonly reward: readonly ProgressionReward[];
|
|
1692
|
+
readonly rewardOnSkip: boolean;
|
|
1693
|
+
readonly hints: string | null;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
declare interface TutorialAudit {
|
|
1697
|
+
readonly operations: number;
|
|
1698
|
+
readonly tutorials: number;
|
|
1699
|
+
readonly rewardRows: number;
|
|
1700
|
+
readonly matches: boolean;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
export declare interface TutorialDefinition {
|
|
1704
|
+
readonly id?: string;
|
|
1705
|
+
readonly version?: number;
|
|
1706
|
+
readonly steps: readonly string[];
|
|
1707
|
+
readonly skippable?: boolean;
|
|
1708
|
+
readonly reward?: readonly ProgressionReward[];
|
|
1709
|
+
readonly rewardOnSkip?: boolean;
|
|
1710
|
+
readonly hints?: string;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
export declare interface TutorialEvidence {
|
|
1714
|
+
readonly source: string;
|
|
1715
|
+
readonly originId: string;
|
|
1716
|
+
readonly version: string;
|
|
1717
|
+
readonly from: number;
|
|
1718
|
+
readonly until: number;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
export declare interface TutorialPluginOptions extends TutorialStoreOptions {
|
|
1722
|
+
readonly service?: TutorialService | undefined;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
export declare class TutorialPort extends TutorialPort_base {
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
declare const TutorialPort_base: Context.ServiceClass<TutorialPort, "@voltro/TutorialPort", TutorialService>;
|
|
1729
|
+
|
|
1730
|
+
export declare interface TutorialReceipt {
|
|
1731
|
+
readonly operationId: string;
|
|
1732
|
+
readonly kind: 'step' | 'skip';
|
|
1733
|
+
readonly step: string | null;
|
|
1734
|
+
readonly after: TutorialState;
|
|
1735
|
+
readonly rewardsQueued: number;
|
|
1736
|
+
readonly at: number;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
export declare interface TutorialRecordInput extends TutorialStepInput {
|
|
1740
|
+
readonly tenantId: string;
|
|
1741
|
+
readonly ownerId: string;
|
|
1742
|
+
readonly source: string;
|
|
1743
|
+
readonly originId: string;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
export declare interface TutorialService {
|
|
1747
|
+
readonly completeStep: (subject: Subject, input: TutorialStepInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
1748
|
+
readonly record: (subject: Subject, input: TutorialRecordInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
1749
|
+
readonly skip: (subject: Subject, input: TutorialSkipInput) => Effect.Effect<TutorialReceipt, ProgressionError>;
|
|
1750
|
+
readonly mine: (subject: Subject) => Effect.Effect<readonly PlayerTutorial[], ProgressionError>;
|
|
1751
|
+
readonly exportSubject: (target: PluginPrivacyTarget) => Effect.Effect<unknown, ProgressionError>;
|
|
1752
|
+
readonly eraseSubject: (target: PluginPrivacyTarget) => Effect.Effect<void, ProgressionError>;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
export declare interface TutorialSkipInput {
|
|
1756
|
+
readonly tutorialId: string;
|
|
1757
|
+
readonly requestId: string;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
declare interface TutorialSqlService extends TutorialService {
|
|
1761
|
+
readonly auditTutorials: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<TutorialAudit, ProgressionError>;
|
|
1762
|
+
readonly rebuildTutorials: (subject: Subject, tenantId: string, ownerId: string) => Effect.Effect<TutorialAudit, ProgressionError>;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
export declare interface TutorialState {
|
|
1766
|
+
readonly tutorialId: string;
|
|
1767
|
+
readonly version: number;
|
|
1768
|
+
readonly completedSteps: readonly string[];
|
|
1769
|
+
readonly completed: boolean;
|
|
1770
|
+
readonly skipped: boolean;
|
|
1771
|
+
readonly completedAt: number | null;
|
|
1772
|
+
readonly updatedAt: number | null;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
export declare interface TutorialStepInput {
|
|
1776
|
+
readonly tutorialId: string;
|
|
1777
|
+
readonly step: string;
|
|
1778
|
+
readonly requestId: string;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
export declare type TutorialStepPolicy = (input: TutorialStepPolicyContext) => boolean;
|
|
1782
|
+
|
|
1783
|
+
export declare interface TutorialStepPolicyContext {
|
|
1784
|
+
readonly tutorial: Tutorial;
|
|
1785
|
+
readonly before: TutorialState;
|
|
1786
|
+
readonly step: string;
|
|
1787
|
+
readonly evidence: TutorialEvidence;
|
|
1788
|
+
readonly at: number;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
declare interface TutorialStoreOptions {
|
|
1792
|
+
readonly definitions: readonly (TutorialDefinition | Tutorial)[];
|
|
1793
|
+
readonly eventSources: readonly string[];
|
|
1794
|
+
readonly verifier?: TutorialVerifierService | undefined;
|
|
1795
|
+
readonly allowedServices?: readonly string[] | undefined;
|
|
1796
|
+
readonly maxHistoryRows?: number | undefined;
|
|
1797
|
+
readonly maxPendingRewards?: number | undefined;
|
|
1798
|
+
readonly now?: (() => number) | undefined;
|
|
1799
|
+
readonly strategies?: {
|
|
1800
|
+
readonly stepPolicy?: TutorialStepPolicy | undefined;
|
|
1801
|
+
readonly version?: string;
|
|
1802
|
+
} | undefined;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
export declare interface TutorialVerificationInput {
|
|
1806
|
+
readonly tenantId: string;
|
|
1807
|
+
readonly ownerId: string;
|
|
1808
|
+
readonly tutorialId: string;
|
|
1809
|
+
readonly version: number;
|
|
1810
|
+
readonly step: string;
|
|
1811
|
+
readonly requestId: string;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
export declare class TutorialVerifier extends TutorialVerifier_base {
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
declare const TutorialVerifier_base: Context.ServiceClass<TutorialVerifier, "@voltro/TutorialVerifier", TutorialVerifierService>;
|
|
1818
|
+
|
|
1819
|
+
/** An app checks actual authoritative gameplay evidence; a client completion boolean is never evidence. */
|
|
1820
|
+
export declare interface TutorialVerifierService {
|
|
1821
|
+
readonly verify: (subject: Subject, input: TutorialVerificationInput) => Effect.Effect<TutorialEvidence, ProgressionError>;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
export declare const xp: (trackId: string, amount: ProgressValue) => ProgressionReward;
|
|
1825
|
+
|
|
1826
|
+
export declare type XpCurve = (context: XpCurveContext) => number;
|
|
1827
|
+
|
|
1828
|
+
declare interface XpCurveContext {
|
|
1829
|
+
readonly xp: string;
|
|
1830
|
+
readonly curve: LevelCurve;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
export { }
|