dkountanis~maya-chief-of-staff
View the agent and its source on the Agent Hub.
At a glance
- Agent type: auto-managed TypeScript agent
- Integrations: Google Calendar (read-only) and, for direct delivery, Slack
- Runs from: a schedule trigger, or a session with JSON input
- LLM calls: one per brief
- Reads a window that starts now, runs for a set number of hours, and never crosses local midnight in your timezone
- Keeps at most 20 source events, 12 events in the brief, and 6 conflicts
- States when the Calendar was only partly available, or unavailable, instead of filling the gap
- Gives each day’s brief a stable ID, and checks Slack for it before posting, so a retry doesn’t post twice
- Returns the brief instead of posting it when called with
delivery: "return" - Has no tools that create or change Calendar events
How it works
1
Resolve a safe window
Workspace variables set the timezone, the Calendar, the look-ahead period, the Slack channel, and the Slack bot’s identity. The input can’t override the channel.
2
Gather bounded evidence
Maya reads the configured Calendar once. Synchronous helpers normalize the timestamps and detect overlaps. Event descriptions, URLs, and provider IDs never reach the LLM prompt.
3
Synthesize from normalized facts
The LLM receives a capped packet of normalized events and writes only the executive summary. Deterministic code renders the headings, event lines, conflicts, source status, and the brief’s ID marker.
4
Deliver or hand off
In direct mode, Maya reads one page of the Slack channel’s history first. If it finds its own message with today’s marker, it skips the post. In return mode, it makes no Slack calls and returns the rendered text.
Build the agent
Define the input and output
Configuration lives in workspace variables. The input chooses how Maya was invoked and how to deliver, but can’t supply a Calendar ID or a Slack destination:Register the Calendar and Slack tools
Only the Calendar read comes from a service package. Each Slack operation is registered on its own withguildServiceTool:
google-calendar-oauth, the integration’s name in the live catalog. That’s needed only because the 1.0.0 package it pins was generated before a codegen fix. A package version generated after the fix already carries the right name and doesn’t need the rewrite.
Resolve the local-day window
The look-ahead period never crosses local midnight:Detect conflicts without the LLM
Conflict detection is deterministic and capped. Because the events are sorted, the inner loop stops as soon as later events can no longer overlap:Gather, synthesize, and deliver
The I/O stays thin. Normalization and rendering are synchronous helpers kept outside the compiled state machine, as Coded agents recommends:Fail closed during the duplicate check
Don’t treat incomplete Slack history as “marker absent.” A history page that’s malformed, or that has more messages beyond it, isn’t proof that today’s brief hasn’t been posted:Set it up
1
Add the agent
Open
dkountanis~maya-chief-of-staff on the Agent Hub and add it to a workspace.2
Connect Google Calendar
Connect a Google Calendar credential, and use a credential policy to limit it to reading events.
3
Set workspace variables
Add these workspace variables, using your own values:
MAYA_SLACK_BOT_USER_ID is the Slack user that posts the brief. Maya looks for its own earlier message when it checks for a duplicate.4
Connect Slack
For direct delivery, connect a Slack credential and limit it to
conversations.history and chat.postMessage. Skip this if you only use return mode.5
Schedule it
Create a schedule trigger that runs Maya every weekday morning in your timezone:
text it returns:
delivery: "return" and posts the returned text itself. That bot runs on its own host with its own credentials. The agent doesn’t include it.
Expected result
The output includesstatus, the rendered text, the normalized brief, a notification, a deliveryReceipt, a deliveryHandoff, and up to eight warnings:
failed without inventing events. In return mode, delivery is skipped on purpose, and the brief itself still succeeds.
Run it locally
From the agent’s directory:Relevant code
Boundaries
Maya doesn’t create or edit Calendar events, read Gmail or Asana, or accept a Slack channel from the caller. The duplicate check stops ordinary retries that run one after another. It isn’t a lock, so two runs that start at the same moment can both post.Related
Coded agents
How TypeScript agents are structured and built.
Schedule triggers
Run an agent on a recurring schedule.
Workspace variables
Configure an agent per workspace without changing its code.
Credential policies
Limit a credential to the operations an agent needs.