@nodaro/sdk 1.17.0 → 1.19.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 { GenericNode, GenericEdge, WorkflowExport, 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 } 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, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, PipelineStageName, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject } from '@nodaro/shared';
1
+ import { GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, 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, PipelineStageName, 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';
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
 
@@ -163,11 +163,15 @@ declare class WorkflowsResource {
163
163
  /**
164
164
  * Import a `WorkflowExport` bundle into the specified project.
165
165
  * Re-creates any bundled assets (characters, objects, locations) under your account.
166
+ * Media the bundle references on other hosts is copied onto this instance's
167
+ * storage where reachable; `importReport` says what was copied, what could
168
+ * not be reached, and what was skipped (and why).
166
169
  */
167
170
  import(input: WorkflowExport & {
168
171
  projectId: string;
169
172
  }): Promise<{
170
173
  data: Workflow;
174
+ importReport?: WorkflowImportReport;
171
175
  }>;
172
176
  }
173
177
 
@@ -223,7 +227,8 @@ type JobStatus = "pending" | "queued" | "processing" | "completed" | "failed" |
223
227
  * Sensitive fields stripped server-side for non-admin callers:
224
228
  * `provider`, `provider_cost`, `display_cost`, `credits_actual`. USD
225
229
  * pricing is admin-only across api/sdk/mcp — non-admin consumers see
226
- * only the `credits` abstraction.
230
+ * only the `credits` abstraction. Server-only nested job data (including
231
+ * Recast's private remux base) is stripped for every caller, including admins.
227
232
  */
228
233
  interface Job {
229
234
  id: string;
@@ -254,8 +259,9 @@ interface CancelJobResult {
254
259
  }
255
260
  /**
256
261
  * Lean job status returned by `GET /v1/jobs/:id/status`. Skips the
257
- * `input_data` JSONB, cost/timestamp columns, and the public sanitize pass —
258
- * intended for poll loops that only need progress/output/error.
262
+ * `input_data` JSONB and cost/timestamp columns. Its `output_data` still goes
263
+ * through the server-only nested-field redaction. Intended for poll loops that
264
+ * only need progress/output/error.
259
265
  */
260
266
  interface JobStatusResult {
261
267
  id: string;
@@ -3981,6 +3987,54 @@ declare class MediaResource {
3981
3987
  }): Promise<{
3982
3988
  jobId: string;
3983
3989
  }>;
3990
+ /**
3991
+ * Turn one still image + one audio track into an MP4
3992
+ * (`POST /v1/still-to-video`) — locally rendered (FFmpeg), no AI model,
3993
+ * zero credits. The output duration IS the audio's duration; there is no
3994
+ * duration field. Optional `motion` animates the still (zoom / pan /
3995
+ * ken-burns) at `intensity` 1–10. `fit: "contain"` letterboxes with
3996
+ * `padColor` instead of cropping. Poll `jobs.get(jobId)`.
3997
+ */
3998
+ stillToVideo(input: {
3999
+ imageUrl: string;
4000
+ audioUrl: string;
4001
+ motion?: "none" | "zoom-in" | "zoom-out" | "pan-left" | "pan-right" | "ken-burns";
4002
+ intensity?: number;
4003
+ resolution?: "720p" | "1080p" | "4K";
4004
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3";
4005
+ fps?: 24 | 30;
4006
+ fit?: "cover" | "contain";
4007
+ padColor?: string;
4008
+ }): Promise<{
4009
+ jobId: string;
4010
+ }>;
4011
+ /**
4012
+ * Turn 2–100 images + one optional audio track into an MP4 slideshow
4013
+ * (`POST /v1/slideshow`) — locally rendered (FFmpeg), zero credits. With
4014
+ * audio, the output duration IS the audio's duration (equal split unless
4015
+ * `imageDurations` pins rows — null entries = auto; mismatched pinned sums
4016
+ * scale proportionally and the factor is disclosed in the job output).
4017
+ * Without audio: N × `perImageDuration`, silent output. Transitions
4018
+ * consume the outgoing slide, so totals stay exact. For a single image use
4019
+ * `stillToVideo`. Poll `jobs.get(jobId)`.
4020
+ */
4021
+ slideshow(input: {
4022
+ imageUrls: string[];
4023
+ audioUrl?: string;
4024
+ imageDurations?: Array<number | null>;
4025
+ perImageDuration?: number;
4026
+ transition?: string;
4027
+ transitionDuration?: number;
4028
+ motion?: "none" | "zoom-in" | "zoom-out" | "ken-burns" | "alternate";
4029
+ intensity?: number;
4030
+ resolution?: "720p" | "1080p" | "4K";
4031
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3";
4032
+ fps?: 24 | 30;
4033
+ fit?: "cover" | "contain";
4034
+ padColor?: string;
4035
+ }): Promise<{
4036
+ jobId: string;
4037
+ }>;
3984
4038
  /**
3985
4039
  * Probe a social video's metadata (`POST /v1/video-metadata`) — duration,
3986
4040
  * dimensions, title, live status — WITHOUT downloading it. A direct read, not a
@@ -4651,10 +4705,109 @@ interface RecastEstimate {
4651
4705
  breakdown?: Record<string, number>;
4652
4706
  [key: string]: unknown;
4653
4707
  }
4708
+ type RecastAudioLayerName = "music" | "video";
4709
+ interface RecastAudioMixControl {
4710
+ /** Linear gain percentage. The server rounds and clamps this to 0–200. */
4711
+ gain: number;
4712
+ /** A muted lane has an effective wire gain of zero. */
4713
+ muted: boolean;
4714
+ }
4715
+ /** Complete desired controls for the logical lanes addressed by an operation. */
4716
+ interface RecastAudioMix {
4717
+ music?: RecastAudioMixControl;
4718
+ video?: RecastAudioMixControl;
4719
+ }
4720
+ interface RecastAudioManifestV1 {
4721
+ version: 1;
4722
+ /** Opaque server-minted identity of the currently published audio delivery. */
4723
+ revision: string;
4724
+ mode: "bed" | "replace";
4725
+ /** Logical layers in the delivery, including layers whose preview derivative failed. */
4726
+ present: {
4727
+ music?: true;
4728
+ video?: true;
4729
+ };
4730
+ /** Browser-ready, CORS-enabled audio-only derivatives. */
4731
+ layers: {
4732
+ music?: {
4733
+ url: string;
4734
+ };
4735
+ video?: {
4736
+ url: string;
4737
+ };
4738
+ };
4739
+ /** Effective integer gain percentages baked into the current `resultUrl`. */
4740
+ bakedEffectiveGain: {
4741
+ music?: number;
4742
+ video?: number;
4743
+ };
4744
+ /** Present only while a paid audio operation is genuinely live. */
4745
+ pendingRescore?: {
4746
+ jobId: string;
4747
+ requestId: string;
4748
+ state: "pending" | "running";
4749
+ expectedAudioRevision: string;
4750
+ requestedEffectiveGain: {
4751
+ music?: number;
4752
+ video?: number;
4753
+ };
4754
+ };
4755
+ }
4756
+ interface RecastAudioSectionReplacement {
4757
+ index: number;
4758
+ brief: string;
4759
+ }
4760
+ /** Exactly one replacement lane may be combined with a mix. */
4761
+ type RecastRescoreReplacement = {
4762
+ audioUrl: string;
4763
+ sections?: never;
4764
+ } | {
4765
+ sections: RecastAudioSectionReplacement[];
4766
+ audioUrl?: never;
4767
+ };
4768
+ type RecastNoReplacement = {
4769
+ audioUrl?: never;
4770
+ sections?: never;
4771
+ };
4772
+ /** A mix, one Music replacement, or a replacement and its complete desired mix. */
4773
+ type RecastRescoreOperation = ({
4774
+ mix: RecastAudioMix;
4775
+ } & (RecastRescoreReplacement | RecastNoReplacement)) | (RecastRescoreReplacement & {
4776
+ mix?: RecastAudioMix;
4777
+ });
4778
+ /** Free quote input. `requestId` is deliberately absent because quoting has no side effects. */
4779
+ type EstimateRecastRescoreInput = RecastRescoreOperation & {
4780
+ expectedAudioRevision: string;
4781
+ };
4782
+ /** Revision-safe paid operation. Reuse `requestId` only for transport retries. */
4783
+ type RecastRescoreRequestV2 = EstimateRecastRescoreInput & {
4784
+ requestId: string;
4785
+ };
4786
+ interface RecastRescoreQuote {
4787
+ credits: number;
4788
+ audioRevision: string;
4789
+ noOp: boolean;
4790
+ }
4791
+ type RecastRescoreResponse = {
4792
+ recastId: string;
4793
+ jobId: string;
4794
+ noOp?: false;
4795
+ } | {
4796
+ recastId: string;
4797
+ noOp: true;
4798
+ audioRevision: string;
4799
+ };
4654
4800
  /** Run snapshot — `status` plus, on interactive runs, the pending step. */
4655
4801
  interface RecastRunSnapshot {
4656
4802
  status: string;
4657
4803
  interactive?: Record<string, unknown>;
4804
+ /** Presence of `audioLayers: 1` opts a client into the revisioned audio contract. */
4805
+ capabilities?: {
4806
+ audioLayers?: 1;
4807
+ [key: string]: unknown;
4808
+ };
4809
+ /** Server-authored manifest for the selected completed take. */
4810
+ audio?: RecastAudioManifestV1;
4658
4811
  [key: string]: unknown;
4659
4812
  }
4660
4813
  interface ResolveRecastGateInput {
@@ -4698,6 +4851,10 @@ declare class RecastResource {
4698
4851
  }>;
4699
4852
  /** Poll the run — status plus any pending interactive step. */
4700
4853
  get(recastId: string): Promise<RecastRunSnapshot>;
4854
+ /** Quote a revisioned Music replacement and/or complete desired mix. Free. */
4855
+ estimateRescore(recastId: string, input: EstimateRecastRescoreInput): Promise<RecastRescoreQuote>;
4856
+ /** Apply a quoted audio operation. Reuse its request id only for a transport retry. */
4857
+ rescore(recastId: string, input: RecastRescoreRequestV2): Promise<RecastRescoreResponse>;
4701
4858
  /** Start rendering a `planned` run. Idempotent server-side. */
4702
4859
  start(recastId: string, opts?: {
4703
4860
  segmentSec?: number;
@@ -4935,6 +5092,254 @@ declare class TutorialsResource {
4935
5092
  }>;
4936
5093
  }
4937
5094
 
5095
+ /**
5096
+ * Organizations, their members, and the invitations that fill them.
5097
+ *
5098
+ * Every shape here comes from `@nodaro/shared` rather than being restated:
5099
+ * the app, the CLI and this SDK all read the same wire, and a shape written
5100
+ * out three times is one that drifts in two of them.
5101
+ *
5102
+ * Nothing in this file decides anything. Whether a caller may invite, remove
5103
+ * or rename is the server's answer, delivered as a typed error code, and an
5104
+ * SDK that guessed would be wrong the first time a setting changed.
5105
+ */
5106
+ interface CreateOrgInput {
5107
+ name: string;
5108
+ kind: OrgKind;
5109
+ /** Derived from the name when omitted; the server resolves collisions. */
5110
+ slug?: string;
5111
+ acceptTerms?: boolean;
5112
+ settings?: OrgSettings;
5113
+ }
5114
+ interface InviteInput {
5115
+ emails: string[];
5116
+ orgRole?: "admin" | "member";
5117
+ /** Also places the invitee in this workspace on accept. */
5118
+ workspaceId?: string;
5119
+ workspaceRole?: WorkspaceRole;
5120
+ }
5121
+ interface ListInvitationsOptions {
5122
+ status?: InvitationState;
5123
+ workspaceId?: string;
5124
+ cursor?: string;
5125
+ limit?: number;
5126
+ }
5127
+ declare class OrganizationsResource {
5128
+ private client;
5129
+ constructor(client: NodaroClient);
5130
+ /** The organizations this account belongs to. */
5131
+ list(): Promise<{
5132
+ data: OrganizationView[];
5133
+ }>;
5134
+ get(id: string): Promise<{
5135
+ data: OrganizationView;
5136
+ }>;
5137
+ /**
5138
+ * Create an organization. On instances that require it, `acceptTerms` must
5139
+ * be true or the server answers `terms_required` — the SDK does not decide
5140
+ * whether terms apply, because only the instance knows.
5141
+ *
5142
+ * A new organization may come back `pending`: some instances hold new
5143
+ * organizations for a platform admin to approve, and a pending one grants
5144
+ * nothing until it is active.
5145
+ */
5146
+ create(input: CreateOrgInput): Promise<{
5147
+ data: OrganizationView;
5148
+ }>;
5149
+ update(id: string, input: {
5150
+ name?: string;
5151
+ settings?: OrgSettings;
5152
+ }): Promise<{
5153
+ data: OrganizationView;
5154
+ }>;
5155
+ /** Soft-delete. The organization stops granting context; nothing is destroyed. */
5156
+ delete(id: string): Promise<{
5157
+ data: {
5158
+ id: string;
5159
+ status: string;
5160
+ };
5161
+ }>;
5162
+ /** Hand the organization to another member. The caller becomes an admin. */
5163
+ transferOwnership(id: string, userId: string): Promise<{
5164
+ data: {
5165
+ orgId: string;
5166
+ ownerUserId: string;
5167
+ };
5168
+ }>;
5169
+ /** Leave. An owner cannot — transfer ownership first (`owner_cannot_leave`). */
5170
+ leave(id: string): Promise<{
5171
+ data: {
5172
+ orgId: string;
5173
+ left: boolean;
5174
+ };
5175
+ }>;
5176
+ listMembers(orgId: string, opts?: {
5177
+ cursor?: string;
5178
+ limit?: number;
5179
+ }): Promise<OrgPage<OrgMemberView>>;
5180
+ updateMember(orgId: string, userId: string, input: {
5181
+ role?: "admin" | "member";
5182
+ status?: MemberStatus;
5183
+ }): Promise<{
5184
+ data: OrgMemberView;
5185
+ }>;
5186
+ removeMember(orgId: string, userId: string): Promise<{
5187
+ data: {
5188
+ removed: boolean;
5189
+ };
5190
+ }>;
5191
+ /**
5192
+ * Invite by email. Returns ONE ROW PER ADDRESS, and a row whose `status` is
5193
+ * not `sent` carries a `link` instead.
5194
+ *
5195
+ * Surface that link. An install with no mail provider — every fresh
5196
+ * self-host — delivers nothing, and an integration that reports "invited"
5197
+ * without showing the link creates invitations nobody can ever reach.
5198
+ */
5199
+ invite(orgId: string, input: InviteInput): Promise<{
5200
+ data: InvitationDelivery[];
5201
+ }>;
5202
+ listInvitations(orgId: string, opts?: ListInvitationsOptions): Promise<OrgPage<InvitationView>>;
5203
+ revokeInvitation(id: string): Promise<{
5204
+ data: {
5205
+ id: string;
5206
+ revoked: boolean;
5207
+ };
5208
+ }>;
5209
+ resendInvitation(id: string): Promise<{
5210
+ data: InvitationDelivery & {
5211
+ id: string;
5212
+ };
5213
+ }>;
5214
+ /**
5215
+ * What an invitee sees before signing in — the one organization read that
5216
+ * needs no token, so it works while the recipient is still signed out.
5217
+ */
5218
+ previewInvitation(token: string): Promise<{
5219
+ data: InvitationPreview;
5220
+ }>;
5221
+ /** Accept. Requires an authenticated caller whose email matches the invite. */
5222
+ acceptInvitation(token: string): Promise<{
5223
+ data: {
5224
+ orgId: string;
5225
+ workspaceId: string | null;
5226
+ };
5227
+ }>;
5228
+ /**
5229
+ * The organization's audit log, newest first. Owner and admins only, and
5230
+ * readable while the organization is suspended — the record of what
5231
+ * happened is exactly what someone needs when things have gone wrong.
5232
+ */
5233
+ audit(orgId: string, opts?: {
5234
+ cursor?: string;
5235
+ limit?: number;
5236
+ }): Promise<OrgPage<OrgAuditEntry>>;
5237
+ }
5238
+
5239
+ /**
5240
+ * Workspaces — the inner tenancy axis, where work actually lives.
5241
+ *
5242
+ * Selecting a workspace and belonging to one are different things, and this
5243
+ * resource is only about the second. Use {@link NodaroClient.withWorkspace}
5244
+ * to decide which workspace a REQUEST acts in; these methods read and change
5245
+ * the workspaces themselves.
5246
+ */
5247
+ interface CreateWorkspaceInput {
5248
+ name: string;
5249
+ slug?: string;
5250
+ description?: string;
5251
+ settings?: WorkspaceSettings;
5252
+ }
5253
+ declare class WorkspacesResource {
5254
+ private client;
5255
+ constructor(client: NodaroClient);
5256
+ /**
5257
+ * Every workspace this account belongs to, across all its organizations.
5258
+ *
5259
+ * An identity read: a stale workspace binding cannot lock a caller out of
5260
+ * it, which is what makes it safe to call when a selection has gone bad.
5261
+ *
5262
+ * Byte-for-byte the list `GET /v1/me` carries, so a client reconciles
5263
+ * against one truth rather than two. That is why these are SUMMARIES —
5264
+ * enough to render a switcher, not the full view; use {@link get} for that.
5265
+ */
5266
+ list(): Promise<{
5267
+ data: WorkspaceSummary[];
5268
+ lastWorkspaceId: string | null;
5269
+ }>;
5270
+ listForOrg(orgId: string, opts?: {
5271
+ includeArchived?: boolean;
5272
+ }): Promise<{
5273
+ data: WorkspaceView[];
5274
+ }>;
5275
+ get(id: string): Promise<{
5276
+ data: WorkspaceView;
5277
+ }>;
5278
+ create(orgId: string, input: CreateWorkspaceInput): Promise<{
5279
+ data: WorkspaceView;
5280
+ }>;
5281
+ update(id: string, input: {
5282
+ name?: string;
5283
+ description?: string | null;
5284
+ settings?: WorkspaceSettings;
5285
+ }): Promise<{
5286
+ data: WorkspaceView;
5287
+ }>;
5288
+ /**
5289
+ * Archive or restore. Archiving is REVERSIBLE and destroys nothing: the
5290
+ * workspace stops accepting new work and stays fully readable, which is
5291
+ * what a finished class term needs and a delete would not survive.
5292
+ */
5293
+ setArchived(id: string, archived: boolean): Promise<{
5294
+ data: WorkspaceView;
5295
+ }>;
5296
+ listMembers(id: string, opts?: {
5297
+ cursor?: string;
5298
+ limit?: number;
5299
+ }): Promise<OrgPage<WorkspaceMemberView>>;
5300
+ /** Add someone who is ALREADY in the organization. To bring in a new person, invite them. */
5301
+ addMember(id: string, input: {
5302
+ userId: string;
5303
+ role: WorkspaceRole;
5304
+ }): Promise<{
5305
+ data: WorkspaceMemberView;
5306
+ }>;
5307
+ updateMember(id: string, userId: string, input: {
5308
+ role?: WorkspaceRole;
5309
+ status?: MemberStatus;
5310
+ creditCap?: number | null;
5311
+ }): Promise<{
5312
+ data: WorkspaceMemberView;
5313
+ }>;
5314
+ removeMember(id: string, userId: string): Promise<{
5315
+ data: {
5316
+ removed: boolean;
5317
+ };
5318
+ }>;
5319
+ /** The workspace's join code, or `null` if none has been created. Admins only. */
5320
+ getJoinCode(id: string): Promise<{
5321
+ data: JoinCodeView | null;
5322
+ }>;
5323
+ /**
5324
+ * Rotate, enable or disable the code. Rotating invalidates the old one
5325
+ * immediately — that is the point of it, and anyone still holding a link
5326
+ * with the old code will be refused.
5327
+ */
5328
+ actOnJoinCode(id: string, action: "rotate" | "enable" | "disable"): Promise<{
5329
+ data: JoinCodeView;
5330
+ }>;
5331
+ /**
5332
+ * Join by code. Another way IN, so a stale workspace binding must not block
5333
+ * it — the server treats this as an identity route for that reason.
5334
+ */
5335
+ join(code: string): Promise<{
5336
+ data: {
5337
+ orgId: string;
5338
+ workspaceId: string;
5339
+ };
5340
+ }>;
5341
+ }
5342
+
4938
5343
  interface ClientOptions {
4939
5344
  /** Backend base URL, e.g. "https://nodaro.example.com" or empty string for same-origin. */
4940
5345
  baseUrl: string;
@@ -4952,6 +5357,19 @@ interface ClientOptions {
4952
5357
  * surfaces could never be told apart.
4953
5358
  */
4954
5359
  clientLabel?: string;
5360
+ /**
5361
+ * The workspace every request acts in — sent as `X-Nodaro-Workspace`.
5362
+ *
5363
+ * It selects which workspace a LIST reads from and where a CREATE lands.
5364
+ * It never authorizes: reading, updating, deleting or running an
5365
+ * identified object is decided by that object's own workspace, so a
5366
+ * forgotten header cannot hide work and a forged one cannot reach anyone
5367
+ * else's. Omit it to work in the caller's personal space.
5368
+ *
5369
+ * Prefer {@link NodaroClient.withWorkspace} for anything short-lived — one
5370
+ * client per workspace, no shared mutable selection to get wrong.
5371
+ */
5372
+ workspaceId?: string;
4955
5373
  }
4956
5374
  interface RequestOptions {
4957
5375
  body?: unknown;
@@ -5028,14 +5446,38 @@ declare class NodaroClient {
5028
5446
  readonly community: CommunityResource;
5029
5447
  readonly templates: TemplatesResource;
5030
5448
  readonly tutorials: TutorialsResource;
5449
+ readonly organizations: OrganizationsResource;
5450
+ readonly workspaces: WorkspacesResource;
5451
+ /** The workspace this client acts in; undefined = the personal space. */
5452
+ readonly workspaceId: string | undefined;
5031
5453
  constructor(opts: ClientOptions);
5454
+ /**
5455
+ * A client that acts in `workspaceId`, sharing this one's auth and config.
5456
+ *
5457
+ * A NEW client rather than a setter, deliberately. A mutable selection is
5458
+ * the bug this whole axis exists to prevent: two concurrent operations
5459
+ * against one client would race over which workspace they were in, and the
5460
+ * loser would create work in the wrong place with nothing failing. A
5461
+ * per-workspace client cannot be raced.
5462
+ *
5463
+ * Pass `null` for the personal space.
5464
+ */
5465
+ withWorkspace(workspaceId: string | null): NodaroClient;
5032
5466
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
5033
5467
  /**
5034
5468
  * `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
5035
5469
  * Unwraps the `{ data }` envelope. Throws `UnauthorizedError` (401) when the
5036
5470
  * token is missing/invalid, and the SDK's other typed errors as usual.
5037
- */
5038
- me(): Promise<UserIdentity>;
5471
+ *
5472
+ * On an instance with organizations it also carries what the caller belongs
5473
+ * to. THREE states, and collapsing them is wrong in a way users feel: the
5474
+ * organization fields ABSENT means this instance has no organizations at
5475
+ * all; present and empty means the account belongs to none; and
5476
+ * `organizationsUnavailable` means the lookup failed — keep whatever
5477
+ * selection you already had rather than concluding the person was removed
5478
+ * from everything.
5479
+ */
5480
+ me(): Promise<UserIdentity & MeOrganizations>;
5039
5481
  private buildUrl;
5040
5482
  }
5041
5483
  /** Factory function — preferred entry point. */
@@ -5129,4 +5571,4 @@ interface ApiErrorBody {
5129
5571
  }
5130
5572
  declare function throwFromResponse(status: number, body: ApiErrorBody): never;
5131
5573
 
5132
- 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, 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 CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, 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 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 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 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, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastEstimate, 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 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, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
5574
+ 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, 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, 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 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 };