@kaana.ai/contracts 8.11.0 → 8.13.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/internal/catalogue.d.ts +1 -1
- package/dist/internal/identity.d.ts +141 -0
- package/dist/internal/identity.js +82 -0
- package/dist/internal/request.d.ts +10 -0
- package/dist/internal/request.js +14 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +1 -0
- package/dist/public/messages.d.ts +19 -0
- package/dist/public/messages.js +17 -0
- package/dist/public/version.d.ts +14 -1
- package/dist/public/version.js +14 -1
- package/openapi.json +34 -1
- package/package.json +1 -1
|
@@ -314,10 +314,10 @@ export declare const routingProfileSchema: z.ZodObject<{
|
|
|
314
314
|
displayName: z.ZodString;
|
|
315
315
|
description: z.ZodOptional<z.ZodString>;
|
|
316
316
|
optimiseFor: z.ZodEnum<{
|
|
317
|
+
quality: "quality";
|
|
317
318
|
price: "price";
|
|
318
319
|
latency: "latency";
|
|
319
320
|
throughput: "throughput";
|
|
320
|
-
quality: "quality";
|
|
321
321
|
balanced: "balanced";
|
|
322
322
|
}>;
|
|
323
323
|
candidates: z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/** Identity facts only. Kaana owns admission, routing and economic policy. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const IDENTITY_SIGNATURE_DOMAIN = "oxy-kaana-identity:v1";
|
|
4
|
+
export declare const IDENTITY_VALIDITY_WINDOW_MS = 60000;
|
|
5
|
+
export declare const OXY_KAANA_IDENTITIES_ENDPOINT = "/internal/kaana/v1/identities";
|
|
6
|
+
/** The exact bytes of this request, not inference content, are signed by hash. */
|
|
7
|
+
export declare const kaanaIdentityRequestSchema: z.ZodObject<{
|
|
8
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
9
|
+
kind: z.ZodLiteral<"identity">;
|
|
10
|
+
requestId: z.ZodString;
|
|
11
|
+
audience: z.ZodLiteral<"kaana.ai">;
|
|
12
|
+
credential: z.ZodString;
|
|
13
|
+
onBehalfOfUserId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "DelegatedUserId", "out">>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export declare const kaanaIdentityLaneSchema: z.ZodEnum<{
|
|
16
|
+
machine_credential: "machine_credential";
|
|
17
|
+
service_token: "service_token";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const kaanaIdentityApplicationClassSchema: z.ZodEnum<{
|
|
20
|
+
system: "system";
|
|
21
|
+
first_party: "first_party";
|
|
22
|
+
third_party: "third_party";
|
|
23
|
+
internal: "internal";
|
|
24
|
+
}>;
|
|
25
|
+
export declare const kaanaIdentityPrincipalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
+
authority: z.ZodLiteral<"first_party">;
|
|
27
|
+
ownerAccountId: z.core.$ZodBranded<z.ZodString, "OxyAccountId", "out">;
|
|
28
|
+
applicationId: z.ZodString;
|
|
29
|
+
credentialId: z.ZodString;
|
|
30
|
+
environment: z.ZodEnum<{
|
|
31
|
+
development: "development";
|
|
32
|
+
staging: "staging";
|
|
33
|
+
production: "production";
|
|
34
|
+
}>;
|
|
35
|
+
lane: z.ZodEnum<{
|
|
36
|
+
machine_credential: "machine_credential";
|
|
37
|
+
service_token: "service_token";
|
|
38
|
+
}>;
|
|
39
|
+
applicationClass: z.ZodEnum<{
|
|
40
|
+
system: "system";
|
|
41
|
+
first_party: "first_party";
|
|
42
|
+
third_party: "third_party";
|
|
43
|
+
internal: "internal";
|
|
44
|
+
}>;
|
|
45
|
+
applicationIsInternal: z.ZodBoolean;
|
|
46
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
47
|
+
authority: z.ZodLiteral<"external">;
|
|
48
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
49
|
+
"inference:invoke": "inference:invoke";
|
|
50
|
+
"inference:models:read": "inference:models:read";
|
|
51
|
+
"inference:usage:read": "inference:usage:read";
|
|
52
|
+
"inference:routing:read": "inference:routing:read";
|
|
53
|
+
"inference:routing:write": "inference:routing:write";
|
|
54
|
+
"inference:providers:read": "inference:providers:read";
|
|
55
|
+
"inference:providers:write": "inference:providers:write";
|
|
56
|
+
}>>;
|
|
57
|
+
ownerAccountId: z.core.$ZodBranded<z.ZodString, "OxyAccountId", "out">;
|
|
58
|
+
applicationId: z.ZodString;
|
|
59
|
+
credentialId: z.ZodString;
|
|
60
|
+
environment: z.ZodEnum<{
|
|
61
|
+
development: "development";
|
|
62
|
+
staging: "staging";
|
|
63
|
+
production: "production";
|
|
64
|
+
}>;
|
|
65
|
+
lane: z.ZodEnum<{
|
|
66
|
+
machine_credential: "machine_credential";
|
|
67
|
+
service_token: "service_token";
|
|
68
|
+
}>;
|
|
69
|
+
applicationClass: z.ZodEnum<{
|
|
70
|
+
system: "system";
|
|
71
|
+
first_party: "first_party";
|
|
72
|
+
third_party: "third_party";
|
|
73
|
+
internal: "internal";
|
|
74
|
+
}>;
|
|
75
|
+
applicationIsInternal: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strict>], "authority">;
|
|
77
|
+
export declare const kaanaIdentityAssertionSchema: z.ZodObject<{
|
|
78
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
79
|
+
kind: z.ZodLiteral<"identity">;
|
|
80
|
+
requestId: z.ZodString;
|
|
81
|
+
audience: z.ZodLiteral<"kaana.ai">;
|
|
82
|
+
requestSha256: z.ZodString;
|
|
83
|
+
issuedAt: z.ZodString;
|
|
84
|
+
expiresAt: z.ZodString;
|
|
85
|
+
principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
86
|
+
authority: z.ZodLiteral<"first_party">;
|
|
87
|
+
ownerAccountId: z.core.$ZodBranded<z.ZodString, "OxyAccountId", "out">;
|
|
88
|
+
applicationId: z.ZodString;
|
|
89
|
+
credentialId: z.ZodString;
|
|
90
|
+
environment: z.ZodEnum<{
|
|
91
|
+
development: "development";
|
|
92
|
+
staging: "staging";
|
|
93
|
+
production: "production";
|
|
94
|
+
}>;
|
|
95
|
+
lane: z.ZodEnum<{
|
|
96
|
+
machine_credential: "machine_credential";
|
|
97
|
+
service_token: "service_token";
|
|
98
|
+
}>;
|
|
99
|
+
applicationClass: z.ZodEnum<{
|
|
100
|
+
system: "system";
|
|
101
|
+
first_party: "first_party";
|
|
102
|
+
third_party: "third_party";
|
|
103
|
+
internal: "internal";
|
|
104
|
+
}>;
|
|
105
|
+
applicationIsInternal: z.ZodBoolean;
|
|
106
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
107
|
+
authority: z.ZodLiteral<"external">;
|
|
108
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
109
|
+
"inference:invoke": "inference:invoke";
|
|
110
|
+
"inference:models:read": "inference:models:read";
|
|
111
|
+
"inference:usage:read": "inference:usage:read";
|
|
112
|
+
"inference:routing:read": "inference:routing:read";
|
|
113
|
+
"inference:routing:write": "inference:routing:write";
|
|
114
|
+
"inference:providers:read": "inference:providers:read";
|
|
115
|
+
"inference:providers:write": "inference:providers:write";
|
|
116
|
+
}>>;
|
|
117
|
+
ownerAccountId: z.core.$ZodBranded<z.ZodString, "OxyAccountId", "out">;
|
|
118
|
+
applicationId: z.ZodString;
|
|
119
|
+
credentialId: z.ZodString;
|
|
120
|
+
environment: z.ZodEnum<{
|
|
121
|
+
development: "development";
|
|
122
|
+
staging: "staging";
|
|
123
|
+
production: "production";
|
|
124
|
+
}>;
|
|
125
|
+
lane: z.ZodEnum<{
|
|
126
|
+
machine_credential: "machine_credential";
|
|
127
|
+
service_token: "service_token";
|
|
128
|
+
}>;
|
|
129
|
+
applicationClass: z.ZodEnum<{
|
|
130
|
+
system: "system";
|
|
131
|
+
first_party: "first_party";
|
|
132
|
+
third_party: "third_party";
|
|
133
|
+
internal: "internal";
|
|
134
|
+
}>;
|
|
135
|
+
applicationIsInternal: z.ZodBoolean;
|
|
136
|
+
}, z.core.$strict>], "authority">;
|
|
137
|
+
userId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "DelegatedUserId", "out">>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type KaanaIdentityRequest = z.infer<typeof kaanaIdentityRequestSchema>;
|
|
140
|
+
export type KaanaIdentityPrincipal = z.infer<typeof kaanaIdentityPrincipalSchema>;
|
|
141
|
+
export type KaanaIdentityAssertion = z.infer<typeof kaanaIdentityAssertionSchema>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Identity facts only. Kaana owns admission, routing and economic policy. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { maxUtf16Length, minUtf16Length } from '../stringBounds.js';
|
|
4
|
+
import { delegatedUserIdSchema, inferenceEnvironmentSchema, inferenceTimestampSchema, oxyApplicationIdSchema, oxyCredentialIdSchema, requestIdSchema, } from '../public/identifiers.js';
|
|
5
|
+
import { inferenceScopeSchema } from './attribution.js';
|
|
6
|
+
import { oxyAccountIdSchema } from './identifiers.js';
|
|
7
|
+
export const IDENTITY_SIGNATURE_DOMAIN = 'oxy-kaana-identity:v1';
|
|
8
|
+
export const IDENTITY_VALIDITY_WINDOW_MS = 60_000;
|
|
9
|
+
export const OXY_KAANA_IDENTITIES_ENDPOINT = '/internal/kaana/v1/identities';
|
|
10
|
+
/** The exact bytes of this request, not inference content, are signed by hash. */
|
|
11
|
+
export const kaanaIdentityRequestSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
schemaVersion: z.literal(1),
|
|
14
|
+
kind: z.literal('identity'),
|
|
15
|
+
requestId: requestIdSchema,
|
|
16
|
+
audience: z.literal('kaana.ai'),
|
|
17
|
+
credential: z.string().check(minUtf16Length(1)).check(maxUtf16Length(8192)),
|
|
18
|
+
/** Attribution only. Never proof of the person's identity or data authority. */
|
|
19
|
+
onBehalfOfUserId: delegatedUserIdSchema.optional(),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
22
|
+
export const kaanaIdentityLaneSchema = z.enum(['machine_credential', 'service_token']);
|
|
23
|
+
export const kaanaIdentityApplicationClassSchema = z.enum([
|
|
24
|
+
'first_party',
|
|
25
|
+
'third_party',
|
|
26
|
+
'internal',
|
|
27
|
+
'system',
|
|
28
|
+
]);
|
|
29
|
+
const principalFields = {
|
|
30
|
+
ownerAccountId: oxyAccountIdSchema,
|
|
31
|
+
applicationId: oxyApplicationIdSchema,
|
|
32
|
+
credentialId: oxyCredentialIdSchema,
|
|
33
|
+
environment: inferenceEnvironmentSchema,
|
|
34
|
+
// Product sessions require their own identity-only verifier before enrollment.
|
|
35
|
+
lane: kaanaIdentityLaneSchema,
|
|
36
|
+
applicationClass: kaanaIdentityApplicationClassSchema,
|
|
37
|
+
applicationIsInternal: z.boolean(),
|
|
38
|
+
};
|
|
39
|
+
export const kaanaIdentityPrincipalSchema = z
|
|
40
|
+
.discriminatedUnion('authority', [
|
|
41
|
+
z.object({ ...principalFields, authority: z.literal('first_party') }).strict(),
|
|
42
|
+
z
|
|
43
|
+
.object({
|
|
44
|
+
...principalFields,
|
|
45
|
+
authority: z.literal('external'),
|
|
46
|
+
scopes: z.array(inferenceScopeSchema),
|
|
47
|
+
})
|
|
48
|
+
.strict(),
|
|
49
|
+
])
|
|
50
|
+
.superRefine((principal, ctx) => {
|
|
51
|
+
if (principal.authority === 'first_party' && principal.lane !== 'service_token') {
|
|
52
|
+
ctx.addIssue({
|
|
53
|
+
code: 'custom',
|
|
54
|
+
path: ['lane'],
|
|
55
|
+
message: 'First-party authority requires a workload service token',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export const kaanaIdentityAssertionSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
schemaVersion: z.literal(1),
|
|
62
|
+
kind: z.literal('identity'),
|
|
63
|
+
requestId: requestIdSchema,
|
|
64
|
+
audience: z.literal('kaana.ai'),
|
|
65
|
+
requestSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
66
|
+
issuedAt: inferenceTimestampSchema,
|
|
67
|
+
expiresAt: inferenceTimestampSchema,
|
|
68
|
+
principal: kaanaIdentityPrincipalSchema,
|
|
69
|
+
/** Attribution only, with the same meaning as onBehalfOfUserId. */
|
|
70
|
+
userId: delegatedUserIdSchema.optional(),
|
|
71
|
+
})
|
|
72
|
+
.strict()
|
|
73
|
+
.superRefine((assertion, ctx) => {
|
|
74
|
+
const duration = Date.parse(assertion.expiresAt) - Date.parse(assertion.issuedAt);
|
|
75
|
+
if (!(duration > 0 && duration <= IDENTITY_VALIDITY_WINDOW_MS)) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
code: 'custom',
|
|
78
|
+
path: ['expiresAt'],
|
|
79
|
+
message: 'Identity assertions are valid for at most 60 seconds',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
@@ -341,6 +341,16 @@ export declare const inferenceRequestSchema: z.ZodObject<{
|
|
|
341
341
|
}>;
|
|
342
342
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
343
343
|
}, z.core.$strict>>;
|
|
344
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
345
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
346
|
+
size: z.ZodOptional<z.ZodString>;
|
|
347
|
+
quality: z.ZodOptional<z.ZodString>;
|
|
348
|
+
style: z.ZodOptional<z.ZodString>;
|
|
349
|
+
responseFormat: z.ZodOptional<z.ZodEnum<{
|
|
350
|
+
url: "url";
|
|
351
|
+
b64_json: "b64_json";
|
|
352
|
+
}>>;
|
|
353
|
+
}, z.core.$strict>>;
|
|
344
354
|
transcription: z.ZodOptional<z.ZodObject<{
|
|
345
355
|
language: z.ZodOptional<z.ZodString>;
|
|
346
356
|
prompt: z.ZodOptional<z.ZodString>;
|
package/dist/internal/request.js
CHANGED
|
@@ -8,7 +8,7 @@ import { maxUtf16Length, minUtf16Length } from '../stringBounds.js';
|
|
|
8
8
|
import { inferenceApiFormatSchema, inferenceModalitySchema } from '../public/catalogue.js';
|
|
9
9
|
import { decisionInputSchema } from '../public/decisions.js';
|
|
10
10
|
import { idempotencyKeySchema, inferenceTimestampSchema } from '../public/identifiers.js';
|
|
11
|
-
import { inferenceAudioOutputParametersSchema, inferenceMessageSchema, inferenceReasoningSchema, inferenceSpeechParametersSchema, inferenceTranscriptionParametersSchema, responseFormatSchema, samplingParametersSchema, toolChoiceSchema, toolDefinitionSchema, } from '../public/messages.js';
|
|
11
|
+
import { inferenceAudioOutputParametersSchema, inferenceMessageSchema, inferenceReasoningSchema, inferenceImageParametersSchema, inferenceSpeechParametersSchema, inferenceTranscriptionParametersSchema, responseFormatSchema, samplingParametersSchema, toolChoiceSchema, toolDefinitionSchema, } from '../public/messages.js';
|
|
12
12
|
import { routingPolicyReferenceSchema } from '../public/policy.js';
|
|
13
13
|
import { inferenceAttributionSchema } from './attribution.js';
|
|
14
14
|
import { authorizedRouteSchema, routingTargetSchema } from './routing.js';
|
|
@@ -93,6 +93,8 @@ const inferenceRequestObjectSchema = z.object({
|
|
|
93
93
|
/** Absent means the route's own default reasoning behaviour. */
|
|
94
94
|
reasoning: inferenceReasoningSchema.optional(),
|
|
95
95
|
speech: inferenceSpeechParametersSchema.optional(),
|
|
96
|
+
/** Text-to-image controls. Contract set 8.12.0. */
|
|
97
|
+
image: inferenceImageParametersSchema.optional(),
|
|
96
98
|
/** File transcription parameters. Contract set 4.5.0. */
|
|
97
99
|
transcription: inferenceTranscriptionParametersSchema.optional(),
|
|
98
100
|
/** Spoken output from a conversational model. Contract set 3.2.0. */
|
|
@@ -168,6 +170,7 @@ export const inferenceRequestSchema = inferenceRequestObjectSchema.superRefine((
|
|
|
168
170
|
request.responseFormat !== undefined ||
|
|
169
171
|
request.reasoning !== undefined ||
|
|
170
172
|
request.speech !== undefined ||
|
|
173
|
+
request.image !== undefined ||
|
|
171
174
|
request.transcription !== undefined ||
|
|
172
175
|
request.audioOutput !== undefined) {
|
|
173
176
|
ctx.addIssue({
|
|
@@ -196,6 +199,16 @@ export const inferenceRequestSchema = inferenceRequestObjectSchema.superRefine((
|
|
|
196
199
|
message: 'speech parameters require the audio_speech API format',
|
|
197
200
|
});
|
|
198
201
|
}
|
|
202
|
+
if (request.image !== undefined &&
|
|
203
|
+
(request.client.apiFormat !== 'images_generations' ||
|
|
204
|
+
request.modality !== 'image' ||
|
|
205
|
+
request.input.format !== 'text')) {
|
|
206
|
+
ctx.addIssue({
|
|
207
|
+
code: 'custom',
|
|
208
|
+
path: ['image'],
|
|
209
|
+
message: 'image parameters require the images_generations API format with image modality and text input',
|
|
210
|
+
});
|
|
211
|
+
}
|
|
199
212
|
if (request.transcription !== undefined &&
|
|
200
213
|
(request.client.apiFormat !== 'audio_transcriptions' ||
|
|
201
214
|
request.modality !== 'audio' ||
|
package/dist/internal.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './internal/embeddings.js';
|
|
|
19
19
|
export * from './internal/errors.js';
|
|
20
20
|
export * from './internal/grant.js';
|
|
21
21
|
export * from './internal/identifiers.js';
|
|
22
|
+
export * from './internal/identity.js';
|
|
22
23
|
export * from './internal/realtime.js';
|
|
23
24
|
export * from './internal/request.js';
|
|
24
25
|
export * from './internal/routing.js';
|
package/dist/internal.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from './internal/embeddings.js';
|
|
|
19
19
|
export * from './internal/errors.js';
|
|
20
20
|
export * from './internal/grant.js';
|
|
21
21
|
export * from './internal/identifiers.js';
|
|
22
|
+
export * from './internal/identity.js';
|
|
22
23
|
export * from './internal/realtime.js';
|
|
23
24
|
export * from './internal/request.js';
|
|
24
25
|
export * from './internal/routing.js';
|
|
@@ -343,6 +343,24 @@ export declare const inferenceSpeechParametersSchema: z.ZodObject<{
|
|
|
343
343
|
}>;
|
|
344
344
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
345
345
|
}, z.core.$strict>;
|
|
346
|
+
/**
|
|
347
|
+
* Parameters for text-to-image (contract set 8.12.0), preserved in the request.
|
|
348
|
+
* Each is the caller's own control, forwarded as named: an adapter whose
|
|
349
|
+
* provider takes none of them refuses the request rather than dropping it.
|
|
350
|
+
* `n` is how many images; `size`, `quality` and `style` are the provider's own
|
|
351
|
+
* vocabulary (each size/quality class is its own model reference in the
|
|
352
|
+
* catalogue, so none of them widens a hold).
|
|
353
|
+
*/
|
|
354
|
+
export declare const inferenceImageParametersSchema: z.ZodObject<{
|
|
355
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
size: z.ZodOptional<z.ZodString>;
|
|
357
|
+
quality: z.ZodOptional<z.ZodString>;
|
|
358
|
+
style: z.ZodOptional<z.ZodString>;
|
|
359
|
+
responseFormat: z.ZodOptional<z.ZodEnum<{
|
|
360
|
+
url: "url";
|
|
361
|
+
b64_json: "b64_json";
|
|
362
|
+
}>>;
|
|
363
|
+
}, z.core.$strict>;
|
|
346
364
|
/**
|
|
347
365
|
* Parameters for a file transcription, preserved in the signed request
|
|
348
366
|
* (contract set 4.5.0). `language` is the caller's statement of what is spoken,
|
|
@@ -386,6 +404,7 @@ export declare const inferenceAudioOutputParametersSchema: z.ZodObject<{
|
|
|
386
404
|
* Moved from the Oxy edge (`packages/api/src/schemas/inferenceEdge.schemas.ts`).
|
|
387
405
|
*/
|
|
388
406
|
export declare const requestLabelsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
407
|
+
export type InferenceImageParameters = z.infer<typeof inferenceImageParametersSchema>;
|
|
389
408
|
export type InferenceSpeechParameters = z.infer<typeof inferenceSpeechParametersSchema>;
|
|
390
409
|
export type InferenceTranscriptionParameters = z.infer<typeof inferenceTranscriptionParametersSchema>;
|
|
391
410
|
export type InferenceAudioOutputParameters = z.infer<typeof inferenceAudioOutputParametersSchema>;
|
package/dist/public/messages.js
CHANGED
|
@@ -412,6 +412,23 @@ export const inferenceSpeechParametersSchema = z
|
|
|
412
412
|
speed: z.number().min(0.25).max(4).optional(),
|
|
413
413
|
})
|
|
414
414
|
.strict();
|
|
415
|
+
/**
|
|
416
|
+
* Parameters for text-to-image (contract set 8.12.0), preserved in the request.
|
|
417
|
+
* Each is the caller's own control, forwarded as named: an adapter whose
|
|
418
|
+
* provider takes none of them refuses the request rather than dropping it.
|
|
419
|
+
* `n` is how many images; `size`, `quality` and `style` are the provider's own
|
|
420
|
+
* vocabulary (each size/quality class is its own model reference in the
|
|
421
|
+
* catalogue, so none of them widens a hold).
|
|
422
|
+
*/
|
|
423
|
+
export const inferenceImageParametersSchema = z
|
|
424
|
+
.object({
|
|
425
|
+
n: z.number().int().min(1).max(10).optional(),
|
|
426
|
+
size: z.string().check(minUtf16Length(1)).check(maxUtf16Length(32)).optional(),
|
|
427
|
+
quality: z.string().check(minUtf16Length(1)).check(maxUtf16Length(32)).optional(),
|
|
428
|
+
style: z.string().check(minUtf16Length(1)).check(maxUtf16Length(32)).optional(),
|
|
429
|
+
responseFormat: z.enum(['url', 'b64_json']).optional(),
|
|
430
|
+
})
|
|
431
|
+
.strict();
|
|
415
432
|
/**
|
|
416
433
|
* Parameters for a file transcription, preserved in the signed request
|
|
417
434
|
* (contract set 4.5.0). `language` is the caller's statement of what is spoken,
|
package/dist/public/version.d.ts
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
101
101
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
102
102
|
*/
|
|
103
|
-
export declare const INFERENCE_CONTRACT_VERSION = "8.
|
|
103
|
+
export declare const INFERENCE_CONTRACT_VERSION = "8.13.0";
|
|
104
104
|
/**
|
|
105
105
|
* Contract set 4.0.0 (Kaana ADR 0002) is the first published as
|
|
106
106
|
* `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
|
|
@@ -241,6 +241,19 @@ export declare const INFERENCE_CONTRACT_VERSION = "8.11.0";
|
|
|
241
241
|
* operation (`grantOperationSchema`, last member) and the public `POST /v1/rerank`
|
|
242
242
|
* shapes (`rerankRequestSchema`, `rerankResponseSchema`). Kaana emits no `rerank`
|
|
243
243
|
* operation and serves no route yet; Oxy supports the operation first.
|
|
244
|
+
*
|
|
245
|
+
* Contract set 8.12.0 is additive: the signed envelope's optional `image`
|
|
246
|
+
* member (`inferenceImageParametersSchema`: `n`, `size`, `quality`, `style`,
|
|
247
|
+
* `responseFormat`), which carries a text-to-image request's controls to the
|
|
248
|
+
* adapter instead of dropping them. It is valid only with the
|
|
249
|
+
* `images_generations` API format, image modality and text input. Nothing in
|
|
250
|
+
* 8.11.0 changes and the public request and response shapes are unchanged.
|
|
251
|
+
*/
|
|
252
|
+
/**
|
|
253
|
+
* Contract set 8.13.0 adds identity-only Oxy assertions under /internal, with a
|
|
254
|
+
* distinct signature domain and bounded request binding. Existing grants and
|
|
255
|
+
* public inference shapes are unchanged; publishing does not activate native
|
|
256
|
+
* economic authorization or enroll any customer.
|
|
244
257
|
*/
|
|
245
258
|
/** The public API's one origin and version. */
|
|
246
259
|
export declare const KAANA_API_BASE_URL = "https://kaana.ai/v1";
|
package/dist/public/version.js
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
101
101
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
102
102
|
*/
|
|
103
|
-
export const INFERENCE_CONTRACT_VERSION = '8.
|
|
103
|
+
export const INFERENCE_CONTRACT_VERSION = '8.13.0';
|
|
104
104
|
/**
|
|
105
105
|
* Contract set 4.0.0 (Kaana ADR 0002) is the first published as
|
|
106
106
|
* `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
|
|
@@ -241,6 +241,19 @@ export const INFERENCE_CONTRACT_VERSION = '8.11.0';
|
|
|
241
241
|
* operation (`grantOperationSchema`, last member) and the public `POST /v1/rerank`
|
|
242
242
|
* shapes (`rerankRequestSchema`, `rerankResponseSchema`). Kaana emits no `rerank`
|
|
243
243
|
* operation and serves no route yet; Oxy supports the operation first.
|
|
244
|
+
*
|
|
245
|
+
* Contract set 8.12.0 is additive: the signed envelope's optional `image`
|
|
246
|
+
* member (`inferenceImageParametersSchema`: `n`, `size`, `quality`, `style`,
|
|
247
|
+
* `responseFormat`), which carries a text-to-image request's controls to the
|
|
248
|
+
* adapter instead of dropping them. It is valid only with the
|
|
249
|
+
* `images_generations` API format, image modality and text input. Nothing in
|
|
250
|
+
* 8.11.0 changes and the public request and response shapes are unchanged.
|
|
251
|
+
*/
|
|
252
|
+
/**
|
|
253
|
+
* Contract set 8.13.0 adds identity-only Oxy assertions under /internal, with a
|
|
254
|
+
* distinct signature domain and bounded request binding. Existing grants and
|
|
255
|
+
* public inference shapes are unchanged; publishing does not activate native
|
|
256
|
+
* economic authorization or enroll any customer.
|
|
244
257
|
*/
|
|
245
258
|
/** The public API's one origin and version. */
|
|
246
259
|
export const KAANA_API_BASE_URL = 'https://kaana.ai/v1';
|
package/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Kaana API",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.13.0",
|
|
6
6
|
"description": "Kaana inference API. Generated from @kaana.ai/contracts; the Zod source is the authority. Accounts, applications, oxy_sk_ keys, limits and billing are managed in Oxy Console: https://console.oxy.so"
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
@@ -4311,6 +4311,39 @@
|
|
|
4311
4311
|
"maxLength": 2048,
|
|
4312
4312
|
"pattern": "^https:\\/\\/[^\\s]+$"
|
|
4313
4313
|
},
|
|
4314
|
+
"InferenceImageParameters": {
|
|
4315
|
+
"type": "object",
|
|
4316
|
+
"properties": {
|
|
4317
|
+
"n": {
|
|
4318
|
+
"type": "integer",
|
|
4319
|
+
"minimum": 1,
|
|
4320
|
+
"maximum": 10
|
|
4321
|
+
},
|
|
4322
|
+
"size": {
|
|
4323
|
+
"type": "string",
|
|
4324
|
+
"minLength": 1,
|
|
4325
|
+
"maxLength": 32
|
|
4326
|
+
},
|
|
4327
|
+
"quality": {
|
|
4328
|
+
"type": "string",
|
|
4329
|
+
"minLength": 1,
|
|
4330
|
+
"maxLength": 32
|
|
4331
|
+
},
|
|
4332
|
+
"style": {
|
|
4333
|
+
"type": "string",
|
|
4334
|
+
"minLength": 1,
|
|
4335
|
+
"maxLength": 32
|
|
4336
|
+
},
|
|
4337
|
+
"responseFormat": {
|
|
4338
|
+
"type": "string",
|
|
4339
|
+
"enum": [
|
|
4340
|
+
"url",
|
|
4341
|
+
"b64_json"
|
|
4342
|
+
]
|
|
4343
|
+
}
|
|
4344
|
+
},
|
|
4345
|
+
"additionalProperties": false
|
|
4346
|
+
},
|
|
4314
4347
|
"InferenceMessageRole": {
|
|
4315
4348
|
"type": "string",
|
|
4316
4349
|
"enum": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaana.ai/contracts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"description": "Kaana inference contract: the Zod schemas of the public API at https://kaana.ai/v1 and, under /internal, of the Oxy-Kaana grant, settlement and signed lane.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|