@nodaro/sdk 1.24.0 → 1.26.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, ConnectedReference, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
2
- export { AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, CloneListingResult, CommunityCard, CommunityEntityType, CommunityReportReason, CommunitySort, ConnectedReference, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, FavoriteListingResult, GenericEdge, GenericNode, InvitationDelivery, InvitationPreview, InvitationState, InvitationView, JoinCodeView, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, MeOrganizations, MemberStatus, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, OrgAuditEntry, OrgErrorCode, OrgKind, OrgMemberView, OrgPage, OrgRole, OrgSettings, OrgStatus, OrganizationSummary, OrganizationView, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PipelineStageName, PromptAffixFields, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WORKSPACE_HEADER, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, WorkspaceMemberView, WorkspaceRole, WorkspaceSettings, WorkspaceSummary, WorkspaceView } from '@nodaro/shared';
1
+ import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, ConnectedReference, ModelInputAdjustment, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, UsageQuery, UsageReport, UsageLogEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
2
+ export { AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, CloneListingResult, CommunityCard, CommunityEntityType, CommunityReportReason, CommunitySort, ConnectedReference, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, FavoriteListingResult, GenericEdge, GenericNode, InvitationDelivery, InvitationPreview, InvitationState, InvitationView, JoinCodeView, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, MeOrganizations, MemberStatus, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, OrgAuditEntry, OrgErrorCode, OrgKind, OrgMemberView, OrgPage, OrgRole, OrgSettings, OrgStatus, OrganizationSummary, OrganizationView, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PipelineStageName, PromptAffixFields, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, USAGE_GROUP_BYS, UsageGroupBy, UsageLogEntry, UsageQuery, UsageReport, UsageReportRow, UsageReportTotals, UsageVarianceRow, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WORKSPACE_HEADER, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, WorkspaceMemberView, WorkspaceRole, WorkspaceSettings, WorkspaceSummary, WorkspaceView } from '@nodaro/shared';
3
3
  import { PersonValue, WizardNodeContext, WizardQuestion, WizardSelection, RecommendedModel, FactoryPreset } from '@nodaro/prompts';
4
4
  export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PersonValue, RecommendedModel, WizardNodeContext, WizardOption, WizardQuestion, WizardSelection, buildPersonHints } from '@nodaro/prompts';
5
5
 
@@ -222,10 +222,17 @@ declare class WorkflowsResource {
222
222
  }>;
223
223
  /**
224
224
  * Import a `WorkflowExport` bundle into the specified project.
225
- * Re-creates any bundled assets (characters, objects, locations) under your account.
225
+ * Re-creates any bundled assets (characters, objects, creatures, locations)
226
+ * under your account, and re-points BOTH the entity nodes and every `@`-chip
227
+ * (`ConnectedReference`) bound in the graph at the rows it created.
226
228
  * Media the bundle references on other hosts is copied onto this instance's
227
- * storage where reachable; `importReport` says what was copied, what could
228
- * not be reached, and what was skipped (and why).
229
+ * storage where reachable; a bundled entity's images are copied whoever
230
+ * hosts them, because they are the exporter's bytes and their lifecycle is
231
+ * not yours. `importReport` says what was copied, what could not be reached
232
+ * and what was skipped (and why); `assetIdMap` maps each bundled entity id
233
+ * to the row created for it (for chips you hold outside the graph), and
234
+ * `assetsSkipped` names the entities your storage quota left uncreated —
235
+ * the workflow itself still lands.
229
236
  */
230
237
  import(input: WorkflowExport & {
231
238
  projectId: string;
@@ -347,6 +354,22 @@ interface CancelJobResult {
347
354
  success: true;
348
355
  cancelled: number;
349
356
  }
357
+ interface ListJobsParams {
358
+ /** Exact match on `input_data.type` — the route that created the job
359
+ * (`"llm-structured"`, `"video-analysis"`, …). */
360
+ type?: string;
361
+ /** Exact match on `input_data.origin` — the client app that sent it. */
362
+ origin?: string;
363
+ /** Page size, 1–100 (server default 50). */
364
+ limit?: number;
365
+ /** The previous page's `next`. */
366
+ cursor?: string;
367
+ }
368
+ interface ListJobsPage {
369
+ data: Job[];
370
+ /** Pass back as `cursor` for the next page; `null` on the last one. */
371
+ next: string | null;
372
+ }
350
373
  /**
351
374
  * Lean job status returned by `GET /v1/jobs/:id/status`. Skips the
352
375
  * `input_data` JSONB and cost/timestamp columns. Its `output_data` still goes
@@ -367,6 +390,12 @@ declare class JobsResource {
367
390
  get(id: string): Promise<{
368
391
  data: Job;
369
392
  }>;
393
+ /**
394
+ * Your jobs, newest first (`GET /v1/jobs`), cursor-paginated. `type` and
395
+ * `origin` filter on the job's own `input_data`, which every job carries —
396
+ * a client app lists its runs with `{ type: "llm-structured", origin: "studio" }`.
397
+ */
398
+ list(params?: ListJobsParams): Promise<ListJobsPage>;
370
399
  /**
371
400
  * Get the lean status of a single job (poll-loop friendly).
372
401
  * Hits `GET /v1/jobs/:id/status` — returns only id/status/progress/
@@ -584,9 +613,22 @@ interface NodeDescriptor {
584
613
  * result body. The shape is route-specific; consumers should branch on the
585
614
  * presence of `jobId`.
586
615
  */
616
+ /**
617
+ * One parameter the server corrected because the chosen model does not accept
618
+ * the value you sent (e.g. `gpt-image-2` has no 3:2 aspect ratio). The run
619
+ * proceeds with the corrected value rather than failing — this is how you find
620
+ * out what it actually used.
621
+ *
622
+ * Re-exports `@nodaro/shared`'s `ModelInputAdjustment` — the same shape the
623
+ * server's `normalizeModelInput` / `resolveNormalizedImageGen` populate — under
624
+ * the SDK's naming convention, rather than declaring a second copy of the
625
+ * fields.
626
+ */
627
+ type RunNodeAdjustment = ModelInputAdjustment;
587
628
  type RunNodeResult = {
588
629
  jobId: string;
589
630
  usageLogId?: string;
631
+ adjustments?: RunNodeAdjustment[];
590
632
  [k: string]: unknown;
591
633
  } | Record<string, unknown>;
592
634
  /**
@@ -3821,6 +3863,18 @@ declare class VoicesResource {
3821
3863
  type VoiceChangerProVoice = string | {
3822
3864
  /** Target voice — premade name (`"Rachel"`, `"Aria"`, …) or an ElevenLabs UUID for a custom clone. */
3823
3865
  voiceId: string;
3866
+ /**
3867
+ * Which lane converts this speaker. `"sts"` (default) is the classic
3868
+ * speech-to-speech recast; `"v3"` is RE-SPEAK — the performance is
3869
+ * REGENERATED from the transcript with eleven_v3 (supports `[audio
3870
+ * tags]`; original delivery is replaced, and lips won't match on video).
3871
+ * A v3 speaker needs transcript text: pass an `analysis` whose
3872
+ * `segments[].text` carries it (analyze now emits this), or omit
3873
+ * `analysis` and the engine re-speaks from its own transcription. For
3874
+ * `"v3"`, `stability` accepts exactly 0 / 0.5 / 1, and
3875
+ * `similarityBoost` / `style` / `useSpeakerBoost` are ignored.
3876
+ */
3877
+ engine?: "sts" | "v3";
3824
3878
  /** ElevenLabs stability (0–1). Higher = steadier, lower = more expressive. */
3825
3879
  stability?: number;
3826
3880
  /** ElevenLabs similarity boost (0–1) — how closely the output hugs the target voice's timbre. */
@@ -3923,10 +3977,13 @@ interface VoiceChangerProInput {
3923
3977
  interface VcpAnalysisSpeaker {
3924
3978
  /** Stable speaker id (first-appearance order). */
3925
3979
  id: string;
3926
- /** The speaker's spoken time ranges (seconds). */
3980
+ /** The speaker's spoken time ranges (seconds). `text` is what was said in
3981
+ * the range — the paid input for a speaker recast with `engine: "v3"`
3982
+ * (editable before conversion); the STS lane ignores it. */
3927
3983
  segments: Array<{
3928
3984
  start: number;
3929
3985
  end: number;
3986
+ text?: string;
3930
3987
  }>;
3931
3988
  /** When the speaker first speaks (seconds). */
3932
3989
  firstStartSec?: number;
@@ -4022,20 +4079,122 @@ interface VoiceRemixInput {
4022
4079
  /** Optional extra prompt context (≤8000 chars). */
4023
4080
  userPrompt?: string;
4024
4081
  }
4025
- /** Input for {@link VoicesResource.dub}. */
4082
+ /** Input for {@link VoicesResource.dub}. Provide exactly ONE source:
4083
+ * `audioUrl` (dubbed audio out), `videoUrl` (the dubbed VIDEO out, plus the
4084
+ * dubbed audio track as `output_data.audioUrl`), or `sourceUrl` (a public
4085
+ * YouTube/TikTok/direct link ElevenLabs fetches itself). Priced per minute
4086
+ * of the dubbed span; the span is capped at 30 minutes — use
4087
+ * `startTime`/`endTime` to dub part of a longer source. */
4026
4088
  interface DubbingInput {
4027
- /** URL of the audio to dub. */
4028
- audioUrl: string;
4089
+ /** URL of the audio to dub (audio mode). */
4090
+ audioUrl?: string;
4091
+ /** URL of the video to dub — the result is the dubbed VIDEO (+ audio track). */
4092
+ videoUrl?: string;
4093
+ /** Public page/media URL (YouTube, TikTok, or a direct link) — ElevenLabs fetches it directly. */
4094
+ sourceUrl?: string;
4029
4095
  /** Target language ISO code (2–10 chars), e.g. `"es"`, `"pt-BR"`. */
4030
4096
  targetLanguage: string;
4031
4097
  /** Source language ISO code; auto-detected when omitted. */
4032
4098
  sourceLanguage?: string;
4033
- /** Expected number of speakers (1–20) — improves separation when known. */
4099
+ /** Expected number of speakers (1–20; 0 = auto-detect) — improves separation when known. */
4034
4100
  numSpeakers?: number;
4035
4101
  /** Keep the original voices instead of cloning them into the target language. */
4036
4102
  disableVoiceCloning?: boolean;
4037
4103
  /** Drop the background/music bed from the dubbed output. */
4038
4104
  dropBackgroundAudio?: boolean;
4105
+ /** Dub only this window of the source (seconds). */
4106
+ startTime?: number;
4107
+ endTime?: number;
4108
+ /** Keep the source resolution on video dubs (slower render). */
4109
+ highestResolution?: boolean;
4110
+ useProfanityFilter?: boolean;
4111
+ /** Experimental: steer dubbed voices toward an accent. */
4112
+ targetAccent?: string;
4113
+ /** Apply ElevenLabs' own watermark to video dubs. */
4114
+ watermark?: boolean;
4115
+ }
4116
+
4117
+ /**
4118
+ * Structured LLM output — `POST /v1/llm/structured` and its asynchronous
4119
+ * twin. The platform supplies the model lane, forced JSON-Schema output with
4120
+ * validation and error-fed retries, the job row and the credit lifecycle; the
4121
+ * caller supplies its own system prompt and schema (an app-owned vocabulary
4122
+ * the platform cannot know — Nodaro Studio's production plan is the first).
4123
+ */
4124
+ interface LlmStructuredInput {
4125
+ /** The system prompt (≤ 100,000 chars). */
4126
+ system: string;
4127
+ /** The user turn (1–100,000 chars). */
4128
+ input: string;
4129
+ /** A JSON Schema OBJECT (`type: "object"`, ≤ 64 KB, ≤ 20 levels) in the
4130
+ * keyword subset the server converts — see the API guide. */
4131
+ jsonSchema: Record<string, unknown>;
4132
+ /** Names the forced-output tool the provider sees (≤ 64 chars). */
4133
+ schemaName?: string;
4134
+ llmModel?: string;
4135
+ reasoningEffort?: string;
4136
+ /** Invalid answers fed back with their error before the call fails (0–3, default 2). */
4137
+ maxRetries?: number;
4138
+ /** Your app's slug — attribution only; `jobs.list({ origin })` finds the rows. */
4139
+ origin?: string;
4140
+ advancedMode?: boolean;
4141
+ temperature?: number;
4142
+ maxTokens?: number;
4143
+ }
4144
+ interface LlmStructuredResult<T = unknown> {
4145
+ jobId: string;
4146
+ output: T;
4147
+ usage: {
4148
+ inputTokens: number;
4149
+ outputTokens: number;
4150
+ };
4151
+ }
4152
+ interface LlmStructuredJobInput extends LlmStructuredInput {
4153
+ /** Display label stored on the job (≤ 120 chars) — a run list's row title. */
4154
+ label?: string;
4155
+ /** Draft FROM this video: the platform analyzes it first (`POST
4156
+ * /v1/video-analysis`, a separate job you own) and appends the analysis
4157
+ * to `input` before the LLM call. */
4158
+ videoUrl?: string;
4159
+ /** Analysis options, handed to the analysis route unchanged (its tiers). */
4160
+ videoAnalysis?: {
4161
+ llmModel?: string;
4162
+ selectionMode?: "choose" | "combine";
4163
+ };
4164
+ }
4165
+ /** `output_data` of an `llm-structured` job as it progresses: `stage` while
4166
+ * running (`analyzing` only for movie runs), then the result. */
4167
+ interface LlmStructuredJobOutput<T = unknown> {
4168
+ stage?: "analyzing" | "drafting";
4169
+ output?: T;
4170
+ inputTokens?: number;
4171
+ outputTokens?: number;
4172
+ analysisJobId?: string;
4173
+ analysisCredits?: number;
4174
+ }
4175
+ declare class LlmResource {
4176
+ private client;
4177
+ constructor(client: NodaroClient);
4178
+ /**
4179
+ * Synchronous forced-schema completion (`POST /v1/llm/structured`). A call
4180
+ * can run several minutes — longer than the client's default 60 s
4181
+ * `timeoutMs`; construct the client with a larger `timeoutMs` for this
4182
+ * call, or use {@link LlmResource.structuredJob}.
4183
+ */
4184
+ structured<T = unknown>(input: LlmStructuredInput): Promise<LlmStructuredResult<T>>;
4185
+ /**
4186
+ * The same call as a job (`POST /v1/llm/structured/jobs`): answers `{ jobId }`
4187
+ * at once. Poll `jobs.getStatus(jobId)` — `output_data` is an
4188
+ * {@link LlmStructuredJobOutput}; `error_message` says why a run failed.
4189
+ * `jobs.list({ type: "llm-structured", origin })` finds every run later.
4190
+ * Throws `NotFoundError` on a platform that predates the route. An instance
4191
+ * that proxies its LLM calls to nodaro.ai answers `503 provider_unavailable`
4192
+ * permanently — the SDK surfaces that as a generic `NodaroError` with the
4193
+ * same code; treat it as unavailable here, not as transient.
4194
+ */
4195
+ structuredJob(input: LlmStructuredJobInput): Promise<{
4196
+ jobId: string;
4197
+ }>;
4039
4198
  }
4040
4199
 
4041
4200
  /**
@@ -4210,6 +4369,16 @@ declare class MediaResource {
4210
4369
  videoMetadata(input: {
4211
4370
  url: string;
4212
4371
  }): Promise<VideoMetadata>;
4372
+ /**
4373
+ * Cut or crop a stored file (`POST /v1/media/process`) — synchronous and
4374
+ * free, the source-preparation sibling of the priced `trimVideo` node.
4375
+ * `trim` is `[startTime, endTime]` in seconds; `deleteSource: true` removes
4376
+ * the source object afterwards when it is yours and nothing else references
4377
+ * it ("the cut replaces the original"). Answers the stored file.
4378
+ */
4379
+ process(input: MediaProcessInput): Promise<{
4380
+ data: MediaProcessResult;
4381
+ }>;
4213
4382
  }
4214
4383
  /**
4215
4384
  * One event from {@link MediaResource.downloadVideoProgress}. The stream ends
@@ -4236,6 +4405,30 @@ interface VideoMetadata {
4236
4405
  isLive?: boolean;
4237
4406
  [key: string]: unknown;
4238
4407
  }
4408
+ interface MediaProcessInput {
4409
+ sourceUrl: string;
4410
+ type: "video" | "audio";
4411
+ trim?: {
4412
+ startTime: number;
4413
+ endTime: number;
4414
+ };
4415
+ crop?: {
4416
+ x: number;
4417
+ y: number;
4418
+ width: number;
4419
+ height: number;
4420
+ };
4421
+ format?: "mp4" | "webm" | "mp3" | "wav" | "m4a" | "aac";
4422
+ deleteSource?: boolean;
4423
+ }
4424
+ interface MediaProcessResult {
4425
+ url: string;
4426
+ thumbnailUrl: string | null;
4427
+ assetId: string | null;
4428
+ sizeBytes: number;
4429
+ mimeType: string;
4430
+ metadata: Record<string, unknown>;
4431
+ }
4239
4432
 
4240
4433
  /**
4241
4434
  * Audio primitives — the building blocks Voice Changer Pro composes internally
@@ -5463,6 +5656,20 @@ declare class OrganizationsResource {
5463
5656
  cursor?: string;
5464
5657
  limit?: number;
5465
5658
  }): Promise<OrgPage<OrgAuditEntry>>;
5659
+ /**
5660
+ * Credits by workspace, member, model or day. Owner and org admins only.
5661
+ * Inclusive dates (`from`/`to`), IANA `tz` (default UTC), ≤ 366 days
5662
+ * (default last 30).
5663
+ */
5664
+ usage(orgId: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "groupBy"> & {
5665
+ groupBy?: "workspace" | "member" | "model" | "day";
5666
+ }): Promise<{
5667
+ data: UsageReport;
5668
+ }>;
5669
+ /** The individual runs behind a report, newest first, cursor-paged. */
5670
+ usageRows(orgId: string, opts?: Omit<UsageQuery, "groupBy">): Promise<OrgPage<UsageLogEntry>>;
5671
+ /** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
5672
+ usageCsv(orgId: string, opts?: Omit<UsageQuery, "cursor" | "limit">): Promise<string>;
5466
5673
  }
5467
5674
 
5468
5675
  /**
@@ -5567,6 +5774,21 @@ declare class WorkspacesResource {
5567
5774
  workspaceId: string;
5568
5775
  };
5569
5776
  }>;
5777
+ /**
5778
+ * Credits by member, model or day for this workspace. A plain member sees
5779
+ * their OWN runs (the report is self-narrowed and `groupBy: "member"` is
5780
+ * refused); a workspace admin sees everyone and may filter `userId`.
5781
+ * Inclusive dates, IANA `tz` (default UTC), ≤ 366 days (default last 30).
5782
+ */
5783
+ usage(id: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "workspaceId" | "groupBy"> & {
5784
+ groupBy?: "member" | "model" | "day";
5785
+ }): Promise<{
5786
+ data: UsageReport;
5787
+ }>;
5788
+ /** The individual runs behind a report, newest first, cursor-paged. */
5789
+ usageRows(id: string, opts?: Omit<UsageQuery, "groupBy" | "workspaceId">): Promise<OrgPage<UsageLogEntry>>;
5790
+ /** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
5791
+ usageCsv(id: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "workspaceId">): Promise<string>;
5570
5792
  }
5571
5793
 
5572
5794
  interface ClientOptions {
@@ -5662,6 +5884,7 @@ declare class NodaroClient {
5662
5884
  readonly reduce: ReduceResource;
5663
5885
  readonly promptHelper: PromptHelperResource;
5664
5886
  readonly voices: VoicesResource;
5887
+ readonly llm: LlmResource;
5665
5888
  readonly media: MediaResource;
5666
5889
  readonly audio: AudioResource;
5667
5890
  readonly credits: CreditsResource;
@@ -5693,7 +5916,21 @@ declare class NodaroClient {
5693
5916
  * Pass `null` for the personal space.
5694
5917
  */
5695
5918
  withWorkspace(workspaceId: string | null): NodaroClient;
5919
+ /**
5920
+ * The transport: build the request, send it, throw the typed error on a
5921
+ * non-2xx via {@link throwFromResponse}, then read the body via `read` — all
5922
+ * inside the abort timer, so `timeoutMs` bounds the body download too (a
5923
+ * stalled CSV stream aborts, it does not hang forever). Both the JSON path
5924
+ * ({@link request}) and the text path ({@link requestText}) go through here.
5925
+ */
5926
+ private send;
5696
5927
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
5928
+ /**
5929
+ * Like {@link request}, for endpoints that answer text (CSV exports). Errors
5930
+ * are still the JSON envelope and throw the same typed errors, and the read is
5931
+ * bounded by the same timeout as the request.
5932
+ */
5933
+ requestText(method: string, path: string, options?: RequestOptions): Promise<string>;
5697
5934
  /**
5698
5935
  * `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
5699
5936
  * Unwraps the `{ data }` envelope. Throws `UnauthorizedError` (401) when the
@@ -5801,4 +6038,4 @@ interface ApiErrorBody {
5801
6038
  }
5802
6039
  declare function throwFromResponse(status: number, body: ApiErrorBody): never;
5803
6040
 
5804
- export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, CreditsResource, type DeleteAppRunResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type ResolveRecastGateInput, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
6041
+ export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, CreditsResource, type DeleteAppRunResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListJobsPage, type ListJobsParams, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListWorkflowsParams, LlmResource, type LlmStructuredInput, type LlmStructuredJobInput, type LlmStructuredJobOutput, type LlmStructuredResult, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, type MediaProcessInput, type MediaProcessResult, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type ResolveRecastGateInput, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeAdjustment, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { buildPersonHints } from '@nodaro/prompts';
2
2
  export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, buildPersonHints } from '@nodaro/prompts';
3
3
  import { WORKSPACE_HEADER } from '@nodaro/shared';
4
- export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, SURROUND_DIRECTIONS, WORKSPACE_HEADER } from '@nodaro/shared';
4
+ export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, SURROUND_DIRECTIONS, USAGE_GROUP_BYS, WORKSPACE_HEADER } from '@nodaro/shared';
5
5
 
6
6
  // src/errors.ts
7
7
  var NodaroError = class extends Error {
@@ -238,10 +238,17 @@ var WorkflowsResource = class {
238
238
  }
239
239
  /**
240
240
  * Import a `WorkflowExport` bundle into the specified project.
241
- * Re-creates any bundled assets (characters, objects, locations) under your account.
241
+ * Re-creates any bundled assets (characters, objects, creatures, locations)
242
+ * under your account, and re-points BOTH the entity nodes and every `@`-chip
243
+ * (`ConnectedReference`) bound in the graph at the rows it created.
242
244
  * Media the bundle references on other hosts is copied onto this instance's
243
- * storage where reachable; `importReport` says what was copied, what could
244
- * not be reached, and what was skipped (and why).
245
+ * storage where reachable; a bundled entity's images are copied whoever
246
+ * hosts them, because they are the exporter's bytes and their lifecycle is
247
+ * not yours. `importReport` says what was copied, what could not be reached
248
+ * and what was skipped (and why); `assetIdMap` maps each bundled entity id
249
+ * to the row created for it (for chips you hold outside the graph), and
250
+ * `assetsSkipped` names the entities your storage quota left uncreated —
251
+ * the workflow itself still lands.
245
252
  */
246
253
  import(input) {
247
254
  const { projectId, ...workflowJson } = input;
@@ -324,6 +331,14 @@ var JobsResource = class {
324
331
  get(id) {
325
332
  return this.client.request("GET", `/v1/jobs/${encodeURIComponent(id)}`);
326
333
  }
334
+ /**
335
+ * Your jobs, newest first (`GET /v1/jobs`), cursor-paginated. `type` and
336
+ * `origin` filter on the job's own `input_data`, which every job carries —
337
+ * a client app lists its runs with `{ type: "llm-structured", origin: "studio" }`.
338
+ */
339
+ list(params = {}) {
340
+ return this.client.request("GET", "/v1/jobs", { query: { ...params } });
341
+ }
327
342
  /**
328
343
  * Get the lean status of a single job (poll-loop friendly).
329
344
  * Hits `GET /v1/jobs/:id/status` — returns only id/status/progress/
@@ -1786,6 +1801,36 @@ var VoicesResource = class {
1786
1801
  }
1787
1802
  };
1788
1803
 
1804
+ // src/resources/llm.ts
1805
+ var LlmResource = class {
1806
+ constructor(client) {
1807
+ this.client = client;
1808
+ }
1809
+ client;
1810
+ /**
1811
+ * Synchronous forced-schema completion (`POST /v1/llm/structured`). A call
1812
+ * can run several minutes — longer than the client's default 60 s
1813
+ * `timeoutMs`; construct the client with a larger `timeoutMs` for this
1814
+ * call, or use {@link LlmResource.structuredJob}.
1815
+ */
1816
+ structured(input) {
1817
+ return this.client.request("POST", "/v1/llm/structured", { body: input });
1818
+ }
1819
+ /**
1820
+ * The same call as a job (`POST /v1/llm/structured/jobs`): answers `{ jobId }`
1821
+ * at once. Poll `jobs.getStatus(jobId)` — `output_data` is an
1822
+ * {@link LlmStructuredJobOutput}; `error_message` says why a run failed.
1823
+ * `jobs.list({ type: "llm-structured", origin })` finds every run later.
1824
+ * Throws `NotFoundError` on a platform that predates the route. An instance
1825
+ * that proxies its LLM calls to nodaro.ai answers `503 provider_unavailable`
1826
+ * permanently — the SDK surfaces that as a generic `NodaroError` with the
1827
+ * same code; treat it as unavailable here, not as transient.
1828
+ */
1829
+ structuredJob(input) {
1830
+ return this.client.request("POST", "/v1/llm/structured/jobs", { body: input });
1831
+ }
1832
+ };
1833
+
1789
1834
  // src/resources/media.ts
1790
1835
  var MediaResource = class {
1791
1836
  constructor(client) {
@@ -1935,6 +1980,16 @@ var MediaResource = class {
1935
1980
  videoMetadata(input) {
1936
1981
  return this.client.request("POST", "/v1/video-metadata", { body: input });
1937
1982
  }
1983
+ /**
1984
+ * Cut or crop a stored file (`POST /v1/media/process`) — synchronous and
1985
+ * free, the source-preparation sibling of the priced `trimVideo` node.
1986
+ * `trim` is `[startTime, endTime]` in seconds; `deleteSource: true` removes
1987
+ * the source object afterwards when it is yours and nothing else references
1988
+ * it ("the cut replaces the original"). Answers the stored file.
1989
+ */
1990
+ process(input) {
1991
+ return this.client.request("POST", "/v1/media/process", { body: input });
1992
+ }
1938
1993
  };
1939
1994
 
1940
1995
  // src/resources/audio.ts
@@ -2536,6 +2591,23 @@ var OrganizationsResource = class {
2536
2591
  audit(orgId, opts = {}) {
2537
2592
  return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/audit`, { query: { ...opts } });
2538
2593
  }
2594
+ // -- usage ----------------------------------------------------------------
2595
+ /**
2596
+ * Credits by workspace, member, model or day. Owner and org admins only.
2597
+ * Inclusive dates (`from`/`to`), IANA `tz` (default UTC), ≤ 366 days
2598
+ * (default last 30).
2599
+ */
2600
+ usage(orgId, opts = {}) {
2601
+ return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts } });
2602
+ }
2603
+ /** The individual runs behind a report, newest first, cursor-paged. */
2604
+ usageRows(orgId, opts = {}) {
2605
+ return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts, groupBy: "none" } });
2606
+ }
2607
+ /** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
2608
+ usageCsv(orgId, opts = {}) {
2609
+ return this.client.requestText("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts, format: "csv" } });
2610
+ }
2539
2611
  };
2540
2612
 
2541
2613
  // src/resources/workspaces.ts
@@ -2627,8 +2699,26 @@ var WorkspacesResource = class {
2627
2699
  join(code) {
2628
2700
  return this.client.request("POST", "/v1/workspaces/join", { body: { code } });
2629
2701
  }
2702
+ // -- usage ----------------------------------------------------------------
2703
+ /**
2704
+ * Credits by member, model or day for this workspace. A plain member sees
2705
+ * their OWN runs (the report is self-narrowed and `groupBy: "member"` is
2706
+ * refused); a workspace admin sees everyone and may filter `userId`.
2707
+ * Inclusive dates, IANA `tz` (default UTC), ≤ 366 days (default last 30).
2708
+ */
2709
+ usage(id, opts = {}) {
2710
+ return this.client.request("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts } });
2711
+ }
2712
+ /** The individual runs behind a report, newest first, cursor-paged. */
2713
+ usageRows(id, opts = {}) {
2714
+ return this.client.request("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, groupBy: "none" } });
2715
+ }
2716
+ /** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
2717
+ usageCsv(id, opts = {}) {
2718
+ return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
2719
+ }
2630
2720
  };
2631
- var SDK_VERSION = "1.24.0" ;
2721
+ var SDK_VERSION = "1.26.0" ;
2632
2722
  var CLIENT_HEADER = "X-Nodaro-Client";
2633
2723
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
2634
2724
  var NodaroClient = class _NodaroClient {
@@ -2666,6 +2756,7 @@ var NodaroClient = class _NodaroClient {
2666
2756
  reduce;
2667
2757
  promptHelper;
2668
2758
  voices;
2759
+ llm;
2669
2760
  media;
2670
2761
  audio;
2671
2762
  credits;
@@ -2709,6 +2800,7 @@ var NodaroClient = class _NodaroClient {
2709
2800
  this.reduce = new ReduceResource(this);
2710
2801
  this.promptHelper = new PromptHelperResource(this);
2711
2802
  this.voices = new VoicesResource(this);
2803
+ this.llm = new LlmResource(this);
2712
2804
  this.media = new MediaResource(this);
2713
2805
  this.audio = new AudioResource(this);
2714
2806
  this.credits = new CreditsResource(this);
@@ -2747,7 +2839,14 @@ var NodaroClient = class _NodaroClient {
2747
2839
  ...workspaceId ? { workspaceId } : {}
2748
2840
  });
2749
2841
  }
2750
- async request(method, path, options = {}) {
2842
+ /**
2843
+ * The transport: build the request, send it, throw the typed error on a
2844
+ * non-2xx via {@link throwFromResponse}, then read the body via `read` — all
2845
+ * inside the abort timer, so `timeoutMs` bounds the body download too (a
2846
+ * stalled CSV stream aborts, it does not hang forever). Both the JSON path
2847
+ * ({@link request}) and the text path ({@link requestText}) go through here.
2848
+ */
2849
+ async send(method, path, options, read) {
2751
2850
  const url = this.buildUrl(path, options.query);
2752
2851
  const token = await this.auth.getToken();
2753
2852
  const isFormData = typeof FormData !== "undefined" && options.body instanceof FormData;
@@ -2780,12 +2879,30 @@ var NodaroClient = class _NodaroClient {
2780
2879
  }
2781
2880
  throwFromResponse(res.status, errBody);
2782
2881
  }
2783
- if (res.status === 204) return void 0;
2784
- return await res.json();
2882
+ return await read(res);
2785
2883
  } finally {
2786
2884
  clearTimeout(timeoutId);
2787
2885
  }
2788
2886
  }
2887
+ async request(method, path, options = {}) {
2888
+ return this.send(
2889
+ method,
2890
+ path,
2891
+ options,
2892
+ async (res) => (
2893
+ // 204 No Content
2894
+ res.status === 204 ? void 0 : await res.json()
2895
+ )
2896
+ );
2897
+ }
2898
+ /**
2899
+ * Like {@link request}, for endpoints that answer text (CSV exports). Errors
2900
+ * are still the JSON envelope and throw the same typed errors, and the read is
2901
+ * bounded by the same timeout as the request.
2902
+ */
2903
+ async requestText(method, path, options = {}) {
2904
+ return this.send(method, path, options, (res) => res.text());
2905
+ }
2789
2906
  /**
2790
2907
  * `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
2791
2908
  * Unwraps the `{ data }` envelope. Throws `UnauthorizedError` (401) when the
@@ -2849,6 +2966,6 @@ function supabaseAuth(supabase) {
2849
2966
  };
2850
2967
  }
2851
2968
 
2852
- export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CatalogsResource, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LocationsResource, MediaResource, ModelsResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, OrganizationsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, RecastResource, ReduceResource, ShotsResource, StaticTokenAuth, StorageExceededError, TemplatesResource, TutorialsResource, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowConflictError, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
2969
+ export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CatalogsResource, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LlmResource, LocationsResource, MediaResource, ModelsResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, OrganizationsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, RecastResource, ReduceResource, ShotsResource, StaticTokenAuth, StorageExceededError, TemplatesResource, TutorialsResource, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowConflictError, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
2853
2970
  //# sourceMappingURL=index.js.map
2854
2971
  //# sourceMappingURL=index.js.map