@oxy.so/contracts 6.23.0 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/inference/money.js +20 -0
- package/dist/cjs/inference/version.js +1 -1
- package/dist/cjs/platformSession.js +27 -1
- package/dist/esm/inference/money.js +20 -0
- package/dist/esm/inference/version.js +1 -1
- package/dist/esm/platformSession.js +26 -0
- package/dist/types/inference/catalogue.d.ts +1 -0
- package/dist/types/inference/economics.d.ts +1 -0
- package/dist/types/inference/money.d.ts +23 -1
- package/dist/types/inference/priceVersion.d.ts +2 -0
- package/dist/types/inference/realtime.d.ts +4 -0
- package/dist/types/inference/routingPolicy.d.ts +1 -0
- package/dist/types/inference/streamEvents.d.ts +2 -0
- package/dist/types/inference/usage.d.ts +4 -0
- package/dist/types/inference/version.d.ts +1 -1
- package/dist/types/platformSession.d.ts +34 -0
- package/package.json +1 -1
|
@@ -157,6 +157,25 @@ exports.moneySchema = zod_1.z
|
|
|
157
157
|
* each read once, so the partition rule holds. A provider whose session price
|
|
158
158
|
* already includes the transcription (xAI's Voice Agent) never reports it.
|
|
159
159
|
*
|
|
160
|
+
* **`cache_write_input_tokens` is a third prompt-side sibling** (added in
|
|
161
|
+
* contract set 4.1.0, mirroring `@kaana.ai/contracts` 8.4.0): input tokens
|
|
162
|
+
* WRITTEN to a prompt cache on this request, the first-request premium a
|
|
163
|
+
* provider charges to create a cache entry (Anthropic's default five-minute
|
|
164
|
+
* write is billed at 1.25 times the input price). A token is written to the
|
|
165
|
+
* cache OR read from it OR neither, so it is in none of `input_tokens` and
|
|
166
|
+
* none of `cached_input_tokens`:
|
|
167
|
+
*
|
|
168
|
+
* ```text
|
|
169
|
+
* input_tokens = prompt tokens - cache reads - cache writes
|
|
170
|
+
* cached_input_tokens = tokens served from the cache
|
|
171
|
+
* cache_write_input_tokens = tokens written to the cache
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* Only the default (five-minute) time to live is a unit; an extended-TTL write
|
|
175
|
+
* is not reported as this unit. A price version that does not price the unit
|
|
176
|
+
* refuses a settlement that reports it (`unpriced_unit`): an unpriced unit is
|
|
177
|
+
* never a free one.
|
|
178
|
+
*
|
|
160
179
|
* No refinement in this package can enforce it, and saying so is part of the
|
|
161
180
|
* rule: a nested report and a disjoint one are the same four non-negative
|
|
162
181
|
* integers, so no predicate over a single report can tell them apart. The two
|
|
@@ -195,6 +214,7 @@ exports.USAGE_UNITS = [
|
|
|
195
214
|
'audio_output_tokens',
|
|
196
215
|
'session_milliseconds',
|
|
197
216
|
'input_transcription_milliseconds',
|
|
217
|
+
'cache_write_input_tokens',
|
|
198
218
|
];
|
|
199
219
|
exports.usageUnitSchema = zod_1.z.enum(exports.USAGE_UNITS);
|
|
200
220
|
/**
|
|
@@ -102,4 +102,4 @@ exports.INFERENCE_CONTRACT_VERSION = void 0;
|
|
|
102
102
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
103
103
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
104
104
|
*/
|
|
105
|
-
exports.INFERENCE_CONTRACT_VERSION = '4.
|
|
105
|
+
exports.INFERENCE_CONTRACT_VERSION = '4.1.0';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* `./client/platformSession.ts`.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.hostTokenValidationSchema = exports.hostTokenClaimSchema = exports.deviceAppTokenResponseSchema = exports.deviceAppTokenRequestSchema = exports.deviceAppTokenAttestationSchema = exports.devicePlatformRequestSchema = exports.redemptionKeySchema = exports.devicePlatformConfirmResponseSchema = exports.devicePlatformConfirmRequestSchema = exports.PLATFORM_CREDENTIAL_PENDING_MS = exports.platformClientSchema = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = void 0;
|
|
17
|
+
exports.hostTokenValidationSchema = exports.hostTokenClaimSchema = exports.deviceAppTokenResponseSchema = exports.deviceAppTokenRequestSchema = exports.deviceAppTokenAttestationSchema = exports.devicePlatformWindowsSchema = exports.redemptionWindowSchema = exports.devicePlatformRequestSchema = exports.redemptionKeySchema = exports.devicePlatformConfirmResponseSchema = exports.devicePlatformConfirmRequestSchema = exports.PLATFORM_CREDENTIAL_PENDING_MS = exports.platformClientSchema = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = void 0;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
const appAssertions_1 = require("./appAssertions");
|
|
20
20
|
const platformSession_1 = require("./client/platformSession");
|
|
@@ -91,6 +91,32 @@ exports.devicePlatformRequestSchema = zod_1.z.strictObject({
|
|
|
91
91
|
platformClient: exports.platformClientSchema,
|
|
92
92
|
redemptionKey: exports.redemptionKeySchema.optional(),
|
|
93
93
|
});
|
|
94
|
+
/**
|
|
95
|
+
* A window of the QR's redemption (R9), as the server counts it when it
|
|
96
|
+
* answers: `expiresInSeconds` (whole seconds, never negative) is what a
|
|
97
|
+
* platform measures against its own monotonic clock from the moment the
|
|
98
|
+
* answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
|
|
99
|
+
* is for logs and people.
|
|
100
|
+
*/
|
|
101
|
+
exports.redemptionWindowSchema = zod_1.z.strictObject({
|
|
102
|
+
expiresAt: zod_1.z.string().datetime(),
|
|
103
|
+
expiresInSeconds: zod_1.z.number().int().nonnegative(),
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* What `POST /session/device/platform` adds to an answer that concerns a
|
|
107
|
+
* known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
|
|
108
|
+
* proof may be redeemed, and redeemed again with its key, until then); and,
|
|
109
|
+
* on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
|
|
110
|
+
* credential it issued must be confirmed by. The 200 carries both beside the
|
|
111
|
+
* sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
|
|
112
|
+
* account in (the account's budget) carries `redemptionWindow` beside its
|
|
113
|
+
* `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
|
|
114
|
+
* neither: it stays the one identical 401.
|
|
115
|
+
*/
|
|
116
|
+
exports.devicePlatformWindowsSchema = zod_1.z.object({
|
|
117
|
+
redemptionWindow: exports.redemptionWindowSchema,
|
|
118
|
+
confirmWindow: exports.redemptionWindowSchema.optional(),
|
|
119
|
+
});
|
|
94
120
|
/**
|
|
95
121
|
* Which application the token is for, as the platform vouches for it:
|
|
96
122
|
*
|
|
@@ -154,6 +154,25 @@ export const moneySchema = z
|
|
|
154
154
|
* each read once, so the partition rule holds. A provider whose session price
|
|
155
155
|
* already includes the transcription (xAI's Voice Agent) never reports it.
|
|
156
156
|
*
|
|
157
|
+
* **`cache_write_input_tokens` is a third prompt-side sibling** (added in
|
|
158
|
+
* contract set 4.1.0, mirroring `@kaana.ai/contracts` 8.4.0): input tokens
|
|
159
|
+
* WRITTEN to a prompt cache on this request, the first-request premium a
|
|
160
|
+
* provider charges to create a cache entry (Anthropic's default five-minute
|
|
161
|
+
* write is billed at 1.25 times the input price). A token is written to the
|
|
162
|
+
* cache OR read from it OR neither, so it is in none of `input_tokens` and
|
|
163
|
+
* none of `cached_input_tokens`:
|
|
164
|
+
*
|
|
165
|
+
* ```text
|
|
166
|
+
* input_tokens = prompt tokens - cache reads - cache writes
|
|
167
|
+
* cached_input_tokens = tokens served from the cache
|
|
168
|
+
* cache_write_input_tokens = tokens written to the cache
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* Only the default (five-minute) time to live is a unit; an extended-TTL write
|
|
172
|
+
* is not reported as this unit. A price version that does not price the unit
|
|
173
|
+
* refuses a settlement that reports it (`unpriced_unit`): an unpriced unit is
|
|
174
|
+
* never a free one.
|
|
175
|
+
*
|
|
157
176
|
* No refinement in this package can enforce it, and saying so is part of the
|
|
158
177
|
* rule: a nested report and a disjoint one are the same four non-negative
|
|
159
178
|
* integers, so no predicate over a single report can tell them apart. The two
|
|
@@ -192,6 +211,7 @@ export const USAGE_UNITS = [
|
|
|
192
211
|
'audio_output_tokens',
|
|
193
212
|
'session_milliseconds',
|
|
194
213
|
'input_transcription_milliseconds',
|
|
214
|
+
'cache_write_input_tokens',
|
|
195
215
|
];
|
|
196
216
|
export const usageUnitSchema = z.enum(USAGE_UNITS);
|
|
197
217
|
/**
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
100
100
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
101
101
|
*/
|
|
102
|
-
export const INFERENCE_CONTRACT_VERSION = '4.
|
|
102
|
+
export const INFERENCE_CONTRACT_VERSION = '4.1.0';
|
|
@@ -84,6 +84,32 @@ export const devicePlatformRequestSchema = z.strictObject({
|
|
|
84
84
|
platformClient: platformClientSchema,
|
|
85
85
|
redemptionKey: redemptionKeySchema.optional(),
|
|
86
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* A window of the QR's redemption (R9), as the server counts it when it
|
|
89
|
+
* answers: `expiresInSeconds` (whole seconds, never negative) is what a
|
|
90
|
+
* platform measures against its own monotonic clock from the moment the
|
|
91
|
+
* answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
|
|
92
|
+
* is for logs and people.
|
|
93
|
+
*/
|
|
94
|
+
export const redemptionWindowSchema = z.strictObject({
|
|
95
|
+
expiresAt: z.string().datetime(),
|
|
96
|
+
expiresInSeconds: z.number().int().nonnegative(),
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* What `POST /session/device/platform` adds to an answer that concerns a
|
|
100
|
+
* known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
|
|
101
|
+
* proof may be redeemed, and redeemed again with its key, until then); and,
|
|
102
|
+
* on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
|
|
103
|
+
* credential it issued must be confirmed by. The 200 carries both beside the
|
|
104
|
+
* sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
|
|
105
|
+
* account in (the account's budget) carries `redemptionWindow` beside its
|
|
106
|
+
* `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
|
|
107
|
+
* neither: it stays the one identical 401.
|
|
108
|
+
*/
|
|
109
|
+
export const devicePlatformWindowsSchema = z.object({
|
|
110
|
+
redemptionWindow: redemptionWindowSchema,
|
|
111
|
+
confirmWindow: redemptionWindowSchema.optional(),
|
|
112
|
+
});
|
|
87
113
|
/**
|
|
88
114
|
* Which application the token is for, as the platform vouches for it:
|
|
89
115
|
*
|
|
@@ -742,6 +742,7 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
742
742
|
audio_output_tokens: "audio_output_tokens";
|
|
743
743
|
session_milliseconds: "session_milliseconds";
|
|
744
744
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
745
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
745
746
|
}>;
|
|
746
747
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
747
748
|
per: z.ZodNumber;
|
|
@@ -147,6 +147,7 @@ export declare const meteredGenerationSchema: z.ZodObject<{
|
|
|
147
147
|
audio_output_tokens: "audio_output_tokens";
|
|
148
148
|
session_milliseconds: "session_milliseconds";
|
|
149
149
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
150
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
150
151
|
}>;
|
|
151
152
|
quantity: z.ZodNumber;
|
|
152
153
|
}, z.core.$strict>>;
|
|
@@ -140,6 +140,25 @@ export declare const moneySchema: z.ZodObject<{
|
|
|
140
140
|
* each read once, so the partition rule holds. A provider whose session price
|
|
141
141
|
* already includes the transcription (xAI's Voice Agent) never reports it.
|
|
142
142
|
*
|
|
143
|
+
* **`cache_write_input_tokens` is a third prompt-side sibling** (added in
|
|
144
|
+
* contract set 4.1.0, mirroring `@kaana.ai/contracts` 8.4.0): input tokens
|
|
145
|
+
* WRITTEN to a prompt cache on this request, the first-request premium a
|
|
146
|
+
* provider charges to create a cache entry (Anthropic's default five-minute
|
|
147
|
+
* write is billed at 1.25 times the input price). A token is written to the
|
|
148
|
+
* cache OR read from it OR neither, so it is in none of `input_tokens` and
|
|
149
|
+
* none of `cached_input_tokens`:
|
|
150
|
+
*
|
|
151
|
+
* ```text
|
|
152
|
+
* input_tokens = prompt tokens - cache reads - cache writes
|
|
153
|
+
* cached_input_tokens = tokens served from the cache
|
|
154
|
+
* cache_write_input_tokens = tokens written to the cache
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* Only the default (five-minute) time to live is a unit; an extended-TTL write
|
|
158
|
+
* is not reported as this unit. A price version that does not price the unit
|
|
159
|
+
* refuses a settlement that reports it (`unpriced_unit`): an unpriced unit is
|
|
160
|
+
* never a free one.
|
|
161
|
+
*
|
|
143
162
|
* No refinement in this package can enforce it, and saying so is part of the
|
|
144
163
|
* rule: a nested report and a disjoint one are the same four non-negative
|
|
145
164
|
* integers, so no predicate over a single report can tell them apart. The two
|
|
@@ -161,7 +180,7 @@ export declare const moneySchema: z.ZodObject<{
|
|
|
161
180
|
* and the "units are integers" rule holds for every modality instead of holding
|
|
162
181
|
* for tokens and being quietly broken by audio.
|
|
163
182
|
*/
|
|
164
|
-
export declare const USAGE_UNITS: readonly ["input_tokens", "cached_input_tokens", "output_tokens", "reasoning_tokens", "requests", "images", "audio_input_milliseconds", "audio_output_milliseconds", "video_milliseconds", "characters", "embeddings", "audio_input_tokens", "cached_audio_input_tokens", "audio_output_tokens", "session_milliseconds", "input_transcription_milliseconds"];
|
|
183
|
+
export declare const USAGE_UNITS: readonly ["input_tokens", "cached_input_tokens", "output_tokens", "reasoning_tokens", "requests", "images", "audio_input_milliseconds", "audio_output_milliseconds", "video_milliseconds", "characters", "embeddings", "audio_input_tokens", "cached_audio_input_tokens", "audio_output_tokens", "session_milliseconds", "input_transcription_milliseconds", "cache_write_input_tokens"];
|
|
165
184
|
export declare const usageUnitSchema: z.ZodEnum<{
|
|
166
185
|
input_tokens: "input_tokens";
|
|
167
186
|
cached_input_tokens: "cached_input_tokens";
|
|
@@ -179,6 +198,7 @@ export declare const usageUnitSchema: z.ZodEnum<{
|
|
|
179
198
|
audio_output_tokens: "audio_output_tokens";
|
|
180
199
|
session_milliseconds: "session_milliseconds";
|
|
181
200
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
201
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
182
202
|
}>;
|
|
183
203
|
/**
|
|
184
204
|
* A metered quantity of ONE unit. Never money — a quantity carries no price and
|
|
@@ -202,6 +222,7 @@ export declare const usageQuantitySchema: z.ZodObject<{
|
|
|
202
222
|
audio_output_tokens: "audio_output_tokens";
|
|
203
223
|
session_milliseconds: "session_milliseconds";
|
|
204
224
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
225
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
205
226
|
}>;
|
|
206
227
|
quantity: z.ZodNumber;
|
|
207
228
|
}, z.core.$strict>;
|
|
@@ -245,6 +266,7 @@ export declare const unitPriceSchema: z.ZodObject<{
|
|
|
245
266
|
audio_output_tokens: "audio_output_tokens";
|
|
246
267
|
session_milliseconds: "session_milliseconds";
|
|
247
268
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
269
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
248
270
|
}>;
|
|
249
271
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
250
272
|
per: z.ZodNumber;
|
|
@@ -65,6 +65,7 @@ export declare const priceVersionSchema: z.ZodObject<{
|
|
|
65
65
|
audio_output_tokens: "audio_output_tokens";
|
|
66
66
|
session_milliseconds: "session_milliseconds";
|
|
67
67
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
68
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
68
69
|
}>;
|
|
69
70
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
70
71
|
per: z.ZodNumber;
|
|
@@ -104,6 +105,7 @@ export declare const priceSnapshotSchema: z.ZodObject<{
|
|
|
104
105
|
audio_output_tokens: "audio_output_tokens";
|
|
105
106
|
session_milliseconds: "session_milliseconds";
|
|
106
107
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
108
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
107
109
|
}>;
|
|
108
110
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
109
111
|
per: z.ZodNumber;
|
|
@@ -1442,6 +1442,7 @@ export declare const realtimeResponseDoneEventSchema: z.ZodObject<{
|
|
|
1442
1442
|
audio_output_tokens: "audio_output_tokens";
|
|
1443
1443
|
session_milliseconds: "session_milliseconds";
|
|
1444
1444
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
1445
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
1445
1446
|
}>;
|
|
1446
1447
|
quantity: z.ZodNumber;
|
|
1447
1448
|
}, z.core.$strict>>;
|
|
@@ -1570,6 +1571,7 @@ export declare const realtimeSessionClosedEventSchema: z.ZodObject<{
|
|
|
1570
1571
|
audio_output_tokens: "audio_output_tokens";
|
|
1571
1572
|
session_milliseconds: "session_milliseconds";
|
|
1572
1573
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
1574
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
1573
1575
|
}>;
|
|
1574
1576
|
quantity: z.ZodNumber;
|
|
1575
1577
|
}, z.core.$strict>>;
|
|
@@ -2019,6 +2021,7 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
2019
2021
|
audio_output_tokens: "audio_output_tokens";
|
|
2020
2022
|
session_milliseconds: "session_milliseconds";
|
|
2021
2023
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
2024
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
2022
2025
|
}>;
|
|
2023
2026
|
quantity: z.ZodNumber;
|
|
2024
2027
|
}, z.core.$strict>>;
|
|
@@ -2125,6 +2128,7 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
2125
2128
|
audio_output_tokens: "audio_output_tokens";
|
|
2126
2129
|
session_milliseconds: "session_milliseconds";
|
|
2127
2130
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
2131
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
2128
2132
|
}>;
|
|
2129
2133
|
quantity: z.ZodNumber;
|
|
2130
2134
|
}, z.core.$strict>>;
|
|
@@ -132,6 +132,7 @@ export declare const routingPolicySchema: z.ZodObject<{
|
|
|
132
132
|
audio_output_tokens: "audio_output_tokens";
|
|
133
133
|
session_milliseconds: "session_milliseconds";
|
|
134
134
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
135
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
135
136
|
}>;
|
|
136
137
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
137
138
|
per: z.ZodNumber;
|
|
@@ -164,6 +164,7 @@ export declare const inferenceStreamUsageEventSchema: z.ZodObject<{
|
|
|
164
164
|
audio_output_tokens: "audio_output_tokens";
|
|
165
165
|
session_milliseconds: "session_milliseconds";
|
|
166
166
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
167
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
167
168
|
}>;
|
|
168
169
|
quantity: z.ZodNumber;
|
|
169
170
|
}, z.core.$strict>>;
|
|
@@ -423,6 +424,7 @@ export declare const inferenceStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
423
424
|
audio_output_tokens: "audio_output_tokens";
|
|
424
425
|
session_milliseconds: "session_milliseconds";
|
|
425
426
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
427
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
426
428
|
}>;
|
|
427
429
|
quantity: z.ZodNumber;
|
|
428
430
|
}, z.core.$strict>>;
|
|
@@ -99,6 +99,7 @@ export declare const usageReservationRequestSchema: z.ZodObject<{
|
|
|
99
99
|
audio_output_tokens: "audio_output_tokens";
|
|
100
100
|
session_milliseconds: "session_milliseconds";
|
|
101
101
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
102
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
102
103
|
}>;
|
|
103
104
|
quantity: z.ZodNumber;
|
|
104
105
|
}, z.core.$strict>>>;
|
|
@@ -294,6 +295,7 @@ export declare const normalizedUsageReportSchema: z.ZodObject<{
|
|
|
294
295
|
audio_output_tokens: "audio_output_tokens";
|
|
295
296
|
session_milliseconds: "session_milliseconds";
|
|
296
297
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
298
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
297
299
|
}>;
|
|
298
300
|
quantity: z.ZodNumber;
|
|
299
301
|
}, z.core.$strict>>;
|
|
@@ -395,6 +397,7 @@ export declare const usageReceiptSchema: z.ZodObject<{
|
|
|
395
397
|
audio_output_tokens: "audio_output_tokens";
|
|
396
398
|
session_milliseconds: "session_milliseconds";
|
|
397
399
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
400
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
398
401
|
}>;
|
|
399
402
|
quantity: z.ZodNumber;
|
|
400
403
|
}, z.core.$strict>>;
|
|
@@ -424,6 +427,7 @@ export declare const usageReceiptSchema: z.ZodObject<{
|
|
|
424
427
|
audio_output_tokens: "audio_output_tokens";
|
|
425
428
|
session_milliseconds: "session_milliseconds";
|
|
426
429
|
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
430
|
+
cache_write_input_tokens: "cache_write_input_tokens";
|
|
427
431
|
}>;
|
|
428
432
|
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
429
433
|
per: z.ZodNumber;
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
100
100
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
101
101
|
*/
|
|
102
|
-
export declare const INFERENCE_CONTRACT_VERSION = "4.
|
|
102
|
+
export declare const INFERENCE_CONTRACT_VERSION = "4.1.0";
|
|
@@ -88,6 +88,38 @@ export declare const devicePlatformRequestSchema: z.ZodObject<{
|
|
|
88
88
|
}, z.core.$strict>;
|
|
89
89
|
redemptionKey: z.ZodOptional<z.ZodString>;
|
|
90
90
|
}, z.core.$strict>;
|
|
91
|
+
/**
|
|
92
|
+
* A window of the QR's redemption (R9), as the server counts it when it
|
|
93
|
+
* answers: `expiresInSeconds` (whole seconds, never negative) is what a
|
|
94
|
+
* platform measures against its own monotonic clock from the moment the
|
|
95
|
+
* answer arrives, so neither clock's setting matters; `expiresAt` (ISO 8601)
|
|
96
|
+
* is for logs and people.
|
|
97
|
+
*/
|
|
98
|
+
export declare const redemptionWindowSchema: z.ZodObject<{
|
|
99
|
+
expiresAt: z.ZodString;
|
|
100
|
+
expiresInSeconds: z.ZodNumber;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
/**
|
|
103
|
+
* What `POST /session/device/platform` adds to an answer that concerns a
|
|
104
|
+
* known proof (R9): `redemptionWindow`, when the claim's ten minutes end (the
|
|
105
|
+
* proof may be redeemed, and redeemed again with its key, until then); and,
|
|
106
|
+
* on a 200 to a platform that confirms (R8), `confirmWindow`, when the pending
|
|
107
|
+
* credential it issued must be confirmed by. The 200 carries both beside the
|
|
108
|
+
* sign-in's `LoginResult`; a 429 asked once the proof is known to sign an
|
|
109
|
+
* account in (the account's budget) carries `redemptionWindow` beside its
|
|
110
|
+
* `retryAfterSeconds`. A refusal of a proof that is not redeemable carries
|
|
111
|
+
* neither: it stays the one identical 401.
|
|
112
|
+
*/
|
|
113
|
+
export declare const devicePlatformWindowsSchema: z.ZodObject<{
|
|
114
|
+
redemptionWindow: z.ZodObject<{
|
|
115
|
+
expiresAt: z.ZodString;
|
|
116
|
+
expiresInSeconds: z.ZodNumber;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
confirmWindow: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
expiresAt: z.ZodString;
|
|
120
|
+
expiresInSeconds: z.ZodNumber;
|
|
121
|
+
}, z.core.$strict>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
91
123
|
/**
|
|
92
124
|
* Which application the token is for, as the platform vouches for it:
|
|
93
125
|
*
|
|
@@ -179,6 +211,8 @@ export type PlatformHost = (typeof PLATFORM_HOSTS)[number];
|
|
|
179
211
|
export type DeviceAppTokenErrorCode = (typeof DEVICE_APP_TOKEN_ERROR_CODES)[number];
|
|
180
212
|
export type PlatformClient = z.infer<typeof platformClientSchema>;
|
|
181
213
|
export type DevicePlatformRequest = z.infer<typeof devicePlatformRequestSchema>;
|
|
214
|
+
export type RedemptionWindow = z.infer<typeof redemptionWindowSchema>;
|
|
215
|
+
export type DevicePlatformWindows = z.infer<typeof devicePlatformWindowsSchema>;
|
|
182
216
|
export type DevicePlatformConfirmRequest = z.infer<typeof devicePlatformConfirmRequestSchema>;
|
|
183
217
|
export type DevicePlatformConfirmResponse = z.infer<typeof devicePlatformConfirmResponseSchema>;
|
|
184
218
|
export type DeviceAppTokenAttestation = z.infer<typeof deviceAppTokenAttestationSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.0",
|
|
4
4
|
"description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|