@nodetool-ai/minimax-nodes 0.8.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/README.md +27 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/minimax-base.d.ts +140 -0
- package/dist/minimax-base.d.ts.map +1 -0
- package/dist/minimax-base.js +315 -0
- package/dist/minimax-base.js.map +1 -0
- package/dist/nodes/image-to-video.d.ts +32 -0
- package/dist/nodes/image-to-video.d.ts.map +1 -0
- package/dist/nodes/image-to-video.js +105 -0
- package/dist/nodes/image-to-video.js.map +1 -0
- package/dist/nodes/music.d.ts +31 -0
- package/dist/nodes/music.d.ts.map +1 -0
- package/dist/nodes/music.js +102 -0
- package/dist/nodes/music.js.map +1 -0
- package/dist/nodes/text-to-image.d.ts +32 -0
- package/dist/nodes/text-to-image.d.ts.map +1 -0
- package/dist/nodes/text-to-image.js +116 -0
- package/dist/nodes/text-to-image.js.map +1 -0
- package/dist/nodes/text-to-speech.d.ts +36 -0
- package/dist/nodes/text-to-speech.d.ts.map +1 -0
- package/dist/nodes/text-to-speech.js +168 -0
- package/dist/nodes/text-to-speech.js.map +1 -0
- package/dist/nodes/text-to-video.d.ts +31 -0
- package/dist/nodes/text-to-video.d.ts.map +1 -0
- package/dist/nodes/text-to-video.js +81 -0
- package/dist/nodes/text-to-video.js.map +1 -0
- package/dist/nodes/voice.d.ts +22 -0
- package/dist/nodes/voice.d.ts.map +1 -0
- package/dist/nodes/voice.js +37 -0
- package/dist/nodes/voice.js.map +1 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @nodetool-ai/minimax-nodes
|
|
2
|
+
|
|
3
|
+
MiniMax AI nodes for [NodeTool](https://nodetool.ai).
|
|
4
|
+
|
|
5
|
+
These nodes call the [MiniMax API](https://platform.minimax.io/docs/api-reference/api-overview)
|
|
6
|
+
directly so they can expose MiniMax-specific controls that the generic provider
|
|
7
|
+
nodes don't carry.
|
|
8
|
+
|
|
9
|
+
## Nodes
|
|
10
|
+
|
|
11
|
+
| Node | Type | Description |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| MiniMax Voice | `minimax.Voice` | Pick a MiniMax system voice and output its voice ID. |
|
|
14
|
+
| MiniMax Text to Speech | `minimax.TextToSpeech` | Synthesize speech with emotion, volume, pitch, speed, and language boost. |
|
|
15
|
+
| MiniMax Music Generation | `minimax.MusicGeneration` | Generate a full song with vocals from a style prompt and lyrics. |
|
|
16
|
+
| MiniMax Text to Image | `minimax.TextToImage` | Generate images with image-01 at a chosen aspect ratio. |
|
|
17
|
+
| MiniMax Text to Video | `minimax.TextToVideo` | Generate video from text with Hailuo / Director models. |
|
|
18
|
+
| MiniMax Image to Video | `minimax.ImageToVideo` | Animate a still image into a video. |
|
|
19
|
+
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
22
|
+
Set `MINIMAX_API_KEY` in NodeTool's secret store (Settings → API Keys) or as an
|
|
23
|
+
environment variable.
|
|
24
|
+
|
|
25
|
+
> MiniMax chat models and the generic Text to Image / Text to Video / Text to
|
|
26
|
+
> Speech nodes also work through the built-in MiniMax provider; this pack adds
|
|
27
|
+
> dedicated, discoverable nodes with the full set of MiniMax options.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-09-28T09:19:08.655Z
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NodeClass } from "@nodetool-ai/node-sdk";
|
|
2
|
+
export { MinimaxVoiceNode } from "./nodes/voice.js";
|
|
3
|
+
export { MinimaxTextToSpeechNode } from "./nodes/text-to-speech.js";
|
|
4
|
+
export { MinimaxMusicNode } from "./nodes/music.js";
|
|
5
|
+
export { MinimaxTextToImageNode } from "./nodes/text-to-image.js";
|
|
6
|
+
export { MinimaxTextToVideoNode } from "./nodes/text-to-video.js";
|
|
7
|
+
export { MinimaxImageToVideoNode } from "./nodes/image-to-video.js";
|
|
8
|
+
export declare const MINIMAX_NODES: readonly NodeClass[];
|
|
9
|
+
export declare function registerMinimaxNodes(registry: {
|
|
10
|
+
register: (nodeClass: NodeClass) => void;
|
|
11
|
+
}): void;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAO7C,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE;IAC7C,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C,GAAG,IAAI,CAIP"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { VOICE_NODES } from "./nodes/voice.js";
|
|
2
|
+
import { TEXT_TO_SPEECH_NODES } from "./nodes/text-to-speech.js";
|
|
3
|
+
import { MUSIC_NODES } from "./nodes/music.js";
|
|
4
|
+
import { TEXT_TO_IMAGE_NODES } from "./nodes/text-to-image.js";
|
|
5
|
+
import { TEXT_TO_VIDEO_NODES } from "./nodes/text-to-video.js";
|
|
6
|
+
import { IMAGE_TO_VIDEO_NODES } from "./nodes/image-to-video.js";
|
|
7
|
+
export { MinimaxVoiceNode } from "./nodes/voice.js";
|
|
8
|
+
export { MinimaxTextToSpeechNode } from "./nodes/text-to-speech.js";
|
|
9
|
+
export { MinimaxMusicNode } from "./nodes/music.js";
|
|
10
|
+
export { MinimaxTextToImageNode } from "./nodes/text-to-image.js";
|
|
11
|
+
export { MinimaxTextToVideoNode } from "./nodes/text-to-video.js";
|
|
12
|
+
export { MinimaxImageToVideoNode } from "./nodes/image-to-video.js";
|
|
13
|
+
export const MINIMAX_NODES = [
|
|
14
|
+
...VOICE_NODES,
|
|
15
|
+
...TEXT_TO_SPEECH_NODES,
|
|
16
|
+
...MUSIC_NODES,
|
|
17
|
+
...TEXT_TO_IMAGE_NODES,
|
|
18
|
+
...TEXT_TO_VIDEO_NODES,
|
|
19
|
+
...IMAGE_TO_VIDEO_NODES
|
|
20
|
+
];
|
|
21
|
+
export function registerMinimaxNodes(registry) {
|
|
22
|
+
for (const nodeClass of MINIMAX_NODES) {
|
|
23
|
+
registry.register(nodeClass);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD,GAAG,WAAW;IACd,GAAG,oBAAoB;IACvB,GAAG,WAAW;IACd,GAAG,mBAAmB;IACtB,GAAG,mBAAmB;IACtB,GAAG,oBAAoB;CACxB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,QAEpC;IACC,KAAK,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers and constants for the MiniMax node pack.
|
|
3
|
+
*
|
|
4
|
+
* Nodes talk to MiniMax's REST API directly (mirroring the elevenlabs-nodes
|
|
5
|
+
* pattern) rather than going through the runtime provider. That lets each node
|
|
6
|
+
* expose MiniMax-specific knobs — emotion, volume, pitch, lyrics, camera
|
|
7
|
+
* direction — that the generic provider interface does not carry. All network
|
|
8
|
+
* access goes through the global `fetch` so tests can stub it.
|
|
9
|
+
*
|
|
10
|
+
* Docs: https://platform.minimax.io/docs/api-reference/api-overview
|
|
11
|
+
*/
|
|
12
|
+
import { detectImageMime } from "@nodetool-ai/runtime";
|
|
13
|
+
export declare const MINIMAX_BASE_URL = "https://api.minimax.io";
|
|
14
|
+
/** Resolve the MiniMax API key from injected secrets or the environment. */
|
|
15
|
+
export declare function getMinimaxApiKey(secrets: Record<string, string>): string;
|
|
16
|
+
/** Written as a type alias, not an interface, so it stays `HeadersInit`-assignable. */
|
|
17
|
+
type MinimaxHeaders = {
|
|
18
|
+
Authorization: string;
|
|
19
|
+
"Content-Type": string;
|
|
20
|
+
};
|
|
21
|
+
export declare function minimaxHeaders(apiKey: string): MinimaxHeaders;
|
|
22
|
+
export interface MinimaxBaseResp {
|
|
23
|
+
status_code?: number;
|
|
24
|
+
status_msg?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Every MiniMax REST response carries `base_resp`. Endpoint-specific responses
|
|
28
|
+
* extend this; the fields they add stay optional because the API omits them on
|
|
29
|
+
* an error reply.
|
|
30
|
+
*/
|
|
31
|
+
export interface MinimaxResponse {
|
|
32
|
+
base_resp?: MinimaxBaseResp;
|
|
33
|
+
}
|
|
34
|
+
/** MiniMax embeds a `base_resp` on most responses; surface failures as errors. */
|
|
35
|
+
export declare function assertBaseResp(data: MinimaxResponse, context: string): void;
|
|
36
|
+
/** Decode MiniMax's hex-encoded audio payloads to raw bytes. */
|
|
37
|
+
export declare function hexToBytes(hex: string): Uint8Array;
|
|
38
|
+
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
39
|
+
/**
|
|
40
|
+
* MiniMax audio endpoints return either hex-encoded bytes or, when configured,
|
|
41
|
+
* a download URL. Normalise both to raw bytes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveAudioPayload(audio: string): Promise<Uint8Array>;
|
|
44
|
+
export declare const AUDIO_FORMAT_MIME: {
|
|
45
|
+
mp3: string;
|
|
46
|
+
wav: string;
|
|
47
|
+
flac: string;
|
|
48
|
+
pcm: string;
|
|
49
|
+
};
|
|
50
|
+
/** Inline media refs the nodes emit. `data` is raw base64, never a data URL. */
|
|
51
|
+
export interface MinimaxAudioRef {
|
|
52
|
+
type: string;
|
|
53
|
+
data: string;
|
|
54
|
+
content_type: string;
|
|
55
|
+
}
|
|
56
|
+
export interface MinimaxImageRef {
|
|
57
|
+
type: string;
|
|
58
|
+
data: string;
|
|
59
|
+
mimeType: string;
|
|
60
|
+
}
|
|
61
|
+
export interface MinimaxVideoRef {
|
|
62
|
+
type: string;
|
|
63
|
+
data: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Build an inline AudioRef from raw bytes for the given format.
|
|
67
|
+
*
|
|
68
|
+
* `data` is RAW base64 (no `data:` prefix); the MIME type goes in
|
|
69
|
+
* `content_type`. Asset-saving (`decodeAssetBytes`) and provider forwarding
|
|
70
|
+
* (`asUint8Array`) decode `data` directly with `Buffer.from(data, "base64")`,
|
|
71
|
+
* so a `data:` prefix would corrupt the bytes.
|
|
72
|
+
*/
|
|
73
|
+
export declare function audioRefFromBytes(bytes: Uint8Array, format: string): MinimaxAudioRef;
|
|
74
|
+
/**
|
|
75
|
+
* Guess an image MIME type from magic bytes; defaults to PNG. The local copy
|
|
76
|
+
* this replaced read `bytes[8]` with no length guard and matched WebP on two
|
|
77
|
+
* bytes of "RIFF".
|
|
78
|
+
*/
|
|
79
|
+
export declare const inferImageMime: typeof detectImageMime;
|
|
80
|
+
export declare function imageRefFromBytes(bytes: Uint8Array): MinimaxImageRef;
|
|
81
|
+
export declare function videoRefFromBytes(bytes: Uint8Array): MinimaxVideoRef;
|
|
82
|
+
/**
|
|
83
|
+
* Curated subset of MiniMax's 300+ system voices — enough for a UI picker.
|
|
84
|
+
* Any MiniMax voice_id (including cloned voices) can still be passed directly
|
|
85
|
+
* to the Text to Speech node.
|
|
86
|
+
*/
|
|
87
|
+
export declare const MINIMAX_VOICES: string[];
|
|
88
|
+
export declare const DEFAULT_VOICE = "English_Trustworth_Man";
|
|
89
|
+
export declare const MINIMAX_TTS_MODELS: string[];
|
|
90
|
+
/** "auto" is a node-only sentinel meaning "omit emotion from the request". */
|
|
91
|
+
export declare const MINIMAX_EMOTIONS: string[];
|
|
92
|
+
/** "auto" is a node-only sentinel meaning "let MiniMax autodetect the language". */
|
|
93
|
+
export declare const MINIMAX_LANGUAGE_BOOST: string[];
|
|
94
|
+
export declare const MINIMAX_MUSIC_MODELS: string[];
|
|
95
|
+
export declare const MINIMAX_IMAGE_ASPECTS: string[];
|
|
96
|
+
export declare const MINIMAX_T2V_MODELS: string[];
|
|
97
|
+
export declare const MINIMAX_I2V_MODELS: string[];
|
|
98
|
+
export declare const MINIMAX_VIDEO_RESOLUTIONS: string[];
|
|
99
|
+
export declare const MINIMAX_VIDEO_DURATIONS: number[];
|
|
100
|
+
/**
|
|
101
|
+
* Sanitize duration/resolution for a video request. They are Hailuo-only
|
|
102
|
+
* knobs — the 01-series models (T2V-01-Director, I2V-01-Director, S2V-01)
|
|
103
|
+
* are fixed at 6s/720P and reject both parameters. Within the Hailuo family,
|
|
104
|
+
* 512P exists only on Hailuo-02 and 10s clips render only at 768P; invalid
|
|
105
|
+
* combinations fall back to 768P (the API default) so MiniMax doesn't reject
|
|
106
|
+
* the request.
|
|
107
|
+
*/
|
|
108
|
+
export interface MinimaxVideoRenderSettings {
|
|
109
|
+
duration?: number;
|
|
110
|
+
resolution?: string;
|
|
111
|
+
}
|
|
112
|
+
export declare function videoRenderSettings(model: string, duration: number, resolution: string): MinimaxVideoRenderSettings;
|
|
113
|
+
interface VideoTaskOptions {
|
|
114
|
+
pollIntervalMs?: number;
|
|
115
|
+
maxAttempts?: number;
|
|
116
|
+
/** The run's cancellation: a cancelled run stops polling the paid job. */
|
|
117
|
+
signal?: AbortSignal;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Request body for `/v1/video_generation`. `first_frame_image` and
|
|
121
|
+
* `subject_reference` are mutually exclusive: the 01-series S2V model animates
|
|
122
|
+
* a character reference, every other model takes a first frame.
|
|
123
|
+
*/
|
|
124
|
+
export interface MinimaxVideoRequest extends MinimaxVideoRenderSettings {
|
|
125
|
+
model: string;
|
|
126
|
+
prompt?: string;
|
|
127
|
+
first_frame_image?: string;
|
|
128
|
+
subject_reference?: Array<{
|
|
129
|
+
type: string;
|
|
130
|
+
image: string[];
|
|
131
|
+
}>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Submit a video generation task, poll until it succeeds, and download the
|
|
135
|
+
* resulting file. Mirrors the runtime provider's flow so the node behaves
|
|
136
|
+
* identically while exposing MiniMax-specific request fields.
|
|
137
|
+
*/
|
|
138
|
+
export declare function generateVideo(apiKey: string, body: MinimaxVideoRequest, options?: VideoTaskOptions): Promise<Uint8Array>;
|
|
139
|
+
export {};
|
|
140
|
+
//# sourceMappingURL=minimax-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimax-base.d.ts","sourceRoot":"","sources":["../src/minimax-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAa,MAAM,sBAAsB,CAAC;AAMlE,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAEzD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIxE;AAED,uFAAuF;AACvF,KAAK,cAAc,GAAG;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAK7D;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAO3E;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAQlD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAW5E;AAED,eAAO,MAAM,i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E,MAAM,EAAY,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,0BAA0B,CAO5B;AAMD,UAAU,gBAAgB;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9D;AAkBD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,mBAAmB,EACzB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAwBrB"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers and constants for the MiniMax node pack.
|
|
3
|
+
*
|
|
4
|
+
* Nodes talk to MiniMax's REST API directly (mirroring the elevenlabs-nodes
|
|
5
|
+
* pattern) rather than going through the runtime provider. That lets each node
|
|
6
|
+
* expose MiniMax-specific knobs — emotion, volume, pitch, lyrics, camera
|
|
7
|
+
* direction — that the generic provider interface does not carry. All network
|
|
8
|
+
* access goes through the global `fetch` so tests can stub it.
|
|
9
|
+
*
|
|
10
|
+
* Docs: https://platform.minimax.io/docs/api-reference/api-overview
|
|
11
|
+
*/
|
|
12
|
+
import { detectImageMime, safeFetch } from "@nodetool-ai/runtime";
|
|
13
|
+
import { fetchWithRetry, pollUntilTerminal } from "@nodetool-ai/runtime/provider-transport";
|
|
14
|
+
export const MINIMAX_BASE_URL = "https://api.minimax.io";
|
|
15
|
+
/** Resolve the MiniMax API key from injected secrets or the environment. */
|
|
16
|
+
export function getMinimaxApiKey(secrets) {
|
|
17
|
+
const key = secrets?.MINIMAX_API_KEY || process.env.MINIMAX_API_KEY || "";
|
|
18
|
+
if (!key)
|
|
19
|
+
throw new Error("MINIMAX_API_KEY is not configured");
|
|
20
|
+
return key;
|
|
21
|
+
}
|
|
22
|
+
export function minimaxHeaders(apiKey) {
|
|
23
|
+
return {
|
|
24
|
+
Authorization: `Bearer ${apiKey}`,
|
|
25
|
+
"Content-Type": "application/json"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** MiniMax embeds a `base_resp` on most responses; surface failures as errors. */
|
|
29
|
+
export function assertBaseResp(data, context) {
|
|
30
|
+
const baseResp = data.base_resp;
|
|
31
|
+
if (baseResp && baseResp.status_code && baseResp.status_code !== 0) {
|
|
32
|
+
throw new Error(`MiniMax ${context} failed: ${baseResp.status_msg ?? "unknown error"} (code ${baseResp.status_code})`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Decode MiniMax's hex-encoded audio payloads to raw bytes. */
|
|
36
|
+
export function hexToBytes(hex) {
|
|
37
|
+
const clean = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
38
|
+
const len = Math.floor(clean.length / 2);
|
|
39
|
+
const out = new Uint8Array(len);
|
|
40
|
+
for (let i = 0; i < len; i++) {
|
|
41
|
+
out[i] = parseInt(clean.slice(i * 2, i * 2 + 2), 16);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
export function bytesToBase64(bytes) {
|
|
46
|
+
return Buffer.from(bytes).toString("base64");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* MiniMax audio endpoints return either hex-encoded bytes or, when configured,
|
|
50
|
+
* a download URL. Normalise both to raw bytes.
|
|
51
|
+
*/
|
|
52
|
+
export async function resolveAudioPayload(audio) {
|
|
53
|
+
if (/^https?:\/\//i.test(audio)) {
|
|
54
|
+
// Provider-returned download URL: caller-influenced data, so it goes
|
|
55
|
+
// through the SSRF-screened, redirect-checking fetch.
|
|
56
|
+
const dl = await safeFetch(audio);
|
|
57
|
+
if (!dl.ok) {
|
|
58
|
+
throw new Error(`Failed to download MiniMax audio from ${audio}`);
|
|
59
|
+
}
|
|
60
|
+
return new Uint8Array(await dl.arrayBuffer());
|
|
61
|
+
}
|
|
62
|
+
return hexToBytes(audio);
|
|
63
|
+
}
|
|
64
|
+
export const AUDIO_FORMAT_MIME = {
|
|
65
|
+
mp3: "audio/mpeg",
|
|
66
|
+
wav: "audio/wav",
|
|
67
|
+
flac: "audio/flac",
|
|
68
|
+
pcm: "audio/pcm"
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Build an inline AudioRef from raw bytes for the given format.
|
|
72
|
+
*
|
|
73
|
+
* `data` is RAW base64 (no `data:` prefix); the MIME type goes in
|
|
74
|
+
* `content_type`. Asset-saving (`decodeAssetBytes`) and provider forwarding
|
|
75
|
+
* (`asUint8Array`) decode `data` directly with `Buffer.from(data, "base64")`,
|
|
76
|
+
* so a `data:` prefix would corrupt the bytes.
|
|
77
|
+
*/
|
|
78
|
+
export function audioRefFromBytes(bytes, format) {
|
|
79
|
+
// SAFETY: the `in` check just established that `format` is one of the four
|
|
80
|
+
// own keys of AUDIO_FORMAT_MIME, so the indexed read hits a declared entry.
|
|
81
|
+
const contentType = format in AUDIO_FORMAT_MIME
|
|
82
|
+
? AUDIO_FORMAT_MIME[format]
|
|
83
|
+
: "audio/mpeg";
|
|
84
|
+
return {
|
|
85
|
+
type: "audio",
|
|
86
|
+
data: bytesToBase64(bytes),
|
|
87
|
+
content_type: contentType
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Guess an image MIME type from magic bytes; defaults to PNG. The local copy
|
|
92
|
+
* this replaced read `bytes[8]` with no length guard and matched WebP on two
|
|
93
|
+
* bytes of "RIFF".
|
|
94
|
+
*/
|
|
95
|
+
export const inferImageMime = detectImageMime;
|
|
96
|
+
export function imageRefFromBytes(bytes) {
|
|
97
|
+
return {
|
|
98
|
+
type: "image",
|
|
99
|
+
data: bytesToBase64(bytes),
|
|
100
|
+
mimeType: inferImageMime(bytes)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function videoRefFromBytes(bytes) {
|
|
104
|
+
return { type: "video", data: bytesToBase64(bytes) };
|
|
105
|
+
}
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// Catalogues
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
/**
|
|
110
|
+
* Curated subset of MiniMax's 300+ system voices — enough for a UI picker.
|
|
111
|
+
* Any MiniMax voice_id (including cloned voices) can still be passed directly
|
|
112
|
+
* to the Text to Speech node.
|
|
113
|
+
*/
|
|
114
|
+
export const MINIMAX_VOICES = [
|
|
115
|
+
"English_Trustworth_Man",
|
|
116
|
+
"English_CalmWoman",
|
|
117
|
+
"English_UpsetGirl",
|
|
118
|
+
"English_Gentle-voiced_man",
|
|
119
|
+
"English_Whispering_girl_v3",
|
|
120
|
+
"English_Diligent_Man",
|
|
121
|
+
"English_Graceful_Lady",
|
|
122
|
+
"English_ReservedYoungMan",
|
|
123
|
+
"English_PlayfulGirl",
|
|
124
|
+
"English_ManWithDeepVoice",
|
|
125
|
+
"English_GentleTeacher",
|
|
126
|
+
"English_MaturePartner",
|
|
127
|
+
"English_FriendlyPerson",
|
|
128
|
+
"English_MatureBoss",
|
|
129
|
+
"English_Debator",
|
|
130
|
+
"English_LovelyGirl",
|
|
131
|
+
"English_Steadymentor",
|
|
132
|
+
"English_Deep-VoicedGentleman",
|
|
133
|
+
"English_DecentYoungMan",
|
|
134
|
+
"English_SentimentalLady",
|
|
135
|
+
"English_ImposingManner",
|
|
136
|
+
"English_SadTeen",
|
|
137
|
+
"English_Wiselady",
|
|
138
|
+
"English_CaptivatingStoryteller",
|
|
139
|
+
"English_AttractiveGirl",
|
|
140
|
+
"English_DescendPriest",
|
|
141
|
+
"English_ConfidentWoman",
|
|
142
|
+
"English_CuteElf",
|
|
143
|
+
"English_radiant_girl",
|
|
144
|
+
"English_Insightful_Speaker",
|
|
145
|
+
"Chinese (Mandarin)_Warm_Bestie",
|
|
146
|
+
"Chinese (Mandarin)_Gentleman",
|
|
147
|
+
"Chinese (Mandarin)_Kind-hearted_Antie",
|
|
148
|
+
"Chinese (Mandarin)_Lyrical_Voice",
|
|
149
|
+
"Chinese (Mandarin)_Straightforward_Boy",
|
|
150
|
+
"Chinese (Mandarin)_Stubborn_Friend",
|
|
151
|
+
"Chinese (Mandarin)_Sweet_Girl_2",
|
|
152
|
+
"Chinese (Mandarin)_Gentle_Youth",
|
|
153
|
+
"Chinese (Mandarin)_Warm_Girl",
|
|
154
|
+
"Chinese (Mandarin)_Male_Announcer"
|
|
155
|
+
];
|
|
156
|
+
export const DEFAULT_VOICE = "English_Trustworth_Man";
|
|
157
|
+
export const MINIMAX_TTS_MODELS = [
|
|
158
|
+
"speech-2.8-hd",
|
|
159
|
+
"speech-2.8-turbo",
|
|
160
|
+
"speech-2.6-hd",
|
|
161
|
+
"speech-2.6-turbo",
|
|
162
|
+
"speech-02-hd",
|
|
163
|
+
"speech-02-turbo"
|
|
164
|
+
];
|
|
165
|
+
/** "auto" is a node-only sentinel meaning "omit emotion from the request". */
|
|
166
|
+
export const MINIMAX_EMOTIONS = [
|
|
167
|
+
"auto",
|
|
168
|
+
"neutral",
|
|
169
|
+
"happy",
|
|
170
|
+
"sad",
|
|
171
|
+
"angry",
|
|
172
|
+
"fearful",
|
|
173
|
+
"disgusted",
|
|
174
|
+
"surprised"
|
|
175
|
+
];
|
|
176
|
+
/** "auto" is a node-only sentinel meaning "let MiniMax autodetect the language". */
|
|
177
|
+
export const MINIMAX_LANGUAGE_BOOST = [
|
|
178
|
+
"auto",
|
|
179
|
+
"English",
|
|
180
|
+
"Chinese",
|
|
181
|
+
"Chinese,Yue",
|
|
182
|
+
"Japanese",
|
|
183
|
+
"Korean",
|
|
184
|
+
"Spanish",
|
|
185
|
+
"French",
|
|
186
|
+
"German",
|
|
187
|
+
"Italian",
|
|
188
|
+
"Portuguese",
|
|
189
|
+
"Russian",
|
|
190
|
+
"Arabic",
|
|
191
|
+
"Turkish",
|
|
192
|
+
"Dutch",
|
|
193
|
+
"Ukrainian",
|
|
194
|
+
"Vietnamese",
|
|
195
|
+
"Indonesian",
|
|
196
|
+
"Thai",
|
|
197
|
+
"Polish"
|
|
198
|
+
];
|
|
199
|
+
export const MINIMAX_MUSIC_MODELS = [
|
|
200
|
+
"music-2.6",
|
|
201
|
+
"music-1.5",
|
|
202
|
+
"music-01"
|
|
203
|
+
];
|
|
204
|
+
export const MINIMAX_IMAGE_ASPECTS = [
|
|
205
|
+
"1:1",
|
|
206
|
+
"16:9",
|
|
207
|
+
"4:3",
|
|
208
|
+
"3:2",
|
|
209
|
+
"2:3",
|
|
210
|
+
"3:4",
|
|
211
|
+
"9:16",
|
|
212
|
+
"21:9"
|
|
213
|
+
];
|
|
214
|
+
export const MINIMAX_T2V_MODELS = [
|
|
215
|
+
"MiniMax-Hailuo-2.3",
|
|
216
|
+
"MiniMax-Hailuo-02",
|
|
217
|
+
"T2V-01-Director"
|
|
218
|
+
];
|
|
219
|
+
export const MINIMAX_I2V_MODELS = [
|
|
220
|
+
"MiniMax-Hailuo-2.3",
|
|
221
|
+
"MiniMax-Hailuo-2.3-Fast",
|
|
222
|
+
"MiniMax-Hailuo-02",
|
|
223
|
+
"I2V-01-Director",
|
|
224
|
+
"S2V-01"
|
|
225
|
+
];
|
|
226
|
+
export const MINIMAX_VIDEO_RESOLUTIONS = ["512P", "768P", "1080P"];
|
|
227
|
+
export const MINIMAX_VIDEO_DURATIONS = [6, 10];
|
|
228
|
+
export function videoRenderSettings(model, duration, resolution) {
|
|
229
|
+
if (!model.startsWith("MiniMax-Hailuo"))
|
|
230
|
+
return {};
|
|
231
|
+
const d = duration >= 9 ? 10 : 6;
|
|
232
|
+
let r = resolution;
|
|
233
|
+
if (r === "512P" && model !== "MiniMax-Hailuo-02")
|
|
234
|
+
r = "768P";
|
|
235
|
+
if (r === "1080P" && d === 10)
|
|
236
|
+
r = "768P";
|
|
237
|
+
return { duration: d, resolution: r };
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Submit a video generation task, poll until it succeeds, and download the
|
|
241
|
+
* resulting file. Mirrors the runtime provider's flow so the node behaves
|
|
242
|
+
* identically while exposing MiniMax-specific request fields.
|
|
243
|
+
*/
|
|
244
|
+
export async function generateVideo(apiKey, body, options = {}) {
|
|
245
|
+
const submit = await fetch(`${MINIMAX_BASE_URL}/v1/video_generation`, {
|
|
246
|
+
method: "POST",
|
|
247
|
+
headers: minimaxHeaders(apiKey),
|
|
248
|
+
body: JSON.stringify(body),
|
|
249
|
+
signal: options.signal
|
|
250
|
+
});
|
|
251
|
+
if (!submit.ok) {
|
|
252
|
+
throw new Error(`MiniMax video_generation submit failed: ${submit.status} ${await submit.text()}`);
|
|
253
|
+
}
|
|
254
|
+
const submitData = await submit.json();
|
|
255
|
+
assertBaseResp(submitData, "video_generation submit");
|
|
256
|
+
const taskId = submitData.task_id;
|
|
257
|
+
if (!taskId) {
|
|
258
|
+
throw new Error(`MiniMax video_generation returned no task_id: ${JSON.stringify(submitData)}`);
|
|
259
|
+
}
|
|
260
|
+
const fileId = await pollVideoTask(apiKey, taskId, options);
|
|
261
|
+
return downloadFile(apiKey, fileId);
|
|
262
|
+
}
|
|
263
|
+
async function pollVideoTask(apiKey, taskId, options = {}) {
|
|
264
|
+
const pollIntervalMs = options.pollIntervalMs ?? 5000;
|
|
265
|
+
const maxAttempts = options.maxAttempts ?? 360;
|
|
266
|
+
const url = `${MINIMAX_BASE_URL}/v1/query/video_generation?task_id=${encodeURIComponent(taskId)}`;
|
|
267
|
+
const data = await pollUntilTerminal(async () => {
|
|
268
|
+
// The job is already submitted and billed: a 429 or a gateway 5xx on the
|
|
269
|
+
// status GET must back off, not throw the job away.
|
|
270
|
+
const res = await fetchWithRetry(url, {
|
|
271
|
+
headers: minimaxHeaders(apiKey),
|
|
272
|
+
signal: options.signal
|
|
273
|
+
});
|
|
274
|
+
if (!res.ok) {
|
|
275
|
+
throw new Error(`MiniMax video status failed: ${res.status} ${await res.text()}`);
|
|
276
|
+
}
|
|
277
|
+
const body = await res.json();
|
|
278
|
+
// Surface API-level failures (expired task, auth, rate limit) instead of
|
|
279
|
+
// polling an empty status until the timeout.
|
|
280
|
+
assertBaseResp(body, "video status");
|
|
281
|
+
return body;
|
|
282
|
+
}, {
|
|
283
|
+
intervalMs: pollIntervalMs,
|
|
284
|
+
maxAttempts,
|
|
285
|
+
signal: options.signal,
|
|
286
|
+
onFailure: (body) => new Error(`MiniMax video task failed: ${JSON.stringify(body.base_resp ?? body)}`),
|
|
287
|
+
onTimeout: () => new Error(`MiniMax video task timed out after ${maxAttempts * pollIntervalMs}ms`)
|
|
288
|
+
});
|
|
289
|
+
const fileId = data.file_id;
|
|
290
|
+
if (!fileId) {
|
|
291
|
+
throw new Error("MiniMax video task succeeded but returned no file_id");
|
|
292
|
+
}
|
|
293
|
+
return fileId;
|
|
294
|
+
}
|
|
295
|
+
async function downloadFile(apiKey, fileId) {
|
|
296
|
+
const url = `${MINIMAX_BASE_URL}/v1/files/retrieve?file_id=${encodeURIComponent(fileId)}`;
|
|
297
|
+
const res = await fetchWithRetry(url, { headers: minimaxHeaders(apiKey) });
|
|
298
|
+
if (!res.ok) {
|
|
299
|
+
throw new Error(`MiniMax files/retrieve failed: ${res.status} ${await res.text()}`);
|
|
300
|
+
}
|
|
301
|
+
const data = await res.json();
|
|
302
|
+
assertBaseResp(data, "files/retrieve");
|
|
303
|
+
const file = data.file;
|
|
304
|
+
const downloadUrl = file?.download_url ?? file?.downloadURL;
|
|
305
|
+
if (!downloadUrl) {
|
|
306
|
+
throw new Error(`MiniMax files/retrieve returned no download_url: ${JSON.stringify(data)}`);
|
|
307
|
+
}
|
|
308
|
+
// Provider-returned download URL — screened like every other one.
|
|
309
|
+
const dl = await safeFetch(downloadUrl);
|
|
310
|
+
if (!dl.ok) {
|
|
311
|
+
throw new Error(`Failed to download MiniMax file from ${downloadUrl}`);
|
|
312
|
+
}
|
|
313
|
+
return new Uint8Array(await dl.arrayBuffer());
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=minimax-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimax-base.js","sourceRoot":"","sources":["../src/minimax-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,iBAAiB,EAClB,MAAM,yCAAyC,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,OAA+B;IAC9D,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;IAC1E,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IAC/D,OAAO,GAAG,CAAC;AACb,CAAC;AAQD,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO;QACL,aAAa,EAAE,UAAU,MAAM,EAAE;QACjC,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAgBD,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,IAAqB,EAAE,OAAe;IACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;IAChC,IAAI,Q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AC;IAC3E,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,kCAAkC,GAAG,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CACnE,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAyB,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACpD,cAAc,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvB,MAAM,WAAW,GAAG,IAAI,EAAE,YAAY,IAAI,IAAI,EAAE,WAAW,CAAC;IAC5D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,oDAAoD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,kEAAkE;IAClE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseNode } from "@nodetool-ai/node-sdk";
|
|
2
|
+
import type { NodeClass } from "@nodetool-ai/node-sdk";
|
|
3
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
4
|
+
/** Output handles MinimaxImageToVideoNode.process() emits. */
|
|
5
|
+
type MinimaxImageToVideoNodeOutputs = {
|
|
6
|
+
output: {
|
|
7
|
+
type: string;
|
|
8
|
+
data: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare class MinimaxImageToVideoNode extends BaseNode {
|
|
12
|
+
static readonly nodeType = "minimax.ImageToVideo";
|
|
13
|
+
static readonly body = "content_card";
|
|
14
|
+
static readonly title = "MiniMax Image to Video";
|
|
15
|
+
static readonly description: string;
|
|
16
|
+
static readonly metadataOutputTypes: {
|
|
17
|
+
output: string;
|
|
18
|
+
};
|
|
19
|
+
static readonly inlineFields: string[];
|
|
20
|
+
static readonly inputFields: string[];
|
|
21
|
+
static readonly requiredSettings: string[];
|
|
22
|
+
static readonly autoSaveAsset = true;
|
|
23
|
+
model: any;
|
|
24
|
+
image: any;
|
|
25
|
+
prompt: any;
|
|
26
|
+
duration: any;
|
|
27
|
+
resolution: any;
|
|
28
|
+
process(context?: ProcessingContext): Promise<MinimaxImageToVideoNodeOutputs>;
|
|
29
|
+
}
|
|
30
|
+
export declare const IMAGE_TO_VIDEO_NODES: readonly NodeClass[];
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=image-to-video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-to-video.d.ts","sourceRoot":"","sources":["../../src/nodes/image-to-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAe9D,8DAA8D;AAC9D,KAAK,8BAA8B,GAAG;IACpC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC,CAAC;AAEF,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,MAAM,CAAC,QAAQ,CAAC,QAAQ,0BAA0B;IAClD,MAAM,CAAC,QAAQ,CAAC,IAAI,kBAAkB;IACtC,MAAM,CAAC,QAAQ,CAAC,KAAK,4BAA4B;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,SAQmB;IAC9C,MAAM,CAAC,QAAQ,CAAC,mBAAmB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