J.A.R.V.I.S-rust/resources/commands/expenses/command.toml
Bossiara13 87bb186e94
Some checks are pending
Rust CI / cargo test (jarvis-core) (push) Waiting to run
Rust CI / cargo clippy (push) Waiting to run
Rust CI / cargo check (workspace) (push) Waiting to run
feat: Wave 10 — expense tracker pack (voice-driven)
resources/commands/expenses/ (4 commands):
- expenses.log     "потратил 500 на еду"     → append entry
- expenses.today   "сколько потратил сегодня" → today's total
- expenses.week    "сколько на неделе"       → 7-day rolling total
- expenses.breakdown "куда ушли деньги"      → top-5 categories

Storage: `jarvis.state` (auto-namespaced per-pack JSON). Wire format is
compact "ts1,amount1,cat1|ts2,amount2,cat2" so we don't need a JSON parser
inside Lua.

Phrase parsing:
- Trigger stripped via jarvis.text.strip_trigger.
- First number captured; "12,50" comma decimals accepted.
- Category extracted from "на <слово>" (RU) or "for/on <word>" (EN);
  defaults to "разное" / "misc".

Time math:
- Day boundary: local-calendar midnight via os.time({year,month,day,...}).
- Week boundary: rolling 7×86400 seconds.

Pack count: 98 → 99 functional.
2026-05-16 14:57:58 +03:00

91 lines
1.9 KiB
TOML

# Personal-finance tracker — voice-log expenses by category, get totals.
# Storage is per-pack via `jarvis.state` (auto-namespaced JSON), so it doesn't
# bleed into other packs' data.
#
# Voice flow:
# "потратил 500 на еду" → log entry (amount=500, category="еда")
# "сколько я потратил сегодня" → speak today's total
# "сколько на этой неделе" → speak 7-day total
# "куда ушли деньги" → speak per-category breakdown for the week
[[commands]]
id = "expenses.log"
type = "lua"
script = "log.lua"
sandbox = "standard"
timeout = 3000
[commands.phrases]
ru = [
"потратил",
"записать трату",
"запиши трату",
"купил за",
"заплатил за",
]
en = [
"spent",
"log expense",
"paid for",
"bought",
]
[[commands]]
id = "expenses.today"
type = "lua"
script = "today.lua"
sandbox = "standard"
timeout = 3000
[commands.phrases]
ru = [
"сколько я потратил сегодня",
"траты сегодня",
"сколько ушло сегодня",
]
en = [
"spending today",
"expenses today",
"how much spent today",
]
[[commands]]
id = "expenses.week"
type = "lua"
script = "week.lua"
sandbox = "standard"
timeout = 3000
[commands.phrases]
ru = [
"сколько я потратил на этой неделе",
"траты на неделе",
"недельные траты",
]
en = [
"spending this week",
"weekly expenses",
]
[[commands]]
id = "expenses.breakdown"
type = "lua"
script = "breakdown.lua"
sandbox = "standard"
timeout = 3000
[commands.phrases]
ru = [
"куда ушли деньги",
"разбивка по тратам",
"на что я тратил",
"разбивка по категориям",
]
en = [
"where did the money go",
"expense breakdown",
"spending by category",
]