uprava chovani

This commit is contained in:
lachtan
2026-08-27 14:18:18 +02:00
parent de0f4c8a8f
commit 8119f780e7
2 changed files with 42 additions and 62 deletions

View File

@@ -10,6 +10,19 @@ Test: *Who is the recipient?* User gets notified → `/remind` skill (SQLite `db
**Do NOT just write reminders to MEMORY.md** — that won't trigger actual notifications. **Do NOT just write reminders to MEMORY.md** — that won't trigger actual notifications.
## Doručené připomínky — „co dnes přišlo?"
Připomínky doručuje **systémový cron uživatele nanobot**
(`skills/remind/scripts/remind_send.py`) přímo přes Telegram, mimo agenta —
agent u odeslání není. Když se uživatel ptá na minulé/dnešní připomínky
(„připomněl jsi mi…?", „co dnes přišlo?"), zavolej
`uv run skills/remind/scripts/remind_cli.py delivered [--since YYYY-MM-DD]`
čte tabulku `reminder_fires` (jen doručené, čas v Praze).
`log/reminder.log` je provozní/debug log všech operací (ADD/EDIT/REMOVE/…/DELIVER,
UTC) — ne zdroj pravdy pro doručení. `log/reminder_cron.log` zachytává
stdout/stderr crontabu — za zdravého běhu prázdný, plní se jen při pádech skriptu.
## Heartbeat Tasks ## Heartbeat Tasks
`HEARTBEAT.md` is checked on the configured heartbeat interval. Use file tools to manage periodic tasks: `HEARTBEAT.md` is checked on the configured heartbeat interval. Use file tools to manage periodic tasks:
@@ -37,6 +50,25 @@ Never use `/tmp/`, hardcoded absolute paths, or in-memory databases for persiste
The exec safety guard blocks commands without an explicit workspace path (e.g. `lua -e '...'`, `which`). Write scripts to files inside the workspace (e.g. `tmp/script.lua`) and run them with `working_dir` set to the workspace root. The exec safety guard blocks commands without an explicit workspace path (e.g. `lua -e '...'`, `which`). Write scripts to files inside the workspace (e.g. `tmp/script.lua`) and run them with `working_dir` set to the workspace root.
## python — use uv
For all Python code (scripts, snippets, one-liners, tools) use `uv`,
not `python` / `python3` / `pip` directly.
- Run a script: `uv run script.py` (not `python script.py`)
- One-liner / snippet: `uv run --with <pkg> python -c '...'`
- Script with declared dependencies: `uv run --script script.py`
(PEP 723 header inside the file)
- Add a project dependency: `uv add <pkg>` (not `pip install`)
- Remove: `uv remove <pkg>`
- Sync environment: `uv sync`
- Run a tool: `uv run pytest`, `uv run ruff`, `uv run mypy`, …
- REPL: `uv run python`
Do not use `pip`, `pip-tools`, `poetry`, `conda`, or the system `python`.
Reason: isolated, reproducible environments with no system-level side
effects, faster resolves, no "works on my machine" surprises.
## File / Code Conventions ## File / Code Conventions
### Report / result files ### Report / result files
@@ -49,6 +81,16 @@ The exec safety guard blocks commands without an explicit workspace path (e.g. `
- Longer / non-trivial script -> Python. - Longer / non-trivial script -> Python.
- Override: if the user explicitly specifies a language or location, their instruction always takes precedence. - Override: if the user explicitly specifies a language or location, their instruction always takes precedence.
### Available scripting languages
In addition to Python and Bash, the agent can also write and run:
- **Lua** — via `lua` interpreter (scripts in `tmp/`, run with `working_dir` set to workspace root)
- **Rust** — via `rustc` / `cargo` (compile and run inside workspace)
- **TypeScript** — via `bun` (preferred) or `deno` / `node` if available
Use these when the user explicitly asks for them or when they are the right tool for the job. Default remains Python for non-trivial scripts and Bash for very short shell snippets.
### Git clones ### Git clones
- Always clone repos into `workspace/src/<repo-name>`, not directly into workspace root. - Always clone repos into `workspace/src/<repo-name>`, not directly into workspace root.

View File

@@ -1,62 +0,0 @@
# Tool Usage Notes
Tool signatures are provided automatically via function calling.
This file documents non-obvious constraints and usage patterns.
## exec — Safety Limits
- Commands have a configurable timeout (default 60s)
- Dangerous commands are blocked (rm -rf, format, dd, shutdown, etc.)
- Output is truncated at 10,000 characters
- `restrictToWorkspace` config can limit file access to the workspace
## grep — Content Search
- Use `grep` to search file contents inside the workspace
- Default behavior returns only matching file paths (`output_mode="files_with_matches"`)
- Supports optional `glob` filtering (e.g. `glob="*.py"`) plus `context_before` / `context_after`
- Supports `type="py"`, `type="ts"`, `type="md"` and similar shorthand filters
- Use `fixed_strings=true` for literal keywords containing regex characters
- Use `output_mode="files_with_matches"` to get only matching file paths
- Use `output_mode="count"` to size a search before reading full matches
- Use `head_limit` and `offset` to page across results
- Prefer this over `exec` for code and history searches
- Binary or oversized files may be skipped to keep results readable
## cron — Background Agent Tasks
- Use `cron` only for **background agent tasks** (scripts, checks, autonomous actions).
- For **personal reminders to the user**, use the `/remind` skill instead (stored in SQLite `db/reminders.sqlite`).
- Do not call `nanobot cron` via `exec` — use the built-in `cron` tool.
## python — use uv
For all Python code (scripts, snippets, one-liners, tools) use `uv`,
not `python` / `python3` / `pip` directly.
- Run a script: `uv run script.py` (not `python script.py`)
- One-liner / snippet: `uv run --with <pkg> python -c '...'`
- Script with declared dependencies: `uv run --script script.py`
(PEP 723 header inside the file)
- Add a project dependency: `uv add <pkg>` (not `pip install`)
- Remove: `uv remove <pkg>`
- Sync environment: `uv sync`
- Run a tool: `uv run pytest`, `uv run ruff`, `uv run mypy`, …
- REPL: `uv run python`
Do not use `pip`, `pip-tools`, `poetry`, `conda`, or the system `python`.
Reason: isolated, reproducible environments with no system-level side
effects, faster resolves, no "works on my machine" surprises.
## Doručené připomínky — „co dnes přišlo?"
Připomínky doručuje **systémový cron uživatele nanobot**
(`skills/remind/scripts/remind_send.py`) přímo přes Telegram, mimo agenta —
agent u odeslání není. Když se uživatel ptá na minulé/dnešní připomínky
(„připomněl jsi mi…?", „co dnes přišlo?"), zavolej
`uv run skills/remind/scripts/remind_edit.py delivered [--since YYYY-MM-DD]`
čte tabulku `reminder_fires` (jen doručené, čas v Praze).
`log/reminder.log` je provozní/debug log všech operací (ADD/EDIT/REMOVE/…/DELIVER,
UTC) — ne zdroj pravdy pro doručení. `log/reminder_cron.log` zachytává
stdout/stderr crontabu — za zdravého běhu prázdný, plní se jen při pádech skriptu.