@zweer/mage-space-client 1.2.0 → 1.3.1

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.mts CHANGED
@@ -1,11 +1,56 @@
1
- //#region lib/types.d.ts
1
+ //#region lib/targets.d.ts
2
+ /**
3
+ * Per-host {@link Target} descriptors.
4
+ *
5
+ * mage.space is migrating from production (`https://www.mage.space`) to a new
6
+ * portal (`https://beta.mage.space`). Rather than hard-coding one base URL and
7
+ * one action-name set, each host is modelled as a `Target` so host differences
8
+ * (renamed actions, poll strategy) live in a single table. The client holds an
9
+ * ordered chain `[production, beta]` and advances to the next target only when
10
+ * the active host can no longer serve a required action.
11
+ */
12
+ /** Hosts the client can talk to. */
13
+ type TargetKey = 'production' | 'beta';
14
+ /** How a single history-status read is performed on a given host. */
15
+ type PollStrategy = 'byId' | 'paginated';
16
+ /**
17
+ * Logical operations the generation/history services invoke, decoupled from the
18
+ * host-specific wire names. `createUserSession` is intentionally NOT a member:
19
+ * it is resolved by its literal name on both hosts (see `lib/auth.ts`).
20
+ */
21
+ type LogicalAction = 'submitGeneration' | 'getHistoryById' | 'cancelJob' | 'listHistory' | 'listCreations';
22
+ /** A single host the client can target. */
23
+ interface Target {
24
+ readonly key: TargetKey;
25
+ readonly baseUrl: string;
26
+ /** logical name → host-specific wire name; unlisted names resolve to themselves. */
27
+ readonly actionNames: Readonly<Partial<Record<LogicalAction, string>>>;
28
+ readonly pollStrategy: PollStrategy;
29
+ }
30
+ /** Resolve a logical action to its host-specific wire name (identity if unlisted). */
31
+ export declare function resolveActionName(target: Target, logical: LogicalAction): string;
2
32
  /**
3
- * Shared type definitions for the mage.space client.
33
+ * Production target.
4
34
  *
5
35
  * @remarks
6
- * mage.space is not a REST API: it uses Next.js Server Actions. These types model
7
- * the request/response shapes reverse-engineered in `docs/api/*.md`.
36
+ * Maps each logical action to the wire name the current production deploy
37
+ * actually serves (all VERIFIED against `lib/seed.ts` / the existing MSW tests):
38
+ * `submitGeneration → runArchitecture`, `cancelJob → cancelArchitectureJob`,
39
+ * `listHistory → getHistoryPaginated`, `listCreations → getCreationsPaginatedParallel`,
40
+ * and `getHistoryById → getHistoryById` (identity). The table is explicit rather
41
+ * than empty so production behaviour is reproduced exactly regardless of the
42
+ * logical-name vocabulary.
43
+ */
44
+ export declare const PRODUCTION_TARGET: Target;
45
+ /**
46
+ * Beta target. Beta facts are assumptions pending a reverse-engineering capture
47
+ * under `docs/api/beta` — treat them as unverified until that doc lands.
8
48
  */
49
+ export declare const BETA_TARGET: Target;
50
+ /** Default ordered fallback chain: production first, then beta. */
51
+ export declare const DEFAULT_TARGET_CHAIN: readonly Target[];
52
+ //#endregion
53
+ //#region lib/types.d.ts
9
54
  /** Minimal `fetch` signature the client depends on (injectable for tests). */
10
55
  type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
11
56
  /** In-memory representation of the Firebase token chain. */
@@ -27,7 +72,7 @@ interface SessionState {
27
72
  expiresAt: number;
28
73
  }
29
74
  /** Server Action function names the client relies on for the MVP surface. */
30
- type ActionName = 'createUserSession' | 'deleteUserSession' | 'getUserHydrationData' | 'runArchitecture' | 'getHistoryById' | 'cancelArchitectureJob' | 'getHistoryPaginated' | 'getMentionSuggestionsParallel' | 'createCharacter' | 'updateCharacter' | 'deleteCharacter' | 'getCharacter' | 'getCharacters' | 'publishCharacter' | 'unpublishCharacter' | 'uploadCharacterImage' | 'uploadReferenceImage' | 'createReference' | 'updateReference' | 'deleteReference' | 'getReferences' | 'getReferencesPaginated' | 'getCharactersPaginated' | 'getCreationsPaginatedParallel' | 'deleteHistory' | 'deleteManyHistories' | 'deleteCreation' | 'deleteManyCreations' | 'saveCreation' | 'generateCharacterVoice' | 'followCharacter' | 'unfollowCharacter';
75
+ type ActionName = 'createUserSession' | 'deleteUserSession' | 'getUserHydrationData' | 'runArchitecture' | 'getHistoryById' | 'cancelArchitectureJob' | 'getHistoryPaginated' | 'getMentionSuggestionsParallel' | 'createCharacter' | 'updateCharacter' | 'deleteCharacter' | 'getCharacter' | 'getCharacters' | 'publishCharacter' | 'unpublishCharacter' | 'uploadCharacterImage' | 'uploadReferenceImage' | 'createReference' | 'updateReference' | 'deleteReference' | 'getReferences' | 'getReferencesPaginated' | 'getCharactersPaginated' | 'getCreationsPaginatedParallel' | 'getCreationsPaginated' | 'deleteHistory' | 'deleteManyHistories' | 'deleteCreation' | 'deleteManyCreations' | 'saveCreation' | 'generateCharacterVoice' | 'followCharacter' | 'unfollowCharacter';
31
76
  /** Map of Server Action function name → hex action hash. */
32
77
  type ActionHashes = Record<string, string>;
33
78
  /** A discovered (or seeded) set of action hashes for a single Vercel deploy. */
@@ -136,6 +181,21 @@ interface MageSpaceClientOptions {
136
181
  baseUrl?: string;
137
182
  /** Override the Firebase Web API key. */
138
183
  firebaseApiKey?: string;
184
+ /**
185
+ * Host-fallback behaviour. Default: production first, with an automatic,
186
+ * sticky fallback to beta when production can no longer serve a required
187
+ * action. Cannot be combined with `baseUrl` (which pins a single host).
188
+ */
189
+ fallback?: FallbackOptions;
190
+ }
191
+ /** Configuration for the automatic beta-portal fallback. */
192
+ interface FallbackOptions {
193
+ /** Host to start on. Default `'production'`. `'beta'` forces beta from the first call. */
194
+ start?: TargetKey;
195
+ /** Auto-advance to the next target on a definitive action-unavailable signal. Default `true`. */
196
+ auto?: boolean;
197
+ /** Override the ordered target chain. Advanced/testing. Default `DEFAULT_TARGET_CHAIN`. */
198
+ chain?: readonly Target[];
139
199
  }
140
200
  interface GenerateOptions {
141
201
  /** Prompt text; supports `@character-username` mentions. */
@@ -466,7 +526,7 @@ interface VoiceResult {
466
526
  //#endregion
467
527
  //#region lib/actions.d.ts
468
528
  /** Default in-process snapshot cache. */
469
- declare class InMemoryActionCache implements ActionCache {
529
+ export declare class InMemoryActionCache implements ActionCache {
470
530
  private snapshot;
471
531
  load(): Promise<ActionSnapshot | null>;
472
532
  save(snapshot: ActionSnapshot): Promise<void>;
@@ -485,7 +545,7 @@ interface DiscoveryOptions {
485
545
  *
486
546
  * @throws {DiscoveryError} on network failure or when nothing is discovered.
487
547
  */
488
- declare function discoverActions(opts: DiscoveryOptions): Promise<ActionSnapshot>;
548
+ export declare function discoverActions(opts: DiscoveryOptions): Promise<ActionSnapshot>;
489
549
  interface ActionRegistryOptions {
490
550
  fetch: FetchLike;
491
551
  baseUrl: string;
@@ -500,7 +560,7 @@ interface ActionRegistryOptions {
500
560
  * Serves action hashes from a warm seed / pluggable cache, discovering lazily and
501
561
  * refreshing on staleness. Concurrent refreshes are de-duplicated (single-flight).
502
562
  */
503
- declare class ActionRegistry {
563
+ export declare class ActionRegistry {
504
564
  private readonly fetch;
505
565
  private readonly baseUrl;
506
566
  private readonly cache;
@@ -545,15 +605,23 @@ declare class HttpClient {
545
605
  private readonly registry;
546
606
  private readonly fetchImpl;
547
607
  private readonly baseUrl;
608
+ private readonly targetKey;
548
609
  private readonly userAgent;
549
- constructor(registry: ActionRegistry, fetchImpl: FetchLike, baseUrl: string, userAgent?: string);
610
+ constructor(registry: ActionRegistry, fetchImpl: FetchLike, baseUrl: string, targetKey: string, userAgent?: string);
611
+ /** A response that means the action is unavailable (stale hash or gone). */
612
+ private isUnavailable;
550
613
  callAction<T = unknown>(params: CallActionParams, retried?: boolean): Promise<CallActionResult<T>>;
551
614
  }
552
615
  //#endregion
553
616
  //#region lib/auth.d.ts
554
617
  interface AuthManagerOptions {
555
618
  refreshToken: string;
556
- http: HttpClient;
619
+ /**
620
+ * Accessor for the active host's {@link HttpClient}. A closure (not the client
621
+ * itself) so `createUserSession` always hits whichever host is currently
622
+ * active after an automatic fallback.
623
+ */
624
+ getHttp: () => HttpClient;
557
625
  fetch: FetchLike;
558
626
  firebaseApiKey?: string;
559
627
  /** Page path for the `createUserSession` action (default `/creations`). */
@@ -561,13 +629,19 @@ interface AuthManagerOptions {
561
629
  }
562
630
  declare class AuthManager {
563
631
  private refreshToken;
564
- private readonly http;
632
+ private readonly getHttp;
565
633
  private readonly fetchImpl;
566
634
  private readonly apiKey;
567
635
  private readonly sessionPath;
568
636
  private tokens;
569
637
  private session;
570
638
  constructor(opts: AuthManagerOptions);
639
+ /**
640
+ * Drop the cached `__session` cookie so the next {@link getSession} mints a
641
+ * fresh one against the (newly) active host. The Firebase token chain is kept
642
+ * because it is host-independent.
643
+ */
644
+ resetSession(): void;
571
645
  /** Return a valid Firebase ID token, refreshing via the refresh token if needed. */
572
646
  getIdToken(): Promise<string>;
573
647
  /** Return the Firebase uid (fetching an ID token first if necessary). */
@@ -578,7 +652,7 @@ declare class AuthManager {
578
652
  }
579
653
  //#endregion
580
654
  //#region lib/characters.d.ts
581
- declare class CharactersService {
655
+ export declare class CharactersService {
582
656
  private readonly http;
583
657
  private readonly auth;
584
658
  constructor(http: HttpClient, auth: AuthManager);
@@ -634,7 +708,7 @@ declare class CharactersService {
634
708
  }
635
709
  //#endregion
636
710
  //#region lib/references.d.ts
637
- declare class ReferencesService {
711
+ export declare class ReferencesService {
638
712
  private readonly http;
639
713
  private readonly auth;
640
714
  constructor(http: HttpClient, auth: AuthManager);
@@ -666,16 +740,44 @@ declare class ReferencesService {
666
740
  }
667
741
  //#endregion
668
742
  //#region lib/client.d.ts
669
- declare class MageSpaceClient {
670
- private readonly registry;
743
+ export declare class MageSpaceClient {
671
744
  private readonly auth;
672
- private readonly generationService;
673
- private readonly historyService;
674
- /** Character management (search, CRUD, pagination, uploads). */
745
+ private readonly chain;
746
+ private readonly auto;
747
+ private readonly contextDeps;
748
+ private readonly contexts;
749
+ private activeIndex;
750
+ private activeContext;
751
+ private activeBundle;
752
+ /**
753
+ * Character management (search, CRUD, pagination, uploads).
754
+ *
755
+ * @remarks
756
+ * Bound to the initial host (production by default) and does not follow an
757
+ * automatic beta fallback. Construct a client with `fallback: { start: 'beta' }`
758
+ * to use these against beta.
759
+ */
675
760
  readonly characters: CharactersService;
676
- /** Reference asset management (upload, create, update, list, feed). */
761
+ /**
762
+ * Reference asset management (upload, create, update, list, feed).
763
+ *
764
+ * @remarks
765
+ * Bound to the initial host (production by default) and does not follow an
766
+ * automatic beta fallback. Construct a client with `fallback: { start: 'beta' }`
767
+ * to use these against beta.
768
+ */
677
769
  readonly references: ReferencesService;
678
770
  constructor(options: MageSpaceClientOptions);
771
+ /** Lazily build (and memoise) the {@link TargetContext} for a chain index. */
772
+ private getContext;
773
+ /** Build the generation/history service bundle for a context. */
774
+ private buildBundle;
775
+ /** Advance to the next target (sticky). Returns `null` if none or `auto` is off. */
776
+ private advanceTarget;
777
+ /** Whether an error is a definitive action-unavailable signal (a fallback trigger). */
778
+ private shouldFallback;
779
+ /** Run `op` against the active bundle, switching to the next target once on a trigger. */
780
+ private withFallback;
679
781
  /** Submit a generation job; returns its `historyId`. */
680
782
  generate(options: GenerateOptions): Promise<{
681
783
  historyId: string;
@@ -704,54 +806,79 @@ declare class MageSpaceClient {
704
806
  deleteCreation(creationId: string, options?: ConfirmOptions): Promise<void>;
705
807
  /** Permanently delete many creations. Irreversible — requires `{ confirm: true }`. */
706
808
  deleteManyCreations(creationIds: string[], options?: ConfirmOptions): Promise<void>;
707
- /** Force re-discovery of the Server Action hashes. */
809
+ /** Force re-discovery of the Server Action hashes on the active host. */
708
810
  refreshActions(): Promise<ActionSnapshot>;
709
811
  /** Return the authenticated user's Firebase uid. */
710
812
  getUid(): Promise<string>;
813
+ /** Return the key of the currently active target (`'production'` or `'beta'`). */
814
+ getActiveTarget(): TargetKey;
711
815
  }
712
816
  //#endregion
713
817
  //#region lib/errors.d.ts
714
818
  /** Typed error hierarchy for the mage.space client. */
715
819
  /** Base class for every error thrown by this library. */
716
- declare class MageSpaceError extends Error {
820
+ export declare class MageSpaceError extends Error {
717
821
  constructor(message: string, options?: {
718
822
  cause?: unknown;
719
823
  });
720
824
  }
721
825
  /** Authentication failures (token refresh, session creation). */
722
- declare class AuthError extends MageSpaceError {
826
+ export declare class AuthError extends MageSpaceError {
723
827
  constructor(message: string, options?: {
724
828
  cause?: unknown;
725
829
  });
726
830
  }
727
831
  /** Action-hash discovery failures (page/chunk fetch, empty registry). */
728
- declare class DiscoveryError extends MageSpaceError {
832
+ export declare class DiscoveryError extends MageSpaceError {
833
+ /**
834
+ * `true` when the action name was absent even after a forced re-discovery
835
+ * (a fallback trigger); `false` for scrape failures (no chunks/no hashes).
836
+ */
837
+ readonly notFound: boolean;
729
838
  constructor(message: string, options?: {
730
839
  cause?: unknown;
840
+ notFound?: boolean;
731
841
  });
732
842
  }
733
- /** A Server Action returned 404, indicating a stale (post-deploy) hash. */
734
- declare class StaleActionError extends MageSpaceError {
843
+ /**
844
+ * A required action is unavailable on the active host (a persistent 404 / HTML
845
+ * fallback that survived one in-place re-discovery). A fallback trigger.
846
+ */
847
+ export declare class ActionUnavailableError extends MageSpaceError {
848
+ readonly action: string;
849
+ readonly targetKey: string;
850
+ constructor(action: string, targetKey: string, options?: {
851
+ cause?: unknown;
852
+ });
853
+ }
854
+ /**
855
+ * A Server Action returned 404, indicating a stale (post-deploy) hash.
856
+ *
857
+ * @deprecated Legacy export kept for backward compatibility; no longer thrown.
858
+ * The current signal for a definitively unavailable action is
859
+ * {@link ActionUnavailableError}.
860
+ */
861
+ export declare class StaleActionError extends MageSpaceError {
735
862
  readonly action: string;
736
863
  constructor(action: string, options?: {
737
864
  cause?: unknown;
738
865
  });
739
866
  }
740
867
  /** Failures while submitting or polling a generation job. */
741
- declare class GenerationError extends MageSpaceError {
868
+ export declare class GenerationError extends MageSpaceError {
742
869
  readonly code?: number | undefined;
743
870
  constructor(message: string, code?: number | undefined, options?: {
744
871
  cause?: unknown;
745
872
  });
746
873
  }
747
874
  /** Failure to parse a React Server Component (RSC) wire response. */
748
- declare class RscParseError extends MageSpaceError {
875
+ export declare class RscParseError extends MageSpaceError {
749
876
  constructor(message: string, options?: {
750
877
  cause?: unknown;
751
878
  });
752
879
  }
753
880
  /** A wait/poll operation exceeded its deadline or was aborted. */
754
- declare class TimeoutError extends MageSpaceError {
881
+ export declare class TimeoutError extends MageSpaceError {
755
882
  constructor(message: string, options?: {
756
883
  cause?: unknown;
757
884
  });
@@ -770,15 +897,15 @@ declare class TimeoutError extends MageSpaceError {
770
897
  * position/length aware so length-delimited rows are consumed exactly and every
771
898
  * subsequent row stays isolated.
772
899
  */
773
- declare function parseFlightRows(text: string): Map<string, unknown>;
900
+ export declare function parseFlightRows(text: string): Map<string, unknown>;
774
901
  /** Recursively resolve Flight sentinels/references within a parsed value. */
775
- declare function resolveFlightValue(value: unknown, rows: Map<string, unknown>, seen?: Set<string>): unknown;
902
+ export declare function resolveFlightValue(value: unknown, rows: Map<string, unknown>, seen?: Set<string>): unknown;
776
903
  /**
777
904
  * Parse a Server Action response and return the action's resolved return value.
778
905
  *
779
906
  * @throws {RscParseError} when the response contains no parseable rows.
780
907
  */
781
- declare function parseServerActionResponse<T = unknown>(text: string): T;
908
+ export declare function parseServerActionResponse<T = unknown>(text: string): T;
782
909
  /**
783
910
  * Unwrap a single-object result that some Server Actions (notably the
784
911
  * `*Parallel` family) wrap in a one-element array.
@@ -790,7 +917,7 @@ declare function parseServerActionResponse<T = unknown>(text: string): T;
790
917
  * a no-op when the response is already the object. Do NOT use it for actions whose
791
918
  * genuine return type is an array (e.g. `getReferences`).
792
919
  */
793
- declare function unwrapResult<T>(value: unknown): T;
920
+ export declare function unwrapResult<T>(value: unknown): T;
794
921
  //#endregion
795
922
  //#region lib/seed.d.ts
796
923
  /**
@@ -802,11 +929,11 @@ declare function unwrapResult<T>(value: unknown): T;
802
929
  * Hashes change on every deploy; when one goes stale the client re-discovers
803
930
  * automatically (404 → invalidate → refresh).
804
931
  */
805
- declare const SEED_SNAPSHOT: ActionSnapshot;
932
+ export declare const SEED_SNAPSHOT: ActionSnapshot;
806
933
  //#endregion
807
934
  //#region lib/index.d.ts
808
935
  /** Public entry point for `@zweer/mage-space-client`. */
809
- declare const VERSION = "0.0.0";
936
+ export declare const VERSION = "0.0.0";
810
937
  //#endregion
811
- export { type ActionCache, type ActionHashes, type ActionName, ActionRegistry, type ActionSnapshot, type ArchitectureConfig, type AspectRatio, AuthError, type AuthTokens, type Character, type CharacterPage, type CharacterRef, type CharacterSearchResult, CharactersService, type ConfirmOptions, type CreateCharacterInput, type CreateReferenceInput, type Creation, type CreationPage, DiscoveryError, type FetchLike, type GenerateOptions, type GenerateVideoOptions, type GenerateVoiceOptions, GenerationError, type GenerationMode, type GenerationResult, type HistoryItem, type HistoryPage, InMemoryActionCache, type JobStatus, type ListCharactersOptions, type ListCreationsOptions, type ListHistoryOptions, type ListReferencesOptions, MageSpaceClient, type MageSpaceClientOptions, MageSpaceError, type Modality, type Reference, type ReferenceOrder, type ReferencePage, type ReferenceVariant, ReferencesService, type Resolution, RscParseError, SEED_SNAPSHOT, type SearchCharactersOptions, type SessionState, StaleActionError, TimeoutError, type UpdateCharacterInput, type UpdateReferenceInput, VERSION, type VideoArchitectureConfig, type VideoAspectRatio, type VideoResolution, type Visibility, type VoiceResult, type WaitOptions, discoverActions, parseFlightRows, parseServerActionResponse, resolveFlightValue, unwrapResult };
938
+ export type { ActionCache, ActionHashes, ActionName, ActionSnapshot, ArchitectureConfig, AspectRatio, AuthTokens, Character, CharacterPage, CharacterRef, CharacterSearchResult, ConfirmOptions, CreateCharacterInput, CreateReferenceInput, Creation, CreationPage, FallbackOptions, FetchLike, GenerateOptions, GenerateVideoOptions, GenerateVoiceOptions, GenerationMode, GenerationResult, HistoryItem, HistoryPage, JobStatus, ListCharactersOptions, ListCreationsOptions, ListHistoryOptions, ListReferencesOptions, LogicalAction, MageSpaceClientOptions, Modality, PollStrategy, Reference, ReferenceOrder, ReferencePage, ReferenceVariant, Resolution, SearchCharactersOptions, SessionState, Target, TargetKey, UpdateCharacterInput, UpdateReferenceInput, VideoArchitectureConfig, VideoAspectRatio, VideoResolution, Visibility, VoiceResult, WaitOptions };
812
939
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../lib/types.ts","../lib/actions.ts","../lib/http.ts","../lib/auth.ts","../lib/characters.ts","../lib/references.ts","../lib/client.ts","../lib/errors.ts","../lib/rsc.ts","../lib/seed.ts","../lib/index.ts"],"mappings":";;;;;;;;;KASY,aAAa,eAAe,OAAO,gBAAgB,QAAQ;;UAOtD;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;;EAEA;;;KAQU;;KAmCA,eAAe;;UAGV;;EAEf;;EAEA,QAAQ;;EAER;;;;;;;;;;UAWe;EACf,QAAQ,QAAQ;EAChB,KAAK,UAAU,iBAAiB;;KAOtB;KACA;;KAEA;;KAEA;;UAGK;EACf;EACA;EACA;EACA;;EAEA;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;;EAEf;EACA;EACA,YAAY;EACZ;EACA;;EAEA;;;UAIe;EACf;IACE;IACA;IACA;IACA;IACA;IACA;MAAe;MAAkB;;;EAEnC;EACA;;;UAIe;EACf;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA,QAAQ;EACR;EACA,sBAAsB;EACtB;EACA;EACA;GACC;;;UAIc;EACf,WAAW;EACX;;UAOe;;EAEf;;EAEA,QAAQ;;EAER,QAAQ;;EAER;;EAEA,OAAO;;EAEP;;EAEA;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA;EACA,cAAc;EACd,aAAa;;EAEb;;EAEA;;EAEA,aAAa;;;;;;EAMb,aAAa;;EAEb;;EAEA;;EAEA,iBAAiB;;;KAQP;;KAEA;;;;;;;;UASK;EACf;EACA;EACA;EACA;;EAEA;EACA;EACA,qBAAqB;;EAErB;;EAEA;EACA;EACA,YAAY;EACZ;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA,cAAc;;EAEd,aAAa;;EAEb;;EAEA;;EAEA;;EAEA,aAAa;;EAEb,aAAa;;EAEb;;EAEA;;EAEA,iBAAiB;;;;;;;;;UAUF;EACf;;UAGe;;EAEf;;EAEA;;EAEA,SAAS;;UAGM;;EAEf;;EAEA;;EAEA,SAAS;;;KAQC;;KAEA;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A;;WAGR,YAAY;;WAGZ,YAAY;EAErB,YAAY,SAAS;;EA2BrB,SAAS,SAAS,kBAAkB;IAAU;;;EAK9C,cAAc,SAAS,uBAAuB;IAAU;;;EAKxD,UAAU,oBAAoB,QAAQ;;EAKtC,cAAc,mBAAmB,UAAU,cAAc,QAAQ;;EAKjE,UAAU,oBAAoB;;EAK9B,YAAY,UAAU,qBAAqB,QAAQ;;EAKnD,cAAc,UAAU,uBAAuB,QAAQ;;EAKvD,aAAa,QAAQ,mBAAmB;;EAKxC,cAAc,mBAAmB,UAAU,iBAAiB;;EAK5D,oBAAoB,sBAAsB,UAAU,iBAAiB;;EAKrE,eAAe,oBAAoB,UAAU,iBAAiB;;EAK9D,oBAAoB,uBAAuB,UAAU,iBAAiB;;EAKtE,kBAAkB,QAAQ;;EAK1B,UAAU;;;;;;cCnIC,uBAAuB;EAClC,YAAY,iBAAiB;IAAY;;;;cAO9B,kBAAkB;EAC7B,YAAY,iBAAiB;IAAY;;;;cAO9B,uBAAuB;EAClC,YAAY,iBAAiB;IAAY;;;;cAO9B,yBAAyB;WAElB;EADlB,YACkB,gBAChB;IAAY;;;;cAQH,wBAAwB;WAGjB;EAFlB,YACE,iBACgB,2BAChB;IAAY;;;;cAQH,sBAAsB;EACjC,YAAY,iBAAiB;IAAY;;;;cAO9B,qBAAqB;EAChC,YAAY,iBAAiB;IAAY;;;;;;;;;;;;;;;;;iBCL3B,gBAAgB,eAAe;;iBAmE/B,mBACd,gBACA,MAAM,sBACN,OAAM;;;;;;iBA4CQ,0BAA0B,aAAa,eAAe;;;;;;;;;;;;iBA8BtD,aAAa,GAAG,iBAAiB;;;;;;;;;;;;cC3LpC,eAAe;;;;cCVf"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../lib/targets.ts","../lib/types.ts","../lib/actions.ts","../lib/http.ts","../lib/auth.ts","../lib/characters.ts","../lib/references.ts","../lib/client.ts","../lib/errors.ts","../lib/rsc.ts","../lib/seed.ts","../lib/index.ts"],"m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