dsh-fish-soul 0.19.24 → 0.19.25
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/README.md +1 -1
- package/lib/client.behavior.js +32 -16
- package/lib/client.diag.js +17 -6
- package/lib/client.douyin.js +38 -32
- package/lib/client.js +112 -90
- package/lib/client.models.js +337 -56
- package/lib/client.persona.js +69 -42
- package/lib/client.scheduled-tasks.js +12 -13
- package/lib/client.soul.js +171 -73
- package/lib/panel.css +290 -32
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/client.behavior.js
CHANGED
|
@@ -148,23 +148,39 @@ window.__ModuleLoader__.load({
|
|
|
148
148
|
if (r?.ok) { notify("写好了"); load(); } else notify(r?.error ?? "没写成");
|
|
149
149
|
}
|
|
150
150
|
const topics = d.topics?.items ?? [];
|
|
151
|
+
const entries = d.entries ?? [];
|
|
151
152
|
const now = Date.now();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
:
|
|
166
|
-
h("
|
|
167
|
-
|
|
153
|
+
const splitEntry = (text) => {
|
|
154
|
+
const raw = String(text ?? "");
|
|
155
|
+
const m = /^(\d{4}-\d{2}-\d{2}) 的日记:([\s\S]*)$/.exec(raw);
|
|
156
|
+
return m ? { date: m[1], body: m[2] } : { date: null, body: raw };
|
|
157
|
+
};
|
|
158
|
+
return h(react.Fragment, null,
|
|
159
|
+
Group({ title: "每晚记录", aside: Button({ disabled: busy, onClick: writeNow }, busy ? "在写…" : "现在写一篇") },
|
|
160
|
+
Row({ title: "每晚写日记", desc: "记成她自己的私密记忆(群里不会想起),顺便想想明天想跟谁聊什么" },
|
|
161
|
+
h(Switch, { label: "每晚写日记", checked: c.enabled, onChange: (v) => save({ diary: { enabled: v } }) })),
|
|
162
|
+
c.enabled ? Row({ title: "几点写" }, h(NumField, { ui, value: c.hour, min: 18, max: 23, step: 1, label: "几点写", onSave: (n) => save({ diary: { hour: n } }) }), Muted("点以后")) : null,
|
|
163
|
+
Row({ title: "发到 QQ 空间", desc: "默认关;SnowLuma 不支持的话会在动态里记一条失败" },
|
|
164
|
+
h(Switch, { label: "发到 QQ 空间", checked: c.qzone, onChange: (v) => save({ diary: { qzone: v } }) }))),
|
|
165
|
+
topics.length === 0 ? null : Group({ title: "明天想聊的话题", aside: Tag(String(topics.length), "outline") },
|
|
166
|
+
h("div", { className: "fs-list" }, topics.map((x) => h("div", { className: "fs-read-item", key: `${x.who ?? ""}:${x.topic}` },
|
|
167
|
+
h("div", { className: "fs-read-head" },
|
|
168
|
+
Tag("想聊", "info"),
|
|
169
|
+
h("span", { className: "fs-read-text" }, `${x.who ? `${x.who}:` : ""}${x.topic}`),
|
|
170
|
+
h("span", { className: "fs-read-actions" }, IconButton("close", "删除", async () => {
|
|
171
|
+
const r = await api("POST", "/diary/topic-remove", { who: x.who ?? "", topic: x.topic });
|
|
172
|
+
if (r?.ok) { notify("删掉了"); load(); } else notify(r?.error ?? "删除失败");
|
|
173
|
+
}))))))),
|
|
174
|
+
Group({ title: "日记本", aside: entries.length ? Tag(String(entries.length), "outline") : null },
|
|
175
|
+
entries.length === 0 ? Empty("还没写过日记")
|
|
176
|
+
: entries.map((e) => {
|
|
177
|
+
const parsed = splitEntry(e.content);
|
|
178
|
+
return h("div", { className: "fs-diary-card", key: e.id },
|
|
179
|
+
h("div", { className: "fs-diary-head" },
|
|
180
|
+
h("span", { className: "fs-diary-date" }, parsed.date ?? "随笔"),
|
|
181
|
+
h("span", { className: "fs-diary-time" }, relTime(e.at, now))),
|
|
182
|
+
h("div", { className: "fs-diary-body" }, parsed.body));
|
|
183
|
+
})));
|
|
168
184
|
}
|
|
169
185
|
|
|
170
186
|
function BehaviorPane({ api, notify, relTime, ui, section = "habits" }) {
|
package/lib/client.diag.js
CHANGED
|
@@ -43,6 +43,7 @@ window.__ModuleLoader__.load({
|
|
|
43
43
|
function DiagPane({ api, notify, ui }) {
|
|
44
44
|
const { h, Group, Tag, Button, useConfirm = () => [async () => true, null] } = ui;
|
|
45
45
|
const [raw, setRaw] = react.useState(false);
|
|
46
|
+
const [level, setLevel] = react.useState("all");
|
|
46
47
|
const [data, load, err] = usePoll(api, "/diag-log", 15000);
|
|
47
48
|
const [confirm, confirmNode] = useConfirm();
|
|
48
49
|
if (!data) {
|
|
@@ -51,6 +52,9 @@ window.__ModuleLoader__.load({
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
const entries = data.entries ?? [];
|
|
55
|
+
const warnCount = entries.filter((e) => e.level === "warn").length;
|
|
56
|
+
const errCount = entries.filter((e) => e.level === "error").length;
|
|
57
|
+
const shownEntries = level === "all" ? entries : entries.filter((e) => e.level === level);
|
|
54
58
|
const pad = (n) => String(n).padStart(2, "0");
|
|
55
59
|
const fmtTime = (ms) => {
|
|
56
60
|
const d = new Date(ms);
|
|
@@ -95,12 +99,19 @@ window.__ModuleLoader__.load({
|
|
|
95
99
|
? h("div", { className: "fs-empty" }, "还没有记录。重启宿主后回来就能看到启动过程。")
|
|
96
100
|
: raw
|
|
97
101
|
? h("pre", { className: "fs-report fs-diag-raw" }, JSON.stringify(entries, null, 2))
|
|
98
|
-
: h(
|
|
99
|
-
|
|
100
|
-
h("
|
|
101
|
-
|
|
102
|
-
h("
|
|
103
|
-
|
|
102
|
+
: h(react.Fragment, null,
|
|
103
|
+
h("div", { className: "fs-pills fs-filter-bar", role: "group", "aria-label": "日志级别筛选" },
|
|
104
|
+
h("button", { type: "button", className: "fs-pill", "aria-pressed": level === "all", onClick: () => setLevel("all") }, `全部 ${entries.length}`),
|
|
105
|
+
h("button", { type: "button", className: "fs-pill", "aria-pressed": level === "warn", onClick: () => setLevel("warn") }, `警告 ${warnCount}`),
|
|
106
|
+
h("button", { type: "button", className: "fs-pill", "aria-pressed": level === "error", onClick: () => setLevel("error") }, `错误 ${errCount}`)),
|
|
107
|
+
shownEntries.length === 0
|
|
108
|
+
? h("div", { className: "fs-empty" }, "这个级别下没有日志。")
|
|
109
|
+
: h("div", { className: "fs-diag-list" },
|
|
110
|
+
shownEntries.map((e, i) => h("div", { key: `${e.at}-${e.key ?? i}`, className: "fs-diag-row", "data-level": e.level },
|
|
111
|
+
h("span", { className: "fs-diag-time" }, fmtTime(e.at)),
|
|
112
|
+
e.level === "error" ? Tag("错误", "danger") : e.level === "warn" ? Tag("警告", "warning") : null,
|
|
113
|
+
h("span", { className: "fs-diag-label", "data-level": e.level }, e.label),
|
|
114
|
+
h("span", { className: "fs-diag-detail" }, describe(e)))))),
|
|
104
115
|
confirmNode);
|
|
105
116
|
}
|
|
106
117
|
|
package/lib/client.douyin.js
CHANGED
|
@@ -225,31 +225,31 @@ window.__ModuleLoader__.load({
|
|
|
225
225
|
`你填的 ${d.channel.identityState.masterUidMismatch.filled} 跟已学到的抖音身份对不上,多半填成了账号短号。留空就行;已学到的身份:${d.channel.identityState.masterUidMismatch.learned.join(" / ")}`,
|
|
226
226
|
undefined, true))
|
|
227
227
|
: null,
|
|
228
|
-
(candidates ?? []).length === 0 ? null : Group({ title: "待确认的抖音身份" },
|
|
229
|
-
Muted("请核对 uid 是不是你自己,确认后点「是我」。"),
|
|
230
|
-
...(candidates ?? []).map((c) => Row({ key: c.name, title: `${c.name} → QQ ${c.qq}`,
|
|
231
|
-
meta: `抖音 uid ${c.uid}${c.at ? ` · ${new Date(c.at).toLocaleString()}` : ""}` },
|
|
232
|
-
Button({ variant: "primary", disabled: busy, onClick: async () => {
|
|
233
|
-
setBusy(true);
|
|
234
|
-
try {
|
|
235
|
-
const r = await api("POST", "/douyin/uin-confirm", { name: c.name });
|
|
236
|
-
if (r?.ok) { notify(`已确认:${c.name}`); await loadCandidates(); refresh(); }
|
|
237
|
-
else notify(r?.error ?? "没确认成");
|
|
238
|
-
} finally { setBusy(false); }
|
|
239
|
-
} }, "是我"),
|
|
240
|
-
Button({ variant: "outline", disabled: busy, onClick: async () => {
|
|
241
|
-
setBusy(true);
|
|
242
|
-
try {
|
|
243
|
-
const r = await api("POST", "/douyin/uin-dismiss", { name: c.name });
|
|
244
|
-
if (r?.ok) { notify(`已忽略:${c.name}`); await loadCandidates(); refresh(); }
|
|
245
|
-
else notify(r?.error ?? "操作失败");
|
|
246
|
-
} finally { setBusy(false); }
|
|
247
|
-
} }, "不是我")))),
|
|
248
228
|
Row({ title: "回所有能私信她的人", desc: d.replyAll ? "建议在抖音隐私设置里把「谁可以私信我」设为互关好友" : null },
|
|
249
229
|
sw("回所有能私信她的人", d.replyAll === true, (v) => save({ top: { replyAll: v } }))),
|
|
250
230
|
Row({ title: "超过多久的消息只记不回", desc: "断线补拉或重启后积压的老消息,超过这个时间就只记进记忆、不回复" },
|
|
251
231
|
Num({ min: 1, max: 1440, value: form.replyWindowMinutes, "aria-label": "分钟", onChange: (e) => patch({ replyWindowMinutes: e.target.value }), onBlur: () => save({ top: { replyWindowMinutes: form.replyWindowMinutes === "" ? 120 : Number(form.replyWindowMinutes) } }) }), Muted("分钟")),
|
|
252
232
|
d.replyAll ? null : Row({ title: "白名单", stack: true }, Area({ ...bind("allowList"), "aria-label": "白名单", placeholder: "对方的抖音数字 uid,每行一个;昵称不参与放行" }))),
|
|
233
|
+
(candidates ?? []).length === 0 ? null : Group({ title: "待确认的抖音身份" },
|
|
234
|
+
Muted("请核对 uid 是不是你自己,确认后点「是我」。"),
|
|
235
|
+
...(candidates ?? []).map((c) => Row({ key: c.name, title: `${c.name} → QQ ${c.qq}`,
|
|
236
|
+
meta: `抖音 uid ${c.uid}${c.at ? ` · ${new Date(c.at).toLocaleString()}` : ""}` },
|
|
237
|
+
Button({ variant: "primary", disabled: busy, onClick: async () => {
|
|
238
|
+
setBusy(true);
|
|
239
|
+
try {
|
|
240
|
+
const r = await api("POST", "/douyin/uin-confirm", { name: c.name });
|
|
241
|
+
if (r?.ok) { notify(`已确认:${c.name}`); await loadCandidates(); refresh(); }
|
|
242
|
+
else notify(r?.error ?? "没确认成");
|
|
243
|
+
} finally { setBusy(false); }
|
|
244
|
+
} }, "是我"),
|
|
245
|
+
Button({ variant: "outline", disabled: busy, onClick: async () => {
|
|
246
|
+
setBusy(true);
|
|
247
|
+
try {
|
|
248
|
+
const r = await api("POST", "/douyin/uin-dismiss", { name: c.name });
|
|
249
|
+
if (r?.ok) { notify(`已忽略:${c.name}`); await loadCandidates(); refresh(); }
|
|
250
|
+
else notify(r?.error ?? "操作失败");
|
|
251
|
+
} finally { setBusy(false); }
|
|
252
|
+
} }, "不是我")))),
|
|
253
253
|
Group({ title: "群聊" },
|
|
254
254
|
Row({ title: "群里被叫到时回", desc: "群聊按说话的人分开认,不会当成一个人;没人 @ 她或叫她名字时只看不说" },
|
|
255
255
|
sw("群里被叫到时回", d.groupReply === true, (v) => save({ top: { groupReply: v } }))),
|
|
@@ -272,9 +272,7 @@ window.__ModuleLoader__.load({
|
|
|
272
272
|
browseOn ? Row({ title: "刷到有意思的发给你", desc: br.shareInDm !== false ? "带链接和感受发到你的抖音私信,没连上就发 QQ;一天最多 2 条" : "带链接和感受发到你的 QQ 私聊;一天最多 2 条" }, sw("刷到有意思的发给你", br.share !== false, (v) => save({ browse: { share: v } }))) : null,
|
|
273
273
|
browseOn && br.share !== false ? Row({ title: "在抖音私信里分享", desc: "要填「主人的名字」、开自动回复" }, sw("在抖音私信里分享", br.shareInDm !== false, (v) => save({ browse: { shareInDm: v } }))) : null,
|
|
274
274
|
browseOn && br.share !== false && br.shareInDm !== false ? Row({ title: "发原生视频卡片", desc: "在抖音私信里发点开就播的原生卡片;需专用浏览器开着,且按收件人身份锁定" }, sw("发原生视频卡片", d.shareCard === true, (v) => save({ top: { shareCard: v } }))) : null),
|
|
275
|
-
Group({ title: "
|
|
276
|
-
post.enabled ? Tag(`今天发了 ${so.post?.todayCount ?? 0} / ${post.perDay ?? 1}`, "outline") : null,
|
|
277
|
-
video.enabled ? Tag(`今天视频 ${so.video?.todayCount ?? 0} / ${video.perDay ?? 1}`, "outline") : null) : null },
|
|
275
|
+
Group({ title: "图文发布", aside: post.enabled ? Tag(`今天发了 ${so.post?.todayCount ?? 0} / ${post.perDay ?? 1}`, "outline") : null },
|
|
278
276
|
Row({ title: "自己发图文", desc: "把想说的话做成文字卡片,在创作者中心发图文;创作者中心可能要单独登录一次" },
|
|
279
277
|
post.enabled ? Button({ disabled: busy || so.post?.running === true || so.video?.running === true || Boolean(so.postPending) || d.enabled !== true || !running, onClick: async () => {
|
|
280
278
|
if (await confirm({ title: "现在发一条图文?", description: "将在抖音创作者中心公开发布一条图文动态。", confirmLabel: "发布" })) await act("/douyin/post-now", { text: noteText.trim() }, "发出去了", "没发成");
|
|
@@ -282,6 +280,10 @@ window.__ModuleLoader__.load({
|
|
|
282
280
|
sw("自己发图文", post.enabled === true, (v) => save({ post: { enabled: v } }))),
|
|
283
281
|
post.enabled ? Row({ title: "指定内容", desc: "留空则按她此刻的心情随机写一条" }, Input({ value: noteText, onChange: (e) => setNoteText(e.target.value), placeholder: "想发什么就写在这里", "aria-label": "图文指定内容" })) : null,
|
|
284
282
|
post.enabled ? Row({ title: "每天最多" }, Num({ min: 0, max: 5, "aria-label": "每天最多几条", ...bind("postPerDay") }), Muted("条")) : null,
|
|
283
|
+
so.postPending && so.postPending.kind !== "video" ? Row({ title: "图文结果待核实", meta: so.postPending.text || "先到创作者中心核实,不会自动重发" },
|
|
284
|
+
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "not_published" }, "已记录为未发布", "记录失败") }, "已核实未发布"),
|
|
285
|
+
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "published" }, "已记录为已发布", "记录失败") }, "已核实已发布")) : null),
|
|
286
|
+
Group({ title: "AI 视频生成", aside: video.enabled ? Tag(`今天视频 ${so.video?.todayCount ?? 0} / ${video.perDay ?? 1}`, "outline") : null },
|
|
285
287
|
// 视频:生成要调付费接口(按条计费)—— 开关旁边必须写清楚这是花钱的操作,点击前也要二次确认。
|
|
286
288
|
Row({ title: "自己发视频", desc: "生成视频要调用付费接口(按条计费),每发一条都真花钱;创作者中心也要先登录过" },
|
|
287
289
|
video.enabled ? Button({ variant: "ghost", disabled: busy || so.video?.running === true || so.post?.running === true || Boolean(so.postPending) || d.enabled !== true || !running, onClick: async () => {
|
|
@@ -304,9 +306,10 @@ window.__ModuleLoader__.load({
|
|
|
304
306
|
Select({ value: form.videoResolution, "aria-label": "分辨率", onChange: (e) => { const v = e.target.value; patch({ videoResolution: v }); save({ video: { resolution: v } }); } },
|
|
305
307
|
...VIDEO_RESOLUTIONS.map((o) => h("option", { key: o.value, value: o.value }, o.label)))) : null,
|
|
306
308
|
video.enabled ? Row({ title: "每天最多" }, Num({ min: 0, max: 5, "aria-label": "每天最多几条视频", ...bind("videoPerDay") }), Muted("条")) : null,
|
|
307
|
-
so.postPending
|
|
309
|
+
so.postPending && so.postPending.kind === "video" ? Row({ title: "视频结果待核实", meta: so.postPending.text || "先到创作者中心核实,不会自动重发" },
|
|
308
310
|
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "not_published" }, "已记录为未发布", "记录失败") }, "已核实未发布"),
|
|
309
|
-
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "published" }, "已记录为已发布", "记录失败") }, "已核实已发布")) : null,
|
|
311
|
+
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "published" }, "已记录为已发布", "记录失败") }, "已核实已发布")) : null),
|
|
312
|
+
Group({ title: "评论互动" },
|
|
310
313
|
Row({ title: "回评论", desc: "每 20 分钟看看最近 3 个作品的评论区;抖音可能要短信验证,碰到会停下来提醒你" },
|
|
311
314
|
cm.enabled ? Button({ disabled: busy || d.enabled !== true || !running, onClick: () => act("/douyin/comments-now", {}, "看完了", "没看成") }, "现在看一眼") : null,
|
|
312
315
|
sw("回评论", cm.enabled === true, (v) => save({ comments: { enabled: v } }))),
|
|
@@ -315,14 +318,17 @@ window.__ModuleLoader__.load({
|
|
|
315
318
|
sw("允许发表情", cm.emoji === true, (v) => save({ comments: { emoji: v } }))) : null,
|
|
316
319
|
so.blockedUntil ? Row({ title: "等验证" }, State("error", `抖音要验证,${Math.max(1, Math.ceil((so.blockedUntil - Date.now()) / 3600000))} 小时内先不试;去浏览器里验证一下`, undefined, true)) : null,
|
|
317
320
|
so.lastError ? Row({ title: "上次出错" }, State("error", so.lastError)) : null,
|
|
318
|
-
socialLog.length === 0 ? null : h("div", { className: "fs-list" }, socialLog.map((x) =>
|
|
321
|
+
socialLog.length === 0 ? null : h("div", { className: "fs-list" }, socialLog.map((x) => h("div", { className: "fs-read-item", key: x.key },
|
|
322
|
+
h("div", { className: "fs-read-head" }, x.tag, h("span", { className: "fs-read-text" }, x.text)),
|
|
323
|
+
h("div", { className: "fs-read-foot" }, h("span", null, relTime(x.at, Date.now()))))))),
|
|
319
324
|
recent.length === 0 ? null : Group({ title: "最近看过" },
|
|
320
|
-
h("div", { className: "fs-list" }, recent.map((v) =>
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
h("div", { className: "fs-list" }, recent.map((v) => h("div", { className: "fs-read-item", key: v.id },
|
|
326
|
+
h("div", { className: "fs-read-head" },
|
|
327
|
+
Tag(v.liked ? "赞" : v.skipped ? "划走" : "推荐", v.liked ? "danger" : undefined),
|
|
328
|
+
h("span", { className: "fs-read-text" }, `${v.title || "没写文案"}${v.impression ? ` · ${v.impression}` : ""}`)),
|
|
329
|
+
h("div", { className: "fs-read-foot" },
|
|
330
|
+
h("a", { href: `https://www.douyin.com/video/${v.id}`, target: "_blank", rel: "noreferrer" }, v.author || "打开"),
|
|
331
|
+
h("span", null, relTime(v.seenAt, Date.now()))))))),
|
|
326
332
|
Group({ title: "页面自检" },
|
|
327
333
|
Row({ title: "能否认出私信页" },
|
|
328
334
|
ch.canary ? State(ch.canary.ok ? "done" : "error", relTime(ch.canary.at, Date.now()), ch.canary.ok ? (ch.canary.recovered?.ok === true ? "上次没通过,刷新后好了" : "上次通过") : "上次没通过") : null,
|
package/lib/client.js
CHANGED
|
@@ -520,6 +520,12 @@ window.__ModuleLoader__.load({
|
|
|
520
520
|
const num = (name, label, min, max, fallback) => Num({ min, max, value: form[name], "aria-label": label,
|
|
521
521
|
onChange: (e) => patch({ [name]: e.target.value === "" ? "" : Number(e.target.value) }), onBlur: () => save({ [name]: form[name] === "" ? fallback : form[name] }) });
|
|
522
522
|
|
|
523
|
+
const cap = Math.max(0, Number(form.dailyMaxCount) || 0);
|
|
524
|
+
const used = Math.max(0, Number(today.proactiveCount) || 0);
|
|
525
|
+
const ratio = cap > 0 ? used / cap : 0;
|
|
526
|
+
const pct = Math.min(100, Math.max(0, ratio * 100));
|
|
527
|
+
const quotaTone = ratio >= 1 ? "danger" : ratio >= 0.8 ? "warn" : undefined;
|
|
528
|
+
|
|
523
529
|
return h(react.Fragment, null,
|
|
524
530
|
h("section", { className: "fs-life-overview" },
|
|
525
531
|
h("div", { className: "fs-now" },
|
|
@@ -528,23 +534,32 @@ window.__ModuleLoader__.load({
|
|
|
528
534
|
h("span", { className: "fs-now-meta" },
|
|
529
535
|
today.dailyMoodTone ? Tag(today.dailyMoodTone) : null,
|
|
530
536
|
clock.isAccelerated || scale > 1 ? Tag(`${scale}×`, "warning") : null,
|
|
531
|
-
h("span",
|
|
537
|
+
h("span", { className: "num" }, fmtClock(clock.virtualNowMs)))),
|
|
532
538
|
schedule.length > 0 ? h("div", { className: "fs-schedule" },
|
|
533
|
-
schedule.map((s, i) =>
|
|
534
|
-
|
|
539
|
+
schedule.map((s, i) => {
|
|
540
|
+
const active = s.range === slot.range;
|
|
541
|
+
return h("div", { className: "fs-slot", key: i, "aria-current": active },
|
|
542
|
+
h("div", { className: "fs-slot-head" },
|
|
543
|
+
h("span", null, s.range),
|
|
544
|
+
active ? Tag("此刻", "info") : null),
|
|
545
|
+
h("span", { title: s.activity }, s.activity));
|
|
546
|
+
})) : null,
|
|
547
|
+
form.enabled && cap > 0 ? h("div", { className: "fs-life-quota" },
|
|
548
|
+
h("span", { className: "fs-life-quota-lbl" }, "今日主动配额"),
|
|
549
|
+
h("div", { className: "fs-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": cap, "aria-valuenow": used, "aria-label": "今日主动开口配额" },
|
|
550
|
+
h("div", { className: "fs-fill", "data-tone": quotaTone, style: { width: `${pct.toFixed(2)}%` } })),
|
|
551
|
+
h("span", { className: "fs-life-quota-val", "data-tone": quotaTone }, `${used} / ${cap} 次`)) : null),
|
|
535
552
|
Group({ className: "fs-life-settings" },
|
|
536
553
|
Row({ title: "主动开口" }, h(Switch, { label: "主动开口", checked: form.enabled, onChange: (v) => save({ enabled: v }) })),
|
|
537
|
-
form.enabled ? Row({ title: "每天最多" }, Tag(`今天 ${today.proactiveCount ?? 0}`), num("dailyMaxCount", "每天最多", 0, 50, 10), Muted("次")) : null,
|
|
554
|
+
form.enabled ? Row({ title: "每天最多", desc: "0 = 不限" }, Tag(`今天 ${today.proactiveCount ?? 0}`), num("dailyMaxCount", "每天最多", 0, 50, 10), Muted("次")) : null,
|
|
538
555
|
form.enabled ? Row({ title: "时段" }, num("activeStart", "开始", 0, 23, 8), Muted("–"), num("activeEnd", "结束", 1, 24, 24), Muted("点")) : null,
|
|
539
556
|
form.enabled ? Row({ title: "空闲多久后" }, num("idleTriggerHours", "空闲多久后", 1, 48, 6), Muted("小时")) : null,
|
|
540
557
|
form.enabled ? Row({ title: "刚聊完先等等" }, num("idleRealGapMinutes", "刚聊完先等等", 0, 1440, 30), Muted("分钟"), Muted("0 = 不等")) : null,
|
|
541
558
|
form.enabled ? Row({ title: "自走日程" }, h(Switch, { label: "自走日程", checked: form.scheduleEnabled, onChange: (v) => save({ scheduleEnabled: v }) }), Muted("关掉就不排今天干什么")) : null,
|
|
542
|
-
form.enabled ? Row({ title: "分享视频",
|
|
543
|
-
num("shareMaxPerDay", "分享视频每天最多", 0, 20, 2), Muted("条/天"),
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
num("shareFallbackDays", "几天没分享就主动挑一条", 0, 30, 2), Muted("天"),
|
|
547
|
-
Muted("0 = 不主动挑(只用她自己想分享的)")) : null,
|
|
559
|
+
form.enabled ? Row({ title: "分享视频", desc: "她刷到特别想分享的才会发" },
|
|
560
|
+
num("shareMaxPerDay", "分享视频每天最多", 0, 20, 2), Muted("条/天")) : null,
|
|
561
|
+
form.enabled ? Row({ title: "几天没分享就主动挑一条", desc: "0 = 不主动挑(只用她自己想分享的)" },
|
|
562
|
+
num("shareFallbackDays", "几天没分享就主动挑一条", 0, 30, 2), Muted("天")) : null,
|
|
548
563
|
form.enabled ? Row({ title: "主人私聊" }, Input({ value: form.masterPrivateChannelId, placeholder: "private:主人 QQ", onChange: (e) => patch({ masterPrivateChannelId: e.target.value }), onBlur: () => save() })) : null,
|
|
549
564
|
form.enabled ? Row({ title: "群聊", stack: true },
|
|
550
565
|
...form.selfGroupChannelIds.map((cid) => Tag(cid, undefined, { key: cid },
|
|
@@ -576,15 +591,13 @@ window.__ModuleLoader__.load({
|
|
|
576
591
|
|
|
577
592
|
return h(react.Fragment, null,
|
|
578
593
|
Group({ className: "fs-life-settings" },
|
|
579
|
-
Row({ title: "熟人传话",
|
|
580
|
-
h(Switch, { label: "熟人传话", checked: form.enabled, onChange: (v) => save({ enabled: v }) }),
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
Muted("填平台 uid,不是昵称 —— 昵称可以改、可以撞名。发起人和收件人都要在这里面。")) : null,
|
|
585
|
-
form.enabled ? Row({ title: "每人每天最多", stack: true },
|
|
594
|
+
Row({ title: "熟人传话", meta: "打开后,白名单里的人可以让她给对方带一句话,发出时自动带发起人前缀(不能匿名传话)" },
|
|
595
|
+
h(Switch, { label: "熟人传话", checked: form.enabled, onChange: (v) => save({ enabled: v }) })),
|
|
596
|
+
form.enabled ? Row({ title: "白名单", meta: "填平台 uid(不是昵称),逗号或换行分隔,发起人和收件人都要在白名单内", stack: true },
|
|
597
|
+
Area({ value: form.allowList, placeholder: "平台 uid,逗号或换行分隔:\nqq:12345678\nbili:1234567890\ndouyin:1234567890123456789", onChange: (e) => patch({ allowList: e.target.value }), onBlur: () => save() })) : null,
|
|
598
|
+
form.enabled ? Row({ title: "每人每天最多", meta: "到上限即拒,避免拿她当群发工具" },
|
|
586
599
|
Num({ min: 1, max: 50, value: form.perDay, "aria-label": "每人每天最多", onChange: (e) => patch({ perDay: e.target.value === "" ? "" : Number(e.target.value) }), onBlur: () => save({ perDay: form.perDay === "" ? 5 : form.perDay }) }),
|
|
587
|
-
Muted("
|
|
600
|
+
Muted("条")) : null));
|
|
588
601
|
}
|
|
589
602
|
|
|
590
603
|
/**
|
|
@@ -655,7 +668,7 @@ window.__ModuleLoader__.load({
|
|
|
655
668
|
const elsewhere = chats.filter((c) => c.workspacePath !== ses.workspacePath).length;
|
|
656
669
|
|
|
657
670
|
return h(react.Fragment, null,
|
|
658
|
-
Group({},
|
|
671
|
+
Group({ title: "连接与白名单" },
|
|
659
672
|
Row({ title: "QQ 接入" }, status, h(Switch, { label: "QQ 接入", checked: form.enabled, onChange: (v) => save({ enabled: v }) })),
|
|
660
673
|
form.enabled ? Row({ title: "SnowLuma 地址" }, field("wsUrl", { placeholder: "ws://127.0.0.1:3001" })) : null,
|
|
661
674
|
form.enabled ? Row({ title: "访问令牌" }, h(Secret, { label: "访问令牌", value: form.accessToken, placeholder: qq.hasToken ? qq.tokenMasked : "accessToken", onChange: (e) => patch({ accessToken: e.target.value }), onBlur: () => { if (form.accessToken !== "") save(); } })) : null,
|
|
@@ -663,41 +676,45 @@ window.__ModuleLoader__.load({
|
|
|
663
676
|
form.enabled ? Row({ title: "所有群" }, h(Switch, { label: "所有群", checked: form.allGroups, onChange: (v) => save({ allGroups: v }) }), Muted(form.allGroups ? "任何群里 @ 都回" : "只回下面列的群")) : null,
|
|
664
677
|
form.enabled && !form.allGroups ? Row({ title: "只在这些群" }, field("groupAllowList", { placeholder: "群号,逗号分隔;空 = 谁都不回" })) : null,
|
|
665
678
|
form.enabled ? Row({ title: "所有好友", desc: "关掉后只回下面名单里的人,主人始终回。升级前好友私聊都会回,想保持那样就打开" }, h(Switch, { label: "所有好友", checked: form.allFriends === true, onChange: (v) => save({ allFriends: v }) }), Muted(form.allFriends ? "任何好友的私聊都回" : "只回名单里的人")) : null,
|
|
666
|
-
form.enabled && !form.allFriends ? Row({ title: "只回这些人" }, field("privateAllowList", { placeholder: "QQ 号,逗号分隔;空 = 只回主人" })) : null,
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
679
|
+
form.enabled && !form.allFriends ? Row({ title: "只回这些人" }, field("privateAllowList", { placeholder: "QQ 号,逗号分隔;空 = 只回主人" })) : null),
|
|
680
|
+
form.enabled ? Group({ title: "回复节奏" },
|
|
681
|
+
Row({ title: "群里只回点名", desc: "打开后:只在她被 @ 或叫名字时开口,关掉「接着听」和「自己想插一句」。几个机器人待在同一个群、互相接话刷屏时打开它" },
|
|
682
|
+
h(Switch, { label: "群里只回点名", checked: form.mentionOnly === true, onChange: (v) => save({ mentionOnly: v }) })),
|
|
683
|
+
!form.mentionOnly ? Row({ title: "点名后接着听" },
|
|
670
684
|
Num({ min: 0, max: 20, value: form.followUpCount, "aria-label": "条数", onChange: (e) => patch({ followUpCount: e.target.value }), onBlur: () => save() }), Muted("条"),
|
|
671
685
|
Num({ min: 0, max: 1800, value: form.followUpSeconds, "aria-label": "秒数", onChange: (e) => patch({ followUpSeconds: e.target.value }), onBlur: () => save() }), Muted("秒")) : null,
|
|
672
|
-
|
|
673
|
-
Num({ min: 0, max: 15000, step: 500, value: form.batchMs, "aria-label": "等待毫秒", onChange: (e) => patch({ batchMs: e.target.value }), onBlur: () => save({ batchMs: form.batchMs === "" ? 3000 : Number(form.batchMs) }) }), Muted("毫秒"))
|
|
674
|
-
|
|
675
|
-
Num({ min: 1, max: 1440, value: form.replyWindowMinutes, "aria-label": "分钟", onChange: (e) => patch({ replyWindowMinutes: e.target.value }), onBlur: () => save({ replyWindowMinutes: form.replyWindowMinutes === "" ? 120 : Number(form.replyWindowMinutes) }) }), Muted("分钟"))
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
686
|
+
Row({ title: "连着发几条时", desc: "你连着发消息,她等你停手再一起回;0 = 每条都回" },
|
|
687
|
+
Num({ min: 0, max: 15000, step: 500, value: form.batchMs, "aria-label": "等待毫秒", onChange: (e) => patch({ batchMs: e.target.value }), onBlur: () => save({ batchMs: form.batchMs === "" ? 3000 : Number(form.batchMs) }) }), Muted("毫秒")),
|
|
688
|
+
Row({ title: "超过多久的消息只记不回", desc: "断线补拉 / 重启后积压的老消息,超过这个时间就只记进记忆、不回复(避免回一堆过时的话)" },
|
|
689
|
+
Num({ min: 1, max: 1440, value: form.replyWindowMinutes, "aria-label": "分钟", onChange: (e) => patch({ replyWindowMinutes: e.target.value }), onBlur: () => save({ replyWindowMinutes: form.replyWindowMinutes === "" ? 120 : Number(form.replyWindowMinutes) }) }), Muted("分钟")),
|
|
690
|
+
Row({ title: "叫这些名字也算点名" }, field("callNames", { placeholder: "人格卡名字" }))) : null,
|
|
691
|
+
form.enabled && !form.mentionOnly ? Group({ title: "群里主动插话" },
|
|
692
|
+
Row({ title: "群里主动插话" }, h(Switch, { label: "群里主动插话", checked: ij.enabled === true, onChange: (v) => save({ ij: { ...ij, enabled: v } }) })),
|
|
693
|
+
ij.enabled ? Row({ title: "插话概率" }, ijNum("chance", "插话概率", 0, 100), Muted("%"), ijNum("maxPerHour", "每小时最多", 0, 30), Muted("次/小时")) : null,
|
|
694
|
+
ij.enabled ? Row({ title: "说完话后冷却" }, ijNum("cooldownMinutes", "冷却", 0, 1440), Muted("分钟")) : null,
|
|
695
|
+
ij.enabled ? Row({ title: "感兴趣的话题" }, Input({ value: ij.keywords ?? "", placeholder: "猫, 原神, 考研", onChange: (e) => patch({ ij: { ...ij, keywords: e.target.value } }), onBlur: () => save() })) : null,
|
|
696
|
+
ij.enabled ? Row({ title: "最近搜的也算兴趣", desc: "她最近在 B 站搜过的词被群里提及时也加分;命中只算一次,不按命中几个词叠加" },
|
|
697
|
+
h(Switch, { label: "动态兴趣", checked: ij.interest?.enabled === true, onChange: (v) => save({ ij: { ...ij, interest: { ...(ij.interest ?? {}), enabled: v } } }) }),
|
|
698
|
+
ij.interest?.enabled === true ? Num({ min: 0, max: 1, step: 0.05, value: ij.interest?.weight ?? 0.2, "aria-label": "兴趣加分", onChange: (e) => patch({ ij: { ...ij, interest: { ...(ij.interest ?? {}), weight: e.target.value } } }), onBlur: () => save() }) : null) : null) : null,
|
|
699
|
+
form.enabled ? Group({ title: "群管理" },
|
|
700
|
+
Row({ title: "群管理", desc: "发版时在群里公告更新说明 + 处理入群申请" },
|
|
701
|
+
h(Switch, { label: "群管理", checked: form.ga.enabled === true, onChange: (v) => save({ ga: { ...form.ga, enabled: v } }) })),
|
|
702
|
+
form.ga.enabled ? Row({ title: "要管的群" },
|
|
680
703
|
Input({ value: form.ga.groupId, placeholder: "群号", inputMode: "numeric", onChange: (e) => patch({ ga: { ...form.ga, groupId: e.target.value } }), onBlur: () => save() })) : null,
|
|
681
|
-
form.
|
|
704
|
+
form.ga.enabled ? Row({ title: "发版公告" },
|
|
682
705
|
h(Switch, { label: "发版公告", checked: form.ga.announce === true, onChange: (v) => save({ ga: { ...form.ga, announce: v } }) }),
|
|
683
706
|
Muted("有新版本就在这个群里发更新说明")) : null,
|
|
684
|
-
form.
|
|
707
|
+
form.ga.enabled ? Row({ title: "入群申请" },
|
|
685
708
|
h(Switch, { label: "自动同意", checked: form.ga.autoApprove === true, onChange: (v) => save({ ga: { ...form.ga, autoApprove: v } }) }),
|
|
686
|
-
Muted(form.ga.autoApprove === true ? "有人申请就同意" : "私聊通知你,回「/鱼 同意」或「/鱼 拒绝」")) : null,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "说完话后冷却" }, ijNum("cooldownMinutes", "冷却", 0, 1440), Muted("分钟")) : null,
|
|
690
|
-
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "感兴趣的话题" }, Input({ value: ij.keywords ?? "", placeholder: "猫, 原神, 考研", onChange: (e) => patch({ ij: { ...ij, keywords: e.target.value } }), onBlur: () => save() })) : null,
|
|
691
|
-
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "最近搜的也算兴趣", desc: "她最近在 B 站搜过的词被群里提及时也加分;命中只算一次,不按命中几个词叠加" },
|
|
692
|
-
h(Switch, { label: "动态兴趣", checked: ij.interest?.enabled === true, onChange: (v) => save({ ij: { ...ij, interest: { ...(ij.interest ?? {}), enabled: v } } }) }),
|
|
693
|
-
ij.interest?.enabled === true ? Num({ min: 0, max: 1, step: 0.05, value: ij.interest?.weight ?? 0.2, "aria-label": "兴趣加分", onChange: (e) => patch({ ij: { ...ij, interest: { ...(ij.interest ?? {}), weight: e.target.value } } }), onBlur: () => save() }) : null) : null,
|
|
694
|
-
form.enabled ? Row({ title: "收藏表情包", desc: qq.stickers?.collect !== false ? undefined : "看到喜欢的表情会存下来,之后自己用" },
|
|
709
|
+
Muted(form.ga.autoApprove === true ? "有人申请就同意" : "私聊通知你,回「/鱼 同意」或「/鱼 拒绝」")) : null) : null,
|
|
710
|
+
form.enabled ? Group({ title: "收藏与学习" },
|
|
711
|
+
Row({ title: "收藏表情包", desc: qq.stickers?.collect !== false ? undefined : "看到喜欢的表情会存下来,之后自己用" },
|
|
695
712
|
h(Switch, { label: "收藏表情包", checked: qq.stickers?.collect !== false, onChange: (v) => run("/stickers/config", { collect: v }, v ? "会收藏喜欢的表情了" : "不再收藏表情", "保存失败") }),
|
|
696
713
|
Num({ min: 0, max: 100, value: form.stickersPerDay, "aria-label": "每天收藏几张", onChange: (e) => patch({ stickersPerDay: e.target.value }), onBlur: () => { if (form.stickersPerDay !== "") run("/stickers/config", { perDay: form.stickersPerDay }, "每天的上限改了", "保存失败"); } }),
|
|
697
|
-
Muted("张/天"))
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
714
|
+
Muted("张/天")),
|
|
715
|
+
Row({ title: "学群里的说法", desc: qq.slang?.enabled !== false ? undefined : "学每个群的梗和说话风格" }, h(Switch, { label: "学群里的说法", checked: qq.slang?.enabled !== false, onChange: (v) => run("/slang/config", { enabled: v }, v ? "会学群里的说法了" : "不再学群里的说法", "保存失败") })),
|
|
716
|
+
qq.slang?.enabled !== false ? Row({ title: "学说话方式", desc: "从别人的话里学「什么场合怎么说」,只学别人的、不带人名" }, h(Switch, { label: "学说话方式", checked: qq.slang?.expressions !== false, onChange: (v) => run("/slang/config", { expressions: v }, v ? "会学说话方式了" : "不再学说话方式", "保存失败") })) : null,
|
|
717
|
+
qq.slang?.enabled !== false ? Row({ title: "私聊也学", desc: "好友私聊里学到的只在那个私聊里用" }, h(Switch, { label: "私聊也学", checked: qq.slang?.privateChats !== false, onChange: (v) => run("/slang/config", { privateChats: v }, v ? "私聊里也会学了" : "只学群里的", "保存失败") })) : null) : null,
|
|
701
718
|
Group({ title: "会话", aside: chats.length > 0 ? Tag(String(chats.length), "outline") : null },
|
|
702
719
|
Row({ title: "工作区" }, Select({ disabled: busy, value: ses.isDedicated ? "__dedicated__" : ses.workspacePath, "aria-label": "工作区",
|
|
703
720
|
onChange: (e) => run("/sessions/workspace", e.target.value === "__dedicated__" ? { dedicated: true } : { path: e.target.value }, "新会话会放在这里", "切换失败") },
|
|
@@ -890,30 +907,39 @@ window.__ModuleLoader__.load({
|
|
|
890
907
|
Num({ min: 1, max: 6, value: form.videosPerSession, "aria-label": "每轮条数", onChange: (e) => patch({ videosPerSession: e.target.value }), onBlur: () => save() }), Muted("条")) : null,
|
|
891
908
|
br.enabled !== false ? Row({ title: "喜欢就点赞" }, sw("喜欢就点赞", br.like === true, (v) => save({ browse: { like: v } }))) : null,
|
|
892
909
|
br.enabled !== false ? Row({ title: "刷到就分享", desc: "带链接和感受,发到你的 QQ 私聊;多少条受「主动开口」那边的额度管" }, sw("刷到就分享", br.share !== false, (v) => save({ browse: { share: v } }))) : null,
|
|
893
|
-
br.enabled !== false ? Row({ title: "看完就收藏", desc:
|
|
910
|
+
br.enabled !== false ? Row({ title: "看完就收藏", desc: "收进默认收藏夹,建议 1–3 个/天;要能看图的模型(flash 可以、pro 不行)" },
|
|
894
911
|
br.favorite ? Muted(`今天收藏了 ${br.favoritedToday ?? 0}`) : null,
|
|
895
912
|
sw("想再看的就收藏", br.favorite === true, (v) => save({ browse: { favorite: v } })),
|
|
896
913
|
br.favorite ? Num({ min: 0, max: 30, value: form.favoritePerDay, "aria-label": "一天最多收藏几个", onChange: (e) => patch({ favoritePerDay: e.target.value }), onBlur: () => save() }) : null,
|
|
897
914
|
br.favorite ? Muted("个/天") : null) : null,
|
|
898
|
-
br.enabled !== false ? Row({ title: "
|
|
915
|
+
br.enabled !== false ? Row({ title: "也看弹幕", desc: "看视频时顺便看几条弹幕(只看不发)" }, sw("也看弹幕", br.danmaku !== false, (v) => save({ browse: { danmaku: v } }))) : null,
|
|
916
|
+
br.enabled !== false ? Row({ title: "按关键词搜一下", desc: "让她偶尔按自己最近感兴趣的东西搜一下,当作刷视频的又一个来源;只读" },
|
|
917
|
+
br.search ? Muted(`今天搜了 ${br.searchedToday ?? 0} / ${br.searchPerDay ?? 2} 次`) : null,
|
|
918
|
+
sw("按关键词搜一下", br.search === true, (v) => save({ browse: { search: v } }))) : null,
|
|
919
|
+
br.enabled !== false && br.search ? Row({ title: "搜什么词", desc: "留空 = 她自己按最近看过的提一个;填了就按你的搜(逗号分隔,比如:插件,大肥鱼)" },
|
|
920
|
+
Input({ value: form.searchKeywords, placeholder: "插件,大肥鱼", "aria-label": "搜索关键词", onChange: (e) => patch({ searchKeywords: e.target.value }), onBlur: () => save() })) : null,
|
|
921
|
+
br.enabled !== false && br.search ? Row({ title: "一天最多搜" },
|
|
922
|
+
Num({ min: 0, max: 12, value: form.searchPerDay, "aria-label": "一天最多搜几次", onChange: (e) => patch({ searchPerDay: e.target.value }), onBlur: () => save() }), Muted("次")) : null),
|
|
923
|
+
br.enabled !== false ? Group({ title: "画面与评论互动" },
|
|
924
|
+
Row({ title: "看一眼画面", desc: "抽开头 1 分钟拼 9 格一起看,一条十几秒;要用能看图的模型(flash 可以、pro 不行)" },
|
|
899
925
|
br.frames ? Muted(`今天看了 ${br.framedToday ?? 0}`) : null,
|
|
900
|
-
sw("看一眼画面", br.frames === true, (v) => save({ browse: { frames: v } })),
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
desc: "在真的浏览器里把视频放一遍,B
|
|
909
|
-
sw("留观看痕迹", br.playback?.enabled === true, (v) => { patch({ playback: { ...(form.playback ?? {}), enabled: v } }); save({ browse: { playback: { ...(form.playback ?? {}), enabled: v, rate: Number(form.playbackRate) || 2 } } }); }),
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
br.playback
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
926
|
+
sw("看一眼画面", br.frames === true, (v) => save({ browse: { frames: v } }))),
|
|
927
|
+
br.frames ? Row({ title: "看图每日上限" },
|
|
928
|
+
Muted("自己刷"),
|
|
929
|
+
Num({ min: 0, max: 15, value: form.framesPerDay, "aria-label": "自己刷每天最多几条", onChange: (e) => patch({ framesPerDay: e.target.value }), onBlur: () => save() }),
|
|
930
|
+
Muted("条/天 · 你发链接"),
|
|
931
|
+
Num({ min: 0, max: 30, value: form.framesPerDayChat, "aria-label": "你发链接时每天最多几条", onChange: (e) => patch({ framesPerDayChat: e.target.value }), onBlur: () => save() }),
|
|
932
|
+
Muted(`条/天(今天 ${br.framedTodayChat ?? 0})`)) : null,
|
|
933
|
+
Row({ title: "真播一遍留观看痕迹",
|
|
934
|
+
desc: "在真的浏览器里把视频放一遍,B站历史里才有记录、首页推荐才会跟着变,播放时另开独立窗口" },
|
|
935
|
+
sw("留观看痕迹", br.playback?.enabled === true, (v) => { patch({ playback: { ...(form.playback ?? {}), enabled: v } }); save({ browse: { playback: { ...(form.playback ?? {}), enabled: v, rate: Number(form.playbackRate) || 2 } } }); })),
|
|
936
|
+
br.playback?.enabled ? Row({ title: "播放倍速与上限", desc: "2 倍速 = 视频时长一半;单条上限防长视频拖慢整轮" },
|
|
937
|
+
Muted("倍速"),
|
|
938
|
+
Num({ min: 1, max: 8, step: 1, value: form.playbackRate, "aria-label": "播放倍速", onChange: (e) => patch({ playbackRate: e.target.value }), onBlur: () => save({ browse: { playback: { ...(br.playback ?? {}), enabled: true, rate: Number(form.playbackRate) || 2 } } }) }),
|
|
939
|
+
Muted("× · 最多"),
|
|
940
|
+
Num({ min: 1, max: 180, step: 10, value: form.playbackMaxMinutes, "aria-label": "一条最多占多久", onChange: (e) => patch({ playbackMaxMinutes: e.target.value }), onBlur: () => save({ browse: { playback: { ...(form.playback ?? {}), enabled: true, rate: Number(form.playbackRate) || 2, maxMinutes: Number(form.playbackMaxMinutes) || 60 } } }) }),
|
|
941
|
+
Muted("分钟")) : null,
|
|
942
|
+
Row({ title: "回一条评论", desc: "在她看的视频评论区挑一条值得搭话的回一句(楼中楼);不追着聊、不抬杠" },
|
|
917
943
|
sw("回一条评论", br.commentReply === true, (v) => save({ browse: { commentReply: v } })),
|
|
918
944
|
br.commentReply ? Num({ min: 0, max: 20, value: form.commentReplyPerDay, "aria-label": "一天最多回几条", onChange: (e) => patch({ commentReplyPerDay: e.target.value }), onBlur: () => save() }) : null,
|
|
919
945
|
br.commentReply ? Muted("条/天") : null,
|
|
@@ -927,25 +953,18 @@ window.__ModuleLoader__.load({
|
|
|
927
953
|
rel: "noreferrer",
|
|
928
954
|
title: br.replyLast.title ?? ""
|
|
929
955
|
}, `最近一次:回 @${br.replyLast.name || "某人"}「${String(br.replyLast.text ?? "").slice(0, 20)}」`)
|
|
930
|
-
: null)
|
|
931
|
-
|
|
932
|
-
br.enabled !== false ? Row({ title: "留一句", desc: `真看完、有感觉的视频,在评论区留一句(不超过 25 字,只写不追回复),一天最多 ${br.commentPerDay ?? 1} 条` },
|
|
956
|
+
: null),
|
|
957
|
+
Row({ title: "留一句", desc: `真看完、有感觉的视频,在评论区留一句(不超过 25 字,只写不追回复),一天最多 ${br.commentPerDay ?? 1} 条` },
|
|
933
958
|
br.comment ? Muted(`今天留了 ${br.commentedToday ?? 0}`) : null,
|
|
934
959
|
sw("留一句", br.comment === true, (v) => save({ browse: { comment: v } })),
|
|
935
960
|
br.comment ? Num({ min: 0, max: 20, value: form.commentPerDay, "aria-label": "一天最多几条", onChange: (e) => patch({ commentPerDay: e.target.value }), onBlur: () => save() }) : null,
|
|
936
|
-
br.comment ? Muted("条/天") : null)
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
br.search ? Muted(`今天搜了 ${br.searchedToday ?? 0} / ${br.searchPerDay ?? 2} 次`) : null,
|
|
944
|
-
sw("按关键词搜一下", br.search === true, (v) => save({ browse: { search: v } }))) : null,
|
|
945
|
-
br.enabled !== false && br.search ? Row({ title: "搜什么词", desc: "留空 = 她自己按最近看过的提一个;填了就按你的搜(逗号分隔,比如:插件,大肥鱼)" },
|
|
946
|
-
Input({ value: form.searchKeywords, className: "wide", placeholder: "插件,大肥鱼", "aria-label": "搜索关键词", onChange: (e) => patch({ searchKeywords: e.target.value }), onBlur: () => save() })) : null,
|
|
947
|
-
br.enabled !== false && br.search ? Row({ title: "一天最多搜" },
|
|
948
|
-
Num({ min: 0, max: 12, value: form.searchPerDay, "aria-label": "一天最多搜几次", onChange: (e) => patch({ searchPerDay: e.target.value }), onBlur: () => save() }), Muted("次")) : null),
|
|
961
|
+
br.comment ? Muted("条/天") : null),
|
|
962
|
+
Row({ title: "你发视频给她时读多细", stack: true, desc: "你在聊天里发 B站 链接,她先看一遍再回;四个数字都可以改,字数是节选上限,不写 0 就行" },
|
|
963
|
+
h("div", { className: "fs-inline-ctl" },
|
|
964
|
+
Num({ min: 1, max: 5, value: form.maxLinks, "aria-label": "最多读几条", onChange: (e) => patch({ maxLinks: e.target.value }), onBlur: () => save() }), Muted("条"),
|
|
965
|
+
Num({ min: 0, max: 3000, step: 100, value: form.subtitleChars, "aria-label": "字幕字数", onChange: (e) => patch({ subtitleChars: e.target.value }), onBlur: () => save() }), Muted("字字幕"),
|
|
966
|
+
Num({ min: 0, max: 1000, step: 50, value: form.descChars, "aria-label": "简介字数", onChange: (e) => patch({ descChars: e.target.value }), onBlur: () => save() }), Muted("字简介"),
|
|
967
|
+
Num({ min: 0, max: 500, step: 20, value: form.hotCommentChars, "aria-label": "热评字数", onChange: (e) => patch({ hotCommentChars: e.target.value }), onBlur: () => save() }), Muted("字热评")))) : null,
|
|
949
968
|
Group({ title: "动态和评论", aside: post.enabled ? Tag(`今天发了 ${so.post?.todayCount ?? 0} / ${post.perDay ?? 1}`, "outline") : null },
|
|
950
969
|
Row({ title: "自己发动态", desc: "醒着的时候按心情和最近刷到的随手发,纯文字" },
|
|
951
970
|
post.enabled ? Button({ variant: "ghost", disabled: busy || so.post?.running === true || b.enabled !== true, onClick: () => act("/bili/post-now", {}, (r) => `发了:${r.text}`, "没发成") }, so.post?.running ? "正在写…" : "现在发一条") : null,
|
|
@@ -961,17 +980,20 @@ window.__ModuleLoader__.load({
|
|
|
961
980
|
Num({ min: 10, max: 300, step: 10, value: form.commentsReplyChars, "aria-label": "回评论字数", onChange: (e) => patch({ commentsReplyChars: e.target.value }), onBlur: () => save() }), Muted("字")) : null,
|
|
962
981
|
so.lastError ? Row({ title: "上次出错" }, State("error", so.lastError)) : null,
|
|
963
982
|
socialLogAll.length === 0 ? null : h(react.Fragment, null,
|
|
964
|
-
h("div", { className: "fs-list" }, socialLogAll.map((x) =>
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
983
|
+
h("div", { className: "fs-list" }, socialLogAll.map((x) => h("div", { className: "fs-read-item", key: x.key },
|
|
984
|
+
h("div", { className: "fs-read-head" }, x.tag, h("span", { className: "fs-read-text" }, x.text)),
|
|
985
|
+
h("div", { className: "fs-read-foot" },
|
|
986
|
+
x.href ? h("a", { href: x.href, target: "_blank", rel: "noreferrer" }, "打开") : null,
|
|
987
|
+
h("span", null, relTime(x.at, Date.now())))))),
|
|
968
988
|
logNext !== null ? h("div", { className: "fs-pag-bar" }, Button({ variant: "ghost", disabled: olderLog.busy, onClick: loadMoreLog }, olderLog.busy ? "加载中…" : "加载更多")) : null)),
|
|
969
989
|
recentAll.length === 0 ? null : Group({ title: "最近看过" },
|
|
970
|
-
h("div", { className: "fs-list" }, recentAll.map((v) =>
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
990
|
+
h("div", { className: "fs-list" }, recentAll.map((v) => h("div", { className: "fs-read-item", key: v.bvid },
|
|
991
|
+
h("div", { className: "fs-read-head" },
|
|
992
|
+
Tag(v.favorited ? "藏" : v.liked ? "赞" : v.skipped ? "划走" : v.source === "following" ? "关注" : v.source === "search" ? "搜索" : "推荐", v.liked ? "danger" : undefined),
|
|
993
|
+
h("span", { className: "fs-read-text" }, `${v.title}${v.impression ? ` · ${v.impression}` : ""}`)),
|
|
994
|
+
h("div", { className: "fs-read-foot" },
|
|
995
|
+
h("a", { href: `https://www.bilibili.com/video/${v.bvid}`, target: "_blank", rel: "noreferrer" }, v.owner || v.bvid),
|
|
996
|
+
h("span", null, relTime(v.seenAt, Date.now())))))),
|
|
975
997
|
seenNext !== null ? h("div", { className: "fs-pag-bar" }, Button({ variant: "ghost", disabled: olderSeen.busy, onClick: loadMoreSeen }, olderSeen.busy ? "加载中…" : "加载更多")) : null))
|
|
976
998
|
}
|
|
977
999
|
|