@yyc3/music-ai 0.0.0-stage → 2.0.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/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YanYuCloudCube™ (YYC³)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ YYC³(YanYuCloudCube™)· 言启象限 | 语枢未来
26
+ Words Initiate Quadrants, Language Serves as Core for Future
27
+ 万象归元于云枢 | 深栈智启新纪元
package/README.md CHANGED
@@ -1,3 +1,80 @@
1
- # Temporary Holding Version
1
+ # @yyc3/music-ai
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > AI 助手、AI 歌词生成、创作工作室与 MV 生成器。
4
+
5
+ | 属性 | 值 |
6
+ | --- | --- |
7
+ | 版本 | 2.0.0 |
8
+ | 定位 | AI 创作组件 |
9
+ | 许可证 | MIT |
10
+ | 仓库 | https://github.com/YYC-Cube/YYC3-MusAI |
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ pnpm add @yyc3/music-ai react
16
+ ```
17
+
18
+ ## 快速开始
19
+
20
+ ```tsx
21
+ import { AILyricsGenerator, CreationStudio } from '@yyc3/music-ai'
22
+
23
+ export function Studio({ open, setOpen, playlist }: any) {
24
+ return (
25
+ <>
26
+ <AILyricsGenerator isOpen={open} onClose={() => setOpen(false)} />
27
+ <CreationStudio
28
+ isOpen={open} onClose={() => setOpen(false)}
29
+ playlist={playlist} currentTrackIndex={0}
30
+ onCreateTrack={(lyrics, theme, audioBlobUrl) => console.log(theme, lyrics, audioBlobUrl)}
31
+ />
32
+ </>
33
+ )
34
+ }
35
+ ```
36
+
37
+ ## 导出清单
38
+
39
+ - AIAssistant
40
+ - AILyricsGenerator
41
+ - CreationStudio
42
+ - MVCreator
43
+
44
+ ## 关键 API
45
+
46
+ | 名称 | 说明 |
47
+ | --- | --- |
48
+ | `AIAssistant` | activeTips、onDismissTip、onExecuteAction、isListening、voiceFeedback、sessionInsight 等 |
49
+ | `AILyricsGenerator` | isOpen、onClose、onCreateTrack(lyrics, theme, audioBlobUrl?, compositionParams?) |
50
+ | `CreationStudio` | isOpen、onClose、playlist、currentTrackIndex、onShareWork、onOpenMV 等 |
51
+ | `MVCreator` | track、isPlaying、audioEnergy、frequencyData、currentTime、emotion 等 |
52
+
53
+ ## 说明
54
+
55
+ AI 组件通过回调向上层暴露创作结果,不自带网络层;模型调用请由宿主注入 Provider(见路线图的 AIProvider 契约)。
56
+
57
+ ## 兼容性
58
+
59
+ - React 19+(组件包 peer 依赖)
60
+ - TypeScript 5.6+ / Node.js 20.19+
61
+ - 现代浏览器(Chrome/Edge/Safari/Firefox 最近两个大版本)
62
+
63
+ ## 开发与验证
64
+
65
+ ```bash
66
+ pnpm --filter @yyc3/music-ai build
67
+ pnpm --filter @yyc3/music-ai typecheck
68
+ pnpm --filter @yyc3/music-ai lint
69
+ pnpm test:coverage
70
+ ```
71
+
72
+ ## 许可证
73
+
74
+ MIT © 2026 YanYuCloudCube™(YYC³)
75
+
76
+ <p align="center">
77
+ <b>YYC³</b>(YanYuCloudCube™ · 注册商标)<br>
78
+ 言启象限 | 语枢未来 — Words Initiate Quadrants, Language Serves as Core for Future<br>
79
+ <sub>© 2026 YanYuCloudCube™(YYC³)· <a href="mailto:admin@0379.email">admin@0379.email</a></sub>
80
+ </p>
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AITip, VoiceCommand } from '@yyc3/music-hooks';
3
+ interface AIAssistantProps {
4
+ activeTips: AITip[];
5
+ onDismissTip: (id: string) => void;
6
+ onExecuteAction: (actionKey: string) => void;
7
+ isListening: boolean;
8
+ onToggleListening: () => void;
9
+ voiceSupported: boolean;
10
+ voiceFeedback: string;
11
+ voiceHistory: VoiceCommand[];
12
+ sessionInsight: string;
13
+ isPlaying: boolean;
14
+ audioEnergy: number;
15
+ externalExpanded?: boolean;
16
+ onExternalExpandedChange?: (expanded: boolean) => void;
17
+ }
18
+ export declare const AIAssistant: React.FC<AIAssistantProps>;
19
+ export {};
20
+ //# sourceMappingURL=AIAssistant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIAssistant.d.ts","sourceRoot":"","sources":["../../src/components/AIAssistant.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM7D,UAAU,gBAAgB;IACxB,UAAU,EAAE,KAAK,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wBAAwB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AA4CD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwflD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { type CompositionParams } from '@yyc3/music-hooks';
3
+ interface AILyricsGeneratorProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ onCreateTrack?: (lyrics: string[], theme: AILyricsTheme, audioBlobUrl?: string, compositionParams?: CompositionParams) => void;
7
+ }
8
+ export type AILyricsTheme = 'happy' | 'sad' | 'energetic' | 'calm' | 'love';
9
+ export declare const AILyricsGenerator: React.FC<AILyricsGeneratorProps>;
10
+ export {};
11
+ //# sourceMappingURL=AILyricsGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AILyricsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/AILyricsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAuBrD,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,UAAU,sBAAsB;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChI;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAiB5E,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAoY9D,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { type CompositionParams } from '@yyc3/music-hooks';
3
+ import type { Track } from '@yyc3/music-data';
4
+ interface CreationStudioProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ onCreateTrack?: (lyrics: string[], theme: string, audioBlobUrl?: string, compositionParams?: CompositionParams) => void;
8
+ playlist: Track[];
9
+ currentTrackIndex: number;
10
+ onHaptic?: (pattern: string) => void;
11
+ onShareWork?: (work: CreatedWork) => void;
12
+ onOpenMV?: (workLyrics?: string[]) => void;
13
+ user?: any;
14
+ starPower?: number;
15
+ onStarPowerUpdate?: (sp: number) => void;
16
+ }
17
+ interface CreatedWork {
18
+ id: string;
19
+ title: string;
20
+ theme: string;
21
+ lyrics: string[];
22
+ createdAt: number;
23
+ mode: string;
24
+ }
25
+ export declare const CreationStudio: React.FC<CreationStudioProps>;
26
+ export {};
27
+ //# sourceMappingURL=CreationStudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreationStudio.d.ts","sourceRoot":"","sources":["../../src/components/CreationStudio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAchE,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAc9C,UAAU,mBAAmB;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,CACd,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,iBAAiB,KAClC,IAAI,CAAC;IACV,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AA6FD,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAinCxD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { Track } from '@yyc3/music-data';
3
+ interface MVCreatorProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ track: Track;
7
+ isPlaying: boolean;
8
+ audioEnergy: number;
9
+ frequencyData: Uint8Array;
10
+ currentTime: number;
11
+ emotion: string;
12
+ customLyrics?: string[] | null;
13
+ onHaptic?: (pattern: string) => void;
14
+ }
15
+ export declare const MVCreator: React.FC<MVCreatorProps>;
16
+ export {};
17
+ //# sourceMappingURL=MVCreator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MVCreator.d.ts","sourceRoot":"","sources":["../../src/components/MVCreator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAQxE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C,UAAU,cAAc;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,UAAU,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAiFD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAghB9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './components/AIAssistant';
2
+ export * from './components/AILyricsGenerator';
3
+ export * from './components/CreationStudio';
4
+ export * from './components/MVCreator';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}