Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

UI copy: one sentence instead of "·"-joined state fragments

Marla1050cd3538ce
diff --git a/src/app.ts b/src/app.ts
index b5b6263..0842b2c 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -296,7 +296,8 @@ export class App {
for (const [botId, ch] of this.channels) {
const st = ch.weixin?.status;
if (st?.state !== "expired") continue;
- out.push({ id: `login:${botId}:weixin`, kind: "login", botId, botName: this.store.getBot(botId)?.name ?? botId, subject: tr("app.weixinExpiredSubject"), status: "", line: "", since: st.since, severity: "err", actions: ["relogin"], channel: "weixin" });
+ const subject = tr("app.weixinExpiredSubject");
+ out.push({ id: `login:${botId}:weixin`, kind: "login", botId, botName: this.store.getBot(botId)?.name ?? botId, subject, status: "", head: subject, line: "", since: st.since, severity: "err", actions: ["relogin"], channel: "weixin" });
}
return out;
}
diff --git a/src/i18n/messages/delivery.ts b/src/i18n/messages/delivery.ts
index 92614ec..20fd94c 100644
--- a/src/i18n/messages/delivery.ts
+++ b/src/i18n/messages/delivery.ts
@@ -19,6 +19,8 @@ export const zh = {
failedResults: { other: "{count} 条结果没能发到{channel}" },
failedMessages: { other: "{count} 条消息没能发到{channel}" },
heldLine: "在{channel}里发条消息就能收到",
+ // 「需要你」那一行的那一句:没送到的几条,和怎么办
+ head: "{title},{line}",
retrying: "还在重试",
fileItem: "[文件 {name}]",
goneTooLong: "等待太久,已不再发送",
@@ -71,6 +73,7 @@ export const en: Catalog<typeof zh> = {
failedResults: { one: "{count} result couldn't be sent to {channel}", other: "{count} results couldn't be sent to {channel}" },
failedMessages: { one: "{count} message couldn't be sent to {channel}", other: "{count} messages couldn't be sent to {channel}" },
heldLine: "Send a message in {channel} to receive them",
+ head: "{title}. {line}",
retrying: "Still retrying",
fileItem: "[file {name}]",
goneTooLong: "Waited too long; no longer sending",
diff --git a/src/i18n/messages/rules.ts b/src/i18n/messages/rules.ts
index 7d203c0..1ac309b 100644
--- a/src/i18n/messages/rules.ts
+++ b/src/i18n/messages/rules.ts
@@ -63,6 +63,12 @@ export const zh = {
failingPaused: { other: "连续失败 {count} 次,已暂停" },
failing: { other: "连续失败 {count} 次" },
suggest: { other: "规则「{title}」已观察 {count} 次,需要你来决定是否执行" },
+ // 「需要你」那一行的那一句(不带机器人名)
+ headAnswer: "规则「{title}」在等你回答",
+ headApproval: "规则「{title}」在等你批准",
+ headFailing: { other: "规则「{title}」连续失败 {count} 次" },
+ headFailingPaused: { other: "规则「{title}」连续失败 {count} 次,已暂停" },
+ headMonth: "规则「{title}」本月预算用完了",
// 推送:连续失败暂停了(执行中的规则)
pausedPush: "⚠️ 规则「{title}」连续失败 {count} 次,已暂停:{why}",
// 建规则时建议给用户的那句(经聊天代理转述)
@@ -153,6 +159,11 @@ export const en: Catalog<typeof zh> = {
failingPaused: { one: "Failed {count} time in a row, paused", other: "Failed {count} times in a row, paused" },
failing: { one: "Failed {count} time in a row", other: "Failed {count} times in a row" },
suggest: { one: "Rule “{title}” has observed {count} time; decide whether it should act", other: "Rule “{title}” has observed {count} times; decide whether it should act" },
+ headAnswer: "Rule “{title}” is waiting for your answer",
+ headApproval: "Rule “{title}” is waiting for your approval",
+ headFailing: { one: "Rule “{title}” failed {count} time in a row", other: "Rule “{title}” failed {count} times in a row" },
+ headFailingPaused: { one: "Rule “{title}” failed {count} time in a row and is paused", other: "Rule “{title}” failed {count} times in a row and is paused" },
+ headMonth: "Rule “{title}” used up this month's budget",
pausedPush: "⚠️ Rule “{title}” failed {count} times in a row and is paused: {why}",
createdReply: "Rule set: {title}, {when}. It watches quietly for a few days; switch it to act under Tasks.",
remindReply: "OK, reminder set for {when}.",
diff --git a/src/i18n/messages/tasks.ts b/src/i18n/messages/tasks.ts
index 1e323a0..5c98be8 100644
--- a/src/i18n/messages/tasks.ts
+++ b/src/i18n/messages/tasks.ts
@@ -42,7 +42,14 @@ export const zh = {
chFeishu: "飞书",
chWeb: "对话",
notifyTitle: "{name} 需要你",
- trayTitle: { other: "{product} · {count} 件事需要你" },
+ trayTitle: { other: "{product} 有 {count} 件事需要你" },
+ // 「需要你」那一行的那一句(不带机器人名):任务的、聊天里的
+ headAnswer: "「{title}」在等你回答",
+ headApproval: "「{title}」在等你批准",
+ headBudget: "「{title}」预算用完了",
+ headFailed: "「{title}」失败了",
+ headChatAnswer: "{channel}里有个问题等你回答",
+ headChatApproval: "{channel}里有个操作等你批准",
// 花费与预算(3e)
budgetAsk: "已用约 {spent},再给 {add} 继续?",
budgetGo: "继续",
@@ -55,7 +62,7 @@ export const zh = {
// 保留与清理(3f):归档了的任务、「需要你」里清理文件夹那一行
archivedNoFollowup: "「{title}」已归档,不能再追加;需要的话开个新任务。",
cleanupSubject: { other: "{count} 个任务文件夹 {date} 删除" },
- cleanupLine: "{titles} · 30 天没动过",
+ cleanupLine: { other: "{titles} 30 天没动过了" },
// 导出成 Markdown(3f,tasks/export.ts)
exportedAt: "导出于 {time}",
exportLog: "运行记录",
@@ -126,7 +133,13 @@ export const en: Catalog<typeof zh> = {
chFeishu: "Feishu",
chWeb: "Chat",
notifyTitle: "{name} needs you",
- trayTitle: { one: "{product} · {count} thing needs you", other: "{product} · {count} things need you" },
+ trayTitle: { one: "{product} has {count} thing that needs you", other: "{product} has {count} things that need you" },
+ headAnswer: "“{title}” is waiting for your answer",
+ headApproval: "“{title}” is waiting for your approval",
+ headBudget: "“{title}” used up its budget",
+ headFailed: "“{title}” failed",
+ headChatAnswer: "{channel} has a question for you",
+ headChatApproval: "{channel} needs your approval",
budgetAsk: "Used about {spent}. Add {add} and continue?",
budgetGo: "Continue",
budgetStop: "Stop",
@@ -137,7 +150,7 @@ export const en: Catalog<typeof zh> = {
reserveLine: "The bot's budget is down to about {remain} of {limit}; the rest is kept for chat",
archivedNoFollowup: "\"{title}\" is archived and can't take follow-ups; start a new task if you need one.",
cleanupSubject: { one: "{count} task folder will be deleted {date}", other: "{count} task folders will be deleted {date}" },
- cleanupLine: "{titles} · unused for 30 days",
+ cleanupLine: { one: "{titles} hasn't been used in 30 days", other: "{titles} haven't been used in 30 days" },
exportedAt: "Exported {time}",
exportLog: "Run log",
exportNoRuns: "No runs yet.",
diff --git a/src/tasks/attention.ts b/src/tasks/attention.ts
index 05d06e4..342313f 100644
--- a/src/tasks/attention.ts
+++ b/src/tasks/attention.ts
@@ -37,8 +37,13 @@ export interface AttentionItem {
botName: string;
/** 说的是什么:任务名、渠道名("微信"),或一句话("微信登录已过期") */
subject: string;
- /** 状态:等你回答 / 等你批准 / 失败 / 未送达;没有就不显示 */
+ /** 状态:等你回答 / 等你批准 / 失败 / 未送达;没有就是空 */
status: string;
+ /**
+ * 界面上的那一句(不带机器人名):「「GPU 价格调研」在等你回答」「微信登录已过期」。几个机器人时界面在前面加上名字
+ * (「小蓝的「GPU 价格调研」在等你回答」);侧栏机器人行的第二行也是它
+ */
+ head: string;
/** 第二行:问题、命令、失败原因、没送到的那句话 */
line: string;
/** 有默认回答的提问:不回答会怎样(「不回复就按中文做」);任务这时还在做 */
@@ -187,7 +192,7 @@ const channelLabel = (c: string) => (c === "weixin" ? tr("tasks.chWeixin") : c =
/**
* 审批中心那一份:还在等的提问和审批(聊天回合里的、后台任务的)。任务的以任务名为题,聊天里的以渠道为题:
- * 「小蓝 · GPU 价格调研 · 等你回答」「小蓝 · 微信 · 等你批准」。
+ * 「「GPU 价格调研」在等你回答」「微信里有个操作等你批准」。
*/
export function approvalItems(store: Store, rows: ApprovalRow[]): AttentionItem[] {
return rows.map((r) => {
@@ -197,6 +202,12 @@ export function approvalItems(store: Store, rows: ApprovalRow[]): AttentionItem[
const qs = questionsOf(r);
const line = r.kind === "approval" ? r.detail || r.reason || r.tool : qs.map((q) => q.question).join(" / ") || r.detail;
const note = r.kind === "question" ? defaultLine(r) : undefined;
+ const budget = r.kind === "question" && r.tool === BUDGET_TOOL;
+ const head = task
+ ? tr(r.kind === "approval" ? "tasks.headApproval" : budget ? "tasks.headBudget" : "tasks.headAnswer", { title: task.title })
+ : rule
+ ? tr(r.kind === "approval" ? "rules.headApproval" : "rules.headAnswer", { title: rule.title })
+ : tr(r.kind === "approval" ? "tasks.headChatApproval" : "tasks.headChatAnswer", { channel: channelLabel(channel) ?? tr("tasks.chWeb") });
return {
id: `approval:${r.id}`,
kind: r.kind,
@@ -204,7 +215,8 @@ export function approvalItems(store: Store, rows: ApprovalRow[]): AttentionItem[
botName: store.getBot(r.botId)?.name ?? r.botId,
subject: task?.title ?? (rule ? tr("rules.subject", { title: rule.title }) : (channelLabel(channel) ?? tr("tasks.chWeb"))),
// 任务预算用完时问的那个:状态是预算用完(第二行就是「已用约 $1.00,再给 $1 继续?」)
- status: r.kind === "approval" ? tr("tasks.stageApproval") : r.tool === BUDGET_TOOL ? tr("tasks.stageBudget") : tr("tasks.stageAnswer"),
+ status: r.kind === "approval" ? tr("tasks.stageApproval") : budget ? tr("tasks.stageBudget") : tr("tasks.stageAnswer"),
+ head,
line: line.length > 300 ? line.slice(0, 299) + "…" : line,
...(note ? { note } : {}),
since: r.createdAt,
@@ -222,7 +234,7 @@ export function approvalItems(store: Store, rows: ApprovalRow[]): AttentionItem[
}
/**
- * 出站队列那一份(core/delivery.ts):没送到的结果,一个会话一行。「1 条结果未送达微信 · 在微信里发条消息就能收到」,
+ * 出站队列那一份(core/delivery.ts):没送到的结果,一个会话一行。「1 条结果未送达微信,在微信里发条消息就能收到」,
* 第二行是没送到的那几句(在这里就能看到);一直失败的可以重试、放弃了的可以不再提示
*/
export function deliveryItem(d: DeliveryItem, botName: string): AttentionItem {
@@ -234,6 +246,7 @@ export function deliveryItem(d: DeliveryItem, botName: string): AttentionItem {
botName,
subject: d.title,
status: d.line,
+ head: d.line ? tr("delivery.head", { title: d.title, line: d.line }) : d.title,
line: text.length > 300 ? text.slice(0, 299) + "…" : text,
since: d.since,
severity: d.severity === "error" ? "err" : "warn",
@@ -243,17 +256,17 @@ export function deliveryItem(d: DeliveryItem, botName: string): AttentionItem {
};
}
-/** 列表变没变:id + 状态 + 第二行 */
+/** 列表变没变:id + 那一句 + 第二行 */
function signature(items: AttentionItem[]): string {
- return items.map((it) => `${it.id}|${it.status}|${it.line}`).join("\n");
+ return items.map((it) => `${it.id}|${it.head}|${it.line}`).join("\n");
}
-/** 侧栏机器人行的第二行:"GPU 价格调研等你回答"、"微信登录已过期" */
+/** 侧栏机器人行的第二行:「「GPU 价格调研」在等你回答」「微信登录已过期」 */
export function botLine(it: AttentionItem): string {
- return it.status ? `${it.subject}${it.status}` : it.subject;
+ return it.head;
}
-/** 系统通知:标题「小蓝 需要你」,正文「GPU 价格调研:报告用中文还是英文?」(设计第 6 节) */
+/** 系统通知:标题「小蓝 需要你」,正文「GPU 价格调研:报告用中文还是英文?」(设计第 6 节);没有第二行时是那一句 */
export function notificationOf(it: AttentionItem): { title: string; body: string } {
const body = it.line ? `${it.subject}:${it.line}` : botLine(it);
return { title: tr("tasks.notifyTitle", { name: it.botName }), body: body.length > 120 ? body.slice(0, 119) + "…" : body };
diff --git a/src/tasks/service.ts b/src/tasks/service.ts
index 0907afc..f205485 100644
--- a/src/tasks/service.ts
+++ b/src/tasks/service.ts
@@ -1686,6 +1686,7 @@ export class TaskService {
botName: bot?.name ?? t.botId,
subject: t.title,
status: st.label,
+ head: tr(st.key === "failed" ? "tasks.headFailed" : "tasks.headBudget", { title: t.title }),
line: clip(oneLine(line), 200),
since: run?.endedAt || t.updatedAt,
severity: st.key === "failed" ? "err" : "warn",
@@ -1705,6 +1706,7 @@ export class TaskService {
botName: bot.name,
subject: tr("tasks.reserveSubject"),
status: "",
+ head: tr("tasks.reserveSubject"),
line: tr("tasks.reserveLine", { remain: usdText(low.remainUsd), limit: stepText(low.limitUsd) }),
since: this.reserveSince.get(bot.id) ?? this.now(),
severity: "warn",
@@ -1999,14 +2001,16 @@ export class TaskService {
const date = new Intl.DateTimeFormat(l === "en" ? "en-US" : "zh-CN", { month: l === "en" ? "short" : "long", day: "numeric", timeZone: this.timeZone }).format(first);
const names = tasks.slice(0, 3).map((t) => t.title);
const titles = new Intl.ListFormat(l === "en" ? "en" : "zh-CN", { type: "conjunction" }).format(names) + (tasks.length > 3 ? "…" : "");
+ const subject = tr("tasks.cleanupSubject", { count: tasks.length, date });
out.push({
id: `cleanup:${botId}`,
kind: "cleanup",
botId,
botName: this.store.getBot(botId)?.name ?? botId,
- subject: tr("tasks.cleanupSubject", { count: tasks.length, date }),
+ subject,
status: "",
- line: tr("tasks.cleanupLine", { titles }),
+ head: subject,
+ line: tr("tasks.cleanupLine", { titles, count: tasks.length }),
since: first - WARN_MS,
severity: "warn",
actions: ["keep", "dismiss"],
@@ -2888,6 +2892,7 @@ export class TaskService {
botName: this.store.getBot(rule.botId)?.name ?? rule.botId,
subject: tr("rules.subject", { title: rule.title }),
status: tr("rules.monthPaused"),
+ head: tr("rules.headMonth", { title: rule.title }),
line: tr("rules.monthLine", { spent: usdText(this.monthSpent(rule)), add: stepText(RULE_MONTH_BUDGET_USD) }),
since: rule.updatedAt,
severity: "warn",
@@ -2907,6 +2912,7 @@ export class TaskService {
botName: this.store.getBot(rule.botId)?.name ?? rule.botId,
subject: tr("rules.subject", { title: rule.title }),
status: tr(paused ? "rules.failingPaused" : "rules.failing", { count: rule.failures }),
+ head: tr(paused ? "rules.headFailingPaused" : "rules.headFailing", { title: rule.title, count: rule.failures }),
line: last ? clip(oneLine((last.outcome === "failed" && last.report?.message) || errorText(last.error || RUN_ERROR.noReport)), 200) : "",
since: last?.endedAt || rule.updatedAt,
severity: paused ? "err" : "warn",
@@ -2930,13 +2936,15 @@ export class TaskService {
const good = this.store.ruleRuns(rule.id, { mode: "observe", outcome: "done", version: rule.version, limit: RULE_SUGGEST_AFTER });
if (good.length < RULE_SUGGEST_AFTER) return undefined;
const last = good[0];
+ const subject = tr("rules.suggest", { title: rule.title, count: RULE_SUGGEST_AFTER });
return {
id: `suggest:${rule.id}`,
kind: "suggest",
botId: rule.botId,
botName: this.store.getBot(rule.botId)?.name ?? rule.botId,
- subject: tr("rules.suggest", { title: rule.title, count: RULE_SUGGEST_AFTER }),
+ subject,
status: "",
+ head: subject,
line: runLine(last, rule.kind, this.carrier(last)),
since: last.endedAt || last.queuedAt,
severity: "warn",
diff --git a/test/attention.unit.test.ts b/test/attention.unit.test.ts
index 7ca0554..dd6e3d5 100644
--- a/test/attention.unit.test.ts
+++ b/test/attention.unit.test.ts
@@ -6,12 +6,14 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { Store } from "../src/store/db.js";
import { ApprovalCenter } from "../src/agent/approvals.js";
import { Attention, approvalItems, botLine, notificationOf, trayTitle, type AttentionItem } from "../src/tasks/attention.js";
+import { withLang } from "../src/i18n/index.js";
const item = (o: Partial<AttentionItem> & Pick<AttentionItem, "id" | "kind">): AttentionItem => ({
botId: "b",
botName: "小蓝",
subject: "GPU 价格调研",
status: "等你回答",
+ head: "「GPU 价格调研」在等你回答",
line: "报告用中文还是英文?",
since: 1,
severity: "warn",
@@ -72,8 +74,8 @@ describe("Attention", () => {
});
it("每个机器人几件、最早那件(侧栏机器人行的第二行)", () => {
- att.addSource(() => [item({ id: "a", kind: "question", since: 1 }), item({ id: "b", kind: "failed", since: 2, status: "失败" }), item({ id: "c", kind: "login", botId: "g", botName: "绿草", subject: "微信登录已过期", status: "" })]);
- expect(att.byBot()).toEqual({ b: { n: 2, line: "GPU 价格调研等你回答" }, g: { n: 1, line: "微信登录已过期" } });
+ att.addSource(() => [item({ id: "a", kind: "question", since: 1 }), item({ id: "b", kind: "failed", since: 2, status: "失败", head: "「GPU 价格调研」失败了" }), item({ id: "c", kind: "login", botId: "g", botName: "绿草", subject: "微信登录已过期", status: "", head: "微信登录已过期" })]);
+ expect(att.byBot()).toEqual({ b: { n: 2, line: "「GPU 价格调研」在等你回答" }, g: { n: 1, line: "微信登录已过期" } });
});
it("系统通知每项最多一次,重启后也不再给;处理掉的项从记录里清掉", () => {
@@ -112,12 +114,13 @@ describe("Attention", () => {
it("系统通知的样子:标题「小蓝 需要你」,正文「GPU 价格调研:报告用中文还是英文?」", () => {
expect(notificationOf(item({ id: "a", kind: "question" }))).toEqual({ title: "小蓝 需要你", body: "GPU 价格调研:报告用中文还是英文?" });
- expect(notificationOf(item({ id: "l", kind: "login", subject: "微信登录已过期", status: "", line: "" }))).toEqual({ title: "小蓝 需要你", body: "微信登录已过期" });
- expect(botLine(item({ id: "f", kind: "failed", status: "失败" }))).toBe("GPU 价格调研失败");
- expect(trayTitle("AnyModelBot", 3)).toBe("AnyModelBot · 3 件事需要你");
+ expect(notificationOf(item({ id: "l", kind: "login", subject: "微信登录已过期", status: "", head: "微信登录已过期", line: "" }))).toEqual({ title: "小蓝 需要你", body: "微信登录已过期" });
+ expect(botLine(item({ id: "f", kind: "failed", status: "失败", head: "「GPU 价格调研」失败了" }))).toBe("「GPU 价格调研」失败了");
+ expect(trayTitle("AnyModelBot", 3)).toBe("AnyModelBot 有 3 件事需要你");
+ expect(withLang("en", () => [trayTitle("AnyModelBot", 1), trayTitle("AnyModelBot", 3)])).toEqual(["AnyModelBot has 1 thing that needs you", "AnyModelBot has 3 things that need you"]);
});
- it("审批中心那一份:任务的以任务名为题,聊天里的以渠道为题", () => {
+ it("审批中心那一份:任务的以任务名为题,聊天里的以渠道为题;那一句(界面上的标题行)是一句话", () => {
store.createBot({ id: "b", name: "小蓝" });
store.ensureConversation("b", "weixin", "owner", "owner");
const c = new ApprovalCenter(store);
@@ -126,8 +129,9 @@ describe("Attention", () => {
const a = c.create({ kind: "approval", botId: "b", conversationId: "b:weixin:owner", sessionId: "task-t_1", tool: "bash", detail: "rm -rf build/", reason: "", taskId: "t_1" });
const q = c.create({ kind: "question", botId: "b", conversationId: "b:weixin:owner", sessionId: "chat", tool: "ask_user_question", detail: "继续吗?", reason: "", payload: JSON.stringify([{ id: "q", question: "继续吗?" }]) });
const items = approvalItems(store, c.pendingAll());
- expect(items.find((x) => x.id === `approval:${a.id}`)).toMatchObject({ kind: "approval", subject: "清理旧构建", status: "等你批准", line: "rm -rf build/", actions: ["approve", "deny"], taskId: "t_1", code: a.code, channel: "weixin" });
- expect(items.find((x) => x.id === `approval:${q.id}`)).toMatchObject({ kind: "question", subject: "微信", status: "等你回答", line: "继续吗?", actions: ["answer"], questions: [{ id: "q", question: "继续吗?" }] });
+ expect(items.find((x) => x.id === `approval:${a.id}`)).toMatchObject({ kind: "approval", subject: "清理旧构建", status: "等你批准", head: "「清理旧构建」在等你批准", line: "rm -rf build/", actions: ["approve", "deny"], taskId: "t_1", code: a.code, channel: "weixin" });
+ expect(items.find((x) => x.id === `approval:${q.id}`)).toMatchObject({ kind: "question", subject: "微信", status: "等你回答", head: "微信里有个问题等你回答", line: "继续吗?", actions: ["answer"], questions: [{ id: "q", question: "继续吗?" }] });
+ expect(withLang("en", () => approvalItems(store, c.pendingAll()).map((x) => x.head)).sort()).toEqual(["WeChat has a question for you", "“清理旧构建” is waiting for your approval"]);
expect(items.find((x) => x.id === `approval:${q.id}`)!.taskId).toBeUndefined();
expect(items.find((x) => x.id === `approval:${q.id}`)!.note).toBeUndefined();
});
diff --git a/test/cost.unit.test.ts b/test/cost.unit.test.ts
index 2d55ad8..f906f1b 100644
--- a/test/cost.unit.test.ts
+++ b/test/cost.unit.test.ts
@@ -452,7 +452,7 @@ describe("预算(假宿主、假时钟)", () => {
]);
expect(store.listRuns({ taskId: t.id })[0].error).toBe("reserve");
expect(svc.get(t.id)!.stage.key).toBe("working/queued");
- expect(svc.attention()).toEqual([{ id: "reserve:b", kind: "budget", botId: "b", botName: "小蓝", subject: "后台工作已停", status: "", line: "机器人预算只剩约 $1.95(共 $10),留给聊天", since: now, severity: "warn", actions: ["open"] }]);
+ expect(svc.attention()).toEqual([{ id: "reserve:b", kind: "budget", botId: "b", botName: "小蓝", subject: "后台工作已停", status: "", head: "后台工作已停", line: "机器人预算只剩约 $1.95(共 $10),留给聊天", since: now, severity: "warn", actions: ["open"] }]);
expect(approvals.pendingAll()).toEqual([]);
// 不开新任务(聊天代理照实说);规则到点跳过
const r = await svc.chatTool({ botId: "b", sessionId: "chat-1", op: "start", args: { title: "又一个", brief: "" } });
diff --git a/test/delivery.e2e.test.ts b/test/delivery.e2e.test.ts
index 02d1194..744d478 100644
--- a/test/delivery.e2e.test.ts
+++ b/test/delivery.e2e.test.ts
@@ -123,6 +123,7 @@ describe("退出演示:免打扰与微信窗口", () => {
expect(items[0].messages.map((m) => m.text)).toEqual(["季度报告做好了,在 tasks 文件夹里。"]);
// 「需要你」里就这一行(任务那一份不重复列),没送到的那句在这里就能看到
expect(app.attention.list().map((x) => [x.kind, x.subject, x.status, x.line, x.actions])).toEqual([["delivery", "1 条结果未送达微信", "在微信里发条消息就能收到", "季度报告做好了,在 tasks 文件夹里。", []]]);
+ expect(app.attention.list()[0].head).toBe("1 条结果未送达微信,在微信里发条消息就能收到");
// 主人周日 09:00 发消息:先收到留着的结果,再收到这次的回复
await clock("2026-11-08T09:00");
expect(await say(OWNER, "早")).toEqual(["你不在时:季度报告做好了,在 tasks 文件夹里。", "[mock-a] 你说:早"]);
diff --git a/test/retention.unit.test.ts b/test/retention.unit.test.ts
index d74dbbd..74c9fe6 100644
--- a/test/retention.unit.test.ts
+++ b/test/retention.unit.test.ts
@@ -16,6 +16,7 @@ import { DEFAULT_SETTINGS } from "../src/agent/settings.js";
import { Outbox } from "../src/core/outbox.js";
import { Delivery } from "../src/core/delivery.js";
import { Store, type RunOutcome } from "../src/store/db.js";
+import { withLang } from "../src/i18n/index.js";
const TZ = "Asia/Shanghai";
const at = (s: string) => Date.parse(`${s}${s.length === 16 ? ":00" : ""}+08:00`);
@@ -157,7 +158,7 @@ describe("保留与清理(假宿主、假时钟)", () => {
expect(due).toBe(now + WARN_MS);
expect(svc.get(t)!.cleanupAt).toBe(due);
expect(cleanupItems()).toEqual([
- expect.objectContaining({ id: "cleanup:b", kind: "cleanup", botName: "小蓝", subject: "1 个任务文件夹 12月1日 删除", line: "GPU 价格调研 · 30 天没动过", severity: "warn", actions: ["keep", "dismiss"], since: now }),
+ expect.objectContaining({ id: "cleanup:b", kind: "cleanup", botName: "小蓝", subject: "1 个任务文件夹 12月1日 删除", head: "1 个任务文件夹 12月1日 删除", line: "GPU 价格调研 30 天没动过了", severity: "warn", actions: ["keep", "dismiss"], since: now }),
]);
// 只在应用里:出站队列里没有它
expect(store.listOutbox({ limit: 100 }).filter((r) => r.id.includes("cleanup"))).toEqual([]);
@@ -183,7 +184,8 @@ describe("保留与清理(假宿主、假时钟)", () => {
now += KEEP_MS - WARN_MS;
svc.retain();
expect(cleanupItems()[0].subject).toBe("2 个任务文件夹 12月1日 删除");
- expect(cleanupItems()[0].line).toBe("A和B · 30 天没动过");
+ expect(cleanupItems()[0].line).toBe("A和B 30 天没动过了");
+ expect(withLang("en", () => cleanupItems()[0].line)).toBe("A and B haven't been used in 30 days");
expect(svc.keepCleanup("b")).toBe(true);
expect(store.getTask(a)!.cleanupAt).toBe(0);
expect(cleanupItems()).toEqual([]);
diff --git a/test/rules.unit.test.ts b/test/rules.unit.test.ts
index b5391cb..d04d137 100644
--- a/test/rules.unit.test.ts
+++ b/test/rules.unit.test.ts
@@ -132,7 +132,7 @@ describe("时间表:下一次、上一次、宽限期", () => {
});
describe("界面:规则的一行(健康时只有状态和下次)", () => {
- it("第二行:观察中 · 下次 明天 08:00;正在运行;暂停了说连续失败几次;关了、跑完了只有状态;运行记录的时间", async () => {
+ it("第二行是一句话:观察中,明天 08:00 再运行;正在运行;连续失败 3 次,已暂停;关了、跑完了只有状态;运行记录的时间", async () => {
(globalThis as any).window ??= { matchMedia: () => ({ matches: false, addEventListener() {}, removeEventListener() {} }), addEventListener() {}, removeEventListener() {} };
// @ts-expect-error 界面代码是不经构建的 JS
const { ruleSub, fmtRunAt, fmtNext } = await import("../ui/components/rules.js");
@@ -142,10 +142,14 @@ describe("界面:规则的一行(健康时只有状态和下次)", () => {
const now = new Date(2026, 10, 2, 7, 30).getTime();
const t = (d: number, h: number, m = 0) => new Date(2026, 10, 2 + d, h, m).getTime();
const r = (o: any) => ({ failures: 0, nextRunAt: t(1, 8), state: { key: "observe", label: "观察中" }, ...o });
- expect(ruleSub(r({}), now)).toBe("观察中 · 下次 明天 08:00");
- expect(ruleSub(r({ state: { key: "act", label: "执行中" }, nextRunAt: t(0, 15) }), now)).toBe("执行中 · 下次 今天 15:00");
- expect(ruleSub(r({ live: { state: "running" } }), now)).toBe("观察中 · 正在运行");
- expect(ruleSub(r({ state: { key: "paused", label: "已暂停" }, failures: 3, nextRunAt: 0 }), now)).toBe("已暂停 · 连续失败 3 次");
+ expect(ruleSub(r({}), now)).toBe("观察中,明天 08:00 再运行");
+ expect(ruleSub(r({ state: { key: "act", label: "执行中" }, nextRunAt: t(0, 15) }), now)).toBe("执行中,今天 15:00 再运行");
+ expect(ruleSub(r({ state: { key: "remind", label: "提醒" }, nextRunAt: t(1, 12) }), now)).toBe("明天 12:00 提醒你");
+ expect(ruleSub(r({ live: { state: "running" } }), now)).toBe("正在运行");
+ expect(ruleSub(r({ live: { state: "queued" } }), now)).toBe("排队中");
+ expect(ruleSub(r({ state: { key: "paused", label: "已暂停" }, failures: 3, nextRunAt: 0 }), now)).toBe("连续失败 3 次,已暂停");
+ expect(ruleSub(r({ state: { key: "paused", label: "已暂停" }, pausedReason: "budget", nextRunAt: 0 }), now)).toBe("本月预算用完,已暂停");
+ expect(ruleSub(r({ nextRunAt: 0 }), now)).toBe("观察中");
expect(ruleSub(r({ state: { key: "off", label: "已关闭" } }), now)).toBe("已关闭");
expect(ruleSub(r({ state: { key: "done", label: "已结束" }, nextRunAt: 0 }), now)).toBe("已结束");
expect([fmtRunAt(t(0, 8), now), fmtRunAt(t(-1, 8), now), fmtRunAt(t(-6, 8), now)]).toEqual(["今天 08:00", "昨天 08:00", "10/27 08:00"]);
@@ -153,8 +157,11 @@ describe("界面:规则的一行(健康时只有状态和下次)", () => {
expect([fmtNext(t(3, 9), now), fmtNext(t(10, 9), now)]).toEqual(["周四 09:00", "11/12 09:00"]);
// 英文:状态文字是服务端按界面语言给的,这里只换了界面自己的那部分
ui.setLangPref("en");
- expect(ruleSub(r({ state: { key: "observe", label: "Observing" } }), now)).toBe("Observing · Next: Tomorrow 08:00");
- expect(ruleSub(r({ state: { key: "paused", label: "Paused" }, failures: 3, nextRunAt: 0 }), now)).toBe("Paused · failed 3 times in a row");
+ expect(ruleSub(r({ state: { key: "observe", label: "Observing" } }), now)).toBe("Observing, next run tomorrow 08:00");
+ expect(ruleSub(r({ state: { key: "act", label: "Acting" }, nextRunAt: t(0, 15) }), now)).toBe("Acting, next run today 15:00");
+ expect(ruleSub(r({ state: { key: "remind", label: "Reminder" }, nextRunAt: t(1, 12) }), now)).toBe("Reminds you tomorrow 12:00");
+ expect(ruleSub(r({ state: { key: "paused", label: "Paused" }, failures: 3, nextRunAt: 0 }), now)).toBe("Failed 3 times in a row, so it's paused");
+ expect(ruleSub(r({ state: { key: "paused", label: "Paused" }, pausedReason: "budget", nextRunAt: 0 }), now)).toBe("Used up this month's budget, so it's paused");
expect([fmtRunAt(t(-1, 8), now), fmtNext(t(3, 9), now)]).toEqual(["Yesterday 08:00", "Thu 09:00"]);
ui.setLangPref("zh-CN");
});
@@ -448,6 +455,7 @@ describe("规则(假宿主、假时钟)", () => {
botName: "小蓝",
subject: "规则「看 X 价格」已观察 3 次,需要你来决定是否执行",
status: "",
+ head: "规则「看 X 价格」已观察 3 次,需要你来决定是否执行",
line: "本会做:在 X 的页面上点「降价提醒」",
since: runsOf(rule.id).at(-1)!.endedAt,
severity: "warn",
@@ -463,7 +471,7 @@ describe("规则(假宿主、假时钟)", () => {
expect(store.listOutbox({ limit: 100 })).toEqual([]);
const att = new Attention({ store });
att.addSource(() => svc.ruleAttention());
- att.addSource(() => [{ id: "cleanup:b", kind: "cleanup", botId: "b", botName: "小蓝", subject: "1 个任务文件夹 11月9日 删除", status: "", line: "", since: now + H, severity: "warn", actions: ["keep", "dismiss"] }]);
+ att.addSource(() => [{ id: "cleanup:b", kind: "cleanup", botId: "b", botName: "小蓝", subject: "1 个任务文件夹 11月9日 删除", status: "", head: "1 个任务文件夹 11月9日 删除", line: "", since: now + H, severity: "warn", actions: ["keep", "dismiss"] }]);
expect(att.list().map((a) => a.id)).toEqual(["cleanup:b", `suggest:${rule.id}`]);
expect(att.count()).toBe(2);
expect(att.takeNew().map((a) => a.id)).toEqual(["cleanup:b"]);
@@ -587,14 +595,14 @@ describe("规则(假宿主、假时钟)", () => {
expect(store.getRule(rule.id)!.failures).toBe(0);
await day("2026-11-04", report("failed", "X 的页面打不开"));
await day("2026-11-05", report("failed", "X 的页面打不开"));
- expect(svc.ruleAttention().map((a) => [a.kind, a.subject, a.status, a.severity, a.line])).toEqual([["rule", "规则「看 X 价格」", "连续失败 2 次", "warn", "X 的页面打不开"]]);
+ expect(svc.ruleAttention().map((a) => [a.kind, a.subject, a.status, a.head, a.severity, a.line])).toEqual([["rule", "规则「看 X 价格」", "连续失败 2 次", "规则「看 X 价格」连续失败 2 次", "warn", "X 的页面打不开"]]);
expect(pushes()).toEqual([]);
await day("2026-11-06", report("failed", "X 的页面打不开"));
expect(store.getRule(rule.id)).toMatchObject({ failures: 3, pausedReason: "failures", nextRunAt: 0 });
expect(svc.getRuleView(rule.id)!.state).toEqual({ key: "paused", label: "已暂停", dot: "err" });
const last = runsOf(rule.id).at(-1)!;
expect(pushes().map((r) => [r.id, r.purpose, r.body.text])).toEqual([[`rule:${rule.id}:paused:${last.id}`, "failure", "⚠️ 规则「看 X 价格」连续失败 3 次,已暂停:X 的页面打不开"]]);
- expect(svc.ruleAttention()[0]).toMatchObject({ status: "连续失败 3 次,已暂停", severity: "err", actions: ["retry"], ruleId: rule.id });
+ expect(svc.ruleAttention()[0]).toMatchObject({ status: "连续失败 3 次,已暂停", head: "规则「看 X 价格」连续失败 3 次,已暂停", severity: "err", actions: ["retry"], ruleId: rule.id });
// 暂停了就不再到点开 run
const n = host.prompts.length;
await go(at("2026-11-07T08:00"));
@@ -945,7 +953,7 @@ describe("规则(假宿主、假时钟)", () => {
try {
for (const date of ["2026-11-04", "2026-11-05", "2026-11-06"]) await day(date, report("failed", "", {}));
expect(pushes().find((r) => r.purpose === "failure")!.body.text).toBe("⚠️ Rule “看 X 价格” failed 3 times in a row and is paused: no result");
- expect(svc.ruleAttention()[0]).toMatchObject({ subject: "Rule “看 X 价格”", status: "Failed 3 times in a row, paused", line: "no result" });
+ expect(svc.ruleAttention()[0]).toMatchObject({ subject: "Rule “看 X 价格”", status: "Failed 3 times in a row, paused", head: "Rule “看 X 价格” failed 3 times in a row and is paused", line: "no result" });
expect(svc.listText(CONV)).toBe("Rules:\n1. 看 X 价格 · Paused: Daily 08:00\nSend /stop <number> to stop one.");
// 有任务又有规则:同一种写法、同一种语言,规则接着任务编号
expect(svc.create({ botId: "b", conversationId: CONV, title: "GPU prices", brief: "compare" }).task).toBeDefined();
diff --git a/test/tasks-view.e2e.test.ts b/test/tasks-view.e2e.test.ts
index 654c430..d7f8c7d 100644
--- a/test/tasks-view.e2e.test.ts
+++ b/test/tasks-view.e2e.test.ts
@@ -116,7 +116,8 @@ describe("任务视图的接口", () => {
it("保留文件夹:详情里的保留、「需要你」里的保留和知道了", async () => {
app.store.updateTask(done, { cleanupAt: Date.now() + 3 * 86400_000 });
const item = (await api("/attention")).data.items.find((i: any) => i.id === "cleanup:default");
- expect(item).toMatchObject({ kind: "cleanup", actions: ["keep", "dismiss"], line: "整理下载目录 · 30 天没动过" });
+ expect(item).toMatchObject({ kind: "cleanup", actions: ["keep", "dismiss"], line: "整理下载目录 30 天没动过了" });
+ expect(item.head).toBe(item.subject);
expect((await api("/attention/cleanup:default/dismiss", { method: "POST", body: {} })).data.items.find((i: any) => i.kind === "cleanup")).toBeUndefined();
app.store.updateTask(failed, { cleanupAt: Date.now() + 4 * 86400_000 });
expect((await api("/attention")).data.items.filter((i: any) => i.kind === "cleanup")).toHaveLength(1);
@@ -216,3 +217,37 @@ describe("观察够了的规则:「需要你」里问要不要改为执行", (
for (const x of [few, id, keep, other]) await api(`/rules/${x}`, { method: "DELETE" });
});
});
+
+describe("界面:任务那一行、每次运行、胶囊都是一句话", () => {
+ it("进行中说做了多久、花了多少;等你的、结束了的说什么时候怎么了;每次运行说用了多久;英文同样是一句话", async () => {
+ (globalThis as any).window ??= { matchMedia: () => ({ matches: false, addEventListener() {}, removeEventListener() {} }), addEventListener() {}, removeEventListener() {} };
+ // @ts-expect-error 界面代码是不经构建的 JS
+ const { taskSub, runLabel } = await import("../ui/components/tasks.js");
+ // @ts-expect-error 同上
+ const ui = await import("../ui/lib/i18n.js");
+ const now = new Date(2026, 10, 2, 15, 30).getTime();
+ const MIN = 60_000;
+ const task = (key: string, group: string, o: Record<string, unknown> = {}) => ({ stage: { key, label: "?", group }, createdAt: now - 12 * MIN, updatedAt: now - 5 * MIN, endedAt: 0, spentUsd: 0, ...o });
+ ui.setLangPref("zh-CN");
+ expect(taskSub(task("working", "working"), now)).toBe("已进行 12 分钟");
+ expect(taskSub(task("working", "working", { spentUsd: 0.08 }), now)).toBe("已进行 12 分钟,花了约 $0.08");
+ expect(taskSub(task("working/asking", "working", { spentUsd: 0.05 }), now)).toBe("已进行 12 分钟,有个问题等你回答");
+ expect(taskSub(task("working/queued", "working", { stage: { key: "working/queued", label: "排队中", group: "working" } }), now)).toBe("排队中");
+ expect(taskSub(task("needs-you/answer", "needs", { spentUsd: 0.21 }), now)).toBe("5 分钟前问了你一个问题");
+ expect(taskSub(task("failed", "needs", { updatedAt: now - 20_000 }), now)).toBe("刚刚失败了");
+ expect(taskSub(task("ready", "ended", { endedAt: new Date(2026, 10, 2, 9, 5).getTime(), spentUsd: 0.02 }), now)).toBe("09:05 完成,花了约 $0.02");
+ expect(taskSub(task("stopped", "ended", { endedAt: new Date(2026, 9, 26, 9, 5).getTime() }), now)).toBe("10月26日停止了");
+ const run = (o: Record<string, unknown>) => ({ state: "ended", queuedAt: now - 20 * MIN, startedAt: now - 20 * MIN, endedAt: now - 8 * MIN, ...o });
+ expect(runLabel(run({}), 0, now)).toBe("第 1 次运行,用了 12 分 0 秒");
+ expect(runLabel(run({ state: "running", endedAt: 0, startedAt: now - 34_000 }), 1, now)).toBe("第 2 次运行,已进行 34 秒");
+ expect(runLabel(run({ state: "queued", startedAt: 0, endedAt: 0 }), 2, now)).toBe("第 3 次运行,排队中");
+ ui.setLangPref("en");
+ expect(taskSub(task("working", "working", { spentUsd: 0.08 }), now)).toBe("Running for 12 min, about $0.08 so far");
+ expect(taskSub(task("needs-you/approval", "needs"), now)).toBe("Asked for your approval 5 min ago");
+ expect(taskSub(task("ready", "ended", { endedAt: new Date(2026, 10, 2, 9, 5).getTime(), spentUsd: 0.02 }), now)).toBe("Finished at 09:05, about $0.02");
+ expect(taskSub(task("stopped", "ended", { endedAt: new Date(2026, 9, 26, 9, 5).getTime() }), now)).toBe("Stopped on Oct 26");
+ expect(runLabel(run({}), 0, now)).toBe("Run 1 took 12m 0s");
+ expect(runLabel(run({ state: "queued", startedAt: 0, endedAt: 0 }), 1, now)).toBe("Run 2 is queued");
+ ui.setLangPref("zh-CN");
+ });
+});
diff --git a/ui/components/activity.js b/ui/components/activity.js
index da216b5..1549f5a 100644
--- a/ui/components/activity.js
+++ b/ui/components/activity.js
@@ -13,7 +13,7 @@ const DOT = { ok: "ok", error: "err", running: "warn" };
const stepDur = (ms) => (ms < 100 ? t("activity.lessThanTenth") : ms < 1000 ? t("activity.seconds", { s: (ms / 1000).toFixed(1) }) : fmtDur(ms));
const kTokens = (n) => (n >= 1000 ? `${(n / 1000).toFixed(n >= 10_000 ? 0 : 1)}k` : String(n));
-/** 正在进行的那一步,用在工作状态行上:"运行 bash" / "等待 grok-4.7 回复" */
+/** 正在进行的那一步,用在工作状态行上:"运行 bash" / "等待 grok-4.7 回复"(和用时合成一句:activity.stepFor) */
export function currentStep(steps) {
const s = (steps || []).findLast((x) => x.status === "running");
if (!s) return "";
@@ -95,7 +95,7 @@ export function ActivityLine({ label, phase, live, steps, count = 0, load }) {
if (!n) return html`<div class="work-line live" aria-live="off">${text}</div>`;
return html`<div class=${`activity${open ? " open" : ""}`}>
<button type="button" class=${`work-line toggle${live ? " live" : ""}`} aria-expanded=${open} aria-live="off" title=${t(open ? "activity.collapse" : "activity.expand")} onClick=${() => setOpen(!open)}>
- ${text}<span class="steps num">${t("activity.steps", { count: n })}</span><${Icon} name="chevRight" size=${12} class="chev" />
+ ${text}<${Icon} name="chevRight" size=${12} class="chev" />
</button>
${open && (list ? html`<${ActivityList} steps=${list} />` : html`<div class="act-list empty"><span class="hint">${err || t("common.loading")}</span></div>`)}
</div>`;
diff --git a/ui/components/guide.js b/ui/components/guide.js
index a16646e..e24a37f 100644
--- a/ui/components/guide.js
+++ b/ui/components/guide.js
@@ -336,7 +336,7 @@ export function MediaDemo({ prompt }) {
</div>
<figcaption class="t-meta" role="status">
${stage === "gen" ? t("guide.demo.generating") : t("guide.demo.caption")}
- ${stage === "done" && !g.media && html` · <a href=${MF_CONSOLE} target="_blank" rel="noopener noreferrer">${t("guide.demo.enable")}</a>`}
+ ${stage === "done" && !g.media && html` <a href=${MF_CONSOLE} target="_blank" rel="noopener noreferrer">${t("guide.demo.enable")}</a>`}
</figcaption>
</figure>`}
${stage === "cancel" && html`<p class="t-meta">${t("guide.demo.cancelled")} <button type="button" class="text" onClick=${() => setStage("ask")}>${t("guide.demo.again")}</button></p>`}
diff --git a/ui/components/rules.js b/ui/components/rules.js
index 6ef7feb..95b74ac 100644
--- a/ui/components/rules.js
+++ b/ui/components/rules.js
@@ -1,4 +1,4 @@
-// 规则(3d):信息面板「任务」组里一条规则一行——时间表 · 标题,下面一行是状态和下次运行(观察够了要不要改为执行,在「需要你」里问,
+// 规则(3d):信息面板「任务」组里一条规则一行——时间表 · 标题,下面一句状态和下次运行(观察够了要不要改为执行,在「需要你」里问,
// 从不推送)。点开是规则的详情:用户的原话、模式(观察 / 执行 / 关)、立即运行、编辑、删除,
// 和运行记录(一次一行:时间 · 模式 · 本会发送 / 保持安静 / 失败 / 跳过),每行再点开看报告、步骤、版本和权限;运行记录可以导出成
// Markdown(3f)。编辑器里有每次、每月的预算(3f,检查才有)。
@@ -29,22 +29,22 @@ export function fmtRunAt(at, now = Date.now()) {
return t("time.dateTime", { date: shortDate(d), time: hm(d) });
}
-/** 下次运行:今天 15:00 / 明天 08:00 / 周一 09:00 / 11/20 09:00 */
+/** 下次运行(放在句子里,英文小写):今天 15:00 / 明天 08:00 / 周一 09:00 / 11/20 09:00 */
export function fmtNext(at, now = Date.now()) {
const d = new Date(at);
const n = dayDiff(at, now);
- if (n <= 0) return t("time.today", { time: hm(d) });
+ if (n <= 0) return t("rules.today", { time: hm(d) });
if (n === 1) return t("rules.tomorrow", { time: hm(d) });
if (n < 7) return t("rules.weekdayTime", { day: d.toLocaleDateString(locale(), { weekday: "short" }), time: hm(d) });
return t("time.dateTime", { date: shortDate(d), time: hm(d) });
}
-/** 行的第二行:观察中 · 下次 明天 08:00;正在运行;已暂停 · 连续失败 3 次 / 本月预算用完(状态文字由服务端按界面语言给) */
+/** 行的第二行,一句话:观察中,明天 08:00 再运行;明天 08:00 提醒你;正在运行;连续失败 3 次,已暂停(其余的状态文字由服务端按界面语言给) */
export function ruleSub(rule, now = Date.now()) {
- if (rule.live) return t(rule.live.state === "queued" ? "rules.queued" : "rules.running", { state: rule.state.label });
+ if (rule.live) return t(rule.live.state === "queued" ? "rules.queued" : "rules.running");
if (rule.state.key === "paused") return rule.pausedReason === "budget" ? t("rules.pausedBudget") : t("rules.paused", { count: rule.failures });
- if (rule.state.key === "off" || rule.state.key === "done") return rule.state.label;
- return rule.nextRunAt ? t("rules.sub", { state: rule.state.label, next: fmtNext(rule.nextRunAt, now) }) : rule.state.label;
+ const next = { observe: "rules.observeNext", act: "rules.actNext", remind: "rules.remindNext" }[rule.state.key];
+ return next && rule.nextRunAt ? t(next, { next: fmtNext(rule.nextRunAt, now) }) : rule.state.label;
}
async function put(rule, body, done) {
diff --git a/ui/components/tasks.js b/ui/components/tasks.js
index 88bf6e6..0559858 100644
--- a/ui/components/tasks.js
+++ b/ui/components/tasks.js
@@ -1,18 +1,18 @@
-// 后台任务(3a,3f 补全):对话里请求那条消息下面的任务胶囊「后台任务 · 标题 · 进行中 ›」,点开是任务的详情;
+// 后台任务(3a,3f 补全):对话里请求那条消息下面的任务胶囊「后台任务「GPU 价格调研」进行中 ›」,点开是任务的详情;
// 信息面板的「任务」组(TaskGroup)是一个机器人的全部任务和规则:进行中、等你的、规则,结束了的收在最后一行「已结束 3」里,
// 点开才列出来。一个任务一行,点开是同一块里的详情(和规则一样,像普通的折叠一样展开)。
// 详情:来自(渠道、时间、原话)、它问你的问题(有默认回答时下面一句「不回复就按中文做」)、最新进展、预算(约 $0.08 / $1.00,
// 可以改)、文件夹(大小、打开)、要清理时的日期和保留、每次运行折叠的处理过程,以及停止 / 导出 / 删除。
// 状态是"点 + 文字":绿 = 进行中(问了个有默认回答的问题、接着在做的也是:「进行中,有个问题等你回答」),黄 = 等你,
// 红 = 失败,灰 = 已完成 / 已停止。
-// 健康时不多占地方:花费有了才写,清理只在定了日期时出现。
+// 健康时不多占地方:花费有了才写,清理只在定了日期时出现。行、胶囊、每次运行都是一句话(「已进行 12 分钟,花了约 $0.08」)。
import { useEffect, useRef, useState } from "preact/hooks";
import { html, Icon, Notice } from "./ui.js";
import { ActivityLine } from "./activity.js";
import { RuleRow } from "./rules.js";
import { api } from "../lib/api.js";
import { confirmSheet, failed, toast } from "../lib/store.js";
-import { fmtAgo, fmtDay, fmtDur, fmtSep, fmtSize } from "../lib/format.js";
+import { fmtClock, fmtDay, fmtDur, fmtSep, fmtSize } from "../lib/format.js";
import { channelName } from "../lib/access.js";
import { t, has, getLang } from "../lib/i18n.js";
@@ -29,14 +29,42 @@ export function stageDot(stage) {
export const hasCost = (usd) => Number(usd) >= 0.005;
export const money = (usd) => `$${Number(usd || 0).toFixed(2)}`;
-/** 每次运行怎么来的(launch、followup、recover、retry、continue、answer、manual) */
-const cause = (c) => (has(`tasks.cause.${c}`) ? t(`tasks.cause.${c}`) : c);
+/** 运行一行:「第 1 次运行,用了 12 分钟」「第 2 次运行,已进行 3 分钟」「第 2 次运行,排队中」 */
+export function runLabel(r, i, now = Date.now()) {
+ const n = i + 1;
+ if (r.state === "queued") return t("tasks.runQueued", { n });
+ if (!r.startedAt) return t("tasks.run", { n });
+ return t(r.state === "ended" ? "tasks.runTook" : "tasks.runGoing", { n, d: fmtDur((r.endedAt || now) - r.startedAt) });
+}
+
+/** 阶段在词典里的名字:needs-you/answer → answer,working/asking → asking */
+const stageName = (stage) => stage.key.split("/").pop();
+
+/** 句子里的时间:刚刚 / 5 分钟前 / 15:33 / 10月26日(英文:just now / 5 min ago / at 15:33 / on Oct 26) */
+function whenIn(at, now = Date.now()) {
+ const s = (now - at) / 1000;
+ if (s < 60) return t("tasks.when.now");
+ if (s < 3600) return t("time.minutesAgo", { count: Math.floor(s / 60) });
+ if (new Date(now).toDateString() === new Date(at).toDateString()) return t("tasks.when.clock", { time: fmtClock(at) });
+ return t("tasks.when.day", { date: fmtDay(at) });
+}
-/** 运行一行:"第 2 次 · 重启后继续 · 3 分钟" */
-function runLabel(r, i, now) {
- const ms = (r.endedAt || now) - (r.startedAt || r.queuedAt);
- const tail = r.state === "queued" ? t("tasks.queued") : r.startedAt ? fmtDur(ms) : "";
- return [t("tasks.run", { n: i + 1 }), cause(r.cause), tail].filter(Boolean).join(" · ");
+/**
+ * 行的第二行,一句话:进行中的说做了多久、花了多少(「已进行 12 分钟,花了约 $0.08」;问了有默认回答的问题时说这个,不写花费);
+ * 等你的说什么时候怎么了(「5 分钟前问了你一个问题」);结束了的再加花了多少(「15:33 完成,花了约 $0.02」)
+ */
+export function taskSub(task, now = Date.now()) {
+ const k = stageName(task.stage);
+ const spent = hasCost(task.spentUsd) ? money(task.spentUsd) : "";
+ if (task.stage.group === "working") {
+ if (k === "queued") return task.stage.label;
+ const d = t("tasks.minutes", { count: Math.max(1, Math.round((now - task.createdAt) / 60_000)) });
+ if (k === "asking") return t("tasks.sub.asking", { d });
+ return spent ? t("tasks.sub.workingCost", { d, spent }) : t("tasks.sub.working", { d });
+ }
+ if (!has(`tasks.sub.${k}`)) return task.stage.label;
+ const line = t(`tasks.sub.${k}`, { when: whenIn(task.endedAt || task.updatedAt, now) });
+ return task.stage.group === "ended" && spent ? t("tasks.sub.withCost", { line, spent }) : line;
}
export async function stopTask(task) {
@@ -155,14 +183,16 @@ export function TaskDetail({ task, onChanged, origin = true, question = true, on
</div>`;
}
-/** 对话里的任务胶囊:「后台任务 · 标题 · 进行中 ›」,点开看详情(data 给了就不去取:样例页) */
+/** 对话里的任务胶囊,一句话:「后台任务「GPU 价格调研」进行中 ›」,标题太长时只截标题;点开看详情(data 给了就不去取:样例页) */
export function TaskChip({ task, onChanged, data }) {
const [open, setOpen] = useState(false);
const dot = stageDot(task.stage);
+ const k = `tasks.chipLine.${stageName(task.stage)}`;
+ const title = html`<span class="t">${task.title}</span>`;
return html`<div class=${`task-chip${open ? " open" : ""}`}>
<button type="button" class="task-pill" aria-expanded=${open} title=${open ? t("tasks.collapse") : t("tasks.view")} onClick=${() => setOpen(!open)}>
<span class=${`dot ${dot}`} aria-hidden="true"></span>
- <span class="k">${t("tasks.chip")}</span><span class="sep">·</span><span class="t">${task.title}</span><span class="sep">·</span><span class="st">${task.stage.label}</span>
+ <span class="l">${has(k) ? t(k, { title }) : t("tasks.chipAny", { title, stage: task.stage.label })}</span>
<${Icon} name="chevRight" size=${12} class="chev" />
</button>
${open && html`<${TaskDetail} task=${task} origin=${false} onChanged=${onChanged} data=${data} />`}
@@ -170,13 +200,12 @@ export function TaskChip({ task, onChanged, data }) {
}
/**
- * 信息面板里的一行:状态点 + 标题,下面一行是状态、多久了(进行中)或什么时候结束的、花了多少(有了花费才写);
+ * 信息面板里的一行:状态点 + 标题,下面一句话(taskSub:做了多久、什么时候怎么了、花了多少);
* 进行中的可以直接停止。点开是同一块里的详情(data 给了就是样例页)
*/
export function TaskRow({ task, onChanged, open, onToggle, onOpenConv, data }) {
const [stopping, setStopping] = useState(false);
const working = task.stage.group === "working";
- const when = working ? t("tasks.minutes", { count: Math.max(1, Math.round((Date.now() - task.createdAt) / 60_000)) }) : fmtAgo(task.endedAt || task.updatedAt);
const stop = async (e) => {
e.stopPropagation();
setStopping(true);
@@ -188,7 +217,7 @@ export function TaskRow({ task, onChanged, open, onToggle, onOpenConv, data }) {
<span class=${`dot ${stageDot(task.stage)}`} aria-hidden="true"></span>
<div class="who">
<div class="name">${task.title}</div>
- <div class="sub">${task.stage.label} · ${when}${hasCost(task.spentUsd) ? ` · ${t("tasks.costShort", { spent: money(task.spentUsd) })}` : ""}</div>
+ <div class="sub">${taskSub(task)}</div>
</div>
${working && !open && html`<button type="button" class="text danger" disabled=${stopping} onClick=${stop} onKeyDown=${(e) => e.stopPropagation()}>${stopping ? t("tasks.stopping") : t("tasks.stop")}</button>`}
</div>
diff --git a/ui/css/chat.css b/ui/css/chat.css
index 95a0f7e..529149e 100644
--- a/ui/css/chat.css
+++ b/ui/css/chat.css
@@ -113,8 +113,6 @@ button.head-bot:active { background: var(--pill-press); }
每步一行:状态点 + 类别图标 + 名称 + 等宽摘要 + 用时;有参数或输出的步骤再点开看全文 */
.work-line.toggle { width: 100%; text-align: left; transition: color var(--t-fast); }
.work-line.toggle:hover { color: var(--fg); }
-.work-line .steps { color: var(--muted); }
-.work-line .steps::before { content: "·"; margin-right: var(--space-1-5); }
.work-line .chev, .act-head .chev { flex: none; transition: transform var(--t-fast); }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.activity { display: grid; grid-template-columns: minmax(0, 1fr); }
@@ -355,7 +353,7 @@ button.act-head:active { background: var(--pill-hover); }
.send .spinner { width: 12px; height: 12px; }
.composer-disabled { pointer-events: auto; width: var(--col); margin: 0 auto var(--space-2); }
-/* —— 后台任务:请求那条消息的回复下面一个胶囊「后台任务 · 标题 · 进行中 ›」(静默填充,不描边);
+/* —— 后台任务:请求那条消息的回复下面一个胶囊,一句话「后台任务「GPU 价格调研」进行中 ›」(静默填充,不描边;太长时只截标题);
点开是最新进展、文件夹、每次运行折叠的处理过程(和回复上方的"用时"同一种写法)和停止 —— */
.task-chip { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; margin-top: var(--space-2); }
.task-pill {
@@ -365,9 +363,8 @@ button.act-head:active { background: var(--pill-hover); }
}
.task-pill:hover { background: var(--pill-hover); color: var(--fg); }
.task-pill:active { background: var(--pill-press); transform: scale(var(--press)); }
-.task-pill .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: var(--fw-medium); }
-.task-pill :is(.k, .sep, .st) { flex: none; }
-.task-pill .sep { color: var(--muted); }
+.task-pill .l { display: flex; min-width: 0; white-space: nowrap; }
+.task-pill .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg); font-weight: var(--fw-medium); }
.task-pill .chev { flex: none; color: var(--muted); transition: transform var(--t-fast); }
.task-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); width: 100%; margin-top: var(--space-3); }
/* 详情里一行一样:小标签 + 值 + 行尾的大小、文字按钮(改预算、打开、保留);每次运行一行折叠的处理过程,行间不画线 */
diff --git a/ui/css/settings.css b/ui/css/settings.css
index 9d67cb5..e2f55eb 100644
--- a/ui/css/settings.css
+++ b/ui/css/settings.css
@@ -84,7 +84,7 @@
.notif time { font-size: var(--fs-2xs); color: var(--muted); }
/* 需要你(screens/needs-you.js):和设置页同一种页面;一组 .list,一件事一块,块间一条细线。
- 左边一列是状态点,右边一列从上到下:谁 · 什么 · 状态(可点:展开任务详情)、问题或命令、行内操作 */
+ 左边一列是状态点,右边一列从上到下:一句话说谁的什么怎么了(可点:展开任务详情)、问题或命令、行内操作 */
.needs-list .need {
display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-2-5); row-gap: var(--space-2);
padding: var(--space-3-5) var(--space-4);
diff --git a/ui/design/README.md b/ui/design/README.md
index 55e568b..dab6f7b 100644
--- a/ui/design/README.md
+++ b/ui/design/README.md
@@ -337,7 +337,21 @@ JS 组件(`ui/components/ui.js`)只是给常用组合一个带逻辑的写
## 文案
- 最短、能说清就行:不加解释性的括号,不写说明段落。健康、空闲时什么都不显示。
-- 一行里接连几个状态时,合成一句自然的话:「进行中,有个问题等你回答」,不是「进行中 · 有个问题」。时间、花费这类简短的元信息照旧用「·」隔开(「进行中 · 12 分钟 · 约 $0.08」)。放不下的细节去掉,不往句子里塞。
+- 一行里有状态,又跟着别的状态或事实(时间、花费、次数)时,写成一句自然的短句,不用「·」把碎片串起来:
+
+ | 写成 | 不写成 |
+ |---|---|
+ | 进行中,有个问题等你回答 | 进行中 · 有个问题 |
+ | 已进行 12 分钟,花了约 $0.08 | 进行中 · 12 分钟 · 约 $0.08 |
+ | 观察中,明天 08:00 再运行 | 观察中 · 下次 明天 08:00 |
+ | 第 1 次运行,用了 12 分钟 | 第 1 次 · 开始 · 34 步 · 12 分钟 |
+ | 小蓝的「GPU 价格调研」在等你回答 | 小蓝 · GPU 价格调研 · 等你回答 |
+ | 后台任务「GPU 价格调研」进行中 | 后台任务 · GPU 价格调研 · 进行中 |
+ | 规则「看 X 价格」已观察 3 次,需要你来决定是否执行 | 已观察 3 次 · 改为执行? |
+
+- 句子里不帮人做决定的细节直接去掉,不往句子里塞(上面的「开始」「34 步」就是这样去掉的)。
+- 「·」只留给没有状态词、让人扫一眼的紧凑元信息:模型的上下文 · 能力 · 价格,「微信 · 3 天前」这样的来源和时间,运行记录展开后的「第 1 版 · 只读 · 手动运行」,诊断信息。
+- 英文同样写成自然的句子,不照搬中文的断句:「Observing, next run tomorrow 08:00」「Run 1 took 12m 0s」「Ping: “GPU price research” is waiting for your answer」。句中的 today、tomorrow 小写。
- 中文、英文都要有(`ui/locales/`,服务端的在 `src/i18n/messages/`)。
## 新增或修改
diff --git a/ui/design/gallery.js b/ui/design/gallery.js
index e4ebdfb..4ee99d7 100644
--- a/ui/design/gallery.js
+++ b/ui/design/gallery.js
@@ -411,7 +411,7 @@ function Gallery() {
<${Demo} col title="容器与层次" note="一组东西 = 底色深一级(--well)+ 间距;里面不再套框;描边只留给输入框(≥ 3:1)和浮层玻璃" code=${`.card { background: var(--well); border-radius: var(--r-well); } /* 不描边、不加投影 */
.card .cmd { font-family: var(--code); } /* 卡片里的命令是一行等宽字,不再套底 */
.notice.red { --notice-bg: var(--red-wash); --notice-ic: var(--red); } /* 提示:淡底 + 图标 + --fg 字,不描边、无色条 */`}>
- ${() => html`<div class="card"><div class="meta">需要你的批准 · <span class="num">A7K2</span></div><div class="q">机器人想在工作区之外写入文件</div>
+ ${() => html`<div class="card"><div class="meta">需要你的批准,编号 <span class="num">A7K2</span></div><div class="q">机器人想在工作区之外写入文件</div>
<div class="cmd">write_file ~/Documents/周报/2026-W44.md</div>
<div class="actions"><${Button} variant="primary">允许(仅本次)<//><${Button}>拒绝<//></div></div>
<${Notice} tone="red">模型请求失败:HTTP 529 上游繁忙,请稍后重试<//>
@@ -610,12 +610,12 @@ const { mounted, leaving } = usePresence(open); /* design/motion.js:退场
<${NeedsRow} count=${3} onClick=${() => {}} /><${NeedsRow} count=${2} on onClick=${() => {}} /><${NeedsRow} count=${0} />
</div>`}
<//>
- <${Demo} flush col title="列表" note="NeedItem:等你回答 / 等你回答(任务接着在做,不回复就按默认)/ 等你批准 / 预算用完(再给 $1 继续?)/ 未送达 / 失败 / 规则本月预算用完 / 登录过期 / 预算留给聊天 / 清理文件夹 / 观察够了,要不要改为执行(不推送)">
+ <${Demo} flush col title="列表" note="NeedItem:标题行是一句话,几个机器人时带上名字(「小蓝的「GPU 价格调研」在等你回答」)。等你回答 / 等你回答(任务接着在做,不回复就按默认)/ 等你批准 / 预算用完(再给 $1 继续?)/ 未送达 / 失败 / 规则本月预算用完 / 登录过期 / 预算留给聊天 / 清理文件夹 / 观察够了,要不要改为执行(不推送)">
${() => html`<div class="list needs-list">${NEEDS.map((it) => html`<${NeedItem} item=${it} multiBot onAct=${async () => {}} />`)}</div>`}
<//>
<//>
- <${Section} id="rules" title="规则" lead="信息面板「任务」组里一条规则一行:时间表 · 标题,状态和下次运行。观察够了要不要改为执行,在「需要你」里问(从不推送)。点开是同一块里的详情和运行记录,记录一次一行、不画分隔线,再点开一行看报告。">
+ <${Section} id="rules" title="规则" lead="信息面板「任务」组里一条规则一行:时间表 · 标题,下面一句状态和下次运行(「观察中,明天 08:00 再运行」)。观察够了要不要改为执行,在「需要你」里问(从不推送)。点开是同一块里的详情和运行记录,记录一次一行、不画分隔线,再点开一行看报告。">
<${Demo} title="行" note="RuleRow:观察中 / 执行中 / 暂停 / 提醒">
${() => html`<div class="panel-body" style="width: 340px; flex: none; padding: var(--space-2); border-radius: var(--r-pane); background: var(--grain), var(--glass-panel)">
<div class="list">${RULES.map((r) => html`<${RuleRow} rule=${r} open=${false} onToggle=${() => {}} />`)}</div>
@@ -633,7 +633,7 @@ const { mounted, leaving } = usePresence(open); /* design/motion.js:退场
<//>
<//>
- <${Section} id="tasks" title="任务" lead="信息面板的「任务」组就是一个机器人的全部任务和规则:进行中、等你的在前,规则其次,结束了的收在最后一行里,点开才列出来(留 30 天)。一个任务一行,点开是同一块里的详情:来自、最新进展、预算(可以改)、文件夹(大小、打开)、要清理时的日期和保留、每次运行折叠的处理过程。什么都没有时整组不画。">
+ <${Section} id="tasks" title="任务" lead="信息面板的「任务」组就是一个机器人的全部任务和规则:进行中、等你的在前,规则其次,结束了的收在最后一行里,点开才列出来(留 30 天)。一个任务一行,第二行是一句话(「已进行 12 分钟,花了约 $0.08」「15:33 完成」),点开是同一块里的详情:来自、最新进展、预算(可以改)、文件夹(大小、打开)、要清理时的日期和保留、每次运行折叠的处理过程。什么都没有时整组不画。">
<${Demo} title="「任务」组" note="TaskGroup:进行中 / 进行中,有个问题等你回答(问了个有默认回答的问题,接着在做)/ 等你回答 / 规则 / 已结束 1(点开列出结束了的,那个文件夹 3 天后清理)">
${() => html`<div class="panel-body" style="width: 340px; flex: none; padding: var(--space-2); border-radius: var(--r-pane); background: var(--grain), var(--glass-panel)">
<${TaskGroup} botId="b" tasks=${TASKS} rules=${[RULES[0]]} ended=${ENDED} details=${{ t1: TASK_DETAIL, t4: ASKING_DETAIL, t2: ASK_DETAIL, t3: ENDED_DETAIL }} />
@@ -644,11 +644,11 @@ const { mounted, leaving } = usePresence(open); /* design/motion.js:退场
<div class="list"><${TaskRow} task=${ASKING} open data=${ASKING_DETAIL} onToggle=${() => {}} onOpenConv=${() => {}} /></div>
</div>`}
<//>
- <${Demo} col title="对话里的胶囊" note="TaskChip:进行中 / 进行中,有个问题等你回答;点开是详情(不写来自)">
+ <${Demo} col title="对话里的胶囊" note="TaskChip:一句话「后台任务「GPU 价格调研」进行中」,太长时只截标题;点开是详情(不写来自)">
${() => html`<div class="gal-chat"><div class="msg-row assistant"><${TaskChip} task=${TASKS[0]} data=${TASK_DETAIL} /></div>
<div class="msg-row assistant"><${TaskChip} task=${ASKING} data=${ASKING_DETAIL} /></div></div>`}
<//>
- <${Demo} title="详情" note="TaskRow 展开:来自 · 最新进展 · 预算 约 $0.08 / $1.00(改) · 文件夹 2.3 MB(打开) · 第 1 次 · 开始 · 停止 / 导出">
+ <${Demo} title="详情" note="TaskRow 展开:来自 · 最新进展 · 预算 约 $0.08 / $1.00(改) · 文件夹 2.3 MB(打开) · 第 1 次运行,已进行 12 分钟 · 停止 / 导出">
${() => html`<div class="panel-body" style="width: 340px; flex: none; padding: var(--space-2); border-radius: var(--r-pane); background: var(--grain), var(--glass-panel)">
<div class="list"><${TaskRow} task=${TASKS[0]} open data=${TASK_DETAIL} onToggle=${() => {}} onOpenConv=${() => {}} /></div>
</div>`}
@@ -678,18 +678,18 @@ const { mounted, leaving } = usePresence(open); /* design/motion.js:退场
/** 「需要你」的样例(单人:一个人用自己的机器人) */
const NEEDS = [
- { id: "q", kind: "question", botName: "小蓝", subject: "GPU 价格调研", status: "等你回答", line: "报告用中文还是英文?", since: Date.now() - 2 * 60_000, severity: "warn", questions: [{ id: "a", question: "报告用中文还是英文?", options: [{ label: "中文" }, { label: "英文" }] }] },
- { id: "qd", kind: "question", botName: "小蓝", subject: "竞品周报", status: "等你回答", line: "报告用中文还是英文?", note: "不回复就按中文做", since: Date.now() - 3 * 60_000, severity: "warn", taskId: "t4", questions: [{ id: "answer", question: "报告用中文还是英文?", options: [{ label: "中文" }, { label: "英文" }], default: "中文" }] },
- { id: "a", kind: "approval", botName: "小蓝", subject: "清理旧构建", status: "等你批准", line: "rm -rf build/", since: Date.now() - 5 * 60_000, severity: "warn" },
- { id: "bq", kind: "question", botName: "小蓝", subject: "季度报告 PPT", status: "预算用完", line: "已用约 $1.00,再给 $1 继续?", since: Date.now() - 8 * 60_000, severity: "warn", questions: [{ id: "budget", question: "已用约 $1.00,再给 $1 继续?", options: [{ label: "继续" }, { label: "停止" }] }] },
- { id: "d", kind: "delivery", botName: "小蓝", subject: "1 条结果未送达微信", status: "在微信里发条消息就能收到", line: "季度报告做好了,在 tasks 文件夹里。", since: Date.now() - 20 * 60_000, severity: "warn", actions: [] },
- { id: "f", kind: "failed", botName: "红魔", subject: "季度报告", status: "失败", line: "X 云的价格页要登录,我进不去", since: Date.now() - 40 * 60_000, severity: "err" },
- { id: "r", kind: "rule", botName: "红魔", subject: "规则「每日 issue 巡检」", status: "连续失败 3 次,已暂停", line: "GitHub 返回 401:令牌可能过期了", since: Date.now() - 90 * 60_000, severity: "err", actions: ["retry"] },
- { id: "rb", kind: "rule", botName: "小蓝", subject: "规则「看 X 价格」", status: "本月预算用完", line: "已用约 $3.00,下月自动恢复。再给 $3 继续?", since: Date.now() - 2 * 3600_000, severity: "warn", actions: ["continue"] },
- { id: "l", kind: "login", botName: "绿草", subject: "微信登录已过期", status: "", line: "", since: Date.now() - 3 * 3600_000, severity: "err" },
- { id: "rs", kind: "budget", botName: "小蓝", subject: "后台工作已停", status: "", line: "机器人预算只剩约 $1.80(共 $10),留给聊天", since: Date.now() - 4 * 3600_000, severity: "warn", actions: ["open"] },
- { id: "c", kind: "cleanup", botName: "小蓝", subject: "2 个任务文件夹 11月4日 删除", status: "", line: "整理下载目录和旧照片归档 · 30 天没动过", since: Date.now() - 5 * 3600_000, severity: "warn", actions: ["keep", "dismiss"] },
- { id: "s", kind: "suggest", botName: "小蓝", subject: "规则「看 X 价格」已观察 3 次,需要你来决定是否执行", status: "", line: "本会发送:“X 降价了,现在 ¥199(昨天 ¥259)”", since: Date.now() - 6 * 3600_000, severity: "warn", actions: ["act", "dismiss"], ruleTitle: "看 X 价格" },
+ { id: "q", kind: "question", botName: "小蓝", subject: "GPU 价格调研", status: "等你回答", head: "「GPU 价格调研」在等你回答", line: "报告用中文还是英文?", since: Date.now() - 2 * 60_000, severity: "warn", questions: [{ id: "a", question: "报告用中文还是英文?", options: [{ label: "中文" }, { label: "英文" }] }] },
+ { id: "qd", kind: "question", botName: "小蓝", subject: "竞品周报", status: "等你回答", head: "「竞品周报」在等你回答", line: "报告用中文还是英文?", note: "不回复就按中文做", since: Date.now() - 3 * 60_000, severity: "warn", taskId: "t4", questions: [{ id: "answer", question: "报告用中文还是英文?", options: [{ label: "中文" }, { label: "英文" }], default: "中文" }] },
+ { id: "a", kind: "approval", botName: "小蓝", subject: "清理旧构建", status: "等你批准", head: "「清理旧构建」在等你批准", line: "rm -rf build/", since: Date.now() - 5 * 60_000, severity: "warn" },
+ { id: "bq", kind: "question", botName: "小蓝", subject: "季度报告 PPT", status: "预算用完", head: "「季度报告 PPT」预算用完了", line: "已用约 $1.00,再给 $1 继续?", since: Date.now() - 8 * 60_000, severity: "warn", questions: [{ id: "budget", question: "已用约 $1.00,再给 $1 继续?", options: [{ label: "继续" }, { label: "停止" }] }] },
+ { id: "d", kind: "delivery", botName: "小蓝", subject: "1 条结果未送达微信", status: "在微信里发条消息就能收到", head: "1 条结果未送达微信,在微信里发条消息就能收到", line: "季度报告做好了,在 tasks 文件夹里。", since: Date.now() - 20 * 60_000, severity: "warn", actions: [] },
+ { id: "f", kind: "failed", botName: "红魔", subject: "季度报告", status: "失败", head: "「季度报告」失败了", line: "X 云的价格页要登录,我进不去", since: Date.now() - 40 * 60_000, severity: "err" },
+ { id: "r", kind: "rule", botName: "红魔", subject: "规则「每日 issue 巡检」", status: "连续失败 3 次,已暂停", head: "规则「每日 issue 巡检」连续失败 3 次,已暂停", line: "GitHub 返回 401:令牌可能过期了", since: Date.now() - 90 * 60_000, severity: "err", actions: ["retry"] },
+ { id: "rb", kind: "rule", botName: "小蓝", subject: "规则「看 X 价格」", status: "本月预算用完", head: "规则「看 X 价格」本月预算用完了", line: "已用约 $3.00,下月自动恢复。再给 $3 继续?", since: Date.now() - 2 * 3600_000, severity: "warn", actions: ["continue"] },
+ { id: "l", kind: "login", botName: "绿草", subject: "微信登录已过期", status: "", head: "微信登录已过期", line: "", since: Date.now() - 3 * 3600_000, severity: "err" },
+ { id: "rs", kind: "budget", botName: "小蓝", subject: "后台工作已停", status: "", head: "后台工作已停", line: "机器人预算只剩约 $1.80(共 $10),留给聊天", since: Date.now() - 4 * 3600_000, severity: "warn", actions: ["open"] },
+ { id: "c", kind: "cleanup", botName: "小蓝", subject: "2 个任务文件夹 11月4日 删除", status: "", head: "2 个任务文件夹 11月4日 删除", line: "整理下载目录和旧照片归档 30 天没动过了", since: Date.now() - 5 * 3600_000, severity: "warn", actions: ["keep", "dismiss"] },
+ { id: "s", kind: "suggest", botName: "小蓝", subject: "规则「看 X 价格」已观察 3 次,需要你来决定是否执行", status: "", head: "规则「看 X 价格」已观察 3 次,需要你来决定是否执行", line: "本会发送:“X 降价了,现在 ¥199(昨天 ¥259)”", since: Date.now() - 6 * 3600_000, severity: "warn", actions: ["act", "dismiss"], ruleTitle: "看 X 价格" },
];
/** 任务的样例(单人:自己的机器人小蓝):在调研的、问了个有默认回答的问题接着在做的、等你回答的、昨天做完的(文件夹 3 天后清理) */
diff --git a/ui/locales/en/activity.js b/ui/locales/en/activity.js
index 7722573..bdb7c9c 100644
--- a/ui/locales/en/activity.js
+++ b/ui/locales/en/activity.js
@@ -20,5 +20,5 @@ export default {
noSteps: "No steps yet",
expand: "Show activity",
collapse: "Hide activity",
- steps: { one: "{count} step", other: "{count} steps" },
+ stepFor: "{step}, {d} so far",
};
diff --git a/ui/locales/en/botSettings.js b/ui/locales/en/botSettings.js
index 07f6f19..d320055 100644
--- a/ui/locales/en/botSettings.js
+++ b/ui/locales/en/botSettings.js
@@ -27,7 +27,7 @@ export default {
off: "Shares this device's key with other bots, with no separate limit",
on: "Uses this bot's own key and stops at the limit",
usage: "{used} used, {remain} left",
- exhausted: "{used} used, {remain} left · Used up — the bot has paused model calls",
+ exhausted: "{used} used, nothing left, so the bot has paused model calls",
limit: "Limit (USD)",
limitSub: "Includes what's already spent. Raising it restores a used-up key automatically.",
limitLabel: "Budget limit (USD)",
@@ -61,7 +61,7 @@ export default {
head: "Computer use",
backend: "Backend",
backendLabel: "Computer use backend",
- cuaNote: "Bundled · macOS / Windows / Linux",
+ cuaNote: "Bundled, for macOS, Windows and Linux",
codex: "Codex bridge",
macOnly: "macOS only",
macOnlyUnavailable: "macOS only, unavailable on this device",
@@ -91,7 +91,7 @@ export default {
resetOwnerBody: "The next person to message the bot becomes the {channel} owner, and \"{who}\" will need to be allowed again.",
allowed: "Allowed",
denied: "Denied",
- deniedSub: "Denied {when} · they get no reply if they message again",
+ deniedSub: "Denied {when}; they get no reply if they message again",
allow: "Allow",
remove: "Remove",
removeDeniedTitle: "Remove \"{who}\"?",
diff --git a/ui/locales/en/chat.js b/ui/locales/en/chat.js
index 158a086..39e47ed 100644
--- a/ui/locales/en/chat.js
+++ b/ui/locales/en/chat.js
@@ -25,8 +25,8 @@ export default {
more: "More permission settings…",
},
approval: {
- neededTask: "\"{title}\" needs your approval · {code}",
- needed: "Needs your approval · {code}",
+ neededTask: "\"{title}\" needs your approval, code {code}",
+ needed: "Needs your approval, code {code}",
fallbackReason: "The bot wants to do something outside its workspace",
allowOnce: "Allow once",
deny: "Deny",
@@ -39,11 +39,11 @@ export default {
submit: "Submit",
},
file: {
- delivered: "Delivered to the bot's workspace · sent directly on WeChat/Feishu",
+ delivered: "Delivered to the bot's workspace; on WeChat and Feishu it's sent directly",
},
work: {
- stopping: "Stopping…{extra}",
- processedFor: " · ran for {d}",
+ stopping: "Stopping…",
+ stoppingAfter: "Stopping after {d}…",
process: "Activity",
done: "Worked for {d}",
replying: "Replying for {d}",
diff --git a/ui/locales/en/guide.js b/ui/locales/en/guide.js
index 25e4223..091303c 100644
--- a/ui/locales/en/guide.js
+++ b/ui/locales/en/guide.js
@@ -6,7 +6,7 @@ export default {
title: "Getting started",
allDone: "Getting started complete",
progress: "Getting started · {progress}",
- toastProgress: "Getting started {progress} · {title}",
+ toastProgress: "Finished “{title}”, {progress} done",
collapse: "Minimize to sidebar",
demoThis: "Demo prompt",
watchDemo: "Watch demo",
@@ -31,11 +31,11 @@ export default {
question: "Generate this image with “Sample image model”?",
pickModel: "Choose a model",
sampleModel: "Sample image model",
- sampleDesc: "Default · free in this demo",
+ sampleDesc: "The default, free in this demo",
cancelDesc: "Don't generate this time",
alt: "Sample image: a little blue robot wearing headphones, flat illustration style",
generating: "Generating (demo)…",
- caption: "Sample image · bundled with the app, no model called",
+ caption: "This sample image comes with the app; no model was called.",
enable: "Enable image models ↗",
cancelled: "Cancelled: nothing was generated or charged.",
again: "Try again",
diff --git a/ui/locales/en/info.js b/ui/locales/en/info.js
index 554ff45..bb28270 100644
--- a/ui/locales/en/info.js
+++ b/ui/locales/en/info.js
@@ -20,7 +20,7 @@ export default {
feishu: {
bindHint: "Send the bot a message from your own Feishu account to finish binding.",
sub: "Receives messages over a long connection",
- secretSaved: "Saved {masked} · leave blank to keep it",
+ secretSaved: "Saved {masked}. Leave blank to keep it",
saveConnect: "Save and connect",
disconnect: "Disconnect",
disconnectTitle: "Disconnect Feishu?",
@@ -59,7 +59,7 @@ export default {
allowed: "Allowed \"{who}\"",
denied: "Denied \"{who}\"",
messages: { one: "sent {count} message", other: "sent {count} messages" },
- wants: "Wants to use this bot · pairing code {code}",
+ wants: "Wants to use this bot with pairing code {code}",
quote: "\"{text}\"",
allow: "Allow",
deny: "Deny",
@@ -68,7 +68,7 @@ export default {
turn: {
stopFailed: "Couldn't stop: {error}",
processing: "Processing for {d}",
- waitingAgent: " · waiting for the agent process",
+ waitingAgent: "Waiting for the agent process",
idle: "No progress for {d}",
stop: "Stop",
activity: "Activity",
diff --git a/ui/locales/en/needs.js b/ui/locales/en/needs.js
index 429f1bd..5096cf7 100644
--- a/ui/locales/en/needs.js
+++ b/ui/locales/en/needs.js
@@ -1,6 +1,8 @@
// needs · en
export default {
title: "Needs you",
+ head: "{bot}: {what}",
+ headSpaced: "{bot}: {what}",
collapse: "Collapse",
viewTask: "View task",
viewRule: "View rule",
diff --git a/ui/locales/en/onboarding.js b/ui/locales/en/onboarding.js
index 55b5e15..382d96b 100644
--- a/ui/locales/en/onboarding.js
+++ b/ui/locales/en/onboarding.js
@@ -36,7 +36,7 @@ export default {
copyLink: "Copy link",
},
model: {
- found: { one: "Connected · {n} model found", other: "Connected · {n} models found" },
+ found: { one: "Connected and found {n} model", other: "Connected and found {n} models" },
hint: "Pick a default model. You can switch anytime in a chat.",
filter: "Filter models",
default: "Default model",
diff --git a/ui/locales/en/rules.js b/ui/locales/en/rules.js
index 5de03dd..f2b67a6 100644
--- a/ui/locales/en/rules.js
+++ b/ui/locales/en/rules.js
@@ -1,13 +1,16 @@
// rules · en
export default {
- tomorrow: "Tomorrow {time}",
+ today: "today {time}",
+ tomorrow: "tomorrow {time}",
weekdayTime: "{day} {time}",
mode: { observe: "Observe", act: "Act", off: "Off", on: "On" },
- sub: "{state} · Next: {next}",
- running: "{state} · running",
- queued: "{state} · queued",
- paused: { one: "Paused · failed {count} time in a row", other: "Paused · failed {count} times in a row" },
- pausedBudget: "Paused · monthly budget used up",
+ observeNext: "Observing, next run {next}",
+ actNext: "Acting, next run {next}",
+ remindNext: "Reminds you {next}",
+ running: "Running now",
+ queued: "Queued",
+ paused: { one: "Failed {count} time in a row, so it's paused", other: "Failed {count} times in a row, so it's paused" },
+ pausedBudget: "Used up this month's budget, so it's paused",
month: "This month about {spent} of {budget}",
nowActs: "“{title}” now acts",
version: "Version {n}",
diff --git a/ui/locales/en/settings.js b/ui/locales/en/settings.js
index c4b356a..48cacfe 100644
--- a/ui/locales/en/settings.js
+++ b/ui/locales/en/settings.js
@@ -87,7 +87,7 @@ export default {
guide: {
name: "Getting-started checklist",
hidden: "Hidden. Start over to bring it back on the chat page and at the bottom of the sidebar",
- progress: "Learn what your bots can do, one step at a time · {done}/{total} done",
+ progress: "Learn what your bots can do, one step at a time. {done} of {total} done",
keys: "guide onboarding tutorial checklist getting started",
restart: "Start over",
restarted: "Checklist restarted",
@@ -156,7 +156,7 @@ export default {
account: {
name: "Modelflare account",
signedIn: "Signed in",
- enterprise: "{name} · Billed to your organization's wallet",
+ enterprise: "{name}, billed to your organization's wallet",
signedOut: "Sign in to see usage, notifications and your invite link, and to set budgets for individual bots",
keys: "account sign in sign up log in log out login",
logout: "Sign out",
diff --git a/ui/locales/en/tasks.js b/ui/locales/en/tasks.js
index 9ea98fe..d950525 100644
--- a/ui/locales/en/tasks.js
+++ b/ui/locales/en/tasks.js
@@ -1,8 +1,9 @@
// tasks · en
export default {
- cause: { launch: "Started", followup: "Continued after a follow-up", recover: "Resumed after a restart", retry: "Retry", continue: "Continued", answer: "Continued after your answer", manual: "Run manually" },
run: "Run {n}",
- queued: "Queued",
+ runQueued: "Run {n} is queued",
+ runGoing: "Run {n} has been going for {d}",
+ runTook: "Run {n} took {d}",
stopped: "Stopped \"{title}\"",
latest: "Latest progress",
folder: "Folder",
@@ -10,7 +11,33 @@ export default {
stopping: "Stopping…",
collapse: "Collapse",
view: "View background task",
- chip: "Background task",
+ chipLine: {
+ working: "Background task “{title}” is in progress",
+ asking: "Background task “{title}” is in progress, with a question for you",
+ queued: "Background task “{title}” is queued",
+ answer: "Background task “{title}” is waiting for your answer",
+ approval: "Background task “{title}” is waiting for your approval",
+ budget: "Background task “{title}” used up its budget",
+ delivery: "Background task “{title}” couldn't deliver its result",
+ failed: "Background task “{title}” failed",
+ ready: "Background task “{title}” is done",
+ stopped: "Background task “{title}” was stopped",
+ },
+ chipAny: "Background task “{title}”: {stage}",
+ sub: {
+ working: "Running for {d}",
+ workingCost: "Running for {d}, about {spent} so far",
+ asking: "Running for {d}, with a question for you",
+ answer: "Asked you a question {when}",
+ approval: "Asked for your approval {when}",
+ budget: "Used up its budget {when}",
+ delivery: "Couldn't deliver its result {when}",
+ failed: "Failed {when}",
+ ready: "Finished {when}",
+ stopped: "Stopped {when}",
+ withCost: "{line}, about {spent}",
+ },
+ when: { now: "just now", clock: "at {time}", day: "on {date}" },
minutes: { one: "{count} min", other: "{count} min" },
paused: "Background work is paused",
resume: "Resume",
diff --git a/ui/locales/zh-CN/activity.js b/ui/locales/zh-CN/activity.js
index e607226..5397a8f 100644
--- a/ui/locales/zh-CN/activity.js
+++ b/ui/locales/zh-CN/activity.js
@@ -20,5 +20,5 @@ export default {
noSteps: "还没有步骤",
expand: "查看处理过程",
collapse: "收起处理过程",
- steps: { other: "{count} 步" },
+ stepFor: "{step},已用 {d}",
};
diff --git a/ui/locales/zh-CN/botSettings.js b/ui/locales/zh-CN/botSettings.js
index b5c80a9..1584a78 100644
--- a/ui/locales/zh-CN/botSettings.js
+++ b/ui/locales/zh-CN/botSettings.js
@@ -27,7 +27,7 @@ export default {
off: "与其他机器人共用本机的 Key,不单独限额",
on: "用这个机器人自己的 Key,花到上限就停",
usage: "已用 {used},还剩 {remain}",
- exhausted: "已用 {used},还剩 {remain} · 已用完,机器人暂停调用模型",
+ exhausted: "已用 {used},额度用完了,机器人暂停调用模型",
limit: "上限(美元)",
limitSub: "包括已经花掉的部分;调高后用完的 Key 会自动恢复",
limitLabel: "预算上限(美元)",
@@ -91,7 +91,7 @@ export default {
resetOwnerBody: "下一个给机器人发消息的人会成为{channel}主人,「{who}」需要重新被允许。",
allowed: "允许名单",
denied: "拒绝过的人",
- deniedSub: "{when}拒绝 · 他再发消息不会收到任何回复",
+ deniedSub: "{when}拒绝,他再发消息不会收到任何回复",
allow: "允许",
remove: "移除",
removeDeniedTitle: "移除「{who}」?",
diff --git a/ui/locales/zh-CN/chat.js b/ui/locales/zh-CN/chat.js
index 0b985ac..14df122 100644
--- a/ui/locales/zh-CN/chat.js
+++ b/ui/locales/zh-CN/chat.js
@@ -25,8 +25,8 @@ export default {
more: "更多权限设置…",
},
approval: {
- needed: "需要你的批准 · {code}",
- neededTask: "「{title}」需要你的批准 · {code}",
+ needed: "需要你的批准,编号 {code}",
+ neededTask: "「{title}」需要你的批准,编号 {code}",
fallbackReason: "机器人想执行一个超出工作区的操作",
allowOnce: "允许(仅本次)",
deny: "拒绝",
@@ -39,12 +39,12 @@ export default {
submit: "提交",
},
file: {
- delivered: "已交付到机器人工作区 · 微信/飞书会直接发送",
+ delivered: "已交付到机器人工作区,微信和飞书会直接发送",
},
/** 回复上方的工作状态;{d} 是 fmtDur 的用时 */
work: {
- stopping: "正在停止…{extra}",
- processedFor: " 已处理 {d}",
+ stopping: "正在停止…",
+ stoppingAfter: "处理了 {d},正在停止…",
process: "处理过程",
done: "用时 {d}",
replying: "正在回复 {d}",
diff --git a/ui/locales/zh-CN/guide.js b/ui/locales/zh-CN/guide.js
index 0305e9f..44666dc 100644
--- a/ui/locales/zh-CN/guide.js
+++ b/ui/locales/zh-CN/guide.js
@@ -10,7 +10,7 @@ export default {
allDone: "上手清单全部完成",
/** 「上手清单 · 3/6」;progress 可以是带样式的数字 */
progress: "上手清单 · {progress}",
- toastProgress: "上手清单 {progress} · {title}",
+ toastProgress: "完成了「{title}」,上手清单 {progress}",
collapse: "收起到左下角",
demoThis: "演示这句",
watchDemo: "看演示",
@@ -35,11 +35,11 @@ export default {
question: "这次用「示例图片模型」生成图片吗?",
pickModel: "选择模型",
sampleModel: "示例图片模型",
- sampleDesc: "默认 · 演示不扣费",
+ sampleDesc: "默认选它,演示不扣费",
cancelDesc: "这次不生成",
alt: "示例图:戴着耳机的蓝色小机器人,扁平插画风",
generating: "正在生成(演示)…",
- caption: "示例图 · 客户端自带,没有调用模型",
+ caption: "示例图是客户端自带的,没有调用模型。",
enable: "开通图片模型 ↗",
cancelled: "已取消:没有生成,也没有扣费。",
again: "再来一次",
diff --git a/ui/locales/zh-CN/info.js b/ui/locales/zh-CN/info.js
index bed96f1..26b9773 100644
--- a/ui/locales/zh-CN/info.js
+++ b/ui/locales/zh-CN/info.js
@@ -63,7 +63,7 @@ export default {
allowed: "已允许「{who}」",
denied: "已拒绝「{who}」",
messages: { other: "发了 {count} 条消息" },
- wants: "想使用这个机器人 · 配对码 {code}",
+ wants: "想使用这个机器人,配对码 {code}",
quote: "「{text}」",
allow: "允许",
deny: "拒绝",
@@ -72,7 +72,7 @@ export default {
turn: {
stopFailed: "中止失败:{error}",
processing: "正在处理 {d}",
- waitingAgent: " · 等代理进程接手",
+ waitingAgent: "等代理进程接手",
idle: "{d}没有新进展",
stop: "中止",
activity: "处理过程",
diff --git a/ui/locales/zh-CN/needs.js b/ui/locales/zh-CN/needs.js
index 2ec72e5..7c8f356 100644
--- a/ui/locales/zh-CN/needs.js
+++ b/ui/locales/zh-CN/needs.js
@@ -1,6 +1,8 @@
// needs · zh-CN(screens/needs-you.js:「需要你」)
export default {
title: "需要你",
+ head: "{bot}的{what}",
+ headSpaced: "{bot}的 {what}",
collapse: "收起",
viewTask: "查看任务",
viewRule: "查看规则",
diff --git a/ui/locales/zh-CN/onboarding.js b/ui/locales/zh-CN/onboarding.js
index 6f184f0..6e1f8da 100644
--- a/ui/locales/zh-CN/onboarding.js
+++ b/ui/locales/zh-CN/onboarding.js
@@ -38,7 +38,7 @@ export default {
},
model: {
/** n 是带样式的数字,count 用来选单复数 */
- found: "已连接 · 找到 {n} 个模型",
+ found: "已连接,找到 {n} 个模型",
hint: "选一个默认模型,之后随时可在对话里切换。",
filter: "筛选模型",
default: "默认模型",
diff --git a/ui/locales/zh-CN/rules.js b/ui/locales/zh-CN/rules.js
index 9f7cb1c..3a4af8a 100644
--- a/ui/locales/zh-CN/rules.js
+++ b/ui/locales/zh-CN/rules.js
@@ -1,13 +1,16 @@
// rules · zh-CN(components/rules.js:信息面板里规则的行、详情、运行记录,新建 / 编辑规则的对话框)
export default {
+ today: "今天 {time}",
tomorrow: "明天 {time}",
weekdayTime: "{day} {time}",
mode: { observe: "观察", act: "执行", off: "关", on: "开" },
- sub: "{state} · 下次 {next}",
- running: "{state} · 正在运行",
- queued: "{state} · 排队中",
- paused: { other: "已暂停 · 连续失败 {count} 次" },
- pausedBudget: "已暂停 · 本月预算用完",
+ observeNext: "观察中,{next} 再运行",
+ actNext: "执行中,{next} 再运行",
+ remindNext: "{next} 提醒你",
+ running: "正在运行",
+ queued: "排队中",
+ paused: { other: "连续失败 {count} 次,已暂停" },
+ pausedBudget: "本月预算用完,已暂停",
month: "本月 约 {spent} / {budget}",
nowActs: "「{title}」改为执行",
version: "第 {n} 版",
diff --git a/ui/locales/zh-CN/settings.js b/ui/locales/zh-CN/settings.js
index f911c47..fd14204 100644
--- a/ui/locales/zh-CN/settings.js
+++ b/ui/locales/zh-CN/settings.js
@@ -87,7 +87,7 @@ export default {
guide: {
name: "上手清单",
hidden: "已不再显示;重新开始后,对话页和侧栏左下角会再出现",
- progress: "跟着清单认识机器人能做的事 · 已完成 {done}/{total}",
+ progress: "跟着清单认识机器人能做的事,已完成 {done}/{total}",
keys: "引导 新手 教程 清单 onboarding guide",
restart: "重新开始",
restarted: "上手清单已重新开始",
@@ -156,7 +156,7 @@ export default {
account: {
name: "Modelflare 账户",
signedIn: "已登录",
- enterprise: "{name} · 由企业钱包付费",
+ enterprise: "{name},由企业钱包付费",
signedOut: "登录后可以查看用量、通知和邀请链接,也能给机器人单独设预算",
keys: "登录 注册 账户 退出 account login",
logout: "退出登录",
diff --git a/ui/locales/zh-CN/tasks.js b/ui/locales/zh-CN/tasks.js
index 8b212e2..168d8ef 100644
--- a/ui/locales/zh-CN/tasks.js
+++ b/ui/locales/zh-CN/tasks.js
@@ -1,8 +1,9 @@
// tasks · zh-CN
export default {
- cause: { launch: "开始", followup: "追加后继续", recover: "重启后继续", retry: "重试", continue: "继续", answer: "回答后继续", manual: "手动运行" },
- run: "第 {n} 次",
- queued: "排队中",
+ run: "第 {n} 次运行",
+ runQueued: "第 {n} 次运行,排队中",
+ runGoing: "第 {n} 次运行,已进行 {d}",
+ runTook: "第 {n} 次运行,用了 {d}",
stopped: "已停止「{title}」",
latest: "最新进展",
folder: "文件夹",
@@ -10,7 +11,35 @@ export default {
stopping: "正在停止…",
collapse: "收起",
view: "查看后台任务",
- chip: "后台任务",
+ // 对话里的胶囊(按阶段)
+ chipLine: {
+ working: "后台任务「{title}」进行中",
+ asking: "后台任务「{title}」进行中,有个问题等你回答",
+ queued: "后台任务「{title}」在排队",
+ answer: "后台任务「{title}」在等你回答",
+ approval: "后台任务「{title}」在等你批准",
+ budget: "后台任务「{title}」的预算用完了",
+ delivery: "后台任务「{title}」的结果没送到",
+ failed: "后台任务「{title}」失败了",
+ ready: "后台任务「{title}」做好了",
+ stopped: "后台任务「{title}」已停止",
+ },
+ chipAny: "后台任务「{title}」{stage}",
+ // 信息面板里任务那一行的第二行(按阶段);{when} 是 when 里的一种
+ sub: {
+ working: "已进行 {d}",
+ workingCost: "已进行 {d},花了约 {spent}",
+ asking: "已进行 {d},有个问题等你回答",
+ answer: "{when}问了你一个问题",
+ approval: "{when}请你批准一个操作",
+ budget: "{when}用完了预算",
+ delivery: "{when}的结果没送到",
+ failed: "{when}失败了",
+ ready: "{when}完成",
+ stopped: "{when}停止了",
+ withCost: "{line},花了约 {spent}",
+ },
+ when: { now: "刚刚", clock: "{time} ", day: "{date}" },
minutes: { other: "{count} 分钟" },
paused: "后台工作已暂停",
resume: "恢复",
diff --git a/ui/screens/chat.js b/ui/screens/chat.js
index 76e4ff8..20e7a7e 100644
--- a/ui/screens/chat.js
+++ b/ui/screens/chat.js
@@ -169,7 +169,8 @@ function FileCard({ name }) {
}
/**
- * 回复上方的工作状态:没出字时"思考中 · 正在做的那一步",出字后"正在回复 N 秒",结束后"用时 N 秒"(短于 3 秒且没有步骤时不显示)。
+ * 回复上方的工作状态,一句话:没出字时"思考中 N 秒",有一步在做时是那一步"运行 bash,已用 N 秒",出字后"正在回复 N 秒",
+ * 结束后"用时 N 秒"(短于 3 秒且没有步骤时不显示)。
* 代理回合有步骤时这一行可以展开成处理过程(默认折叠);历史消息只知道步数,展开时用 load 取。
*/
function WorkLine({ live, stopping, text, startedAt, workedMs, steps, count, load }) {
@@ -183,11 +184,14 @@ function WorkLine({ live, stopping, text, startedAt, workedMs, steps, count, loa
if (!live && !(ms >= 3000) && !steps?.length && !count) return null;
const cur = live && !text ? currentStep(steps) : "";
// 按了停止:代理要重启进程,可能要几秒,先说清楚在停
+ const long = ms >= 3000;
const label = live
? stopping
- ? t("chat.work.stopping", { extra: ms >= 3000 ? t("chat.work.processedFor", { d: fmtDur(ms) }) : "" })
- : `${text ? t("chat.work.replying", { d: fmtDur(ms) }) : ms >= 3000 ? t("chat.work.thinkingFor", { d: fmtDur(ms) }) : t("chat.work.thinking")}${cur ? ` · ${cur}` : ""}`
- : ms >= 3000 ? t("chat.work.done", { d: fmtDur(ms) }) : t("chat.work.process");
+ ? long ? t("chat.work.stoppingAfter", { d: fmtDur(ms) }) : t("chat.work.stopping")
+ : text ? t("chat.work.replying", { d: fmtDur(ms) })
+ : cur ? (long ? t("activity.stepFor", { step: cur, d: fmtDur(ms) }) : cur)
+ : long ? t("chat.work.thinkingFor", { d: fmtDur(ms) }) : t("chat.work.thinking")
+ : long ? t("chat.work.done", { d: fmtDur(ms) }) : t("chat.work.process");
// 换阶段(思考 → 回复 → 用时)时文字淡入:key 变才重播,秒数跳动不重播
const phase = !live ? "done" : stopping ? "stop" : text ? "reply" : "think";
return html`<${ActivityLine} label=${label} phase=${phase} live=${live} steps=${steps} count=${count} load=${load} />`;
diff --git a/ui/screens/info-panel.js b/ui/screens/info-panel.js
index c4ed027..0064ddb 100644
--- a/ui/screens/info-panel.js
+++ b/ui/screens/info-panel.js
@@ -179,7 +179,10 @@ function LiveTurn({ turn, convId }) {
};
const idle = turn.lastProgress ? now - turn.lastProgress : 0;
const cur = currentStep(turn.steps);
- const label = `${t("info.turn.processing", { d: fmtDur(now - turn.since) })}${cur ? ` · ${cur}` : turn.lastProgress ? "" : t("info.turn.waitingAgent")}`;
+ // 一句话:有一步在做时是那一步(「运行 bash,已用 12 秒」),代理进程还没接手时说在等它
+ const d = fmtDur(now - turn.since);
+ const step = cur || (turn.lastProgress ? "" : t("info.turn.waitingAgent"));
+ const label = step ? t("activity.stepFor", { step, d }) : t("info.turn.processing", { d });
return html`<div class="transcript-turn">
<${ActivityLine} label=${label} live steps=${turn.steps} />
<div class="cluster">
diff --git a/ui/screens/needs-you.js b/ui/screens/needs-you.js
index 1ec6d46..05a8c7c 100644
--- a/ui/screens/needs-you.js
+++ b/ui/screens/needs-you.js
@@ -30,8 +30,8 @@ function choices(item) {
}
/**
- * 一件事:标题行(机器人 · 任务 · 状态 · 时间;只有一个机器人时不写机器人名)、第二行(问题 / 命令 / 原因)、行内操作。
- * onAct(action, body) 返回 Promise
+ * 一件事:标题行(一句话和时间:「小蓝的「GPU 价格调研」在等你回答」;只有一个机器人时不写机器人名)、第二行(问题 / 命令 / 原因)、
+ * 行内操作。onAct(action, body) 返回 Promise
*/
export function NeedItem({ item, multiBot, onAct, onOpenChat, onRelogin, onOpenBotSettings }) {
const [busy, setBusy] = useState("");
@@ -61,8 +61,9 @@ export function NeedItem({ item, multiBot, onAct, onOpenChat, onRelogin, onOpenB
const expands = !!item.taskId || !!item.ruleId;
const canOpen = expands || item.channel === "web";
const head = () => (expands ? setOpen((v) => !v) : onOpenChat?.(item.botId));
- const [lead, ...rest] = [multiBot && item.botName, item.subject, item.status].filter(Boolean);
- const headIn = html`<span class="need-who"><b>${lead}</b>${rest.map((x) => ` · ${x}`).join("")}</span>
+ // 几个机器人时前面加上名字;那一句以数字、字母开头时中间空一格(「小蓝的 1 条结果…」)
+ const who = multiBot ? t(/^[0-9A-Za-z]/.test(item.head) ? "needs.headSpaced" : "needs.head", { bot: html`<b>${item.botName}</b>`, what: item.head }) : item.head;
+ const headIn = html`<span class="need-who">${who}</span>
<span class="need-when num">${fmtAgo(item.since)}</span>
${expands && html`<${Icon} name="chevRight" size=${12} class="chev" />`}`;
return html`<div class=${`need${open ? " open" : ""}`}>