@dimples/apa 0.1.0-dev.1 → 0.1.0-dev.10
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/cli.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { spawn } from "node:child_process";
|
|
2
3
|
import { Command } from "commander";
|
|
3
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -6,11 +7,11 @@ import { serve } from "@hono/node-server";
|
|
|
6
7
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
7
8
|
import { Hono } from "hono";
|
|
8
9
|
import { existsSync } from "node:fs";
|
|
9
|
-
//#region ../../packages/shared/
|
|
10
|
+
//#region ../../packages/shared/dist/index.mjs
|
|
10
11
|
const mockProjects = [
|
|
11
12
|
{
|
|
12
13
|
id: "p-001",
|
|
13
|
-
cover: "
|
|
14
|
+
cover: "covers/p-001.jpg",
|
|
14
15
|
name: "长安十二时辰 · 重制",
|
|
15
16
|
logline: "上元节前夕,死囚张小敬受命拯救长安城,十二个时辰内揪出隐藏的阴谋。",
|
|
16
17
|
genre: "古装悬疑",
|
|
@@ -25,7 +26,7 @@ const mockProjects = [
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
id: "p-002",
|
|
28
|
-
cover: "
|
|
29
|
+
cover: "covers/p-002.jpg",
|
|
29
30
|
name: "星际摆渡人",
|
|
30
31
|
logline: "末日地球最后一位星际摆渡人,驾驶旧飞船护送三千沉睡者前往新家园。",
|
|
31
32
|
genre: "科幻",
|
|
@@ -46,7 +47,7 @@ const mockProjects = [
|
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
id: "p-003",
|
|
49
|
-
cover: "
|
|
50
|
+
cover: "covers/p-003.jpg",
|
|
50
51
|
name: "弄堂风云",
|
|
51
52
|
logline: "九十年代上海弄堂里,两家理发店三代人的恩怨与和解。",
|
|
52
53
|
genre: "年代剧",
|
|
@@ -67,7 +68,7 @@ const mockProjects = [
|
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
70
|
id: "p-005",
|
|
70
|
-
cover: "
|
|
71
|
+
cover: "covers/p-005.jpg",
|
|
71
72
|
name: "无声证词",
|
|
72
73
|
logline: "一位失聪法医通过微表情与物证破译凶案真相,却卷入旧日悬案。",
|
|
73
74
|
genre: "刑侦",
|
|
@@ -84,7 +85,7 @@ const mockProjects = [
|
|
|
84
85
|
const mockActors = [
|
|
85
86
|
{
|
|
86
87
|
id: "a-001",
|
|
87
|
-
avatar: "
|
|
88
|
+
avatar: "avatars/a-001.jpg",
|
|
88
89
|
name: "沈青",
|
|
89
90
|
persona: "眉眼冷峻的刑侦专家,惯用低沉嗓音压住全场;长于审讯对手戏",
|
|
90
91
|
tags: ["悬疑", "正剧"],
|
|
@@ -94,7 +95,7 @@ const mockActors = [
|
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
id: "a-002",
|
|
97
|
-
avatar: "
|
|
98
|
+
avatar: "avatars/a-002.jpg",
|
|
98
99
|
name: "白鹿",
|
|
99
100
|
persona: "清冷少女感,台词干净利落;在失重与奔跑戏里肢体控制力惊人",
|
|
100
101
|
tags: ["科幻", "青春"],
|
|
@@ -122,7 +123,7 @@ const mockActors = [
|
|
|
122
123
|
},
|
|
123
124
|
{
|
|
124
125
|
id: "a-005",
|
|
125
|
-
avatar: "
|
|
126
|
+
avatar: "avatars/a-005.jpg",
|
|
126
127
|
name: "段飞白",
|
|
127
128
|
persona: "满脸风霜的硬汉,不用台词也能演完整场内心戏",
|
|
128
129
|
tags: ["刑侦", "硬汉"],
|
|
@@ -212,8 +213,6 @@ const mockCostumes = [
|
|
|
212
213
|
createdAt: "2026-10-02T09:00:00.000Z"
|
|
213
214
|
}
|
|
214
215
|
];
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region ../../packages/shared/src/index.ts
|
|
217
216
|
/** 应用版本(package.json 同步) */
|
|
218
217
|
const APP_VERSION = "0.1.0";
|
|
219
218
|
//#endregion
|
|
@@ -260,7 +259,7 @@ function startServer(opts) {
|
|
|
260
259
|
//#region src/cli.ts
|
|
261
260
|
const program = new Command();
|
|
262
261
|
program.name("apa").description("APA — AI Pipeline for Auteur").version(APP_VERSION);
|
|
263
|
-
|
|
262
|
+
function startServe(opts) {
|
|
264
263
|
const port = Number.parseInt(opts.port, 10);
|
|
265
264
|
const url = `http://${opts.host}:${port}`;
|
|
266
265
|
startServer({
|
|
@@ -275,7 +274,13 @@ program.command("serve").description("启动 APA Web 服务,通过浏览器访
|
|
|
275
274
|
stdio: "ignore"
|
|
276
275
|
}).unref();
|
|
277
276
|
}
|
|
278
|
-
}
|
|
277
|
+
}
|
|
278
|
+
program.command("serve").description("启动 APA Web 服务,通过浏览器访问").option("-p, --port <port>", "监听端口", "4310").option("-H, --host <host>", "监听地址", "127.0.0.1").option("--open", "启动后自动打开浏览器", false).action(startServe);
|
|
279
|
+
program.action(() => startServe({
|
|
280
|
+
port: "4310",
|
|
281
|
+
host: "127.0.0.1",
|
|
282
|
+
open: false
|
|
283
|
+
}));
|
|
279
284
|
program.parse();
|
|
280
285
|
//#endregion
|
|
281
286
|
export {};
|