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

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