J.A.R.V.I.S-rust/resources/commands/personality/command.toml
Bossiara13 919d565879
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: real-Jarvis Wave 4 — personality, idle banter, persistent history, offline math, DDG search
Personality pack (`resources/commands/personality/`):
- 5 voice commands × ~7-29 phrases each across RU and EN.
- personality.greet: 4 time-of-day buckets (morning/midday/evening/night),
  pulls one of ~7 lines per bucket per language.
- personality.thanks / .compliment / .how_are_you / .tony_quote.
- how_are_you embeds live memory size + active profile via jarvis.health()
  and jarvis.memory.all() for a "feels alive" effect.
- All use jarvis.cmd.ok helpers, no inline PowerShell SAPI.
- Built by sub-agent. Verified: 6 rust command tests + 60 python tests.

Idle banter (`crates/jarvis-core/src/idle_banter.rs`):
- Background thread chimes in periodically without being asked. Gated by
  JARVIS_IDLE_BANTER env (default OFF — intrusion is opt-in).
- Quiet hours 23:00–07:00, skipped under "sleep" profile, paused during
  active interactions via `pause()`.
- 30+ static offline lines split into RU/EN × morning/evening/generic
  buckets — no network required.
- Lua API jarvis.banter.{fire, pause, resume, enabled}.
- New voice pack `banter/` exposes "скажи что-нибудь интересное",
  "помолчи", "можешь говорить".
- 6 unit tests covering pool selection, quiet hours, interval clamp,
  pause/resume, opt-in default.

Conversation continuity (`crates/jarvis-core/src/llm/history.rs`):
- New `ConversationHistory::with_persistence(path)` builder. Every
  push/clear/pop atomically writes to `<APP_CONFIG_DIR>/llm_history.json`
  so daemon restart picks up the thread.
- System prompt is intentionally NOT persisted — comes from current init
  call so prompt edits take effect immediately on restart.
- `llm::init_history` wires the path in automatically.
- 4 new tests: round-trip, clear wipes file, corrupt file tolerated,
  len/is_empty helpers.

Offline-first math (`resources/commands/math/math.lua`):
- Was: always-LLM, hard fail without GROQ_TOKEN, inline PowerShell SAPI.
- Now: shunting-yard parser handles 95% of voice queries in <50ms — no
  network, no token. Russian operator words ("плюс", "умножить на",
  "в степени", "квадрат", ...) normalised to symbols first. Patterns
  for "корень из X" and "X процентов от Y". Falls back to LLM only on
  parse failure (word problems / equations / unit conversions).
- Drops inline PowerShell — speaks via jarvis.cmd.ok.
- 10-case shunting-yard kernel test added (basic ops, precedence,
  parens, unary minus, div-by-zero, garbage rejected).

DuckDuckGo Instant Answer (`resources/commands/ddg_answer/`):
- New pack — short factual Q&A without API key. Trigger phrases
  "что такое", "кто такой", "расскажи про", "what is", etc.
- Reads AbstractText → Answer → Definition → RelatedTopics[0] in order
  from DDG's free JSON API. Opens the search page only if nothing
  useful comes back.
- Sandbox full (needs http + system.open).

Tests: 128 → 139 (+11). Release build green.
2026-05-16 13:52:49 +03:00

136 lines
2.6 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Personality pack — varied JARVIS-style banter so the assistant feels alive.
# Each command picks a random phrase from a time/language-scoped bucket.
[[commands]]
id = "personality.greet"
type = "lua"
script = "greet.lua"
sandbox = "minimal"
timeout = 2000
[commands.phrases]
ru = [
"привет джарвис",
"привет, джарвис",
"здравствуй джарвис",
"доброе утро",
"добрый день",
"добрый вечер",
"доброй ночи",
"приветствую",
"хай джарвис",
]
en = [
"hi jarvis",
"hello jarvis",
"hey jarvis",
"good morning",
"good afternoon",
"good evening",
"good night jarvis",
"morning jarvis",
]
[[commands]]
id = "personality.thanks"
type = "lua"
script = "thanks.lua"
sandbox = "minimal"
timeout = 2000
[commands.phrases]
ru = [
"спасибо",
"спасибо джарвис",
"благодарю",
"благодарю джарвис",
"спс",
"ты лучший",
]
en = [
"thanks",
"thank you",
"thanks jarvis",
"thank you jarvis",
"cheers",
"appreciate it",
]
[[commands]]
id = "personality.compliment"
type = "lua"
script = "compliment.lua"
sandbox = "minimal"
timeout = 2000
[commands.phrases]
ru = [
"ты молодец",
"ты умница",
"молодец джарвис",
"хорошо сработано",
"отличная работа",
"так держать",
"ты лучший ассистент",
]
en = [
"good job",
"good job jarvis",
"well done",
"nice work",
"you are the best",
"great work jarvis",
]
[[commands]]
id = "personality.how_are_you"
type = "lua"
script = "how_are_you.lua"
sandbox = "standard"
timeout = 2000
[commands.phrases]
ru = [
"как дела",
"как дела джарвис",
"как ты",
"как настроение",
"как самочувствие",
"как поживаешь",
"что нового у тебя",
]
en = [
"how are you",
"how are you jarvis",
"how is it going",
"how do you feel",
"you doing ok",
]
[[commands]]
id = "personality.tony_quote"
type = "lua"
script = "tony_quote.lua"
sandbox = "minimal"
timeout = 2000
[commands.phrases]
ru = [
"процитируй тони",
"цитата тони старка",
"что сказал бы тони",
"скажи как тони",
"процитируй железного человека",
"цитата старка",
]
en = [
"quote tony",
"quote tony stark",
"what would tony say",
"stark quote",
"iron man quote",
]