diff --git a/FEATURES.md b/FEATURES.md
index 6a923be..feb211d 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -1963,7 +1963,7 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
- 排程或事件自己跑的那幾次照執行紀錄:✓ 完成、✗ 失敗或中斷、■ 停止、圓點執行中。你按的「立即執行」「執行工作流」、請 Bot 跑的、試跑一步都不放(以前一按就出現在日曆上,像是排好的事);它們在執行紀錄裡。還沒到的照排程算出來(跟真的排程同一套算法),暫停的變灰帶 ‖。事件觸發的例行任務只看得到跑過的。週每筆是時間、Bot 的頭像和名稱;月每天最多三筆、多的「還有 N 個」,點那天換成日看法;日照時間一列列。
- 下面「即將執行」:每個例行任務、工作流各一行,寫它下一次什麼時候跑,照時間排、最多六行,帶頭像(以前一個每天跑的就把六行占滿)。
- 點任何一筆打開卡片:哪個 Bot、那次的時間和狀態、怎麼重複、最近一次怎麼樣、要它做什麼;「打開聊天」「立即執行」「暫停/繼續」(工作流:「打開工作流」「立即執行」)。
-- 「+ 新增例行任務」回到 Bot 的聊天,輸入框先放好「每天早上 9 點幫我」,接著用一般的話說要做什麼。手機還沒有日程。
+- 「+ 新增例行任務」回到 Bot 的聊天,輸入框先放好「每天早上 9 點幫我」,接著用一般的話說要做什麼。手機首頁上面一排有「日程」:最上面「即將執行」(每件一行,寫下次的日子和時間),接著三天前到七天後一天一組,每列時間、名字、Bot、怎麼重複,跑過的寫 ✓ 完成/✗ 失敗/停止了,暫停的變淡;打開捲到今天;點例行任務打開它的卡、點工作流打開那個工作流。大腦的路是 `api/act/schedule`(同一份 `schedule::items`/`coming`)。
## 26. Bot 可以直接操作 App 的功能
diff --git a/docs/feature-map/schedule.md b/docs/feature-map/schedule.md
index 15456ba..c691efe 100644
--- a/docs/feature-map/schedule.md
+++ b/docs/feature-map/schedule.md
@@ -10,10 +10,11 @@
- `schedule-card` 點任何一筆打開卡片:哪個 Bot、那一次的時間和狀態、怎麼重複、最近一次怎麼樣、要它做什麼;按鈕「打開聊天」「立即執行」「暫停/繼續」。工作流的是「打開工作流」「立即執行」(在螢幕電腦上按,交給大腦執行)。
- `schedule-new` 「+ 新增例行任務」:回到那個 Bot 的聊天,輸入框先放好「每天早上 9 點幫我」,接著說要做什麼;Bot 用 `create_routine` 設好,日程上就出現。
+- `schedule-phone` 手機的日程:最上面「即將執行」(每件一行:頭像、名字、怎麼重複、下次的日子和時間),接著三天前到七天後一天一組(「今天・11月22日(日)」,沒事的那天只有今天寫「這一天沒有排定的事」),每列時間、名字、Bot、怎麼重複,跑過的右邊 ✓ 完成/✗ 失敗/停止了,暫停的變淡;打開時捲到今天。點例行任務打開它的卡,點工作流打開那個工作流。手按的執行一樣不放。
## 使用者怎麼到
- 側邊欄最左邊那一欄第三個(日曆圖示,滑過寫「日程」),在工作流和任務中間;再按一次、按那一欄的「聊天」、或左上「‹ 聊天」都回到聊天;在側邊欄點別的 Bot 也回到聊天。
-- 手機沒有日程:在聊天裡問 Bot「你有哪些例行任務」,它用 `list_routines` 回答(只有它自己的)。
+- 手機:首頁上面一排的「日程」(`schedule-phone`);或在聊天裡問 Bot「你有哪些例行任務」,它用 `list_routines` 回答(只有它自己的)。
## 怎麼操作(verify-anybot)
@@ -27,6 +28,7 @@
- **從側邊欄打開日程**(covers `schedule-views`、`schedule-entries`、`schedule-coming`):按側邊欄的日曆。指令:要開視窗——`ABV_ALLOW_WINDOW=1 $CTL desktop-shot schedule-open ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_SIZE=1200x820 ANYBOT_SHOT_FRAMES=520 'ANYBOT_SHOT_CLICK=26,152@440'`。看到:「日程」,週看法這一週,今天那格強調色框、裡面沒有剛才立即執行的那次,之後每天 08:30 圓點「競品掃描」;工作日 09:00「晨間簡報」從週一起;右上沒有時區(跟這台一樣);下面「即將執行」競品掃描、晨間簡報各一行,照時間排、有 Bot 的頭像。
- **月和日**(covers `schedule-views`、`schedule-entries`):指令:要開視窗——`ABV_ALLOW_WINDOW=1 $CTL desktop-shot schedule-month ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=schedule ANYBOT_SHOT_TAB=month ANYBOT_SHOT_SIZE=1400x900 ANYBOT_SHOT_FRAMES=520 && ABV_ALLOW_WINDOW=1 $CTL desktop-shot schedule-day ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=schedule ANYBOT_SHOT_TAB=day ANYBOT_SHOT_SIZE=1400x900 ANYBOT_SHOT_FRAMES=520`。看到:月:週一到週日的格子,這個月以外的日期灰字,工作日的格子兩筆(08:30、09:00),今天之前沒跑過的日子是空的;日:今天寫「這一天沒有排定的事。」(立即執行的不放),下面照樣是即將執行。
- **卡片和暫停**(covers `schedule-card`、`schedule-coming`):按即將執行第一筆,再按卡片上的「暫停」。指令:要開視窗——`ABV_ALLOW_WINDOW=1 $CTL desktop-shot schedule-card ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=schedule ANYBOT_SHOT_SIZE=1400x900 ANYBOT_SHOT_FRAMES=560 'ANYBOT_SHOT_CLICK=700,439@530' && ABV_ALLOW_WINDOW=1 $CTL desktop-shot schedule-paused ANYBOT_SHOT_REAL=1 ANYBOT_SHOT_VIEW=schedule ANYBOT_SHOT_SIZE=1400x900 ANYBOT_SHOT_FRAMES=580 'ANYBOT_SHOT_CLICK=700,439@530;705,558@545' && $CTL state '[.bots[0].routines[] | {title, paused}]'`。看到:卡片「競品掃描」:驗證小幫手的頭像和名字、「明天 08:30(啟用中)」「每天 08:30」、最近一次完成、「找三則競品新聞」,按鈕「打開聊天、立即執行、暫停」;暫停後之後的競品掃描變灰帶 ‖,即將執行只剩晨間簡報;state 裡競品掃描 paused 是 true。
+- **手機的日程**(covers `schedule-phone`):先照 [workflow](workflow.md) 建好每天 09:00 的「Threads 早報」並在手機按過一次執行。指令:`$CTL phone click '#quick [data-q="schedule"]' && $CTL phone wait-text '即將執行' --in '#list' && $CTL phone shot schedule-phone && $CTL phone click '[data-sch^="workflow:1"]' && $CTL phone wait '.wf-steps'`。看到:即將執行「Threads 早報・明天 09:00」;今天「這一天沒有排定的事」(手機按的那次不在上面);明天起每天 09:00 一列;點了打開那個工作流。
- 自動測試:`cargo test schedule`、`cargo test layout_audit::`(「日程」週、月、日三景)。
## 陷阱
diff --git a/mobile/index.html b/mobile/index.html
index 681d3ba..d8d448a 100644
--- a/mobile/index.html
+++ b/mobile/index.html
@@ -580,6 +580,12 @@ textarea.field{min-height:96px;line-height:1.5}
.tools .btn.once{background:color-mix(in srgb,var(--accent) 18%,transparent);color:var(--accent-ink)}
.tools .btn.lock{background:var(--accent);color:var(--on-color)}
.tools .btn.on{background:var(--primary);color:var(--on-primary)}
+/* 日程: 即將執行, then a group a day — a row a time: when, what, how it went. */
+.item.sch .sch-t{width:44px;flex:none;font-size:var(--fs-small);color:var(--text2);font-variant-numeric:tabular-nums;display:flex;align-items:center}
+.item.sch .av.sm{width:26px;height:26px}.item.sch .av.sm svg{width:26px;height:26px}
+.item.sch .r{display:flex;align-items:center;gap:4px;font-size:var(--fs-caption);white-space:nowrap}
+.item.sch .r.good{color:var(--ok)}.item.sch .r.bad{color:var(--danger)}.item.sch .r.go{color:var(--accent-ink)}
+.item.sch.todo{opacity:.55}
/* 工作流: a card each (run / stop at the right, the 等你確認 under it); one opened: its steps as a
line from top to bottom, each with how this run (or the last) went there. */
.wf-card{padding:12px 16px;border-bottom:1px solid var(--line2);cursor:pointer}
@@ -877,6 +883,7 @@ const LUCIDE = {
"target": '',
"alarm-clock": '',
"sparkles": '',
+ "calendar": '',
"list-checks": '',
"camera": '',
"paperclip": '',
@@ -1581,6 +1588,7 @@ function renderHome() {
const tn = taskAttention();
$("quick").innerHTML = owner() ? [
``,
+ ``,
``,
``,
``,
@@ -3299,7 +3307,7 @@ async function settingsChanged() {
}
let listTimer = null;
function stopListTimer() { clearInterval(listTimer); listTimer = null; }
-const TITLES = {tasks: "任務", workflows: "工作流", routines: "例行任務", pages: "頁面", computers: "電腦", settings: "設定", general: "一般", me: "個人資料與用量", models: "模型", perms: "權限", integrations: "整合", vault: "保險庫", account: "手機與帳號", updates: "更新"};
+const TITLES = {tasks: "任務", schedule: "日程", workflows: "工作流", routines: "例行任務", pages: "頁面", computers: "電腦", settings: "設定", general: "一般", me: "個人資料與用量", models: "模型", perms: "權限", integrations: "整合", vault: "保險庫", account: "手機與帳號", updates: "更新"};
async function renderList(arg) {
const kind = arg.kind;
$("list-title").textContent = TITLES[kind] || "";
@@ -3311,6 +3319,7 @@ async function renderList(arg) {
if (kind === "pages") return listPages(el);
if (kind === "me") return listMe(el);
if (kind === "workflows") return listWorkflows(el, arg.wf);
+ if (kind === "schedule") return listSchedule(el);
if (SETTINGS_PAGES.includes(kind)) {
// (Drawn from what this phone has at once; read again behind it when it may be old.)
if (!S.settings) { el.innerHTML = `
載入中…
`; await loadSettings(); }
@@ -3321,6 +3330,56 @@ async function renderList(arg) {
if (["computers", "integrations"].includes(kind)) listTimer = setInterval(async () => { await loadSettings(); if (cur().v === "list" && cur().arg.kind === kind) drawSettings(kind, true); }, 4000);
}
}
+// ---------- 日程 ----------
+// What the bots are set to do, as on the computer's 日程: 即將執行 (each routine or workflow once,
+// at its next time), then day by day from three days back to a week ahead — what ran on its own
+// and how it went (✓ ✗ ■), what is coming, what is paused. (What you ran by hand is in each
+// one's own runs, not here.)
+const SCH_MARK = {done: ["good", "circle-check", "完成"], failed: ["bad", "circle-x", "失敗"], stopped: ["", "minus", "停止了"], running: ["go", "loader", "執行中"], coming: ["", "clock", ""], paused: ["todo", "pause", "暫停中"]};
+async function listSchedule(el) {
+ const here = () => cur().v === "list" && cur().arg.kind === "schedule";
+ if (S.sched) drawSchedule(el); else el.innerHTML = `