Overview

Three routes behind the bot’s main chat. The brief is generated once per user, bot and local day, however many devices or tabs ask, and is posted as one message in the bot’s main chat. The first-day introduction runs once per user and bot.
This namespace is served by the Allternit API data-plane node (http://127.0.0.1:8013 on the same machine, or your paired or provisioned node). The hosted Cloud API does not route it.

Base URL

All requests need a bearer token. The bot must belong to the caller, and sessionId must be that bot’s main chat.

POST /bots/:id/brief/today

tzOffsetMinutes is the caller’s UTC offset in minutes and decides which local day it is. ask: true means the person asked for the brief (“Brief me”), so it is built even on the first day. The brief object:
  • date, botId, botName, opening, generatedBy (model or fallback).
  • needsYou[]: id, source (inbox or mail), kind, level (urgent or needs_you), title, why, startPrompt.
  • canWait[]: title, note.
  • calendar[]: start, end, title, allDay for the local day.
  • unchecked[]: source, reason, and action ({kind:"connect", connector, label}) when connecting would fix it.
  • elsewhere: how many items wait on other bots.
startPrompt is the text to send as the first message of a new task thread (POST /threads with kind: "task"). The Start button does exactly that.

How it is built

  • Items come from the Needs-you inbox, ranked with the quiet-hours levels (urgent, needs you, normal, low).
  • Today’s calendar and unread mail come from the Google Calendar and Gmail connectors. If one is not connected or fails, it is listed under unchecked and nothing is claimed about it.
  • The bot writes the opening line and a short reason for each row with its own model, in a scratch session with every tool denied. Mail and calendar text is fenced as untrusted data, and the model can only refer to rows by number.
  • Unread mail is not sorted yet: it appears as one “not sorted yet” line until the mail triage classifier is wired in.

POST /bots/:id/intro

On a new bot’s first open, builds and posts three short bubbles (who you are, three ways to help, an invitation to correct it) and returns {"status":"posted","intro":{"bubbles":[...],"needsConnect":[...]}}. Without Gmail or Calendar the bubbles promise nothing about mail, and needsConnect lists the connect cards to show. Later calls return the stored state. Bots created before this feature return {"status":"none"}.

POST /bots/:id/intro/reply

answer is right or off. An off answer with text is saved to the bot’s memory as a correction. The app also sends the answer to the chat as the person’s own message.

Storage

bot_briefs (unique on user, bot and local date) and bot_intro (primary key user and bot), migration V280.

POST /bots/:id/reach-out

The main bot’s first message. The app calls it when a bot becomes the main bot.
sessionId is optional. Without it (or when it is not this bot’s main chat) the server uses the bot’s pinned main chat, else its newest main chat, else makes one and pins it. The first call posts a message into that chat (source bot-reach-out, no model call) with two or three offers built from the person’s connectors, the bot’s email address and computers. Each offer is opened as a bot suggestion (a proposed task thread, answered with POST /threads/:id/approve or /decline). It also writes a bot.message.posted ledger event, which the Desktop event feed and the cloud push sink treat as a new message, and marks the first-day introduction done.