Phone actions: the confirm card and the capability (harness spec 3.6.0, server e463621)
CI / check (push) Canceled after 0s

- Contract and strings pinned at server dev e463621 (event_ask_phone.json); tokens unchanged.
- Every message declares client ["phone_actions"] (POST /chats and /chats/{id}/messages).
- CardItem.phone; a phone_action card (chat card sheet, and inline in the assistant's sheet):
  the model's summary, how it will be done, its facts, the map app to use when Settings leaves
  it open, Google Maps' limits said; Cancel answers declined, Do it runs ActionRunner and
  answers {result: {status, message}} -- done or failed with why. Locked: "unlock first".
- Executor on the spec's fields: alarm time HH:MM/days/label, timer, calendar_event
  (start/end local, notes), sms_draft (numbers only; names left to the person), email_draft
  with cc, dial, open_app by name, open_url, media command, torch on, settings_panel,
  automation_intent (Tasker's ACTION_TASK by name with values as local variables, else
  LLeMbas's own AUTOMATION broadcast), navigate (replace_route -> OsmAnd force), add_stop,
  search_nearby (near), stop_navigation. Tool-result reasons in English, for the model.
- Tests: PhoneActionsTest reads the fixture; shots 35-38 phone cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 16:51:32 +00:00
1 parent 9906554d09
commit f816919071
26 files changed
+944 -69

No files matched your search

+10
View File
@@ -31,6 +31,16 @@ is in alpha and releases come off `main`.
for you. Then ask the assistant about "my notifications", or tap its chip, and the
notifications on the phone right now go with that one question -- never before you ask, never
while the phone is locked, and the app keeps none of them.
- **Phone actions** (with LLeMbas server 2.0 and harness spec 3.6.0): a model may offer to do
something on this phone -- set an alarm or a timer, add a calendar event, draft a text or an
email, open the dialler with a number, start a route (with stops), add a stop, search nearby,
end the route, open an app or a web page, play/pause/skip, switch the torch, open a settings
panel, or run a Tasker task. A card says what will happen; nothing happens until you tap
**Do it**, never while the phone is locked, and drafts and calls are left for you to send and
place. The chat (and the assistant's sheet) tells the model whether it was done, declined or
failed. Navigation goes to Google Maps or **OsmAnd** (Settings › Navigation app: whichever is
installed, or ask); OsmAnd can also be asked where you are and where the running route goes,
once you allow LLeMbas inside OsmAnd.
- **Code in colour.** The file viewer highlights a source file by its language (as the server
names it), and a reply's code blocks by their fence's language: comments, strings, numbers,
keywords, type names, and markup's tags and attributes, in the theme's own colours in Shire
+3
View File
@@ -14,6 +14,8 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- Phone actions: an alarm or a timer, set through the clock app once the person confirms. -->
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<!-- Phone actions: run a Tasker task by its name (Tasker asks the person to allow it). -->
<uses-permission android:name="net.dinglisch.android.tasker.PERMISSION_RUN_TASKS" />
<queries>
<!-- UnifiedPush distributors (ntfy and others) are found by this action. -->
@@ -33,6 +35,7 @@
<package android:name="net.osmand.plus" />
<package android:name="net.osmand" />
<package android:name="net.osmand.dev" />
<package android:name="net.dinglisch.android.taskerm" />
</queries>
<application
@@ -32,12 +32,12 @@ object ActionRunner {
suspend fun run(context: Context, action: String, args: Args, nav: NavApp?, askOsmAnd: Boolean = false): ActionOutcome {
when (action) {
"torch" -> return PhoneActions.torch(context, args.bool("on"))
"media" -> return PhoneActions.media(context, args.str("key").ifBlank { "play_pause" })
"media" -> return PhoneActions.media(context, args.str("command").ifBlank { "toggle" })
"navigate", "add_stop", "search_nearby", "stop_navigation" -> return navigate(context, action, args, nav, askOsmAnd)
}
val intent = PhoneActions.intentFor(context, action, args)
?: return ActionOutcome(ActionStatus.Failed, NOT_POSSIBLE)
return PhoneActions.launch(context, intent, broadcast = action == "automation")
return PhoneActions.launch(context, intent, broadcast = action == "automation_intent")
}
private suspend fun navigate(context: Context, action: String, args: Args, nav: NavApp?, askOsmAnd: Boolean): ActionOutcome {
@@ -47,13 +47,24 @@ object ActionRunner {
// OsmAnd's own position and destination, if the person allowed LLeMbas to ask it.
val info = if (app == NavApp.OsmAnd && askOsmAnd && action != "stop_navigation") osmandInfo(context, pkg) else null
val step = when (action) {
"navigate" -> args.place("destination")?.let { NavIntents.navigate(app, pkg, it, args.places("stops"), travel, info) }
"navigate" -> args.place("destination")?.let {
NavIntents.navigate(app, pkg, it, args.places("stops"), travel, info, replace = args.bool("replace_route") == true)
}
"add_stop" -> args.place("stop")?.let {
NavIntents.addStop(app, pkg, it, args.place("destination"), travel, info, NO_DESTINATION)
}
"search_nearby" -> args.str("query").takeIf { it.isNotBlank() }?.let { NavIntents.searchNearby(app, pkg, it, info) }
"search_nearby" -> args.str("query").takeIf { it.isNotBlank() }?.let {
NavIntents.searchNearby(
app,
pkg,
it,
info,
alongRoute =
args.str("near") == "route",
)
}
else -> NavIntents.stop(app, pkg, GOOGLE_CANNOT_STOP)
} ?: return ActionOutcome(ActionStatus.Failed, NOT_POSSIBLE)
@@ -100,18 +100,25 @@ data class OsmAndInfo(val lat: Double?, val lon: Double?, val destination: Place
object NavIntents {
private const val GOOGLE_STOPS = 9
fun navigate(app: NavApp, pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?): NavStep = when (app) {
NavApp.GoogleMaps -> google(pkg, destination, stops, travel)
NavApp.OsmAnd -> osmand(pkg, destination, stops, travel, info)
}
/** [replace]: a route already running is replaced without the map app asking first (OsmAnd asks otherwise). */
fun navigate(app: NavApp, pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?, replace: Boolean = false): NavStep =
when (app) {
NavApp.GoogleMaps -> google(pkg, destination, stops, travel)
NavApp.OsmAnd -> osmand(pkg, destination, stops, travel, info, if (replace) "true" else "false")
}
/** A stop on the way to the route's destination ([destination] from the model, else OsmAnd's own). */
fun addStop(app: NavApp, pkg: String, stop: Place, destination: Place?, travel: Travel, info: OsmAndInfo?, noDestination: String): NavStep {
val to = destination?.takeIf { it.hasCoordinates || it.searchText.isNotBlank() } ?: info?.destination ?: return NavStep.Unsupported(noDestination)
return navigate(app, pkg, to, listOf(stop), travel, info)
// Planned again from here: the route being replaced is the one the person asked to change.
return navigate(app, pkg, to, listOf(stop), travel, info, replace = true)
}
fun searchNearby(app: NavApp, pkg: String, query: String, info: OsmAndInfo?): NavStep = when {
/**
* [alongRoute] searches near the running route; OsmAnd is given the phone's position for both
* (its search ranks along the route itself while one runs), Google Maps searches near here.
*/
fun searchNearby(app: NavApp, pkg: String, query: String, info: OsmAndInfo?, alongRoute: Boolean = false): NavStep = when {
app == NavApp.OsmAnd && info?.lat != null && info.lon != null -> NavStep.Launch(
osmandUri(
pkg,
@@ -152,12 +159,12 @@ object NavIntents {
private fun googlePlace(p: Place) = if (p.hasCoordinates) "${p.lat},${p.lon}" else p.searchText
private fun osmand(pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?): NavStep {
private fun osmand(pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?, force: String): NavStep {
val route = stops + destination
return when {
// Through stops: OsmAnd follows a route given as GPX, which needs every point's coordinates.
stops.isNotEmpty() && route.all { it.hasCoordinates } -> NavStep.Launch(
osmandUri(pkg, "navigate_gpx", "force" to "true").putExtra("data", gpx(route)),
osmandUri(pkg, "navigate_gpx", "force" to force).putExtra("data", gpx(route)),
)
stops.isNotEmpty() -> NavStep.Unsupported("")
@@ -170,7 +177,7 @@ object NavIntents {
"dest_lon" to destination.lon.toString(),
"dest_name" to destination.label,
"profile" to travel.osmand,
"force" to "true",
"force" to force,
),
)
@@ -184,7 +191,7 @@ object NavIntents {
"search_lat" to info.lat.toString(),
"search_lon" to info.lon.toString(),
"profile" to travel.osmand,
"force" to "true",
"force" to force,
),
)
@@ -20,6 +20,7 @@ import kotlinx.serialization.json.booleanOrNull
import kotlinx.serialization.json.doubleOrNull
import kotlinx.serialization.json.intOrNull
import kotlinx.serialization.json.longOrNull
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.ZoneId
@@ -45,6 +46,13 @@ class Args(val json: JsonObject) {
fun list(key: String): List<JsonElement> = (o[key] as? JsonArray).orEmpty()
/** A list of strings (or one string, which a model sometimes writes for a list of one). */
fun strings(key: String): List<String> = when (val v = o[key]) {
is JsonArray -> v.mapNotNull { (it as? JsonPrimitive)?.content?.trim()?.takeIf(String::isNotEmpty) }
is JsonPrimitive -> listOfNotNull(v.content.trim().takeIf { it.isNotEmpty() })
else -> emptyList()
}
fun place(key: String): Place? = when (val v = o[key]) {
is JsonObject -> placeOf(v)
is JsonPrimitive -> v.content.takeIf { it.isNotBlank() }?.let { Place(query = it) }
@@ -69,11 +77,13 @@ class Args(val json: JsonObject) {
)
}
/** A time the model wrote: ISO 8601 with an offset, or local (the phone's zone). */
/** A time the model wrote: `YYYY-MM-DDTHH:MM` in the phone's zone, `YYYY-MM-DD`, or with an offset. */
fun time(key: String): Long? {
val raw = str(key).ifBlank { return null }
return runCatching { OffsetDateTime.parse(raw).toInstant().toEpochMilli() }.getOrNull()
?: runCatching { LocalDateTime.parse(raw).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() }.getOrNull()
val zone = ZoneId.systemDefault()
return runCatching { LocalDateTime.parse(raw).atZone(zone).toInstant().toEpochMilli() }.getOrNull()
?: runCatching { LocalDate.parse(raw).atStartOfDay(zone).toInstant().toEpochMilli() }.getOrNull()
?: runCatching { OffsetDateTime.parse(raw).toInstant().toEpochMilli() }.getOrNull()
}
}
@@ -88,17 +98,16 @@ class Args(val json: JsonObject) {
* a phone number goes to the dialler and is never called.
*/
object PhoneActions {
/** Media keys the `media` action sends. */
/** Media keys, by the action's `command`. */
private val MEDIA = mapOf(
"play_pause" to KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE,
"toggle" to KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE,
"play" to KeyEvent.KEYCODE_MEDIA_PLAY,
"pause" to KeyEvent.KEYCODE_MEDIA_PAUSE,
"next" to KeyEvent.KEYCODE_MEDIA_NEXT,
"previous" to KeyEvent.KEYCODE_MEDIA_PREVIOUS,
"stop" to KeyEvent.KEYCODE_MEDIA_STOP,
)
/** Settings panels, by the action's name. Panels (Android 10+) float over the app; the rest are pages. */
/** Settings panels, by the action's `panel`. Panels (Android 10+) float over the app; the rest are pages. */
private val PANELS = mapOf(
"wifi" to Settings.Panel.ACTION_WIFI,
"internet" to Settings.Panel.ACTION_INTERNET_CONNECTIVITY,
@@ -106,39 +115,56 @@ object PhoneActions {
"volume" to Settings.Panel.ACTION_VOLUME,
"bluetooth" to Settings.ACTION_BLUETOOTH_SETTINGS,
"location" to Settings.ACTION_LOCATION_SOURCE_SETTINGS,
"display" to Settings.ACTION_DISPLAY_SETTINGS,
"battery" to Intent.ACTION_POWER_USAGE_SUMMARY,
"airplane" to Settings.ACTION_AIRPLANE_MODE_SETTINGS,
"do_not_disturb" to Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS,
)
/** A broadcast an automation app (Tasker, Automate, MacroDroid) listens for: never a system one. */
fun broadcastAllowed(action: String): Boolean =
action.isNotBlank() && action.length <= 200 && !action.startsWith("android.") && !action.startsWith("com.android.") &&
Regex("^[A-Za-z0-9_.]+$").matches(action)
/** Tasker's public intent for running a task by its name (its TaskerIntent protocol). */
const val TASKER_PACKAGE = "net.dinglisch.android.taskerm"
private const val TASKER_ACTION = "net.dinglisch.android.tasker.ACTION_TASK"
/** The broadcast any other automation app (Automate, MacroDroid, …) can listen for. */
const val AUTOMATION_ACTION = "eu.llembas.android.action.AUTOMATION"
/** A URL the phone may open for a model: web pages only. */
fun urlAllowed(url: String): Boolean = Uri.parse(url.trim()).scheme?.lowercase() in setOf("http", "https")
fun urlAllowed(url: String): Boolean = url.trim().lowercase().let {
(it.startsWith("http://") || it.startsWith("https://")) &&
it.substringAfter("://").isNotBlank()
}
/** `HH:MM` as hour and minute, or null. */
fun clock(time: String): Pair<Int, Int>? {
val m = Regex("^(\\d{1,2}):(\\d{2})$").matchEntire(time.trim()) ?: return null
val (h, min) = m.destructured
return (h.toInt() to min.toInt()).takeIf { it.first in 0..23 && it.second in 0..59 }
}
/** SMS recipients: the numbers among [to]; a name the messaging app has to find is left to the person. */
fun smsNumbers(to: List<String>): List<String> = to.map { it.trim() }.filter { Regex("^[+0-9 ()./#*-]{3,}$").matches(it) && it.count(Char::isDigit) >= 3 }
/**
* The intent for an action that is one intent (everything but navigation, the torch and media
* keys), or null when [action] is not one of these.
* keys), or null when [action] is not one of these or its arguments do not make one.
*/
fun intentFor(context: Context, action: String, a: Args): Intent? = when (action) {
"alarm" -> Intent(AlarmClock.ACTION_SET_ALARM)
.putExtra(AlarmClock.EXTRA_HOUR, a.int("hour") ?: 7)
.putExtra(AlarmClock.EXTRA_MINUTES, a.int("minute") ?: 0)
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
.apply {
val days = a.list("days").mapNotNull { (it as? JsonPrimitive)?.content?.let(::calendarDay) }
if (days.isNotEmpty()) putIntegerArrayListExtra(AlarmClock.EXTRA_DAYS, ArrayList(days))
}
"alarm" -> clock(a.str("time"))?.let { (hour, minute) ->
Intent(AlarmClock.ACTION_SET_ALARM)
.putExtra(AlarmClock.EXTRA_HOUR, hour)
.putExtra(AlarmClock.EXTRA_MINUTES, minute)
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
.apply {
val days = a.strings("days").mapNotNull(::calendarDay)
if (days.isNotEmpty()) putIntegerArrayListExtra(AlarmClock.EXTRA_DAYS, ArrayList(days))
}
}
"timer" -> Intent(AlarmClock.ACTION_SET_TIMER)
.putExtra(AlarmClock.EXTRA_LENGTH, (a.int("seconds") ?: 60).coerceIn(1, 86_400))
.putExtra(AlarmClock.EXTRA_SKIP_UI, false)
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
"timer" -> a.int("seconds")?.let { seconds ->
Intent(AlarmClock.ACTION_SET_TIMER)
.putExtra(AlarmClock.EXTRA_LENGTH, seconds.coerceIn(1, 86_400))
.putExtra(AlarmClock.EXTRA_SKIP_UI, false)
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
}
// The calendar's new-event screen, filled in: the person saves it.
"calendar_event" -> Intent(Intent.ACTION_INSERT, CalendarContract.Events.CONTENT_URI)
.putExtra(CalendarContract.Events.TITLE, a.str("title"))
.apply {
@@ -146,38 +172,47 @@ object PhoneActions {
a.time("end")?.let { putExtra(CalendarContract.EXTRA_EVENT_END_TIME, it) }
if (a.bool("all_day") == true) putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true)
a.str("location").takeIf { it.isNotBlank() }?.let { putExtra(CalendarContract.Events.EVENT_LOCATION, it) }
a.str("description").takeIf { it.isNotBlank() }?.let { putExtra(CalendarContract.Events.DESCRIPTION, it) }
a.str("notes").takeIf { it.isNotBlank() }?.let { putExtra(CalendarContract.Events.DESCRIPTION, it) }
}
"sms_draft" -> Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + Uri.encode(a.str("to"))))
// A draft: the messaging app opens with it, and the person sends.
"sms_draft" -> Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + smsNumbers(a.strings("to")).joinToString(";") { Uri.encode(it) }))
.putExtra("sms_body", a.str("body"))
"email_draft" -> Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"))
.putExtra(
Intent.EXTRA_EMAIL,
a.list("to").mapNotNull {
(it as? JsonPrimitive)?.content
}.ifEmpty { listOf(a.str("to")) }.filter { it.isNotBlank() }.toTypedArray(),
)
.putExtra(Intent.EXTRA_EMAIL, a.strings("to").toTypedArray())
.putExtra(Intent.EXTRA_CC, a.strings("cc").toTypedArray())
.putExtra(Intent.EXTRA_SUBJECT, a.str("subject"))
.putExtra(Intent.EXTRA_TEXT, a.str("body"))
// The dialler with the number in it: the person presses call.
// The dialler with the number in it: the person places the call.
"dial" -> Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + Uri.encode(a.str("number"))))
"open_url" -> a.str("url").trim().takeIf(::urlAllowed)?.let { Intent(Intent.ACTION_VIEW, Uri.parse(it)) }
"open_app" -> appIntent(context, a.str("package"), a.str("name"))
"open_app" -> appIntent(context, "", a.str("app"))
"settings_panel" -> PANELS[a.str("panel")]?.let { Intent(it) }
"automation" -> a.str("action").takeIf(::broadcastAllowed)?.let { name ->
Intent(name).apply {
a.str("package").takeIf { it.isNotBlank() }?.let { setPackage(it) }
a.obj("extras")?.let { extras ->
// Strings only: an automation app reads its variables as text.
extras.json.forEach { (k, v) -> (v as? JsonPrimitive)?.let { putExtra(k, it.content) } }
}
// Tasker (by default) runs the task by its name, the values as its local variables; any
// other automation app gets LLeMbas's own broadcast, with the task's name and the values.
"automation_intent" -> {
val task = a.str("task")
val app = a.str("app").trim()
val values = a.obj("values")?.json.orEmpty().mapNotNull { (k, v) -> (v as? JsonPrimitive)?.let { k to it.content } }
if (app.isBlank() || app.equals("tasker", ignoreCase = true)) {
Intent(TASKER_ACTION)
.setPackage(TASKER_PACKAGE)
.putExtra("version_number", "1.1")
.putExtra("task_name", task)
.putExtra("task_priority", 5)
.putStringArrayListExtra("varNames", ArrayList(values.map { "%" + it.first.lowercase() }))
.putStringArrayListExtra("varValues", ArrayList(values.map { it.second }))
} else {
Intent(AUTOMATION_ACTION)
.putExtra("task", task)
.putExtra("app", app)
.apply { values.forEach { (k, v) -> putExtra(k, v) } }
}
}
@@ -216,7 +251,7 @@ object PhoneActions {
/** A media key to whatever is playing. */
fun media(context: Context, key: String): ActionOutcome {
val code = MEDIA[key] ?: return ActionOutcome(ActionStatus.Failed, "unknown media key: $key")
val code = MEDIA[key] ?: return ActionOutcome(ActionStatus.Failed, "unknown media command: $key")
val audio = context.getSystemService(AudioManager::class.java) ?: return ActionOutcome(ActionStatus.Failed, "no audio")
audio.dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, code))
audio.dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_UP, code))
@@ -239,6 +239,7 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
agents?.let { put("agents", agentsJson(it)) }
put("temporary", temporary)
forceTool?.let { put("force_tool", it) }
put("client", CAPABILITIES)
// An agent chat runs on a linked device; an empty directory is the device's first
// allowed one. A device that is no longer linked makes it an ordinary chat on the
// server, rather than losing the message.
@@ -258,6 +259,7 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
put("text", text)
put("attachments", JsonArray(attachments.map { JsonPrimitive(it) }))
forceTool?.let { put("force_tool", it) }
put("client", CAPABILITIES)
},
)
@@ -513,6 +515,12 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
authed("$v2/chats/$chatId/messages/$messageId/stream").header("Accept", "text/event-stream").build()
companion object {
/**
* What this app can do, sent with every message (spec 3.6.0): the phone carries out
* `phone_action` calls the person confirms here, so the chat is offered the tool.
*/
private val CAPABILITIES = JsonArray(listOf(JsonPrimitive("phone_actions")))
/** 1 MB, the server's own limit on a shown file, with room for a little more. */
const val SHOWN_MAX_BYTES = 1_100_000L
@@ -544,6 +544,11 @@ data class CardItem(
val job: String = "",
/** The tree subagent asking (spec 3.4.0), for a call nobody in the tree may allow; null otherwise. */
val subagent: CardSubagent? = null,
/**
* A `phone_action` card's action (spec 3.6.0, `phone.md` §2): `action`, `summary` and the
* action's own fields, as the server checked them. Carried out by `actions/ActionRunner`.
*/
val phone: JsonObject? = null,
)
@Serializable
@@ -582,6 +587,8 @@ data class Job(
/** The answer to a card, as the page's form says it (see `api/v2/chats.py:answer`). */
@Serializable
data class CardAnswer(
/** A phone card's answer: what the phone did once the person confirmed or declined. */
val result: PhoneResult? = null,
val verdict: String = "",
val reason: String = "",
val choices: Map<String, List<String>> = emptyMap(),
@@ -589,6 +596,9 @@ data class CardAnswer(
val asks: Map<String, String> = emptyMap(),
)
@Serializable
data class PhoneResult(val status: String, val message: String = "")
@Serializable
data class PushKey(val key: String = "", val registered: Boolean = false)
@@ -10,6 +10,8 @@ import androidx.core.content.ContextCompat
import eu.llembas.android.MainActivity
import eu.llembas.android.R
import eu.llembas.android.api.ApiException
import eu.llembas.android.api.Card
import eu.llembas.android.api.CardAnswer
import eu.llembas.android.api.LiveReply
import eu.llembas.android.api.ModelInfo
import eu.llembas.android.api.Step
@@ -104,6 +106,7 @@ interface AssistActions {
fun stopReading() {}
fun endConversation() {}
fun summariseNotifications() {}
fun answerCard(card: Card, answer: CardAnswer) {}
}
/**
@@ -474,6 +477,21 @@ class AssistController(private val context: Context, private val scope: Coroutin
}
}
/** A phone action's card, answered in the sheet: what the phone did (spec 3.6.0). */
override fun answerCard(card: Card, answer: CardAnswer) {
val chat = _state.value.chatId ?: return
scope.launch {
try {
context.lembas.instances.client()?.answer(chat, card.id, answer)
} catch (e: ApiException) {
// First answer wins: a 409 is somebody answering elsewhere already.
if (e.status != 409) _state.update { it.copy(error = context.explain(e)) }
} catch (e: Exception) {
_state.update { it.copy(error = context.explain(e)) }
}
}
}
override fun newChat() {
following?.cancel()
speaker.stop()
@@ -91,6 +91,7 @@ import androidx.compose.ui.unit.dp
import eu.llembas.android.R
import eu.llembas.android.ui.ModelAvatar
import eu.llembas.android.ui.ProgressStatus
import eu.llembas.android.ui.chat.PhoneCard
import eu.llembas.android.ui.chat.Steps
import eu.llembas.android.ui.progressLineOf
import eu.llembas.android.ui.theme.LocalPalette
@@ -481,6 +482,11 @@ private fun Turn(turn: AssistTurn, last: Boolean, state: AssistUiState, actions:
val reply = turn.reply
val drawsProgress = reply != null && (progressLineOf(reply.progress) != null || reply.status.isNotBlank())
when {
// A phone action is confirmed here, where the phone is; any other card in the app.
reply != null && reply.cards.any { it.kind == "phone_action" } -> reply.cards.first { it.kind == "phone_action" }.let { card ->
PhoneCard(card) { answer -> actions.answerCard(card, answer) }
}
reply != null && reply.cards.isNotEmpty() -> TextButton(onClick = onOpenApp) { Text(stringResource(R.string.assist_answer_in_app)) }
turn.writing && drawsProgress -> ProgressStatus(reply?.progress, reply?.status.orEmpty(), MaterialTheme.typography.labelSmall, palette.inkFaint)
@@ -58,6 +58,7 @@ fun CardSheet(card: Card, onAnswer: (CardAnswer) -> Unit) {
}
when (card.kind) {
"approval" -> Approval(card, onAnswer)
"phone_action" -> PhoneCard(card, onAnswer)
"plan" -> PlanCard(card, onAnswer)
else -> Questions(card, onAnswer)
}
@@ -0,0 +1,250 @@
package eu.llembas.android.ui.chat
import android.app.KeyguardManager
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.PhoneAndroid
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import eu.llembas.android.R
import eu.llembas.android.actions.ActionRunner
import eu.llembas.android.actions.Args
import eu.llembas.android.actions.NavApp
import eu.llembas.android.api.Card
import eu.llembas.android.api.CardAnswer
import eu.llembas.android.api.PhoneResult
import eu.llembas.android.auth.Prefs
import eu.llembas.android.lembas
import eu.llembas.android.ui.theme.LocalPalette
import kotlinx.coroutines.launch
import kotlinx.serialization.json.JsonArray
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
/** The actions a map app carries out. */
val NAV_ACTIONS = setOf("navigate", "add_stop", "search_nearby", "stop_navigation")
/** What the card shows of a phone card while it is being carried out. */
data class PhoneCardState(val running: Boolean = false, val locked: Boolean = false, val error: String? = null)
/**
* A `phone_action` card (spec 3.6.0) with the phone behind it: Do it carries the action out
* ([ActionRunner]) and answers what happened -- done, or failed and why; Cancel answers declined.
* Never while the phone is locked: Do it says to unlock first. Used by the chat's card sheet and
* by the assistant's sheet alike.
*/
@Composable
fun PhoneCard(card: Card, onAnswer: (CardAnswer) -> Unit) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
val prefs by context.lembas.instances.prefs.collectAsState(initial = Prefs())
val installed = remember { NavApp.installedApps(context) }
var state by remember(card.id) { mutableStateOf(PhoneCardState()) }
val item = card.items.firstOrNull() ?: return
val phone = item.phone ?: JsonObject(emptyMap())
PhoneCardContent(
phone = phone,
navApps = installed,
chosen = NavApp.chosen(prefs.navApp, installed),
state = state,
onDo = { app ->
if (context.getSystemService(KeyguardManager::class.java).isKeyguardLocked) {
state = state.copy(locked = true)
return@PhoneCardContent
}
state = PhoneCardState(running = true)
scope.launch {
val action = (phone["action"] as? JsonPrimitive)?.content.orEmpty()
val outcome = ActionRunner.run(context, action, Args(phone), app, askOsmAnd = prefs.osmandInfo)
state = PhoneCardState(error = outcome.message.takeIf { outcome.status.wire == "failed" })
onAnswer(CardAnswer(result = PhoneResult(outcome.status.wire, outcome.message)))
}
},
onDecline = { onAnswer(CardAnswer(result = PhoneResult("declined"))) },
)
}
/**
* The card from its state alone (what the screenshot tests draw): the phone's icon and "Do this
* on your phone?", the model's one line ([phone]'s `summary`), how it will be done and its facts,
* the map app to use when Settings leaves it open ([chosen] null, more than one installed), and
* Cancel / Do it -- each at least 48 dp, the line above them free to wrap.
*/
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun PhoneCardContent(
phone: JsonObject,
navApps: List<NavApp>,
chosen: NavApp?,
state: PhoneCardState,
onDo: (NavApp?) -> Unit = {},
onDecline: () -> Unit = {},
) {
val palette = LocalPalette.current
val action = (phone["action"] as? JsonPrimitive)?.content.orEmpty()
val summary = (phone["summary"] as? JsonPrimitive)?.content.orEmpty().ifBlank { action }
val nav = action in NAV_ACTIONS
var picked by remember(chosen) { mutableStateOf(chosen ?: navApps.singleOrNull()) }
Surface(
shape = RoundedCornerShape(20.dp),
color = palette.surfaceRaised,
border = BorderStroke(1.dp, palette.border),
modifier = Modifier.fillMaxWidth(),
) {
Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {
Icon(Icons.Filled.PhoneAndroid, contentDescription = null, tint = palette.accent, modifier = Modifier.size(20.dp))
Spacer(Modifier.width(10.dp))
Text(stringResource(R.string.action_card_title), style = MaterialTheme.typography.labelLarge, color = palette.accent)
}
Text(summary, style = MaterialTheme.typography.titleMedium)
Text(howLine(action, picked), style = MaterialTheme.typography.bodyMedium, color = palette.inkMuted)
phoneFacts(phone).takeIf { it.isNotBlank() }?.let {
Text(it, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted)
}
if (nav && chosen == null && navApps.size > 1) {
Text(stringResource(R.string.nav_app_pick), style = MaterialTheme.typography.labelMedium, color = palette.inkMuted)
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
navApps.forEach { app ->
FilterChip(
selected = picked == app,
onClick = { picked = app },
label = { Text(stringResource(if (app == NavApp.OsmAnd) R.string.nav_app_osmand else R.string.nav_app_google)) },
colors = FilterChipDefaults.filterChipColors(selectedContainerColor = palette.accentSoft),
modifier = Modifier.heightIn(min = 40.dp),
)
}
}
}
if (nav && picked == NavApp.GoogleMaps && action in setOf("add_stop", "stop_navigation")) {
Text(
stringResource(if (action == "add_stop") R.string.action_google_add_stop else R.string.action_google_no_stop),
style = MaterialTheme.typography.bodySmall,
color = palette.warning,
)
}
when {
state.locked -> Text(stringResource(R.string.action_unlock), style = MaterialTheme.typography.bodyMedium, color = palette.warning)
state.error != null -> Text(
stringResource(R.string.action_failed, state.error),
style = MaterialTheme.typography.bodyMedium,
color = palette.danger,
)
}
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.CenterVertically) {
TextButton(onClick = onDecline, enabled = !state.running, modifier = Modifier.heightIn(min = 48.dp)) { Text(stringResource(R.string.cancel)) }
Spacer(Modifier.width(8.dp))
Button(
onClick = { onDo(picked) },
enabled = !state.running && (!nav || picked != null),
colors = ButtonDefaults.buttonColors(containerColor = palette.accent, contentColor = palette.accentInk),
modifier = Modifier.heightIn(min = 48.dp),
) { Text(stringResource(if (state.running) R.string.action_running else R.string.action_do)) }
}
}
}
}
/** How the action will be done, in a sentence: which kind of app, and what is left to the person. */
@Composable
private fun howLine(action: String, app: NavApp?): String = when (action) {
"alarm", "timer" -> stringResource(R.string.action_line_clock)
"calendar_event" -> stringResource(R.string.action_line_calendar)
"sms_draft", "email_draft" -> stringResource(R.string.action_line_draft)
"dial" -> stringResource(R.string.action_line_dial)
"navigate", "add_stop", "search_nearby", "stop_navigation" ->
stringResource(
R.string.action_line_map,
stringResource(
if (app ==
NavApp.OsmAnd
) {
R.string.nav_app_osmand
} else if (app == NavApp.GoogleMaps) {
R.string.nav_app_google
} else {
R.string.nav_app
},
),
)
"media", "torch" -> stringResource(R.string.action_line_now)
"settings_panel" -> stringResource(R.string.action_line_settings)
"automation_intent" -> stringResource(R.string.action_line_automation)
else -> stringResource(R.string.action_line_open)
}
/**
* The action's facts as one line, values only, in the order the spec lists the fields: what the
* person checks before Do it ("07:00 · mon tue wed thu fri · Work"). A place is its name and,
* when it has one, what the map app will search, or its coordinates.
*/
fun phoneFacts(phone: JsonObject): String {
fun place(e: JsonElement?): String? {
val o = e as? JsonObject ?: return (e as? JsonPrimitive)?.content
val name = (o["name"] as? JsonPrimitive)?.content.orEmpty()
val query = (o["query"] as? JsonPrimitive)?.content.orEmpty()
val lat = (o["lat"] as? JsonPrimitive)?.content
val lon = (o["lon"] as? JsonPrimitive)?.content
val where = query.ifBlank { if (lat != null && lon != null) "$lat, $lon" else "" }
return listOf(name, where).filter { it.isNotBlank() }.distinct().let {
if (it.size == 2) "${it[0]} (${it[1]})" else it.firstOrNull()
}
}
fun value(key: String, e: JsonElement?): String? = when {
e == null -> null
key in setOf("destination", "stop") -> place(e)
key == "stops" -> (e as? JsonArray)?.mapNotNull { place(it) }?.joinToString(" → ")?.ifBlank { null }
e is JsonArray -> e.mapNotNull { (it as? JsonPrimitive)?.content }.joinToString(" ").ifBlank { null }
e is JsonObject -> e.entries.joinToString(", ") { (k, v) -> "$k=${(v as? JsonPrimitive)?.content.orEmpty()}" }.ifBlank { null }
e is JsonPrimitive -> e.content.takeIf { it.isNotBlank() && it != "false" && it != "true" }
else -> null
}
return FACT_ORDER.mapNotNull { key -> value(key, phone[key]) }.joinToString(" · ")
}
private val FACT_ORDER = listOf(
"time", "days", "seconds", "label", "title", "start", "end", "location", "to", "cc", "subject", "number",
"stops", "stop", "destination", "mode", "query", "near", "app", "url", "command", "panel", "task", "values",
)
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Ptát se OsmAnd na trasu</string>
<string name="osmand_info_line">Umožní „přidat zastávku“ a hledání v okolí i u trasy nastavené přímo v OsmAnd: LLeMbas se OsmAnd zeptá, kde jste a kam trasa vede. Nejdřív LLeMbas povolte v OsmAnd (připojené aplikace, s polohou); OsmAnd dá vědět, pokud povoleno není.</string>
<string name="phone_actions_line">Model může nabídnout, že v telefonu něco udělá — nastaví budík, přidá událost, připraví zprávu, spustí trasu. Nic se nestane, dokud neklepnete na Provést na jeho kartě, a nikdy při zamčeném telefonu. Mapy Google spustí trasu s několika zastávkami, ale do běžící trasy zastávku nepřidají ani je nelze zastavit; OsmAnd to umí.</string>
<string name="action_card_title">Udělat to v telefonu?</string>
<string name="action_do">Provést</string>
<string name="action_running">Provádím…</string>
<string name="action_unlock">Nejdřív odemkněte telefon, pak klepněte na Provést.</string>
<string name="action_failed">Nepovedlo se: %1$s</string>
<string name="nav_app_pick">Ve které mapové aplikaci?</string>
<string name="action_google_add_stop">Mapy Google nepřidají zastávku do běžící trasy: spustí trasu znovu, přes zastávku.</string>
<string name="action_google_no_stop">Mapy Google nelze zastavit zvenčí: trasu ukončete v nich.</string>
<string name="action_line_clock">Nastaví to aplikace Hodiny.</string>
<string name="action_line_calendar">Otevře se kalendář s vyplněnou událostí; uložíte ji vy.</string>
<string name="action_line_draft">Otevře koncept; odešlete ho sami.</string>
<string name="action_line_dial">Otevře se vytáčení s číslem; hovor zahájíte vy.</string>
<string name="action_line_map">Trasu převezme %1$s.</string>
<string name="action_line_now">Stane se hned.</string>
<string name="action_line_settings">Otevře nastavení; změníte ho vy.</string>
<string name="action_line_automation">Spustí vaši automatizaci (Tasker, pokud není uvedena jiná aplikace).</string>
<string name="action_line_open">Otevře to.</string>
<string name="assist_recogniser_failed">Rozpoznávání řeči v telefonu se zastavilo. Zkuste to znovu nebo zvolte LLeMbas v Nastavení › Hlasový vstup.</string>
<string name="assistant_listens">Začít poslouchat, když se asistent otevře</string>
<string name="voice_input">Hlasový vstup</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">OsmAnd nach der Route fragen</string>
<string name="osmand_info_line">Damit „Zwischenstopp hinzufügen“ und die Suche in der Nähe auch mit einer in OsmAnd geplanten Route gehen: LLeMbas fragt OsmAnd, wo du bist und wohin die Route führt. Erlaube LLeMbas zuerst in OsmAnd (verbundene Apps, mit Standort); OsmAnd sagt Bescheid, wenn es nicht erlaubt ist.</string>
<string name="phone_actions_line">Ein Modell kann anbieten, etwas auf diesem Telefon zu tun — einen Wecker stellen, einen Termin eintragen, eine Nachricht entwerfen, eine Route starten. Nichts passiert, bevor du auf seiner Karte auf Ausführen tippst, und nie bei gesperrtem Telefon. Google Maps startet eine Route mit ein paar Stopps, kann aber keinen in eine laufende Route einfügen und nicht angehalten werden; OsmAnd kann das.</string>
<string name="action_card_title">Das auf deinem Telefon tun?</string>
<string name="action_do">Ausführen</string>
<string name="action_running">Wird ausgeführt…</string>
<string name="action_unlock">Entsperre zuerst das Telefon und tippe dann auf Ausführen.</string>
<string name="action_failed">Hat nicht geklappt: %1$s</string>
<string name="nav_app_pick">Mit welcher Karten-App?</string>
<string name="action_google_add_stop">Google Maps kann keinen Stopp in eine laufende Route einfügen: Es startet die Route neu, über den Stopp.</string>
<string name="action_google_no_stop">Google Maps lässt sich nicht von außen anhalten: Beende die Route dort.</string>
<string name="action_line_clock">Die Uhr-App stellt es ein.</string>
<string name="action_line_calendar">Der Kalender öffnet sich mit dem ausgefüllten Termin; du speicherst ihn.</string>
<string name="action_line_draft">Öffnet einen Entwurf; du sendest ihn selbst.</string>
<string name="action_line_dial">Die Telefon-App öffnet sich mit der Nummer; du rufst an.</string>
<string name="action_line_map">%1$s übernimmt die Route.</string>
<string name="action_line_now">Passiert sofort.</string>
<string name="action_line_settings">Öffnet die Einstellung; du änderst sie.</string>
<string name="action_line_automation">Startet deine Automatisierung (Tasker, wenn keine andere App genannt ist).</string>
<string name="action_line_open">Öffnet es.</string>
<string name="assist_recogniser_failed">Die Spracherkennung des Telefons hat angehalten. Versuchen Sie es erneut oder wählen Sie LLeMbas unter Einstellungen › Spracheingabe.</string>
<string name="assistant_listens">Beim Öffnen des Assistenten zuhören</string>
<string name="voice_input">Spracheingabe</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Preguntar a OsmAnd por la ruta</string>
<string name="osmand_info_line">Permite «añadir una parada» y buscar cerca de ti con una ruta creada en el propio OsmAnd: LLeMbas pregunta a OsmAnd dónde estás y adónde va la ruta. Primero permite LLeMbas en OsmAnd (apps conectadas, con ubicación); OsmAnd te avisa si no está permitido.</string>
<string name="phone_actions_line">Un modelo puede ofrecer hacer cosas en este teléfono: poner una alarma, añadir un evento, redactar un mensaje, iniciar una ruta. No pasa nada hasta que tocas Hacerlo en su tarjeta, y nunca con el teléfono bloqueado. Google Maps inicia una ruta con unas pocas paradas, pero no puede añadir una a una ruta en curso ni detenerse a petición; OsmAnd sí.</string>
<string name="action_card_title">¿Hacer esto en tu teléfono?</string>
<string name="action_do">Hacerlo</string>
<string name="action_running">Haciéndolo…</string>
<string name="action_unlock">Desbloquea primero el teléfono y luego toca Hacerlo.</string>
<string name="action_failed">No funcionó: %1$s</string>
<string name="nav_app_pick">¿Con qué app de mapas?</string>
<string name="action_google_add_stop">Google Maps no puede añadir una parada a una ruta en curso: vuelve a iniciar la ruta, pasando por la parada.</string>
<string name="action_google_no_stop">A Google Maps no se le puede pedir que pare: termina la ruta allí.</string>
<string name="action_line_clock">La app de reloj lo programa.</string>
<string name="action_line_calendar">El calendario se abre con el evento rellenado; tú lo guardas.</string>
<string name="action_line_draft">Abre un borrador; lo envías tú.</string>
<string name="action_line_dial">El marcador se abre con el número; tú haces la llamada.</string>
<string name="action_line_map">%1$s se encarga de la ruta.</string>
<string name="action_line_now">Ocurre al instante.</string>
<string name="action_line_settings">Abre el ajuste; tú lo cambias.</string>
<string name="action_line_automation">Ejecuta tu automatización (Tasker salvo que se indique otra app).</string>
<string name="action_line_open">Lo abre.</string>
<string name="assist_recogniser_failed">El reconocimiento de voz del teléfono se detuvo. Inténtelo de nuevo o elija LLeMbas en Ajustes › Entrada de voz.</string>
<string name="assistant_listens">Empezar a escuchar al abrir el asistente</string>
<string name="voice_input">Entrada de voz</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Demander l’itinéraire à OsmAnd</string>
<string name="osmand_info_line">Permet « ajouter un arrêt » et la recherche à proximité avec un itinéraire créé dans OsmAnd même : LLeMbas demande à OsmAnd où vous êtes et où va l’itinéraire. Autorisez d’abord LLeMbas dans OsmAnd (apps connectées, avec la position) ; OsmAnd vous prévient sinon.</string>
<string name="phone_actions_line">Un modèle peut proposer de faire des choses sur ce téléphone : régler une alarme, ajouter un événement, rédiger un message, lancer un itinéraire. Rien ne se passe tant que vous ne touchez pas Le faire sur sa carte, et jamais téléphone verrouillé. Google Maps lance un itinéraire avec quelques arrêts mais ne peut ni en ajouter à un itinéraire en cours ni être arrêté ; OsmAnd le peut.</string>
<string name="action_card_title">Faire ceci sur votre téléphone ?</string>
<string name="action_do">Le faire</string>
<string name="action_running">En cours…</string>
<string name="action_unlock">Déverrouillez d’abord le téléphone, puis touchez Le faire.</string>
<string name="action_failed">Cela n’a pas marché : %1$s</string>
<string name="nav_app_pick">Avec quelle app de cartes ?</string>
<string name="action_google_add_stop">Google Maps ne peut pas ajouter d’arrêt à un itinéraire en cours : il relance l’itinéraire, par l’arrêt.</string>
<string name="action_google_no_stop">On ne peut pas dire à Google Maps d’arrêter : terminez l’itinéraire dans l’app.</string>
<string name="action_line_clock">L’app Horloge le règle.</string>
<string name="action_line_calendar">Le calendrier s’ouvre avec l’événement rempli ; vous l’enregistrez.</string>
<string name="action_line_draft">Ouvre un brouillon ; vous l’envoyez vous-même.</string>
<string name="action_line_dial">Le clavier s’ouvre avec le numéro ; vous lancez l’appel.</string>
<string name="action_line_map">%1$s prend l’itinéraire.</string>
<string name="action_line_now">Se fait aussitôt.</string>
<string name="action_line_settings">Ouvre le réglage ; vous le changez.</string>
<string name="action_line_automation">Lance votre automatisation (Tasker sauf si une autre app est nommée).</string>
<string name="action_line_open">L’ouvre.</string>
<string name="assist_recogniser_failed">La reconnaissance vocale du téléphone s’est arrêtée. Réessayez, ou choisissez LLeMbas dans Réglages › Saisie vocale.</string>
<string name="assistant_listens">Écouter dès l’ouverture de l’assistant</string>
<string name="voice_input">Saisie vocale</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Útvonal lekérdezése az OsmAndtól</string>
<string name="osmand_info_line">Így a „megálló hozzáadása” és a közeli keresés az OsmAndban beállított útvonallal is működik: a LLeMbas megkérdezi az OsmAndot, hol vagy és hová tart az útvonal. Előbb engedélyezd a LLeMbast az OsmAndban (csatlakoztatott alkalmazások, helyadattal); az OsmAnd szól, ha nincs engedélyezve.</string>
<string name="phone_actions_line">Egy modell felajánlhatja, hogy tesz valamit ezen a telefonon — ébresztőt állít, eseményt vesz fel, üzenetet fogalmaz, útvonalat indít. Semmi sem történik, amíg a kártyáján nem koppintasz a Mehet gombra, és zárolt telefonnál soha. A Google Térkép néhány megállós útvonalat indít, de futó útvonalhoz nem ad megállót és nem állítható le; az OsmAnd igen.</string>
<string name="action_card_title">Megtegyem ezt a telefonodon?</string>
<string name="action_do">Mehet</string>
<string name="action_running">Folyamatban…</string>
<string name="action_unlock">Előbb oldd fel a telefont, aztán koppints a Mehet gombra.</string>
<string name="action_failed">Nem sikerült: %1$s</string>
<string name="nav_app_pick">Melyik térképalkalmazással?</string>
<string name="action_google_add_stop">A Google Térkép nem tud megállót adni egy futó útvonalhoz: újraindítja az útvonalat a megállón át.</string>
<string name="action_google_no_stop">A Google Térképet nem lehet kívülről leállítani: ott fejezd be az útvonalat.</string>
<string name="action_line_clock">Az Óra alkalmazás beállítja.</string>
<string name="action_line_calendar">Megnyílik a naptár a kitöltött eseménnyel; te mented el.</string>
<string name="action_line_draft">Megnyit egy piszkozatot; te küldöd el.</string>
<string name="action_line_dial">Megnyílik a tárcsázó a számmal; te indítod a hívást.</string>
<string name="action_line_map">Az útvonalat a(z) %1$s kapja.</string>
<string name="action_line_now">Azonnal megtörténik.</string>
<string name="action_line_settings">Megnyitja a beállítást; te módosítod.</string>
<string name="action_line_automation">Lefuttatja az automatizálásodat (Tasker, ha nincs más alkalmazás megadva).</string>
<string name="action_line_open">Megnyitja.</string>
<string name="assist_recogniser_failed">A telefon beszédfelismerője leállt. Próbálja újra, vagy válassza a LLeMbast a Beállítások › Hangbevitel alatt.</string>
<string name="assistant_listens">Hallgatás indítása az asszisztens megnyitásakor</string>
<string name="voice_input">Hangbevitel</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Chiedi il percorso a OsmAnd</string>
<string name="osmand_info_line">Permette «aggiungi una tappa» e la ricerca nelle vicinanze anche con un percorso impostato in OsmAnd: LLeMbas chiede a OsmAnd dove sei e dove va il percorso. Prima consenti LLeMbas in OsmAnd (app collegate, con posizione); OsmAnd ti avvisa se non è consentito.</string>
<string name="phone_actions_line">Un modello può offrirsi di fare cose su questo telefono: impostare una sveglia, aggiungere un evento, preparare un messaggio, avviare un percorso. Non succede nulla finché non tocchi Fallo sulla sua scheda, e mai a telefono bloccato. Google Maps avvia un percorso con alcune tappe ma non può aggiungerne a un percorso in corso né essere fermato; OsmAnd sì.</string>
<string name="action_card_title">Farlo sul tuo telefono?</string>
<string name="action_do">Fallo</string>
<string name="action_running">In corso…</string>
<string name="action_unlock">Sblocca prima il telefono, poi tocca Fallo.</string>
<string name="action_failed">Non ha funzionato: %1$s</string>
<string name="nav_app_pick">Con quale app di mappe?</string>
<string name="action_google_add_stop">Google Maps non può aggiungere una tappa a un percorso in corso: riavvia il percorso passando per la tappa.</string>
<string name="action_google_no_stop">Non si può dire a Google Maps di fermarsi: termina il percorso lì.</string>
<string name="action_line_clock">Lo imposta l’app Orologio.</string>
<string name="action_line_calendar">Il calendario si apre con l’evento compilato; lo salvi tu.</string>
<string name="action_line_draft">Apre una bozza; la invii tu.</string>
<string name="action_line_dial">Il tastierino si apre con il numero; la chiamata la fai tu.</string>
<string name="action_line_map">Il percorso va a %1$s.</string>
<string name="action_line_now">Avviene subito.</string>
<string name="action_line_settings">Apre l’impostazione; la cambi tu.</string>
<string name="action_line_automation">Esegue la tua automazione (Tasker se non è indicata un’altra app).</string>
<string name="action_line_open">Lo apre.</string>
<string name="assist_recogniser_failed">Il riconoscimento vocale del telefono si è fermato. Riprovi, oppure scelga LLeMbas in Impostazioni › Input vocale.</string>
<string name="assistant_listens">Inizia ad ascoltare all’apertura dell’assistente</string>
<string name="voice_input">Input vocale</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Pytaj OsmAnd o trasę</string>
<string name="osmand_info_line">Pozwala „dodać przystanek” i szukać w pobliżu także przy trasie ustawionej w samym OsmAnd: LLeMbas pyta OsmAnd, gdzie jesteś i dokąd prowadzi trasa. Najpierw zezwól LLeMbas w OsmAnd (połączone aplikacje, z lokalizacją); OsmAnd poinformuje, jeśli nie ma zgody.</string>
<string name="phone_actions_line">Model może zaproponować zrobienie czegoś na tym telefonie — ustawienie budzika, dodanie wydarzenia, szkic wiadomości, start trasy. Nic się nie dzieje, dopóki nie dotkniesz Zrób to na jego karcie, i nigdy przy zablokowanym telefonie. Mapy Google uruchomią trasę z kilkoma przystankami, ale nie dodadzą przystanku do trwającej trasy ani nie dadzą się zatrzymać; OsmAnd potrafi.</string>
<string name="action_card_title">Zrobić to na telefonie?</string>
<string name="action_do">Zrób to</string>
<string name="action_running">Robię to…</string>
<string name="action_unlock">Najpierw odblokuj telefon, potem dotknij Zrób to.</string>
<string name="action_failed">Nie udało się: %1$s</string>
<string name="nav_app_pick">W której aplikacji map?</string>
<string name="action_google_add_stop">Mapy Google nie dodadzą przystanku do trwającej trasy: uruchomią trasę od nowa, przez przystanek.</string>
<string name="action_google_no_stop">Map Google nie da się zatrzymać z zewnątrz: zakończ trasę w nich.</string>
<string name="action_line_clock">Ustawi to aplikacja Zegar.</string>
<string name="action_line_calendar">Kalendarz otworzy się z wypełnionym wydarzeniem; Ty je zapiszesz.</string>
<string name="action_line_draft">Otwiera szkic; wysyłasz go sam.</string>
<string name="action_line_dial">Otworzy się wybieranie z numerem; połączenie rozpoczniesz Ty.</string>
<string name="action_line_map">Trasę przejmie %1$s.</string>
<string name="action_line_now">Dzieje się od razu.</string>
<string name="action_line_settings">Otwiera ustawienie; Ty je zmieniasz.</string>
<string name="action_line_automation">Uruchamia Twoją automatyzację (Tasker, chyba że podano inną aplikację).</string>
<string name="action_line_open">Otwiera to.</string>
<string name="assist_recogniser_failed">Rozpoznawanie mowy w telefonie przestało działać. Spróbuj ponownie albo wybierz LLeMbas w Ustawienia › Wprowadzanie głosowe.</string>
<string name="assistant_listens">Zacznij słuchać po otwarciu asystenta</string>
<string name="voice_input">Wprowadzanie głosowe</string>
+17
View File
@@ -436,6 +436,23 @@
<string name="osmand_info">Pýtať sa OsmAnd na trasu</string>
<string name="osmand_info_line">Umožní „pridať zastávku“ a hľadanie v okolí aj pri trase nastavenej priamo v OsmAnd: LLeMbas sa OsmAnd opýta, kde ste a kam trasa vedie. Najprv LLeMbas povoľte v OsmAnd (pripojené aplikácie, s polohou); OsmAnd dá vedieť, ak povolené nie je.</string>
<string name="phone_actions_line">Model môže ponúknuť, že v telefóne niečo urobí — nastaví budík, pridá udalosť, pripraví správu, spustí trasu. Nič sa nestane, kým neťuknete na Urobiť na jeho karte, a nikdy pri zamknutom telefóne. Mapy Google spustia trasu s niekoľkými zastávkami, ale do bežiacej trasy zastávku nepridajú ani sa nedajú zastaviť; OsmAnd to vie.</string>
<string name="action_card_title">Urobiť to v telefóne?</string>
<string name="action_do">Urobiť</string>
<string name="action_running">Robím to…</string>
<string name="action_unlock">Najprv odomknite telefón, potom ťuknite na Urobiť.</string>
<string name="action_failed">Nepodarilo sa: %1$s</string>
<string name="nav_app_pick">V ktorej mapovej aplikácii?</string>
<string name="action_google_add_stop">Mapy Google nepridajú zastávku do bežiacej trasy: spustia trasu znova, cez zastávku.</string>
<string name="action_google_no_stop">Mapy Google sa nedajú zastaviť zvonka: trasu ukončite v nich.</string>
<string name="action_line_clock">Nastaví to aplikácia Hodiny.</string>
<string name="action_line_calendar">Otvorí sa kalendár s vyplnenou udalosťou; uložíte ju vy.</string>
<string name="action_line_draft">Otvorí koncept; odošlete ho sami.</string>
<string name="action_line_dial">Otvorí sa vytáčanie s číslom; hovor začnete vy.</string>
<string name="action_line_map">Trasu prevezme %1$s.</string>
<string name="action_line_now">Stane sa hneď.</string>
<string name="action_line_settings">Otvorí nastavenie; zmeníte ho vy.</string>
<string name="action_line_automation">Spustí vašu automatizáciu (Tasker, ak nie je uvedená iná aplikácia).</string>
<string name="action_line_open">Otvorí to.</string>
<string name="assist_recogniser_failed">Rozpoznávanie reči v telefóne sa zastavilo. Skúste to znova alebo zvoľte LLeMbas v Nastaveniach › Hlasový vstup.</string>
<string name="assistant_listens">Začať počúvať, keď sa asistent otvorí</string>
<string name="voice_input">Hlasový vstup</string>
+17
View File
@@ -438,6 +438,23 @@
<string name="osmand_info">Ask OsmAnd about the route</string>
<string name="osmand_info_line">Lets “add a stop” and searches near you work with a route you set up in OsmAnd itself: LLeMbas asks OsmAnd where you are and where the route goes. Allow LLeMbas in OsmAnd first (its connected apps, with Location); OsmAnd tells you if it is not allowed.</string>
<string name="phone_actions_line">A model may offer to do things on this phone — set an alarm, add an event, draft a message, start a route. Nothing happens until you tap Do it on its card, and never while the phone is locked. Google Maps starts a route with a few stops but cannot add one to a route already running or be told to stop; OsmAnd can.</string>
<string name="action_card_title">Do this on your phone?</string>
<string name="action_do">Do it</string>
<string name="action_running">Doing it…</string>
<string name="action_unlock">Unlock the phone first, then tap Do it.</string>
<string name="action_failed">It did not work: %1$s</string>
<string name="nav_app_pick">With which map app?</string>
<string name="action_google_add_stop">Google Maps cannot add a stop to a running route: it starts the route again, through the stop.</string>
<string name="action_google_no_stop">Google Maps cannot be told to stop: end the route there.</string>
<string name="action_line_clock">The clock app sets it.</string>
<string name="action_line_calendar">The calendar opens with the event filled in; you save it.</string>
<string name="action_line_draft">Opens a draft; you send it yourself.</string>
<string name="action_line_dial">The dialler opens with the number; you place the call.</string>
<string name="action_line_map">%1$s takes the route.</string>
<string name="action_line_now">Happens at once.</string>
<string name="action_line_settings">Opens the setting; you change it.</string>
<string name="action_line_automation">Runs your automation (Tasker unless another app is named).</string>
<string name="action_line_open">Opens it.</string>
<string name="assist_recogniser_failed">The phone\'s speech recogniser stopped. Try again, or choose LLeMbas under Settings › Voice input.</string>
<string name="assistant_listens">Start listening when the assistant opens</string>
<string name="voice_input">Voice input</string>
@@ -5,7 +5,11 @@ import eu.llembas.android.actions.NavApp
import eu.llembas.android.actions.NavIntents
import eu.llembas.android.actions.PhoneActions
import eu.llembas.android.actions.Place
import eu.llembas.android.api.AskFrame
import eu.llembas.android.api.CardAnswer
import eu.llembas.android.api.LembasJson
import eu.llembas.android.api.PhoneResult
import eu.llembas.android.ui.chat.phoneFacts
import kotlinx.serialization.json.jsonObject
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
@@ -44,11 +48,31 @@ class PhoneActionsTest {
}
@Test
fun aBroadcastNeverNamesASystemAction() {
assertTrue(PhoneActions.broadcastAllowed("net.dinglisch.android.tasker.ACTION_TASK"))
assertTrue(PhoneActions.broadcastAllowed("lembas.lights_off"))
assertFalse(PhoneActions.broadcastAllowed("android.intent.action.BOOT_COMPLETED"))
assertFalse(PhoneActions.broadcastAllowed("com.android.something"))
assertFalse(PhoneActions.broadcastAllowed("has spaces"))
fun clockTimesAndNumbersAreCheckedAgain() {
assertEquals(7 to 5, PhoneActions.clock("07:05"))
assertNull(PhoneActions.clock("24:00"))
assertNull(PhoneActions.clock("7 am"))
// A name the messaging app would have to find is left out: the person picks the contact.
assertEquals(listOf("+421 900 123 456"), PhoneActions.smsNumbers(listOf("+421 900 123 456", "Sam")))
assertTrue(PhoneActions.urlAllowed("HTTPS://example.org"))
assertFalse(PhoneActions.urlAllowed("javascript:alert(1)"))
assertFalse(PhoneActions.urlAllowed("https://"))
}
@Test
fun theCardSaysWhatWillHappenFromTheContract() {
val frame = requireNotNull(javaClass.classLoader!!.getResource("event_ask_phone.json")).readText()
val cards = LembasJson.decodeFromString(AskFrame.serializer(), frame).cards
assertEquals(listOf("phone_action"), cards.map { it.kind }.distinct())
val phones = cards.map { requireNotNull(it.items.single().phone) }
assertEquals("07:00 · mon tue wed thu fri · Work", phoneFacts(phones[0]))
assertEquals("Bakery (48.894, 18.044) · Home (1 Bagshot Row, Hobbiton) · drive", phoneFacts(phones[1]))
assertEquals("Bakery (Bakery, Bywater) · Home (1 Bagshot Row, Hobbiton)", phoneFacts(phones[2]))
assertEquals("", phoneFacts(phones[3]))
// The answer the server reads: {"result": {"status", "message"}}, nothing else.
assertEquals(
"""{"result":{"status":"done","message":"ok"}}""",
LembasJson.encodeToString(CardAnswer.serializer(), CardAnswer(result = PhoneResult("done", "ok"))),
)
}
}
@@ -27,6 +27,7 @@ import com.github.takahirom.roborazzi.captureRoboImage
import com.github.takahirom.roborazzi.inspectionMode
import com.github.takahirom.roborazzi.size
import eu.llembas.android.R
import eu.llembas.android.actions.NavApp
import eu.llembas.android.assist.AssistActions
import eu.llembas.android.assist.AssistSheetContent
import eu.llembas.android.assist.AssistSheetFrame
@@ -41,6 +42,8 @@ import eu.llembas.android.ui.chat.ChatActions
import eu.llembas.android.ui.chat.ChatContent
import eu.llembas.android.ui.chat.CodeBlock
import eu.llembas.android.ui.chat.ModelPickerContent
import eu.llembas.android.ui.chat.PhoneCardContent
import eu.llembas.android.ui.chat.PhoneCardState
import eu.llembas.android.ui.chat.TuneContent
import eu.llembas.android.ui.chat.modelId
import eu.llembas.android.ui.home.ArchivedActions
@@ -320,6 +323,27 @@ class ScreenShots {
}
}
/**
* The phone_action cards as the server's contract has them (`event_ask_phone.json`): an
* alarm, a route through a stop with both map apps to choose from, a stop added in Google
* Maps (its limit said), and the phone still locked.
*/
@Test
fun phoneActions() {
val frame = requireNotNull(javaClass.classLoader!!.getResource("event_ask_phone.json")).readText()
val phones = eu.llembas.android.api.LembasJson.decodeFromString(eu.llembas.android.api.AskFrame.serializer(), frame).cards
.map { requireNotNull(it.items.single().phone) }
val both = listOf(NavApp.GoogleMaps, NavApp.OsmAnd)
val card: (Int, NavApp?, PhoneCardState) -> @Composable () -> Unit = { i, chosen, state ->
{ Column(Modifier.fillMaxSize().padding(16.dp)) { PhoneCardContent(phones[i], both, chosen, state) } }
}
shoot("35-phone-alarm", content = card(0, null, PhoneCardState()))
shoot("35-phone-alarm", Phone.Small, fontScale = 1.5f, content = card(0, null, PhoneCardState()))
shoot("36-phone-navigate-pick", content = card(1, null, PhoneCardState()))
shoot("37-phone-add-stop-google", content = card(2, NavApp.GoogleMaps, PhoneCardState()))
shoot("38-phone-stop-locked", content = card(3, NavApp.OsmAnd, PhoneCardState(locked = true)))
}
/** "Ask LLeMbas" from another app's share menu: a link, and a picture with a file. */
@Test
fun share() {
+162
View File
@@ -0,0 +1,162 @@
{
"cards": [
{
"id": "card5",
"kind": "phone_action",
"why": "",
"dismissable": true,
"expires_in": null,
"items": [
{
"index": 0,
"key": "phone",
"kind": "phone_action",
"tool": "phone_action",
"title": "Alarm at 07:00 on weekdays",
"header": "",
"detail": "alarm",
"reason": "",
"purpose": "",
"options": [],
"multiple": false,
"free_text": false,
"editable": false,
"plan": null,
"mode_choice": false,
"job": "",
"subagent": null,
"phone": {
"action": "alarm",
"summary": "Alarm at 07:00 on weekdays",
"time": "07:00",
"days": [
"mon",
"tue",
"wed",
"thu",
"fri"
],
"label": "Work"
}
}
]
},
{
"id": "card6",
"kind": "phone_action",
"why": "",
"dismissable": true,
"expires_in": null,
"items": [
{
"index": 0,
"key": "phone",
"kind": "phone_action",
"tool": "phone_action",
"title": "Drive home via the bakery",
"header": "",
"detail": "navigate",
"reason": "",
"purpose": "",
"options": [],
"multiple": false,
"free_text": false,
"editable": false,
"plan": null,
"mode_choice": false,
"job": "",
"subagent": null,
"phone": {
"action": "navigate",
"summary": "Drive home via the bakery",
"destination": {
"name": "Home",
"query": "1 Bagshot Row, Hobbiton"
},
"stops": [
{
"name": "Bakery",
"lat": 48.894,
"lon": 18.044
}
],
"mode": "drive",
"replace_route": false
}
}
]
},
{
"id": "card7",
"kind": "phone_action",
"why": "",
"dismissable": true,
"expires_in": null,
"items": [
{
"index": 0,
"key": "phone",
"kind": "phone_action",
"tool": "phone_action",
"title": "Add the bakery to the route",
"header": "",
"detail": "add_stop",
"reason": "",
"purpose": "",
"options": [],
"multiple": false,
"free_text": false,
"editable": false,
"plan": null,
"mode_choice": false,
"job": "",
"subagent": null,
"phone": {
"action": "add_stop",
"summary": "Add the bakery to the route",
"stop": {
"name": "Bakery",
"query": "Bakery, Bywater"
},
"destination": {
"name": "Home",
"query": "1 Bagshot Row, Hobbiton"
}
}
}
]
},
{
"id": "card8",
"kind": "phone_action",
"why": "",
"dismissable": true,
"expires_in": null,
"items": [
{
"index": 0,
"key": "phone",
"kind": "phone_action",
"tool": "phone_action",
"title": "End the route",
"header": "",
"detail": "stop_navigation",
"reason": "",
"purpose": "",
"options": [],
"multiple": false,
"free_text": false,
"editable": false,
"plan": null,
"mode_choice": false,
"job": "",
"subagent": null,
"phone": {
"action": "stop_navigation",
"summary": "End the route"
}
}
]
}
]
}
+3 -3
View File
@@ -1,5 +1,5 @@
{
"ref": "v2.0.0-beta.9",
"commit": "3b7da5fc7ac72d5de9229919793dd299c03da6a8",
"sha256": "08565486a9707bf7f11a7e5baeae16fbae38598d89975c5ad6c8178cd066a6c5"
"ref": "e46362176d6421aca2488f9cd16400457cfaa82b",
"commit": "e46362176d6421aca2488f9cd16400457cfaa82b",
"sha256": "d82cfc3a93ec70127c6bdff1a1b0f564d4276428ffc6ffb7a66cf13bfe746acd"
}
+17
View File
@@ -463,6 +463,23 @@ STRINGS: dict[str, str] = {
"osmand_info": "Ask OsmAnd about the route",
"osmand_info_line": "Lets “add a stop” and searches near you work with a route you set up in OsmAnd itself: LLeMbas asks OsmAnd where you are and where the route goes. Allow LLeMbas in OsmAnd first (its connected apps, with Location); OsmAnd tells you if it is not allowed.",
"phone_actions_line": "A model may offer to do things on this phone — set an alarm, add an event, draft a message, start a route. Nothing happens until you tap Do it on its card, and never while the phone is locked. Google Maps starts a route with a few stops but cannot add one to a route already running or be told to stop; OsmAnd can.",
"action_card_title": "Do this on your phone?",
"action_do": "Do it",
"action_running": "Doing it…",
"action_unlock": "Unlock the phone first, then tap Do it.",
"action_failed": "It did not work: %1$s",
"nav_app_pick": "With which map app?",
"action_google_add_stop": "Google Maps cannot add a stop to a running route: it starts the route again, through the stop.",
"action_google_no_stop": "Google Maps cannot be told to stop: end the route there.",
"action_line_clock": "The clock app sets it.",
"action_line_calendar": "The calendar opens with the event filled in; you save it.",
"action_line_draft": "Opens a draft; you send it yourself.",
"action_line_dial": "The dialler opens with the number; you place the call.",
"action_line_map": "%1$s takes the route.",
"action_line_now": "Happens at once.",
"action_line_settings": "Opens the setting; you change it.",
"action_line_automation": "Runs your automation (Tasker unless another app is named).",
"action_line_open": "Opens it.",
"assist_recogniser_failed": "The phone's speech recogniser stopped. Try again, or choose LLeMbas under Settings › Voice input.",
"assistant_listens": "Start listening when the assistant opens",
"voice_input": "Voice input",
+136
View File
@@ -1,6 +1,22 @@
{
"cs": {
"about_version": "LLeMbas pro Android %1$s",
"action_card_title": "Udělat to v telefonu?",
"action_do": "Provést",
"action_failed": "Nepovedlo se: %1$s",
"action_google_add_stop": "Mapy Google nepřidají zastávku do běžící trasy: spustí trasu znovu, přes zastávku.",
"action_google_no_stop": "Mapy Google nelze zastavit zvenčí: trasu ukončete v nich.",
"action_line_automation": "Spustí vaši automatizaci (Tasker, pokud není uvedena jiná aplikace).",
"action_line_calendar": "Otevře se kalendář s vyplněnou událostí; uložíte ji vy.",
"action_line_clock": "Nastaví to aplikace Hodiny.",
"action_line_dial": "Otevře se vytáčení s číslem; hovor zahájíte vy.",
"action_line_draft": "Otevře koncept; odešlete ho sami.",
"action_line_map": "Trasu převezme %1$s.",
"action_line_now": "Stane se hned.",
"action_line_open": "Otevře to.",
"action_line_settings": "Otevře nastavení; změníte ho vy.",
"action_running": "Provádím…",
"action_unlock": "Nejdřív odemkněte telefon, pak klepněte na Provést.",
"activity_compact_off": "Automatické shrnutí je vypnuté.",
"activity_until_compact": "%1$s do automatického shrnutí",
"add_instance": "Přidat instanci",
@@ -116,6 +132,7 @@
"nav_app_google": "Mapy Google",
"nav_app_not_installed": "Není nainstalovaná",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "Ve které mapové aplikaci?",
"new_agent_chat": "Nová konverzace s agentem",
"notification_access": "Přístup k oznámením",
"notification_access_off": "Zatím neuděleno. Klepnutím otevřete přepínač Androidu pro LLeMbas.",
@@ -276,6 +293,22 @@
},
"de": {
"about_version": "LLeMbas für Android %1$s",
"action_card_title": "Das auf deinem Telefon tun?",
"action_do": "Ausführen",
"action_failed": "Hat nicht geklappt: %1$s",
"action_google_add_stop": "Google Maps kann keinen Stopp in eine laufende Route einfügen: Es startet die Route neu, über den Stopp.",
"action_google_no_stop": "Google Maps lässt sich nicht von außen anhalten: Beende die Route dort.",
"action_line_automation": "Startet deine Automatisierung (Tasker, wenn keine andere App genannt ist).",
"action_line_calendar": "Der Kalender öffnet sich mit dem ausgefüllten Termin; du speicherst ihn.",
"action_line_clock": "Die Uhr-App stellt es ein.",
"action_line_dial": "Die Telefon-App öffnet sich mit der Nummer; du rufst an.",
"action_line_draft": "Öffnet einen Entwurf; du sendest ihn selbst.",
"action_line_map": "%1$s übernimmt die Route.",
"action_line_now": "Passiert sofort.",
"action_line_open": "Öffnet es.",
"action_line_settings": "Öffnet die Einstellung; du änderst sie.",
"action_running": "Wird ausgeführt…",
"action_unlock": "Entsperre zuerst das Telefon und tippe dann auf Ausführen.",
"activity_compact_off": "Automatisches Zusammenfassen ist aus.",
"activity_until_compact": "%1$s bis zum automatischen Zusammenfassen",
"add_instance": "Instanz hinzufügen",
@@ -392,6 +425,7 @@
"nav_app_google": "Google Maps",
"nav_app_not_installed": "Nicht installiert",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "Mit welcher Karten-App?",
"new_agent_chat": "Neuer Agent-Chat",
"notification_access": "Zugriff auf Benachrichtigungen",
"notification_access_off": "Noch nicht erteilt. Tippe, um den Android-Schalter für LLeMbas zu öffnen.",
@@ -552,6 +586,22 @@
},
"es": {
"about_version": "LLeMbas para Android %1$s",
"action_card_title": "¿Hacer esto en tu teléfono?",
"action_do": "Hacerlo",
"action_failed": "No funcionó: %1$s",
"action_google_add_stop": "Google Maps no puede añadir una parada a una ruta en curso: vuelve a iniciar la ruta, pasando por la parada.",
"action_google_no_stop": "A Google Maps no se le puede pedir que pare: termina la ruta allí.",
"action_line_automation": "Ejecuta tu automatización (Tasker salvo que se indique otra app).",
"action_line_calendar": "El calendario se abre con el evento rellenado; tú lo guardas.",
"action_line_clock": "La app de reloj lo programa.",
"action_line_dial": "El marcador se abre con el número; tú haces la llamada.",
"action_line_draft": "Abre un borrador; lo envías tú.",
"action_line_map": "%1$s se encarga de la ruta.",
"action_line_now": "Ocurre al instante.",
"action_line_open": "Lo abre.",
"action_line_settings": "Abre el ajuste; tú lo cambias.",
"action_running": "Haciéndolo…",
"action_unlock": "Desbloquea primero el teléfono y luego toca Hacerlo.",
"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",
@@ -667,6 +717,7 @@
"nav_app_google": "Google Maps",
"nav_app_not_installed": "No instalada",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "¿Con qué app de mapas?",
"new_agent_chat": "Nuevo chat de agente",
"notification_access": "Acceso a notificaciones",
"notification_access_off": "Aún no concedido. Toca para abrir el interruptor de Android para LLeMbas.",
@@ -827,6 +878,22 @@
},
"fr": {
"about_version": "LLeMbas pour Android %1$s",
"action_card_title": "Faire ceci sur votre téléphone ?",
"action_do": "Le faire",
"action_failed": "Cela n’a pas marché : %1$s",
"action_google_add_stop": "Google Maps ne peut pas ajouter d’arrêt à un itinéraire en cours : il relance l’itinéraire, par l’arrêt.",
"action_google_no_stop": "On ne peut pas dire à Google Maps d’arrêter : terminez l’itinéraire dans l’app.",
"action_line_automation": "Lance votre automatisation (Tasker sauf si une autre app est nommée).",
"action_line_calendar": "Le calendrier s’ouvre avec l’événement rempli ; vous l’enregistrez.",
"action_line_clock": "L’app Horloge le règle.",
"action_line_dial": "Le clavier s’ouvre avec le numéro ; vous lancez l’appel.",
"action_line_draft": "Ouvre un brouillon ; vous l’envoyez vous-même.",
"action_line_map": "%1$s prend l’itinéraire.",
"action_line_now": "Se fait aussitôt.",
"action_line_open": "L’ouvre.",
"action_line_settings": "Ouvre le réglage ; vous le changez.",
"action_running": "En cours…",
"action_unlock": "Déverrouillez d’abord le téléphone, puis touchez Le faire.",
"activity_compact_off": "Le compactage automatique est désactivé.",
"activity_until_compact": "%1$s avant le compactage automatique",
"add_instance": "Ajouter une instance",
@@ -943,6 +1010,7 @@
"nav_app_google": "Google Maps",
"nav_app_not_installed": "Non installée",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "Avec quelle app de cartes ?",
"new_agent_chat": "Nouvelle conversation d'agent",
"notification_access": "Accès aux notifications",
"notification_access_off": "Pas encore accordé. Touchez pour ouvrir l’interrupteur d’Android pour LLeMbas.",
@@ -1103,6 +1171,22 @@
},
"hu": {
"about_version": "LLeMbas Androidra %1$s",
"action_card_title": "Megtegyem ezt a telefonodon?",
"action_do": "Mehet",
"action_failed": "Nem sikerült: %1$s",
"action_google_add_stop": "A Google Térkép nem tud megállót adni egy futó útvonalhoz: újraindítja az útvonalat a megállón át.",
"action_google_no_stop": "A Google Térképet nem lehet kívülről leállítani: ott fejezd be az útvonalat.",
"action_line_automation": "Lefuttatja az automatizálásodat (Tasker, ha nincs más alkalmazás megadva).",
"action_line_calendar": "Megnyílik a naptár a kitöltött eseménnyel; te mented el.",
"action_line_clock": "Az Óra alkalmazás beállítja.",
"action_line_dial": "Megnyílik a tárcsázó a számmal; te indítod a hívást.",
"action_line_draft": "Megnyit egy piszkozatot; te küldöd el.",
"action_line_map": "Az útvonalat a(z) %1$s kapja.",
"action_line_now": "Azonnal megtörténik.",
"action_line_open": "Megnyitja.",
"action_line_settings": "Megnyitja a beállítást; te módosítod.",
"action_running": "Folyamatban…",
"action_unlock": "Előbb oldd fel a telefont, aztán koppints a Mehet gombra.",
"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",
@@ -1219,6 +1303,7 @@
"nav_app_google": "Google Térkép",
"nav_app_not_installed": "Nincs telepítve",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "Melyik térképalkalmazással?",
"new_agent_chat": "Új ügynök-csevegés",
"notification_access": "Hozzáférés az értesítésekhez",
"notification_access_off": "Még nincs megadva. Koppints az Android LLeMbas-kapcsolójának megnyitásához.",
@@ -1379,6 +1464,22 @@
},
"it": {
"about_version": "LLeMbas per Android %1$s",
"action_card_title": "Farlo sul tuo telefono?",
"action_do": "Fallo",
"action_failed": "Non ha funzionato: %1$s",
"action_google_add_stop": "Google Maps non può aggiungere una tappa a un percorso in corso: riavvia il percorso passando per la tappa.",
"action_google_no_stop": "Non si può dire a Google Maps di fermarsi: termina il percorso lì.",
"action_line_automation": "Esegue la tua automazione (Tasker se non è indicata un’altra app).",
"action_line_calendar": "Il calendario si apre con l’evento compilato; lo salvi tu.",
"action_line_clock": "Lo imposta l’app Orologio.",
"action_line_dial": "Il tastierino si apre con il numero; la chiamata la fai tu.",
"action_line_draft": "Apre una bozza; la invii tu.",
"action_line_map": "Il percorso va a %1$s.",
"action_line_now": "Avviene subito.",
"action_line_open": "Lo apre.",
"action_line_settings": "Apre l’impostazione; la cambi tu.",
"action_running": "In corso…",
"action_unlock": "Sblocca prima il telefono, poi tocca Fallo.",
"activity_compact_off": "La compattazione automatica è disattivata.",
"activity_until_compact": "%1$s alla compattazione automatica",
"add_instance": "Aggiungi un'istanza",
@@ -1494,6 +1595,7 @@
"nav_app_google": "Google Maps",
"nav_app_not_installed": "Non installata",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "Con quale app di mappe?",
"new_agent_chat": "Nuova chat agente",
"notification_access": "Accesso alle notifiche",
"notification_access_off": "Non ancora concesso. Tocca per aprire l’interruttore di Android per LLeMbas.",
@@ -1654,6 +1756,22 @@
},
"pl": {
"about_version": "LLeMbas na Androida %1$s",
"action_card_title": "Zrobić to na telefonie?",
"action_do": "Zrób to",
"action_failed": "Nie udało się: %1$s",
"action_google_add_stop": "Mapy Google nie dodadzą przystanku do trwającej trasy: uruchomią trasę od nowa, przez przystanek.",
"action_google_no_stop": "Map Google nie da się zatrzymać z zewnątrz: zakończ trasę w nich.",
"action_line_automation": "Uruchamia Twoją automatyzację (Tasker, chyba że podano inną aplikację).",
"action_line_calendar": "Kalendarz otworzy się z wypełnionym wydarzeniem; Ty je zapiszesz.",
"action_line_clock": "Ustawi to aplikacja Zegar.",
"action_line_dial": "Otworzy się wybieranie z numerem; połączenie rozpoczniesz Ty.",
"action_line_draft": "Otwiera szkic; wysyłasz go sam.",
"action_line_map": "Trasę przejmie %1$s.",
"action_line_now": "Dzieje się od razu.",
"action_line_open": "Otwiera to.",
"action_line_settings": "Otwiera ustawienie; Ty je zmieniasz.",
"action_running": "Robię to…",
"action_unlock": "Najpierw odblokuj telefon, potem dotknij Zrób to.",
"activity_compact_off": "Automatyczne streszczanie jest wyłączone.",
"activity_until_compact": "%1$s do automatycznego streszczenia",
"add_instance": "Dodaj instancję",
@@ -1769,6 +1887,7 @@
"nav_app_google": "Mapy Google",
"nav_app_not_installed": "Nie zainstalowano",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "W której aplikacji map?",
"new_agent_chat": "Nowy czat agenta",
"notification_access": "Dostęp do powiadomień",
"notification_access_off": "Jeszcze nie przyznany. Dotknij, aby otworzyć przełącznik Androida dla LLeMbas.",
@@ -1929,6 +2048,22 @@
},
"sk": {
"about_version": "LLeMbas pre Android %1$s",
"action_card_title": "Urobiť to v telefóne?",
"action_do": "Urobiť",
"action_failed": "Nepodarilo sa: %1$s",
"action_google_add_stop": "Mapy Google nepridajú zastávku do bežiacej trasy: spustia trasu znova, cez zastávku.",
"action_google_no_stop": "Mapy Google sa nedajú zastaviť zvonka: trasu ukončite v nich.",
"action_line_automation": "Spustí vašu automatizáciu (Tasker, ak nie je uvedená iná aplikácia).",
"action_line_calendar": "Otvorí sa kalendár s vyplnenou udalosťou; uložíte ju vy.",
"action_line_clock": "Nastaví to aplikácia Hodiny.",
"action_line_dial": "Otvorí sa vytáčanie s číslom; hovor začnete vy.",
"action_line_draft": "Otvorí koncept; odošlete ho sami.",
"action_line_map": "Trasu prevezme %1$s.",
"action_line_now": "Stane sa hneď.",
"action_line_open": "Otvorí to.",
"action_line_settings": "Otvorí nastavenie; zmeníte ho vy.",
"action_running": "Robím to…",
"action_unlock": "Najprv odomknite telefón, potom ťuknite na Urobiť.",
"activity_compact_off": "Automatické zhrnutie je vypnuté.",
"activity_until_compact": "%1$s do automatického zhrnutia",
"add_instance": "Pridať inštanciu",
@@ -2044,6 +2179,7 @@
"nav_app_google": "Mapy Google",
"nav_app_not_installed": "Nie je nainštalovaná",
"nav_app_osmand": "OsmAnd",
"nav_app_pick": "V ktorej mapovej aplikácii?",
"new_agent_chat": "Nová konverzácia s agentom",
"notification_access": "Prístup k oznámeniam",
"notification_access_off": "Zatiaľ neudelený. Ťuknutím otvoríte prepínač Androidu pre LLeMbas.",