Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Quick Ask's `quick_shot` fails with `helper_failed` (the message is the helper's
| `set_model` | `bot`, `model` (empty: back to the engine's default, with no `effort`), `effort?` (`minimal`, `low`, `medium`, `high`) | `{}`; kept for the bot, so each new engine of it starts with them; `bots_changed` follows |
| `rewind` | `bot`, `conversation?`, `entry` (a prompt's `nonce`), `fork` | Without `fork`: `{}` once the engine went back; the service then removes that prompt and what followed from the conversation's history and sends `history_changed`. With `fork` ("fork from here"): `{conversation}` once the engine went on in a copy; the new conversation holds the old one's history up to, not with, that prompt, and is the bot's current one (`conversations_changed` follows). The old conversation and its engine session are left as they were, so nothing is taken away; `busy` while the bot works in another conversation. The removed prompts' nonces stay used in the ledger, so a late retry of one is answered `duplicate` and does not undo the rewind: send new prompts with new nonces. |
| `list_routines` | `bot` | `{routines:[Routine]}` |
| `set_routine` | `bot`, `routine`, `keepPrecheck` (optional) | `{routine}`. No `routine.id`: create; with one: replace. `routine.precheck` is approved by this call: see "Before a run starts". `routine.watch` is checked by it: see "Watching a connector". Only Bate's own window sets a precheck or a watch: from a device on the network a frame whose `routine` has a `precheck` or a `watch` key (to add, change or clear one) is refused with `forbidden`, and any other `set_routine` from a device leaves the stored precheck and watch as they are: the network page adds `keepPrecheck: true`, which says "keep them, whatever `routine.precheck` and `routine.watch` say". A window sends no `keepPrecheck`; for it a routine without `precheck` or `watch` has none |
| `set_routine` | `bot`, `routine`, `keepPrecheck` (optional) | `{routine}`. No `routine.id`: create; with one: replace. `routine.precheck` is approved by this call: see "Before a run starts". `routine.watch` is checked by it: see "Watching a connector". `routine.deliverChannel` (`"telegram"` or `"discord"`) and `routine.deliverChat` (a currently paired chat id for that bot on that channel) optionally send the routine's final reply (capped and marked, never including secrets) to that chat when a run finishes `done`. Only Bate's own window sets a precheck, a watch, or channel delivery: from a device on the network a frame whose `routine` has a `precheck`, `watch`, `deliverChannel` or `deliverChat` key (to add, change or clear one) is refused with `forbidden`, and any other `set_routine` from a device leaves them as they are: the network page adds `keepPrecheck: true`. A window sends no `keepPrecheck` |
| `run_routine` | `bot`, `routineId` | `{skipped}`: runs the routine once now, as a normal run recorded with `by` `user`; `skipped` is why it was not run (a sentence), else `null`. Allowed for a routine that is off and one held back by the back-off. `paused` and `busy` when the bot is paused or occupied (also by a precheck that runs), as a webhook is refused; `no_such_routine`; `engine_failed` when the engine could not be started. The answer comes when the start is settled, so after the precheck if there is one. See "Before a run starts" |
| `delete_routine` | `bot`, `routineId` | `{}`. Its past runs go with it. |
| `list_routine_runs` | `bot`, `routineId` | `{runs:[RoutineRun]}`, newest first, at most the last 50 |
Expand Down Expand Up @@ -858,7 +858,7 @@ The same page is reachable from the user's own Tailscale network (no relay of Ba
- Files (`botfile://`) and surfaces open in the pane of Bate's native window only and are not served to LAN devices.
- A device cannot read, set or remove a secret: `answer_secret`, `list_secrets` and `remove_secret` are refused to it. It can only `answer` a secret card with `Deny` (the service refuses any other choice to a secret card, whoever sends it), and its card says that the value is typed in Bate's window on this Mac.
- A device may not change a bot's check, in any form (`set_bot` with `check`, `checkModel` or `checkBot`, refused `forbidden`), as it may not change a precheck: only the person at the window decides whether answers are checked.
- A device may not set or change a routine's `watch` (a frame whose `routine` has a `watch` key, even `null`, is refused `forbidden`; the network page's `keepPrecheck: true` keeps the stored watch too): a watch makes the service call a connector tool on its own, which only the person at the window decides.
- A device may not set or change a routine's `watch`, `deliverChannel`, or `deliverChat` (a frame whose `routine` has any of those keys, even `null`, is refused `forbidden`; the network page's `keepPrecheck: true` keeps them as stored): a watch makes the service call a connector tool on its own, and channel pairing is local-only, so only the person at the window decides.

### Speech (the window, not the service)

Expand Down
2 changes: 2 additions & 0 deletions appd/src/botfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ fn check(file: BotFile, now: u64) -> Result<Checked, String> {
last_run: None,
precheck: None,
watch: None,
deliver_channel: None,
deliver_chat: None,
backoff: None,
after: None,
last_check: None,
Expand Down
Loading
Loading