Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions apps/maple-agent/app/locales/de/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,9 @@ settings-usage-pace-exhausted = Das Tarifguthaben ist aufgebraucht. Kaufe zusät
# $reset is a short date such as Dec 1.
settings-usage-pace-exhausted-extra = Das Tarifguthaben ist aufgebraucht. Zusätzliches Guthaben deckt die Nutzung, solange es reicht. Das Tarifguthaben wird am { $reset } zurückgesetzt.
# $reset is a short date such as Dec 1.
settings-usage-pace-team-exhausted = Das gemeinsame Teamguthaben ist aufgebraucht. Die Teamnutzung pausiert bis zur Zurücksetzung am { $reset }.
settings-usage-pace-team-exhausted = Das gemeinsame Teamguthaben ist aufgebraucht. Kaufe zusätzliches Guthaben für dein eigenes Konto, um vor der Zurücksetzung am { $reset } weiterzuarbeiten.
# $reset is a short date such as Dec 1.
settings-usage-pace-team-exhausted-extra = Das gemeinsame Teamguthaben ist aufgebraucht. Dein eigenes zusätzliches Guthaben deckt deine Nutzung, solange es reicht. Das Teamguthaben wird am { $reset } zurückgesetzt.
# $pace is a formatted number of credits and $count the same number for plurals; $allowance is a formatted number such as 20,000; $date is a short date.
settings-usage-pace-runs-out = Bei etwa { $pace } { $count ->
[one] Guthabenpunkt
Expand All @@ -893,7 +895,12 @@ settings-usage-pace-runs-out-extra = Bei etwa { $pace } { $count ->
settings-usage-pace-team-runs-out = Bei etwa { $pace } { $count ->
[one] Guthabenpunkt
*[other] Guthabenpunkten
} pro Tag erreicht ihr { $allowance } ungefähr am { $date }. Danach pausiert die Teamnutzung bis zur Zurücksetzung.
} pro Tag erreicht ihr { $allowance } ungefähr am { $date }. Danach benötigst du bis zur Zurücksetzung eigenes zusätzliches Guthaben.
# $pace is a formatted number of credits and $count the same number for plurals; $allowance is a formatted number such as 20,000; $date is a short date.
settings-usage-pace-team-runs-out-extra = Bei etwa { $pace } { $count ->
[one] Guthabenpunkt
*[other] Guthabenpunkten
} pro Tag erreicht ihr { $allowance } ungefähr am { $date }. Danach deckt dein eigenes zusätzliches Guthaben deine Nutzung.
# $pace is a formatted number of credits and $count the same number for plurals; $projected and $allowance are formatted numbers such as 18,000; $reset is a short date.
settings-usage-pace-on-track = Bei etwa { $pace } { $count ->
[one] Guthabenpunkt
Expand Down Expand Up @@ -998,7 +1005,7 @@ settings-usage-about-credits-plan = Guthabenpunkte messen die Nutzung zu unseren
# $allowance is a formatted number.
settings-usage-about-credits-unnamed = Guthabenpunkte messen die Nutzung zu unseren API-Listenpreisen: 1.000 Punkte entsprechen 1 $ Nutzung. Dein Tarif enthält { $allowance } Guthabenpunkte pro Abrechnungszeitraum. Zusätzliches Guthaben wird erst nach Verbrauch des Tarifguthabens verwendet und verfällt nicht.
# $allowance is a formatted number.
settings-usage-about-credits-team = Guthabenpunkte messen die Nutzung zu unseren API-Listenpreisen: 1.000 Punkte entsprechen 1 $ Nutzung. Dein Team teilt sich { $allowance } Guthabenpunkte pro Abrechnungszeitraum.
settings-usage-about-credits-team = Guthabenpunkte messen die Nutzung zu unseren API-Listenpreisen: 1.000 Punkte entsprechen 1 $ Nutzung. Dein Team teilt sich { $allowance } Guthabenpunkte pro Abrechnungszeitraum. Zusätzliches Guthaben auf deinem eigenen Konto wird erst nach Verbrauch des Teamguthabens verwendet und verfällt nicht.
settings-usage-about-background-title = Hintergrundanfragen
settings-usage-about-background = Maple stellt auch Anfragen für dich, etwa um Chats zu benennen, Werkzeugergebnisse zusammenzufassen, ein Modell für Auto auszuwählen oder lange Gespräche zu kürzen. Sie laufen auf dem Modell, das Maple für die jeweilige Aufgabe verwendet; dieses kann sich ändern. Sie zählen zu deiner Nutzung und werden unter diesem Modell aufgeführt.
settings-usage-about-auto-title = Auto, Quick und Powerful
Expand Down
13 changes: 10 additions & 3 deletions apps/maple-agent/app/locales/en/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,9 @@ settings-usage-pace-exhausted = Plan credits ran out. Add Extra credits to keep
# $reset is a short date such as Dec 1.
settings-usage-pace-exhausted-extra = Plan credits ran out. Extra credits cover usage while your balance lasts. Plan credits reset on { $reset }.
# $reset is a short date such as Dec 1.
settings-usage-pace-team-exhausted = The team pool ran out. Team usage pauses until the reset on { $reset }.
settings-usage-pace-team-exhausted = The team pool ran out. Add Extra credits to your own account to keep going before the reset on { $reset }.
# $reset is a short date such as Dec 1.
settings-usage-pace-team-exhausted-extra = The team pool ran out. Your own Extra credits cover your usage while your balance lasts. The pool resets on { $reset }.
# $pace is a formatted number of credits and $count the same number for plurals; $allowance is a formatted number such as 20,000; $date is a short date.
settings-usage-pace-runs-out = About { $pace } { $count ->
[one] credit
Expand All @@ -893,7 +895,12 @@ settings-usage-pace-runs-out-extra = About { $pace } { $count ->
settings-usage-pace-team-runs-out = About { $pace } { $count ->
[one] credit
*[other] credits
} a day reaches { $allowance } around { $date }. After that, team usage pauses until the reset.
} a day reaches { $allowance } around { $date }. After that, you need your own Extra credits until the reset.
# $pace is a formatted number of credits and $count the same number for plurals; $allowance is a formatted number such as 20,000; $date is a short date.
settings-usage-pace-team-runs-out-extra = About { $pace } { $count ->
[one] credit
*[other] credits
} a day reaches { $allowance } around { $date }. After that, your own Extra credits cover your usage.
# $pace is a formatted number of credits and $count the same number for plurals; $projected and $allowance are formatted numbers such as 18,000; $reset is a short date.
settings-usage-pace-on-track = About { $pace } { $count ->
[one] credit
Expand Down Expand Up @@ -998,7 +1005,7 @@ settings-usage-about-credits-plan = Credits measure usage at our API list prices
# $allowance is a formatted number.
settings-usage-about-credits-unnamed = Credits measure usage at our API list prices: 1,000 credits is $1 of usage. Your plan includes { $allowance } credits each billing period. Extra credits are used only after plan credits run out, and they don't expire.
# $allowance is a formatted number.
settings-usage-about-credits-team = Credits measure usage at our API list prices: 1,000 credits is $1 of usage. Your team shares { $allowance } credits each billing period.
settings-usage-about-credits-team = Credits measure usage at our API list prices: 1,000 credits is $1 of usage. Your team shares { $allowance } credits each billing period. Extra credits on your own account are used only after the team's credits run out, and they don't expire.
settings-usage-about-background-title = Background requests
settings-usage-about-background = Maple also sends requests for you, for example to name chats, summarize tool results, choose a model for Auto, or shorten long conversations. They run on whichever model Maple uses for that job, which can change, and they count toward your usage. They are listed under that model.
settings-usage-about-auto-title = Auto, Quick and Powerful
Expand Down
11 changes: 8 additions & 3 deletions apps/maple-agent/app/locales/es/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ settings-usage-team-rest = Resto del equipo { $credits }
settings-usage-team-footer = Todo lo de abajo es tu propio uso. La bolsa de arriba incluye a todo el equipo.
settings-usage-pace-exhausted = Se agotaron los créditos del plan. Agrega créditos adicionales para seguir antes de que se restablezcan el { $reset }.
settings-usage-pace-exhausted-extra = Se agotaron los créditos del plan. Los créditos adicionales cubren el uso mientras dure tu saldo. Los créditos del plan se restablecen el { $reset }.
settings-usage-pace-team-exhausted = La bolsa del equipo se agotó. El uso del equipo se detiene hasta que se restablezca el { $reset }.
settings-usage-pace-team-exhausted = La bolsa del equipo se agotó. Agrega créditos adicionales a tu propia cuenta para seguir antes de que se restablezca el { $reset }.
settings-usage-pace-team-exhausted-extra = La bolsa del equipo se agotó. Tus propios créditos adicionales cubren tu uso mientras dure tu saldo. La bolsa se restablece el { $reset }.
settings-usage-pace-runs-out = { $count ->
[one] Un crédito al día alcanza
*[other] Unos { $pace } créditos al día alcanzan
Expand All @@ -833,7 +834,11 @@ settings-usage-pace-runs-out-extra = { $count ->
settings-usage-pace-team-runs-out = { $count ->
[one] Un crédito al día alcanza
*[other] Unos { $pace } créditos al día alcanzan
} { $allowance } hacia el { $date }. Después, el uso del equipo se detiene hasta que se restablezca.
} { $allowance } hacia el { $date }. Después, necesitarás tus propios créditos adicionales hasta que se restablezca.
settings-usage-pace-team-runs-out-extra = { $count ->
[one] Un crédito al día alcanza
*[other] Unos { $pace } créditos al día alcanzan
} { $allowance } hacia el { $date }. Después, tus propios créditos adicionales cubren tu uso.
settings-usage-pace-on-track = { $count ->
[one] Un crédito al día suma
*[other] Unos { $pace } créditos al día suman
Expand Down Expand Up @@ -926,7 +931,7 @@ settings-usage-about-apps = Cada solicitud cuenta para la app que la envió, aun
settings-usage-about-credits-title = Créditos
settings-usage-about-credits-plan = Los créditos miden el uso según nuestros precios de lista de la API: 1,000 créditos equivalen a $1 de uso. Tu plan { $plan } incluye { $allowance } créditos en cada periodo de facturación. Los créditos adicionales solo se usan cuando se agotan los del plan y no vencen.
settings-usage-about-credits-unnamed = Los créditos miden el uso según nuestros precios de lista de la API: 1,000 créditos equivalen a $1 de uso. Tu plan incluye { $allowance } créditos en cada periodo de facturación. Los créditos adicionales solo se usan cuando se agotan los del plan y no vencen.
settings-usage-about-credits-team = Los créditos miden el uso según nuestros precios de lista de la API: 1,000 créditos equivalen a $1 de uso. Tu equipo comparte { $allowance } créditos en cada periodo de facturación.
settings-usage-about-credits-team = Los créditos miden el uso según nuestros precios de lista de la API: 1,000 créditos equivalen a $1 de uso. Tu equipo comparte { $allowance } créditos en cada periodo de facturación. Los créditos adicionales de tu propia cuenta solo se usan cuando se agotan los del equipo y no vencen.
settings-usage-about-background-title = Solicitudes en segundo plano
settings-usage-about-background = Maple también envía solicitudes por ti, por ejemplo para poner nombre a los chats, resumir los resultados de herramientas, elegir un modelo para Auto o acortar conversaciones largas. Se ejecutan en el modelo que Maple use para esa tarea, que puede cambiar, y cuentan para tu uso. Aparecen bajo ese modelo.
settings-usage-about-auto-title = Auto, Rápido y Potente
Expand Down
34 changes: 34 additions & 0 deletions apps/maple-agent/app/src/ui/settings/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,40 @@ mod tests {
);
});
}
#[gpui::test]
fn a_team_member_is_pointed_to_their_own_extra_credits(cx: &mut TestAppContext) {
let (settings, cx) = usage_window(cx);
let start = chrono::Utc::now() - chrono::Duration::days(3);
let status = |used: i64, credits: Option<i64>| BillingStatus {
is_subscribed: true,
product_name: Some("Team".into()),
total_tokens: Some(7_000),
used_tokens: Some(used),
api_credit_balance: credits,
usage_period_start: Some(start.to_rfc3339()),
usage_reset_date: Some((start + chrono::Duration::days(30)).to_rfc3339()),
..BillingStatus::default()
};
settings.update(cx, |this, _| {
this.usage.enabled = Some(true);
this.usage.flag_failed = false;
let mut pace = |used, credits| {
this.billing.status = Some(status(used, credits));
this.rebuild_usage_data();
let data = this.usage.data.clone().expect("usage data");
this.pace_text(&data.plan).expect("pace").to_string()
};
// The pool running out stops nobody who has credits of their own.
let empty = pace(7_000, None);
assert!(empty.contains("Add Extra credits to your own account"));
let covered = pace(7_000, Some(500));
assert!(covered.contains("Your own Extra credits cover your usage"));
let ahead = pace(6_000, Some(0));
assert!(ahead.contains("you need your own Extra credits"));
let ahead_covered = pace(6_000, Some(500));
assert!(ahead_covered.contains("your own Extra credits cover your usage"));
});
}
/// The flag and the billing status arrive in either order on a visit;
/// together they fetch the history once, and a status load that failed
/// does not fetch it again.
Expand Down
8 changes: 6 additions & 2 deletions apps/maple-agent/app/src/ui/settings/usage/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ impl SettingsScreen {
.unwrap_or(0);
Some(if progress.exhausted {
self.messages.get(
if team {
if team && balance > 0 {
"settings-usage-pace-team-exhausted-extra"
} else if team {
"settings-usage-pace-team-exhausted"
} else if balance > 0 {
"settings-usage-pace-exhausted-extra"
Expand All @@ -129,7 +131,9 @@ impl SettingsScreen {
)
} else if let Some(run_out) = progress.run_out {
self.messages.get(
if team {
if team && balance > 0 {
"settings-usage-pace-team-runs-out-extra"
} else if team {
"settings-usage-pace-team-runs-out"
} else if balance > 0 {
"settings-usage-pace-runs-out-extra"
Expand Down
8 changes: 5 additions & 3 deletions apps/maple-agent/app/translation-revisions/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@ settings-usage-about-auto-title 87cd465aede241a7
settings-usage-about-background aa322c0d7030a36a
settings-usage-about-background-title d0a4fd0939cb27f7
settings-usage-about-credits-plan c08bc793cd8cab50
settings-usage-about-credits-team 51a738e4281dcd63
settings-usage-about-credits-team d97f2dd03b97ab08
settings-usage-about-credits-title eda99ca4dd9d049f
settings-usage-about-credits-unnamed 02da107a6adf0d10
settings-usage-about-free 16300349397b5dc1
Expand Down Expand Up @@ -1978,8 +1978,10 @@ settings-usage-pace-exhausted-extra 92763981e17d2c8f
settings-usage-pace-on-track 504f0171fdfcd7c2
settings-usage-pace-runs-out cca9bfb270c35eed
settings-usage-pace-runs-out-extra a46cb9314a39bc9b
settings-usage-pace-team-exhausted 1e0845040e55a4bd
settings-usage-pace-team-runs-out 3dbb585fd4a2eb93
settings-usage-pace-team-exhausted faf5f821025784e7
settings-usage-pace-team-exhausted-extra 7f4c8d752f9740d1
settings-usage-pace-team-runs-out 7e50032e4cc7e7ba
settings-usage-pace-team-runs-out-extra 5b32cb9e95b5ea6d
settings-usage-paid-extra 513755a8f6904241
settings-usage-percent b1b0eb69f5dafec4
settings-usage-plan-amount 132afc5508e18260
Expand Down
8 changes: 5 additions & 3 deletions apps/maple-agent/app/translation-revisions/es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@ settings-usage-about-auto-title 87cd465aede241a7
settings-usage-about-background aa322c0d7030a36a
settings-usage-about-background-title d0a4fd0939cb27f7
settings-usage-about-credits-plan c08bc793cd8cab50
settings-usage-about-credits-team 51a738e4281dcd63
settings-usage-about-credits-team d97f2dd03b97ab08
settings-usage-about-credits-title eda99ca4dd9d049f
settings-usage-about-credits-unnamed 02da107a6adf0d10
settings-usage-about-free 16300349397b5dc1
Expand Down Expand Up @@ -1978,8 +1978,10 @@ settings-usage-pace-exhausted-extra 92763981e17d2c8f
settings-usage-pace-on-track 504f0171fdfcd7c2
settings-usage-pace-runs-out cca9bfb270c35eed
settings-usage-pace-runs-out-extra a46cb9314a39bc9b
settings-usage-pace-team-exhausted 1e0845040e55a4bd
settings-usage-pace-team-runs-out 3dbb585fd4a2eb93
settings-usage-pace-team-exhausted faf5f821025784e7
settings-usage-pace-team-exhausted-extra 7f4c8d752f9740d1
settings-usage-pace-team-runs-out 7e50032e4cc7e7ba
settings-usage-pace-team-runs-out-extra 5b32cb9e95b5ea6d
settings-usage-paid-extra 513755a8f6904241
settings-usage-percent b1b0eb69f5dafec4
settings-usage-plan-amount 132afc5508e18260
Expand Down
Loading