@rozenite/tanstack-query-plugin 1.5.0 → 1.6.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,1000 @@
1
+ import { AgentTool } from '@rozenite/agent-bridge';
2
+ import { MutationCacheNotifyEvent, QueryCacheNotifyEvent, QueryClient } from '@tanstack/react-query';
3
+ type PaginationInput = {
4
+ limit?: number;
5
+ cursor?: string;
6
+ };
7
+ type QueryHashInput = {
8
+ queryHash: string;
9
+ };
10
+ type QueryToggleInput = QueryHashInput & {
11
+ enabled: boolean;
12
+ };
13
+ type MutationIdInput = {
14
+ mutationId: number;
15
+ };
16
+ type OnlineStatusInput = {
17
+ online: boolean;
18
+ };
19
+ type AgentSafeValue = null | boolean | number | string | AgentSafeValue[] | {
20
+ [key: string]: AgentSafeValue;
21
+ };
22
+ export declare const serializeForAgent: (value: unknown, seen?: WeakSet<object>) => AgentSafeValue;
23
+ export declare const getCacheSummaryTool: AgentTool;
24
+ export declare const getOnlineStatusTool: AgentTool;
25
+ export declare const setOnlineStatusTool: AgentTool;
26
+ export declare const listQueriesTool: AgentTool;
27
+ export declare const getQueryDetailsTool: AgentTool;
28
+ export declare const refetchQueryTool: AgentTool;
29
+ export declare const setQueryLoadingTool: AgentTool;
30
+ export declare const setQueryErrorTool: AgentTool;
31
+ export declare const invalidateQueryTool: AgentTool;
32
+ export declare const resetQueryTool: AgentTool;
33
+ export declare const removeQueryTool: AgentTool;
34
+ export declare const clearQueryCacheTool: AgentTool;
35
+ export declare const listMutationsTool: AgentTool;
36
+ export declare const getMutationDetailsTool: AgentTool;
37
+ export declare const clearMutationCacheTool: AgentTool;
38
+ export declare const TANSTACK_QUERY_AGENT_TOOLS: AgentTool[];
39
+ export declare const buildTanStackQueryCacheSummary: (queryClient: QueryClient) => {
40
+ online: boolean;
41
+ queries: {
42
+ total: number;
43
+ active: number;
44
+ fetching: number;
45
+ pending: number;
46
+ success: number;
47
+ error: number;
48
+ invalidated: number;
49
+ };
50
+ mutations: {
51
+ total: number;
52
+ pending: number;
53
+ success: number;
54
+ error: number;
55
+ paused: number;
56
+ };
57
+ };
58
+ export declare const createTanStackQueryAgentController: (queryClient: QueryClient) => {
59
+ handleQueryCacheEvent(event: QueryCacheNotifyEvent): void;
60
+ handleMutationCacheEvent(event: MutationCacheNotifyEvent): void;
61
+ getCacheSummary(): {
62
+ online: boolean;
63
+ queries: {
64
+ total: number;
65
+ active: number;
66
+ fetching: number;
67
+ pending: number;
68
+ success: number;
69
+ error: number;
70
+ invalidated: number;
71
+ };
72
+ mutations: {
73
+ total: number;
74
+ pending: number;
75
+ success: number;
76
+ error: number;
77
+ paused: number;
78
+ };
79
+ };
80
+ getOnlineStatus(): {
81
+ online: boolean;
82
+ };
83
+ setOnlineStatus({ online }: OnlineStatusInput): {
84
+ online: boolean;
85
+ };
86
+ listQueries(input?: PaginationInput): {
87
+ items: {
88
+ queryHash: string;
89
+ queryKey: AgentSafeValue;
90
+ status: import('@tanstack/query-core').QueryStatus;
91
+ fetchStatus: import('@tanstack/query-core').FetchStatus;
92
+ observersCount: number;
93
+ isInvalidated: boolean;
94
+ dataUpdatedAt: number;
95
+ errorUpdatedAt: number;
96
+ hasData: boolean;
97
+ hasError: boolean;
98
+ }[];
99
+ page: {
100
+ nextCursor?: string | undefined;
101
+ limit: number;
102
+ hasMore: boolean;
103
+ };
104
+ total: number;
105
+ online: boolean;
106
+ queries: {
107
+ total: number;
108
+ active: number;
109
+ fetching: number;
110
+ pending: number;
111
+ success: number;
112
+ error: number;
113
+ invalidated: number;
114
+ };
115
+ mutations: {
116
+ total: number;
117
+ pending: number;
118
+ success: number;
119
+ error: number;
120
+ paused: number;
121
+ };
122
+ };
123
+ getQueryDetails({ queryHash }: QueryHashInput): {
124
+ summary: {
125
+ online: boolean;
126
+ queries: {
127
+ total: number;
128
+ active: number;
129
+ fetching: number;
130
+ pending: number;
131
+ success: number;
132
+ error: number;
133
+ invalidated: number;
134
+ };
135
+ mutations: {
136
+ total: number;
137
+ pending: number;
138
+ success: number;
139
+ error: number;
140
+ paused: number;
141
+ };
142
+ };
143
+ query: {
144
+ data: AgentSafeValue;
145
+ error: AgentSafeValue;
146
+ observers: {
147
+ queryHash: string;
148
+ options: {
149
+ enabled: AgentSafeValue;
150
+ networkMode: AgentSafeValue;
151
+ staleTime: AgentSafeValue;
152
+ gcTime: AgentSafeValue;
153
+ retry: AgentSafeValue;
154
+ retryDelay: AgentSafeValue;
155
+ refetchInterval: AgentSafeValue;
156
+ refetchOnMount: AgentSafeValue;
157
+ refetchOnReconnect: AgentSafeValue;
158
+ refetchOnWindowFocus: AgentSafeValue;
159
+ subscribed: AgentSafeValue;
160
+ meta: AgentSafeValue;
161
+ hasQueryFn: boolean;
162
+ hasSelect: boolean;
163
+ hasPlaceholderData: boolean;
164
+ hasInitialData: boolean;
165
+ } | null;
166
+ }[];
167
+ queryHash: string;
168
+ queryKey: AgentSafeValue;
169
+ status: import('@tanstack/query-core').QueryStatus;
170
+ fetchStatus: import('@tanstack/query-core').FetchStatus;
171
+ observersCount: number;
172
+ isInvalidated: boolean;
173
+ dataUpdatedAt: number;
174
+ errorUpdatedAt: number;
175
+ hasData: boolean;
176
+ hasError: boolean;
177
+ };
178
+ };
179
+ refetchQuery({ queryHash }: QueryHashInput): Promise<{
180
+ applied: boolean;
181
+ action: "CLEAR_QUERY_CACHE";
182
+ cleared: boolean;
183
+ queryCountBefore: number;
184
+ queryCountAfter: number;
185
+ mutationCountBefore?: undefined;
186
+ mutationCountAfter?: undefined;
187
+ queryHash?: undefined;
188
+ } | {
189
+ applied: boolean;
190
+ action: "CLEAR_MUTATION_CACHE";
191
+ cleared: boolean;
192
+ mutationCountBefore: number;
193
+ mutationCountAfter: number;
194
+ queryCountBefore?: undefined;
195
+ queryCountAfter?: undefined;
196
+ queryHash?: undefined;
197
+ } | {
198
+ applied: boolean;
199
+ action: "TRIGGER_ERROR";
200
+ queryHash: string;
201
+ cleared?: undefined;
202
+ queryCountBefore?: undefined;
203
+ queryCountAfter?: undefined;
204
+ mutationCountBefore?: undefined;
205
+ mutationCountAfter?: undefined;
206
+ } | {
207
+ applied: boolean;
208
+ action: "RESTORE_ERROR";
209
+ queryHash: string;
210
+ cleared?: undefined;
211
+ queryCountBefore?: undefined;
212
+ queryCountAfter?: undefined;
213
+ mutationCountBefore?: undefined;
214
+ mutationCountAfter?: undefined;
215
+ } | {
216
+ applied: boolean;
217
+ action: "TRIGGER_LOADING";
218
+ queryHash: string;
219
+ cleared?: undefined;
220
+ queryCountBefore?: undefined;
221
+ queryCountAfter?: undefined;
222
+ mutationCountBefore?: undefined;
223
+ mutationCountAfter?: undefined;
224
+ } | {
225
+ applied: boolean;
226
+ action: "RESTORE_LOADING";
227
+ queryHash: string;
228
+ cleared?: undefined;
229
+ queryCountBefore?: undefined;
230
+ queryCountAfter?: undefined;
231
+ mutationCountBefore?: undefined;
232
+ mutationCountAfter?: undefined;
233
+ } | {
234
+ applied: boolean;
235
+ action: "RESET";
236
+ queryHash: string;
237
+ cleared?: undefined;
238
+ queryCountBefore?: undefined;
239
+ queryCountAfter?: undefined;
240
+ mutationCountBefore?: undefined;
241
+ mutationCountAfter?: undefined;
242
+ } | {
243
+ applied: boolean;
244
+ action: "REMOVE";
245
+ queryHash: string;
246
+ cleared?: undefined;
247
+ queryCountBefore?: undefined;
248
+ queryCountAfter?: undefined;
249
+ mutationCountBefore?: undefined;
250
+ mutationCountAfter?: undefined;
251
+ } | {
252
+ applied: boolean;
253
+ action: "REFETCH";
254
+ queryHash: string;
255
+ cleared?: undefined;
256
+ queryCountBefore?: undefined;
257
+ queryCountAfter?: undefined;
258
+ mutationCountBefore?: undefined;
259
+ mutationCountAfter?: undefined;
260
+ } | {
261
+ applied: boolean;
262
+ action: "INVALIDATE";
263
+ queryHash: string;
264
+ cleared?: undefined;
265
+ queryCountBefore?: undefined;
266
+ queryCountAfter?: undefined;
267
+ mutationCountBefore?: undefined;
268
+ mutationCountAfter?: undefined;
269
+ }>;
270
+ setQueryLoading({ queryHash, enabled }: QueryToggleInput): Promise<{
271
+ applied: boolean;
272
+ action: "CLEAR_QUERY_CACHE";
273
+ cleared: boolean;
274
+ queryCountBefore: number;
275
+ queryCountAfter: number;
276
+ mutationCountBefore?: undefined;
277
+ mutationCountAfter?: undefined;
278
+ queryHash?: undefined;
279
+ } | {
280
+ applied: boolean;
281
+ action: "CLEAR_MUTATION_CACHE";
282
+ cleared: boolean;
283
+ mutationCountBefore: number;
284
+ mutationCountAfter: number;
285
+ queryCountBefore?: undefined;
286
+ queryCountAfter?: undefined;
287
+ queryHash?: undefined;
288
+ } | {
289
+ applied: boolean;
290
+ action: "TRIGGER_ERROR";
291
+ queryHash: string;
292
+ cleared?: undefined;
293
+ queryCountBefore?: undefined;
294
+ queryCountAfter?: undefined;
295
+ mutationCountBefore?: undefined;
296
+ mutationCountAfter?: undefined;
297
+ } | {
298
+ applied: boolean;
299
+ action: "RESTORE_ERROR";
300
+ queryHash: string;
301
+ cleared?: undefined;
302
+ queryCountBefore?: undefined;
303
+ queryCountAfter?: undefined;
304
+ mutationCountBefore?: undefined;
305
+ mutationCountAfter?: undefined;
306
+ } | {
307
+ applied: boolean;
308
+ action: "TRIGGER_LOADING";
309
+ queryHash: string;
310
+ cleared?: undefined;
311
+ queryCountBefore?: undefined;
312
+ queryCountAfter?: undefined;
313
+ mutationCountBefore?: undefined;
314
+ mutationCountAfter?: undefined;
315
+ } | {
316
+ applied: boolean;
317
+ action: "RESTORE_LOADING";
318
+ queryHash: string;
319
+ cleared?: undefined;
320
+ queryCountBefore?: undefined;
321
+ queryCountAfter?: undefined;
322
+ mutationCountBefore?: undefined;
323
+ mutationCountAfter?: undefined;
324
+ } | {
325
+ applied: boolean;
326
+ action: "RESET";
327
+ queryHash: string;
328
+ cleared?: undefined;
329
+ queryCountBefore?: undefined;
330
+ queryCountAfter?: undefined;
331
+ mutationCountBefore?: undefined;
332
+ mutationCountAfter?: undefined;
333
+ } | {
334
+ applied: boolean;
335
+ action: "REMOVE";
336
+ queryHash: string;
337
+ cleared?: undefined;
338
+ queryCountBefore?: undefined;
339
+ queryCountAfter?: undefined;
340
+ mutationCountBefore?: undefined;
341
+ mutationCountAfter?: undefined;
342
+ } | {
343
+ applied: boolean;
344
+ action: "REFETCH";
345
+ queryHash: string;
346
+ cleared?: undefined;
347
+ queryCountBefore?: undefined;
348
+ queryCountAfter?: undefined;
349
+ mutationCountBefore?: undefined;
350
+ mutationCountAfter?: undefined;
351
+ } | {
352
+ applied: boolean;
353
+ action: "INVALIDATE";
354
+ queryHash: string;
355
+ cleared?: undefined;
356
+ queryCountBefore?: undefined;
357
+ queryCountAfter?: undefined;
358
+ mutationCountBefore?: undefined;
359
+ mutationCountAfter?: undefined;
360
+ }>;
361
+ setQueryError({ queryHash, enabled }: QueryToggleInput): Promise<{
362
+ applied: boolean;
363
+ action: "CLEAR_QUERY_CACHE";
364
+ cleared: boolean;
365
+ queryCountBefore: number;
366
+ queryCountAfter: number;
367
+ mutationCountBefore?: undefined;
368
+ mutationCountAfter?: undefined;
369
+ queryHash?: undefined;
370
+ } | {
371
+ applied: boolean;
372
+ action: "CLEAR_MUTATION_CACHE";
373
+ cleared: boolean;
374
+ mutationCountBefore: number;
375
+ mutationCountAfter: number;
376
+ queryCountBefore?: undefined;
377
+ queryCountAfter?: undefined;
378
+ queryHash?: undefined;
379
+ } | {
380
+ applied: boolean;
381
+ action: "TRIGGER_ERROR";
382
+ queryHash: string;
383
+ cleared?: undefined;
384
+ queryCountBefore?: undefined;
385
+ queryCountAfter?: undefined;
386
+ mutationCountBefore?: undefined;
387
+ mutationCountAfter?: undefined;
388
+ } | {
389
+ applied: boolean;
390
+ action: "RESTORE_ERROR";
391
+ queryHash: string;
392
+ cleared?: undefined;
393
+ queryCountBefore?: undefined;
394
+ queryCountAfter?: undefined;
395
+ mutationCountBefore?: undefined;
396
+ mutationCountAfter?: undefined;
397
+ } | {
398
+ applied: boolean;
399
+ action: "TRIGGER_LOADING";
400
+ queryHash: string;
401
+ cleared?: undefined;
402
+ queryCountBefore?: undefined;
403
+ queryCountAfter?: undefined;
404
+ mutationCountBefore?: undefined;
405
+ mutationCountAfter?: undefined;
406
+ } | {
407
+ applied: boolean;
408
+ action: "RESTORE_LOADING";
409
+ queryHash: string;
410
+ cleared?: undefined;
411
+ queryCountBefore?: undefined;
412
+ queryCountAfter?: undefined;
413
+ mutationCountBefore?: undefined;
414
+ mutationCountAfter?: undefined;
415
+ } | {
416
+ applied: boolean;
417
+ action: "RESET";
418
+ queryHash: string;
419
+ cleared?: undefined;
420
+ queryCountBefore?: undefined;
421
+ queryCountAfter?: undefined;
422
+ mutationCountBefore?: undefined;
423
+ mutationCountAfter?: undefined;
424
+ } | {
425
+ applied: boolean;
426
+ action: "REMOVE";
427
+ queryHash: string;
428
+ cleared?: undefined;
429
+ queryCountBefore?: undefined;
430
+ queryCountAfter?: undefined;
431
+ mutationCountBefore?: undefined;
432
+ mutationCountAfter?: undefined;
433
+ } | {
434
+ applied: boolean;
435
+ action: "REFETCH";
436
+ queryHash: string;
437
+ cleared?: undefined;
438
+ queryCountBefore?: undefined;
439
+ queryCountAfter?: undefined;
440
+ mutationCountBefore?: undefined;
441
+ mutationCountAfter?: undefined;
442
+ } | {
443
+ applied: boolean;
444
+ action: "INVALIDATE";
445
+ queryHash: string;
446
+ cleared?: undefined;
447
+ queryCountBefore?: undefined;
448
+ queryCountAfter?: undefined;
449
+ mutationCountBefore?: undefined;
450
+ mutationCountAfter?: undefined;
451
+ }>;
452
+ invalidateQuery({ queryHash }: QueryHashInput): Promise<{
453
+ applied: boolean;
454
+ action: "CLEAR_QUERY_CACHE";
455
+ cleared: boolean;
456
+ queryCountBefore: number;
457
+ queryCountAfter: number;
458
+ mutationCountBefore?: undefined;
459
+ mutationCountAfter?: undefined;
460
+ queryHash?: undefined;
461
+ } | {
462
+ applied: boolean;
463
+ action: "CLEAR_MUTATION_CACHE";
464
+ cleared: boolean;
465
+ mutationCountBefore: number;
466
+ mutationCountAfter: number;
467
+ queryCountBefore?: undefined;
468
+ queryCountAfter?: undefined;
469
+ queryHash?: undefined;
470
+ } | {
471
+ applied: boolean;
472
+ action: "TRIGGER_ERROR";
473
+ queryHash: string;
474
+ cleared?: undefined;
475
+ queryCountBefore?: undefined;
476
+ queryCountAfter?: undefined;
477
+ mutationCountBefore?: undefined;
478
+ mutationCountAfter?: undefined;
479
+ } | {
480
+ applied: boolean;
481
+ action: "RESTORE_ERROR";
482
+ queryHash: string;
483
+ cleared?: undefined;
484
+ queryCountBefore?: undefined;
485
+ queryCountAfter?: undefined;
486
+ mutationCountBefore?: undefined;
487
+ mutationCountAfter?: undefined;
488
+ } | {
489
+ applied: boolean;
490
+ action: "TRIGGER_LOADING";
491
+ queryHash: string;
492
+ cleared?: undefined;
493
+ queryCountBefore?: undefined;
494
+ queryCountAfter?: undefined;
495
+ mutationCountBefore?: undefined;
496
+ mutationCountAfter?: undefined;
497
+ } | {
498
+ applied: boolean;
499
+ action: "RESTORE_LOADING";
500
+ queryHash: string;
501
+ cleared?: undefined;
502
+ queryCountBefore?: undefined;
503
+ queryCountAfter?: undefined;
504
+ mutationCountBefore?: undefined;
505
+ mutationCountAfter?: undefined;
506
+ } | {
507
+ applied: boolean;
508
+ action: "RESET";
509
+ queryHash: string;
510
+ cleared?: undefined;
511
+ queryCountBefore?: undefined;
512
+ queryCountAfter?: undefined;
513
+ mutationCountBefore?: undefined;
514
+ mutationCountAfter?: undefined;
515
+ } | {
516
+ applied: boolean;
517
+ action: "REMOVE";
518
+ queryHash: string;
519
+ cleared?: undefined;
520
+ queryCountBefore?: undefined;
521
+ queryCountAfter?: undefined;
522
+ mutationCountBefore?: undefined;
523
+ mutationCountAfter?: undefined;
524
+ } | {
525
+ applied: boolean;
526
+ action: "REFETCH";
527
+ queryHash: string;
528
+ cleared?: undefined;
529
+ queryCountBefore?: undefined;
530
+ queryCountAfter?: undefined;
531
+ mutationCountBefore?: undefined;
532
+ mutationCountAfter?: undefined;
533
+ } | {
534
+ applied: boolean;
535
+ action: "INVALIDATE";
536
+ queryHash: string;
537
+ cleared?: undefined;
538
+ queryCountBefore?: undefined;
539
+ queryCountAfter?: undefined;
540
+ mutationCountBefore?: undefined;
541
+ mutationCountAfter?: undefined;
542
+ }>;
543
+ resetQuery({ queryHash }: QueryHashInput): Promise<{
544
+ applied: boolean;
545
+ action: "CLEAR_QUERY_CACHE";
546
+ cleared: boolean;
547
+ queryCountBefore: number;
548
+ queryCountAfter: number;
549
+ mutationCountBefore?: undefined;
550
+ mutationCountAfter?: undefined;
551
+ queryHash?: undefined;
552
+ } | {
553
+ applied: boolean;
554
+ action: "CLEAR_MUTATION_CACHE";
555
+ cleared: boolean;
556
+ mutationCountBefore: number;
557
+ mutationCountAfter: number;
558
+ queryCountBefore?: undefined;
559
+ queryCountAfter?: undefined;
560
+ queryHash?: undefined;
561
+ } | {
562
+ applied: boolean;
563
+ action: "TRIGGER_ERROR";
564
+ queryHash: string;
565
+ cleared?: undefined;
566
+ queryCountBefore?: undefined;
567
+ queryCountAfter?: undefined;
568
+ mutationCountBefore?: undefined;
569
+ mutationCountAfter?: undefined;
570
+ } | {
571
+ applied: boolean;
572
+ action: "RESTORE_ERROR";
573
+ queryHash: string;
574
+ cleared?: undefined;
575
+ queryCountBefore?: undefined;
576
+ queryCountAfter?: undefined;
577
+ mutationCountBefore?: undefined;
578
+ mutationCountAfter?: undefined;
579
+ } | {
580
+ applied: boolean;
581
+ action: "TRIGGER_LOADING";
582
+ queryHash: string;
583
+ cleared?: undefined;
584
+ queryCountBefore?: undefined;
585
+ queryCountAfter?: undefined;
586
+ mutationCountBefore?: undefined;
587
+ mutationCountAfter?: undefined;
588
+ } | {
589
+ applied: boolean;
590
+ action: "RESTORE_LOADING";
591
+ queryHash: string;
592
+ cleared?: undefined;
593
+ queryCountBefore?: undefined;
594
+ queryCountAfter?: undefined;
595
+ mutationCountBefore?: undefined;
596
+ mutationCountAfter?: undefined;
597
+ } | {
598
+ applied: boolean;
599
+ action: "RESET";
600
+ queryHash: string;
601
+ cleared?: undefined;
602
+ queryCountBefore?: undefined;
603
+ queryCountAfter?: undefined;
604
+ mutationCountBefore?: undefined;
605
+ mutationCountAfter?: undefined;
606
+ } | {
607
+ applied: boolean;
608
+ action: "REMOVE";
609
+ queryHash: string;
610
+ cleared?: undefined;
611
+ queryCountBefore?: undefined;
612
+ queryCountAfter?: undefined;
613
+ mutationCountBefore?: undefined;
614
+ mutationCountAfter?: undefined;
615
+ } | {
616
+ applied: boolean;
617
+ action: "REFETCH";
618
+ queryHash: string;
619
+ cleared?: undefined;
620
+ queryCountBefore?: undefined;
621
+ queryCountAfter?: undefined;
622
+ mutationCountBefore?: undefined;
623
+ mutationCountAfter?: undefined;
624
+ } | {
625
+ applied: boolean;
626
+ action: "INVALIDATE";
627
+ queryHash: string;
628
+ cleared?: undefined;
629
+ queryCountBefore?: undefined;
630
+ queryCountAfter?: undefined;
631
+ mutationCountBefore?: undefined;
632
+ mutationCountAfter?: undefined;
633
+ }>;
634
+ removeQuery({ queryHash }: QueryHashInput): Promise<{
635
+ applied: boolean;
636
+ action: "CLEAR_QUERY_CACHE";
637
+ cleared: boolean;
638
+ queryCountBefore: number;
639
+ queryCountAfter: number;
640
+ mutationCountBefore?: undefined;
641
+ mutationCountAfter?: undefined;
642
+ queryHash?: undefined;
643
+ } | {
644
+ applied: boolean;
645
+ action: "CLEAR_MUTATION_CACHE";
646
+ cleared: boolean;
647
+ mutationCountBefore: number;
648
+ mutationCountAfter: number;
649
+ queryCountBefore?: undefined;
650
+ queryCountAfter?: undefined;
651
+ queryHash?: undefined;
652
+ } | {
653
+ applied: boolean;
654
+ action: "TRIGGER_ERROR";
655
+ queryHash: string;
656
+ cleared?: undefined;
657
+ queryCountBefore?: undefined;
658
+ queryCountAfter?: undefined;
659
+ mutationCountBefore?: undefined;
660
+ mutationCountAfter?: undefined;
661
+ } | {
662
+ applied: boolean;
663
+ action: "RESTORE_ERROR";
664
+ queryHash: string;
665
+ cleared?: undefined;
666
+ queryCountBefore?: undefined;
667
+ queryCountAfter?: undefined;
668
+ mutationCountBefore?: undefined;
669
+ mutationCountAfter?: undefined;
670
+ } | {
671
+ applied: boolean;
672
+ action: "TRIGGER_LOADING";
673
+ queryHash: string;
674
+ cleared?: undefined;
675
+ queryCountBefore?: undefined;
676
+ queryCountAfter?: undefined;
677
+ mutationCountBefore?: undefined;
678
+ mutationCountAfter?: undefined;
679
+ } | {
680
+ applied: boolean;
681
+ action: "RESTORE_LOADING";
682
+ queryHash: string;
683
+ cleared?: undefined;
684
+ queryCountBefore?: undefined;
685
+ queryCountAfter?: undefined;
686
+ mutationCountBefore?: undefined;
687
+ mutationCountAfter?: undefined;
688
+ } | {
689
+ applied: boolean;
690
+ action: "RESET";
691
+ queryHash: string;
692
+ cleared?: undefined;
693
+ queryCountBefore?: undefined;
694
+ queryCountAfter?: undefined;
695
+ mutationCountBefore?: undefined;
696
+ mutationCountAfter?: undefined;
697
+ } | {
698
+ applied: boolean;
699
+ action: "REMOVE";
700
+ queryHash: string;
701
+ cleared?: undefined;
702
+ queryCountBefore?: undefined;
703
+ queryCountAfter?: undefined;
704
+ mutationCountBefore?: undefined;
705
+ mutationCountAfter?: undefined;
706
+ } | {
707
+ applied: boolean;
708
+ action: "REFETCH";
709
+ queryHash: string;
710
+ cleared?: undefined;
711
+ queryCountBefore?: undefined;
712
+ queryCountAfter?: undefined;
713
+ mutationCountBefore?: undefined;
714
+ mutationCountAfter?: undefined;
715
+ } | {
716
+ applied: boolean;
717
+ action: "INVALIDATE";
718
+ queryHash: string;
719
+ cleared?: undefined;
720
+ queryCountBefore?: undefined;
721
+ queryCountAfter?: undefined;
722
+ mutationCountBefore?: undefined;
723
+ mutationCountAfter?: undefined;
724
+ }>;
725
+ clearQueryCache(): Promise<{
726
+ applied: boolean;
727
+ action: "CLEAR_QUERY_CACHE";
728
+ cleared: boolean;
729
+ queryCountBefore: number;
730
+ queryCountAfter: number;
731
+ mutationCountBefore?: undefined;
732
+ mutationCountAfter?: undefined;
733
+ queryHash?: undefined;
734
+ } | {
735
+ applied: boolean;
736
+ action: "CLEAR_MUTATION_CACHE";
737
+ cleared: boolean;
738
+ mutationCountBefore: number;
739
+ mutationCountAfter: number;
740
+ queryCountBefore?: undefined;
741
+ queryCountAfter?: undefined;
742
+ queryHash?: undefined;
743
+ } | {
744
+ applied: boolean;
745
+ action: "TRIGGER_ERROR";
746
+ queryHash: string;
747
+ cleared?: undefined;
748
+ queryCountBefore?: undefined;
749
+ queryCountAfter?: undefined;
750
+ mutationCountBefore?: undefined;
751
+ mutationCountAfter?: undefined;
752
+ } | {
753
+ applied: boolean;
754
+ action: "RESTORE_ERROR";
755
+ queryHash: string;
756
+ cleared?: undefined;
757
+ queryCountBefore?: undefined;
758
+ queryCountAfter?: undefined;
759
+ mutationCountBefore?: undefined;
760
+ mutationCountAfter?: undefined;
761
+ } | {
762
+ applied: boolean;
763
+ action: "TRIGGER_LOADING";
764
+ queryHash: string;
765
+ cleared?: undefined;
766
+ queryCountBefore?: undefined;
767
+ queryCountAfter?: undefined;
768
+ mutationCountBefore?: undefined;
769
+ mutationCountAfter?: undefined;
770
+ } | {
771
+ applied: boolean;
772
+ action: "RESTORE_LOADING";
773
+ queryHash: string;
774
+ cleared?: undefined;
775
+ queryCountBefore?: undefined;
776
+ queryCountAfter?: undefined;
777
+ mutationCountBefore?: undefined;
778
+ mutationCountAfter?: undefined;
779
+ } | {
780
+ applied: boolean;
781
+ action: "RESET";
782
+ queryHash: string;
783
+ cleared?: undefined;
784
+ queryCountBefore?: undefined;
785
+ queryCountAfter?: undefined;
786
+ mutationCountBefore?: undefined;
787
+ mutationCountAfter?: undefined;
788
+ } | {
789
+ applied: boolean;
790
+ action: "REMOVE";
791
+ queryHash: string;
792
+ cleared?: undefined;
793
+ queryCountBefore?: undefined;
794
+ queryCountAfter?: undefined;
795
+ mutationCountBefore?: undefined;
796
+ mutationCountAfter?: undefined;
797
+ } | {
798
+ applied: boolean;
799
+ action: "REFETCH";
800
+ queryHash: string;
801
+ cleared?: undefined;
802
+ queryCountBefore?: undefined;
803
+ queryCountAfter?: undefined;
804
+ mutationCountBefore?: undefined;
805
+ mutationCountAfter?: undefined;
806
+ } | {
807
+ applied: boolean;
808
+ action: "INVALIDATE";
809
+ queryHash: string;
810
+ cleared?: undefined;
811
+ queryCountBefore?: undefined;
812
+ queryCountAfter?: undefined;
813
+ mutationCountBefore?: undefined;
814
+ mutationCountAfter?: undefined;
815
+ }>;
816
+ listMutations(input?: PaginationInput): {
817
+ items: {
818
+ mutationId: number;
819
+ mutationKey: AgentSafeValue;
820
+ status: import('@tanstack/query-core').MutationStatus;
821
+ isPaused: boolean;
822
+ submittedAt: number;
823
+ failureCount: number;
824
+ hasData: boolean;
825
+ hasError: boolean;
826
+ }[];
827
+ page: {
828
+ nextCursor?: string | undefined;
829
+ limit: number;
830
+ hasMore: boolean;
831
+ };
832
+ total: number;
833
+ online: boolean;
834
+ queries: {
835
+ total: number;
836
+ active: number;
837
+ fetching: number;
838
+ pending: number;
839
+ success: number;
840
+ error: number;
841
+ invalidated: number;
842
+ };
843
+ mutations: {
844
+ total: number;
845
+ pending: number;
846
+ success: number;
847
+ error: number;
848
+ paused: number;
849
+ };
850
+ };
851
+ getMutationDetails({ mutationId }: MutationIdInput): {
852
+ summary: {
853
+ online: boolean;
854
+ queries: {
855
+ total: number;
856
+ active: number;
857
+ fetching: number;
858
+ pending: number;
859
+ success: number;
860
+ error: number;
861
+ invalidated: number;
862
+ };
863
+ mutations: {
864
+ total: number;
865
+ pending: number;
866
+ success: number;
867
+ error: number;
868
+ paused: number;
869
+ };
870
+ };
871
+ mutation: {
872
+ variables: AgentSafeValue;
873
+ data: AgentSafeValue;
874
+ error: AgentSafeValue;
875
+ context: AgentSafeValue;
876
+ failureReason: AgentSafeValue;
877
+ options: {
878
+ mutationKey: AgentSafeValue;
879
+ networkMode: AgentSafeValue;
880
+ gcTime: AgentSafeValue;
881
+ retry: AgentSafeValue;
882
+ retryDelay: AgentSafeValue;
883
+ meta: AgentSafeValue;
884
+ scope: AgentSafeValue;
885
+ hasMutationFn: boolean;
886
+ hasOnMutate: boolean;
887
+ hasOnSuccess: boolean;
888
+ hasOnError: boolean;
889
+ hasOnSettled: boolean;
890
+ };
891
+ mutationId: number;
892
+ mutationKey: AgentSafeValue;
893
+ status: import('@tanstack/query-core').MutationStatus;
894
+ isPaused: boolean;
895
+ submittedAt: number;
896
+ failureCount: number;
897
+ hasData: boolean;
898
+ hasError: boolean;
899
+ };
900
+ };
901
+ clearMutationCache(): Promise<{
902
+ applied: boolean;
903
+ action: "CLEAR_QUERY_CACHE";
904
+ cleared: boolean;
905
+ queryCountBefore: number;
906
+ queryCountAfter: number;
907
+ mutationCountBefore?: undefined;
908
+ mutationCountAfter?: undefined;
909
+ queryHash?: undefined;
910
+ } | {
911
+ applied: boolean;
912
+ action: "CLEAR_MUTATION_CACHE";
913
+ cleared: boolean;
914
+ mutationCountBefore: number;
915
+ mutationCountAfter: number;
916
+ queryCountBefore?: undefined;
917
+ queryCountAfter?: undefined;
918
+ queryHash?: undefined;
919
+ } | {
920
+ applied: boolean;
921
+ action: "TRIGGER_ERROR";
922
+ queryHash: string;
923
+ cleared?: undefined;
924
+ queryCountBefore?: undefined;
925
+ queryCountAfter?: undefined;
926
+ mutationCountBefore?: undefined;
927
+ mutationCountAfter?: undefined;
928
+ } | {
929
+ applied: boolean;
930
+ action: "RESTORE_ERROR";
931
+ queryHash: string;
932
+ cleared?: undefined;
933
+ queryCountBefore?: undefined;
934
+ queryCountAfter?: undefined;
935
+ mutationCountBefore?: undefined;
936
+ mutationCountAfter?: undefined;
937
+ } | {
938
+ applied: boolean;
939
+ action: "TRIGGER_LOADING";
940
+ queryHash: string;
941
+ cleared?: undefined;
942
+ queryCountBefore?: undefined;
943
+ queryCountAfter?: undefined;
944
+ mutationCountBefore?: undefined;
945
+ mutationCountAfter?: undefined;
946
+ } | {
947
+ applied: boolean;
948
+ action: "RESTORE_LOADING";
949
+ queryHash: string;
950
+ cleared?: undefined;
951
+ queryCountBefore?: undefined;
952
+ queryCountAfter?: undefined;
953
+ mutationCountBefore?: undefined;
954
+ mutationCountAfter?: undefined;
955
+ } | {
956
+ applied: boolean;
957
+ action: "RESET";
958
+ queryHash: string;
959
+ cleared?: undefined;
960
+ queryCountBefore?: undefined;
961
+ queryCountAfter?: undefined;
962
+ mutationCountBefore?: undefined;
963
+ mutationCountAfter?: undefined;
964
+ } | {
965
+ applied: boolean;
966
+ action: "REMOVE";
967
+ queryHash: string;
968
+ cleared?: undefined;
969
+ queryCountBefore?: undefined;
970
+ queryCountAfter?: undefined;
971
+ mutationCountBefore?: undefined;
972
+ mutationCountAfter?: undefined;
973
+ } | {
974
+ applied: boolean;
975
+ action: "REFETCH";
976
+ queryHash: string;
977
+ cleared?: undefined;
978
+ queryCountBefore?: undefined;
979
+ queryCountAfter?: undefined;
980
+ mutationCountBefore?: undefined;
981
+ mutationCountAfter?: undefined;
982
+ } | {
983
+ applied: boolean;
984
+ action: "INVALIDATE";
985
+ queryHash: string;
986
+ cleared?: undefined;
987
+ queryCountBefore?: undefined;
988
+ queryCountAfter?: undefined;
989
+ mutationCountBefore?: undefined;
990
+ mutationCountAfter?: undefined;
991
+ }>;
992
+ };
993
+ export type TanStackQueryAgentController = ReturnType<typeof createTanStackQueryAgentController>;
994
+ export type TanStackQueryAgentPaginationInput = PaginationInput;
995
+ export type TanStackQueryAgentQueryHashInput = QueryHashInput;
996
+ export type TanStackQueryAgentQueryToggleInput = QueryToggleInput;
997
+ export type TanStackQueryAgentMutationIdInput = MutationIdInput;
998
+ export type TanStackQueryAgentOnlineStatusInput = OnlineStatusInput;
999
+ export declare const TANSTACK_QUERY_AGENT_PLUGIN_ID = "@rozenite/tanstack-query-plugin";
1000
+ export {};