@hyprune/schema 0.5.2 → 0.7.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.
@@ -0,0 +1,448 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://hyprune.com/schema/v0.21/quests-personal.schema.json",
4
+ "title": "Hyprune 0.21 personal quests file (quests/personal.json, version 1)",
5
+ "description": "The core daemon's personal quest store under $XDG_STATE_HOME/hyprune/quests/personal.json. Each quest is a personalQuestInput definition (with its id) plus state, progress ({stepId: {objectiveId: count}}) and local timestamps.",
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "const": 1
10
+ },
11
+ "tracked": {
12
+ "anyOf": [
13
+ {
14
+ "type": "null"
15
+ },
16
+ {
17
+ "$ref": "#/$defs/questRef"
18
+ }
19
+ ]
20
+ },
21
+ "quests": {
22
+ "type": "array",
23
+ "maxItems": 64,
24
+ "items": {
25
+ "$ref": "#/$defs/storedQuest"
26
+ }
27
+ }
28
+ },
29
+ "required": [
30
+ "version",
31
+ "tracked",
32
+ "quests"
33
+ ],
34
+ "additionalProperties": false,
35
+ "$defs": {
36
+ "objectiveInput": {
37
+ "oneOf": [
38
+ {
39
+ "type": "object",
40
+ "properties": {
41
+ "id": {
42
+ "$ref": "#/$defs/questSlug"
43
+ },
44
+ "type": {
45
+ "const": "manual"
46
+ },
47
+ "count": {
48
+ "type": "integer",
49
+ "minimum": 1,
50
+ "maximum": 100
51
+ },
52
+ "label": {
53
+ "type": "string",
54
+ "minLength": 0,
55
+ "maxLength": 64
56
+ }
57
+ },
58
+ "required": [
59
+ "id",
60
+ "type"
61
+ ],
62
+ "additionalProperties": false
63
+ },
64
+ {
65
+ "type": "object",
66
+ "properties": {
67
+ "id": {
68
+ "$ref": "#/$defs/questSlug"
69
+ },
70
+ "type": {
71
+ "const": "reach"
72
+ },
73
+ "count": {
74
+ "type": "integer",
75
+ "minimum": 1,
76
+ "maximum": 100
77
+ },
78
+ "label": {
79
+ "type": "string",
80
+ "minLength": 0,
81
+ "maxLength": 64
82
+ },
83
+ "target": {
84
+ "$ref": "#/$defs/questTarget"
85
+ },
86
+ "radius": {
87
+ "type": "number",
88
+ "minimum": 0.5,
89
+ "maximum": 100
90
+ }
91
+ },
92
+ "required": [
93
+ "id",
94
+ "type"
95
+ ],
96
+ "additionalProperties": false
97
+ },
98
+ {
99
+ "type": "object",
100
+ "properties": {
101
+ "id": {
102
+ "$ref": "#/$defs/questSlug"
103
+ },
104
+ "type": {
105
+ "const": "focus"
106
+ },
107
+ "count": {
108
+ "type": "integer",
109
+ "minimum": 1,
110
+ "maximum": 100
111
+ },
112
+ "label": {
113
+ "type": "string",
114
+ "minLength": 0,
115
+ "maxLength": 64
116
+ },
117
+ "sessions": {
118
+ "type": "integer",
119
+ "minimum": 1,
120
+ "maximum": 12
121
+ },
122
+ "minutes": {
123
+ "type": "number",
124
+ "minimum": 1,
125
+ "maximum": 120
126
+ },
127
+ "focusTarget": {
128
+ "enum": [
129
+ "quest",
130
+ "any"
131
+ ]
132
+ }
133
+ },
134
+ "required": [
135
+ "id",
136
+ "type",
137
+ "sessions"
138
+ ],
139
+ "additionalProperties": false
140
+ }
141
+ ],
142
+ "description": "manual: the user marks it done. reach: target (default the step target; one of them must exist), radius in metres (default 4; area/zone bounds for area and zone targets). focus: sessions, minutes per session (default 0.8 x focus.work_min), focusTarget (default quest: only sessions started from this quest count)."
143
+ },
144
+ "personalQuestInput": {
145
+ "type": "object",
146
+ "properties": {
147
+ "id": {
148
+ "$ref": "#/$defs/questSlug"
149
+ },
150
+ "title": {
151
+ "type": "string",
152
+ "minLength": 1,
153
+ "maxLength": 64
154
+ },
155
+ "summary": {
156
+ "type": "string",
157
+ "minLength": 0,
158
+ "maxLength": 1000
159
+ },
160
+ "sequential": {
161
+ "type": "boolean"
162
+ },
163
+ "expires": {
164
+ "type": "string",
165
+ "minLength": 16,
166
+ "maxLength": 16,
167
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}$"
168
+ },
169
+ "steps": {
170
+ "type": "array",
171
+ "items": {
172
+ "$ref": "#/$defs/stepInput"
173
+ },
174
+ "minItems": 1,
175
+ "maxItems": 16
176
+ }
177
+ },
178
+ "required": [
179
+ "title",
180
+ "steps"
181
+ ],
182
+ "additionalProperties": false,
183
+ "description": "A personal quest definition. On create, id is derived from the title when absent; on update it is ignored (questRef wins). expires is a local date-time YYYY-MM-DDTHH:MM."
184
+ },
185
+ "questRef": {
186
+ "type": "object",
187
+ "properties": {
188
+ "source": {
189
+ "type": "string",
190
+ "minLength": 1,
191
+ "maxLength": 128
192
+ },
193
+ "id": {
194
+ "$ref": "#/$defs/questSlug"
195
+ }
196
+ },
197
+ "required": [
198
+ "source",
199
+ "id"
200
+ ],
201
+ "additionalProperties": false,
202
+ "description": "A quest reference: source (\"personal\", a world ID or a provider ID) and the quest slug."
203
+ },
204
+ "questSlug": {
205
+ "type": "string",
206
+ "minLength": 1,
207
+ "maxLength": 64,
208
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
209
+ },
210
+ "questTarget": {
211
+ "oneOf": [
212
+ {
213
+ "type": "object",
214
+ "properties": {
215
+ "position": {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "number"
219
+ },
220
+ "minItems": 3,
221
+ "maxItems": 3
222
+ },
223
+ "worldId": {
224
+ "type": "string",
225
+ "minLength": 1,
226
+ "maxLength": 128
227
+ }
228
+ },
229
+ "required": [
230
+ "position"
231
+ ],
232
+ "additionalProperties": false
233
+ },
234
+ {
235
+ "type": "object",
236
+ "properties": {
237
+ "zoneId": {
238
+ "type": "string",
239
+ "minLength": 1,
240
+ "maxLength": 128
241
+ }
242
+ },
243
+ "required": [
244
+ "zoneId"
245
+ ],
246
+ "additionalProperties": false
247
+ },
248
+ {
249
+ "type": "object",
250
+ "properties": {
251
+ "areaId": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 128
255
+ }
256
+ },
257
+ "required": [
258
+ "areaId"
259
+ ],
260
+ "additionalProperties": false
261
+ },
262
+ {
263
+ "type": "object",
264
+ "properties": {
265
+ "placeId": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 128
269
+ }
270
+ },
271
+ "required": [
272
+ "placeId"
273
+ ],
274
+ "additionalProperties": false
275
+ },
276
+ {
277
+ "type": "object",
278
+ "properties": {
279
+ "workspaceId": {
280
+ "type": "integer",
281
+ "minimum": 1,
282
+ "maximum": 2147483647
283
+ }
284
+ },
285
+ "required": [
286
+ "workspaceId"
287
+ ],
288
+ "additionalProperties": false
289
+ }
290
+ ],
291
+ "description": "Exactly one of position (optionally with worldId), zoneId, areaId, placeId or workspaceId."
292
+ },
293
+ "stepInput": {
294
+ "type": "object",
295
+ "properties": {
296
+ "id": {
297
+ "$ref": "#/$defs/questSlug"
298
+ },
299
+ "title": {
300
+ "type": "string",
301
+ "minLength": 1,
302
+ "maxLength": 64
303
+ },
304
+ "optional": {
305
+ "type": "boolean"
306
+ },
307
+ "any": {
308
+ "type": "boolean"
309
+ },
310
+ "target": {
311
+ "$ref": "#/$defs/questTarget"
312
+ },
313
+ "objectives": {
314
+ "type": "array",
315
+ "items": {
316
+ "$ref": "#/$defs/objectiveInput"
317
+ },
318
+ "minItems": 1,
319
+ "maxItems": 8
320
+ }
321
+ },
322
+ "required": [
323
+ "title"
324
+ ],
325
+ "additionalProperties": false,
326
+ "description": "id defaults to step-N; objectives default to [{\"id\": \"done\", \"type\": \"manual\"}]."
327
+ },
328
+ "storedQuest": {
329
+ "type": "object",
330
+ "properties": {
331
+ "id": {
332
+ "$ref": "#/$defs/questSlug"
333
+ },
334
+ "title": {
335
+ "type": "string",
336
+ "minLength": 1,
337
+ "maxLength": 64
338
+ },
339
+ "summary": {
340
+ "type": "string",
341
+ "minLength": 0,
342
+ "maxLength": 1000
343
+ },
344
+ "sequential": {
345
+ "type": "boolean"
346
+ },
347
+ "expires": {
348
+ "type": "string",
349
+ "minLength": 16,
350
+ "maxLength": 16,
351
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}$"
352
+ },
353
+ "steps": {
354
+ "type": "array",
355
+ "items": {
356
+ "$ref": "#/$defs/stepInput"
357
+ },
358
+ "minItems": 1,
359
+ "maxItems": 16
360
+ },
361
+ "state": {
362
+ "enum": [
363
+ "available",
364
+ "active",
365
+ "completed",
366
+ "failed",
367
+ "abandoned"
368
+ ]
369
+ },
370
+ "progress": {
371
+ "type": "object",
372
+ "maxProperties": 16,
373
+ "propertyNames": {
374
+ "$ref": "#/$defs/questSlug"
375
+ },
376
+ "additionalProperties": {
377
+ "type": "object",
378
+ "maxProperties": 8,
379
+ "propertyNames": {
380
+ "$ref": "#/$defs/questSlug"
381
+ },
382
+ "additionalProperties": {
383
+ "type": "integer",
384
+ "minimum": 0,
385
+ "maximum": 100
386
+ }
387
+ }
388
+ },
389
+ "createdAt": {
390
+ "type": "string",
391
+ "minLength": 16,
392
+ "maxLength": 40,
393
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]{1,9})?)?(Z|[+-][0-9]{2}:[0-9]{2})?$"
394
+ },
395
+ "updatedAt": {
396
+ "type": "string",
397
+ "minLength": 16,
398
+ "maxLength": 40,
399
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]{1,9})?)?(Z|[+-][0-9]{2}:[0-9]{2})?$"
400
+ },
401
+ "completedAt": {
402
+ "anyOf": [
403
+ {
404
+ "type": "null"
405
+ },
406
+ {
407
+ "type": "string",
408
+ "minLength": 16,
409
+ "maxLength": 40,
410
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]{1,9})?)?(Z|[+-][0-9]{2}:[0-9]{2})?$"
411
+ }
412
+ ]
413
+ },
414
+ "credited": {
415
+ "description": "Credited focus minutes per focus objective (display only).",
416
+ "type": "object",
417
+ "maxProperties": 16,
418
+ "propertyNames": {
419
+ "$ref": "#/$defs/questSlug"
420
+ },
421
+ "additionalProperties": {
422
+ "type": "object",
423
+ "maxProperties": 8,
424
+ "propertyNames": {
425
+ "$ref": "#/$defs/questSlug"
426
+ },
427
+ "additionalProperties": {
428
+ "type": "number",
429
+ "minimum": 0,
430
+ "maximum": 1000000
431
+ }
432
+ }
433
+ }
434
+ },
435
+ "required": [
436
+ "id",
437
+ "title",
438
+ "steps",
439
+ "state",
440
+ "progress",
441
+ "createdAt",
442
+ "updatedAt",
443
+ "completedAt"
444
+ ],
445
+ "additionalProperties": false
446
+ }
447
+ }
448
+ }