@zweer/mage-space-client 1.2.0 → 1.3.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.cjs +391 -114
- package/dist/index.d.cts +143 -16
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +143 -16
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +387 -115
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,56 @@
|
|
|
1
|
-
//#region lib/
|
|
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
|
+
declare function resolveActionName(target: Target, logical: LogicalAction): string;
|
|
2
32
|
/**
|
|
3
|
-
*
|
|
33
|
+
* Production target.
|
|
4
34
|
*
|
|
5
35
|
* @remarks
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
+
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
|
+
declare const BETA_TARGET: Target;
|
|
50
|
+
/** Default ordered fallback chain: production first, then beta. */
|
|
51
|
+
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. */
|
|
@@ -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
|
-
|
|
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
|
|
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). */
|
|
@@ -667,15 +741,43 @@ declare class ReferencesService {
|
|
|
667
741
|
//#endregion
|
|
668
742
|
//#region lib/client.d.ts
|
|
669
743
|
declare class MageSpaceClient {
|
|
670
|
-
private readonly registry;
|
|
671
744
|
private readonly auth;
|
|
672
|
-
private readonly
|
|
673
|
-
private readonly
|
|
674
|
-
|
|
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
|
-
/**
|
|
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,10 +806,12 @@ 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
|
|
@@ -726,11 +830,34 @@ declare class AuthError extends MageSpaceError {
|
|
|
726
830
|
}
|
|
727
831
|
/** Action-hash discovery failures (page/chunk fetch, empty registry). */
|
|
728
832
|
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
|
-
/**
|
|
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
|
+
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
|
+
*/
|
|
734
861
|
declare class StaleActionError extends MageSpaceError {
|
|
735
862
|
readonly action: string;
|
|
736
863
|
constructor(action: string, options?: {
|
|
@@ -808,5 +935,5 @@ declare const SEED_SNAPSHOT: ActionSnapshot;
|
|
|
808
935
|
/** Public entry point for `@zweer/mage-space-client`. */
|
|
809
936
|
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, type ActionHashes, type ActionName, ActionRegistry, type ActionSnapshot, ActionUnavailableError, type ArchitectureConfig, type AspectRatio, AuthError, type AuthTokens, BETA_TARGET, type Character, type CharacterPage, type CharacterRef, type CharacterSearchResult, CharactersService, type ConfirmOptions, type CreateCharacterInput, type CreateReferenceInput, type Creation, type CreationPage, DEFAULT_TARGET_CHAIN, DiscoveryError, type FallbackOptions, 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, type LogicalAction, MageSpaceClient, type MageSpaceClientOptions, MageSpaceError, type Modality, PRODUCTION_TARGET, type PollStrategy, type Reference, type ReferenceOrder, type ReferencePage, type ReferenceVariant, ReferencesService, type Resolution, RscParseError, SEED_SNAPSHOT, type SearchCharactersOptions, type SessionState, StaleActionError, type Target, type TargetKey, TimeoutError, type UpdateCharacterInput, type UpdateReferenceInput, VERSION, type VideoArchitectureConfig, type VideoAspectRatio, type VideoResolution, type Visibility, type VoiceResult, type WaitOptions, discoverActions, parseFlightRows, parseServerActionResponse, resolveActionName, resolveFlightValue, unwrapResult };
|
|
812
939
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","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":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","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"],"mappings":";;;;;;;;;;;;KAYY;;KAGA;;;;;;KAOA;;UAQK;WACN,KAAK;WACL;;WAEA,aAAa,SAAS,QAAQ,OAAO;WACrC,cAAc;;;iBAIT,kBAAkB,QAAQ,QAAQ,SAAS;;;;;;;;;;;;;cAgB9C,mBAAmB;;;;;cAiBnB,aAAa;;cAkBb,+BAA+B;;;;KC/EhC,aAAa,eAAe,OAAO,gBAAgB,QAAQ;;UAOtD;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;;EAEA;;;KAQU;;KAoCA,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;;;U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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;;EAKV,mBAAmB;;;;;;cC/QR,uBAAuB;EAClC,YAAY,iBAAiB;IAAY;;;;cAO9B,kBAAkB;EAC7B,YAAY,iBAAiB;IAAY;;;;cAO9B,uBAAuB;;;;;WAKlB;EAEhB,YAAY,iBAAiB;IAAY;IAAiB;;;;;;;cAW/C,+BAA+B;WAExB;WACA;EAFlB,YACkB,gBACA,mBAChB;IAAY;;;;;;;;;;cAcH,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;;;;;;;;;;;;;;;;;iBCjC3B,gBAAgB,eAAe;;iBAmE/B,mBACd,gBACA,MAAM,sBACN,OAAM;;;;;;iBAqDQ,0BAA0B,aAAa,eAAe;;;;;;;;;;;;iBA8BtD,aAAa,GAAG,iBAAiB;;;;;;;;;;;;cCpMpC,eAAe;;;;cCVf"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,56 @@
|
|
|
1
|
-
//#region lib/
|
|
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
|
+
declare function resolveActionName(target: Target, logical: LogicalAction): string;
|
|
2
32
|
/**
|
|
3
|
-
*
|
|
33
|
+
* Production target.
|
|
4
34
|
*
|
|
5
35
|
* @remarks
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
+
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
|
+
declare const BETA_TARGET: Target;
|
|
50
|
+
/** Default ordered fallback chain: production first, then beta. */
|
|
51
|
+
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. */
|
|
@@ -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
|
-
|
|
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
|
|
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). */
|
|
@@ -667,15 +741,43 @@ declare class ReferencesService {
|
|
|
667
741
|
//#endregion
|
|
668
742
|
//#region lib/client.d.ts
|
|
669
743
|
declare class MageSpaceClient {
|
|
670
|
-
private readonly registry;
|
|
671
744
|
private readonly auth;
|
|
672
|
-
private readonly
|
|
673
|
-
private readonly
|
|
674
|
-
|
|
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
|
-
/**
|
|
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,10 +806,12 @@ 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
|
|
@@ -726,11 +830,34 @@ declare class AuthError extends MageSpaceError {
|
|
|
726
830
|
}
|
|
727
831
|
/** Action-hash discovery failures (page/chunk fetch, empty registry). */
|
|
728
832
|
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
|
-
/**
|
|
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
|
+
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
|
+
*/
|
|
734
861
|
declare class StaleActionError extends MageSpaceError {
|
|
735
862
|
readonly action: string;
|
|
736
863
|
constructor(action: string, options?: {
|
|
@@ -808,5 +935,5 @@ declare const SEED_SNAPSHOT: ActionSnapshot;
|
|
|
808
935
|
/** Public entry point for `@zweer/mage-space-client`. */
|
|
809
936
|
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, type ActionHashes, type ActionName, ActionRegistry, type ActionSnapshot, ActionUnavailableError, type ArchitectureConfig, type AspectRatio, AuthError, type AuthTokens, BETA_TARGET, type Character, type CharacterPage, type CharacterRef, type CharacterSearchResult, CharactersService, type ConfirmOptions, type CreateCharacterInput, type CreateReferenceInput, type Creation, type CreationPage, DEFAULT_TARGET_CHAIN, DiscoveryError, type FallbackOptions, 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, type LogicalAction, MageSpaceClient, type MageSpaceClientOptions, MageSpaceError, type Modality, PRODUCTION_TARGET, type PollStrategy, type Reference, type ReferenceOrder, type ReferencePage, type ReferenceVariant, ReferencesService, type Resolution, RscParseError, SEED_SNAPSHOT, type SearchCharactersOptions, type SessionState, StaleActionError, type Target, type TargetKey, TimeoutError, type UpdateCharacterInput, type UpdateReferenceInput, VERSION, type VideoArchitectureConfig, type VideoAspectRatio, type VideoResolution, type Visibility, type VoiceResult, type WaitOptions, discoverActions, parseFlightRows, parseServerActionResponse, resolveActionName, resolveFlightValue, unwrapResult };
|
|
812
939
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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":"
|
|
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"],"mappings":";;;;;;;;;;;;K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