@myagentroam/protocol 0.9.85 → 0.9.87
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 +179 -0
- package/dist/index.js +28 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3950,6 +3950,185 @@ export declare const codexCredentialDetailsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3950
3950
|
};
|
|
3951
3951
|
}>;
|
|
3952
3952
|
export type CodexCredentialDetails = z.infer<typeof codexCredentialDetailsSchema>;
|
|
3953
|
+
export declare const codexUsageDailyBucketSchema: z.ZodObject<{
|
|
3954
|
+
startDate: z.ZodString;
|
|
3955
|
+
tokens: z.ZodNumber;
|
|
3956
|
+
}, "strict", z.ZodTypeAny, {
|
|
3957
|
+
startDate: string;
|
|
3958
|
+
tokens: number;
|
|
3959
|
+
}, {
|
|
3960
|
+
startDate: string;
|
|
3961
|
+
tokens: number;
|
|
3962
|
+
}>;
|
|
3963
|
+
export type CodexUsageDailyBucket = z.infer<typeof codexUsageDailyBucketSchema>;
|
|
3964
|
+
export declare const codexUsageProfileSchema: z.ZodEffects<z.ZodObject<{
|
|
3965
|
+
lifetimeTokens: z.ZodNullable<z.ZodNumber>;
|
|
3966
|
+
currentDayTokens: z.ZodNullable<z.ZodNumber>;
|
|
3967
|
+
lastSevenDaysTokens: z.ZodNullable<z.ZodNumber>;
|
|
3968
|
+
statsAsOf: z.ZodNullable<z.ZodString>;
|
|
3969
|
+
dailyUsageBuckets: z.ZodArray<z.ZodObject<{
|
|
3970
|
+
startDate: z.ZodString;
|
|
3971
|
+
tokens: z.ZodNumber;
|
|
3972
|
+
}, "strict", z.ZodTypeAny, {
|
|
3973
|
+
startDate: string;
|
|
3974
|
+
tokens: number;
|
|
3975
|
+
}, {
|
|
3976
|
+
startDate: string;
|
|
3977
|
+
tokens: number;
|
|
3978
|
+
}>, "many">;
|
|
3979
|
+
}, "strict", z.ZodTypeAny, {
|
|
3980
|
+
lifetimeTokens: number | null;
|
|
3981
|
+
currentDayTokens: number | null;
|
|
3982
|
+
lastSevenDaysTokens: number | null;
|
|
3983
|
+
statsAsOf: string | null;
|
|
3984
|
+
dailyUsageBuckets: {
|
|
3985
|
+
startDate: string;
|
|
3986
|
+
tokens: number;
|
|
3987
|
+
}[];
|
|
3988
|
+
}, {
|
|
3989
|
+
lifetimeTokens: number | null;
|
|
3990
|
+
currentDayTokens: number | null;
|
|
3991
|
+
lastSevenDaysTokens: number | null;
|
|
3992
|
+
statsAsOf: string | null;
|
|
3993
|
+
dailyUsageBuckets: {
|
|
3994
|
+
startDate: string;
|
|
3995
|
+
tokens: number;
|
|
3996
|
+
}[];
|
|
3997
|
+
}>, {
|
|
3998
|
+
lifetimeTokens: number | null;
|
|
3999
|
+
currentDayTokens: number | null;
|
|
4000
|
+
lastSevenDaysTokens: number | null;
|
|
4001
|
+
statsAsOf: string | null;
|
|
4002
|
+
dailyUsageBuckets: {
|
|
4003
|
+
startDate: string;
|
|
4004
|
+
tokens: number;
|
|
4005
|
+
}[];
|
|
4006
|
+
}, {
|
|
4007
|
+
lifetimeTokens: number | null;
|
|
4008
|
+
currentDayTokens: number | null;
|
|
4009
|
+
lastSevenDaysTokens: number | null;
|
|
4010
|
+
statsAsOf: string | null;
|
|
4011
|
+
dailyUsageBuckets: {
|
|
4012
|
+
startDate: string;
|
|
4013
|
+
tokens: number;
|
|
4014
|
+
}[];
|
|
4015
|
+
}>;
|
|
4016
|
+
export type CodexUsageProfile = z.infer<typeof codexUsageProfileSchema>;
|
|
4017
|
+
export declare const codexCredentialUsageSchema: z.ZodObject<{
|
|
4018
|
+
runner: z.ZodEnum<["codex", "claude-code", "opencode", "mar-agent"]>;
|
|
4019
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
4020
|
+
id: z.ZodString;
|
|
4021
|
+
label: z.ZodString;
|
|
4022
|
+
usedPercentage: z.ZodNumber;
|
|
4023
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
4024
|
+
}, "strip", z.ZodTypeAny, {
|
|
4025
|
+
id: string;
|
|
4026
|
+
label: string;
|
|
4027
|
+
usedPercentage: number;
|
|
4028
|
+
resetsAt: number | null;
|
|
4029
|
+
}, {
|
|
4030
|
+
id: string;
|
|
4031
|
+
label: string;
|
|
4032
|
+
usedPercentage: number;
|
|
4033
|
+
resetsAt: number | null;
|
|
4034
|
+
}>, "many">;
|
|
4035
|
+
fetchedAt: z.ZodNumber;
|
|
4036
|
+
cached: z.ZodBoolean;
|
|
4037
|
+
} & {
|
|
4038
|
+
profile: z.ZodEffects<z.ZodObject<{
|
|
4039
|
+
lifetimeTokens: z.ZodNullable<z.ZodNumber>;
|
|
4040
|
+
currentDayTokens: z.ZodNullable<z.ZodNumber>;
|
|
4041
|
+
lastSevenDaysTokens: z.ZodNullable<z.ZodNumber>;
|
|
4042
|
+
statsAsOf: z.ZodNullable<z.ZodString>;
|
|
4043
|
+
dailyUsageBuckets: z.ZodArray<z.ZodObject<{
|
|
4044
|
+
startDate: z.ZodString;
|
|
4045
|
+
tokens: z.ZodNumber;
|
|
4046
|
+
}, "strict", z.ZodTypeAny, {
|
|
4047
|
+
startDate: string;
|
|
4048
|
+
tokens: number;
|
|
4049
|
+
}, {
|
|
4050
|
+
startDate: string;
|
|
4051
|
+
tokens: number;
|
|
4052
|
+
}>, "many">;
|
|
4053
|
+
}, "strict", z.ZodTypeAny, {
|
|
4054
|
+
lifetimeTokens: number | null;
|
|
4055
|
+
currentDayTokens: number | null;
|
|
4056
|
+
lastSevenDaysTokens: number | null;
|
|
4057
|
+
statsAsOf: string | null;
|
|
4058
|
+
dailyUsageBuckets: {
|
|
4059
|
+
startDate: string;
|
|
4060
|
+
tokens: number;
|
|
4061
|
+
}[];
|
|
4062
|
+
}, {
|
|
4063
|
+
lifetimeTokens: number | null;
|
|
4064
|
+
currentDayTokens: number | null;
|
|
4065
|
+
lastSevenDaysTokens: number | null;
|
|
4066
|
+
statsAsOf: string | null;
|
|
4067
|
+
dailyUsageBuckets: {
|
|
4068
|
+
startDate: string;
|
|
4069
|
+
tokens: number;
|
|
4070
|
+
}[];
|
|
4071
|
+
}>, {
|
|
4072
|
+
lifetimeTokens: number | null;
|
|
4073
|
+
currentDayTokens: number | null;
|
|
4074
|
+
lastSevenDaysTokens: number | null;
|
|
4075
|
+
statsAsOf: string | null;
|
|
4076
|
+
dailyUsageBuckets: {
|
|
4077
|
+
startDate: string;
|
|
4078
|
+
tokens: number;
|
|
4079
|
+
}[];
|
|
4080
|
+
}, {
|
|
4081
|
+
lifetimeTokens: number | null;
|
|
4082
|
+
currentDayTokens: number | null;
|
|
4083
|
+
lastSevenDaysTokens: number | null;
|
|
4084
|
+
statsAsOf: string | null;
|
|
4085
|
+
dailyUsageBuckets: {
|
|
4086
|
+
startDate: string;
|
|
4087
|
+
tokens: number;
|
|
4088
|
+
}[];
|
|
4089
|
+
}>;
|
|
4090
|
+
}, "strip", z.ZodTypeAny, {
|
|
4091
|
+
windows: {
|
|
4092
|
+
id: string;
|
|
4093
|
+
label: string;
|
|
4094
|
+
usedPercentage: number;
|
|
4095
|
+
resetsAt: number | null;
|
|
4096
|
+
}[];
|
|
4097
|
+
runner: "codex" | "claude-code" | "opencode" | "mar-agent";
|
|
4098
|
+
fetchedAt: number;
|
|
4099
|
+
cached: boolean;
|
|
4100
|
+
profile: {
|
|
4101
|
+
lifetimeTokens: number | null;
|
|
4102
|
+
currentDayTokens: number | null;
|
|
4103
|
+
lastSevenDaysTokens: number | null;
|
|
4104
|
+
statsAsOf: string | null;
|
|
4105
|
+
dailyUsageBuckets: {
|
|
4106
|
+
startDate: string;
|
|
4107
|
+
tokens: number;
|
|
4108
|
+
}[];
|
|
4109
|
+
};
|
|
4110
|
+
}, {
|
|
4111
|
+
windows: {
|
|
4112
|
+
id: string;
|
|
4113
|
+
label: string;
|
|
4114
|
+
usedPercentage: number;
|
|
4115
|
+
resetsAt: number | null;
|
|
4116
|
+
}[];
|
|
4117
|
+
runner: "codex" | "claude-code" | "opencode" | "mar-agent";
|
|
4118
|
+
fetchedAt: number;
|
|
4119
|
+
cached: boolean;
|
|
4120
|
+
profile: {
|
|
4121
|
+
lifetimeTokens: number | null;
|
|
4122
|
+
currentDayTokens: number | null;
|
|
4123
|
+
lastSevenDaysTokens: number | null;
|
|
4124
|
+
statsAsOf: string | null;
|
|
4125
|
+
dailyUsageBuckets: {
|
|
4126
|
+
startDate: string;
|
|
4127
|
+
tokens: number;
|
|
4128
|
+
}[];
|
|
4129
|
+
};
|
|
4130
|
+
}>;
|
|
4131
|
+
export type CodexCredentialUsage = z.infer<typeof codexCredentialUsageSchema>;
|
|
3953
4132
|
export declare const codexLoginAttemptSchema: z.ZodEffects<z.ZodObject<{
|
|
3954
4133
|
id: z.ZodString;
|
|
3955
4134
|
status: z.ZodEnum<["PENDING", "SUCCEEDED", "FAILED", "CANCELLED", "EXPIRED"]>;
|
package/dist/index.js
CHANGED
|
@@ -787,6 +787,34 @@ export const codexCredentialDetailsSchema = z
|
|
|
787
787
|
message: 'proxy summary must match the SOCKS5 URL'
|
|
788
788
|
});
|
|
789
789
|
});
|
|
790
|
+
const codexUsageDateSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
791
|
+
export const codexUsageDailyBucketSchema = z
|
|
792
|
+
.object({
|
|
793
|
+
startDate: codexUsageDateSchema,
|
|
794
|
+
tokens: nonnegativeSafeIntegerSchema
|
|
795
|
+
})
|
|
796
|
+
.strict();
|
|
797
|
+
export const codexUsageProfileSchema = z
|
|
798
|
+
.object({
|
|
799
|
+
lifetimeTokens: nonnegativeSafeIntegerSchema.nullable(),
|
|
800
|
+
currentDayTokens: nonnegativeSafeIntegerSchema.nullable(),
|
|
801
|
+
lastSevenDaysTokens: nonnegativeSafeIntegerSchema.nullable(),
|
|
802
|
+
statsAsOf: codexUsageDateSchema.nullable(),
|
|
803
|
+
dailyUsageBuckets: z.array(codexUsageDailyBucketSchema).max(730)
|
|
804
|
+
})
|
|
805
|
+
.strict()
|
|
806
|
+
.superRefine((profile, context) => {
|
|
807
|
+
const dates = profile.dailyUsageBuckets.map((bucket) => bucket.startDate);
|
|
808
|
+
if (new Set(dates).size !== dates.length)
|
|
809
|
+
context.addIssue({
|
|
810
|
+
code: 'custom',
|
|
811
|
+
path: ['dailyUsageBuckets'],
|
|
812
|
+
message: 'daily usage dates must be unique'
|
|
813
|
+
});
|
|
814
|
+
});
|
|
815
|
+
export const codexCredentialUsageSchema = runnerUsageSchema.extend({
|
|
816
|
+
profile: codexUsageProfileSchema
|
|
817
|
+
});
|
|
790
818
|
export const codexLoginAttemptSchema = z
|
|
791
819
|
.object({
|
|
792
820
|
id: boundedIdentifierSchema,
|