@ahmadposten/talos-wire 0.1.0 → 0.1.1
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.cjs +49 -0
- package/dist/index.d.cts +126 -2
- package/dist/index.d.mts +126 -2
- package/dist/index.mjs +45 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -322,6 +322,50 @@ function toWireMetadata(value) {
|
|
|
322
322
|
return result;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
const UsageProviderSchema = z__namespace.enum(["codex", "claude"]);
|
|
326
|
+
const ProviderUsageRequestSchema = z__namespace.object({
|
|
327
|
+
provider: UsageProviderSchema,
|
|
328
|
+
refresh: z__namespace.boolean().optional()
|
|
329
|
+
});
|
|
330
|
+
const ProviderUsageWindowSchema = z__namespace.object({
|
|
331
|
+
id: z__namespace.string(),
|
|
332
|
+
label: z__namespace.string(),
|
|
333
|
+
scope: z__namespace.string().optional(),
|
|
334
|
+
usedPercent: z__namespace.number().finite().nullable(),
|
|
335
|
+
remainingPercent: z__namespace.number().finite().nullable(),
|
|
336
|
+
resetsAt: z__namespace.number().finite().nullable(),
|
|
337
|
+
durationSeconds: z__namespace.number().finite().nullable()
|
|
338
|
+
});
|
|
339
|
+
const ProviderUsageBalanceSchema = z__namespace.object({
|
|
340
|
+
id: z__namespace.string(),
|
|
341
|
+
label: z__namespace.string(),
|
|
342
|
+
kind: z__namespace.enum(["credits", "spend_limit", "resets"]),
|
|
343
|
+
unit: z__namespace.enum(["credits", "currency", "count"]),
|
|
344
|
+
currency: z__namespace.string().optional(),
|
|
345
|
+
used: z__namespace.number().finite().nullable(),
|
|
346
|
+
limit: z__namespace.number().finite().nullable(),
|
|
347
|
+
remaining: z__namespace.number().finite().nullable(),
|
|
348
|
+
usedPercent: z__namespace.number().finite().nullable(),
|
|
349
|
+
unlimited: z__namespace.boolean().optional(),
|
|
350
|
+
enabled: z__namespace.boolean().optional(),
|
|
351
|
+
disabledReason: z__namespace.enum(["out_of_credits", "spend_limit_reached", "user_disabled", "unavailable"]).optional(),
|
|
352
|
+
resetsAt: z__namespace.number().finite().nullable(),
|
|
353
|
+
expiresAt: z__namespace.number().finite().nullable()
|
|
354
|
+
});
|
|
355
|
+
const ProviderUsageSnapshotSchema = z__namespace.object({
|
|
356
|
+
provider: UsageProviderSchema,
|
|
357
|
+
status: z__namespace.enum(["ok", "unauthenticated", "unsupported", "unavailable", "error"]),
|
|
358
|
+
account: z__namespace.object({ id: z__namespace.string().optional(), label: z__namespace.string(), plan: z__namespace.string().optional() }).nullable(),
|
|
359
|
+
checkedAt: z__namespace.number().finite(),
|
|
360
|
+
/** A successful check can return provider-cached data with an unknown age. */
|
|
361
|
+
dataAsOf: z__namespace.number().finite().nullable(),
|
|
362
|
+
freshness: z__namespace.enum(["live", "provider_cache_possible", "cached", "stale", "unknown"]),
|
|
363
|
+
windows: z__namespace.array(ProviderUsageWindowSchema),
|
|
364
|
+
balances: z__namespace.array(ProviderUsageBalanceSchema),
|
|
365
|
+
message: z__namespace.string().optional(),
|
|
366
|
+
retryAt: z__namespace.number().finite().optional()
|
|
367
|
+
});
|
|
368
|
+
|
|
325
369
|
exports.AgentMessageSchema = AgentMessageSchema;
|
|
326
370
|
exports.ApiMessageSchema = ApiMessageSchema;
|
|
327
371
|
exports.ApiUpdateMachineStateSchema = ApiUpdateMachineStateSchema;
|
|
@@ -332,6 +376,10 @@ exports.CoreUpdateContainerSchema = CoreUpdateContainerSchema;
|
|
|
332
376
|
exports.LegacyMessageContentSchema = LegacyMessageContentSchema;
|
|
333
377
|
exports.MessageContentSchema = MessageContentSchema;
|
|
334
378
|
exports.MessageMetaSchema = MessageMetaSchema;
|
|
379
|
+
exports.ProviderUsageBalanceSchema = ProviderUsageBalanceSchema;
|
|
380
|
+
exports.ProviderUsageRequestSchema = ProviderUsageRequestSchema;
|
|
381
|
+
exports.ProviderUsageSnapshotSchema = ProviderUsageSnapshotSchema;
|
|
382
|
+
exports.ProviderUsageWindowSchema = ProviderUsageWindowSchema;
|
|
335
383
|
exports.SessionMessageContentSchema = SessionMessageContentSchema;
|
|
336
384
|
exports.SessionMessageSchema = SessionMessageSchema;
|
|
337
385
|
exports.SessionProtocolMessageSchema = SessionProtocolMessageSchema;
|
|
@@ -340,6 +388,7 @@ exports.UpdateMachineBodySchema = UpdateMachineBodySchema;
|
|
|
340
388
|
exports.UpdateNewMessageBodySchema = UpdateNewMessageBodySchema;
|
|
341
389
|
exports.UpdateSchema = UpdateSchema;
|
|
342
390
|
exports.UpdateSessionBodySchema = UpdateSessionBodySchema;
|
|
391
|
+
exports.UsageProviderSchema = UsageProviderSchema;
|
|
343
392
|
exports.UserMessageSchema = UserMessageSchema;
|
|
344
393
|
exports.VersionedEncryptedValueSchema = VersionedEncryptedValueSchema;
|
|
345
394
|
exports.VersionedMachineEncryptedValueSchema = VersionedMachineEncryptedValueSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -906,5 +906,129 @@ declare function normalizeMetadata<T>(value: T): T;
|
|
|
906
906
|
/** Include wire aliases so accounts explicitly shared with an earlier client remain usable. */
|
|
907
907
|
declare function toWireMetadata<T>(value: T): T;
|
|
908
908
|
|
|
909
|
-
|
|
910
|
-
|
|
909
|
+
declare const UsageProviderSchema: z.ZodEnum<{
|
|
910
|
+
codex: "codex";
|
|
911
|
+
claude: "claude";
|
|
912
|
+
}>;
|
|
913
|
+
type UsageProvider = z.infer<typeof UsageProviderSchema>;
|
|
914
|
+
declare const ProviderUsageRequestSchema: z.ZodObject<{
|
|
915
|
+
provider: z.ZodEnum<{
|
|
916
|
+
codex: "codex";
|
|
917
|
+
claude: "claude";
|
|
918
|
+
}>;
|
|
919
|
+
refresh: z.ZodOptional<z.ZodBoolean>;
|
|
920
|
+
}, z.core.$strip>;
|
|
921
|
+
type ProviderUsageRequest = z.infer<typeof ProviderUsageRequestSchema>;
|
|
922
|
+
/** Provider timestamps are normalized to epoch milliseconds. Null means unknown. */
|
|
923
|
+
declare const ProviderUsageWindowSchema: z.ZodObject<{
|
|
924
|
+
id: z.ZodString;
|
|
925
|
+
label: z.ZodString;
|
|
926
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
927
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
928
|
+
remainingPercent: z.ZodNullable<z.ZodNumber>;
|
|
929
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
930
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
931
|
+
}, z.core.$strip>;
|
|
932
|
+
type ProviderUsageWindow = z.infer<typeof ProviderUsageWindowSchema>;
|
|
933
|
+
/** Currency amounts use major units; provider credits are a separate unit. */
|
|
934
|
+
declare const ProviderUsageBalanceSchema: z.ZodObject<{
|
|
935
|
+
id: z.ZodString;
|
|
936
|
+
label: z.ZodString;
|
|
937
|
+
kind: z.ZodEnum<{
|
|
938
|
+
credits: "credits";
|
|
939
|
+
spend_limit: "spend_limit";
|
|
940
|
+
resets: "resets";
|
|
941
|
+
}>;
|
|
942
|
+
unit: z.ZodEnum<{
|
|
943
|
+
credits: "credits";
|
|
944
|
+
currency: "currency";
|
|
945
|
+
count: "count";
|
|
946
|
+
}>;
|
|
947
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
948
|
+
used: z.ZodNullable<z.ZodNumber>;
|
|
949
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
950
|
+
remaining: z.ZodNullable<z.ZodNumber>;
|
|
951
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
952
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
953
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
954
|
+
disabledReason: z.ZodOptional<z.ZodEnum<{
|
|
955
|
+
out_of_credits: "out_of_credits";
|
|
956
|
+
spend_limit_reached: "spend_limit_reached";
|
|
957
|
+
user_disabled: "user_disabled";
|
|
958
|
+
unavailable: "unavailable";
|
|
959
|
+
}>>;
|
|
960
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
961
|
+
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
962
|
+
}, z.core.$strip>;
|
|
963
|
+
type ProviderUsageBalance = z.infer<typeof ProviderUsageBalanceSchema>;
|
|
964
|
+
declare const ProviderUsageSnapshotSchema: z.ZodObject<{
|
|
965
|
+
provider: z.ZodEnum<{
|
|
966
|
+
codex: "codex";
|
|
967
|
+
claude: "claude";
|
|
968
|
+
}>;
|
|
969
|
+
status: z.ZodEnum<{
|
|
970
|
+
error: "error";
|
|
971
|
+
unavailable: "unavailable";
|
|
972
|
+
ok: "ok";
|
|
973
|
+
unauthenticated: "unauthenticated";
|
|
974
|
+
unsupported: "unsupported";
|
|
975
|
+
}>;
|
|
976
|
+
account: z.ZodNullable<z.ZodObject<{
|
|
977
|
+
id: z.ZodOptional<z.ZodString>;
|
|
978
|
+
label: z.ZodString;
|
|
979
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
980
|
+
}, z.core.$strip>>;
|
|
981
|
+
checkedAt: z.ZodNumber;
|
|
982
|
+
dataAsOf: z.ZodNullable<z.ZodNumber>;
|
|
983
|
+
freshness: z.ZodEnum<{
|
|
984
|
+
unknown: "unknown";
|
|
985
|
+
live: "live";
|
|
986
|
+
provider_cache_possible: "provider_cache_possible";
|
|
987
|
+
cached: "cached";
|
|
988
|
+
stale: "stale";
|
|
989
|
+
}>;
|
|
990
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
991
|
+
id: z.ZodString;
|
|
992
|
+
label: z.ZodString;
|
|
993
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
994
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
995
|
+
remainingPercent: z.ZodNullable<z.ZodNumber>;
|
|
996
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
997
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
998
|
+
}, z.core.$strip>>;
|
|
999
|
+
balances: z.ZodArray<z.ZodObject<{
|
|
1000
|
+
id: z.ZodString;
|
|
1001
|
+
label: z.ZodString;
|
|
1002
|
+
kind: z.ZodEnum<{
|
|
1003
|
+
credits: "credits";
|
|
1004
|
+
spend_limit: "spend_limit";
|
|
1005
|
+
resets: "resets";
|
|
1006
|
+
}>;
|
|
1007
|
+
unit: z.ZodEnum<{
|
|
1008
|
+
credits: "credits";
|
|
1009
|
+
currency: "currency";
|
|
1010
|
+
count: "count";
|
|
1011
|
+
}>;
|
|
1012
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1013
|
+
used: z.ZodNullable<z.ZodNumber>;
|
|
1014
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
1015
|
+
remaining: z.ZodNullable<z.ZodNumber>;
|
|
1016
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
1017
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
1018
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1019
|
+
disabledReason: z.ZodOptional<z.ZodEnum<{
|
|
1020
|
+
out_of_credits: "out_of_credits";
|
|
1021
|
+
spend_limit_reached: "spend_limit_reached";
|
|
1022
|
+
user_disabled: "user_disabled";
|
|
1023
|
+
unavailable: "unavailable";
|
|
1024
|
+
}>>;
|
|
1025
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
1026
|
+
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
1027
|
+
}, z.core.$strip>>;
|
|
1028
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
retryAt: z.ZodOptional<z.ZodNumber>;
|
|
1030
|
+
}, z.core.$strip>;
|
|
1031
|
+
type ProviderUsageSnapshot = z.infer<typeof ProviderUsageSnapshotSchema>;
|
|
1032
|
+
|
|
1033
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, ProviderUsageBalanceSchema, ProviderUsageRequestSchema, ProviderUsageSnapshotSchema, ProviderUsageWindowSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UsageProviderSchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceConversationDeniedSchema, VoiceConversationGrantedSchema, VoiceConversationResponseSchema, VoiceUsageResponseSchema, authenticationContexts, createEnvelope, encryptionContexts, legacyInstallation, legacyServerBanner, normalizeMetadata, rpcMethods, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, toWireMetadata };
|
|
1034
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, ProviderUsageBalance, ProviderUsageRequest, ProviderUsageSnapshot, ProviderUsageWindow, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UsageProvider, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceConversationResponse, VoiceUsageResponse };
|
package/dist/index.d.mts
CHANGED
|
@@ -906,5 +906,129 @@ declare function normalizeMetadata<T>(value: T): T;
|
|
|
906
906
|
/** Include wire aliases so accounts explicitly shared with an earlier client remain usable. */
|
|
907
907
|
declare function toWireMetadata<T>(value: T): T;
|
|
908
908
|
|
|
909
|
-
|
|
910
|
-
|
|
909
|
+
declare const UsageProviderSchema: z.ZodEnum<{
|
|
910
|
+
codex: "codex";
|
|
911
|
+
claude: "claude";
|
|
912
|
+
}>;
|
|
913
|
+
type UsageProvider = z.infer<typeof UsageProviderSchema>;
|
|
914
|
+
declare const ProviderUsageRequestSchema: z.ZodObject<{
|
|
915
|
+
provider: z.ZodEnum<{
|
|
916
|
+
codex: "codex";
|
|
917
|
+
claude: "claude";
|
|
918
|
+
}>;
|
|
919
|
+
refresh: z.ZodOptional<z.ZodBoolean>;
|
|
920
|
+
}, z.core.$strip>;
|
|
921
|
+
type ProviderUsageRequest = z.infer<typeof ProviderUsageRequestSchema>;
|
|
922
|
+
/** Provider timestamps are normalized to epoch milliseconds. Null means unknown. */
|
|
923
|
+
declare const ProviderUsageWindowSchema: z.ZodObject<{
|
|
924
|
+
id: z.ZodString;
|
|
925
|
+
label: z.ZodString;
|
|
926
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
927
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
928
|
+
remainingPercent: z.ZodNullable<z.ZodNumber>;
|
|
929
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
930
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
931
|
+
}, z.core.$strip>;
|
|
932
|
+
type ProviderUsageWindow = z.infer<typeof ProviderUsageWindowSchema>;
|
|
933
|
+
/** Currency amounts use major units; provider credits are a separate unit. */
|
|
934
|
+
declare const ProviderUsageBalanceSchema: z.ZodObject<{
|
|
935
|
+
id: z.ZodString;
|
|
936
|
+
label: z.ZodString;
|
|
937
|
+
kind: z.ZodEnum<{
|
|
938
|
+
credits: "credits";
|
|
939
|
+
spend_limit: "spend_limit";
|
|
940
|
+
resets: "resets";
|
|
941
|
+
}>;
|
|
942
|
+
unit: z.ZodEnum<{
|
|
943
|
+
credits: "credits";
|
|
944
|
+
currency: "currency";
|
|
945
|
+
count: "count";
|
|
946
|
+
}>;
|
|
947
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
948
|
+
used: z.ZodNullable<z.ZodNumber>;
|
|
949
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
950
|
+
remaining: z.ZodNullable<z.ZodNumber>;
|
|
951
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
952
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
953
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
954
|
+
disabledReason: z.ZodOptional<z.ZodEnum<{
|
|
955
|
+
out_of_credits: "out_of_credits";
|
|
956
|
+
spend_limit_reached: "spend_limit_reached";
|
|
957
|
+
user_disabled: "user_disabled";
|
|
958
|
+
unavailable: "unavailable";
|
|
959
|
+
}>>;
|
|
960
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
961
|
+
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
962
|
+
}, z.core.$strip>;
|
|
963
|
+
type ProviderUsageBalance = z.infer<typeof ProviderUsageBalanceSchema>;
|
|
964
|
+
declare const ProviderUsageSnapshotSchema: z.ZodObject<{
|
|
965
|
+
provider: z.ZodEnum<{
|
|
966
|
+
codex: "codex";
|
|
967
|
+
claude: "claude";
|
|
968
|
+
}>;
|
|
969
|
+
status: z.ZodEnum<{
|
|
970
|
+
error: "error";
|
|
971
|
+
unavailable: "unavailable";
|
|
972
|
+
ok: "ok";
|
|
973
|
+
unauthenticated: "unauthenticated";
|
|
974
|
+
unsupported: "unsupported";
|
|
975
|
+
}>;
|
|
976
|
+
account: z.ZodNullable<z.ZodObject<{
|
|
977
|
+
id: z.ZodOptional<z.ZodString>;
|
|
978
|
+
label: z.ZodString;
|
|
979
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
980
|
+
}, z.core.$strip>>;
|
|
981
|
+
checkedAt: z.ZodNumber;
|
|
982
|
+
dataAsOf: z.ZodNullable<z.ZodNumber>;
|
|
983
|
+
freshness: z.ZodEnum<{
|
|
984
|
+
unknown: "unknown";
|
|
985
|
+
live: "live";
|
|
986
|
+
provider_cache_possible: "provider_cache_possible";
|
|
987
|
+
cached: "cached";
|
|
988
|
+
stale: "stale";
|
|
989
|
+
}>;
|
|
990
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
991
|
+
id: z.ZodString;
|
|
992
|
+
label: z.ZodString;
|
|
993
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
994
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
995
|
+
remainingPercent: z.ZodNullable<z.ZodNumber>;
|
|
996
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
997
|
+
durationSeconds: z.ZodNullable<z.ZodNumber>;
|
|
998
|
+
}, z.core.$strip>>;
|
|
999
|
+
balances: z.ZodArray<z.ZodObject<{
|
|
1000
|
+
id: z.ZodString;
|
|
1001
|
+
label: z.ZodString;
|
|
1002
|
+
kind: z.ZodEnum<{
|
|
1003
|
+
credits: "credits";
|
|
1004
|
+
spend_limit: "spend_limit";
|
|
1005
|
+
resets: "resets";
|
|
1006
|
+
}>;
|
|
1007
|
+
unit: z.ZodEnum<{
|
|
1008
|
+
credits: "credits";
|
|
1009
|
+
currency: "currency";
|
|
1010
|
+
count: "count";
|
|
1011
|
+
}>;
|
|
1012
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1013
|
+
used: z.ZodNullable<z.ZodNumber>;
|
|
1014
|
+
limit: z.ZodNullable<z.ZodNumber>;
|
|
1015
|
+
remaining: z.ZodNullable<z.ZodNumber>;
|
|
1016
|
+
usedPercent: z.ZodNullable<z.ZodNumber>;
|
|
1017
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
1018
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1019
|
+
disabledReason: z.ZodOptional<z.ZodEnum<{
|
|
1020
|
+
out_of_credits: "out_of_credits";
|
|
1021
|
+
spend_limit_reached: "spend_limit_reached";
|
|
1022
|
+
user_disabled: "user_disabled";
|
|
1023
|
+
unavailable: "unavailable";
|
|
1024
|
+
}>>;
|
|
1025
|
+
resetsAt: z.ZodNullable<z.ZodNumber>;
|
|
1026
|
+
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
1027
|
+
}, z.core.$strip>>;
|
|
1028
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
retryAt: z.ZodOptional<z.ZodNumber>;
|
|
1030
|
+
}, z.core.$strip>;
|
|
1031
|
+
type ProviderUsageSnapshot = z.infer<typeof ProviderUsageSnapshotSchema>;
|
|
1032
|
+
|
|
1033
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, ProviderUsageBalanceSchema, ProviderUsageRequestSchema, ProviderUsageSnapshotSchema, ProviderUsageWindowSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UsageProviderSchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceConversationDeniedSchema, VoiceConversationGrantedSchema, VoiceConversationResponseSchema, VoiceUsageResponseSchema, authenticationContexts, createEnvelope, encryptionContexts, legacyInstallation, legacyServerBanner, normalizeMetadata, rpcMethods, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, toWireMetadata };
|
|
1034
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, ProviderUsageBalance, ProviderUsageRequest, ProviderUsageSnapshot, ProviderUsageWindow, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UsageProvider, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceConversationResponse, VoiceUsageResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -301,4 +301,48 @@ function toWireMetadata(value) {
|
|
|
301
301
|
return result;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
|
|
304
|
+
const UsageProviderSchema = z.enum(["codex", "claude"]);
|
|
305
|
+
const ProviderUsageRequestSchema = z.object({
|
|
306
|
+
provider: UsageProviderSchema,
|
|
307
|
+
refresh: z.boolean().optional()
|
|
308
|
+
});
|
|
309
|
+
const ProviderUsageWindowSchema = z.object({
|
|
310
|
+
id: z.string(),
|
|
311
|
+
label: z.string(),
|
|
312
|
+
scope: z.string().optional(),
|
|
313
|
+
usedPercent: z.number().finite().nullable(),
|
|
314
|
+
remainingPercent: z.number().finite().nullable(),
|
|
315
|
+
resetsAt: z.number().finite().nullable(),
|
|
316
|
+
durationSeconds: z.number().finite().nullable()
|
|
317
|
+
});
|
|
318
|
+
const ProviderUsageBalanceSchema = z.object({
|
|
319
|
+
id: z.string(),
|
|
320
|
+
label: z.string(),
|
|
321
|
+
kind: z.enum(["credits", "spend_limit", "resets"]),
|
|
322
|
+
unit: z.enum(["credits", "currency", "count"]),
|
|
323
|
+
currency: z.string().optional(),
|
|
324
|
+
used: z.number().finite().nullable(),
|
|
325
|
+
limit: z.number().finite().nullable(),
|
|
326
|
+
remaining: z.number().finite().nullable(),
|
|
327
|
+
usedPercent: z.number().finite().nullable(),
|
|
328
|
+
unlimited: z.boolean().optional(),
|
|
329
|
+
enabled: z.boolean().optional(),
|
|
330
|
+
disabledReason: z.enum(["out_of_credits", "spend_limit_reached", "user_disabled", "unavailable"]).optional(),
|
|
331
|
+
resetsAt: z.number().finite().nullable(),
|
|
332
|
+
expiresAt: z.number().finite().nullable()
|
|
333
|
+
});
|
|
334
|
+
const ProviderUsageSnapshotSchema = z.object({
|
|
335
|
+
provider: UsageProviderSchema,
|
|
336
|
+
status: z.enum(["ok", "unauthenticated", "unsupported", "unavailable", "error"]),
|
|
337
|
+
account: z.object({ id: z.string().optional(), label: z.string(), plan: z.string().optional() }).nullable(),
|
|
338
|
+
checkedAt: z.number().finite(),
|
|
339
|
+
/** A successful check can return provider-cached data with an unknown age. */
|
|
340
|
+
dataAsOf: z.number().finite().nullable(),
|
|
341
|
+
freshness: z.enum(["live", "provider_cache_possible", "cached", "stale", "unknown"]),
|
|
342
|
+
windows: z.array(ProviderUsageWindowSchema),
|
|
343
|
+
balances: z.array(ProviderUsageBalanceSchema),
|
|
344
|
+
message: z.string().optional(),
|
|
345
|
+
retryAt: z.number().finite().optional()
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, ProviderUsageBalanceSchema, ProviderUsageRequestSchema, ProviderUsageSnapshotSchema, ProviderUsageWindowSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UsageProviderSchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceConversationDeniedSchema, VoiceConversationGrantedSchema, VoiceConversationResponseSchema, VoiceUsageResponseSchema, authenticationContexts, createEnvelope, encryptionContexts, legacyInstallation, legacyServerBanner, normalizeMetadata, rpcMethods, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, toWireMetadata };
|