@byte_fluffy/nexra-sdk 0.1.0-alpha.4 → 0.1.0-alpha.40

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/README.md CHANGED
@@ -9,14 +9,14 @@ npm install @byte_fluffy/nexra-sdk@next
9
9
  ```
10
10
 
11
11
  ```ts
12
- import { createNexra, getModelSpec } from "@byte_fluffy/nexra-sdk";
12
+ import { createNexra, getModelSpec, type NexraImageGenerateInput } from "@byte_fluffy/nexra-sdk";
13
13
 
14
14
  const nexra = createNexra({ apiKey: process.env.NEXRA_API_KEY });
15
- const spec = getModelSpec("gpt-image-2");
16
- const input = {
17
- model: spec!.id,
18
- prompt: "A paper boat on a blue table",
19
- size: "1024x1024",
15
+ const spec = getModelSpec("openai/gpt-image-2");
16
+ const input: NexraImageGenerateInput = {
17
+ content: [{ type: "text", text: "A paper boat on a blue table", role: "prompt" }],
18
+ resolution: "1k",
19
+ aspect_ratio: "1:1",
20
20
  quality: "medium",
21
21
  };
22
22
  const quote = await nexra.catalog.quote({
@@ -24,16 +24,338 @@ const quote = await nexra.catalog.quote({
24
24
  operation: "image.generate",
25
25
  input,
26
26
  });
27
- const result = await nexra.run(spec!.id, { input, quoteToken: quote.quoteToken });
27
+ const result = await nexra.run(spec!.id, input, { quoteToken: quote.quoteToken });
28
28
  ```
29
29
 
30
+ Media apps send the versioned Nexra category contract: ordered `content` parts plus
31
+ the common parameters for `image.generate`, `video.generate`, `audio.generate` or
32
+ `image.upscale`. The server resolves the selected model component and explicitly
33
+ adapts that input to the channel Provider. The SDK does not expose or emulate
34
+ Provider-native endpoints. Protocol constants, schemas and types are also
35
+ available from `@byte_fluffy/nexra-sdk/media`.
36
+
30
37
  The default API base URL is `https://api.nexra-ai.com/v1`. When overriding
31
38
  `baseUrl`, include the `/v1` API prefix.
32
39
 
40
+ ## Banana 2.1
41
+
42
+ Use `google/gemini-nano-banana-2.1` for Banana 2.1. The model supports
43
+ `1K` (default), `2K`, and `4K`, fifteen aspect ratios, and up to fourteen
44
+ source/reference images. It does not support `512`, `count`, or `seed`.
45
+
46
+ ```ts
47
+ const modelId = "google/gemini-nano-banana-2.1";
48
+ const input: NexraImageGenerateInput = {
49
+ content: [{ type: "text", text: "A paper boat on a blue table", role: "prompt" }],
50
+ resolution: "2K",
51
+ aspect_ratio: "16:9",
52
+ };
53
+ const quote = await nexra.catalog.quote({ modelId, operation: "image.generate", input });
54
+ const result = await nexra.run(modelId, input, { quoteToken: quote.quoteToken });
55
+ ```
56
+
57
+ The server also exposes the Google Native `generateContent` endpoint at
58
+ `/v1/projects/{project}/locations/global/publishers/google/models/gemini-nano-banana-2.1:generateContent`.
59
+ Use the Native `contents` and `generationConfig` payload for direct HTTP calls;
60
+ SDK media calls use the Nexra contract shown above.
61
+
62
+ ## DeepSeek model identity correction
63
+
64
+ `0.1.0-alpha.36` replaces `ctyun/deepseek-v4-1-flash` with
65
+ `deepseek/deepseek-v4-1-flash`. Update model IDs in SDK calls, direct HTTP
66
+ requests, persisted selections and catalog caches. Upgrading the SDK does not
67
+ rewrite a hardcoded model ID. The previous public ID and `deepseek-v4.1-flash`
68
+ alias are retired; neither resolves in the new catalog.
69
+
70
+ The server rollout must apply migration `0056_deepseek_model_identity` before
71
+ syncing the new model definition. The model UUID, channel-specific upstream IDs,
72
+ routes, prices and original request history remain attached to the same model.
73
+ The API paths and native payload shapes remain unchanged.
74
+
75
+ ## Error contract migration
76
+
77
+ `0.1.0-alpha.30` introduces the flat public error response and matching SDK
78
+ types and exception getters. Existing HTTP envelopes and historical Task
79
+ objects remain supported as described below.
80
+
81
+ New Nexra responses keep one platform request context at the root:
82
+ `nexraRequestId` and `nexraHttpStatus`. Platform classification is
83
+ `nexraError: { code, message, param? }`. Provider context uses the independent
84
+ root fields `upstreamHttpStatus`, `upstreamRequestId` and `upstreamError`.
85
+ Successful Task receipts and results can carry the platform context without
86
+ an error. New Task results do not duplicate the old `requestId` or `error`
87
+ wrapper. The SDK's exported `Task` and `TaskPage` types describe these public
88
+ results, not the server's internal Task read model.
89
+
90
+ `NexraApiError.status` remains the actual fetch response status. Its read-only
91
+ `code` getter and inherited `message` expose the server's platform classification;
92
+ `nexraError` retains that classification object. Both exception types expose
93
+ `nexraHttpStatus`, `nexraRequestId`, `upstreamHttpStatus`, `upstreamRequestId` and
94
+ `upstreamError`. `NexraTaskError` derives these fields and `taskId` from its
95
+ retained `task`, and has no fetch `status`.
96
+
97
+ Platform HTTP status and request ID describe the same originating request.
98
+ A failed Task can retain its original creation HTTP 202 while a later GET
99
+ returns HTTP 200; its provider might separately return HTTP 400. Missing origin
100
+ evidence is omitted, not inferred from Task failure or a later query. The
101
+ SDK preserves server messages and unknown code strings without localizing or
102
+ reclassifying them. Set `Accept-Language: zh-CN` or `en` through existing client
103
+ `headers` when needed.
104
+
105
+ The SDK accepts old HTTP envelopes and Task error fields internally. Deprecated
106
+ `requestId` and `details` exception getters return `nexraRequestId` and the
107
+ parameter context, without adding serialized aliases. Use `nexraError.param`
108
+ for new parameter handling. Public retry/category hints are removed; the SDK
109
+ no longer exposes `NexraApiError.retryable`.
110
+
111
+ `upstreamErrorMessage` is the original provider error text, preserving its
112
+ language and line breaks. It is independent of the platform classification and
113
+ is omitted when captured diagnostics contain no supported error text. Both SDK
114
+ exception types expose this field. For older stored diagnostic bodies,
115
+ `extractUpstreamErrorMessage(body)` uses the same extraction rules as the server.
116
+
117
+ `upstreamError` contains captured provider error content. When an older captured
118
+ body has its own `error` member, input normalization selects that member once;
119
+ otherwise it retains the complete captured error body. An already canonical
120
+ `upstreamError` is not unwrapped again. Provider fields named `requestId`,
121
+ `httpStatus`, `retryable` or `category` remain unchanged. Diagnostic flags such
122
+ as `upstreamRedacted`, `upstreamTruncated`, `upstreamUnavailableReason`,
123
+ `upstreamFormat` and `upstreamEvent` remain available when supplied by the server.
124
+ This diagnostic projection does not rewrite original Native HTTP responses or
125
+ Task outputs.
126
+
127
+ Against older servers, `tasks.get`, `list`, `watch`, `wait` and
128
+ `NexraTaskError.task` retain original Task/Event objects and their historical
129
+ fields. Only exception getters adapt the input shape; the SDK does not clean
130
+ returned objects or manufacture context for old successful responses.
131
+
132
+ HTTP retry behavior is unchanged: eligible HTTP 503 requests make at most three
133
+ attempts by default, and `maxRetries: 0` makes one attempt. Retry decisions use
134
+ the actual fetch status rather than platform or provider payload metadata.
135
+ Retried Task creation keeps the same idempotency key and payload; failed Tasks
136
+ throw `NexraTaskError` without submitting another generation.
137
+ `NexraWaitTimeoutError` remains a local wait timeout with the original `taskId`
138
+ and does not mean generation failed.
139
+
140
+ ## Model display names
141
+
142
+ `getModelSpec`, `listModelSpecs`, `nexra.models.search`, `nexra.models.get`, and
143
+ `nexra.catalog.model` use the existing VibePaper product labels for known model
144
+ IDs, such as `Banana Pro`, `Grok Imagine`, `GPT-5.4`, and `MiniMax H3 Local`.
145
+ Spelling and punctuation follow the Superegg/global VibePaper catalogs rather
146
+ than upstream manufacturer labels. Model detail family versions follow the same
147
+ mapping. Models without an existing product label retain generic word spacing
148
+ and capitalization.
149
+
150
+ Use `formatModelDisplayName(name, { modelId })` to apply the same mapping to other
151
+ display labels. The one-argument form preserves known product labels and formats
152
+ other labels generically; it does not guess model identity from an upstream name.
153
+ It is available from the package root and `/catalog`. Formatting affects only
154
+ `displayName`: use the static catalog's `id`, model discovery's `slug`, or the
155
+ live catalog's `modelId` for requests, never the formatted display name.
156
+
157
+ ## Live model catalog
158
+
159
+ `getModelSpec` and `listModelSpecs` read the catalog bundled with this SDK release.
160
+ Use `catalog.model(publicId, operation)` to read the currently published database
161
+ input schema, display name, sale prices and actual model revision. A successful
162
+ `available: false` response authoritatively confirms an unavailable or retired
163
+ public identity; HTTP failures throw and must preserve the last successful value.
164
+ An unknown identity returns 404. Model IDs are URL-encoded by the SDK.
165
+
166
+ `catalog.changes` lists lightweight public model/operation identities and their
167
+ latest revisions. Start with `after: "0"` for initial alignment. Keep the first
168
+ page's `revision` as `upper` for every remaining page and pass its opaque
169
+ `nextCursor`. The cursor is bound to that `after`/`upper` window. Revisions are
170
+ 64-bit decimal strings; compare them with `BigInt`, not JavaScript numbers.
171
+
172
+ ```ts
173
+ let after = "0";
174
+ let cursor: string | undefined;
175
+ let upper: string | undefined;
176
+ do {
177
+ const page = await nexra.catalog.changes({ after, upper, cursor });
178
+ upper ??= page.revision;
179
+ // Record changed identities for independent background model reads.
180
+ enqueueChanges(page.data);
181
+ cursor = page.nextCursor;
182
+ } while (cursor);
183
+ after = upper!;
184
+
185
+ for await (const event of nexra.catalog.events({ after, signal })) {
186
+ enqueueChanges(event.data);
187
+ after = event.revision;
188
+ }
189
+ ```
190
+
191
+ `enqueueChanges` is application code that records the affected identities before
192
+ advancing the receiving cursor; it does not block on all model reads. Each model
193
+ response carries its own actual revision. Do not label an older response with the
194
+ requested target revision or let it overwrite newer state. An identity updated
195
+ beyond a page window's fixed upper bound appears in the next window, including
196
+ when its index row was replaced during pagination.
197
+
198
+ `catalog.events` opens one authenticated SSE stream, ignores heartbeats, and
199
+ emits complete `catalog.quote-context.changed` windows with `{ revision,
200
+ changedAt, data }`. Notifications wake the API instance immediately; a per-instance
201
+ 60-second revision check recovers silent notification loss. When a stream ends or
202
+ throws, the application reconnects using its retained `after` cursor; the SDK
203
+ does not reconnect automatically. Abort the supplied signal to stop an active
204
+ read. Leaving the iterator cancels and releases the response stream. Keep cached
205
+ values and cursors separate for different API sources and authorization identities.
206
+ No credentials, channel costs or user discounts are included in the public events.
207
+
208
+ ## Private ElevenLabs voices
209
+
210
+ Voice design uses `elevenlabs/eleven_multilingual_ttv_v2`, with exactly one prompt
211
+ and one script content part. Preview IDs remain in `task.output.previews`; the
212
+ corresponding audio is returned in the ordered persisted `task.assets` list.
213
+
214
+ ```ts
215
+ const design = await nexra.run("elevenlabs/eleven_multilingual_ttv_v2", {
216
+ content: [
217
+ { type: "text", role: "prompt", text: "A warm, clear and natural narrator voice." },
218
+ { type: "text", role: "script", text: previewScript },
219
+ ],
220
+ }, { idempotencyKey: designKey });
221
+ const creation = await nexra.voices.create({
222
+ name: "Narrator",
223
+ source: { kind: "design", taskId: design.task.id, previewId: selectedPreviewId },
224
+ }, { idempotencyKey: saveKey });
225
+ await nexra.tasks.wait(creation.taskId);
226
+ const voice = await nexra.voices.get(creation.voice.id);
227
+ ```
228
+
229
+ Cloning is a voice-resource operation, not a separate vendor model. Upload owned
230
+ audio through `nexra.assets.upload`, then call `nexra.voices.create` with
231
+ `source: { kind: "clone", samples: [sample.id] }`. The service accepts one to five
232
+ stored audio samples totaling at most 25 MiB. Retain the sample IDs and the same
233
+ idempotency key when retrying a creation.
234
+
235
+ `nexra.voices.list` and `get` read current authenticated resource state. Only an
236
+ active voice can be used for `elevenlabs/eleven_multilingual_v2` speech, using its
237
+ public `voice_` ID. Creation and synthesis settle separately; creation does not
238
+ imply verification or support for renewal, deletion, or voice conversion.
239
+
240
+ Applications using a shared API key must enforce their own end-user ownership
241
+ before reading or consuming a resource; API-key ownership covers the Nexra
242
+ account, not an application's individual users. Published model choices are
243
+ available through `nexra.models.resources(modelId, resource)`.
244
+
33
245
  Static catalog APIs are also available from `@byte_fluffy/nexra-sdk/catalog`.
34
246
  Exact non-negative decimal helpers are available from
35
247
  `@byte_fluffy/nexra-sdk/decimal`.
36
248
 
249
+ The static catalog includes 14 Agnes and CTYun image/video model
250
+ contracts. A catalog entry describes parameters; it does not grant access to a
251
+ private model or publish a sale price. Check the selected environment's model
252
+ listing and current prices before submitting a task.
253
+
254
+ Agnes Video 2.5 Flash uses the same video Task input format as Seedance, with
255
+ model-specific limits: `resolution: "720P"`, integer `duration` from 4 to 12,
256
+ up to 5 reference images and 3 reference audio clips, and no video references.
257
+ Keyframes use image content parts with `role: "first_frame"` or `"last_frame"`;
258
+ they cannot be combined with reference media in the same request.
259
+
260
+ ```ts
261
+ const flashInput = {
262
+ content: [{ type: "text", text: "A paper boat floats across a sunlit pond", role: "prompt" }],
263
+ duration: 4,
264
+ resolution: "720P",
265
+ aspect_ratio: "16:9",
266
+ };
267
+ const flashQuote = await nexra.catalog.quote({
268
+ modelId: "agnes/agnes-video-2-5-flash",
269
+ operation: "video.generate",
270
+ input: flashInput,
271
+ });
272
+ const flashResult = await nexra.run("agnes/agnes-video-2-5-flash", flashInput, {
273
+ quoteToken: flashQuote.quoteToken,
274
+ });
275
+ ```
276
+
277
+ ## Native language models
278
+
279
+ The optional `@byte_fluffy/nexra-sdk/language` entrypoint returns AI SDK
280
+ `LanguageModelV4` models. Install its optional provider peers when using this
281
+ entrypoint; the core SDK and media entrypoints do not load them. These provider
282
+ versions require Node.js 22 or a supported Bun runtime:
283
+
284
+ ```sh
285
+ npm install @ai-sdk/provider@^4.0.2 @ai-sdk/provider-utils@^5.0.21 \
286
+ @ai-sdk/openai@^4.0.11 @ai-sdk/anthropic@^4.0.30 @ai-sdk/google@^4.0.12 ai@^7
287
+ ```
288
+
289
+ ```ts
290
+ import { generateText, streamText } from "ai";
291
+ import { getLanguageModelBinding } from "@byte_fluffy/nexra-sdk/catalog";
292
+ import { createNexraLanguageModel } from "@byte_fluffy/nexra-sdk/language";
293
+
294
+ const modelId = "openai/gpt-6-sol";
295
+ const binding = getLanguageModelBinding(modelId);
296
+ const model = createNexraLanguageModel(modelId, {
297
+ apiKey: process.env.NEXRA_API_KEY!,
298
+ });
299
+
300
+ if (binding.supportsStreaming) {
301
+ const result = streamText({ model, prompt: "Explain a paper boat", maxRetries: 0 });
302
+ for await (const text of result.textStream) process.stdout.write(text);
303
+ } else {
304
+ const result = await generateText({ model, prompt: "Explain a paper boat", maxRetries: 0 });
305
+ console.log(result.text);
306
+ }
307
+ ```
308
+
309
+ The binding selects a declared native endpoint, preferring Gemini, Responses,
310
+ Chat Completions, then Messages. Pass `protocol` to choose another endpoint
311
+ declared by that model. Native endpoint `inputSchema` and `outputSchema` describe
312
+ wire parameters; language operation schemas may describe Playground inputs.
313
+ `binding.maxOutputTokens` is the lower of the model capability and selected
314
+ native endpoint limit. Messages requests validate the combined visible and
315
+ thinking token budget before sending; explicit budgets are never clamped.
316
+ The SDK does not wrap text requests in media Tasks or retry generations.
317
+
318
+ Messages, tool history and ordered content parts use the AI SDK prompt contract.
319
+ Chat Completions supports declared image/video/audio URLs and inline MP3, WAV,
320
+ AAC and M4A audio without downloading URLs or changing codecs. Native model results and stream finish events retain `usage.raw`, including
321
+ cache and modality details. With AI SDK 7, read `result.finalStep.usage.raw`
322
+ or each step callback's usage. Aggregate `result.usage` and `totalUsage` do not
323
+ retain raw records.
324
+
325
+ Chat native extension fields are passed under `providerOptions.nexra`;
326
+ Responses uses `openai`, Messages uses `anthropic`, and Gemini uses `google`.
327
+ Explicit provider options are preserved. Model identity and prompt/stream
328
+ fields stay owned by the SDK. Kimi K2.5 currently declares synchronous Chat
329
+ Completions only, so use `generateText` for that model.
330
+
331
+ Responses defaults to `store: false` in this SDK so each request replays the full
332
+ conversation and encrypted reasoning instead of relying on stored item IDs.
333
+ Pass `providerOptions.openai.store: true` explicitly for a stored conversation.
334
+ The current Responses provider cannot preserve sampling parameters alongside
335
+ reasoning for canonical Nexra IDs. Explicit `temperature` or `topP` therefore
336
+ fails before sending instead of being silently discarded. A caller may select
337
+ `forceReasoning: false` for sampling without explicit reasoning controls.
338
+ The documented provider version floors are tested; Anthropic budget validation
339
+ uses its exported capability helper and the shared provider budget mapper.
340
+
341
+ Use `resolveNexraLanguageReasoning(modelId, { enabled: false })` from `/catalog`
342
+ for a quiet generation policy. Its `providerOptions` select a declared off mode
343
+ or the model's minimum reasoning effort; `canDisable` distinguishes those cases.
344
+ An explicit AI SDK `reasoning: "none"` is rejected when the native model requires
345
+ reasoning, rather than being changed silently. Explicit provider options take
346
+ precedence over shared reasoning defaults.
347
+
348
+ GPT-6 Sol and GPT-6 Luna are included in the language model catalog. Sale prices
349
+ are not bundled into the SDK; use the current prices published by the selected
350
+ Nexra environment:
351
+
352
+ ```ts
353
+ const { prices } = await nexra.catalog.listPrices();
354
+ const gpt6Prices = prices.filter(({ modelId }) =>
355
+ modelId === "openai/gpt-6-sol" || modelId === "openai/gpt-6-luna"
356
+ );
357
+ ```
358
+
37
359
  ## Directory layout
38
360
 
39
361
  ```
@@ -42,7 +364,8 @@ src/
42
364
  catalog/
43
365
  index.ts CatalogClient, getModelSpec, listModelSpecs
44
366
  generated/ Generated artifacts (committed; required to publish)
45
- image.generated.json One file per model kind (image, video, audio, ...)
367
+ image.generated.json Image model specs
368
+ language.generated.json Text/language model specs
46
369
  index.ts Imports every kind JSON and exports the merged array
47
370
  generated/
48
371
  version.generated.ts SDK_VERSION used by the transport
@@ -52,12 +375,11 @@ scripts/
52
375
  src/catalog/generated/*
53
376
  ```
54
377
 
55
- ### Adding a new public model
378
+ ### Adding a model spec
56
379
 
57
- 1. Add its ID to `PUBLIC_MODEL_IDS` in `scripts/generate-public-catalog.ts`.
380
+ 1. Add its ID to `SDK_MODEL_IDS` in `scripts/generate-public-catalog.ts`.
58
381
  2. Run `bun run generate` (from `packages/sdk`).
59
382
  3. The script groups projected models by `model.kind`, writes one
60
383
  `src/catalog/generated/<kind>.generated.json` per kind (new kinds appear
61
384
  automatically), regenerates the merging `index.ts`, and bumps
62
385
  `src/generated/version.generated.ts`. No hand-written code changes.
63
-
@@ -0,0 +1,61 @@
1
+ import { a as JsonObject } from './json-Cz0MkWQn.js';
2
+
3
+ declare const MEDIA_KINDS: readonly ["image", "video", "audio", "document", "archive", "other"];
4
+ type MediaKind = (typeof MEDIA_KINDS)[number];
5
+ type MediaAssetStatus = "pending" | "ready" | "failed" | "deleted";
6
+ interface MediaAsset {
7
+ id: string;
8
+ kind: MediaKind;
9
+ status: MediaAssetStatus;
10
+ source: "upload" | "generated" | "provider" | "imported";
11
+ name?: string;
12
+ mimeType?: string;
13
+ sizeBytes?: number;
14
+ width?: number;
15
+ height?: number;
16
+ durationMs?: number;
17
+ checksumSha256?: string;
18
+ url?: string;
19
+ downloadUrl?: string;
20
+ expiresAt?: string;
21
+ metadata?: JsonObject;
22
+ createdAt: string;
23
+ }
24
+ interface AssetReference {
25
+ assetId: string;
26
+ }
27
+ type AssetInput = AssetReference | Blob | File | MediaAsset | string | URL;
28
+ interface AssetUploadOptions {
29
+ kind?: MediaKind;
30
+ name?: string;
31
+ signal?: AbortSignal;
32
+ }
33
+ interface AssetImportRequest {
34
+ url: string;
35
+ kind?: MediaKind;
36
+ name?: string;
37
+ }
38
+ type AssetCertificationProvider = "seedance";
39
+ type AssetCertificationStatus = "processing" | "ready" | "failed";
40
+ interface AssetCertification {
41
+ assetId: string;
42
+ provider: AssetCertificationProvider;
43
+ status: AssetCertificationStatus;
44
+ providerAssetId?: string;
45
+ assetUri?: string;
46
+ groupId?: string;
47
+ library: "general" | "liveness";
48
+ error?: string;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ }
52
+ interface AssetCertificationRequest {
53
+ library?: "general" | "liveness";
54
+ }
55
+ interface AssetCertificationWaitOptions {
56
+ pollIntervalMs?: number;
57
+ timeoutMs?: number;
58
+ signal?: AbortSignal;
59
+ }
60
+
61
+ export { type AssetImportRequest as A, MEDIA_KINDS as M, type AssetInput as a, type AssetReference as b, type AssetUploadOptions as c, type MediaAsset as d, type MediaAssetStatus as e, type MediaKind as f, type AssetCertificationRequest as g, type AssetCertification as h, type AssetCertificationWaitOptions as i };
package/dist/catalog.d.ts CHANGED
@@ -1 +1,47 @@
1
- export { d as CatalogClient, h as CreateNexraQuoteRequest, u as NexraBillingCurrency, v as NexraModelOperation, w as NexraModelSpec, x as NexraModelSpecFilter, y as NexraQuote, z as NexraSalePrice, N as NexraSettlement, R as getModelSpec, V as listModelSpecs } from './index-mytCeh5t.js';
1
+ import { a as JsonObject } from './json-Cz0MkWQn.js';
2
+ import { H as HttpTransport, A as NexraCatalogChangeParams, B as NexraCatalogChangePage, D as NexraCatalogModelState, u as NexraSalePriceList, d as CreateNexraQuoteRequest, s as NexraQuote, C as CreateNexraDisplayQuoteBatchRequest, n as NexraDisplayQuoteBatch, m as NexraCatalogRevision, q as NexraModelSpec, E as NexraModelEndpointSpec, r as NexraModelSpecFilter } from './media-geometry-YD9Y_CFw.js';
3
+ export { e as MediaGeometryField, f as MediaGeometryProjection, l as NexraBillingCurrency, G as NexraCatalogModelIdentity, p as NexraModelOperation, t as NexraSalePrice, v as NexraSettlement, U as UnifiedMediaGeometry, w as applyMediaGeometry, x as decodeMediaGeometry, y as encodeMediaGeometry, z as projectMediaGeometry } from './media-geometry-YD9Y_CFw.js';
4
+
5
+ declare function formatModelDisplayName(displayName: string, identity?: {
6
+ modelId: string;
7
+ }): string;
8
+
9
+ declare class CatalogClient {
10
+ private readonly transport;
11
+ constructor(transport: HttpTransport);
12
+ changes(params?: NexraCatalogChangeParams, signal?: AbortSignal): Promise<NexraCatalogChangePage>;
13
+ model(modelId: string, operation: string, signal?: AbortSignal): Promise<NexraCatalogModelState>;
14
+ events(options?: {
15
+ after?: string;
16
+ signal?: AbortSignal;
17
+ }): AsyncGenerator<NexraCatalogChangePage>;
18
+ listPrices(signal?: AbortSignal): Promise<NexraSalePriceList>;
19
+ quote(request: CreateNexraQuoteRequest, signal?: AbortSignal): Promise<NexraQuote>;
20
+ quoteBatch(request: CreateNexraDisplayQuoteBatchRequest, signal?: AbortSignal): Promise<NexraDisplayQuoteBatch>;
21
+ revision(signal?: AbortSignal): Promise<NexraCatalogRevision>;
22
+ }
23
+ declare function getModelSpec(modelId: string): NexraModelSpec | undefined;
24
+ declare function listModelSpecs(filter?: NexraModelSpecFilter): readonly NexraModelSpec[];
25
+ type NexraLanguageProtocol = "gemini-generate-content" | "openai-responses" | "openai-chat-completions" | "anthropic-messages";
26
+ type NexraLanguageModelBinding = Readonly<{
27
+ spec: NexraModelSpec;
28
+ endpoint: NexraModelEndpointSpec & {
29
+ protocol: NexraLanguageProtocol;
30
+ };
31
+ supportsStreaming: boolean;
32
+ maxOutputTokens?: number;
33
+ }>;
34
+ declare function getLanguageModelBinding(modelId: string, options?: {
35
+ protocol?: NexraLanguageProtocol;
36
+ stream?: boolean;
37
+ }): NexraLanguageModelBinding;
38
+ type NexraLanguageReasoning = Readonly<{
39
+ providerOptions: Record<string, JsonObject>;
40
+ canDisable: boolean;
41
+ }>;
42
+ declare function resolveNexraLanguageReasoning(modelId: string, options: {
43
+ enabled: boolean;
44
+ protocol?: NexraLanguageProtocol;
45
+ }): NexraLanguageReasoning;
46
+
47
+ export { CatalogClient, CreateNexraDisplayQuoteBatchRequest, CreateNexraQuoteRequest, NexraCatalogChangePage, NexraCatalogChangeParams, NexraCatalogModelState, NexraCatalogRevision, NexraDisplayQuoteBatch, type NexraLanguageModelBinding, type NexraLanguageProtocol, type NexraLanguageReasoning, NexraModelEndpointSpec, NexraModelSpec, NexraModelSpecFilter, NexraQuote, NexraSalePriceList, formatModelDisplayName, getLanguageModelBinding, getModelSpec, listModelSpecs, resolveNexraLanguageReasoning };
package/dist/catalog.js CHANGED
@@ -1,10 +1,25 @@
1
1
  import {
2
2
  CatalogClient,
3
+ applyMediaGeometry,
4
+ decodeMediaGeometry,
5
+ encodeMediaGeometry,
6
+ formatModelDisplayName,
7
+ getLanguageModelBinding,
3
8
  getModelSpec,
4
- listModelSpecs
5
- } from "./chunk-AV3GN4TV.js";
9
+ listModelSpecs,
10
+ projectMediaGeometry,
11
+ resolveNexraLanguageReasoning
12
+ } from "./chunk-Q4A3HJBX.js";
13
+ import "./chunk-SIBYK5IX.js";
6
14
  export {
7
15
  CatalogClient,
16
+ applyMediaGeometry,
17
+ decodeMediaGeometry,
18
+ encodeMediaGeometry,
19
+ formatModelDisplayName,
20
+ getLanguageModelBinding,
8
21
  getModelSpec,
9
- listModelSpecs
22
+ listModelSpecs,
23
+ projectMediaGeometry,
24
+ resolveNexraLanguageReasoning
10
25
  };