docs(plan): v0.2 adds Pi subagents and scheduled-jobs board

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
rootandClaude Fable 5.1 committed 2026-09-28 02:09:39 +08:00
1 parent b839ed4056
commit 16ab2a6c84
97 files changed
+592 -648

No files matched your search

+21 -33
View File
@@ -220,7 +220,7 @@ export function RenameDialog({ root, entry, onClose }: { root: FileRoot; entry:
onSuccess: (r) => {
const it = r.items[0];
const c = it?.candidates[0];
if (!it || !c) return toast.info("没有可信的识别结果,无法给出建议名");
if (!it || !c) return toast.info("识别结果不可信,没有建议名");
setName(suggestName(c, it.parsed, entry.name, isDir));
setErr(null);
},
@@ -255,7 +255,7 @@ export function RenameDialog({ root, entry, onClose }: { root: FileRoot; entry:
reason === "exists"
? "目标名已存在,不会覆盖"
: reason === "download_active"
? "做种中,改名会让下载器找不到文件"
? "正在做种,改名会让下载器找不到文件"
: filesErrorText(e),
);
},
@@ -325,14 +325,10 @@ export function RenameDialog({ root, entry, onClose }: { root: FileRoot; entry:
))}
</ul>
{pv.assetLocations > 0 ? (
<Notice tone="neutral">
将同步 {pv.assetLocations} 条资产位置,并写一条整理记录(action=rename)。
</Notice>
<Notice tone="neutral">将同步 {pv.assetLocations} 条资产位置,并写一条整理记录。</Notice>
) : null}
{pv.bindings.length > 0 ? (
<Notice tone="warning">
这是作品/季的绑定目录:将新建绑定并把旧绑定标记为已替代,之后新集入库进入新目录。
</Notice>
<Notice tone="warning">这是作品/季的绑定目录。改名后旧绑定标为已替代,新集入库到新目录。</Notice>
) : null}
</>
) : null}
@@ -422,7 +418,7 @@ export function TransferDialog({
onError: (e) => {
const reason = filesErrorReason(e);
if (reason === "plan_stale") {
setErr("源文件在预览后发生了变化,已重新生成预览,请再确认一次。");
setErr("源文件在预览后有变化,已重新预览。确认后再执行。");
runPreview(target, mode);
} else setErr(filesErrorText(e));
},
@@ -437,7 +433,7 @@ export function TransferDialog({
<DialogTitle>{mode === "move" ? "移动到…" : "复制到…"}</DialogTitle>
<DialogDescription>
{items.length === 1 ? baseName(items[0]?.path ?? "") : `${items.length} 项`} ·
先预览前后路径、冲突与空间,确认后才执行; 统一走可恢复的整理计划,跨卷为 Copy → 核验 → 删源。
先预览路径、冲突与空间,确认后执行。跨卷按复制 → 核验 → 删源执行。
</DialogDescription>
</DialogHeader>
<div className="grid min-h-0 gap-4 overflow-y-auto md:grid-cols-[15rem_minmax(0,1fr)]">
@@ -475,7 +471,7 @@ export function TransferDialog({
}}
/>
</div>
<p className="text-meta text-muted-foreground">只有可写的媒体库根能作为目标。</p>
<p className="text-meta text-muted-foreground">只有可写的库根能作为目标。</p>
</div>
<div className="min-w-0 space-y-3">
{target && targetRoot ? (
@@ -512,7 +508,7 @@ export function TransferDialog({
</div>
{hnrBlocked ? (
<Notice tone="destructive">
{plan.hnrBlocks.length} 项仍在做种且 H&R 未满足,不能 Move。可改用“复制”,或等 H&R 满足后再移动。
{plan.hnrBlocks.length} 项仍在做种且 H&R 未满足,不能移动。改用复制,或等 H&R 满足后再移动。
<button
type="button"
className="ml-1 underline"
@@ -526,7 +522,7 @@ export function TransferDialog({
</button>
</Notice>
) : null}
{plan.truncated ? <Notice tone="warning">源文件过多,预览只列出前一部分;执行覆盖全部。</Notice> : null}
{plan.truncated ? <Notice tone="warning">源文件过多,预览只列出前一部分,执行时处理全部。</Notice> : null}
<ul className="space-y-1.5">
{plan.pairs.map((p) => {
const sr = rootById.get(p.source.root);
@@ -654,7 +650,7 @@ export function DeleteDialog({
reason === "permanent_disabled"
? "系统设置未开启永久删除(files.allowPermanentDelete)"
: reason === "approval_required"
? "需要审批:API Key 删除每次都要一次性审批"
? "用 API Key 删除,每次都需要审批"
: filesErrorText(e),
);
},
@@ -666,9 +662,7 @@ export function DeleteDialog({
<DialogContent className="max-h-[92dvh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-2xl">
<DialogHeader>
<DialogTitle>{single ? `删除 ${single}?` : `删除 ${items.length} 项?`}</DialogTitle>
<DialogDescription>
删除前已做引用检查:做种任务、已登记资产、路径绑定。删除不会动下载器里的任务。
</DialogDescription>
<DialogDescription>已检查做种任务、已登记资产和路径绑定。下载器里的任务不受影响。</DialogDescription>
</DialogHeader>
<div className="min-h-0 space-y-3 overflow-y-auto">
{check.isPending ? (
@@ -715,7 +709,7 @@ export function DeleteDialog({
</p>
))}
{c.assets.length ? (
<p>已登记资产 {c.assets.length} 个(删除后退役,满足的 Slot 退回待处理)</p>
<p>已登记资产 {c.assets.length} 个(删除后退役,已满足的版本目标退回待处理)</p>
) : null}
{c.bindings.map((bd) => (
<p key={bd.bindingId}>
@@ -723,7 +717,7 @@ export function DeleteDialog({
{bd.seasonNumber != null ? ` 第 ${bd.seasonNumber} 季` : ""}
</p>
))}
{c.sharedInode ? <p>共享 inode(硬链接):只删除这一处链接,其他位置的文件不受影响</p> : null}
{c.sharedInode ? <p>共享 inode(硬链接):只删这一处链接,其他位置不受影响</p> : null}
</div>
</li>
);
@@ -736,7 +730,7 @@ export function DeleteDialog({
<span>
同时退役资产
<span className="block text-meta text-muted-foreground">
资产位置标为已移除、资产退役;满足的 Slot 退回待处理并建待处理事项。
资产位置标为已移除,资产退役;已满足的版本目标退回待处理。
</span>
</span>
</label>
@@ -746,9 +740,7 @@ export function DeleteDialog({
<input type="checkbox" className="mt-1" checked={unbind} onChange={(e) => setUnbind(e.target.checked)} />
<span>
解除路径绑定
<span className="block text-meta text-muted-foreground">
绑定标为已替代;之后该作品入库会重新选择目录。
</span>
<span className="block text-meta text-muted-foreground">绑定标为已替代,该作品下次入库重新选目录。</span>
</span>
</label>
) : null}
@@ -764,7 +756,7 @@ export function DeleteDialog({
/>
<span>
移入回收站
<span className="block text-meta text-muted-foreground">保留 7 天,期间可在回收站还原到原位置。</span>
<span className="block text-meta text-muted-foreground">到期前可在回收站还原。</span>
</span>
</label>
<label
@@ -782,7 +774,7 @@ export function DeleteDialog({
<span>
永久删除
<span className="block text-meta text-muted-foreground">
{isAdmin ? "不可恢复;需在系统设置开启后才可用。" : "仅管理员会话可用。"}
{isAdmin ? "不可恢复。需要在系统设置里开启。" : "仅管理员会话可用。"}
</span>
</span>
</label>
@@ -866,9 +858,7 @@ export function CopyPathDialog({ root, entry, onClose }: { root: FileRoot; entry
</li>
))}
</ul>
<p className="text-meta text-muted-foreground">
下载器与媒体服务器视角的路径按系统设置里的路径映射换算,见“系统设置 → 路径映射”。
</p>
<p className="text-meta text-muted-foreground">下载器与媒体服务器看到的路径按“系统设置 → 路径映射”换算。</p>
</DialogContent>
</Dialog>
);
@@ -890,9 +880,9 @@ export function ScrapeDialog({ entry, onClose }: { entry: FileEntry; onClose: ()
onSuccess: (r) => {
const extra =
r.nfo === "not_implemented" || r.images === "not_implemented"
? "NFO/图片投影尚未实现,本次只刷新了字段。"
? "还不支持写 NFO 和图片,只刷新了字段。"
: r.nfo === "skipped"
? "目标 NFO 不是本系统生成且字段已锁定,未覆盖。"
? "目标 NFO 不是本工具生成且字段已锁定,未覆盖。"
: "";
toast.success(`已提交元数据刷新${r.lockedFields.length ? `,${r.lockedFields.length} 个锁定字段不动` : ""}`, {
description: extra || undefined,
@@ -908,9 +898,7 @@ export function ScrapeDialog({ entry, onClose }: { entry: FileEntry; onClose: ()
<DialogContent>
<DialogHeader>
<DialogTitle>刮削 {asset.title}</DialogTitle>
<DialogDescription>
字段级刷新元数据:用户锁定的字段不动,不改路径。非本系统生成的 NFO 不会被覆盖。
</DialogDescription>
<DialogDescription>按字段刷新元数据,锁定的字段和路径不变。不覆盖非本工具生成的 NFO。</DialogDescription>
</DialogHeader>
<div className="flex items-center justify-between gap-3 text-caption">
写 NFO 到绑定目录
@@ -71,7 +71,7 @@ export function FileDetail({
label: "链接数",
value:
stat.data?.nlink != null
? `${stat.data.nlink}${stat.data.sharedInode ? "(共享 inode,禁止原地改写)" : ""}`
? `${stat.data.nlink}${stat.data.sharedInode ? "(共享 inode,不能原地改写)" : ""}`
: null,
},
{ label: "本机路径", value: `${root.hostPath}${e.path ? `/${e.path}` : ""}`, mono: true, wide: true },
@@ -110,7 +110,7 @@ export function FileDetail({
{e.asset.slotStatus ?? "查看"}
</Link>
) : (
"未满足任何 Slot"
"未满足任何版本目标"
),
},
{ label: "主资产", value: e.asset.isPrimary ? "是" : "否" },
@@ -162,7 +162,7 @@ export function FileDetail({
</li>
))}
</ul>
<p className="mt-1 text-meta text-muted-foreground">改名/移动此目录会同步修订绑定;元数据刷新不会改路径。</p>
<p className="mt-1 text-meta text-muted-foreground">改名或移动此目录会同步更新绑定;刷新元数据不改路径。</p>
</DetailSection>
) : null}
@@ -225,7 +225,7 @@ export function FileDetail({
/>
) : (
<p className="text-caption text-muted-foreground">
未登记文件不自动探测;点“探测”读取 ffprobe 摘要(缓存 24 小时)。
未登记文件不自动探测。点“探测”读取 ffprobe 摘要,缓存 24 小时。
</p>
)}
</DetailSection>
+1 -1
View File
@@ -684,7 +684,7 @@ function doMove(body: {
executed: null,
};
if (body.dryRun) return res;
if (hnrBlocks.length) throw new ApiRequestError("conflict", "download_active: 含 H&R 未满足的做种文件,不能 Move");
if (hnrBlocks.length) throw new ApiRequestError("conflict", "download_active: 含 H&R 未满足的做种文件,不能移动");
const succeeded: string[] = [];
const failed: { path: string; code: string; message: string }[] = [];
for (const p of pairs) {
+1 -1
View File
@@ -115,7 +115,7 @@ describe("状态与禁用原因", () => {
expect(opDisabledReason("rename", base, { kind: "download", writable: false })).toBeNull();
expect(opDisabledReason("scrape", base, lib)).toMatch(/未登记/);
expect(opDisabledReason("copyPath", { ...base, escape: true }, lib)).toBeNull();
expect(opDisabledReason("rename", { ...base, escape: true }, lib)).toMatch(/根之外/);
expect(opDisabledReason("rename", { ...base, escape: true }, lib)).toMatch(/登记目录之外/);
});
it("删除阻断分软硬", () => {
+7 -7
View File
@@ -8,7 +8,7 @@ export type StatusView = { label: string; tone: StatusTone; hint?: string };
/** 行主状态 → 徽标(文字必带,不只靠颜色) */
export function entryStatusView(e: Pick<FileEntry, "status" | "download" | "escape" | "type">): StatusView | null {
if (e.escape) return { label: "链接逃逸", tone: "destructive", hint: "符号链接指向登记根之外,已禁用所有操作" };
if (e.escape) return { label: "链接逃逸", tone: "destructive", hint: "符号链接指向登记目录之外,所有操作已禁用" };
const s: FileStatus = e.status;
switch (s) {
case "temp":
@@ -22,7 +22,7 @@ export function entryStatusView(e: Pick<FileEntry, "status" | "download" | "esca
return { label: "已登记", tone: "success" };
case "seeding":
return e.download?.hnr === "unsatisfied"
? { label: "做种中·H&R 未满足", tone: "warning", hint: "H&R 未满足前不能改名、删除或 Move" }
? { label: "做种中·H&R 未满足", tone: "warning", hint: "H&R 满足前不能改名、删除或移动" }
: { label: "做种中", tone: "neutral" };
case "unidentified":
return { label: "待识别", tone: "warning" };
@@ -65,7 +65,7 @@ export type FileOp =
/** 返回 null = 可用;否则为禁用原因 */
export function opDisabledReason(op: FileOp, e: FileEntry, root: Pick<FileRoot, "kind" | "writable">): string | null {
if (e.escape && op !== "copyPath") return "链接指向登记根之外,已禁用";
if (e.escape && op !== "copyPath") return "链接指向登记目录之外,已禁用";
// 下载根不能作为写入目标,但其中的文件可改名/删除/移出(服务端仍按引用检查拒绝做种项)
const rootWritable = root.writable || root.kind === "download";
const seeding = e.status === "seeding" || e.status === "downloading";
@@ -77,8 +77,8 @@ export function opDisabledReason(op: FileOp, e: FileEntry, root: Pick<FileRoot,
if (e.status === "temp") return "临时文件不能改名";
return null;
case "move":
if (!rootWritable) return "只读登记根,不能移出(可用“复制到…”)";
if (hnrBlocked) return "做种中且 H&R 未满足,不能 Move";
if (!rootWritable) return "只读根,不能移出。可用“复制到…”";
if (hnrBlocked) return "做种中且 H&R 未满足,不能移动";
return null;
case "delete":
if (!rootWritable) return "只读根,不能删除";
@@ -90,7 +90,7 @@ export function opDisabledReason(op: FileOp, e: FileEntry, root: Pick<FileRoot,
if (e.type === "file" && e.fileKind !== "video") return "只有视频或目录可识别/整理";
return null;
case "scrape":
return e.asset ? null : "未登记,请先识别并整理入库";
return e.asset ? null : "未登记,先识别并整理入库";
case "probe":
return e.type === "file" && e.fileKind === "video" ? null : "只能探测视频文件";
case "openMedia":
@@ -299,7 +299,7 @@ export function deleteBlockText(b: string | null): { text: string; soft: boolean
case "needs_retire":
return { text: "含已登记资产,需勾选“同时退役资产”", soft: true };
case "needs_unbind":
return { text: "是作品/季的绑定目录,需勾选“解除绑定”", soft: true };
return { text: "是作品/季的绑定目录,需勾选“解除路径绑定”", soft: true };
case "root_unavailable":
return { text: "根离线,不能确认文件状态", soft: false };
case "not_found":
@@ -249,8 +249,7 @@ export function OrganizeWizard({
<SheetHeader className="border-b border-[var(--shell-border)] px-5 py-4 pr-14">
<SheetTitle className="text-lead">整理向导</SheetTitle>
<SheetDescription>
{entries.length === 1 ? entries[0]?.name : `${entries.length} 项`} ·
确认后才落库;与自动整理产出同格式的整理记录。
{entries.length === 1 ? entries[0]?.name : `${entries.length} 项`} · 确认后才执行,结果写入整理记录。
</SheetDescription>
<ol className="mt-3 flex flex-wrap items-center gap-1.5" aria-label="步骤">
{STEPS.map((s, i) => (
@@ -279,7 +278,7 @@ export function OrganizeWizard({
{step === 0 ? (
identify.isPending ? (
<p className="flex items-center gap-2 text-caption text-muted-foreground">
<LoaderCircle className="h-4 w-4 animate-spin" /> 识别中:解析文件名并匹配本地作品与 TMDB…
<LoaderCircle className="h-4 w-4 animate-spin" /> 识别中:匹配本地作品与 TMDB…
</p>
) : identify.error ? (
<p className="text-caption text-destructive">{filesErrorText(identify.error, "识别失败")}</p>
@@ -288,7 +287,7 @@ export function OrganizeWizard({
<div className="flex flex-wrap items-center gap-2 text-caption">
<StatusBadge>{rows.length} 个视频</StatusBadge>
{problems.length ? (
<StatusBadge tone="warning">{problems.length} 项未决:选作品或排除</StatusBadge>
<StatusBadge tone="warning">{problems.length} 项待定:选作品或排除</StatusBadge>
) : (
<StatusBadge tone="success">全部已确认</StatusBadge>
)}
@@ -352,13 +351,13 @@ export function OrganizeWizard({
action === a ? "pill-selected" : "border-border hover:bg-foreground/[0.04]",
)}
>
<span className="block text-body font-medium">{a === "copy" ? "Copy" : "Move"}</span>
<span className="block text-body font-medium">{a === "copy" ? "复制" : "移动"}</span>
<span className="block text-meta text-muted-foreground">
{a === "copy"
? "保留源文件,做种不受影响"
: disabled
? "含做种中且 H&R 未满足的文件,不能 Move"
: "入库后删源;跨卷为 Copy → 核验 → 删源"}
? "含做种中且 H&R 未满足的文件,不能移动"
: "入库后删源;跨卷按复制 → 核验 → 删源"}
</span>
</button>
);
@@ -386,8 +385,8 @@ export function OrganizeWizard({
</div>
</section>
<section className="space-y-1 rounded-xl border border-border px-3 py-2.5 text-caption text-muted-foreground">
<p>命名:按系统设置里的命名模板重命名;已绑定的作品/季沿用原目录。</p>
<p>目标已存在:不覆盖,列为冲突进待处理。</p>
<p>命名:按系统设置的命名模板;已绑定的作品/季沿用原目录。</p>
<p>目标已存在:不覆盖,作为冲突进入待处理。</p>
</section>
</div>
) : null}
@@ -446,9 +445,7 @@ export function OrganizeWizard({
</div>
);
})}
<p className="text-caption text-muted-foreground">
整理在后台执行(逐文件可恢复),完成后列表会自动刷新状态。
</p>
<p className="text-caption text-muted-foreground">整理在后台执行,完成后列表自动刷新。</p>
</div>
)
) : null}
@@ -568,7 +565,7 @@ function GroupCard({ g, title }: { g: FilesOrganizeGroup; title?: Entity }) {
{g.error ? (
<p className="flex items-start gap-1.5 text-caption text-destructive">
<TriangleAlert className="mt-0.5 h-4 w-4 shrink-0" />
{g.error.message}(返回第 1 步修改后重新预览)
{g.error.message}(回到第 1 步修改后重新预览)
</p>
) : null}
{g.warnings.map((w) => (
@@ -714,7 +711,7 @@ function SlotSelect({
disabled={!entityId}
className="h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-2 text-caption disabled:opacity-50"
>
<option value="">Slot:自动</option>
<option value="">版本目标:自动</option>
{items.map((s) => (
<option key={s.id} value={s.id}>
{s.name}({s.status})
@@ -803,8 +800,7 @@ function EntityPicker({
{remoteOnly.length ? (
<p className="px-2 pt-2 text-meta text-muted-foreground">
TMDB 另有 {remoteOnly.length} 个未入库候选(
{remoteOnly.map((c) => `${c.title}${c.year ? ` ${c.year}` : ""}`).join("、")}),
需先在“身份与元数据”建立作品。
{remoteOnly.map((c) => `${c.title}${c.year ? ` ${c.year}` : ""}`).join("、")}), 先在“身份与元数据”建立作品。
</p>
) : null}
<div className="relative mt-2">