@myagentroam/protocol 0.10.8 → 0.10.10
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/dist/index.d.ts +263 -19
- package/dist/index.js +48 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export * from './tool-result-resource.js';
|
|
3
3
|
import { type ResourceOwnership } from './enterprise.js';
|
|
4
4
|
export * from './chatgpt-oauth.js';
|
|
5
|
+
export declare const XAI_SUBSCRIPTION_BASE_URL = "https://api.x.ai/v1";
|
|
6
|
+
export declare const XAI_SUBSCRIPTION_PROXY_BASE_URL = "https://cli-chat-proxy.grok.com/v1";
|
|
5
7
|
export * from './composer-tags.js';
|
|
6
8
|
export * from './enterprise.js';
|
|
7
9
|
export * from './skill.js';
|
|
@@ -41,6 +43,7 @@ export declare const marAgentRuntimeCredentialCapabilitySchema: z.ZodObject<{
|
|
|
41
43
|
fastMode: z.ZodOptional<z.ZodBoolean>;
|
|
42
44
|
serviceTiers: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto", "default", "flex", "priority", "fast", "ultrafast"]>, "many">>;
|
|
43
45
|
namespacedTools: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
responsesOptionalParameters: z.ZodOptional<z.ZodBoolean>;
|
|
44
47
|
httpVersions: z.ZodEffects<z.ZodArray<z.ZodEnum<["1.1", "2"]>, "many">, ("2" | "1.1")[], ("2" | "1.1")[]>;
|
|
45
48
|
}, "strict", z.ZodTypeAny, {
|
|
46
49
|
apiVersion: 1;
|
|
@@ -49,6 +52,7 @@ export declare const marAgentRuntimeCredentialCapabilitySchema: z.ZodObject<{
|
|
|
49
52
|
fastMode?: boolean | undefined;
|
|
50
53
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
51
54
|
namespacedTools?: boolean | undefined;
|
|
55
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
52
56
|
}, {
|
|
53
57
|
apiVersion: 1;
|
|
54
58
|
websocket: boolean;
|
|
@@ -56,6 +60,7 @@ export declare const marAgentRuntimeCredentialCapabilitySchema: z.ZodObject<{
|
|
|
56
60
|
fastMode?: boolean | undefined;
|
|
57
61
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
58
62
|
namespacedTools?: boolean | undefined;
|
|
63
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
59
64
|
}>;
|
|
60
65
|
export type MarAgentRuntimeCredentialCapability = z.infer<typeof marAgentRuntimeCredentialCapabilitySchema>;
|
|
61
66
|
export declare const conversationHostingCapabilitySchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -980,6 +985,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
980
985
|
fastMode: z.ZodOptional<z.ZodBoolean>;
|
|
981
986
|
serviceTiers: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto", "default", "flex", "priority", "fast", "ultrafast"]>, "many">>;
|
|
982
987
|
namespacedTools: z.ZodOptional<z.ZodBoolean>;
|
|
988
|
+
responsesOptionalParameters: z.ZodOptional<z.ZodBoolean>;
|
|
983
989
|
httpVersions: z.ZodEffects<z.ZodArray<z.ZodEnum<["1.1", "2"]>, "many">, ("2" | "1.1")[], ("2" | "1.1")[]>;
|
|
984
990
|
}, "strict", z.ZodTypeAny, {
|
|
985
991
|
apiVersion: 1;
|
|
@@ -988,6 +994,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
988
994
|
fastMode?: boolean | undefined;
|
|
989
995
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
990
996
|
namespacedTools?: boolean | undefined;
|
|
997
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
991
998
|
}, {
|
|
992
999
|
apiVersion: 1;
|
|
993
1000
|
websocket: boolean;
|
|
@@ -995,6 +1002,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
995
1002
|
fastMode?: boolean | undefined;
|
|
996
1003
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
997
1004
|
namespacedTools?: boolean | undefined;
|
|
1005
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
998
1006
|
}>>;
|
|
999
1007
|
chatgptLogin: z.ZodOptional<z.ZodObject<{
|
|
1000
1008
|
apiVersion: z.ZodLiteral<1>;
|
|
@@ -1131,6 +1139,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1131
1139
|
fastMode?: boolean | undefined;
|
|
1132
1140
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
1133
1141
|
namespacedTools?: boolean | undefined;
|
|
1142
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
1134
1143
|
} | undefined;
|
|
1135
1144
|
chatgptLogin?: {
|
|
1136
1145
|
apiVersion: 1;
|
|
@@ -1239,6 +1248,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1239
1248
|
fastMode?: boolean | undefined;
|
|
1240
1249
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
1241
1250
|
namespacedTools?: boolean | undefined;
|
|
1251
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
1242
1252
|
} | undefined;
|
|
1243
1253
|
chatgptLogin?: {
|
|
1244
1254
|
apiVersion: 1;
|
|
@@ -1347,6 +1357,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1347
1357
|
fastMode?: boolean | undefined;
|
|
1348
1358
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
1349
1359
|
namespacedTools?: boolean | undefined;
|
|
1360
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
1350
1361
|
} | undefined;
|
|
1351
1362
|
chatgptLogin?: {
|
|
1352
1363
|
apiVersion: 1;
|
|
@@ -1455,6 +1466,7 @@ export declare const nodeCapabilitiesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1455
1466
|
fastMode?: boolean | undefined;
|
|
1456
1467
|
serviceTiers?: ("auto" | "default" | "flex" | "priority" | "fast" | "ultrafast")[] | undefined;
|
|
1457
1468
|
namespacedTools?: boolean | undefined;
|
|
1469
|
+
responsesOptionalParameters?: boolean | undefined;
|
|
1458
1470
|
} | undefined;
|
|
1459
1471
|
chatgptLogin?: {
|
|
1460
1472
|
apiVersion: 1;
|
|
@@ -3152,6 +3164,25 @@ export declare const marAgentRuntimeModelConfigurationSchema: z.ZodEffects<z.Zod
|
|
|
3152
3164
|
}>]>>;
|
|
3153
3165
|
responsesToolNamespace: z.ZodOptional<z.ZodString>;
|
|
3154
3166
|
responsesConfigurationUpdates: z.ZodOptional<z.ZodBoolean>;
|
|
3167
|
+
responsesOptionalParameters: z.ZodOptional<z.ZodObject<{
|
|
3168
|
+
reasoningEffort: z.ZodBoolean;
|
|
3169
|
+
reasoningSummary: z.ZodBoolean;
|
|
3170
|
+
textVerbosity: z.ZodBoolean;
|
|
3171
|
+
promptCacheKey: z.ZodBoolean;
|
|
3172
|
+
nativeTools: z.ZodOptional<z.ZodBoolean>;
|
|
3173
|
+
}, "strict", z.ZodTypeAny, {
|
|
3174
|
+
reasoningEffort: boolean;
|
|
3175
|
+
reasoningSummary: boolean;
|
|
3176
|
+
textVerbosity: boolean;
|
|
3177
|
+
promptCacheKey: boolean;
|
|
3178
|
+
nativeTools?: boolean | undefined;
|
|
3179
|
+
}, {
|
|
3180
|
+
reasoningEffort: boolean;
|
|
3181
|
+
reasoningSummary: boolean;
|
|
3182
|
+
textVerbosity: boolean;
|
|
3183
|
+
promptCacheKey: boolean;
|
|
3184
|
+
nativeTools?: boolean | undefined;
|
|
3185
|
+
}>>;
|
|
3155
3186
|
imageGeneration: z.ZodOptional<z.ZodObject<{
|
|
3156
3187
|
provider: z.ZodOptional<z.ZodString>;
|
|
3157
3188
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -3413,6 +3444,13 @@ export declare const marAgentRuntimeModelConfigurationSchema: z.ZodEffects<z.Zod
|
|
|
3413
3444
|
hostedWebSearch: boolean;
|
|
3414
3445
|
responsesPreviousResponseId: boolean;
|
|
3415
3446
|
fastMode?: boolean | undefined;
|
|
3447
|
+
responsesOptionalParameters?: {
|
|
3448
|
+
reasoningEffort: boolean;
|
|
3449
|
+
reasoningSummary: boolean;
|
|
3450
|
+
textVerbosity: boolean;
|
|
3451
|
+
promptCacheKey: boolean;
|
|
3452
|
+
nativeTools?: boolean | undefined;
|
|
3453
|
+
} | undefined;
|
|
3416
3454
|
credential?: {
|
|
3417
3455
|
value: string;
|
|
3418
3456
|
type: "INLINE_API_KEY";
|
|
@@ -3488,6 +3526,13 @@ export declare const marAgentRuntimeModelConfigurationSchema: z.ZodEffects<z.Zod
|
|
|
3488
3526
|
reasoningEfforts: ("low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
3489
3527
|
hostedWebSearch: boolean;
|
|
3490
3528
|
fastMode?: boolean | undefined;
|
|
3529
|
+
responsesOptionalParameters?: {
|
|
3530
|
+
reasoningEffort: boolean;
|
|
3531
|
+
reasoningSummary: boolean;
|
|
3532
|
+
textVerbosity: boolean;
|
|
3533
|
+
promptCacheKey: boolean;
|
|
3534
|
+
nativeTools?: boolean | undefined;
|
|
3535
|
+
} | undefined;
|
|
3491
3536
|
credential?: {
|
|
3492
3537
|
value: string;
|
|
3493
3538
|
type: "INLINE_API_KEY";
|
|
@@ -3737,6 +3782,25 @@ export declare const marAgentRuntimeCompactConfigurationSchema: z.ZodObject<{
|
|
|
3737
3782
|
}>]>>;
|
|
3738
3783
|
responsesToolNamespace: z.ZodOptional<z.ZodString>;
|
|
3739
3784
|
responsesConfigurationUpdates: z.ZodOptional<z.ZodBoolean>;
|
|
3785
|
+
responsesOptionalParameters: z.ZodOptional<z.ZodObject<{
|
|
3786
|
+
reasoningEffort: z.ZodBoolean;
|
|
3787
|
+
reasoningSummary: z.ZodBoolean;
|
|
3788
|
+
textVerbosity: z.ZodBoolean;
|
|
3789
|
+
promptCacheKey: z.ZodBoolean;
|
|
3790
|
+
nativeTools: z.ZodOptional<z.ZodBoolean>;
|
|
3791
|
+
}, "strict", z.ZodTypeAny, {
|
|
3792
|
+
reasoningEffort: boolean;
|
|
3793
|
+
reasoningSummary: boolean;
|
|
3794
|
+
textVerbosity: boolean;
|
|
3795
|
+
promptCacheKey: boolean;
|
|
3796
|
+
nativeTools?: boolean | undefined;
|
|
3797
|
+
}, {
|
|
3798
|
+
reasoningEffort: boolean;
|
|
3799
|
+
reasoningSummary: boolean;
|
|
3800
|
+
textVerbosity: boolean;
|
|
3801
|
+
promptCacheKey: boolean;
|
|
3802
|
+
nativeTools?: boolean | undefined;
|
|
3803
|
+
}>>;
|
|
3740
3804
|
imageGeneration: z.ZodOptional<z.ZodObject<{
|
|
3741
3805
|
provider: z.ZodOptional<z.ZodString>;
|
|
3742
3806
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -3998,6 +4062,13 @@ export declare const marAgentRuntimeCompactConfigurationSchema: z.ZodObject<{
|
|
|
3998
4062
|
hostedWebSearch: boolean;
|
|
3999
4063
|
responsesPreviousResponseId: boolean;
|
|
4000
4064
|
fastMode?: boolean | undefined;
|
|
4065
|
+
responsesOptionalParameters?: {
|
|
4066
|
+
reasoningEffort: boolean;
|
|
4067
|
+
reasoningSummary: boolean;
|
|
4068
|
+
textVerbosity: boolean;
|
|
4069
|
+
promptCacheKey: boolean;
|
|
4070
|
+
nativeTools?: boolean | undefined;
|
|
4071
|
+
} | undefined;
|
|
4001
4072
|
credential?: {
|
|
4002
4073
|
value: string;
|
|
4003
4074
|
type: "INLINE_API_KEY";
|
|
@@ -4073,6 +4144,13 @@ export declare const marAgentRuntimeCompactConfigurationSchema: z.ZodObject<{
|
|
|
4073
4144
|
reasoningEfforts: ("low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
4074
4145
|
hostedWebSearch: boolean;
|
|
4075
4146
|
fastMode?: boolean | undefined;
|
|
4147
|
+
responsesOptionalParameters?: {
|
|
4148
|
+
reasoningEffort: boolean;
|
|
4149
|
+
reasoningSummary: boolean;
|
|
4150
|
+
textVerbosity: boolean;
|
|
4151
|
+
promptCacheKey: boolean;
|
|
4152
|
+
nativeTools?: boolean | undefined;
|
|
4153
|
+
} | undefined;
|
|
4076
4154
|
credential?: {
|
|
4077
4155
|
value: string;
|
|
4078
4156
|
type: "INLINE_API_KEY";
|
|
@@ -4314,6 +4392,25 @@ export declare const marAgentModelTransportTestInputSchema: z.ZodObject<{
|
|
|
4314
4392
|
}>]>>;
|
|
4315
4393
|
responsesToolNamespace: z.ZodOptional<z.ZodString>;
|
|
4316
4394
|
responsesConfigurationUpdates: z.ZodOptional<z.ZodBoolean>;
|
|
4395
|
+
responsesOptionalParameters: z.ZodOptional<z.ZodObject<{
|
|
4396
|
+
reasoningEffort: z.ZodBoolean;
|
|
4397
|
+
reasoningSummary: z.ZodBoolean;
|
|
4398
|
+
textVerbosity: z.ZodBoolean;
|
|
4399
|
+
promptCacheKey: z.ZodBoolean;
|
|
4400
|
+
nativeTools: z.ZodOptional<z.ZodBoolean>;
|
|
4401
|
+
}, "strict", z.ZodTypeAny, {
|
|
4402
|
+
reasoningEffort: boolean;
|
|
4403
|
+
reasoningSummary: boolean;
|
|
4404
|
+
textVerbosity: boolean;
|
|
4405
|
+
promptCacheKey: boolean;
|
|
4406
|
+
nativeTools?: boolean | undefined;
|
|
4407
|
+
}, {
|
|
4408
|
+
reasoningEffort: boolean;
|
|
4409
|
+
reasoningSummary: boolean;
|
|
4410
|
+
textVerbosity: boolean;
|
|
4411
|
+
promptCacheKey: boolean;
|
|
4412
|
+
nativeTools?: boolean | undefined;
|
|
4413
|
+
}>>;
|
|
4317
4414
|
imageGeneration: z.ZodOptional<z.ZodObject<{
|
|
4318
4415
|
provider: z.ZodOptional<z.ZodString>;
|
|
4319
4416
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -4575,6 +4672,13 @@ export declare const marAgentModelTransportTestInputSchema: z.ZodObject<{
|
|
|
4575
4672
|
hostedWebSearch: boolean;
|
|
4576
4673
|
responsesPreviousResponseId: boolean;
|
|
4577
4674
|
fastMode?: boolean | undefined;
|
|
4675
|
+
responsesOptionalParameters?: {
|
|
4676
|
+
reasoningEffort: boolean;
|
|
4677
|
+
reasoningSummary: boolean;
|
|
4678
|
+
textVerbosity: boolean;
|
|
4679
|
+
promptCacheKey: boolean;
|
|
4680
|
+
nativeTools?: boolean | undefined;
|
|
4681
|
+
} | undefined;
|
|
4578
4682
|
credential?: {
|
|
4579
4683
|
value: string;
|
|
4580
4684
|
type: "INLINE_API_KEY";
|
|
@@ -4650,6 +4754,13 @@ export declare const marAgentModelTransportTestInputSchema: z.ZodObject<{
|
|
|
4650
4754
|
reasoningEfforts: ("low" | "medium" | "high" | "xhigh" | "max" | "ultra")[];
|
|
4651
4755
|
hostedWebSearch: boolean;
|
|
4652
4756
|
fastMode?: boolean | undefined;
|
|
4757
|
+
responsesOptionalParameters?: {
|
|
4758
|
+
reasoningEffort: boolean;
|
|
4759
|
+
reasoningSummary: boolean;
|
|
4760
|
+
textVerbosity: boolean;
|
|
4761
|
+
promptCacheKey: boolean;
|
|
4762
|
+
nativeTools?: boolean | undefined;
|
|
4763
|
+
} | undefined;
|
|
4653
4764
|
credential?: {
|
|
4654
4765
|
value: string;
|
|
4655
4766
|
type: "INLINE_API_KEY";
|
|
@@ -4742,31 +4853,70 @@ export declare const marAgentModelTransportTestResultSchema: z.ZodDiscriminatedU
|
|
|
4742
4853
|
code: z.ZodNull;
|
|
4743
4854
|
message: z.ZodNull;
|
|
4744
4855
|
httpStatus: z.ZodNull;
|
|
4856
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
4745
4857
|
}, "strict", z.ZodTypeAny, {
|
|
4746
4858
|
code: null;
|
|
4747
4859
|
message: null;
|
|
4748
4860
|
success: true;
|
|
4749
4861
|
httpStatus: null;
|
|
4862
|
+
requestId?: string | undefined;
|
|
4750
4863
|
}, {
|
|
4751
4864
|
code: null;
|
|
4752
4865
|
message: null;
|
|
4753
4866
|
success: true;
|
|
4754
4867
|
httpStatus: null;
|
|
4868
|
+
requestId?: string | undefined;
|
|
4755
4869
|
}>, z.ZodObject<{
|
|
4756
4870
|
success: z.ZodLiteral<false>;
|
|
4757
4871
|
code: z.ZodString;
|
|
4758
4872
|
message: z.ZodString;
|
|
4759
4873
|
httpStatus: z.ZodNullable<z.ZodNumber>;
|
|
4874
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
4875
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
4876
|
+
body: z.ZodString;
|
|
4877
|
+
bodyTruncated: z.ZodBoolean;
|
|
4878
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
4879
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
4880
|
+
retryAfter: z.ZodNullable<z.ZodString>;
|
|
4881
|
+
}, "strict", z.ZodTypeAny, {
|
|
4882
|
+
requestId: string | null;
|
|
4883
|
+
body: string;
|
|
4884
|
+
bodyTruncated: boolean;
|
|
4885
|
+
contentType: string | null;
|
|
4886
|
+
retryAfter: string | null;
|
|
4887
|
+
}, {
|
|
4888
|
+
requestId: string | null;
|
|
4889
|
+
body: string;
|
|
4890
|
+
bodyTruncated: boolean;
|
|
4891
|
+
contentType: string | null;
|
|
4892
|
+
retryAfter: string | null;
|
|
4893
|
+
}>>;
|
|
4760
4894
|
}, "strict", z.ZodTypeAny, {
|
|
4761
4895
|
code: string;
|
|
4762
4896
|
message: string;
|
|
4763
4897
|
success: false;
|
|
4764
4898
|
httpStatus: number | null;
|
|
4899
|
+
requestId?: string | undefined;
|
|
4900
|
+
response?: {
|
|
4901
|
+
requestId: string | null;
|
|
4902
|
+
body: string;
|
|
4903
|
+
bodyTruncated: boolean;
|
|
4904
|
+
contentType: string | null;
|
|
4905
|
+
retryAfter: string | null;
|
|
4906
|
+
} | undefined;
|
|
4765
4907
|
}, {
|
|
4766
4908
|
code: string;
|
|
4767
4909
|
message: string;
|
|
4768
4910
|
success: false;
|
|
4769
4911
|
httpStatus: number | null;
|
|
4912
|
+
requestId?: string | undefined;
|
|
4913
|
+
response?: {
|
|
4914
|
+
requestId: string | null;
|
|
4915
|
+
body: string;
|
|
4916
|
+
bodyTruncated: boolean;
|
|
4917
|
+
contentType: string | null;
|
|
4918
|
+
retryAfter: string | null;
|
|
4919
|
+
} | undefined;
|
|
4770
4920
|
}>]>;
|
|
4771
4921
|
export type MarAgentModelTransportTestResult = z.infer<typeof marAgentModelTransportTestResultSchema>;
|
|
4772
4922
|
export declare const marAgentStoredModelConfigurationSchema: z.ZodEffects<z.ZodObject<{
|
|
@@ -4916,7 +5066,7 @@ export type CodexCredentialOwnership = z.infer<typeof codexCredentialOwnershipSc
|
|
|
4916
5066
|
export declare const codexCredentialSummarySchema: z.ZodObject<{
|
|
4917
5067
|
id: z.ZodString;
|
|
4918
5068
|
name: z.ZodString;
|
|
4919
|
-
type: z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH"]>;
|
|
5069
|
+
type: z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH", "XAI_OAUTH"]>;
|
|
4920
5070
|
authorization: z.ZodOptional<z.ZodEnum<["AUTHORIZED", "UNAUTHORIZED"]>>;
|
|
4921
5071
|
ownership: z.ZodDiscriminatedUnion<"ownerType", [z.ZodObject<{
|
|
4922
5072
|
ownerType: z.ZodLiteral<"PERSONAL">;
|
|
@@ -4968,7 +5118,7 @@ export declare const codexCredentialSummarySchema: z.ZodObject<{
|
|
|
4968
5118
|
revision: z.ZodNumber;
|
|
4969
5119
|
}, "strict", z.ZodTypeAny, {
|
|
4970
5120
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
4971
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5121
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
4972
5122
|
name: string;
|
|
4973
5123
|
id: string;
|
|
4974
5124
|
revision: number;
|
|
@@ -4995,7 +5145,7 @@ export declare const codexCredentialSummarySchema: z.ZodObject<{
|
|
|
4995
5145
|
earliestRefreshAt?: number | null | undefined;
|
|
4996
5146
|
}, {
|
|
4997
5147
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
4998
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5148
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
4999
5149
|
name: string;
|
|
5000
5150
|
id: string;
|
|
5001
5151
|
revision: number;
|
|
@@ -5026,7 +5176,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5026
5176
|
credential: z.ZodObject<{
|
|
5027
5177
|
id: z.ZodString;
|
|
5028
5178
|
name: z.ZodString;
|
|
5029
|
-
type: z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH"]>;
|
|
5179
|
+
type: z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH", "XAI_OAUTH"]>;
|
|
5030
5180
|
authorization: z.ZodOptional<z.ZodEnum<["AUTHORIZED", "UNAUTHORIZED"]>>;
|
|
5031
5181
|
ownership: z.ZodDiscriminatedUnion<"ownerType", [z.ZodObject<{
|
|
5032
5182
|
ownerType: z.ZodLiteral<"PERSONAL">;
|
|
@@ -5078,7 +5228,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5078
5228
|
revision: z.ZodNumber;
|
|
5079
5229
|
}, "strict", z.ZodTypeAny, {
|
|
5080
5230
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5081
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5231
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5082
5232
|
name: string;
|
|
5083
5233
|
id: string;
|
|
5084
5234
|
revision: number;
|
|
@@ -5105,7 +5255,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5105
5255
|
earliestRefreshAt?: number | null | undefined;
|
|
5106
5256
|
}, {
|
|
5107
5257
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5108
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5258
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5109
5259
|
name: string;
|
|
5110
5260
|
id: string;
|
|
5111
5261
|
revision: number;
|
|
@@ -5136,7 +5286,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5136
5286
|
socks5Url: string | null;
|
|
5137
5287
|
credential: {
|
|
5138
5288
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5139
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5289
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5140
5290
|
name: string;
|
|
5141
5291
|
id: string;
|
|
5142
5292
|
revision: number;
|
|
@@ -5166,7 +5316,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5166
5316
|
socks5Url: string | null;
|
|
5167
5317
|
credential: {
|
|
5168
5318
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5169
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5319
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5170
5320
|
name: string;
|
|
5171
5321
|
id: string;
|
|
5172
5322
|
revision: number;
|
|
@@ -5196,7 +5346,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5196
5346
|
socks5Url: string | null;
|
|
5197
5347
|
credential: {
|
|
5198
5348
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5199
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5349
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5200
5350
|
name: string;
|
|
5201
5351
|
id: string;
|
|
5202
5352
|
revision: number;
|
|
@@ -5226,7 +5376,7 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5226
5376
|
socks5Url: string | null;
|
|
5227
5377
|
credential: {
|
|
5228
5378
|
status: "DEGRADED" | "ACTIVE" | "REAUTH_REQUIRED";
|
|
5229
|
-
type: "CODEX_OAUTH" | "CHATGPT_OAUTH";
|
|
5379
|
+
type: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH";
|
|
5230
5380
|
name: string;
|
|
5231
5381
|
id: string;
|
|
5232
5382
|
revision: number;
|
|
@@ -5318,8 +5468,11 @@ export declare const codexUsageProfileSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5318
5468
|
}[];
|
|
5319
5469
|
}>;
|
|
5320
5470
|
export type CodexUsageProfile = z.infer<typeof codexUsageProfileSchema>;
|
|
5321
|
-
export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
5471
|
+
export declare const codexCredentialUsageSchema: z.ZodEffects<z.ZodObject<{
|
|
5322
5472
|
runner: z.ZodEnum<["codex", "claude-code", "opencode", "mar-agent"]>;
|
|
5473
|
+
fetchedAt: z.ZodNumber;
|
|
5474
|
+
cached: z.ZodBoolean;
|
|
5475
|
+
} & {
|
|
5323
5476
|
windows: z.ZodArray<z.ZodObject<{
|
|
5324
5477
|
id: z.ZodString;
|
|
5325
5478
|
label: z.ZodString;
|
|
@@ -5336,9 +5489,6 @@ export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
|
5336
5489
|
usedPercentage: number;
|
|
5337
5490
|
resetsAt: number | null;
|
|
5338
5491
|
}>, "many">;
|
|
5339
|
-
fetchedAt: z.ZodNumber;
|
|
5340
|
-
cached: z.ZodBoolean;
|
|
5341
|
-
} & {
|
|
5342
5492
|
profile: z.ZodEffects<z.ZodObject<{
|
|
5343
5493
|
lifetimeTokens: z.ZodNullable<z.ZodNumber>;
|
|
5344
5494
|
currentDayTokens: z.ZodNullable<z.ZodNumber>;
|
|
@@ -5391,6 +5541,28 @@ export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
|
5391
5541
|
startDate: string;
|
|
5392
5542
|
}[];
|
|
5393
5543
|
}>;
|
|
5544
|
+
subscription: z.ZodOptional<z.ZodObject<{
|
|
5545
|
+
provider: z.ZodLiteral<"XAI">;
|
|
5546
|
+
period: z.ZodEnum<["WEEKLY", "MONTHLY", "UNKNOWN"]>;
|
|
5547
|
+
startsAt: z.ZodNullable<z.ZodNumber>;
|
|
5548
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
5549
|
+
usedPercentage: z.ZodNullable<z.ZodNumber>;
|
|
5550
|
+
prepaidBalanceCents: z.ZodNullable<z.ZodNumber>;
|
|
5551
|
+
}, "strict", z.ZodTypeAny, {
|
|
5552
|
+
provider: "XAI";
|
|
5553
|
+
usedPercentage: number | null;
|
|
5554
|
+
resetsAt: number | null;
|
|
5555
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5556
|
+
startsAt: number | null;
|
|
5557
|
+
prepaidBalanceCents: number | null;
|
|
5558
|
+
}, {
|
|
5559
|
+
provider: "XAI";
|
|
5560
|
+
usedPercentage: number | null;
|
|
5561
|
+
resetsAt: number | null;
|
|
5562
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5563
|
+
startsAt: number | null;
|
|
5564
|
+
prepaidBalanceCents: number | null;
|
|
5565
|
+
}>>;
|
|
5394
5566
|
}, "strip", z.ZodTypeAny, {
|
|
5395
5567
|
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
5396
5568
|
windows: {
|
|
@@ -5411,6 +5583,70 @@ export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
|
5411
5583
|
startDate: string;
|
|
5412
5584
|
}[];
|
|
5413
5585
|
};
|
|
5586
|
+
subscription?: {
|
|
5587
|
+
provider: "XAI";
|
|
5588
|
+
usedPercentage: number | null;
|
|
5589
|
+
resetsAt: number | null;
|
|
5590
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5591
|
+
startsAt: number | null;
|
|
5592
|
+
prepaidBalanceCents: number | null;
|
|
5593
|
+
} | undefined;
|
|
5594
|
+
}, {
|
|
5595
|
+
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
5596
|
+
windows: {
|
|
5597
|
+
label: string;
|
|
5598
|
+
id: string;
|
|
5599
|
+
usedPercentage: number;
|
|
5600
|
+
resetsAt: number | null;
|
|
5601
|
+
}[];
|
|
5602
|
+
fetchedAt: number;
|
|
5603
|
+
cached: boolean;
|
|
5604
|
+
profile: {
|
|
5605
|
+
lifetimeTokens: number | null;
|
|
5606
|
+
currentDayTokens: number | null;
|
|
5607
|
+
lastSevenDaysTokens: number | null;
|
|
5608
|
+
statsAsOf: string | null;
|
|
5609
|
+
dailyUsageBuckets: {
|
|
5610
|
+
tokens: number;
|
|
5611
|
+
startDate: string;
|
|
5612
|
+
}[];
|
|
5613
|
+
};
|
|
5614
|
+
subscription?: {
|
|
5615
|
+
provider: "XAI";
|
|
5616
|
+
usedPercentage: number | null;
|
|
5617
|
+
resetsAt: number | null;
|
|
5618
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5619
|
+
startsAt: number | null;
|
|
5620
|
+
prepaidBalanceCents: number | null;
|
|
5621
|
+
} | undefined;
|
|
5622
|
+
}>, {
|
|
5623
|
+
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
5624
|
+
windows: {
|
|
5625
|
+
label: string;
|
|
5626
|
+
id: string;
|
|
5627
|
+
usedPercentage: number;
|
|
5628
|
+
resetsAt: number | null;
|
|
5629
|
+
}[];
|
|
5630
|
+
fetchedAt: number;
|
|
5631
|
+
cached: boolean;
|
|
5632
|
+
profile: {
|
|
5633
|
+
lifetimeTokens: number | null;
|
|
5634
|
+
currentDayTokens: number | null;
|
|
5635
|
+
lastSevenDaysTokens: number | null;
|
|
5636
|
+
statsAsOf: string | null;
|
|
5637
|
+
dailyUsageBuckets: {
|
|
5638
|
+
tokens: number;
|
|
5639
|
+
startDate: string;
|
|
5640
|
+
}[];
|
|
5641
|
+
};
|
|
5642
|
+
subscription?: {
|
|
5643
|
+
provider: "XAI";
|
|
5644
|
+
usedPercentage: number | null;
|
|
5645
|
+
resetsAt: number | null;
|
|
5646
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5647
|
+
startsAt: number | null;
|
|
5648
|
+
prepaidBalanceCents: number | null;
|
|
5649
|
+
} | undefined;
|
|
5414
5650
|
}, {
|
|
5415
5651
|
runner: "mar-agent" | "codex" | "claude-code" | "opencode";
|
|
5416
5652
|
windows: {
|
|
@@ -5431,12 +5667,20 @@ export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
|
5431
5667
|
startDate: string;
|
|
5432
5668
|
}[];
|
|
5433
5669
|
};
|
|
5670
|
+
subscription?: {
|
|
5671
|
+
provider: "XAI";
|
|
5672
|
+
usedPercentage: number | null;
|
|
5673
|
+
resetsAt: number | null;
|
|
5674
|
+
period: "WEEKLY" | "MONTHLY" | "UNKNOWN";
|
|
5675
|
+
startsAt: number | null;
|
|
5676
|
+
prepaidBalanceCents: number | null;
|
|
5677
|
+
} | undefined;
|
|
5434
5678
|
}>;
|
|
5435
5679
|
export type CodexCredentialUsage = z.infer<typeof codexCredentialUsageSchema>;
|
|
5436
5680
|
export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
5437
5681
|
id: z.ZodString;
|
|
5438
5682
|
status: z.ZodEnum<["PENDING", "SUCCEEDED", "FAILED", "CANCELLED", "EXPIRED"]>;
|
|
5439
|
-
type: z.ZodOptional<z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH"]>>;
|
|
5683
|
+
type: z.ZodOptional<z.ZodEnum<["CODEX_OAUTH", "CHATGPT_OAUTH", "XAI_OAUTH"]>>;
|
|
5440
5684
|
userCode: z.ZodOptional<z.ZodString>;
|
|
5441
5685
|
verificationUri: z.ZodOptional<z.ZodString>;
|
|
5442
5686
|
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5449,7 +5693,7 @@ export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5449
5693
|
id: string;
|
|
5450
5694
|
code?: string | undefined;
|
|
5451
5695
|
message?: string | undefined;
|
|
5452
|
-
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | undefined;
|
|
5696
|
+
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH" | undefined;
|
|
5453
5697
|
verificationUri?: string | undefined;
|
|
5454
5698
|
expiresAt?: number | undefined;
|
|
5455
5699
|
credentialId?: string | undefined;
|
|
@@ -5460,7 +5704,7 @@ export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5460
5704
|
id: string;
|
|
5461
5705
|
code?: string | undefined;
|
|
5462
5706
|
message?: string | undefined;
|
|
5463
|
-
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | undefined;
|
|
5707
|
+
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH" | undefined;
|
|
5464
5708
|
verificationUri?: string | undefined;
|
|
5465
5709
|
expiresAt?: number | undefined;
|
|
5466
5710
|
credentialId?: string | undefined;
|
|
@@ -5471,7 +5715,7 @@ export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5471
5715
|
id: string;
|
|
5472
5716
|
code?: string | undefined;
|
|
5473
5717
|
message?: string | undefined;
|
|
5474
|
-
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | undefined;
|
|
5718
|
+
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH" | undefined;
|
|
5475
5719
|
verificationUri?: string | undefined;
|
|
5476
5720
|
expiresAt?: number | undefined;
|
|
5477
5721
|
credentialId?: string | undefined;
|
|
@@ -5482,7 +5726,7 @@ export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
|
5482
5726
|
id: string;
|
|
5483
5727
|
code?: string | undefined;
|
|
5484
5728
|
message?: string | undefined;
|
|
5485
|
-
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | undefined;
|
|
5729
|
+
type?: "CODEX_OAUTH" | "CHATGPT_OAUTH" | "XAI_OAUTH" | undefined;
|
|
5486
5730
|
verificationUri?: string | undefined;
|
|
5487
5731
|
expiresAt?: number | undefined;
|
|
5488
5732
|
credentialId?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { workspaceDirectTransferCapabilitySchema } from './direct-transfer.js';
|
|
|
7
7
|
import { terminalDirectCapabilitySchema } from './terminal-direct.js';
|
|
8
8
|
import { chatgptLoginCapabilitySchema } from './chatgpt-oauth.js';
|
|
9
9
|
export * from './chatgpt-oauth.js';
|
|
10
|
+
export const XAI_SUBSCRIPTION_BASE_URL = 'https://api.x.ai/v1';
|
|
11
|
+
export const XAI_SUBSCRIPTION_PROXY_BASE_URL = 'https://cli-chat-proxy.grok.com/v1';
|
|
10
12
|
export * from './composer-tags.js';
|
|
11
13
|
export * from './enterprise.js';
|
|
12
14
|
export * from './skill.js';
|
|
@@ -47,6 +49,7 @@ export const marAgentRuntimeCredentialCapabilitySchema = z
|
|
|
47
49
|
fastMode: z.boolean().optional(),
|
|
48
50
|
serviceTiers: z.array(marAgentResponsesServiceTierSchema).min(1).max(6).optional(),
|
|
49
51
|
namespacedTools: z.boolean().optional(),
|
|
52
|
+
responsesOptionalParameters: z.boolean().optional(),
|
|
50
53
|
httpVersions: z
|
|
51
54
|
.array(runtimeCredentialHttpVersionSchema)
|
|
52
55
|
.min(1)
|
|
@@ -808,6 +811,16 @@ export const marAgentRuntimeModelConfigurationSchema = refineMarAgentModel(z
|
|
|
808
811
|
.regex(/^[a-zA-Z][a-zA-Z0-9_]{0,63}$/u)
|
|
809
812
|
.optional(),
|
|
810
813
|
responsesConfigurationUpdates: z.boolean().optional(),
|
|
814
|
+
responsesOptionalParameters: z
|
|
815
|
+
.object({
|
|
816
|
+
reasoningEffort: z.boolean(),
|
|
817
|
+
reasoningSummary: z.boolean(),
|
|
818
|
+
textVerbosity: z.boolean(),
|
|
819
|
+
promptCacheKey: z.boolean(),
|
|
820
|
+
nativeTools: z.boolean().optional()
|
|
821
|
+
})
|
|
822
|
+
.strict()
|
|
823
|
+
.optional(),
|
|
811
824
|
imageGeneration: marAgentImageGenerationSchema.optional()
|
|
812
825
|
})
|
|
813
826
|
.strip()).superRefine((configuration, context) => {
|
|
@@ -868,7 +881,8 @@ export const marAgentModelTransportTestResultSchema = z.discriminatedUnion('succ
|
|
|
868
881
|
success: z.literal(true),
|
|
869
882
|
code: z.null(),
|
|
870
883
|
message: z.null(),
|
|
871
|
-
httpStatus: z.null()
|
|
884
|
+
httpStatus: z.null(),
|
|
885
|
+
requestId: z.string().min(1).max(128).optional()
|
|
872
886
|
})
|
|
873
887
|
.strict(),
|
|
874
888
|
z
|
|
@@ -876,7 +890,18 @@ export const marAgentModelTransportTestResultSchema = z.discriminatedUnion('succ
|
|
|
876
890
|
success: z.literal(false),
|
|
877
891
|
code: z.string().trim().min(1).max(80),
|
|
878
892
|
message: z.string().trim().min(1).max(1_000),
|
|
879
|
-
httpStatus: z.number().int().min(100).max(599).nullable()
|
|
893
|
+
httpStatus: z.number().int().min(100).max(599).nullable(),
|
|
894
|
+
requestId: z.string().min(1).max(128).optional(),
|
|
895
|
+
response: z
|
|
896
|
+
.object({
|
|
897
|
+
body: z.string().max(4096),
|
|
898
|
+
bodyTruncated: z.boolean(),
|
|
899
|
+
contentType: z.string().max(256).nullable(),
|
|
900
|
+
requestId: z.string().max(256).nullable(),
|
|
901
|
+
retryAfter: z.string().max(128).nullable()
|
|
902
|
+
})
|
|
903
|
+
.strict()
|
|
904
|
+
.optional()
|
|
880
905
|
})
|
|
881
906
|
.strict()
|
|
882
907
|
]);
|
|
@@ -911,7 +936,7 @@ export const codexCredentialSummarySchema = z
|
|
|
911
936
|
.object({
|
|
912
937
|
id: boundedIdentifierSchema,
|
|
913
938
|
name: z.string().trim().min(1).max(128),
|
|
914
|
-
type: z.enum(['CODEX_OAUTH', 'CHATGPT_OAUTH']),
|
|
939
|
+
type: z.enum(['CODEX_OAUTH', 'CHATGPT_OAUTH', 'XAI_OAUTH']),
|
|
915
940
|
authorization: z.enum(['AUTHORIZED', 'UNAUTHORIZED']).optional(),
|
|
916
941
|
ownership: codexCredentialOwnershipSchema,
|
|
917
942
|
status: z.enum(['ACTIVE', 'DEGRADED', 'REAUTH_REQUIRED']),
|
|
@@ -996,14 +1021,31 @@ export const codexUsageProfileSchema = z
|
|
|
996
1021
|
message: 'daily usage dates must be unique'
|
|
997
1022
|
});
|
|
998
1023
|
});
|
|
999
|
-
export const codexCredentialUsageSchema = runnerUsageSchema
|
|
1000
|
-
|
|
1024
|
+
export const codexCredentialUsageSchema = runnerUsageSchema
|
|
1025
|
+
.extend({
|
|
1026
|
+
windows: z.array(runnerUsageWindowSchema).max(8),
|
|
1027
|
+
profile: codexUsageProfileSchema,
|
|
1028
|
+
subscription: z
|
|
1029
|
+
.object({
|
|
1030
|
+
provider: z.literal('XAI'),
|
|
1031
|
+
period: z.enum(['WEEKLY', 'MONTHLY', 'UNKNOWN']),
|
|
1032
|
+
startsAt: nonnegativeSafeIntegerSchema.nullable(),
|
|
1033
|
+
resetsAt: nonnegativeSafeIntegerSchema.nullable(),
|
|
1034
|
+
usedPercentage: z.number().finite().min(0).max(100).nullable(),
|
|
1035
|
+
prepaidBalanceCents: nonnegativeSafeIntegerSchema.nullable()
|
|
1036
|
+
})
|
|
1037
|
+
.strict()
|
|
1038
|
+
.optional()
|
|
1039
|
+
})
|
|
1040
|
+
.superRefine((usage, context) => {
|
|
1041
|
+
if (!usage.subscription && usage.windows.length === 0)
|
|
1042
|
+
context.addIssue({ code: 'custom', message: 'Usage requires a window or subscription data' });
|
|
1001
1043
|
});
|
|
1002
1044
|
export const codexLoginAttemptSchema = z
|
|
1003
1045
|
.object({
|
|
1004
1046
|
id: boundedIdentifierSchema,
|
|
1005
1047
|
status: z.enum(['PENDING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'EXPIRED']),
|
|
1006
|
-
type: z.enum(['CODEX_OAUTH', 'CHATGPT_OAUTH']).optional(),
|
|
1048
|
+
type: z.enum(['CODEX_OAUTH', 'CHATGPT_OAUTH', 'XAI_OAUTH']).optional(),
|
|
1007
1049
|
userCode: z.string().trim().min(1).max(128).optional(),
|
|
1008
1050
|
verificationUri: z.string().url().max(2048).optional(),
|
|
1009
1051
|
expiresAt: nonnegativeSafeIntegerSchema.optional(),
|