Agent integration: EVIE_CHAT_ID/EVIE_SOCKET env injection + auto-loaded evie CLI skill #68

Merged
weiwen merged 2 commits from issue-61 into main 2026-07-12 18:32:46 +08:00
Owner

Closes #61.

Lets the notes agent drive evie through the Control Plane: an in-conversation "remind me in 1h to X" becomes a real Schedule the agent creates via the evie CLI.

Env injection at spawn

The Daemon injects EVIE_CHAT_ID (the session's own chat) and EVIE_SOCKET into every spawned pi process environment, so the agent's evie … calls target its own chat and daemon with no arguments. Plumbed through PiSpawnConfig/SessionManagerConfig and applied to interactive and Ephemeral Sessions alike.

Bundled evie CLI Skill

skills/evie/SKILL.md documents the Control Plane CLI: every Verb, the injected env vars, and the idempotent --update schedule contract (evie <verb> --help carries the flag detail). Per ADR 0006 this is a Skill over pi's shell/command-exec tool, not a custom extension.

Rather than push absolute-path wiring onto every deployment's [pi].skills, the skill is always loaded automatically at spawn, since it's intrinsic to the daemon↔agent integration, not user-tunable config:

  • bundled_skill_dir() resolves the installed layout (<exe>/../share/evie/skills/evie, shipped by the Nix package) first, falling back to the source tree for cargo run.
  • Injected via --skill on every spawn, deduped against configured skills.
  • The Nix package installs skills/ to $out/share/evie/skills.

Acceptance criteria

  • Interactive pi spawned with EVIE_CHAT_ID + EVIE_SOCKET.
  • In-repo pi Skill documents the evie CLI; loaded automatically (supersedes manual [pi].skills wiring).
  • schedule --name collisions/updates honour the schedule contract (--update idempotent re-issue).
  • Uses CONTEXT.md vocabulary (Skill, Control Plane, CLI); respects ADR 0006.
  • Live Telegram "remind me…" demo — needs a running daemon with provider + Telegram credentials; the dependencies (env injection, skill availability, schedule Verbs) are each unit-tested, but the full loop is a manual smoke test.

Verification

cargo test (200 pass) incl. a new test asserting the bundled skill resolves; cargo clippy --all-targets clean; nix build .#evie ships share/evie/skills/evie/SKILL.md.

Closes #61. Lets the notes agent drive evie through the Control Plane: an in-conversation "remind me in 1h to X" becomes a real Schedule the agent creates via the `evie` CLI. ## Env injection at spawn The Daemon injects `EVIE_CHAT_ID` (the session's own chat) and `EVIE_SOCKET` into every spawned `pi` process environment, so the agent's `evie …` calls target its own chat and daemon with no arguments. Plumbed through `PiSpawnConfig`/`SessionManagerConfig` and applied to interactive and Ephemeral Sessions alike. ## Bundled evie CLI Skill `skills/evie/SKILL.md` documents the Control Plane CLI: every Verb, the injected env vars, and the idempotent `--update` schedule contract (`evie <verb> --help` carries the flag detail). Per ADR 0006 this is a Skill over pi's shell/command-exec tool, not a custom extension. Rather than push absolute-path wiring onto every deployment's `[pi].skills`, the skill is **always loaded automatically** at spawn, since it's intrinsic to the daemon↔agent integration, not user-tunable config: - `bundled_skill_dir()` resolves the installed layout (`<exe>/../share/evie/skills/evie`, shipped by the Nix package) first, falling back to the source tree for `cargo run`. - Injected via `--skill` on every spawn, deduped against configured skills. - The Nix package installs `skills/` to `$out/share/evie/skills`. ## Acceptance criteria - [x] Interactive `pi` spawned with `EVIE_CHAT_ID` + `EVIE_SOCKET`. - [x] In-repo pi Skill documents the evie CLI; loaded automatically (supersedes manual `[pi].skills` wiring). - [x] `schedule --name` collisions/updates honour the schedule contract (`--update` idempotent re-issue). - [x] Uses CONTEXT.md vocabulary (Skill, Control Plane, CLI); respects ADR 0006. - [ ] Live Telegram "remind me…" demo — needs a running daemon with provider + Telegram credentials; the dependencies (env injection, skill availability, schedule Verbs) are each unit-tested, but the full loop is a manual smoke test. ## Verification `cargo test` (200 pass) incl. a new test asserting the bundled skill resolves; `cargo clippy --all-targets` clean; `nix build .#evie` ships `share/evie/skills/evie/SKILL.md`.
- Add chat_id and socket_path to PiSpawnConfig, inject as env vars in spawn
- Add socket_path to SessionManagerConfig, plumb through to every PiSpawnConfig
- Create skills/evie/SKILL.md documenting the evie CLI verbs
- Update default config comment to reference the in-repo skill

Part of #61
feat: always load the bundled evie CLI skill when spawning pi
All checks were successful
CI / check (pull_request) Successful in 1m37s
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s
29dff58421
The evie skill documenting the Control Plane CLI is intrinsic to the
daemon<->agent integration, not user-tunable config, so inject it at every
pi spawn instead of relying on [pi].skills. Resolution prefers the installed
layout (<exe>/../share/evie/skills/evie, shipped by the Nix package) and
falls back to the source tree for cargo run. Deduped against configured skills.

Part of #61
weiwen merged commit d23224bdbd into main 2026-07-12 18:32:46 +08:00
weiwen deleted branch issue-61 2026-07-12 18:32:46 +08:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/evie!68
No description provided.