-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_types.go
More file actions
1044 lines (921 loc) · 41.4 KB
/
app_types.go
File metadata and controls
1044 lines (921 loc) · 41.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package main
type AuthFileItem struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Provider string `json:"provider,omitempty"`
Email string `json:"email,omitempty"`
PlanType string `json:"planType,omitempty"`
Size int64 `json:"size,omitempty"`
AuthIndex interface{} `json:"authIndex,omitempty"`
RuntimeOnly bool `json:"runtimeOnly,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Unavailable bool `json:"unavailable,omitempty"`
Status string `json:"status,omitempty"`
StatusMessage string `json:"statusMessage,omitempty"`
LastRefresh interface{} `json:"lastRefresh,omitempty"`
Modified int64 `json:"modified,omitempty"`
}
type AuthFilesResponse struct {
Files []AuthFileItem `json:"files"`
Total int `json:"total,omitempty"`
}
type UploadFilePayload struct {
Name string `json:"name"`
ContentBase64 string `json:"contentBase64"`
}
type DownloadFileResponse struct {
Name string `json:"name"`
ContentBase64 string `json:"contentBase64"`
}
type OAuthStartResult struct {
URL string `json:"url"`
State string `json:"state,omitempty"`
}
type OAuthStatusResult struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
}
type CompleteCodexOAuthInput struct {
ExistingName string `json:"existingName"`
PreviousNames []string `json:"previousNames"`
}
type CodexQuotaWindow struct {
ID string `json:"id"`
Label string `json:"label"`
RemainingPercent *int `json:"remainingPercent,omitempty"`
UsedTokens *float64 `json:"usedTokens,omitempty"`
LimitTokens *float64 `json:"limitTokens,omitempty"`
RemainingTokens *float64 `json:"remainingTokens,omitempty"`
ResetLabel string `json:"resetLabel"`
ResetAtUnix int64 `json:"resetAtUnix,omitempty"`
}
type CodexQuotaResponse struct {
PlanType string `json:"planType,omitempty"`
Windows []CodexQuotaWindow `json:"windows"`
Billing *CodexQuotaBillingInfo `json:"billing,omitempty"`
}
type CodexQuotaBillingInfo struct {
IsAvailable bool `json:"isAvailable"`
BalanceInfos []CodexQuotaBillingBalanceInfo `json:"balanceInfos"`
}
type CodexQuotaBillingBalanceInfo struct {
Currency string `json:"currency"`
TotalBalance string `json:"totalBalance"`
GrantedBalance string `json:"grantedBalance"`
ToppedUpBalance string `json:"toppedUpBalance"`
}
type AccountRecord struct {
ID string `json:"id"`
Provider string `json:"provider"`
CredentialSource string `json:"credentialSource"`
DisplayName string `json:"displayName"`
Status string `json:"status"`
Priority int `json:"priority,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Email string `json:"email,omitempty"`
PlanType string `json:"planType,omitempty"`
Name string `json:"name,omitempty"`
APIKey string `json:"apiKey,omitempty"`
APIKeys []string `json:"apiKeys,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
KeyFingerprint string `json:"keyFingerprint,omitempty"`
KeySuffix string `json:"keySuffix,omitempty"`
BaseURL string `json:"baseUrl,omitempty"`
Prefix string `json:"prefix,omitempty"`
ProxyURL string `json:"proxyUrl,omitempty"`
AuthIndex interface{} `json:"authIndex,omitempty"`
QuotaKey string `json:"quotaKey,omitempty"`
QuotaCurl string `json:"quotaCurl,omitempty"`
QuotaEnabled bool `json:"quotaEnabled,omitempty"`
LocalOnly bool `json:"localOnly,omitempty"`
SupportedFormats []string `json:"supportedFormats,omitempty"`
FormatBaseURLs map[string]string `json:"formatBaseUrls,omitempty"`
BillingCurl string `json:"billingCurl,omitempty"`
BillingEnabled bool `json:"billingEnabled,omitempty"`
}
type CreateCodexAPIKeyInput struct {
APIKey string `json:"apiKey"`
Label string `json:"label,omitempty"`
BaseURL string `json:"baseUrl"`
FormatBaseURLs map[string]string `json:"formatBaseUrls,omitempty"`
Priority int `json:"priority,omitempty"`
Prefix string `json:"prefix,omitempty"`
ProxyURL string `json:"proxyUrl,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
ExcludedModels []string `json:"excludedModels,omitempty"`
QuotaCurl string `json:"quotaCurl,omitempty"`
QuotaEnabled bool `json:"quotaEnabled,omitempty"`
BillingCurl string `json:"billingCurl,omitempty"`
BillingEnabled bool `json:"billingEnabled,omitempty"`
}
type UpdateCodexAPIKeyPriorityInput struct {
ID string `json:"id"`
Priority int `json:"priority,omitempty"`
}
type UpdateCodexAPIKeyLabelInput struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
}
type UpdateCodexAPIKeyConfigInput struct {
ID string `json:"id"`
APIKey string `json:"apiKey"`
BaseURL string `json:"baseUrl"`
Prefix string `json:"prefix,omitempty"`
ProxyURL string `json:"proxyUrl,omitempty"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
QuotaCurl string `json:"quotaCurl,omitempty"`
QuotaEnabled bool `json:"quotaEnabled,omitempty"`
BillingCurl string `json:"billingCurl,omitempty"`
BillingEnabled bool `json:"billingEnabled,omitempty"`
}
type TestCodexAPIKeyQuotaCurlInput struct {
APIKey string `json:"apiKey"`
BaseURL string `json:"baseUrl"`
Prefix string `json:"prefix,omitempty"`
QuotaCurl string `json:"quotaCurl"`
}
type UpdateAccountPriorityInput struct {
ID string `json:"id"`
Priority int `json:"priority,omitempty"`
}
type ProbeCodexAccountRoutingInput struct {
Model string `json:"model"`
Attempts int `json:"attempts,omitempty"`
AllowAccountIDs []string `json:"allowAccountIDs,omitempty"`
DenyAccountIDs []string `json:"denyAccountIDs,omitempty"`
OrderAccountIDs []string `json:"orderAccountIDs,omitempty"`
AllowFallback bool `json:"allowFallback,omitempty"`
}
type ProbeClaudeCodeAccountRoutingInput struct {
Model string `json:"model"`
Attempts int `json:"attempts,omitempty"`
AllowAccountIDs []string `json:"allowAccountIDs,omitempty"`
DenyAccountIDs []string `json:"denyAccountIDs,omitempty"`
OrderAccountIDs []string `json:"orderAccountIDs,omitempty"`
AllowFallback bool `json:"allowFallback,omitempty"`
}
type UpdateOAuthModelAliasesInput struct {
Channel string `json:"channel"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
}
type CodexAccountRoutingProbeResult struct {
Model string `json:"model"`
Attempts []CodexAccountRoutingProbeAttempt `json:"attempts"`
}
type CodexAccountRoutingProbeAttempt struct {
Index int `json:"index"`
Success bool `json:"success"`
StatusCode int `json:"statusCode,omitempty"`
AccountID string `json:"accountID,omitempty"`
AccountLabel string `json:"accountLabel,omitempty"`
Provider string `json:"provider,omitempty"`
Message string `json:"message,omitempty"`
Evidence string `json:"evidence,omitempty"`
ResponseBody string `json:"responseBody,omitempty"`
StartedAt string `json:"startedAt,omitempty"`
FinishedAt string `json:"finishedAt,omitempty"`
}
type ClaudeCodeAccountRoutingProbeResult struct {
Model string `json:"model"`
Attempts []ClaudeCodeAccountRoutingProbeAttempt `json:"attempts"`
}
type ClaudeCodeAccountRoutingProbeAttempt struct {
Index int `json:"index"`
Success bool `json:"success"`
StatusCode int `json:"statusCode,omitempty"`
AccountID string `json:"accountID,omitempty"`
AccountLabel string `json:"accountLabel,omitempty"`
Provider string `json:"provider,omitempty"`
Message string `json:"message,omitempty"`
Evidence string `json:"evidence,omitempty"`
ResponseBody string `json:"responseBody,omitempty"`
StartedAt string `json:"startedAt,omitempty"`
FinishedAt string `json:"finishedAt,omitempty"`
}
type OpenAICompatibleProvider struct {
Name string `json:"name"`
Priority int `json:"priority,omitempty"`
Disabled bool `json:"disabled,omitempty"`
BaseURL string `json:"baseUrl"`
Prefix string `json:"prefix,omitempty"`
ProxyURL string `json:"proxyUrl,omitempty"`
APIKey string `json:"apiKey"`
APIKeys []string `json:"apiKeys,omitempty"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
KeyCount int `json:"keyCount,omitempty"`
ModelCount int `json:"modelCount,omitempty"`
HasHeaders bool `json:"hasHeaders,omitempty"`
}
type OpenAICompatibleModel struct {
Name string `json:"name"`
Alias string `json:"alias,omitempty"`
SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitempty"`
DefaultReasoningEffort string `json:"defaultReasoningEffort,omitempty"`
}
type CreateOpenAICompatibleProviderInput struct {
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
Prefix string `json:"prefix,omitempty"`
APIKey string `json:"apiKey"`
}
type UpdateOpenAICompatibleProviderInput struct {
CurrentName string `json:"currentName"`
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
Prefix string `json:"prefix,omitempty"`
ProxyURL *string `json:"proxyUrl,omitempty"`
APIKey string `json:"apiKey"`
APIKeys []string `json:"apiKeys,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Models []OpenAICompatibleModel `json:"models,omitempty"`
}
type VerifyOpenAICompatibleProviderInput struct {
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
Model string `json:"model"`
Headers map[string]string `json:"headers,omitempty"`
}
type FetchOpenAICompatibleProviderModelsInput struct {
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
Headers map[string]string `json:"headers,omitempty"`
}
type VerifyOpenAICompatibleProviderResult struct {
Success bool `json:"success"`
StatusCode int `json:"statusCode,omitempty"`
Message string `json:"message,omitempty"`
ResponseBody string `json:"responseBody,omitempty"`
}
type FetchOpenAICompatibleProviderModelsResult struct {
Models []OpenAICompatibleModel `json:"models,omitempty"`
StatusCode int `json:"statusCode,omitempty"`
Message string `json:"message,omitempty"`
ResponseBody string `json:"responseBody,omitempty"`
}
type RelayServiceConfig struct {
APIKeys []string `json:"apiKeys"`
APIKeyItems []RelayServiceAPIKeyItem `json:"apiKeyItems"`
Endpoints []RelayServiceEndpoint `json:"endpoints"`
}
type RelaySupportedModelsResult struct {
Models []OpenAICompatibleModel `json:"models"`
}
type LocalCodexModelProviderView struct {
ProviderID string `json:"providerID"`
ProviderName string `json:"providerName"`
}
type LocalCodexModelProviderStateView struct {
CurrentProviderID string `json:"currentProviderID"`
CurrentProviderName string `json:"currentProviderName"`
CurrentProviderIsBuiltin bool `json:"currentProviderIsBuiltin"`
CurrentProviderExists bool `json:"currentProviderExists"`
Providers []LocalCodexModelProviderView `json:"providers"`
}
type RelayServiceEndpoint struct {
ID string `json:"id"`
Kind string `json:"kind"`
Host string `json:"host"`
BaseURL string `json:"baseUrl"`
}
type RelayServiceAPIKeyItem struct {
Value string `json:"value"`
CreatedAt string `json:"createdAt,omitempty"`
LastUsedAt string `json:"lastUsedAt,omitempty"`
}
type RelayRoutingConfig struct {
Strategy string `json:"strategy"`
SessionAffinity bool `json:"sessionAffinity"`
SessionAffinityTTL string `json:"sessionAffinityTTL"`
RequestRetry int `json:"requestRetry"`
MaxRetryCredentials int `json:"maxRetryCredentials"`
MaxRetryInterval int `json:"maxRetryInterval"`
SwitchProject bool `json:"switchProject"`
SwitchPreviewModel bool `json:"switchPreviewModel"`
AntigravityCredits bool `json:"antigravityCredits"`
}
type RelayLocalApplyResult struct {
CodexHomePath string `json:"codexHomePath"`
AuthFilePath string `json:"authFilePath"`
ConfigPath string `json:"configPath"`
}
type RelayLocalApplyInput struct {
APIKey string `json:"apiKey"`
AuthFileContentBase64 string `json:"authFileContentBase64,omitempty"`
BaseURL string `json:"baseURL"`
Model string `json:"model"`
ReasoningEffort string `json:"reasoningEffort"`
ProviderID string `json:"providerID"`
ProviderName string `json:"providerName"`
SupportsWebsockets bool `json:"supportsWebsockets"`
AuthStrategy string `json:"authStrategy"`
SkipRelayKeyMetadata bool `json:"skipRelayKeyMetadata,omitempty"`
}
type LocalCodexAuthState struct {
AuthFilePath string `json:"authFilePath"`
HasAuthFile bool `json:"hasAuthFile"`
AuthMode string `json:"authMode"`
HasOpenAIAPIKey bool `json:"hasOpenAIAPIKey"`
HasTokens bool `json:"hasTokens"`
AccountEmail string `json:"accountEmail,omitempty"`
PlanType string `json:"planType,omitempty"`
CanPreserveChatGPTAuth bool `json:"canPreserveChatGPTAuth"`
Warnings []string `json:"warnings,omitempty"`
}
type ClaudeCodeLocalApplyResult struct {
ClaudeConfigDirPath string `json:"claudeConfigDirPath"`
SettingsPath string `json:"settingsPath"`
Warnings []string `json:"warnings,omitempty"`
Conflicts []string `json:"conflicts,omitempty"`
}
type ClaudeCodeLocalApplyOptions struct {
Model string `json:"model,omitempty"`
DefaultHaikuModel string `json:"defaultHaikuModel,omitempty"`
DefaultSonnetModel string `json:"defaultSonnetModel,omitempty"`
DefaultOpusModel string `json:"defaultOpusModel,omitempty"`
SmallFastModel string `json:"smallFastModel,omitempty"`
MaxOutputTokens string `json:"maxOutputTokens,omitempty"`
APITimeoutMS string `json:"apiTimeoutMs,omitempty"`
DisableNonEssentialTraffic bool `json:"disableNonEssentialTraffic,omitempty"`
ClaudeCodeAttributionHeader bool `json:"claudeCodeAttributionHeader,omitempty"`
}
type UsageStatisticsResponse struct {
Usage map[string]interface{} `json:"usage"`
FailedRequests int64 `json:"failedRequests,omitempty"`
}
type SidecarUsageAttributionInput struct {
Window string `json:"window,omitempty"`
Bucket string `json:"bucket,omitempty"`
IncludeUnresolved bool `json:"includeUnresolved,omitempty"`
}
type SidecarUsageAttributionBucket struct {
Start string `json:"start"`
RequestCount int64 `json:"requestCount"`
FailedCount int64 `json:"failedCount"`
InputTokens int64 `json:"inputTokens"`
CachedInputTokens int64 `json:"cachedInputTokens"`
OutputTokens int64 `json:"outputTokens"`
TotalTokens int64 `json:"totalTokens"`
}
type SidecarUsageAttributionItem struct {
AttributionKey string `json:"attributionKey"`
AttributionKind string `json:"attributionKind"`
AccountKey string `json:"accountKey"`
CredentialKey string `json:"credentialKey,omitempty"`
Provider string `json:"provider"`
RequestedModels []string `json:"requestedModels"`
RequestCount int64 `json:"requestCount"`
FailedCount int64 `json:"failedCount"`
LatencyAverageMs int64 `json:"latencyAverageMs,omitempty"`
InputTokens int64 `json:"inputTokens"`
CachedInputTokens int64 `json:"cachedInputTokens"`
OutputTokens int64 `json:"outputTokens"`
TotalTokens int64 `json:"totalTokens"`
LastActivityAt string `json:"lastActivityAt,omitempty"`
Buckets []SidecarUsageAttributionBucket `json:"buckets"`
}
type SidecarUsageAttributionResponse struct {
Window string `json:"window"`
Bucket string `json:"bucket"`
GeneratedAt string `json:"generatedAt"`
Items []SidecarUsageAttributionItem `json:"items"`
Unresolved []SidecarUsageAttributionItem `json:"unresolved,omitempty"`
}
type RateLimitRulesInput struct {
AccountKey string `json:"accountKey,omitempty"`
}
type RateLimitStatusInput struct {
AccountKey string `json:"accountKey"`
}
type DeleteRateLimitRuleInput struct {
ID string `json:"id"`
}
type RateLimitEventsInput struct {
AccountKey string `json:"accountKey,omitempty"`
Limit int `json:"limit,omitempty"`
}
type RateLimitStrategyMeta struct {
ID string `json:"id"`
Name string `json:"name"`
SupportedWindows []string `json:"supportedWindows"`
}
type RateLimitRule struct {
ID string `json:"id,omitempty"`
AccountKey string `json:"accountKey"`
MatchKey string `json:"matchKey,omitempty"`
Strategy string `json:"strategy"`
Window string `json:"window"`
LimitValue int64 `json:"limitValue"`
Action string `json:"action"`
Enabled bool `json:"enabled"`
Label string `json:"label,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
type RateLimitRuleState struct {
Rule RateLimitRule `json:"rule"`
Exceeded bool `json:"exceeded"`
Reason string `json:"reason,omitempty"`
UsagePct float64 `json:"usagePct"`
CurrentUsage int64 `json:"currentUsage"`
}
type RateLimitState struct {
AccountKey string `json:"accountKey"`
MatchKey string `json:"matchKey,omitempty"`
Blocked bool `json:"blocked"`
BlockReason string `json:"blockReason,omitempty"`
Rules []RateLimitRuleState `json:"rules"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
type RateLimitEvent struct {
ID string `json:"id"`
AccountKey string `json:"accountKey"`
MatchKey string `json:"matchKey,omitempty"`
RuleID string `json:"ruleID"`
Strategy string `json:"strategy"`
Window string `json:"window"`
Action string `json:"action"`
UsageValue int64 `json:"usageValue"`
LimitValue int64 `json:"limitValue"`
Blocked bool `json:"blocked"`
Reason string `json:"reason,omitempty"`
TriggeredAt int64 `json:"triggeredAt"`
}
type LocalProjectedUsageDetail struct {
Timestamp string `json:"timestamp"`
Provider string `json:"provider"`
SourceKind string `json:"sourceKind"`
SessionID string `json:"sessionID,omitempty"`
ProjectName string `json:"projectName,omitempty"`
Model string `json:"model,omitempty"`
InputTokens int64 `json:"inputTokens"`
CachedInputTokens int64 `json:"cachedInputTokens"`
OutputTokens int64 `json:"outputTokens"`
RequestCount int64 `json:"requestCount"`
}
type LocalProjectedUsageResponse struct {
Provider string `json:"provider"`
SourceKind string `json:"sourceKind"`
ScannedFiles int `json:"scannedFiles"`
CacheHitFiles int `json:"cacheHitFiles,omitempty"`
DeltaAppendFiles int `json:"deltaAppendFiles,omitempty"`
FullRebuildFiles int `json:"fullRebuildFiles,omitempty"`
FileMissingFiles int `json:"fileMissingFiles,omitempty"`
Details []LocalProjectedUsageDetail `json:"details"`
}
type LocalProjectedUsageSettings struct {
RefreshIntervalMinutes int `json:"refreshIntervalMinutes"`
}
type SidecarProxySettings struct {
UseSystemProxy bool `json:"useSystemProxy"`
ConfigPath string `json:"configPath"`
AppliedToRunningSidecar bool `json:"appliedToRunningSidecar"`
}
type AppRuntimeSettings struct {
LaunchAtLogin bool `json:"launchAtLogin"`
LaunchAtLoginSupported bool `json:"launchAtLoginSupported"`
LaunchAgentPath string `json:"launchAgentPath,omitempty"`
CloseAction string `json:"closeAction"`
MenuBarResident bool `json:"menuBarResident"`
ConfigPath string `json:"configPath,omitempty"`
}
type CodexFeatureDefinition struct {
Section string `json:"section"`
Key string `json:"key"`
ID string `json:"id,omitempty"`
Path []string `json:"path,omitempty"`
Description string `json:"description,omitempty"`
Stage string `json:"stage"`
ValueType string `json:"valueType,omitempty"`
Options []string `json:"options,omitempty"`
DefaultValue any `json:"defaultValue,omitempty"`
DefaultEnabled bool `json:"defaultEnabled"`
CanonicalKey string `json:"canonicalKey,omitempty"`
LegacyAlias bool `json:"legacyAlias,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
Unsupported bool `json:"unsupported,omitempty"`
}
type CodexFeatureConfigSnapshot struct {
CodexHomePath string `json:"codexHomePath"`
ConfigPath string `json:"configPath"`
Exists bool `json:"exists"`
Definitions []CodexFeatureDefinition `json:"definitions"`
Values map[string]bool `json:"values"`
TypedValues map[string]any `json:"typedValues,omitempty"`
RawValues map[string]string `json:"rawValues,omitempty"`
UnknownValues map[string]bool `json:"unknownValues,omitempty"`
UnknownSections map[string]string `json:"unknownSections,omitempty"`
Raw string `json:"raw"`
Warnings []string `json:"warnings"`
}
type SaveCodexFeatureConfigInput struct {
Values map[string]bool `json:"values,omitempty"`
Changes []CodexConfigChangeInput `json:"changes,omitempty"`
}
type CodexConfigChangeInput struct {
ID string `json:"id,omitempty"`
Section string `json:"section,omitempty"`
Key string `json:"key,omitempty"`
Path []string `json:"path,omitempty"`
ValueType string `json:"valueType,omitempty"`
Value any `json:"value,omitempty"`
}
type CodexFeatureConfigChange struct {
ID string `json:"id,omitempty"`
Section string `json:"section,omitempty"`
Key string `json:"key"`
Path []string `json:"path,omitempty"`
ValueType string `json:"valueType,omitempty"`
Type string `json:"type"`
PreviousEnabled *bool `json:"previousEnabled,omitempty"`
NextEnabled bool `json:"nextEnabled,omitempty"`
PreviousValue any `json:"previousValue,omitempty"`
NextValue any `json:"nextValue,omitempty"`
}
type CodexFeatureConfigPreview struct {
ConfigPath string `json:"configPath"`
WillCreate bool `json:"willCreate"`
Changes []CodexFeatureConfigChange `json:"changes"`
Preview string `json:"preview"`
Warnings []string `json:"warnings"`
}
type CodexSkillFile struct {
Path string `json:"path"`
Kind string `json:"kind"`
Content string `json:"content,omitempty"`
Previewable bool `json:"previewable"`
}
type GetCodexSkillFilePreviewInput struct {
SkillPath string `json:"skillPath"`
FilePath string `json:"filePath"`
}
type GetCodexSkillFilePreviewResult struct {
Path string `json:"path"`
Content string `json:"content,omitempty"`
Previewable bool `json:"previewable"`
}
type CodexSkillRecord struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
RootLabel string `json:"rootLabel"`
RootPath string `json:"rootPath"`
SourceKind string `json:"sourceKind"`
Origin string `json:"origin"`
VersionLabel string `json:"versionLabel,omitempty"`
Files []CodexSkillFile `json:"files"`
SkillMarkdown string `json:"skillMarkdown"`
PreviewMarkdown string `json:"previewMarkdown"`
Warnings []string `json:"warnings,omitempty"`
}
type CodexSkillRoot struct {
Label string `json:"label"`
Path string `json:"path"`
SourceKind string `json:"sourceKind"`
Exists bool `json:"exists"`
}
type CodexSkillsSnapshot struct {
CodexHomePath string `json:"codexHomePath"`
ConfigPath string `json:"configPath"`
Roots []CodexSkillRoot `json:"roots"`
Skills []CodexSkillRecord `json:"skills"`
Warnings []string `json:"warnings,omitempty"`
}
type ClaudeCodeExtensionsSnapshot struct {
ClaudeConfigDirPath string `json:"claudeConfigDirPath"`
ClaudeJSONPath string `json:"claudeJsonPath"`
ProjectPath string `json:"projectPath"`
Skills []ClaudeCodeSkillAsset `json:"skills"`
McpServers []ClaudeCodeMcpAsset `json:"mcpServers"`
Warnings []string `json:"warnings,omitempty"`
}
type ClaudeCodeSkillAsset struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Scope string `json:"scope"`
Path string `json:"path"`
FrontmatterStatus string `json:"frontmatterStatus"`
Invocation string `json:"invocation"`
ModelInvocation string `json:"modelInvocation"`
Removable bool `json:"removable"`
FileCount int `json:"fileCount"`
Risk string `json:"risk,omitempty"`
PreviewMarkdown string `json:"previewMarkdown,omitempty"`
FrontmatterError string `json:"frontmatterError,omitempty"`
LegacyCommandSource string `json:"legacyCommandSource,omitempty"`
}
type ClaudeCodeMcpAsset struct {
ID string `json:"id"`
Label string `json:"label"`
Transport string `json:"transport"`
Scope string `json:"scope"`
SourcePath string `json:"sourcePath"`
Endpoint string `json:"endpoint"`
Active bool `json:"active"`
SecretState string `json:"secretState"`
Dirty bool `json:"dirty,omitempty"`
ShadowedBy string `json:"shadowedBy,omitempty"`
}
type SaveClaudeCodeMcpServerInput struct {
Server ClaudeCodeMcpAsset `json:"server"`
}
type ClaudeCodeMcpChange struct {
Key string `json:"key"`
Before string `json:"before"`
After string `json:"after"`
}
type SaveClaudeCodeMcpServerResult struct {
ConfigPath string `json:"configPath"`
Server ClaudeCodeMcpAsset `json:"server"`
Preview string `json:"preview"`
Changes []ClaudeCodeMcpChange `json:"changes"`
}
type SaveCodexSkillEnabledInput struct {
Path string `json:"path"`
Name string `json:"name,omitempty"`
Enabled bool `json:"enabled"`
}
type ClaudeCodeSettingsSnapshotDTO struct {
ProjectPath string `json:"projectPath"`
Layers []ClaudeCodeSettingsLayer `json:"layers"`
Warnings []string `json:"warnings,omitempty"`
}
type ClaudeCodeSettingsLayer struct {
Scope string `json:"scope"`
Path string `json:"path"`
Exists bool `json:"exists"`
ParseError string `json:"parseError,omitempty"`
KnownFields *ClaudeCodeSettingsFieldsDTO `json:"knownFields,omitempty"`
}
type ClaudeCodeSettingsFieldsDTO struct {
Env map[string]string `json:"env,omitempty"`
Permissions map[string]any `json:"permissions,omitempty"`
DisableAllHooks *bool `json:"disableAllHooks,omitempty"`
OutputStyle string `json:"outputStyle,omitempty"`
}
type PatchClaudeCodeSettingsInputDTO struct {
Scope string `json:"scope"`
Path string `json:"path"`
Patches map[string]any `json:"patches"`
}
type ClaudeCodeSettingsChangeDTO struct {
Key string `json:"key"`
Before any `json:"before"`
After any `json:"after"`
}
type PatchClaudeCodeSettingsResultDTO struct {
ConfigPath string `json:"configPath"`
Preview string `json:"preview"`
Changes []ClaudeCodeSettingsChangeDTO `json:"changes"`
}
type SaveCodexSkillEnabledResult struct {
ConfigPath string `json:"configPath"`
Preview string `json:"preview"`
}
type RemoveCodexSkillInput struct {
Path string `json:"path"`
}
type RemoveCodexSkillResult struct {
ConfigPath string `json:"configPath"`
RemovedPath string `json:"removedPath"`
Preview string `json:"preview"`
}
type OpenCodexSkillInFinderInput struct {
Path string `json:"path"`
}
type OpenCodexSkillInFinderResult struct {
Path string `json:"path"`
}
type CodexMcpEnvRow struct {
Key string `json:"key"`
Value string `json:"value"`
}
type CodexMcpToolRow struct {
Name string `json:"name"`
ApprovalMode string `json:"approvalMode,omitempty"`
}
type CodexMcpServer struct {
ID string `json:"id"`
Label string `json:"label"`
Enabled bool `json:"enabled"`
Transport string `json:"transport"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env []CodexMcpEnvRow `json:"env,omitempty"`
EnvVarsRaw string `json:"envVarsRaw,omitempty"`
Cwd string `json:"cwd,omitempty"`
URL string `json:"url,omitempty"`
BearerTokenEnvVar string `json:"bearerTokenEnvVar,omitempty"`
HTTPHeaders []CodexMcpEnvRow `json:"httpHeaders,omitempty"`
EnvHTTPHeaders []CodexMcpEnvRow `json:"envHttpHeaders,omitempty"`
EnvironmentID string `json:"environmentId,omitempty"`
ExperimentalEnvironment string `json:"experimentalEnvironment,omitempty"`
Required bool `json:"required,omitempty"`
SupportsParallelToolCalls bool `json:"supportsParallelToolCalls,omitempty"`
StartupTimeoutSec string `json:"startupTimeoutSec,omitempty"`
ToolTimeoutSec string `json:"toolTimeoutSec,omitempty"`
DefaultToolsApprovalMode string `json:"defaultToolsApprovalMode,omitempty"`
EnabledTools []string `json:"enabledTools,omitempty"`
DisabledTools []string `json:"disabledTools,omitempty"`
Scopes []string `json:"scopes,omitempty"`
OAuthClientID string `json:"oauthClientId,omitempty"`
OAuthResource string `json:"oauthResource,omitempty"`
Tools []CodexMcpToolRow `json:"tools,omitempty"`
RawConfig string `json:"rawConfig,omitempty"`
SourcePath string `json:"sourcePath"`
Status string `json:"status"`
Warnings []string `json:"warnings,omitempty"`
}
type CodexMcpServersSnapshot struct {
CodexHomePath string `json:"codexHomePath"`
ConfigPath string `json:"configPath"`
Exists bool `json:"exists"`
Servers []CodexMcpServer `json:"servers"`
Warnings []string `json:"warnings,omitempty"`
}
type SaveCodexMcpServerInput struct {
Server CodexMcpServer `json:"server"`
}
type CodexMcpChange struct {
Key string `json:"key"`
Before string `json:"before"`
After string `json:"after"`
}
type SaveCodexMcpServerResult struct {
ConfigPath string `json:"configPath"`
Server CodexMcpServer `json:"server"`
Preview string `json:"preview"`
Changes []CodexMcpChange `json:"changes"`
}
type OpenCodexConfigTomlResult struct {
ConfigPath string `json:"configPath"`
}
type CodexConfigTomlDocument struct {
ConfigPath string `json:"configPath"`
Content string `json:"content"`
Exists bool `json:"exists"`
}
type SaveCodexConfigTomlInput struct {
Content string `json:"content"`
}
type SaveCodexConfigTomlResult struct {
ConfigPath string `json:"configPath"`
Content string `json:"content"`
}
type UpdateSessionProviderMapping struct {
SourceProvider string `json:"sourceProvider"`
TargetProvider string `json:"targetProvider"`
}
type UpdateSessionProvidersInput struct {
ProjectID string `json:"projectID"`
Mappings []UpdateSessionProviderMapping `json:"mappings"`
Snapshot *SessionManagementSnapshot `json:"snapshot,omitempty"`
}
type SessionManagementSnapshot struct {
ProjectCount int `json:"projectCount"`
SessionCount int `json:"sessionCount"`
ActiveSessionCount int `json:"activeSessionCount"`
ArchivedSessionCount int `json:"archivedSessionCount"`
LastScanAt string `json:"lastScanAt"`
ProviderCounts map[string]int `json:"providerCounts"`
Projects []SessionManagementProjectRecord `json:"projects"`
}
type SessionManagementProviderCount struct {
Provider string `json:"provider"`
SessionCount int `json:"sessionCount"`
}
type SessionManagementProjectRecord struct {
ID string `json:"id"`
Name string `json:"name"`
ProviderCounts map[string]int `json:"providerCounts,omitempty"`
SessionCount int `json:"sessionCount"`
ActiveSessionCount int `json:"activeSessionCount"`
ArchivedSessionCount int `json:"archivedSessionCount"`
LastActiveAt string `json:"lastActiveAt"`
ProviderSummary string `json:"providerSummary"`
Sessions []SessionManagementSessionRecord `json:"sessions"`
}
type SessionManagementSessionRecord struct {
ID string `json:"id"`
SessionID string `json:"sessionID"`
ProjectID string `json:"projectID"`
ProjectName string `json:"projectName"`
Title string `json:"title"`
Status string `json:"status"`
Archived bool `json:"archived"`
MessageCount int `json:"messageCount"`
RoleSummary string `json:"roleSummary"`
StartedAt string `json:"startedAt"`
UpdatedAt string `json:"updatedAt"`
FileLabel string `json:"fileLabel"`
Summary string `json:"summary"`
Preview string `json:"preview"`
Topic string `json:"topic"`
CurrentMessageLabel string `json:"currentMessageLabel"`
Provider string `json:"provider"`
Model string `json:"model,omitempty"`
}
type SessionManagementSessionDetail struct {
SessionID string `json:"sessionID"`
ProjectID string `json:"projectID"`
ProjectName string `json:"projectName"`
Title string `json:"title"`
Status string `json:"status"`
Archived bool `json:"archived"`
FileLabel string `json:"fileLabel"`
MessageCount int `json:"messageCount"`
Masked bool `json:"masked"`
CurrentMessageLabel string `json:"currentMessageLabel"`
RoleSummary string `json:"roleSummary"`
Topic string `json:"topic"`
Preview string `json:"preview"`
Provider string `json:"provider"`
Model string `json:"model,omitempty"`
StartedAt string `json:"startedAt"`
UpdatedAt string `json:"updatedAt"`
Messages []SessionManagementMessageRecord `json:"messages"`
}
type SessionManagementMessageRecord struct {
ID string `json:"id"`
Role string `json:"role"`
TimeLabel string `json:"timeLabel"`
Timestamp string `json:"timestamp,omitempty"`
Title string `json:"title"`
Summary string `json:"summary"`
Content string `json:"content"`
Truncated bool `json:"truncated,omitempty"`
}
// CLAUDE.md Memory File types
type ClaudeCodeMemoryFilesSnapshotDTO struct {
ProjectPath string `json:"projectPath"`
Files []ClaudeCodeMemoryFileRecordDTO `json:"files"`
Warnings []string `json:"warnings,omitempty"`
}
type ClaudeCodeMemoryFileRecordDTO struct {
Scope string `json:"scope"`
Path string `json:"path"`
Exists bool `json:"exists"`
GitIgnored bool `json:"gitIgnored,omitempty"`
Imports []ClaudeCodeMemoryFileImportDTO `json:"imports,omitempty"`
Content string `json:"content,omitempty"`
ContentTruncated bool `json:"contentTruncated,omitempty"`
Size int64 `json:"size"`
}
type ClaudeCodeMemoryFileImportDTO struct {
Raw string `json:"raw"`
Resolved string `json:"resolved"`
Exists bool `json:"exists"`
Depth int `json:"depth"`
}
type SaveClaudeCodeMemoryFileInputDTO struct {
Path string `json:"path"`
Content string `json:"content"`
}
type SaveClaudeCodeMemoryFileResultDTO struct {
Path string `json:"path"`
Size int64 `json:"size"`
Warning string `json:"warning,omitempty"`
}