dreamfactory 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +29 -154
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -1,182 +1,57 @@
1
1
  # DreamFactory 梦工厂
2
2
 
3
- AI-powered short drama generator for digital characters. Interview [linkyun.co](https://linkyun.co) digital characters, build rich profiles, then generate scripts, storyboards, and videos — all from your terminal.
3
+ AI 短剧生成器 —— 采访数字角色、生成剧本、分镜、视频,全部在终端完成。
4
4
 
5
- ## Quick Start
5
+ ## 安装
6
6
 
7
- ```bash
8
- # Install
9
- npm install -g github:stelee410/dream-factory
7
+ 需要 **Node.js >= 20** 和 **ffmpeg**。
10
8
 
11
- # Configure API keys
12
- dreamfactory init
9
+ ```bash
10
+ # macOS 安装 ffmpeg(如已有可跳过)
11
+ brew install ffmpeg
13
12
 
14
- # Start creating
15
- dreamfactory
13
+ # 安装 DreamFactory
14
+ npm install -g dreamfactory
16
15
  ```
17
16
 
18
- ### Prerequisites
19
-
20
- - **Node.js** >= 20
21
- - **ffmpeg** — for video concatenation
22
- - macOS: `brew install ffmpeg`
23
- - Linux: `apt install ffmpeg`
24
-
25
- ## Configuration
26
-
27
- ### Where values are loaded
28
-
29
- The CLI reads **`./.env` first**, then **`~/.dreamfactory/.env`**. Each file only sets a key if it is **not already set** in `process.env`, so values already exported in your shell win, then the local file, then the global file fills remaining gaps (`packages/cli/src/load-env.ts`).
30
-
31
- Copy [`.env.example`](./.env.example) to `.env` as a starting point.
17
+ ## 获取账户
32
18
 
33
- ### linkyun.co vs third-party keys
19
+ DreamFactory 需要 [linkyun.co](https://linkyun.co) Creator 账户。
34
20
 
35
- | Key | Purpose |
36
- |-----|---------|
37
- | `LINKYUN_API_BASE` | linkyun.co API base URL (default: `https://linkyun.co`) |
38
- | `LINKYUN_API_KEY` | From linkyun **login** JSON `data.api_key` (same as `data.creator.api_key`). The linkyun-agent backend generates it as `sk-` + 48 hex characters (~51 chars). It is **not** OpenRouter (`sk-or-v1-…`) or Anthropic (`sk-ant-…`); keys with those prefixes do not come from this login API. |
39
- | `LINKYUN_WORKSPACE_CODE` | Workspace code from login — header `X-Workspace-Code`. |
40
- | `LINKYUN_USERNAME` | Optional; for display only. |
21
+ 通过以下方式获取邀请码注册:
41
22
 
42
- Prefer signing in inside the CLI and choosing to save the session to the local `.env`; then you do not need to hand-copy keys.
23
+ - **微信**:添加 `stephenliy`
24
+ - **Discord**:[https://discord.gg/52e7QPaX](https://discord.gg/52e7QPaX)
43
25
 
44
- **Where is the real `LINKYUN_API_KEY`?** The **canonical** value lives on the linkyun server (per creator). The CLI only **receives** it in the login JSON and keeps a copy in **memory**; optional **save to `.env`** writes that same value to disk. Anything wrong or placeholder-like in `.env` is just a stale or mistaken file — it is not authoritative.
45
-
46
- **Why does password login still work with a bad `LINKYUN_API_KEY` in `.env`?** Interactive login uses **only username + password** in `POST /api/v1/auth/login`; it does **not** read or check `LINKYUN_API_KEY` from the environment. The response body carries the real `api_key`, which replaces in-memory session for that run. **Auto-login from `.env`** (`tryRestoreFromEnv`) only requires non-empty strings and does not pre-validate the key; bad values show up later as API errors (e.g. 401) when listing characters or similar.
47
-
48
- **I use auto-restore, my `.env` key looks “wrong”, but listing characters still works — why?** `load-env` **never overwrites** a variable that already exists on `process.env`. If your shell, IDE / Cursor task env, Docker, or `~/.profile` has already exported `LINKYUN_API_KEY` / `LINKYUN_WORKSPACE_CODE`, those values win — the matching lines in the project `.env` are **skipped** when loading (`packages/cli/src/load-env.ts`). Auto-restore and character list then use the **effective** env vars, not necessarily what you see in the file. Compare: `grep ^LINKYUN_ .env` vs starting the CLI from the same terminal with `echo $LINKYUN_API_KEY` (if the latter is non-empty before launch, it overrides the file).
49
-
50
- | Key | Purpose |
51
- |-----|---------|
52
- | `LLM_BASE_URL` | Base URL for OpenAI-compatible chat API (default `https://openrouter.ai/api/v1`) |
53
- | `LLM_MODEL` | Model id (default `anthropic/claude-sonnet-4`) |
54
- | `LLM_API_KEY` | API key for that endpoint. If unset, `OPENROUTER_API_KEY` is still accepted. |
55
- | `WAN_API_KEY` | Storyboard images (Alibaba Wan2.7), optional |
56
- | `SEEDANCE_API_KEY` | Video generation (Seedance), optional |
57
-
58
- ### Global interactive setup
59
-
60
- Prompts for the global file keys (LLM, Wan, Seedance, and base URL — not linkyun session):
26
+ ## 使用
61
27
 
62
28
  ```bash
29
+ # 首次使用,配置 API 密钥
63
30
  dreamfactory init
64
- ```
65
-
66
- ## Usage
67
-
68
- ```bash
69
- dreamfactory # New project (agent mode)
70
- dreamfactory last # Resume most recent project
71
- dreamfactory <path> # Resume specific project
72
- dreamfactory init # Configure API keys
73
- dreamfactory linear # Linear mode (guided step-by-step)
74
- dreamfactory --help # Show help
75
- dreamfactory --version # Show version
76
- ```
77
-
78
- The current directory is your workspace. All project data is saved under `dreamfactory/projects/` in that directory.
79
-
80
- ## Agent Mode
81
-
82
- The default mode. An AI assistant interprets natural language and calls pipeline tools on your behalf.
83
31
 
84
- **What you can do:**
32
+ # 启动创作(Agent 模式 — AI 自动调度完整流程)
33
+ dreamfactory
85
34
 
86
- - Select a character and conduct an interview
87
- - Set a drama theme and director style
88
- - Generate plot outlines, scripts, and storyboards
89
- - Regenerate individual storyboard images or video shots
90
- - Reorder shots and re-concatenate the final video
91
- - Re-do any step at any point without starting over
35
+ # 线性模式(逐步引导,手动控制每个环节)
36
+ dreamfactory linear
92
37
 
93
- **Keyboard:**
94
- - `↑` / `↓` — browse input history (up to 100 entries)
95
- - `/status` — view project status
96
- - `/done` — end interview and generate dossier
97
- - `/quit` — exit
38
+ # 继续上次的项目
39
+ dreamfactory last
98
40
 
99
- ## Complete Flow
41
+ # 继续指定项目
42
+ dreamfactory <项目目录路径>
100
43
 
101
- ```
102
- Login (linkyun.co credentials)
103
- → Select digital character
104
- → Interview (5+ rounds of conversation)
105
- → Character dossier generated (personality, speech style, appearance)
106
- → Set drama theme (e.g. "职场逆袭", "甜蜜恋爱")
107
- → Set director style (cinematic, anime, documentary, etc.)
108
- → Choose from 3 AI-generated plot outlines
109
- → Full script generated (scenes, dialogues, camera directions)
110
- → Storyboard: script → shots with AI-generated images (Wan2.7)
111
- → Video: shots → MP4 clips → final concatenated video
44
+ # 查看帮助
45
+ dreamfactory --help
112
46
  ```
113
47
 
114
- ## Project Output
48
+ ### Agent 模式
115
49
 
116
- Each project is a timestamped directory:
50
+ 默认模式。AI 助手理解自然语言指令,自动调用流水线工具完成创作:选角、采访、生成剧本、分镜图、视频,支持随时回退重做任意步骤。
117
51
 
118
- ```
119
- dreamfactory/projects/YYYYMMDD_HHMMSS/
120
- ├── character.json # Selected character profile
121
- ├── dossier.json # Character dossier from interview
122
- ├── director-style.json # Director style selection
123
- ├── meta.json # Theme and metadata
124
- ├── outlines.json # Generated plot outlines
125
- ├── script.json # Full script (structured)
126
- ├── script.md # Full script (readable)
127
- ├── storyboard/
128
- │ ├── storyboard.json # Shot breakdown (structured)
129
- │ ├── storyboard.md # Shot breakdown (readable)
130
- │ └── shot_01.png ... # AI-generated storyboard images
131
- └── videos/
132
- ├── shot_01.mp4 ... # Individual shot videos
133
- ├── video-output.json
134
- └── final.mp4 # Concatenated final video
135
- ```
136
-
137
- ## Development
138
-
139
- ```bash
140
- git clone https://github.com/stelee410/dream-factory.git
141
- cd dream-factory
142
- pnpm install
143
- pnpm build # TypeScript compilation (monorepo)
144
- pnpm build:bundle # Single-file CLI bundle (tsup)
145
- npm link # Make `dreamfactory` available globally
146
- ```
147
-
148
- ### Architecture
149
-
150
- ```
151
- packages/
152
- ├── core/ # Shared business logic (SDK)
153
- │ ├── auth/ # linkyun.co authentication
154
- │ ├── character/ # Digital character management
155
- │ ├── ai/ # OpenRouter AI client + tool calling
156
- │ ├── interview/ # Character interview engine
157
- │ ├── director/ # Director style presets
158
- │ ├── script/ # Script generation engine
159
- │ ├── storyboard/ # Shot breakdown + Wan2.7 image generation
160
- │ ├── video/ # Seedance video generation + ffmpeg concat
161
- │ └── agent/ # AI agent (tool dispatch, project state)
162
- └── cli/ # Ink (React for CLI) application
163
- ├── screens/ # Login, Interview, Storyboard, Video, etc.
164
- └── AgentChat.tsx # Agent mode interactive chat
165
- ```
52
+ ### Linear 模式
166
53
 
167
- ### Tech Stack
168
-
169
- | Layer | Technology |
170
- |-------|-----------|
171
- | Runtime | Node.js 20+ / TypeScript |
172
- | CLI | [Ink](https://github.com/vadimdemedes/ink) (React for terminals) |
173
- | AI (text) | Claude via [OpenRouter](https://openrouter.ai) |
174
- | AI (images) | [Wan2.7](https://bailian.console.aliyun.com) (Alibaba Cloud Bailian) |
175
- | AI (video) | Seedance (image-to-video) |
176
- | Video | ffmpeg (concatenation) |
177
- | Build | tsup + esbuild (single-file bundle) |
178
- | Monorepo | pnpm workspaces |
179
- | API | [linkyun.co](https://linkyun.co) REST API |
54
+ 逐步引导模式,按固定顺序完成每个环节:登录 选角 → 采访 → 生成人物档案 → 设定主题 → 选择导演风格 → 生成大纲 → 生成剧本 → 生成分镜 → 生成视频。
180
55
 
181
56
  ## License
182
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreamfactory",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "DreamFactory — AI-powered short drama generator for digital characters",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,9 @@
28
28
  "node": ">=20"
29
29
  },
30
30
  "pnpm": {
31
- "onlyBuiltDependencies": ["esbuild"]
31
+ "onlyBuiltDependencies": [
32
+ "esbuild"
33
+ ]
32
34
  },
33
35
  "devDependencies": {
34
36
  "@types/node": "^22.0.0",