@elizaos/plugin-suno 1.0.6-alpha.3 → 2.0.0-beta.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/auto-enable.ts +18 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +242 -371
- package/dist/index.js.map +1 -1
- package/package.json +62 -35
- package/biome.json +0 -41
- package/src/actions/customGenerate.ts +0 -156
- package/src/actions/extend.ts +0 -134
- package/src/actions/generate.ts +0 -145
- package/src/index.ts +0 -22
- package/src/providers/suno.ts +0 -78
- package/src/types/index.ts +0 -34
- package/tsconfig.json +0 -24
- package/tsup.config.ts +0 -11
package/auto-enable.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Auto-enable check for @elizaos/plugin-suno.
|
|
2
|
+
//
|
|
3
|
+
// Plugin manifest entry-point — referenced by package.json's
|
|
4
|
+
// `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
|
|
5
|
+
// no service init, no transitive imports of the full plugin runtime. The
|
|
6
|
+
// auto-enable engine loads dozens of these per boot.
|
|
7
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Enable when a Suno API key is in the environment, or when the user has
|
|
11
|
+
* explicitly selected Suno as the audio provider in own-key mode.
|
|
12
|
+
*/
|
|
13
|
+
export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
14
|
+
const apiKey = ctx.env.SUNO_API_KEY;
|
|
15
|
+
if (apiKey && apiKey.trim() !== "") return true;
|
|
16
|
+
const audio = ctx.config?.media?.audio;
|
|
17
|
+
return audio?.provider === "suno" && audio?.mode === "own-key";
|
|
18
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Action, IAgentRuntime, Memory, State, Provider, Plugin } from '@elizaos/core';
|
|
2
|
+
|
|
3
|
+
declare const musicGeneration: Action;
|
|
4
|
+
|
|
5
|
+
interface SunoConfig {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
declare class SunoProvider {
|
|
10
|
+
private apiKey;
|
|
11
|
+
private baseUrl;
|
|
12
|
+
static get(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<SunoProvider>;
|
|
13
|
+
constructor(config: SunoConfig);
|
|
14
|
+
get(_runtime: IAgentRuntime, _message: Memory, _state?: State): Promise<{
|
|
15
|
+
status: string;
|
|
16
|
+
}>;
|
|
17
|
+
request(runtime: IAgentRuntime, endpoint: string, options?: RequestInit): Promise<any>;
|
|
18
|
+
}
|
|
19
|
+
declare const sunoStatusProvider: Provider;
|
|
20
|
+
|
|
21
|
+
declare const sunoPlugin: Plugin;
|
|
22
|
+
|
|
23
|
+
export { musicGeneration as CustomGenerateMusic, musicGeneration as ExtendAudio, musicGeneration as GenerateMusic, musicGeneration as MusicGeneration, SunoProvider, sunoPlugin as default, sunoPlugin, sunoStatusProvider };
|