From 0be487bf964f05a268fc446c74b6317397e93151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Mon, 9 Nov 2026 16:53:46 +0000 Subject: [PATCH] The activity sheet as the reference lays it out; Subagents by name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ActivityContent(activity, …, actions): the sheet drawn from its facts, for the shots. Context with "N until auto-compact" and Compact; Background tasks as cards (running with elapsed and a stop square, nested "N under it", Finished folded); Room; Plan. - A bottom sheet from a top-bar button on every chat, a new one included. - The strip above the composer: running · queued · waiting · finished, while anything runs. - Compact through POST /api/v2/chats/{id}/compact (provisional until the server's route). - "Subagents" wherever a person reads it; 13 new strings in 8 languages. - Shots 14-16 (activity, unfolded, new chat); ActivityTest for auto-compact and titles. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 18 + .../eu/llembas/android/api/ActivityLogic.kt | 40 +- .../java/eu/llembas/android/api/ApiClient.kt | 7 + .../java/eu/llembas/android/api/Models.kt | 2 +- .../llembas/android/ui/chat/ActivityPanel.kt | 498 ++++++++++++------ .../eu/llembas/android/ui/chat/ChatScreen.kt | 12 +- .../llembas/android/ui/chat/ChatViewModel.kt | 20 + app/src/main/res/values-cs/strings.xml | 23 +- app/src/main/res/values-de/strings.xml | 23 +- app/src/main/res/values-es/strings.xml | 23 +- app/src/main/res/values-fr/strings.xml | 23 +- app/src/main/res/values-hu/strings.xml | 23 +- app/src/main/res/values-it/strings.xml | 23 +- app/src/main/res/values-pl/strings.xml | 23 +- app/src/main/res/values-sk/strings.xml | 23 +- app/src/main/res/values/strings.xml | 23 +- .../java/eu/llembas/android/ActivityTest.kt | 26 +- .../java/eu/llembas/android/shots/Fakes.kt | 60 ++- .../eu/llembas/android/shots/ScreenShots.kt | 19 + scripts/strings.py | 25 +- scripts/strings_own.json | 112 +++- 21 files changed, 784 insertions(+), 262 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 039c459..52908f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ is in alpha and releases come off `main`. ## [Unreleased] +### Changed + +- **Subagents, by that name.** Everything the app says about the work a chat hands off now + calls it a subagent -- the strip, the activity sheet and the chat's options. The team's size + in Options is **Subagents**, fewest and most. +- **The activity sheet, laid out as a side panel is on a computer**, and always one tap away: + the button at the top of every chat (a new one too) opens it as a sheet. **Context**: how + much of the window is used, in per cent and in tokens of the window, a bar split by what + fills it, each part with its tokens and share, how far it is to compacting by itself -- and a + **Compact** button that does it now. **Background tasks**: what is running -- subagents, a + team's members and background commands -- each on a card with how long it has run and a + stop button (which asks first); a card opens to what it was asked, its latest step, what it + is writing and its whole conversation, and folds those working under it into "N under it". + The finished ones are folded away under **Finished**. Then the team's **Room** and the + **Plan**. +- **The line above the message box** says what runs in the background -- "2 running · 1 queued + · 4 finished" -- only while anything does, and opens the sheet. + ## [1.0.0-beta.3] — 2026-11-09 For LLeMbas server 2.0 (2.0.0-beta.6 or later for scheduled tasks). diff --git a/app/src/main/java/eu/llembas/android/api/ActivityLogic.kt b/app/src/main/java/eu/llembas/android/api/ActivityLogic.kt index e117359..0878b09 100644 --- a/app/src/main/java/eu/llembas/android/api/ActivityLogic.kt +++ b/app/src/main/java/eu/llembas/android/api/ActivityLogic.kt @@ -44,16 +44,46 @@ object ActivityLogic { } /** - * What the strip above the composer says, as counts in order: agents working, queued, - * waiting. Empty when nothing is going -- then there is no strip. + * What the strip above the composer says, as counts in order: running, queued, waiting, + * then finished. Empty when nothing is going -- then there is no strip, whatever finished. */ - fun stripCounts(summary: ActivitySummary): List> = - listOf("working" to summary.working, "queued" to summary.queued, "waiting" to summary.waiting).filter { it.second > 0 } + fun stripCounts(summary: ActivitySummary): List> { + if (summary.working + summary.queued + summary.waiting == 0) return emptyList() + return listOf( + "working" to summary.working, + "queued" to summary.queued, + "waiting" to summary.waiting, + "finished" to summary.finished, + ).filter { it.second > 0 } + } + + /** + * How many tokens are left before the chat compacts itself: the window's [ContextUse.threshold] + * per cent, less what is used. Null when it never will -- the threshold is 0 (off) or 100, + * or the window is unknown -- since a count against an unknown window is a guess. + */ + fun untilAutoCompact(context: ContextUse): Int? { + if (context.limit <= 0 || context.threshold !in 1..99) return null + return (context.limit.toLong() * context.threshold / 100 - context.used).toInt().coerceAtLeast(0) + } + + /** + * What a task is called in its row: a team's member by its name, a subagent or a command + * by what it was asked to do (its role, else its brief), its id only when it has neither. + */ + fun title(agent: ActivityAgent): String = if (agent.kind == "member") { + agent.name + } else { + agent.role.ifBlank { agent.brief }.ifBlank { agent.name } + } + + /** Every task under [agent], however deep. */ + fun descendants(agent: ActivityAgent): Int = agent.children.sumOf { 1 + descendants(it) } /** The top level split as the panel shows it: those still going, then the ended ones. */ fun split(agents: List): Pair, List> = agents.partition { it.isActive } - /** Every agent of a forest with its helpers under it, in tree order, for drawing as rows. */ + /** Every agent of a forest with its subagents under it, in tree order, for drawing as rows. */ fun flatten(agents: List): List = agents.flatMap { listOf(it) + flatten(it.children) } /** diff --git a/app/src/main/java/eu/llembas/android/api/ApiClient.kt b/app/src/main/java/eu/llembas/android/api/ApiClient.kt index cf39826..25ac17c 100644 --- a/app/src/main/java/eu/llembas/android/api/ApiClient.kt +++ b/app/src/main/java/eu/llembas/android/api/ApiClient.kt @@ -248,6 +248,13 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli suspend fun stopAgent(chatId: String, kind: String, id: String): List = send("POST", "/chats/$chatId/agents/${segment(kind)}/${segment(id)}/stop", null).stopped + /** + * Summarise the earlier turns now and stop sending them (the activity sheet's Compact). The + * server refuses in its own words (409) while a reply is being written or with nothing to + * summarise; the transcript is read again after, for the divider it leaves. + */ + suspend fun compact(chatId: String) = empty(authed("$v2/chats/$chatId/compact").post(ByteArray(0).toRequestBody(null)).build()) + suspend fun team(chatId: String, since: Int = 0): TeamView = get("/chats/$chatId/team?since=$since").team suspend fun stopMember(chatId: String, name: String): List = send("POST", "/chats/$chatId/team/${segment(name)}/stop", null).stopped diff --git a/app/src/main/java/eu/llembas/android/api/Models.kt b/app/src/main/java/eu/llembas/android/api/Models.kt index e27aadf..0cf0a35 100644 --- a/app/src/main/java/eu/llembas/android/api/Models.kt +++ b/app/src/main/java/eu/llembas/android/api/Models.kt @@ -521,7 +521,7 @@ data class AgentStep(val tool: String = "", val label: String = "", val title: S /** * One background agent: a team's member (`kind` member, [id] its name) or a job (`kind` job; - * [type] `subagent` or `command`), with its own helpers in [children]. [role], [brief] and + * [type] `subagent` or `command`), with its own subagents in [children]. [role], [brief] and * [text] are a model's words: shown as text, never as anything richer. */ @Serializable diff --git a/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt b/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt index b781cb1..0ac0b81 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/ActivityPanel.kt @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight @@ -32,7 +31,9 @@ import androidx.compose.material.icons.filled.Description import androidx.compose.material.icons.filled.ExpandLess import androidx.compose.material.icons.filled.ExpandMore import androidx.compose.material.icons.filled.Groups -import androidx.compose.material.icons.filled.StopCircle +import androidx.compose.material.icons.filled.SmartToy +import androidx.compose.material.icons.filled.Stop +import androidx.compose.material.icons.filled.Terminal import androidx.compose.material.icons.filled.Visibility import androidx.compose.material3.AlertDialog import androidx.compose.material3.CircularProgressIndicator @@ -40,12 +41,14 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.OutlinedButton import androidx.compose.material3.Scaffold import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.material3.TopAppBar +import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -72,6 +75,7 @@ import eu.llembas.android.api.Activity import eu.llembas.android.api.ActivityAgent import eu.llembas.android.api.ActivityLogic import eu.llembas.android.api.ActivitySummary +import eu.llembas.android.api.ActivityTeam import eu.llembas.android.api.AgentDetail import eu.llembas.android.api.ContextUse import eu.llembas.android.api.Output @@ -84,9 +88,12 @@ import eu.llembas.android.ui.theme.Palette import eu.llembas.android.ui.viewer.TreeFileViewer import kotlinx.coroutines.delay -// --- The strip above the composer --------------------------------------------------------- +// --- The summary chip above the composer -------------------------------------------------- -/** What runs in the background, in one line ("3 agents working · 1 queued"), opening the panel. */ +/** + * What runs in the background, in one line ("2 running · 1 queued · 4 finished"), opening the + * activity sheet. Only while anything runs: finished work alone is no reason for a line. + */ @Composable fun ActivityStrip(summary: ActivitySummary, onOpen: () -> Unit) { val counts = ActivityLogic.stripCounts(summary) @@ -97,8 +104,9 @@ fun ActivityStrip(summary: ActivitySummary, onOpen: () -> Unit) { onClick = onOpen, color = palette.surfaceRaised, contentColor = palette.ink, - shape = RoundedCornerShape(8.dp), - modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp).heightIn(min = 48.dp), + shape = RoundedCornerShape(12.dp), + border = androidx.compose.foundation.BorderStroke(1.dp, palette.border), + modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp).heightIn(min = 48.dp), ) { Row(Modifier.padding(horizontal = 12.dp), verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Filled.Bolt, contentDescription = null, tint = palette.accent, modifier = Modifier.size(18.dp)) @@ -116,7 +124,7 @@ fun ActivityStrip(summary: ActivitySummary, onOpen: () -> Unit) { @Composable private fun stateCount(state: String, n: Int): String = when (state) { - "working" -> if (n == 1) stringResource(R.string.agents_one_working) else stringResource(R.string.agents_n_working, n.toString()) + "working" -> stringResource(R.string.tasks_n_running, n.toString()) "queued" -> stringResource(R.string.agents_n_queued, n.toString()) "waiting" -> stringResource(R.string.agents_n_waiting, n.toString()) else -> stringResource(R.string.agents_n_finished, n.toString()) @@ -132,7 +140,14 @@ private fun stateWord(state: String): String = when (state) { else -> stringResource(R.string.agent_state_error) } -/** The state's dot, in the web panel's colours: accent working, warning waiting, success done. */ +@Composable +private fun kindWord(agent: ActivityAgent): String = when { + agent.kind == "member" -> stringResource(R.string.task_member) + agent.type == "command" -> stringResource(R.string.task_command) + else -> stringResource(R.string.task_subagent) +} + +/** The state's colour, in the web panel's: accent working, warning waiting, success done. */ private fun stateColour(palette: Palette, state: String): Color = when (state) { "working" -> palette.accent "queued", "waiting" -> palette.warning @@ -168,32 +183,43 @@ private fun categoryName(key: String): String = when (key) { else -> key } -// --- The panel ------------------------------------------------------------------------------ +// --- The sheet ------------------------------------------------------------------------------ /** - * The chat's activity, full screen: Context, Outputs, Background tasks (with the team's room) - * and Plan -- the web's activity panel, from `GET /chats/{chat}/activity`. Kept current by the - * events route through the view model; without it, read again every few seconds while open. - * Everything an agent wrote is a model's words: names, roles and briefs as plain text, the - * room and replies through [MarkdownText]'s untrusted rules. + * What the activity sheet asks of the chat. Every action has a do-nothing default, so the + * screenshot tests draw the sheet with fake data and nothing behind it. + */ +interface ActivityActions { + fun stop(agent: ActivityAgent) {} + fun read(agent: ActivityAgent) {} + fun openFile(path: String) {} + fun compact() {} +} + +/** + * The chat's activity as a sheet over it, from the top bar's button or the strip: Context, + * Outputs, Background tasks, the team's Room and Plan -- the web's side panel, from + * `GET /chats/{chat}/activity`. Kept current by the events route through the view model; + * without it, read again every few seconds while open. A chat not made yet has nothing to + * show but says so in each section. Stopping anything asks first. */ @Composable -fun ActivityPanel(chatId: String, state: ChatState, model: ChatViewModel, canOpenFiles: Boolean, onClose: () -> Unit) { - val activity = state.activity +fun ActivityPanel(chatId: String?, state: ChatState, model: ChatViewModel, canOpenFiles: Boolean, onClose: () -> Unit) { val live by rememberUpdatedState(state.activityLive) var now by remember { mutableLongStateOf(SystemClock.elapsedRealtime()) } var stopping by remember { mutableStateOf(null) } var reading by remember { mutableStateOf(null) } var viewing by remember { mutableStateOf(null) } - LaunchedEffect(Unit) { + LaunchedEffect(chatId) { + if (chatId == null) return@LaunchedEffect model.panel(true) var ticks = 0 while (true) { delay(1_000) now = SystemClock.elapsedRealtime() ticks++ - // Without the events route, the panel reads itself again: cheaply, every 5 s. + // Without the events route, the sheet reads itself again: cheaply, every 5 s. if (!live && ticks % 5 == 0) model.loadActivity(context = false) } } @@ -202,54 +228,44 @@ fun ActivityPanel(chatId: String, state: ChatState, model: ChatViewModel, canOpe model.panel(false) onClose() } - Dialog(onDismissRequest = close, properties = DialogProperties(usePlatformDefaultWidth = false)) { - Scaffold( - topBar = { - TopAppBar( - navigationIcon = { - IconButton(onClick = close) { Icon(Icons.Filled.Close, contentDescription = stringResource(R.string.close)) } - }, - title = { Text(stringResource(R.string.activity)) }, - ) - }, - ) { padding -> - if (activity == null) { - Box(Modifier.padding(padding).fillMaxSize(), contentAlignment = Alignment.Center) { CircularProgressIndicator() } - return@Scaffold - } - LazyColumn( - Modifier.padding(padding).fillMaxSize(), - contentPadding = PaddingValues(16.dp), - verticalArrangement = Arrangement.spacedBy(8.dp), - ) { - item { Section(stringResource(R.string.activity_context)) { ContextSection(activity.context) } } - item { - Section(stringResource(R.string.activity_outputs), count = activity.outputs.size.takeIf { it > 0 }) { - OutputsSection(activity.outputs, canOpenFiles) { viewing = it } - } - } - item { - Section(stringResource(R.string.activity_tasks)) { - TasksSection(activity, state.activityAt, now, onStop = { stopping = it }, onRead = { reading = it }) - } - } - ActivityLogic.plan(activity.plan)?.let { plan -> - item { Section(stringResource(R.string.mode_plan)) { PlanBody(plan) } } - } - } + val actions = object : ActivityActions { + override fun stop(agent: ActivityAgent) { + stopping = agent } + + override fun read(agent: ActivityAgent) { + reading = agent + } + + override fun openFile(path: String) { + if (canOpenFiles) viewing = path + } + + override fun compact() = model.compact() + } + ModalBottomSheet(onDismissRequest = close, sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)) { + ActivityContent( + activity = if (chatId == null) Activity() else state.activity, + readAt = state.activityAt, + now = now, + actions = actions, + canCompact = chatId != null && !state.running, + compacting = state.compacting, + canOpenFiles = canOpenFiles, + onClose = close, + ) } stopping?.let { agent -> AlertDialog( onDismissRequest = { stopping = null }, - title = { Text(stringResource(R.string.agent_stop, agent.name)) }, + title = { Text(stringResource(R.string.agent_stop, ActivityLogic.title(agent))) }, text = { Text( if (agent.kind == "member") { stringResource(R.string.agent_stop_member_confirm, agent.name) } else { - stringResource(R.string.agent_stop_confirm, agent.name) + stringResource(R.string.agent_stop_confirm, ActivityLogic.title(agent)) }, ) }, @@ -262,13 +278,70 @@ fun ActivityPanel(chatId: String, state: ChatState, model: ChatViewModel, canOpe dismissButton = { TextButton(onClick = { stopping = null }) { Text(stringResource(R.string.cancel)) } }, ) } - reading?.let { agent -> AgentConversation(chatId, agent, onClose = { reading = null }) } + if (chatId != null) reading?.let { agent -> AgentConversation(chatId, agent, onClose = { reading = null }) } viewing?.let { path -> TreeFileViewer(path, onClose = { viewing = null }) } } -/** A heading that folds its section away, open to begin with. */ +/** + * The sheet as it is drawn, from its facts alone: what the screenshot tests render. [activity] + * null is still being read; [now] and [readAt] are the clock that elapsed time counts on; + * [unfolded] opens the first task and the finished ones, for the screenshots to see them. + */ @Composable -private fun Section(title: String, count: Int? = null, content: @Composable () -> Unit) { +fun ActivityContent( + activity: Activity?, + readAt: Long, + now: Long, + actions: ActivityActions, + canCompact: Boolean = true, + compacting: Boolean = false, + canOpenFiles: Boolean = true, + unfolded: Boolean = false, + onClose: () -> Unit = {}, +) { + val palette = LocalPalette.current + Column(Modifier.fillMaxWidth()) { + Row( + Modifier.fillMaxWidth().padding(start = 16.dp, end = 4.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Text(stringResource(R.string.activity), style = MaterialTheme.typography.titleLarge, modifier = Modifier.weight(1f)) + IconButton(onClick = onClose) { Icon(Icons.Filled.Close, contentDescription = stringResource(R.string.close), tint = palette.inkMuted) } + } + if (activity == null) { + Box(Modifier.fillMaxWidth().height(240.dp), contentAlignment = Alignment.Center) { CircularProgressIndicator() } + return@Column + } + LazyColumn( + Modifier.fillMaxWidth(), + contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 32.dp), + ) { + item { + Section(stringResource(R.string.activity_context)) { + ContextSection(activity.context, canCompact, compacting, actions::compact) + } + } + if (activity.outputs.isNotEmpty()) { + item { + Section(stringResource(R.string.activity_outputs), count = activity.outputs.size) { + OutputsSection(activity.outputs, canOpenFiles, actions::openFile) + } + } + } + item { Section(stringResource(R.string.activity_tasks)) { TasksSection(activity, readAt, now, actions, unfolded) } } + activity.team?.let { team -> + item { Section(stringResource(R.string.team_room), count = team.room.size.takeIf { it > 0 }) { RoomSection(team) } } + } + ActivityLogic.plan(activity.plan)?.let { plan -> + item { Section(stringResource(R.string.mode_plan), divider = false) { PlanBody(plan) } } + } + } + } +} + +/** A heading that folds its section away, open to begin with, with an optional count beside it. */ +@Composable +private fun Section(title: String, count: Int? = null, divider: Boolean = true, content: @Composable () -> Unit) { val palette = LocalPalette.current var open by rememberSaveable(title) { mutableStateOf(true) } Column(Modifier.fillMaxWidth()) { @@ -281,85 +354,113 @@ private fun Section(title: String, count: Int? = null, content: @Composable () - Icon(if (open) Icons.Filled.ExpandLess else Icons.Filled.ExpandMore, contentDescription = null, tint = palette.inkFaint) } if (open) content() - HorizontalDivider(Modifier.padding(top = 8.dp), color = palette.border) + if (divider) HorizontalDivider(Modifier.padding(top = 12.dp), color = palette.border) } } @Composable private fun Empty(text: String) { - Text(text, style = MaterialTheme.typography.bodySmall, color = LocalPalette.current.inkMuted) + Text(text, style = MaterialTheme.typography.bodySmall, color = LocalPalette.current.inkMuted, modifier = Modifier.padding(bottom = 4.dp)) } // --- Context -------------------------------------------------------------------------------- +/** + * The reference's Context: "N% used" and used / window on one line, the segmented bar, one row + * per category (swatch, name, tokens, per cent), then how far auto-compact is and the button + * that compacts now. + */ @Composable -private fun ContextSection(context: ContextUse?) { +private fun ContextSection(context: ContextUse?, canCompact: Boolean, compacting: Boolean, onCompact: () -> Unit) { val palette = LocalPalette.current - if (context == null) { - Empty(stringResource(R.string.activity_not_measured)) - return - } Column(verticalArrangement = Arrangement.spacedBy(6.dp)) { - Row(verticalAlignment = Alignment.CenterVertically) { - val pct = context.percent + if (context == null) { + Empty(stringResource(R.string.activity_not_measured)) + } else { + Row(verticalAlignment = Alignment.CenterVertically) { + val pct = context.percent + Text( + if (pct != null) stringResource(R.string.activity_used, ActivityLogic.percent(pct)) else ActivityLogic.compactTokens(context.used), + style = MaterialTheme.typography.bodyMedium, + modifier = Modifier.weight(1f), + ) + Text( + if (context.limit > 0) { + "${ActivityLogic.compactTokens(context.used)} / ${ActivityLogic.compactTokens(context.limit)}" + } else { + stringResource(R.string.activity_window_unknown) + }, + style = MaterialTheme.typography.bodySmall, + color = palette.inkMuted, + ) + } + val parts = ActivityLogic.barParts(context) + if (parts.isNotEmpty()) { + // One segment per category, by its tokens; the rest of the window is the bar's own + // background. Weights, so the segments always fill exactly the bar's width. + Row(Modifier.fillMaxWidth().height(6.dp).clip(RoundedCornerShape(3.dp)).background(palette.surfaceRaised)) { + parts.forEach { part -> Box(Modifier.weight(part.tokens.toFloat()).fillMaxHeight().background(categoryColour(palette, part.key))) } + val rest = (context.limit - parts.sumOf { it.tokens }).coerceAtLeast(0) + if (rest > 0) Spacer(Modifier.weight(rest.toFloat())) + } + } + // Each row a fixed grid: swatch, the name that gives, two number columns of their own + // width -- the numbers line up whatever the names say in which language. + context.categories.forEach { part -> + Row(Modifier.fillMaxWidth().heightIn(min = 24.dp), verticalAlignment = Alignment.CenterVertically) { + Box(Modifier.size(10.dp).clip(RoundedCornerShape(2.dp)).background(categoryColour(palette, part.key))) + Text( + categoryName(part.key), + style = MaterialTheme.typography.bodySmall, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.weight(1f).padding(horizontal = 8.dp), + ) + Text( + ActivityLogic.compactTokens(part.tokens), + style = MaterialTheme.typography.bodySmall, + textAlign = TextAlign.End, + modifier = Modifier.width(56.dp), + ) + Text( + part.percent?.let { "${ActivityLogic.percent(it)}%" } ?: "—", + style = MaterialTheme.typography.bodySmall, + color = palette.inkMuted, + textAlign = TextAlign.End, + modifier = Modifier.width(56.dp), + ) + } + } Text( - if (pct != null) stringResource(R.string.activity_used, ActivityLogic.percent(pct)) else ActivityLogic.compactTokens(context.used), - style = MaterialTheme.typography.bodyMedium, - modifier = Modifier.weight(1f), + stringResource(if (context.measured) R.string.activity_measured else R.string.activity_estimated) + " " + + stringResource(R.string.activity_tools_offered, context.toolsCount.toString()), + style = MaterialTheme.typography.labelSmall, + color = palette.inkFaint, ) + } + // How far automatic compaction is, and the button. The words give; the button keeps its + // own size whatever the sentence says in which language. + Row(Modifier.fillMaxWidth().heightIn(min = 48.dp), verticalAlignment = Alignment.CenterVertically) { + val until = context?.let { ActivityLogic.untilAutoCompact(it) } Text( - if (context.limit > 0) { - "${ActivityLogic.compactTokens(context.used)} / ${ActivityLogic.compactTokens(context.limit)}" - } else { - stringResource(R.string.activity_window_unknown) + when { + context == null -> "" + until != null -> stringResource(R.string.activity_until_compact, ActivityLogic.compactTokens(until)) + context.threshold <= 0 -> stringResource(R.string.activity_compact_off) + else -> "" }, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted, + modifier = Modifier.weight(1f).padding(end = 8.dp), ) - } - val parts = ActivityLogic.barParts(context) - if (parts.isNotEmpty()) { - // One segment per category, by its tokens; the rest of the window is the bar's own - // background. Weights, so the segments always fill exactly the bar's width. - Row(Modifier.fillMaxWidth().height(8.dp).clip(RoundedCornerShape(4.dp)).background(palette.surfaceRaised)) { - parts.forEach { part -> Box(Modifier.weight(part.tokens.toFloat()).fillMaxHeight().background(categoryColour(palette, part.key))) } - val rest = (context.limit - parts.sumOf { it.tokens }).coerceAtLeast(0) - if (rest > 0) Spacer(Modifier.weight(rest.toFloat())) + OutlinedButton(onClick = onCompact, enabled = canCompact && !compacting && context != null) { + if (compacting) { + CircularProgressIndicator(Modifier.size(16.dp), strokeWidth = 2.dp) + Spacer(Modifier.width(8.dp)) + } + Text(stringResource(R.string.activity_compact)) } } - // Each row a fixed grid: swatch, the name that gives, two number columns of their own - // width -- the numbers line up whatever the names say in which language. - context.categories.forEach { part -> - Row(Modifier.fillMaxWidth().heightIn(min = 24.dp), verticalAlignment = Alignment.CenterVertically) { - Box(Modifier.size(10.dp).clip(RoundedCornerShape(2.dp)).background(categoryColour(palette, part.key))) - Text( - categoryName(part.key), - style = MaterialTheme.typography.bodySmall, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f).padding(horizontal = 8.dp), - ) - Text( - ActivityLogic.compactTokens(part.tokens), - style = MaterialTheme.typography.bodySmall, - textAlign = TextAlign.End, - modifier = Modifier.width(56.dp), - ) - Text( - part.percent?.let { "${ActivityLogic.percent(it)}%" } ?: "—", - style = MaterialTheme.typography.bodySmall, - color = palette.inkMuted, - textAlign = TextAlign.End, - modifier = Modifier.width(56.dp), - ) - } - } - Text( - stringResource(if (context.measured) R.string.activity_measured else R.string.activity_estimated) + " " + - stringResource(R.string.activity_tools_offered, context.toolsCount.toString()), - style = MaterialTheme.typography.labelSmall, - color = palette.inkFaint, - ) } } @@ -368,10 +469,6 @@ private fun ContextSection(context: ContextUse?) { @Composable private fun OutputsSection(outputs: List, canOpen: Boolean, onOpen: (String) -> Unit) { val palette = LocalPalette.current - if (outputs.isEmpty()) { - Empty(stringResource(R.string.outputs_empty)) - return - } Column { outputs.forEach { out -> Row( @@ -406,8 +503,13 @@ private fun OutputsSection(outputs: List, canOpen: Boolean, onOpen: (Str // --- Background tasks ----------------------------------------------------------------------- +/** + * Subagents, a team's members and background commands, as the reference has them: "Running N" + * with a card per task (elapsed and a stop each, those under it folded into "N under it"), + * then "Finished N" folded away. + */ @Composable -private fun TasksSection(activity: Activity, readAt: Long, now: Long, onStop: (ActivityAgent) -> Unit, onRead: (ActivityAgent) -> Unit) { +private fun TasksSection(activity: Activity, readAt: Long, now: Long, actions: ActivityActions, unfolded: Boolean) { val palette = LocalPalette.current val team = activity.team if (activity.agents.isEmpty() && team == null) { @@ -415,14 +517,8 @@ private fun TasksSection(activity: Activity, readAt: Long, now: Long, onStop: (A return } val (live, ended) = ActivityLogic.split(activity.agents) - var showEnded by rememberSaveable { mutableStateOf(false) } - Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { - val counts = ActivityLogic.stripCounts(activity.summary) - Text( - if (counts.isEmpty()) stringResource(R.string.tasks_none_running) else counts.map { (s, n) -> stateCount(s, n) }.joinToString(" · "), - style = MaterialTheme.typography.bodySmall, - color = palette.inkMuted, - ) + var showEnded by rememberSaveable { mutableStateOf(unfolded) } + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { team?.let { t -> Row(verticalAlignment = Alignment.CenterVertically) { Icon(Icons.Filled.Groups, contentDescription = null, tint = palette.inkMuted, modifier = Modifier.size(18.dp)) @@ -434,48 +530,118 @@ private fun TasksSection(activity: Activity, readAt: Long, now: Long, onStop: (A } if (t.goal.isNotBlank()) Text(t.goal, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted) } - ActivityLogic.flatten(live).forEach { AgentRow(it, readAt, now, onStop, onRead) } + Row(verticalAlignment = Alignment.CenterVertically) { + Text(stringResource(R.string.tasks_running), style = MaterialTheme.typography.labelLarge, color = palette.inkMuted) + Text(live.size.toString(), style = MaterialTheme.typography.labelLarge, color = palette.inkFaint, modifier = Modifier.padding(start = 6.dp)) + } + if (live.isEmpty()) Empty(stringResource(R.string.tasks_none_running)) + live.forEachIndexed { i, task -> TaskCard(task, readAt, now, actions, unfolded && i == 0) } if (ended.isNotEmpty()) { Row( Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { showEnded = !showEnded }, verticalAlignment = Alignment.CenterVertically, ) { - Icon(if (showEnded) Icons.Filled.ExpandLess else Icons.Filled.ExpandMore, contentDescription = null, tint = palette.inkFaint) + Icon( + if (showEnded) Icons.Filled.ExpandMore else Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, + tint = palette.inkFaint, + ) Text( - stringResource(R.string.agents_n_finished, ended.size.toString()), - style = MaterialTheme.typography.bodyMedium, + stringResource(R.string.tasks_finished), + style = MaterialTheme.typography.labelLarge, + color = palette.inkMuted, modifier = Modifier.padding(start = 6.dp), ) + Text(ended.size.toString(), style = MaterialTheme.typography.labelLarge, color = palette.inkFaint, modifier = Modifier.padding(start = 6.dp)) } - if (showEnded) ActivityLogic.flatten(ended).forEach { AgentRow(it, readAt, now, onStop, onRead) } + if (showEnded) ended.forEach { TaskCard(it, readAt, now, actions, unfolded = false) } } - team?.let { t -> - Text(stringResource(R.string.team_room), style = MaterialTheme.typography.titleSmall, modifier = Modifier.padding(top = 12.dp)) - if (t.room.isEmpty()) Empty(stringResource(R.string.room_empty)) else t.room.forEach { RoomEntry(it) } + } +} + +/** One top-level task as a card of its own, with the tasks under it inside, folded. */ +@Composable +private fun TaskCard(agent: ActivityAgent, readAt: Long, now: Long, actions: ActivityActions, unfolded: Boolean) { + val palette = LocalPalette.current + var nestedOpen by rememberSaveable(agent.kind, agent.id, "nested") { mutableStateOf(unfolded) } + Surface( + color = palette.surfaceRaised, + contentColor = palette.ink, + shape = RoundedCornerShape(12.dp), + modifier = Modifier.fillMaxWidth(), + ) { + Column(Modifier.padding(vertical = 2.dp)) { + TaskRow(agent, readAt, now, actions, unfolded) + val under = ActivityLogic.descendants(agent) + if (under > 0) { + Row( + Modifier.fillMaxWidth().heightIn(min = 40.dp).clickable { nestedOpen = !nestedOpen }.padding(start = 12.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Icon( + if (nestedOpen) Icons.Filled.ExpandMore else Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, + tint = palette.inkFaint, + modifier = Modifier.size(18.dp), + ) + Text( + stringResource(R.string.tasks_nested, under.toString()), + style = MaterialTheme.typography.bodySmall, + color = palette.inkMuted, + modifier = Modifier.padding(start = 4.dp), + ) + } + if (nestedOpen) ActivityLogic.flatten(agent.children).forEach { TaskRow(it, readAt, now, actions, unfolded = false) } + } } } } /** - * One agent: a fixed row (state dot, what it is -- the part that gives, cut not wrapped --, - * elapsed time in a column of its own width, the stop button at its tap size), indented by - * its depth in the tree; tapped, it opens to its brief, model, latest step and what it is - * writing, and the way into its conversation. + * One task: a fixed row (chevron, kind icon, what it is -- the part that gives, cut not + * wrapped --, elapsed time in a column of its own width, the stop square at its tap size), + * indented by its depth; tapped, it opens to its brief, model, latest step and live text, and + * the way into its conversation. */ @Composable -private fun AgentRow(agent: ActivityAgent, readAt: Long, now: Long, onStop: (ActivityAgent) -> Unit, onRead: (ActivityAgent) -> Unit) { +private fun TaskRow(agent: ActivityAgent, readAt: Long, now: Long, actions: ActivityActions, unfolded: Boolean) { val palette = LocalPalette.current - var open by rememberSaveable(agent.kind, agent.id) { mutableStateOf(false) } + var open by rememberSaveable(agent.kind, agent.id) { mutableStateOf(unfolded) } Column(Modifier.fillMaxWidth().padding(start = (16 * agent.depth.coerceIn(0, 4)).dp)) { Row( - Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { open = !open }, + Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { open = !open }.padding(start = 8.dp), verticalAlignment = Alignment.CenterVertically, ) { - Box(Modifier.size(8.dp).clip(CircleShape).background(stateColour(palette, agent.state))) + Icon( + if (open) Icons.Filled.ExpandMore else Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, + tint = palette.inkFaint, + modifier = Modifier.size(18.dp), + ) + Icon( + when { + agent.kind == "member" -> Icons.Filled.Groups + agent.type == "command" -> Icons.Filled.Terminal + else -> Icons.Filled.SmartToy + }, + contentDescription = kindWord(agent), + tint = stateColour(palette, agent.state), + modifier = Modifier.padding(start = 4.dp).size(18.dp), + ) Column(Modifier.weight(1f).padding(horizontal = 8.dp)) { - Text(agent.name, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis) - if (agent.role.isNotBlank()) { - Text(agent.role, style = MaterialTheme.typography.labelSmall, color = palette.inkMuted, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(ActivityLogic.title(agent), style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis) + val sub = listOfNotNull( + if (agent.kind == "member") agent.role.ifBlank { null } else null, + if (agent.isActive) null else stateWord(agent.state), + ) + if (sub.isNotEmpty()) { + Text( + sub.joinToString(" · "), + style = MaterialTheme.typography.labelSmall, + color = palette.inkMuted, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) } } Text( @@ -486,23 +652,40 @@ private fun AgentRow(agent: ActivityAgent, readAt: Long, now: Long, onStop: (Act modifier = Modifier.width(64.dp), ) Box(Modifier.size(48.dp), contentAlignment = Alignment.Center) { - if (agent.stoppable) { - IconButton(onClick = { onStop(agent) }) { - Icon(Icons.Filled.StopCircle, contentDescription = stringResource(R.string.agent_stop, agent.name), tint = palette.inkMuted) + if (agent.stoppable && agent.isActive) { + IconButton(onClick = { actions.stop(agent) }) { + Box( + Modifier.size(24.dp).clip(RoundedCornerShape(6.dp)).background(palette.surfaceActive), + contentAlignment = Alignment.Center, + ) { + Icon( + Icons.Filled.Stop, + contentDescription = stringResource(R.string.agent_stop, ActivityLogic.title(agent)), + tint = palette.ink, + modifier = Modifier.size(16.dp), + ) + } } } } } if (open) { - Column(Modifier.padding(start = 16.dp, bottom = 8.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) { + Column(Modifier.padding(start = 34.dp, end = 12.dp, bottom = 10.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) { val facts = listOfNotNull( + kindWord(agent), stateWord(agent.state), agent.agent.ifBlank { null }, agent.model.ifBlank { null }, if (agent.steps > 0) stringResource(R.string.agent_steps, agent.steps.toString(), agent.tools.toString()) else null, ) Text(facts.joinToString(" · "), style = MaterialTheme.typography.labelSmall, color = palette.inkMuted) - if (agent.brief.isNotBlank()) Text(agent.brief, style = MaterialTheme.typography.bodySmall) + if (agent.brief.isNotBlank() && agent.brief != ActivityLogic.title(agent)) { + Text( + agent.brief, + style = MaterialTheme.typography.bodySmall, + fontFamily = if (agent.type == "command") FontFamily.Monospace else null, + ) + } agent.step?.let { step -> Text( listOf(step.label.ifBlank { step.tool }, step.title).filter { it.isNotBlank() }.joinToString(" "), @@ -517,7 +700,7 @@ private fun AgentRow(agent: ActivityAgent, readAt: Long, now: Long, onStop: (Act Text(agent.text, style = MaterialTheme.typography.bodySmall, color = palette.ink, maxLines = 6, overflow = TextOverflow.Ellipsis) } if (agent.transcript) { - OutlinedButton(onClick = { onRead(agent) }) { + OutlinedButton(onClick = { actions.read(agent) }) { Icon(Icons.Filled.Visibility, contentDescription = null, modifier = Modifier.size(18.dp)) Text(stringResource(R.string.agent_open_conversation), modifier = Modifier.padding(start = 6.dp)) } @@ -527,6 +710,13 @@ private fun AgentRow(agent: ActivityAgent, readAt: Long, now: Long, onStop: (Act } } +// --- The room ------------------------------------------------------------------------------- + +@Composable +private fun RoomSection(team: ActivityTeam) { + if (team.room.isEmpty()) Empty(stringResource(R.string.room_empty)) else Column { team.room.forEach { RoomEntry(it) } } +} + @Composable private fun RoomEntry(entry: RoomMessage) { val palette = LocalPalette.current diff --git a/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt b/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt index 7122468..1faa168 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/ChatScreen.kt @@ -142,10 +142,8 @@ fun ChatScreen( ) if (activityOpen) { - state.chat?.let { chat -> - // A device's files are on the device: the panel lists them, the tree cannot open them. - ActivityPanel(chat.id, state, model, canOpenFiles = !chat.isAgent, onClose = { activityOpen = false }) - } + // A device's files are on the device: the sheet lists them, the tree cannot open them. + ActivityPanel(state.chat?.id, state, model, canOpenFiles = !isAgent, onClose = { activityOpen = false }) } showing?.let { file -> state.chat?.id?.let { id -> FileViewer(id, file, onClose = { showing = null }) } @@ -219,15 +217,13 @@ fun ChatContent( ) }, actions = { + // The activity sheet, always within reach: context, background tasks, plan. + IconButton(onClick = onActivity) { Icon(Icons.Filled.Bolt, contentDescription = stringResource(R.string.activity_open)) } if (chat != null) { IconButton(onClick = onNewChat) { Icon(Icons.Filled.EditNote, contentDescription = stringResource(R.string.new_chat)) } Box { IconButton(onClick = { menu = true }) { Icon(Icons.Filled.MoreVert, contentDescription = stringResource(R.string.more)) } DropdownMenu(expanded = menu, onDismissRequest = { menu = false }) { - MenuItem(Icons.Filled.Bolt, stringResource(R.string.activity)) { - menu = false - onActivity() - } MenuItem(Icons.Filled.DriveFileRenameOutline, stringResource(R.string.rename_chat)) { menu = false renaming = true diff --git a/app/src/main/java/eu/llembas/android/ui/chat/ChatViewModel.kt b/app/src/main/java/eu/llembas/android/ui/chat/ChatViewModel.kt index a332c05..7b89447 100644 --- a/app/src/main/java/eu/llembas/android/ui/chat/ChatViewModel.kt +++ b/app/src/main/java/eu/llembas/android/ui/chat/ChatViewModel.kt @@ -65,6 +65,8 @@ data class ChatState( val teamOffered: Boolean = false, /** Whether the events route is followed; without it an open panel polls. */ val activityLive: Boolean = false, + /** A Compact asked for from the activity sheet and not answered yet. */ + val compacting: Boolean = false, /** What a chat not made yet will be made with: chosen in the top bar and the tune sheet. */ val draft: Draft = Draft(), ) @@ -423,6 +425,24 @@ class ChatViewModel(app: Application) : loadActivity(context = false) } + /** Compact the chat now; the transcript and the sheet are read again for what it changed. */ + fun compact() { + val chat = _state.value.chat ?: return + if (_state.value.compacting) return + viewModelScope.launch { + _state.update { it.copy(compacting = true) } + try { + api().compact(chat.id) + refresh() + loadActivity() + } catch (e: Exception) { + fail(e) + } finally { + _state.update { it.copy(compacting = false) } + } + } + } + override fun delete(then: () -> Unit) = control { api, chat -> api.deleteChat(chat.id) then() diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 7afe978..de27d5d 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -76,11 +76,18 @@ Od poslední odpovědi Rezerva na zhuštění Volné místo - V tomto chatu se zatím nezapsal žádný soubor. - Na pozadí nic neběží. Pomocníci, příkazy a členové týmu se tu zobrazí, dokud pracují. + Na pozadí nic neběží. Subagenti, příkazy a členové týmu se tu ukážou, dokud pracují. Nic neběží. - 1 agent pracuje - Pracující agenti: %1$s + Běží + Dokončeno + Běží: %1$s + Pod ním: %1$s + Subagent + Příkaz + Člen týmu + %1$s do automatického shrnutí + Automatické shrnutí je vypnuté. + Shrnout Ve frontě: %1$s Čeká: %1$s Dokončeno: %1$s @@ -97,15 +104,15 @@ Zastavit %1$s? Co dosud udělal, zůstane. Zatím nic neřekl. Od systému - Tým: %1$s z %2$s agentů + Tým: %1$s z %2$s subagentů Místnost V místnosti zatím nikdo nic neřekl. hlášení - Agenti + Subagenti Nejméně Nejvíce - Včetně vlastního agenta. Při více než jednom může přidat členy, kteří dělají práci, zatímco je vede. - Agenti %1$s–%2$s + Nejméně a nejvíce pro tento chat, včetně jeho vlastního agenta. Nad jednoho může předávat práci subagentům a vést je. + Subagenti %1$s–%2$s Přemýšlet před odpovědí vypnuto výchozí diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4bac78d..a4ae8ec 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -76,11 +76,18 @@ Seit der letzten Antwort Puffer für die Verdichtung Freier Platz - In diesem Chat wurde noch keine Datei geschrieben. - Im Hintergrund läuft nichts. Helfer, Befehle und die Mitglieder eines Teams erscheinen hier, solange sie arbeiten. + Im Hintergrund läuft nichts. Subagenten, Befehle und die Mitglieder eines Teams erscheinen hier, solange sie arbeiten. Nichts läuft. - 1 Agent arbeitet - %1$s Agenten arbeiten + Läuft + Beendet + %1$s laufen + %1$s darunter + Subagent + Befehl + Teammitglied + %1$s bis zur automatischen Verdichtung + Automatische Verdichtung ist aus. + Zusammenfassen %1$s in der Warteschlange %1$s warten %1$s beendet @@ -97,15 +104,15 @@ %1$s stoppen? Was bisher getan wurde, bleibt. Noch nichts gesagt. Vom System - Team: %1$s von %2$s Agenten + Team: %1$s von %2$s Subagenten Raum Im Raum wurde noch nichts gesagt. Bericht - Agenten + Subagenten Mindestens Höchstens - Der eigene Agent eingeschlossen. Bei mehr als einem kann er Mitglieder hinzufügen, die die Arbeit machen, während er sie leitet. - Agenten %1$s–%2$s + Die wenigsten und die meisten für diesen Chat, sein eigener Agent eingeschlossen. Ab zwei kann er Arbeit an Subagenten abgeben und sie leiten. + Subagenten %1$s–%2$s Vor der Antwort nachdenken aus Standard diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index abc0047..b60a73c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -76,11 +76,18 @@ Desde la última respuesta Reserva para la compactación Espacio libre - Todavía no se ha escrito ningún archivo en este chat. - No hay nada en segundo plano. Los ayudantes, los comandos y los miembros de un equipo aparecen aquí mientras trabajan. + No hay nada en segundo plano. Los subagentes, los comandos y los miembros de un equipo aparecen aquí mientras trabajan. Nada en marcha. - 1 agente trabajando - %1$s agentes trabajando + En ejecución + Terminadas + %1$s en curso + %1$s debajo + Subagente + Comando + Miembro del equipo + %1$s hasta la compactación automática + La compactación automática está desactivada. + Compactar %1$s en cola %1$s esperando %1$s terminados @@ -97,15 +104,15 @@ ¿Detener %1$s? Lo que ha hecho hasta ahora se queda. Todavía no ha dicho nada. Del sistema - Equipo: %1$s de %2$s agentes + Equipo: %1$s de %2$s subagentes Sala Todavía no se ha dicho nada en la sala. informe - Agentes + Subagentes Mínimo Máximo - Su propio agente incluido. Con más de uno, puede añadir miembros que hagan el trabajo mientras los dirige. - Agentes %1$s–%2$s + El mínimo y el máximo para este chat, incluido su propio agente. Por encima de uno, puede repartir trabajo entre subagentes y dirigirlos. + Subagentes %1$s–%2$s Razonar antes de responder desactivado predeterminado diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0c08fab..704ddc0 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -76,11 +76,18 @@ Depuis la dernière réponse Réserve de compactage Espace libre - Aucun fichier n’a encore été écrit dans cette conversation. - Rien ne tourne en arrière-plan. Les assistants, les commandes et les membres d’une équipe s’affichent ici pendant qu’ils travaillent. + Rien ne tourne en arrière-plan. Les sous-agents, les commandes et les membres d\'une équipe apparaissent ici pendant qu\'ils travaillent. Rien en cours. - 1 agent au travail - %1$s agents au travail + En cours + Terminées + %1$s en cours + %1$s en dessous + Sous-agent + Commande + Membre de l\'équipe + %1$s avant le compactage automatique + Le compactage automatique est désactivé. + Compacter %1$s en file d’attente %1$s en attente %1$s terminés @@ -97,15 +104,15 @@ Arrêter %1$s ? Ce qu’il a déjà fait reste. Rien de dit pour l’instant. Du système - Équipe : %1$s agents sur %2$s + Équipe : %1$s sur %2$s sous-agents Salle Rien n’a encore été dit dans la salle. rapport - Agents + Sous-agents Au moins Au plus - Son propre agent compris. Au-delà d’un, il peut ajouter des membres qui font le travail pendant qu’il les dirige. - Agents %1$s–%2$s + Le minimum et le maximum pour ce chat, son propre agent compris. Au-delà d\'un, il peut confier du travail à des sous-agents et les diriger. + Sous-agents %1$s–%2$s Réfléchir avant de répondre désactivé par défaut diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 0b4e016..e377c72 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -76,11 +76,18 @@ Az utolsó válasz óta Tömörítési tartalék Szabad hely - Ebben a csevegésben még nem íródott fájl. - A háttérben semmi sem fut. A segítők, a parancsok és egy csapat tagjai itt jelennek meg, amíg dolgoznak. + A háttérben semmi sem fut. Az alügynökök, a parancsok és a csapat tagjai itt látszanak, amíg dolgoznak. Semmi sem fut. - 1 ügynök dolgozik - %1$s ügynök dolgozik + Fut + Befejezve + %1$s fut + Alatta: %1$s + Alügynök + Parancs + Csapattag + %1$s az automatikus tömörítésig + Az automatikus tömörítés ki van kapcsolva. + Tömörítés %1$s sorban áll %1$s várakozik %1$s befejezve @@ -97,15 +104,15 @@ Leállítja: %1$s? Amit eddig elvégzett, megmarad. Még nem mondott semmit. A rendszertől - Csapat: %1$s / %2$s ügynök + Csapat: %1$s / %2$s alügynök Szoba A szobában még senki nem mondott semmit. jelentés - Ügynökök + Alügynökök Legalább Legfeljebb - A saját ügynökét is beleértve. Egynél több esetén tagokat vehet fel, akik elvégzik a munkát, amíg ő vezeti őket. - Ügynökök: %1$s–%2$s + A legkevesebb és a legtöbb ehhez a csevegéshez, a saját ügynökével együtt. Egy fölött munkát adhat alügynököknek, és vezeti őket. + Alügynökök %1$s–%2$s Gondolkodjon válasz előtt ki alapértelmezett diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 46931ff..bd8b566 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -76,11 +76,18 @@ Dall’ultima risposta Riserva per la compattazione Spazio libero - In questa chat non è ancora stato scritto alcun file. - Nulla è in esecuzione in background. Aiutanti, comandi e membri di una squadra compaiono qui mentre lavorano. + Niente in background. Subagenti, comandi e membri di un team compaiono qui mentre lavorano. Nulla in esecuzione. - 1 agente al lavoro - %1$s agenti al lavoro + In esecuzione + Terminate + %1$s in corso + %1$s sotto + Subagente + Comando + Membro del team + %1$s alla compattazione automatica + La compattazione automatica è disattivata. + Compatta %1$s in coda %1$s in attesa %1$s terminati @@ -97,15 +104,15 @@ Fermare %1$s? Ciò che ha fatto finora resta. Non ha ancora detto nulla. Dal sistema - Squadra: %1$s di %2$s agenti + Team: %1$s di %2$s subagenti Stanza Nella stanza non è ancora stato detto nulla. resoconto - Agenti + Subagenti Minimo Massimo - Il proprio agente compreso. Con più di uno, può aggiungere membri che fanno il lavoro mentre li guida. - Agenti %1$s–%2$s + Il minimo e il massimo per questa chat, compreso il suo agente. Sopra uno, può affidare lavoro a subagenti e guidarli. + Subagenti %1$s–%2$s Ragiona prima di rispondere disattivato predefinito diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index b260785..0d58236 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -76,11 +76,18 @@ Od ostatniej odpowiedzi Rezerwa na kompakcję Wolne miejsce - W tym czacie nie zapisano jeszcze żadnego pliku. - W tle nic nie działa. Pomocnicy, polecenia i członkowie zespołu pojawiają się tu, gdy pracują. + W tle nic nie działa. Subagenci, polecenia i członkowie zespołu pojawiają się tu, gdy pracują. Nic nie działa. - 1 agent pracuje - Pracujący agenci: %1$s + Działa + Zakończone + Działa: %1$s + Pod nim: %1$s + Subagent + Polecenie + Członek zespołu + %1$s do automatycznego kompaktowania + Automatyczne kompaktowanie jest wyłączone. + Streść W kolejce: %1$s Czeka: %1$s Zakończone: %1$s @@ -97,15 +104,15 @@ Zatrzymać %1$s? To, co już zrobił, zostaje. Jeszcze nic nie powiedział. Od systemu - Zespół: %1$s z %2$s agentów + Zespół: %1$s z %2$s subagentów Pokój W pokoju nikt jeszcze nic nie powiedział. raport - Agenci + Subagenci Najmniej Najwięcej - Wliczając własnego agenta. Przy więcej niż jednym może dodać członków, którzy wykonują pracę, gdy on nimi kieruje. - Agenci %1$s–%2$s + Najmniej i najwięcej dla tego czatu, łącznie z jego własnym agentem. Powyżej jednego może przekazywać pracę subagentom i nimi kierować. + Subagenci %1$s–%2$s Rozumuj przed odpowiedzią wył. domyślna diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 2ca42a4..c1df7eb 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -76,11 +76,18 @@ Od poslednej odpovede Rezerva na zhustenie Voľné miesto - V tomto chate sa zatiaľ nezapísal žiadny súbor. - Na pozadí nič nebeží. Pomocníci, príkazy a členovia tímu sa tu zobrazia, kým pracujú. + Na pozadí nič nebeží. Subagenti, príkazy a členovia tímu sa tu ukážu, kým pracujú. Nič nebeží. - 1 agent pracuje - Pracujúci agenti: %1$s + Beží + Dokončené + Beží: %1$s + Pod ním: %1$s + Subagent + Príkaz + Člen tímu + %1$s do automatického zhrnutia + Automatické zhrnutie je vypnuté. + Zhrnúť V rade: %1$s Čaká: %1$s Dokončené: %1$s @@ -97,15 +104,15 @@ Zastaviť %1$s? Čo doteraz urobil, zostane. Zatiaľ nič nepovedal. Od systému - Tím: %1$s z %2$s agentov + Tím: %1$s z %2$s subagentov Miestnosť V miestnosti zatiaľ nikto nič nepovedal. hlásenie - Agenti + Subagenti Najmenej Najviac - Vrátane vlastného agenta. Pri viac ako jednom môže pridať členov, ktorí robia prácu, kým ich vedie. - Agenti %1$s–%2$s + Najmenej a najviac pre tento chat, vrátane jeho vlastného agenta. Nad jedného môže odovzdávať prácu subagentom a viesť ich. + Subagenti %1$s–%2$s Premýšľať pred odpoveďou vypnuté predvolené diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3aec854..8f20c5b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -77,11 +77,18 @@ Since the last reply Compaction buffer Free space - No files written in this chat yet. - Nothing runs in the background. Helpers, commands and a team\'s members show here while they work. + Nothing runs in the background. Subagents, commands and a team\'s members show here while they work. Nothing running. - 1 agent working - %1$s agents working + Running + Finished + %1$s running + %1$s under it + Subagent + Command + Team member + %1$s until auto-compact + Auto-compact is off. + Compact %1$s queued %1$s waiting %1$s finished @@ -98,15 +105,15 @@ Stop %1$s? What it has done so far stays. Nothing said yet. From the system - Team: %1$s of %2$s agents + Team: %1$s of %2$s subagents Room Nothing has been said in the room yet. report - Agents + Subagents Fewest Most - Its own agent included. Above one, it can add members that do the work while it leads them. - Agents %1$s–%2$s + The fewest and most for this chat, its own agent included. Above one, it can hand work to subagents while it leads them. + Subagents %1$s–%2$s Think before answering off default diff --git a/app/src/test/java/eu/llembas/android/ActivityTest.kt b/app/src/test/java/eu/llembas/android/ActivityTest.kt index 981f6ae..af06627 100644 --- a/app/src/test/java/eu/llembas/android/ActivityTest.kt +++ b/app/src/test/java/eu/llembas/android/ActivityTest.kt @@ -143,10 +143,30 @@ class ActivityTest { @Test fun theStripCountsWhatIsGoing() { val summary = ActivitySummary(queued = 1, working = 3, waiting = 0, done = 4, finished = 4, active = 4, total = 8) - assertEquals(listOf("working" to 3, "queued" to 1), ActivityLogic.stripCounts(summary)) + assertEquals(listOf("working" to 3, "queued" to 1, "finished" to 4), ActivityLogic.stripCounts(summary)) assertTrue(ActivityLogic.stripCounts(ActivitySummary(done = 2, finished = 2)).isEmpty()) } + @Test + fun autoCompactIsCountedOnlyAgainstAKnownWindow() { + val context = read("activity", ActivityEnvelope.serializer()).activity.context!! + // 95 % of 128k is 121.6k; 41k used. + assertEquals(80_600, ActivityLogic.untilAutoCompact(context)) + assertEquals(0, ActivityLogic.untilAutoCompact(context.copy(used = 127_000))) + assertNull(ActivityLogic.untilAutoCompact(context.copy(threshold = 0))) + assertNull(ActivityLogic.untilAutoCompact(context.copy(limit = 0))) + } + + @Test + fun aTaskIsCalledByWhatItWasAskedToDo() { + val activity = read("activity", ActivityEnvelope.serializer()).activity + val (baker, command) = activity.agents + assertEquals("baker", ActivityLogic.title(baker)) + assertEquals("find mallorn leaves", ActivityLogic.title(baker.children[1])) + assertEquals("pytest", ActivityLogic.title(command)) + assertEquals(2, ActivityLogic.descendants(baker)) + } + @Test fun numbersAsTheServerWritesThem() { assertEquals("950", ActivityLogic.compactTokens(950)) @@ -167,10 +187,10 @@ class ActivityTest { val activity = read("activity", ActivityEnvelope.serializer()).activity val (baker, _) = activity.agents val wrapper = baker.children[0] - val helper = baker.children[1] + val subagent = baker.children[1] assertEquals(105L, ActivityLogic.elapsed(baker, readAtMillis = 1_000, nowMillis = 11_000)) assertEquals(0L, ActivityLogic.elapsed(wrapper, readAtMillis = 1_000, nowMillis = 11_000)) - assertEquals(12L, ActivityLogic.elapsed(helper, readAtMillis = 1_000, nowMillis = 11_000)) + assertEquals(12L, ActivityLogic.elapsed(subagent, readAtMillis = 1_000, nowMillis = 11_000)) } @Test diff --git a/app/src/test/java/eu/llembas/android/shots/Fakes.kt b/app/src/test/java/eu/llembas/android/shots/Fakes.kt index 91e0a83..d81f138 100644 --- a/app/src/test/java/eu/llembas/android/shots/Fakes.kt +++ b/app/src/test/java/eu/llembas/android/shots/Fakes.kt @@ -1,9 +1,13 @@ package eu.llembas.android.shots +import eu.llembas.android.api.ActivityAgent +import eu.llembas.android.api.ActivityEnvelope import eu.llembas.android.api.ActivitySummary +import eu.llembas.android.api.AgentStep import eu.llembas.android.api.AgentsSetting import eu.llembas.android.api.Attachment import eu.llembas.android.api.Chat +import eu.llembas.android.api.ContextPart import eu.llembas.android.api.LembasJson import eu.llembas.android.api.LinkedDevice import eu.llembas.android.api.LiveReply @@ -111,7 +115,61 @@ object Fakes { messages = listOf(question, answer, packing, packingAnswer), models = models, teamOffered = true, - summary = ActivitySummary(working = 2, active = 2, total = 2), + summary = ActivitySummary(working = 2, queued = 1, done = 4, finished = 4, active = 3, total = 7), + ) + + private val fixture = LembasJson.decodeFromString(ActivityEnvelope.serializer(), text("activity")).activity + + private fun job(id: String, type: String, role: String, brief: String, state: String, seconds: Int, stoppable: Boolean = true) = ActivityAgent( + kind = "job", + id = id, + type = type, + name = id, + role = role, + brief = brief, + state = state, + seconds = seconds, + model = if (type == "command") "" else "qwen", + agent = if (type == "command") "" else "explore", + manager = "lead", + stoppable = stoppable, + transcript = type != "command", + ) + + /** + * The activity sheet with everything in it, as the reference has it: a context two thirds + * free with auto-compact ahead, a team with a member under the lead, subagents and commands + * running, four finished, the room and no plan. + */ + val activity = fixture.copy( + summary = ActivitySummary(queued = 1, working = 4, done = 4, finished = 4, active = 5, total = 9), + agents = listOf( + fixture.agents[0].copy(seconds = 1_135, step = AgentStep(tool = "edit", label = "Edit", title = "recipe.md", running = true)), + job("job2", "subagent", "Find where the waybread recipe is used", "Search the notes for every use of the recipe", "working", 97), + job("job3", "command", "Run related test files", "pytest -q tests/test_bake.py", "working", 40), + fixture.agents[1].copy(role = "Relax status, rerun targeted tests", seconds = 39), + ) + listOf( + job("job4", "subagent", "Read the old packing list", "", "done", 64, stoppable = false), + job("job5", "command", "Lint the notes", "ruff check", "done", 12, stoppable = false), + job("job6", "subagent", "Check the weather on the pass", "", "error", 8, stoppable = false), + job("job7", "command", "Count the provisions", "wc -l list.md", "stopped", 3, stoppable = false), + ), + context = fixture.context!!.copy( + used = 41_200, + limit = 128_000, + percent = 32.2, + categories = listOf( + ContextPart("messages", 26_300, 20.5), + ContextPart("memory", 2_400, 1.9), + ContextPart("mcp_tools", 2_300, 1.8), + ContextPart("tools", 2_000, 1.6), + ContextPart("instructions", 1_300, 1.0), + ContextPart("system", 500, 0.4), + ContextPart("since", 200, 0.1), + ContextPart("buffer", 6_400, 5.0), + ContextPart("free", 80_400, 62.8), + ), + ), ) /** The last reply while it is being written: its tools done, its words coming in. */ diff --git a/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt b/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt index dd41ba9..e8acd83 100644 --- a/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt +++ b/app/src/test/java/eu/llembas/android/shots/ScreenShots.kt @@ -16,6 +16,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import eu.llembas.android.ui.chat.ActivityActions +import eu.llembas.android.ui.chat.ActivityContent import eu.llembas.android.ui.chat.ChatActions import eu.llembas.android.ui.chat.ChatContent import eu.llembas.android.ui.chat.ModelPickerContent @@ -42,6 +44,8 @@ private object NoChatActions : ChatActions private object NoDrawerActions : DrawerActions +private object NoActivityActions : ActivityActions + private object NoSettingsActions : SettingsActions /** @@ -127,6 +131,21 @@ class ScreenShots { shoot("12-schedule-run", Phone.Small) { RunContent(Fakes.run) } } + @Test + fun activity() { + val sheet: @Composable () -> Unit = { SheetOver { ActivityContent(Fakes.activity, readAt = 0, now = 0, actions = NoActivityActions) } } + val open: @Composable () -> Unit = { + SheetOver { ActivityContent(Fakes.activity, readAt = 0, now = 0, actions = NoActivityActions, unfolded = true) } + } + shoot("14-activity", content = sheet) + shoot("14-activity", Phone.Small, content = sheet) + shoot("14-activity", Phone.Small, fontScale = 1.5f, content = sheet) + shoot("15-activity-open", content = open) + shoot("16-activity-new-chat") { + SheetOver { ActivityContent(eu.llembas.android.api.Activity(), readAt = 0, now = 0, actions = NoActivityActions, canCompact = false) } + } + } + @Test fun schedulingModels() = shoot("13-scheduling-models") { SchedulingModelsContent(Fakes.schedulingModels) } } diff --git a/scripts/strings.py b/scripts/strings.py index 38c9d22..62dde3f 100755 --- a/scripts/strings.py +++ b/scripts/strings.py @@ -90,11 +90,18 @@ STRINGS: dict[str, str] = { "ctx_since": "Since the last reply", "ctx_buffer": "Compaction buffer", "ctx_free": "Free space", - "outputs_empty": "No files written in this chat yet.", - "tasks_empty": "Nothing runs in the background. Helpers, commands and a team's members show here while they work.", + "tasks_empty": "Nothing runs in the background. Subagents, commands and a team's members show here while they work.", "tasks_none_running": "Nothing running.", - "agents_one_working": "1 agent working", - "agents_n_working": "%1$s agents working", + "tasks_running": "Running", + "tasks_finished": "Finished", + "tasks_n_running": "%1$s running", + "tasks_nested": "%1$s under it", + "task_subagent": "Subagent", + "task_command": "Command", + "task_member": "Team member", + "activity_until_compact": "%1$s until auto-compact", + "activity_compact_off": "Auto-compact is off.", + "activity_compact": "Compact", "agents_n_queued": "%1$s queued", "agents_n_waiting": "%1$s waiting", "agents_n_finished": "%1$s finished", @@ -111,15 +118,15 @@ STRINGS: dict[str, str] = { "agent_stop_confirm": "Stop %1$s? What it has done so far stays.", "agent_nothing_yet": "Nothing said yet.", "agent_machine": "From the system", - "team_size": "Team: %1$s of %2$s agents", + "team_size": "Team: %1$s of %2$s subagents", "team_room": "Room", "room_empty": "Nothing has been said in the room yet.", "room_report": "report", - "team_agents": "Agents", + "team_agents": "Subagents", "team_fewest": "Fewest", "team_most": "Most", - "team_hint": "Its own agent included. Above one, it can add members that do the work while it leads them.", - "team_chip": "Agents %1$s–%2$s", + "team_hint": "The fewest and most for this chat, its own agent included. Above one, it can hand work to subagents while it leads them.", + "team_chip": "Subagents %1$s–%2$s", "thinking_switch": "Think before answering", "level_off": "off", "level_default": "default", @@ -287,12 +294,10 @@ STRINGS: dict[str, str] = { SERVER_ENGLISH: dict[str, str] = { "activity_used": "%(percent)s%% used", "activity_tools_offered": "%(n)s tools offered.", - "agents_n_working": "%(n)s agents working", "agents_n_queued": "%(n)s queued", "agents_n_waiting": "%(n)s waiting", "agents_n_finished": "%(n)s finished", "agent_steps": "%(steps)s steps, %(tools)s tools", "agent_stop": "Stop %(name)s", "agent_stop_member_confirm": "Stop %(name)s and the members under it? They leave the team.", - "team_size": "Team: %(size)s of %(max)s agents", } diff --git a/scripts/strings_own.json b/scripts/strings_own.json index 97c9fd0..271a898 100644 --- a/scripts/strings_own.json +++ b/scripts/strings_own.json @@ -1,6 +1,8 @@ { "cs": { "about_version": "LLeMbas pro Android %1$s", + "activity_compact_off": "Automatické shrnutí je vypnuté.", + "activity_until_compact": "%1$s do automatického shrnutí", "add_instance": "Přidat instanci", "agent_directory": "Složka na zařízení", "agent_directory_default": "jeho první složka", @@ -130,7 +132,17 @@ "suggest_plan_line": "výlet, týden nebo projekt", "suggest_write": "Napiš", "suggest_write_line": "e-mail, poznámku nebo příspěvek", - "team_chip": "Agenti %1$s–%2$s", + "task_command": "Příkaz", + "task_member": "Člen týmu", + "task_subagent": "Subagent", + "tasks_empty": "Na pozadí nic neběží. Subagenti, příkazy a členové týmu se tu ukážou, dokud pracují.", + "tasks_finished": "Dokončeno", + "tasks_n_running": "Běží: %1$s", + "tasks_nested": "Pod ním: %1$s", + "team_agents": "Subagenti", + "team_chip": "Subagenti %1$s–%2$s", + "team_hint": "Nejméně a nejvíce pro tento chat, včetně jeho vlastního agenta. Nad jednoho může předávat práci subagentům a vést je.", + "team_size": "Tým: %1$s z %2$s subagentů", "theme_moria": "Moria (temná)", "theme_shire": "Shire (světlý)", "theme_system": "Podle systému", @@ -152,6 +164,8 @@ }, "de": { "about_version": "LLeMbas für Android %1$s", + "activity_compact_off": "Automatische Verdichtung ist aus.", + "activity_until_compact": "%1$s bis zur automatischen Verdichtung", "add_instance": "Instanz hinzufügen", "agent_directory": "Ordner auf dem Gerät", "agent_directory_default": "seinem ersten Ordner", @@ -282,7 +296,17 @@ "suggest_plan_line": "eine Reise, eine Woche oder ein Projekt", "suggest_write": "Schreibe", "suggest_write_line": "eine E-Mail, eine Notiz oder einen Beitrag", - "team_chip": "Agenten %1$s–%2$s", + "task_command": "Befehl", + "task_member": "Teammitglied", + "task_subagent": "Subagent", + "tasks_empty": "Im Hintergrund läuft nichts. Subagenten, Befehle und die Mitglieder eines Teams erscheinen hier, solange sie arbeiten.", + "tasks_finished": "Beendet", + "tasks_n_running": "%1$s laufen", + "tasks_nested": "%1$s darunter", + "team_agents": "Subagenten", + "team_chip": "Subagenten %1$s–%2$s", + "team_hint": "Die wenigsten und die meisten für diesen Chat, sein eigener Agent eingeschlossen. Ab zwei kann er Arbeit an Subagenten abgeben und sie leiten.", + "team_size": "Team: %1$s von %2$s Subagenten", "theme_moria": "Moria (dunkel)", "theme_shire": "Shire (hell)", "theme_system": "Wie das System", @@ -304,6 +328,8 @@ }, "es": { "about_version": "LLeMbas para Android %1$s", + "activity_compact_off": "La compactación automática está desactivada.", + "activity_until_compact": "%1$s hasta la compactación automática", "add_instance": "Añadir una instancia", "agent_directory": "Carpeta en el dispositivo", "agent_directory_default": "su primera carpeta", @@ -433,7 +459,17 @@ "suggest_plan_line": "un viaje, una semana o un proyecto", "suggest_write": "Escribe", "suggest_write_line": "un correo, una nota o una publicación", - "team_chip": "Agentes %1$s–%2$s", + "task_command": "Comando", + "task_member": "Miembro del equipo", + "task_subagent": "Subagente", + "tasks_empty": "No hay nada en segundo plano. Los subagentes, los comandos y los miembros de un equipo aparecen aquí mientras trabajan.", + "tasks_finished": "Terminadas", + "tasks_n_running": "%1$s en curso", + "tasks_nested": "%1$s debajo", + "team_agents": "Subagentes", + "team_chip": "Subagentes %1$s–%2$s", + "team_hint": "El mínimo y el máximo para este chat, incluido su propio agente. Por encima de uno, puede repartir trabajo entre subagentes y dirigirlos.", + "team_size": "Equipo: %1$s de %2$s subagentes", "theme_moria": "Moria (oscuro)", "theme_shire": "Shire (claro)", "theme_system": "Como el sistema", @@ -455,6 +491,8 @@ }, "fr": { "about_version": "LLeMbas pour Android %1$s", + "activity_compact_off": "Le compactage automatique est désactivé.", + "activity_until_compact": "%1$s avant le compactage automatique", "add_instance": "Ajouter une instance", "agent_directory": "Dossier sur l'appareil", "agent_directory_default": "son premier dossier", @@ -585,7 +623,17 @@ "suggest_plan_line": "un voyage, une semaine ou un projet", "suggest_write": "Rédige", "suggest_write_line": "un e-mail, une note ou un billet", - "team_chip": "Agents %1$s–%2$s", + "task_command": "Commande", + "task_member": "Membre de l'équipe", + "task_subagent": "Sous-agent", + "tasks_empty": "Rien ne tourne en arrière-plan. Les sous-agents, les commandes et les membres d'une équipe apparaissent ici pendant qu'ils travaillent.", + "tasks_finished": "Terminées", + "tasks_n_running": "%1$s en cours", + "tasks_nested": "%1$s en dessous", + "team_agents": "Sous-agents", + "team_chip": "Sous-agents %1$s–%2$s", + "team_hint": "Le minimum et le maximum pour ce chat, son propre agent compris. Au-delà d'un, il peut confier du travail à des sous-agents et les diriger.", + "team_size": "Équipe : %1$s sur %2$s sous-agents", "theme_moria": "Moria (sombre)", "theme_shire": "Shire (clair)", "theme_system": "Comme le système", @@ -607,6 +655,8 @@ }, "hu": { "about_version": "LLeMbas Androidra %1$s", + "activity_compact_off": "Az automatikus tömörítés ki van kapcsolva.", + "activity_until_compact": "%1$s az automatikus tömörítésig", "add_instance": "Példány hozzáadása", "agent_directory": "Mappa az eszközön", "agent_directory_default": "az első mappája", @@ -737,7 +787,17 @@ "suggest_plan_line": "egy utat, egy hetet vagy egy projektet", "suggest_write": "Írj", "suggest_write_line": "e-mailt, jegyzetet vagy bejegyzést", - "team_chip": "Ügynökök: %1$s–%2$s", + "task_command": "Parancs", + "task_member": "Csapattag", + "task_subagent": "Alügynök", + "tasks_empty": "A háttérben semmi sem fut. Az alügynökök, a parancsok és a csapat tagjai itt látszanak, amíg dolgoznak.", + "tasks_finished": "Befejezve", + "tasks_n_running": "%1$s fut", + "tasks_nested": "Alatta: %1$s", + "team_agents": "Alügynökök", + "team_chip": "Alügynökök %1$s–%2$s", + "team_hint": "A legkevesebb és a legtöbb ehhez a csevegéshez, a saját ügynökével együtt. Egy fölött munkát adhat alügynököknek, és vezeti őket.", + "team_size": "Csapat: %1$s / %2$s alügynök", "theme_moria": "Moria (sötét)", "theme_shire": "Shire (világos)", "theme_system": "A rendszer szerint", @@ -759,6 +819,8 @@ }, "it": { "about_version": "LLeMbas per Android %1$s", + "activity_compact_off": "La compattazione automatica è disattivata.", + "activity_until_compact": "%1$s alla compattazione automatica", "add_instance": "Aggiungi un'istanza", "agent_directory": "Cartella sul dispositivo", "agent_directory_default": "la sua prima cartella", @@ -888,7 +950,17 @@ "suggest_plan_line": "un viaggio, una settimana o un progetto", "suggest_write": "Scrivi", "suggest_write_line": "un’email, una nota o un post", - "team_chip": "Agenti %1$s–%2$s", + "task_command": "Comando", + "task_member": "Membro del team", + "task_subagent": "Subagente", + "tasks_empty": "Niente in background. Subagenti, comandi e membri di un team compaiono qui mentre lavorano.", + "tasks_finished": "Terminate", + "tasks_n_running": "%1$s in corso", + "tasks_nested": "%1$s sotto", + "team_agents": "Subagenti", + "team_chip": "Subagenti %1$s–%2$s", + "team_hint": "Il minimo e il massimo per questa chat, compreso il suo agente. Sopra uno, può affidare lavoro a subagenti e guidarli.", + "team_size": "Team: %1$s di %2$s subagenti", "theme_moria": "Moria (scuro)", "theme_shire": "Shire (chiaro)", "theme_system": "Come il sistema", @@ -910,6 +982,8 @@ }, "pl": { "about_version": "LLeMbas na Androida %1$s", + "activity_compact_off": "Automatyczne kompaktowanie jest wyłączone.", + "activity_until_compact": "%1$s do automatycznego kompaktowania", "add_instance": "Dodaj instancję", "agent_directory": "Folder na urządzeniu", "agent_directory_default": "jego pierwszym folderze", @@ -1039,7 +1113,17 @@ "suggest_plan_line": "podróż, tydzień lub projekt", "suggest_write": "Napisz", "suggest_write_line": "e-mail, notatkę lub wpis", - "team_chip": "Agenci %1$s–%2$s", + "task_command": "Polecenie", + "task_member": "Członek zespołu", + "task_subagent": "Subagent", + "tasks_empty": "W tle nic nie działa. Subagenci, polecenia i członkowie zespołu pojawiają się tu, gdy pracują.", + "tasks_finished": "Zakończone", + "tasks_n_running": "Działa: %1$s", + "tasks_nested": "Pod nim: %1$s", + "team_agents": "Subagenci", + "team_chip": "Subagenci %1$s–%2$s", + "team_hint": "Najmniej i najwięcej dla tego czatu, łącznie z jego własnym agentem. Powyżej jednego może przekazywać pracę subagentom i nimi kierować.", + "team_size": "Zespół: %1$s z %2$s subagentów", "theme_moria": "Moria (ciemny)", "theme_shire": "Shire (jasny)", "theme_system": "Jak system", @@ -1061,6 +1145,8 @@ }, "sk": { "about_version": "LLeMbas pre Android %1$s", + "activity_compact_off": "Automatické zhrnutie je vypnuté.", + "activity_until_compact": "%1$s do automatického zhrnutia", "add_instance": "Pridať inštanciu", "agent_directory": "Zložka v zariadení", "agent_directory_default": "jeho prvý priečinok", @@ -1190,7 +1276,17 @@ "suggest_plan_line": "výlet, týždeň alebo projekt", "suggest_write": "Napíš", "suggest_write_line": "e-mail, poznámku alebo príspevok", - "team_chip": "Agenti %1$s–%2$s", + "task_command": "Príkaz", + "task_member": "Člen tímu", + "task_subagent": "Subagent", + "tasks_empty": "Na pozadí nič nebeží. Subagenti, príkazy a členovia tímu sa tu ukážu, kým pracujú.", + "tasks_finished": "Dokončené", + "tasks_n_running": "Beží: %1$s", + "tasks_nested": "Pod ním: %1$s", + "team_agents": "Subagenti", + "team_chip": "Subagenti %1$s–%2$s", + "team_hint": "Najmenej a najviac pre tento chat, vrátane jeho vlastného agenta. Nad jedného môže odovzdávať prácu subagentom a viesť ich.", + "team_size": "Tím: %1$s z %2$s subagentov", "theme_moria": "Moria (tmavá)", "theme_shire": "Shire (svetlá)", "theme_system": "Podľa systému",