Skip to content

armgit / andee

Public Imported from GitHub
0

Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。

feat(mac): the main page is 动态 — what it did, not only what was said

booboosuiad31a79265f0
diff --git a/CLAUDE.md b/CLAUDE.md
index 273627d..8703ff6 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -679,6 +679,7 @@ meetings, gear, friends) and lists exactly the tools some provider handles. What
- **Notifications come from `usernoted`'s SQLite store, and where it is depends on the macOS version** (`notifCandidates` in `AndeeMac.swift`): macOS 15 keeps it in `~/Library/Group Containers/group.com.apple.usernoted/db2`, earlier systems under `confstr(_CS_DARWIN_USER_DIR)` + `com.apple.notificationcenter/db2` (never derive that from `$TMPDIR` — the JVM replaces it). Only the first was tried, and a store that was not there was reported as missing Full Disk Access, so the user granted it and was told the same thing forever. `andee_notif_latest_id` now answers -2 for "no store anywhere" (`State.NOT_FOUND`, no permission button) and -1 for "exists but refuses us" (`NO_ACCESS`), and reads in process through `libsqlite3` (read-only, busy timeout, since `usernoted` is writing the WAL) instead of forking `/usr/bin/sqlite3`, which swallowed the reason.
- **`type_text` pastes even when the front app reports no focused element** (`MacScreen.typeBlind`). Mac WeChat answers `focused: false` to accessibility, and refusing there sent the model to the shell (`osascript` + ⌘V), which a notification's turn may not use — so a message Andee could read, it could not answer. The blind path sends ⌘V only (no ⌘A: with focus unknown, select-all may take the chat history), refuses when Andee's own window is active, and returns `unverified` with a note to check the screenshot and not to reach for the shell. Verified in WeChat's 文件传输助手 by reading the box back with ⌘A ⌘C. The pasteboard is still not restored afterwards — that was a deliberate choice (see `andee_set_pasteboard`).
- **A click on an inactive app only activates it, so every click brings its app forward first** (`MacScreen.click` → `andee_activate_at`; keystrokes → `andee_activate_target`). Measured 2026-10-28 in Chrome with Finder in front: one click left focus on the page (`AXWebArea`), the second focused the text box. In the trace that turned into a sidebar click that "did nothing" and a `type_text` that pasted into the page and reported success — the task stalled on a box the model concluded it "cannot type into". Not verified end-to-end after the fix (the test window was the user's live Chrome).
+- **The main page is 动态 (Timeline), not a chat.** Besides what was said, it shows what happened as one quiet line each: a todo waking it, the review, topics folded, its writes to its own record (diary, self, wiki, a person, a care, a memory, a todo, the plan), a heartbeat's thought and its work turns, bubbles, notifications it let pass and why, meetings, the camera, a vault fill, shell commands. Two sources end in one place: the brain emits `BrainEvent` through `BrainHost.event` (core, so the phone can follow), and the body adds its own (`TimelineEvents`); both write `Scrollback.Role.EVENT` rows. **Those rows are never given back to the brain** (`DesktopBrainHost.scrollback` filters them) — a review summary must not return as something said — and they fold with the topic they sit inside. A heartbeat that decided to sleep writes nothing. 全部 / 只看对话 in the header hides them (`timeline_events`).
- **A prompt card appears beside the ball** (`PromptWindow`), which may be on a screen the user is not looking
at. A friend's request therefore plays a sound and waves the ball first — the first one timed out unseen.
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/BrainEvent.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/BrainEvent.kt
new file mode 100644
index 0000000..ead07d8
--- /dev/null
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/BrainEvent.kt
@@ -0,0 +1,64 @@
+package net.kuafuai.andee.brain
+
+import org.json.JSONObject
+
+/**
+ * Something that happened that is not a line of conversation: a todo woke it, the nightly review ran, it wrote
+ * its diary, it folded a topic, it got up by itself. Each body shows these in its timeline so that nothing it
+ * does is invisible — the design's "its continuity must be true" applies to the user's view of it too.
+ *
+ * Structured, not a sentence: [kind] says what, [subject] names the thing (a title, a name, a count), and the
+ * body words it in the interface language. Events are **never** read back into the model's context — they
+ * are the device's record of what the brain did, not something anyone said.
+ */
+data class BrainEvent(
+ val kind: Kind,
+ /** What it is about: a title, a name, the reminder's text. May be empty. */
+ val subject: String = "",
+ /** A longer line shown when the row is opened. May be empty. */
+ val detail: String = "",
+) {
+ enum class Kind {
+ /** A todo came due and woke it. */
+ WOKE,
+ /** A notification was judged worth acting on, and a turn started. */
+ NOTIFIED,
+ /** Another of the user's devices handed it a task. */
+ FRIEND_TASK,
+ /** The quiet-hour review (or the pre-trim one) finished; [subject] is how many records it touched. */
+ REVIEWED,
+ /** A finished stretch of conversation was put away as a topic. */
+ FOLDED,
+ DIARY, SELF, WIKI, PERSON, CARE, MEMORY, TODO, PLAN,
+ }
+
+ companion object {
+ /**
+ * The event for a tool call that landed, or null. Only writes to its own record count; reads are not
+ * events. [result] decides whether the write happened (a refused write is not an event).
+ */
+ fun fromTool(method: String, args: JSONObject, result: Any?): BrainEvent? {
+ val r = result as? JSONObject
+ fun ok(key: String) = r == null || !r.has(key) || r.optBoolean(key)
+ val action = args.optString("action")
+ return when (method) {
+ "note.diary" -> if (action == "write" && ok("written")) BrainEvent(Kind.DIARY, detail = args.optString("text").take(400)) else null
+ "note.self" -> if (action == "write" && ok("written")) BrainEvent(Kind.SELF, detail = args.optString("text").take(400)) else null
+ "note.wiki_write" -> if (ok("written")) BrainEvent(Kind.WIKI, args.optString("title"), args.optString("change_note")) else null
+ "note.person" -> when (action) {
+ "upsert" -> if (ok("saved")) BrainEvent(Kind.PERSON, args.optString("name"), args.optString("impression")) else null
+ else -> null
+ }
+ "note.cares" -> when (action) {
+ "add" -> if (ok("added")) BrainEvent(Kind.CARE, args.optString("what"), "+") else null
+ "done", "drop" -> if (ok("changed")) BrainEvent(Kind.CARE, args.optString("id"), action) else null
+ else -> null
+ }
+ "note.remember" -> BrainEvent(Kind.MEMORY, args.optString("name"), args.optString("description"))
+ "note.todo" -> if (r?.has("error") == true) null else BrainEvent(Kind.TODO, args.optString("what").take(120), args.optString("at"))
+ "note.day_plan" -> if (action == "write") BrainEvent(Kind.PLAN, args.optString("date", "today"), args.optString("intent")) else null
+ else -> null
+ }
+ }
+ }
+}
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/BrainHost.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/BrainHost.kt
index 47db74c..736f336 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/BrainHost.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/BrainHost.kt
@@ -143,6 +143,9 @@ interface BrainHost {
*/
fun turnStarted(kind: String) {}
+ /** Something happened that is not conversation — see [BrainEvent]. Any thread. Default: nowhere to show it. */
+ fun event(e: BrainEvent) {}
+
/** Where the trace file lives. */
fun traceDir(): File
}
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/GuestHost.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/GuestHost.kt
index a2065cd..905c303 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/GuestHost.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/GuestHost.kt
@@ -36,6 +36,9 @@ class GuestHost(private val inner: BrainHost) : BrainHost by inner {
/** Not forwarded: the owner's own turn state (the Mac's command policy) must not be moved by a guest. */
override fun turnStarted(kind: String) {}
+ /** A friend's task leaves no trace in the owner's timeline beyond the report itself. */
+ override fun event(e: BrainEvent) {}
+
override fun toolLists(): List<JSONArray> = inner.toolLists().map { list ->
JSONArray().also { out -> for (i in 0 until list.length()) list.optJSONObject(i)?.takeIf { allowed(it.optString("method")) }?.let(out::put) }
}
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
index bb07ce7..96a6c51 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
@@ -508,6 +508,13 @@ class LocalBrain(
busy.set(true)
currentKind = kind
aimMisses = 0
+ turnRecords = 0
+ when (kind) {
+ TurnKind.WAKE -> emit(BrainEvent(BrainEvent.Kind.WOKE, WakeText.what(text)))
+ TurnKind.NOTIFY -> emit(BrainEvent(BrainEvent.Kind.NOTIFIED, detail = text.take(400)))
+ TurnKind.PEER -> emit(BrainEvent(BrainEvent.Kind.FRIEND_TASK, detail = text.take(400)))
+ else -> {}
+ }
if (kind == TurnKind.WORK) {
// Per turn, here, so a queued work turn cannot inherit the one before it.
workTerritory = territory
@@ -560,6 +567,7 @@ class LocalBrain(
// is no longer the current one.
if (gen == generation.get()) applyPendingFolds() else pendingFolds.clear()
if (kind == TurnKind.SWEEP) onSweepSpent(turnTokens)
+ if (kind.silent && gen == generation.get()) emit(BrainEvent(BrainEvent.Kind.REVIEWED, turnRecords.toString()))
if (gen == generation.get()) {
drainWakes()
maybeHarvest()
@@ -626,6 +634,9 @@ class LocalBrain(
/** Loop thread only. The closing words of a [TurnKind.WORK] turn; read by [work]'s callback. Never spoken. */
private var workSummary: String? = null
+ /** Loop thread only. Writes to its own record this turn, for the review's summary event. Reset per turn. */
+ private var turnRecords = 0
+
/** Loop thread only. Coordinate taps in a row whose screen did not change; see [AimHints]. Reset per turn. */
private var aimMisses = 0
@@ -1185,6 +1196,7 @@ class LocalBrain(
val result = dispatchWithTimeout(method, args, tc.id, silent, untrusted)
if (currentKind == TurnKind.WORK) workCalls += WorkCall(method, args.optString("action"), tc.id, landed(result))
+ BrainEvent.fromTool(method, args, result)?.let { turnRecords++; emit(it) }
if (AimHints.isTap(method) && result is JSONObject) {
val missed = result.has("screen_changed") && !result.optBoolean("screen_changed", true)
aimMisses = if (method == "screen.tap" || method == "screen.long_press") { if (missed) aimMisses + 1 else 0 } else if (missed) aimMisses else 0
@@ -1217,6 +1229,8 @@ class LocalBrain(
return NOT_DONE_KEYS.none { o.has(it) && o.opt(it) == false }
}
+ private fun emit(e: BrainEvent) = runCatching { host.event(e) }.onFailure { host.logWarn(TAG, "event ${e.kind} not shown", it) }
+
private fun dispatchWithTimeout(method: String, params: JSONObject, callId: String, silent: Boolean, untrusted: Boolean): Any? {
val declared = params.optLong("timeout_ms", 0L)
val budget = if (declared > 0) declared + TIMEOUT_SLACK_MS else DEFAULT_TOOL_TIMEOUT_MS
@@ -1448,6 +1462,7 @@ class LocalBrain(
text = fold.text,
)
}.getOrNull()
+ if (topic != null) emit(BrainEvent(BrainEvent.Kind.FOLDED, topic.title, topic.summary.lineSequence().firstOrNull().orEmpty()))
if (topic == null) {
host.logWarn(TAG, "fold produced no topic; the conversation is kept as it was")
return
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/WakeText.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/WakeText.kt
index f6834fe..df3ccd7 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/WakeText.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/WakeText.kt
@@ -22,4 +22,10 @@ object WakeText {
"not yet → set the next todo further out and end the turn; needs the user → say so; past its " +
"give-up time → say what you saw. Do not wait on the screen for it."
}
+
+ /** The todo's own words back out of a [due] line, for the timeline; the line itself when it is not one. */
+ fun what(line: String): String {
+ val first = line.lineSequence().firstOrNull().orEmpty()
+ return if (first.startsWith("(time's up")) first.substringAfter(") ", first).trim() else first.trim().take(200)
+ }
}
diff --git a/core/src/test/kotlin/net/kuafuai/andee/brain/BrainEventTest.kt b/core/src/test/kotlin/net/kuafuai/andee/brain/BrainEventTest.kt
new file mode 100644
index 0000000..781779b
--- /dev/null
+++ b/core/src/test/kotlin/net/kuafuai/andee/brain/BrainEventTest.kt
@@ -0,0 +1,21 @@
+package net.kuafuai.andee.brain
+
+import org.json.JSONObject
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNull
+import org.junit.Test
+
+class BrainEventTest {
+ @Test fun onlyWritesThatLandedAreEvents() {
+ assertEquals(BrainEvent.Kind.DIARY, BrainEvent.fromTool("note.diary", JSONObject().put("action", "write").put("text", "x"), JSONObject().put("written", true))?.kind)
+ assertNull(BrainEvent.fromTool("note.diary", JSONObject().put("action", "write"), JSONObject().put("written", false)))
+ assertNull(BrainEvent.fromTool("note.diary", JSONObject().put("action", "read"), JSONObject()))
+ assertNull(BrainEvent.fromTool("note.wiki_search", JSONObject(), JSONObject()))
+ assertEquals("老王", BrainEvent.fromTool("note.person", JSONObject().put("action", "upsert").put("name", "老王"), JSONObject().put("saved", true))?.subject)
+ assertNull(BrainEvent.fromTool("screen.tap", JSONObject(), JSONObject()))
+ }
+
+ @Test fun aWakeLineGivesBackTheTodo() {
+ assertEquals("开周会", WakeText.what(WakeText.due("t1", "开周会", false)))
+ }
+}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Assistant.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Assistant.kt
index 6623a9f..7a6f598 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Assistant.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Assistant.kt
@@ -50,7 +50,7 @@ object Assistant {
net.kuafuai.andee.desktop.shell.ShellTools(
ask = { askApproval(it) },
secrets = { secrets() },
- record = { line -> Scrollback.add(Scrollback.Role.ASSISTANT, line) },
+ record = { line -> TimelineEvents.body(TimelineEvents.Body.SHELL, line) },
)
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Cards.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Cards.kt
index 53ffd49..71a783e 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Cards.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Cards.kt
@@ -191,7 +191,7 @@ fun ArtifactsCard(onDone: () -> Unit, onContinue: () -> Unit) {
Text(if (zh) "回退到这版" else "Roll back", color = Palette.accent, fontSize = 12.sp,
modifier = Modifier.clickable {
Pages.restoreVersion(v.id)
- Scrollback.add(Scrollback.Role.ASSISTANT, "已把「${v.title}」回退到 v${v.version}")
+ TimelineEvents.body(TimelineEvents.Body.PAGE, if (zh) "把「${v.title}」回退到 v${v.version}" else "Rolled \"${v.title}\" back to v${v.version}")
refresh++
}.padding(vertical = 3.dp))
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
index 7ff579f..c44142b 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
@@ -135,7 +135,9 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
var recording by remember { mutableStateOf(Meeting.isActive()) }
// A folded stretch is one card standing where its messages stood — the phone's rule, so the
// conversation still reads top to bottom. The sidebar's topic list is only another way in.
- val items = remember(rows) { chatItems(rows) }
+ // 全部 shows what happened as well as what was said; 只看对话 hides the event rows. Remembered across launches.
+ var showEvents by remember { mutableStateOf(Settings.get("timeline_events") != "off") }
+ val items = remember(rows, showEvents) { chatItems(if (showEvents) rows else rows.filter { it.role != Scrollback.Role.EVENT }) }
// The list is created already standing on the newest message. Opening the page used to start at the top
// and then animate down through the whole conversation, which read as the chat scrolling itself on every
// visit. (An item that is taller than the viewport is shown from its start, so a long last reply is read
@@ -241,6 +243,8 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
Column(Modifier.fillMaxSize()) {
Header(
muted = muted, onToggleMute = { Assistant.setMuted(!muted) },
+ showEvents = showEvents,
+ onToggleEvents = { showEvents = !showEvents; Settings.save(mapOf("timeline_events" to if (showEvents) "on" else "off")) },
live = recording || voice == net.kuafuai.andee.desktop.voice.MacVoice.State.LISTENING,
status = when {
recording -> if (Strings.lang() == "zh") "正在录音" else "Recording"
@@ -269,7 +273,7 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
}
items(items, key = { it.key }) { it ->
when (it) {
- is ChatItem.Message -> Bubble(it.row)
+ is ChatItem.Message -> if (it.row.role == Scrollback.Role.EVENT) EventRow(it.row) else Bubble(it.row)
is ChatItem.Folded -> TopicCard(it.topic, it.count, onOpen = { onOpenTopic(it.topic.id) }, onContinue = { onContinueTopic(it.topic) })
}
}
@@ -351,7 +355,7 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
/** Title, or a one-line status when something is live. Stop is with the input box, where the hand already is. */
@Composable
-private fun Header(status: String?, live: Boolean, muted: Boolean, onToggleMute: () -> Unit) {
+private fun Header(status: String?, live: Boolean, muted: Boolean, onToggleMute: () -> Unit, showEvents: Boolean = true, onToggleEvents: () -> Unit = {}) {
Row(
Modifier.fillMaxWidth().padding(start = 16.dp, end = 16.dp, top = 14.dp, bottom = 10.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -361,12 +365,17 @@ private fun Header(status: String?, live: Boolean, muted: Boolean, onToggleMute:
Spacer(Modifier.width(8.dp))
}
Text(
- status ?: (if (Strings.lang() == "zh") "对话" else "Chat"),
+ status ?: (if (Strings.lang() == "zh") "动态" else "Timeline"),
color = if (live) Palette.accent else Palette.title,
fontSize = 18.sp, fontWeight = FontWeight.SemiBold,
)
Spacer(Modifier.weight(1f))
val zh = Strings.lang() == "zh"
+ Text(
+ if (showEvents) (if (zh) "全部" else "Everything") else (if (zh) "只看对话" else "Talk only"),
+ color = Palette.label, fontSize = 12.sp,
+ modifier = Modifier.clip(RoundedCornerShape(16.dp)).clickable { onToggleEvents() }.padding(horizontal = 10.dp, vertical = 6.dp),
+ )
Row(
Modifier.clip(RoundedCornerShape(16.dp)).clickable { onToggleMute() }.padding(horizontal = 10.dp, vertical = 6.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -565,6 +574,40 @@ fun noVoiceKey() = when {
else -> "No voice key yet: add it under Voice in Settings."
}
+/**
+ * Something that happened, not something said: one quiet line with the time, a mark and the words. A row with a
+ * detail opens on click. Centered and small, so a day of events does not drown the conversation between them.
+ */
+@Composable
+private fun EventRow(r: Scrollback.Row) {
+ var open by remember(r.id) { mutableStateOf(false) }
+ val time = remember(r.ts) { java.text.SimpleDateFormat("HH:mm", java.util.Locale.US).format(java.util.Date(r.ts)) }
+ Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
+ Row(
+ Modifier.clip(RoundedCornerShape(12.dp))
+ .then(if (r.detail.isNotBlank()) Modifier.clickable { open = !open } else Modifier)
+ .padding(horizontal = 10.dp, vertical = 3.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Text(time, color = Palette.secondary, fontSize = 11.sp)
+ Spacer(Modifier.width(8.dp))
+ Icon(TimelineEvents.mark(r.kind), Palette.secondary, 12.dp)
+ Spacer(Modifier.width(6.dp))
+ Text(r.text, color = Palette.photoInk, fontSize = 12.sp, maxLines = if (open) 4 else 1,
+ overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 520.dp))
+ if (r.detail.isNotBlank()) {
+ Spacer(Modifier.width(4.dp))
+ Text(if (open) "▴" else "▾", color = Palette.secondary, fontSize = 10.sp)
+ }
+ }
+ if (open && r.detail.isNotBlank()) {
+ Markdown(r.detail, color = Palette.photoInk, size = 12.sp,
+ modifier = Modifier.widthIn(max = 560.dp).padding(top = 2.dp, bottom = 4.dp)
+ .background(Palette.glass, RoundedCornerShape(12.dp)).padding(horizontal = 12.dp, vertical = 8.dp))
+ }
+ }
+}
+
@Composable
private fun Bubble(r: Scrollback.Row) {
val mine = r.role == Scrollback.Role.USER
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
index e37099c..efff413 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
@@ -64,7 +64,8 @@ class DesktopBrainHost(
override fun scenesIndex(): String = DesktopNotebook.book.scenesForPrompt()
override fun scene(name: String): Scene? = DesktopNotebook.book.scene(name)
- override fun scrollback(): List<ScrollRow> = Scrollback.snapshot().map {
+ // Event rows are the device's record of what the brain did, not conversation: never handed back to it.
+ override fun scrollback(): List<ScrollRow> = Scrollback.snapshot().filter { it.role != Scrollback.Role.EVENT }.map {
ScrollRow(
isUser = it.role == Scrollback.Role.USER,
isAssistant = it.role == Scrollback.Role.ASSISTANT,
@@ -89,7 +90,8 @@ class DesktopBrainHost(
override fun friendsIndex(): String = Peers.tasks.indexForPrompt()
override fun foldTopic(title: String, summary: String, rows: List<ScrollRow>, text: String): FoldedTopic? {
- val t = Scrollback.fold(title, summary, rows.mapNotNull { it.handle as? Long }, text) ?: return null
+ val ids = rows.mapNotNull { it.handle as? Long }
+ val t = Scrollback.fold(title, summary, ids + Scrollback.eventsWithin(ids), text) ?: return null
return FoldedTopic(t.id, t.title, t.summary)
}
@@ -116,6 +118,8 @@ class DesktopBrainHost(
override fun turnStarted(kind: String) = providers.forEach { it.turnStarted(kind) }
+ override fun event(e: net.kuafuai.andee.brain.BrainEvent) = TimelineEvents.brain(e)
+
override fun traceDir(): File = AppDirs.root
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Main.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Main.kt
index c4d1124..d18f016 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Main.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Main.kt
@@ -113,7 +113,7 @@ fun main() {
Menu("Andee") {
Item(if (Strings.lang() == "zh") "新对话" else "New chat", onClick = { Assistant.newConversation(); chat = true; nav.go("chat") },
shortcut = androidx.compose.ui.input.key.KeyShortcut(androidx.compose.ui.input.key.Key.N, meta = true))
- Item(if (Strings.lang() == "zh") "显示对话" else "Show chat", onClick = { chat = true; nav.go("chat") })
+ Item(if (Strings.lang() == "zh") "显示动态" else "Show timeline", onClick = { chat = true; nav.go("chat") })
Item(if (Strings.lang() == "zh") "设置" else "Settings", onClick = { chat = true; nav.go("settings") },
shortcut = androidx.compose.ui.input.key.KeyShortcut(androidx.compose.ui.input.key.Key.Comma, meta = true))
Item(if (Strings.lang() == "zh") "退出 Andee" else "Quit Andee", onClick = ::exitApplication,
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Meeting.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Meeting.kt
index a318a55..370c007 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Meeting.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Meeting.kt
@@ -83,7 +83,7 @@ object Meeting {
recording.set(true)
exec.execute { micLoop() }
onRecordingChanged(true)
- Scrollback.add(Scrollback.Role.ASSISTANT, (if (Strings.lang() == "zh") "开始录音了。" else "Recording started."))
+ TimelineEvents.body(TimelineEvents.Body.MEETING, if (Strings.lang() == "zh") "开始录音:$title" else "Recording started: $title")
Log.i(TAG, "meeting started: $title")
return JSONObject().put("recording", true).put("title", title).put("started_at", startedAt)
}
@@ -122,7 +122,7 @@ object Meeting {
active = null
if (seg != null) retire(seg)
onRecordingChanged(false)
- Scrollback.add(Scrollback.Role.ASSISTANT, (if (Strings.lang() == "zh") "录音结束了。" else "Recording ended."))
+ TimelineEvents.body(TimelineEvents.Body.MEETING, if (Strings.lang() == "zh") "录音结束" else "Recording ended")
return result(stoppedBy)
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/NudgeBubble.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/NudgeBubble.kt
index b77577a..f7f51ad 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/NudgeBubble.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/NudgeBubble.kt
@@ -151,7 +151,7 @@ object Nudges {
private fun record(slot: Slot) {
if (slot.recorded) return
slot.recorded = true
- Scrollback.add(Scrollback.Role.ASSISTANT, slot.n.text)
+ TimelineEvents.bubble(slot.n.text)
}
// ---- what the user did (called from the UI thread) -----------------------
@@ -211,7 +211,7 @@ object Nudges {
private fun mute(n: Nudge) {
Settings.save(mapOf("nudge_muted" to (muted() + n.kind).joinToString(",")))
// A setting changed by a gesture with no confirmation; the user is owed the news and the way back.
- Scrollback.add(Scrollback.Role.ASSISTANT, String.format(Strings.locale(), Strings.get("s_nudge_muted_row"), n.text))
+ TimelineEvents.body(TimelineEvents.Body.BUBBLE_MUTED, String.format(Strings.locale(), Strings.get("s_nudge_muted_row"), n.text))
}
/** Seconds since the last keyboard or mouse input, from the HID system; null when it cannot be read. */
@@ -244,7 +244,10 @@ object PlanTicks {
val plans = DesktopNotebook.plans
val mind = net.kuafuai.andee.brain.PlanMind(cfg, plans) { warn, msg -> if (warn) Log.w("Plan", msg) else Log.i("Plan", msg) }
val level = Nudges.level()
- if (mind.morning(Strings.lang(), level.perDay)) DesktopScheduler.syncPlan()
+ if (mind.morning(Strings.lang(), level.perDay)) {
+ DesktopScheduler.syncPlan()
+ TimelineEvents.morning(plans.day(plans.today())?.intent.orEmpty())
+ }
val free = !Assistant.working() && !Meeting.isActive() && AskGate.current == null && ApprovalGate.current == null
if (free && level != NudgeBook.Level.OFF) {
mind.muse(Strings.lang())?.let { id -> plans.bubbleForItem(id, Nudges.book, level, Nudges.muted())?.let(Nudges::post) }
@@ -263,14 +266,14 @@ object PlanTicks {
val drive = DesktopNotebook.drive
val log: (Boolean, String) -> Unit = { warn, msg -> if (warn) Log.w("Drive", msg) else Log.i("Drive", msg) }
val v = net.kuafuai.andee.brain.Heartbeat(cfg, self, drive, { DesktopNotebook.plans.indexForPrompt() }, log).beat(Strings.lang())
+ if (v is net.kuafuai.andee.brain.Heartbeat.Verdict.Note) TimelineEvents.thought(v.text)
if (v !is net.kuafuai.andee.brain.Heartbeat.Verdict.Work) return
log(false, "work on ${v.care.id} (${v.care.what}): ${v.why}")
+ TimelineEvents.workStarted(v.care.what, v.why)
net.kuafuai.andee.brain.SelfWork.start(brain, self, drive, v.care, v.ratio, v.why) { effect, summary ->
log(false, "work on ${v.care.id} booked as $effect")
- if (effect != net.kuafuai.andee.config.Selfhood.Effect.NOTHING && summary != null) {
- val text = net.kuafuai.andee.text.stripMarkdown(net.kuafuai.andee.brain.SpeechMood.parse(summary).text)
- Scrollback.add(Scrollback.Role.ASSISTANT, String.format(Strings.locale(), Strings.get("s_drive_row"), v.care.what, text.take(160)))
- }
+ val text = summary?.let { net.kuafuai.andee.brain.SpeechMood.parse(it).text.trim() }
+ TimelineEvents.workDone(v.care.what, effect.name, text)
}
}
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Scrollback.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Scrollback.kt
index 8432e36..0c15d2b 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Scrollback.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Scrollback.kt
@@ -24,9 +24,18 @@ object Scrollback {
private const val MAX_TOPICS = 60
private const val MAX_TEXT = 4000
- enum class Role { USER, ASSISTANT, ERROR }
-
- data class Row(val id: Long, val ts: Long, val role: Role, val text: String, val topicId: Long? = null)
+ /**
+ * [EVENT] is something that happened that is not conversation — a todo woke it, the review ran, it wrote its
+ * diary, it got up by itself ([TimelineEvents]). Shown in the timeline, **never** given to the brain:
+ * [DesktopBrainHost.scrollback] leaves these rows out, so a review summary cannot come back as something said.
+ */
+ enum class Role { USER, ASSISTANT, ERROR, EVENT }
+
+ /** [kind] and [detail] are set on [Role.EVENT] rows only: what kind of event, and the line shown when opened. */
+ data class Row(
+ val id: Long, val ts: Long, val role: Role, val text: String, val topicId: Long? = null,
+ val kind: String = "", val detail: String = "",
+ )
data class Topic(val id: Long, val title: String, val summary: String, val startedAt: Long, val endedAt: Long)
@@ -59,6 +68,24 @@ object Scrollback {
saveAndNotify()
}
+ /** An event row (see [Role.EVENT]). */
+ fun event(kind: String, text: String, detail: String = "") {
+ val t = text.trim()
+ if (t.isEmpty()) return
+ synchronized(lock) {
+ rows += Row(nextId++, System.currentTimeMillis(), Role.EVENT, t.take(MAX_TEXT), kind = kind, detail = detail.trim().take(MAX_TEXT))
+ while (rows.size > MAX_ROWS) rows.removeAt(0)
+ }
+ saveAndNotify()
+ }
+
+ /** Event rows standing between the first and last of [members] (by id): they go into the same topic. */
+ fun eventsWithin(members: List<Long>): List<Long> = synchronized(lock) {
+ if (members.isEmpty()) return emptyList()
+ val lo = members.min(); val hi = members.max()
+ rows.filter { it.role == Role.EVENT && it.topicId == null && it.id in lo..hi }.map { it.id }
+ }
+
fun topicsIndex(max: Int = 5): String = synchronized(lock) {
val fmt = SimpleDateFormat("MM-dd HH:mm", Locale.US)
topics.sortedByDescending { it.endedAt }.take(max).joinToString("\n") { t ->
@@ -112,7 +139,8 @@ object Scrollback {
val arr = JSONArray()
for (r in rows) arr.put(
JSONObject().put("id", r.id).put("ts", r.ts).put("role", r.role.name).put("text", r.text)
- .apply { r.topicId?.let { put("topic", it) } },
+ .apply { r.topicId?.let { put("topic", it) } }
+ .apply { if (r.kind.isNotEmpty()) put("kind", r.kind); if (r.detail.isNotEmpty()) put("detail", r.detail) },
)
val tarr = JSONArray()
for (t in topics) tarr.put(
@@ -143,6 +171,8 @@ object Scrollback {
role = runCatching { Role.valueOf(r.getString("role")) }.getOrDefault(Role.ASSISTANT),
text = r.getString("text"),
topicId = if (r.has("topic")) r.getLong("topic") else null,
+ kind = r.optString("kind"),
+ detail = r.optString("detail"),
)
}
val tarr = o.optJSONArray("topics") ?: JSONArray()
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Settings.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Settings.kt
index ef7128a..b284a95 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Settings.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Settings.kt
@@ -37,7 +37,7 @@ object Settings {
"shell_mode", "shell_workdirs", "shell_critical_confirm", "mute",
"google_api_key", "google_project", "google_location", "google_asr_model", "google_tts_model", "google_base_url",
"google_language", "tts_sample_rate", "grounding", "show_hub", "hub_url", "device_name", "theme", "peers",
- "nudge", "nudge_muted", "locator_model", "drive",
+ "nudge", "nudge_muted", "locator_model", "drive", "timeline_events",
)
/**
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Sidebar.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Sidebar.kt
index ce7d0c6..8ca4517 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Sidebar.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Sidebar.kt
@@ -73,7 +73,7 @@ fun Sidebar(nav: Nav, width: androidx.compose.ui.unit.Dp = 228.dp) {
}
Spacer(Modifier.height(12.dp))
- NavItem(AndeeIcon.CHAT, t("对话", "Chat"), here == "chat") { nav.go("chat") }
+ NavItem(AndeeIcon.CHAT, t("动态", "Timeline"), here == "chat") { nav.go("chat") }
NavItem(AndeeIcon.DOCUMENT, t("产物", "Artifacts") + if (artifactCount > 0) " $artifactCount" else "", here == "artifacts") { nav.go("artifacts") }
// The same doors, in the same order, as the phone's top bar: 产物 · 小本本 · 情景 · 朋友 · 自检 · 设置.
// 形象与表情, 装备 and 保险箱 are opened from 设置 on both, so neither body has a door the other lacks.
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/TimelineEvents.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/TimelineEvents.kt
new file mode 100644
index 0000000..6a56807
--- /dev/null
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/TimelineEvents.kt
@@ -0,0 +1,89 @@
+package net.kuafuai.andee.desktop
+
+import net.kuafuai.andee.brain.BrainEvent
+
+/**
+ * Everything that happens that is not conversation, as one line each in the timeline (动态): what woke it, what
+ * it wrote down, what it did on its own, what it let pass. The design's rule is that its continuity has to be
+ * true; this is the half of that the user can see — nothing it does by itself is invisible.
+ *
+ * Two sources: the brain ([brain], from [BrainEvent]) and the body ([body], for what only the Mac knows — a
+ * heartbeat's thought, a bubble, a notification it let pass, a meeting). Both end in [Scrollback.event], which
+ * the brain never reads back.
+ *
+ * Kept quiet on purpose: a heartbeat that decided to sleep, the usual answer, writes nothing.
+ */
+object TimelineEvents {
+
+ /** Body-side event kinds, alongside [BrainEvent.Kind]'s names. */
+ enum class Body { THOUGHT, WORK, BUBBLE, BUBBLE_MUTED, IGNORED, MEETING, VERSION, LOOK, VAULT, PAGE, MORNING, SHELL }
+
+ private val zh get() = Strings.lang() == "zh"
+ private fun t(z: String, e: String) = if (zh) z else e
+
+ fun brain(e: BrainEvent) {
+ val s = e.subject
+ val text = when (e.kind) {
+ BrainEvent.Kind.WOKE -> t("提醒到点:$s", "Reminder due: $s")
+ BrainEvent.Kind.NOTIFIED -> t("一条通知值得处理,开始做", "A notification was worth acting on")
+ BrainEvent.Kind.FRIEND_TASK -> t("另一台设备的 Andee 交来一件事", "Another Andee handed over a task")
+ BrainEvent.Kind.REVIEWED -> if (s == "0" || s.isEmpty()) t("复盘了一遍,没有要记的", "Reviewed the conversation; nothing to keep")
+ else t("复盘了一遍,记下 $s 处", "Reviewed the conversation; kept $s things")
+ BrainEvent.Kind.FOLDED -> t("收起了一个话题:$s", "Put away a topic: $s")
+ BrainEvent.Kind.DIARY -> t("写了今天的日记", "Wrote today's diary")
+ BrainEvent.Kind.SELF -> t("改写了自我描述", "Rewrote who it is")
+ BrainEvent.Kind.WIKI -> t("写进维基:$s", "Wrote to the wiki: $s")
+ BrainEvent.Kind.PERSON -> t("记下了一个人:$s", "Noted a person: $s")
+ BrainEvent.Kind.CARE -> when (e.detail) {
+ "+" -> t("开始在意:$s", "Now cares about: $s")
+ "done" -> t("一件在意的事做完了", "A care is done")
+ else -> t("放下了一件在意的事", "Let a care go")
+ }
+ BrainEvent.Kind.MEMORY -> t("记住了:$s", "Remembered: $s")
+ BrainEvent.Kind.TODO -> t("排了一件待办:$s", "Set a todo: $s")
+ BrainEvent.Kind.PLAN -> t("写了${if (s == "tomorrow") "明天" else "今天"}的打算", "Wrote ${if (s == "tomorrow") "tomorrow's" else "today's"} plan")
+ }
+ val detail = when (e.kind) {
+ BrainEvent.Kind.CARE -> ""
+ BrainEvent.Kind.TODO -> e.detail.takeIf { it.isNotBlank() }?.let { t("时间:$it", "At: $it") }.orEmpty()
+ else -> e.detail
+ }
+ Scrollback.event(e.kind.name, text, detail)
+ }
+
+ fun body(kind: Body, text: String, detail: String = "") = Scrollback.event(kind.name, text, detail)
+
+ // ---- the words for the body's own events -------------------------------------------------
+
+ fun thought(text: String) = body(Body.THOUGHT, t("自己想了想:$text", "Thought: $text"))
+ fun workStarted(what: String, why: String) = body(Body.WORK, t("自己动起来:「$what」", "Got up for \"$what\""), why)
+ fun workDone(what: String, effect: String, summary: String?) = body(
+ Body.WORK,
+ when (effect) {
+ "ACTED" -> t("做完了「$what」的一部分", "Did some of \"$what\"")
+ "LOOKED" -> t("看了看「$what」,没动手", "Looked at \"$what\", did nothing yet")
+ else -> t("「$what」这次没做成什么", "Nothing came of \"$what\" this time")
+ },
+ summary.orEmpty(),
+ )
+ fun bubble(text: String) = body(Body.BUBBLE, t("冒了个气泡:$text", "Bubble: $text"))
+ fun ignored(app: String, why: String) = body(Body.IGNORED, t("没打扰你:$app 的一条通知", "Let a notification from $app pass"), why)
+ fun morning(intent: String) = body(Body.MORNING, t("早上想好了今天的打算", "Thought out today's plan this morning"), intent)
+
+ /** The row's mark, from the app's own icon set (an emoji would take whatever font the Mac has). */
+ fun mark(kind: String): AndeeIcon = when (kind) {
+ BrainEvent.Kind.WOKE.name, BrainEvent.Kind.NOTIFIED.name, Body.IGNORED.name -> AndeeIcon.ALERT_CIRCLE
+ BrainEvent.Kind.FRIEND_TASK.name -> AndeeIcon.FRIENDS
+ BrainEvent.Kind.REVIEWED.name, BrainEvent.Kind.FOLDED.name -> AndeeIcon.CHECK_CIRCLE
+ BrainEvent.Kind.WIKI.name, Body.PAGE.name -> AndeeIcon.DOCUMENT
+ BrainEvent.Kind.PERSON.name -> AndeeIcon.FACE
+ BrainEvent.Kind.CARE.name, Body.WORK.name, Body.THOUGHT.name -> AndeeIcon.SPARKLE
+ Body.BUBBLE.name, Body.BUBBLE_MUTED.name -> AndeeIcon.CHAT
+ Body.MEETING.name -> AndeeIcon.MIC
+ Body.VERSION.name -> AndeeIcon.LINK
+ Body.LOOK.name -> AndeeIcon.IMAGE
+ Body.VAULT.name -> AndeeIcon.LOCK
+ Body.SHELL.name -> AndeeIcon.GRID
+ else -> AndeeIcon.NOTEBOOK
+ }
+}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
index 04089f6..a7f4e2c 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
@@ -156,6 +156,11 @@ private fun seed() {
Scrollback.add(Scrollback.Role.ASSISTANT, "好,已经设好了明天 10:00 的提醒。")
val b = Scrollback.snapshot().filter { it.topicId == null }.map { it.id }
Scrollback.fold("周会提醒", "明天 10:00 开周会", b, "User: 明天上午十点提醒我开周会\n\nAndee: 好……")
+ TimelineEvents.brain(net.kuafuai.andee.brain.BrainEvent(net.kuafuai.andee.brain.BrainEvent.Kind.REVIEWED, "3"))
+ TimelineEvents.brain(net.kuafuai.andee.brain.BrainEvent(net.kuafuai.andee.brain.BrainEvent.Kind.DIARY, detail = "今天他第一次让我自己去 X 上留言。"))
+ TimelineEvents.thought("交流群这两天很安静,我想知道是不是大家都没遇到问题")
+ TimelineEvents.ignored("Slack", "群里的闲聊,没有提到他")
+ TimelineEvents.brain(net.kuafuai.andee.brain.BrainEvent(net.kuafuai.andee.brain.BrainEvent.Kind.WOKE, "开周会"))
Scrollback.add(Scrollback.Role.USER, "看看今天有什么新闻")
Scrollback.add(Scrollback.Role.ASSISTANT, "我先打开浏览器搜一下,稍等。")
}
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/VersionCheck.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/VersionCheck.kt
index c11831d..a3810d2 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/VersionCheck.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/VersionCheck.kt
@@ -103,6 +103,7 @@ object VersionCheck {
val p = probe()
Log.i("Version", "launch check: ${current()} → $p")
val r = p as? Result.Behind ?: return@Thread
+ TimelineEvents.body(TimelineEvents.Body.VERSION, behindText(r))
if (AskGate.current != null) [email protected] { Log.i("Version", "a card is up; not reminding this launch") }
val zh = Strings.lang() == "zh"
val go = if (zh) "去升级" else "Upgrade"
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacDevice.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacDevice.kt
index 79359a8..de494ca 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacDevice.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacDevice.kt
@@ -237,7 +237,7 @@ class MacDevice : DesktopBrainHost.ToolProvider {
return JSONObject().put("error", "The camera could not be used on this Mac (no camera, or the Camera permission is missing). Say so; do not claim to see.")
}
val b64 = java.util.Base64.getEncoder().encodeToString(f.readBytes())
- Scrollback.add(Scrollback.Role.ASSISTANT, (if (Strings.lang() == "zh") "看了一眼(" else "Looked (") + (if (front) "front" else "back") + ")")
+ net.kuafuai.andee.desktop.TimelineEvents.body(net.kuafuai.andee.desktop.TimelineEvents.Body.LOOK, (if (Strings.lang() == "zh") "用摄像头看了一眼(" else "Looked through the camera (") + (if (front) "front" else "back") + ")")
return JSONObject().put("png_base64", b64).put("camera", if (front) "front" else "back")
} finally { f.delete() }
}
@@ -377,7 +377,7 @@ object MacVault {
val pw = find(label).optString("password")
require(pw.isNotEmpty()) { "That entry has no password saved." }
require(Bridge.focusedValue().optBoolean("focused")) { "Click into the password field first." }
- Scrollback.add(Scrollback.Role.ASSISTANT, "正在填入「$label」的密码… / filling the password for “$label”…")
+ net.kuafuai.andee.desktop.TimelineEvents.body(net.kuafuai.andee.desktop.TimelineEvents.Body.VAULT, if (Strings.lang() == "zh") "正在填入「$label」的密码" else "Filling the password for “$label”")
// Keystrokes, not AXValue: a web login form only believes what arrives as input events, and writing
// the control's value directly fills the box on screen while the page still holds an empty password.
// And not the pasteboard either — a password left there would sit in the user's clipboard history.
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacNotifications.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacNotifications.kt
index 27435be..a1cc8ab 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacNotifications.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/mac/MacNotifications.kt
@@ -184,7 +184,11 @@ object MacNotifications {
.decide(n, h.langTag(), h.scene())
when (verdict?.action) {
null -> Log.w(TAG, "no verdict for ${n.optString("app")}; left in the buffer")
- NotificationTriage.Action.IGNORE -> Log.i(TAG, "ignored ${n.optString("app")}: ${verdict.why}")
+ NotificationTriage.Action.IGNORE -> {
+ Log.i(TAG, "ignored ${n.optString("app")}: ${verdict.why}")
+ // A filter nobody can audit is a filter nobody trusts: what it let pass, and why, is on the timeline.
+ net.kuafuai.andee.desktop.TimelineEvents.ignored(n.optString("app").ifEmpty { "?" }, verdict.why)
+ }
NotificationTriage.Action.TELL -> if (verdict.line.isNotBlank()) h.tell(n, verdict.line)
NotificationTriage.Action.ACT -> h.act(lookQuery(n))
}
diff --git a/desktop/src/main/resources/strings_en.properties b/desktop/src/main/resources/strings_en.properties
index f28b9a8..208c1e3 100644
--- a/desktop/src/main/resources/strings_en.properties
+++ b/desktop/src/main/resources/strings_en.properties
@@ -244,4 +244,3 @@ s_codeflying_url=https://www.codeflying.app/andee
NO_KEY_CODEFLYING=There is no CodeFlying key yet. Open Settings → Backend → CodeFlying and paste the key; no key? Get one at CodeFlying.app.
s_settings_section_drive=On its own
s_settings_drive_note=It keeps a few things it cares about, each with how often it means to look. While you are at the Mac it checks about every 20 minutes whether one has waited too long and is worth doing now. If so, it works on it for a while — writing a plan, tidying the people it knows, noting a thought, at most one bubble — without touching the screen, speaking, or sending anything for you. Not at night (22:30–8:00); at most 40 checks and 6 work turns a day. Nothing overdue costs nothing. Off means it only moves when you call it.
-s_drive_row=(Thought about “%1$s” on my own: %2$s)
diff --git a/desktop/src/main/resources/strings_zh.properties b/desktop/src/main/resources/strings_zh.properties
index 85138cf..26fa788 100644
--- a/desktop/src/main/resources/strings_zh.properties
+++ b/desktop/src/main/resources/strings_zh.properties
@@ -244,4 +244,3 @@ s_codeflying_url=https://www.codeflying.net/andee
NO_KEY_CODEFLYING=还没有 CodeFlying 密钥。打开「设置」→「后端」→「CodeFlying」,粘贴密钥;还没有的话,去 CodeFlying.net 注册获取。
s_settings_section_drive=自己动起来
s_settings_drive_note=它心里记着几件在意的事,每件都有「多久该看一次」。你在电脑前的时候,它大约每 20 分钟想一想:有没有哪件拖得太久、现在值得去做。值得就自己做一会儿——写方案、整理它认识的人、记下想法,最多留一个气泡——不碰屏幕,不出声,也不替你发任何东西。夜里(22:30–8:00)不动;每天最多想 40 次、动手 6 次。没有拖久的事时不花你的 key。关掉就只在你叫它时才动。
-s_drive_row=(自己想了想「%1$s」:%2$s)