Repository navigation
Add multi-car support and owner approval for family requests - #24
Merged
Merged
Conversation
Several cars can be named and selected with --car or a default. History, alerts, and briefings stay with each car. A family member's sensitive action becomes a pending request the owner approves once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An account with one car behaves as before. An account with several cars can name each one, pick one per command, and keep history, alerts, and briefings separate. A family member can ask for a sensitive action, and the owner approves or denies it. AgentDrive does not send that message itself.
Several cars
agentdrive carslists cars from the vehicle list. It does not wake a car and it never prints a full VIN. A masked tail is shown.agentdrive cars name <tail> <nickname>stores a nickname in the private config home.agentdrive cars default <nickname>sets the default.cars clear-defaultclears it.--car <nickname>selects a car. It may appear before or after the command. With one car,--caris unnecessary and existing commands stay the same.--caror a default.agentdrive check --json --car <nickname>once per car, and the morning job isagentdrive history due --car <nickname>once per car.check,report,where, and history still do not wake the car.Confirmation wording
With one car and no
--car, the sentence is unchanged, for exampleI confirm unlock.When a nickname is in use, the prompt, the sentence, and the result name that car:
Confirm unlock on daily. Type a sentence that names the action and the car and includes confirm:I confirm unlock on dailyOK: unlock on dailyI confirm unlockis not accepted for that car, and a sentence that names a different nickname does not run. A schedule still cannot supply the confirmation.Family requests
agentdrive family add <handle>andagentdrive family allow <handle> <action>record who may ask for what.chargingcovers the charging changes.--as <handle>.agentdrive request list,agentdrive request approve <id>, andagentdrive request deny <id>. Approve runs the action once, and the car must still be in Park at speed 0. A second approve, a deny, an expired request, or an approve from the same family member does not run it.Example relay text:
Tests
tests/test_cars_and_family.pycovers selection, refusal without a default, per-car history and alert dedupe, migration of the existing single-car history, and the request lifecycle: create, list, approve once, deny, expiry, and blocked self-approval. Full pytest passes.