Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

29.5 KB
Raw Blame
// This file has been generated by Specta. Do not edit this file manually.
/**  An attendee supplied to a calendar tool. */
export type AttendeeInput = {
	/**  Attendee email address. */
	email: EmailAddress,
	/**  Whether attendance is optional. */
	isOptional?: boolean,
};

/**  How an out-of-office event handles conflicting invitations. */
export type AutoDeclineModeInput =
/**  Leave conflicting invitations alone. */
"decline_none" |
/**  Decline every conflicting invitation, existing and new. */
"decline_all" |
/**  Decline only invitations that arrive after the event is created. */
"decline_new_only";

/**  The kind of event a create tool call makes. */
export type CalendarEventTypeInput =
/**  A regular calendar event. */
"default" |
/**
 *  A Google out-of-office status event: primary calendar only, timed, no
 *  attendees, and Google shows the user as away and can auto-decline
 *  conflicting invitations.
 */
"out_of_office";

/**  Create a calendar event. */
export type CreateCalendarEvent = CreateCalendarEvent_Serialize | CreateCalendarEvent_Deserialize;

/**  Create a calendar event. */
export type CreateCalendarEvent_Deserialize = {
	/**  Display title. */
	title: string,
	/**  Timed or all-day span. */
	time: EventTimeInput,
	/**  Optional event body. */
	description?: string | null,
	/**  Optional location label. */
	location?: string | null,
	/**  Attendees to invite. */
	attendees?: AttendeeInput[],
	/**  Recurrence properties. */
	recurrenceLines?: string[],
	/**  Calendar to create the event on. */
	calendarId?: string | null,
	/**  Reminder configuration. */
	reminders?: EventRemindersInput | null,
	/**  Whether to attach a Macro meeting link. */
	addMacroCall?: boolean,
	/**  Kind of event to create. */
	eventType?: CalendarEventTypeInput,
	/**  Out-of-office decline behavior. */
	outOfOffice?: OutOfOfficeInput | null,
	/**  What guests may do with the event. */
	guestPolicy?: GuestPolicy | null,
} & {
	/**  Whether to attach the calendar provider's meeting conference. */
	addConference?: boolean,
} | {
	/**  Whether to attach the calendar provider's meeting conference. */
	addGoogleMeet?: boolean,
};

/**  Create a calendar event. */
export type CreateCalendarEvent_Serialize = {
	/**  Display title. */
	title: string,
	/**  Timed or all-day span. */
	time: EventTimeInput,
	/**  Optional event body. */
	description: string | null,
	/**  Optional location label. */
	location: string | null,
	/**  Attendees to invite. */
	attendees: AttendeeInput[],
	/**  Recurrence properties. */
	recurrenceLines: string[],
	/**  Calendar to create the event on. */
	calendarId: string | null,
	/**  Reminder configuration. */
	reminders: EventRemindersInput | null,
	/**  Whether to attach a Macro meeting link. */
	addMacroCall: boolean,
	/**  Whether to attach the calendar provider's meeting conference. */
	addConference: boolean,
	/**  Kind of event to create. */
	eventType: CalendarEventTypeInput,
	/**  Out-of-office decline behavior. */
	outOfOffice: OutOfOfficeInput | null,
	/**  What guests may do with the event. */
	guestPolicy: GuestPolicy | null,
};

/**
 *  Review creation. Decoding it validates every draft; creating a review only
 *  presents the drafts, and the account holder acts separately.
 */
export type CreateReview = CreateReview_Serialize | CreateReview_Deserialize;

/**
 *  Review creation. Decoding it validates every draft; creating a review only
 *  presents the drafts, and the account holder acts separately.
 */
export type CreateReview_Deserialize = {
	/**  Optional code execution that prepared these drafts. */
	executionId?: ExecutionId | null,
	/**  Stack label. */
	title: ReviewTitle,
} & ReviewDrafts_Deserialize;

/**
 *  Review creation. Decoding it validates every draft; creating a review only
 *  presents the drafts, and the account holder acts separately.
 */
export type CreateReview_Serialize = {
	/**  Optional code execution that prepared these drafts. */
	executionId: ExecutionId | null,
	/**  Stack label. */
	title: ReviewTitle,
} & ReviewDrafts_Serialize;

/**  Surface of a review decision. */
export type DecisionVia =
/**  Review card. */
"card" |
/**  Owner request in chat. */
"chat" |
/**  Inbox action. */
"inbox";

/**  One to [`MAX_DRAFTS`] drafts of one kind. */
export type DraftList<Draft> = Draft[];

/**  An address that passes [`is_valid_email`]; decoding rejects any other string. */
export type EmailAddress = string;

/**  A Macro document attached to an outgoing email as a file. */
export type EmailAttachment = {
	/**
	 *  The id of the Macro document to attach. It must be a stored file -
	 *  an uploaded PDF, image, spreadsheet, Word document, or other upload -
	 *  that the user can view. A Macro-native document (one written in the
	 *  editor) has no file to attach; link to it in the body instead.
	 */
	documentId: string,
};

/**  A recipient for an email. */
export type EmailRecipient = {
	/**  The recipient's email address. */
	email: EmailAddress,
	/**  The recipient's display name (optional). */
	name?: string | null,
};

/**  One reminder override supplied to a calendar tool. */
export type EventReminderOverrideInput = {
	/**  Provider reminder method. `popup` creates a Macro notification. */
	method: string,
	/**  Minutes before the event start. */
	minutes: number,
};

/**  Reminder configuration supplied when creating a calendar event. */
export type EventRemindersInput = {
	/**  Whether the selected calendar's default reminders should apply. */
	useDefault: boolean,
	/**  Overrides used when calendar defaults are disabled. */
	overrides?: EventReminderOverrideInput[],
};

/**  The mutually exclusive time shape supplied to calendar tools. */
export type EventTimeInput =
/**  A clock-time event with absolute instants. */
{ kind: "timed";
/**  Inclusive start instant, RFC 3339 UTC (e.g. 2026-08-20T17:00:00Z). */
startsAt: string;
/**  Exclusive end instant, RFC 3339 UTC. Must be after the start. */
endsAt: string;
/**
 *  IANA time zone the event was scheduled in (e.g.
 *  America/New_York). Recurring events expand in this zone.
 */
timeZone?: string | null } |
/**  An all-day event spanning whole local dates. */
{ kind: "allDay";
/**  Inclusive local start date (YYYY-MM-DD). */
startDate: string;
/**
 *  Exclusive local end date (YYYY-MM-DD); the day after the last
 *  covered day, so a one-day event ends the next date.
 */
endDate: string };

/**  Caller-selected UUID persisted in tool input before execution begins. */
export type ExecutionId = string;

/**
 *  The switches an organizer sets on an event to bound what its guests may
 *  do. Google omits a switch from the payload while it holds its default.
 */
export type GuestPolicy = {
	/**  Whether guests may change the event, including its guest list. */
	canModify: boolean,
	/**  Whether guests may invite others. */
	canInviteOthers: boolean,
	/**  Whether guests may see the guest list. */
	canSeeOtherGuests: boolean,
};

/**
 *  The one draft an import review carries: which source's staged plan it
 *  presents, the plan rows the user took out of it, and the rows whose
 *  sharing they changed: `shared` to share with their team, `personal` to
 *  keep to themselves.
 */
export type ImportDraft = {
	/**  The staged plan's source; fixed once the review is presented. */
	source: ImportReviewSource,
	/**  Plan rows left out of the import. */
	excluded?: string[],
	/**  Plan rows shared with the team although the plan keeps them private. */
	shared?: string[],
	/**  Plan rows kept private although the plan shares them. */
	personal?: string[],
};

/**
 *  What an imported item is in its source system. Each source has its own
 *  kinds; a Notion database and a Notion page, or a Linear project and a
 *  Linear issue, are tracked and deduplicated separately.
 */
export type ImportKind =
/**  A Linear issue. */
"issue" |
/**  A Linear project. */
"project" |
/**  A Linear document. */
"document" |
/**  A Notion page. */
"page" |
/**  A Notion database. */
"database" |
/**  One data source (table) of a Notion database. */
"data_source" |
/**  One row of a Notion data source. */
"row" |
/**  A Jira issue. */
"jira_issue" |
/**  A Jira project. */
"jira_project" |
/**  A Jira epic grouping. */
"jira_epic" |
/**  A Slack channel. */
"channel";

/**  Which source's staged plan an import review presents. */
export type ImportReviewSource =
/**  A Notion workspace plan, staged by ImportFromNotion. */
"notion" |
/**  A Linear plan, staged by ImportFromLinear. */
"linear" |
/**  A Jira plan, staged by ImportFromJira. */
"jira";

/**  Review item state, shared with notification consumers. */
export type ItemStatus =
/**  Still awaiting a decision. */
"pending" |
/**  Claimed for execution. */
"submitting" |
/**  Confirmed complete. */
"completed" |
/**  Dismissed by the owner. */
"dismissed" |
/**  Outcome requires reconciliation. */
"unknown";

/**  Where a Notion workspace import stands. */
export type NotionImportReport = NotionImportReport_Serialize | NotionImportReport_Deserialize;

/**  Where a Notion workspace import stands. */
export type NotionImportReport_Deserialize = {
	/**  Provider items skipped because they were unreadable, or optional features unavailable. */
	warnings?: string[],
	/**  Tracker issues in the plan. */
	issues?: number,
	/**  Tracker groups written as Macro projects. */
	projects?: number,
	/**
	 *  The run's state: `running` while planning, `ready` once a plan is
	 *  staged, `importing` while writing, `completed`, `failed`, or
	 *  `dismissed` when cancelled. Absent before the first run.
	 */
	status?: RunStatus | null,
	/**  Why the run failed, when it did. */
	error?: string | null,
	/**  What planning has found in Notion so far, while it is `running`. */
	scanned?: ScanCounts | null,
	/**  Pages in the plan. */
	pages: number,
	/**  Data sources (database tables) in the plan. */
	dataSources: number,
	/**
	 *  Plan objects the decision model has not answered for yet, while
	 *  planning is still `running`.
	 */
	deciding?: number,
	/**
	 *  Whether the user is on a team. Without one, everything the import
	 *  writes stays visible only to them.
	 */
	onTeam?: boolean,
	/**  Objects to copy as they are. */
	copy: number,
	/**  Data sources whose rows become tasks. */
	tasks: number,
	/**  Objects left in Notion. */
	skip: number,
	/**  Objects that need handling by hand. */
	hand: number,
	/**  Pages written as documents. */
	documents: number,
	/**  Data sources written as databases. */
	databases: number,
	/**  Rows those databases hold, every one counted while planning. */
	databaseRows: number,
	/**  Tasks the task lists become, one per row. */
	taskRows: number,
	/**  Plan objects already imported. */
	imported: number,
	/**  Plan objects still waiting to be written. */
	waiting: number,
	/**  Plan objects being written now. */
	writing: number,
	/**
	 *  Plan objects waiting for a teammate who is writing the same object
	 *  for the team; they link to the teammate's copy once it is written.
	 */
	waitingOnTeammates?: number,
	/**  Written plan objects shared with the user's team. */
	sharedWithTeam?: number,
	/**
	 *  Plan objects a teammate already imported and shared with the team;
	 *  they link to that copy and are not counted as copies.
	 */
	alreadyInMacro?: number,
	/**  Who imported the objects already in Macro, most first. */
	alreadyImportedBy?: NotionImporter[],
	/**  The review the plan is tied to, once presented. */
	reviewId?: string | null,
	/**  Objects that need handling by hand, with reasons. */
	handItems?: NotionReportItem_Deserialize[],
	/**  Objects that failed to import, with the failure. */
	failures?: NotionReportItem_Deserialize[],
};

/**  Where a Notion workspace import stands. */
export type NotionImportReport_Serialize = {
	/**  Provider items skipped because they were unreadable, or optional features unavailable. */
	warnings?: string[],
	/**  Tracker issues in the plan. */
	issues: number,
	/**  Tracker groups written as Macro projects. */
	projects: number,
	/**
	 *  The run's state: `running` while planning, `ready` once a plan is
	 *  staged, `importing` while writing, `completed`, `failed`, or
	 *  `dismissed` when cancelled. Absent before the first run.
	 */
	status?: RunStatus | null,
	/**  Why the run failed, when it did. */
	error?: string | null,
	/**  What planning has found in Notion so far, while it is `running`. */
	scanned?: ScanCounts | null,
	/**  Pages in the plan. */
	pages: number,
	/**  Data sources (database tables) in the plan. */
	dataSources: number,
	/**
	 *  Plan objects the decision model has not answered for yet, while
	 *  planning is still `running`.
	 */
	deciding: number,
	/**
	 *  Whether the user is on a team. Without one, everything the import
	 *  writes stays visible only to them.
	 */
	onTeam: boolean,
	/**  Objects to copy as they are. */
	copy: number,
	/**  Data sources whose rows become tasks. */
	tasks: number,
	/**  Objects left in Notion. */
	skip: number,
	/**  Objects that need handling by hand. */
	hand: number,
	/**  Pages written as documents. */
	documents: number,
	/**  Data sources written as databases. */
	databases: number,
	/**  Rows those databases hold, every one counted while planning. */
	databaseRows: number,
	/**  Tasks the task lists become, one per row. */
	taskRows: number,
	/**  Plan objects already imported. */
	imported: number,
	/**  Plan objects still waiting to be written. */
	waiting: number,
	/**  Plan objects being written now. */
	writing: number,
	/**
	 *  Plan objects waiting for a teammate who is writing the same object
	 *  for the team; they link to the teammate's copy once it is written.
	 */
	waitingOnTeammates: number,
	/**  Written plan objects shared with the user's team. */
	sharedWithTeam: number,
	/**
	 *  Plan objects a teammate already imported and shared with the team;
	 *  they link to that copy and are not counted as copies.
	 */
	alreadyInMacro: number,
	/**  Who imported the objects already in Macro, most first. */
	alreadyImportedBy: NotionImporter[],
	/**  The review the plan is tied to, once presented. */
	reviewId?: string | null,
	/**  Objects that need handling by hand, with reasons. */
	handItems: NotionReportItem_Serialize[],
	/**  Objects that failed to import, with the failure. */
	failures: NotionReportItem_Serialize[],
};

/**  A teammate who already imported some of a plan's objects. */
export type NotionImporter = {
	/**  The teammate, by email. */
	by: string,
	/**  How many of the plan's objects they imported. */
	count: number,
};

/**  One object a workspace import report calls out. */
export type NotionReportItem = NotionReportItem_Serialize | NotionReportItem_Deserialize;

/**  One object a workspace import report calls out. */
export type NotionReportItem_Deserialize = {
	/**  The ledger row. */
	importId: string,
	/**  The object's title. */
	title: string,
	/**  What the object is. */
	kind: ImportKind,
	/**  Its Notion URL. */
	url?: string | null,
	/**  Why it is called out: the decision model's reason, or the failure. */
	reason?: string | null,
};

/**  One object a workspace import report calls out. */
export type NotionReportItem_Serialize = {
	/**  The ledger row. */
	importId: string,
	/**  The object's title. */
	title: string,
	/**  What the object is. */
	kind: ImportKind,
	/**  Its Notion URL. */
	url?: string | null,
	/**  Why it is called out: the decision model's reason, or the failure. */
	reason?: string | null,
};

/**  Out-of-office decline behavior supplied to the calendar tools. */
export type OutOfOfficeInput = {
	/**
	 *  How conflicting invitations are handled. Defaults to declining nothing,
	 *  so the event only blocks time and shows the away status.
	 */
	autoDeclineMode?: AutoDeclineModeInput | null,
	/**  Message returned to organizers whose invitations are auto-declined. */
	declineMessage?: string | null,
};

/**  One atomic user decision against the displayed revision. */
export type ReviewDecision = ReviewDecision_Serialize | ReviewDecision_Deserialize;

/**  Facts about the most recent account-holder decision. */
export type ReviewDecisionContext = {
	/**  Authenticated account holder. */
	by: string,
	/**  Entry surface. */
	via: DecisionVia,
	/**  Revision claimed by this batch, used in notification deduplication. */
	revision: number,
	/**  Items selected by this decision. */
	items: string[],
};

/**  One atomic user decision against the displayed revision. */
export type ReviewDecision_Deserialize =
/**  Save one edited draft. */
({ action: "edit";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending item to update. */
item: string;
/**  Replacement action arguments, keyed by the review's kind. */
draft: ReviewDraft_Deserialize }) & { items?: never } |
/**  Send/create selected items, or all pending items when empty. */
({ action: "submit";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending items, or an empty list to select all pending items. */
items: string[] }) & { draft?: never; item?: never } |
/**  Dismiss selected pending items, or all pending items when empty. */
({ action: "dismiss";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending items, or an empty list to select all pending items. */
items: string[] }) & { draft?: never; item?: never };

/**  One atomic user decision against the displayed revision. */
export type ReviewDecision_Serialize =
/**  Save one edited draft. */
({ action: "edit";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending item to update. */
item: string;
/**  Replacement action arguments, keyed by the review's kind. */
draft: ReviewDraft_Serialize }) & { items?: never } |
/**  Send/create selected items, or all pending items when empty. */
({ action: "submit";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending items, or an empty list to select all pending items. */
items: string[] }) & { draft?: never; item?: never } |
/**  Dismiss selected pending items, or all pending items when empty. */
({ action: "dismiss";
/**  Revision displayed by the caller. */
revision: number;
/**  Pending items, or an empty list to select all pending items. */
items: string[] }) & { draft?: never; item?: never };

/**  One replacement draft, keyed by the kind of the review it edits. */
export type ReviewDraft = ReviewDraft_Serialize | ReviewDraft_Deserialize;

/**  One replacement draft, keyed by the kind of the review it edits. */
export type ReviewDraft_Deserialize =
/**  An edited email. */
{ kind: "email"; draft: SendEmail } |
/**  An edited calendar event. */
{ kind: "calendar"; draft: CreateCalendarEvent_Deserialize } |
/**  An edited import plan selection. */
{ kind: "import"; draft: ImportDraft };

/**  One replacement draft, keyed by the kind of the review it edits. */
export type ReviewDraft_Serialize =
/**  An edited email. */
{ kind: "email"; draft: SendEmail } |
/**  An edited calendar event. */
{ kind: "calendar"; draft: CreateCalendarEvent_Serialize } |
/**  An edited import plan selection. */
{ kind: "import"; draft: ImportDraft };

/**  The drafts a new review presents, keyed by the review's kind. */
export type ReviewDrafts = ReviewDrafts_Serialize | ReviewDrafts_Deserialize;

/**  The drafts a new review presents, keyed by the review's kind. */
export type ReviewDrafts_Deserialize =
/**  Emails, each sent with the SendEmail action (Markdown body). */
{ kind: "email"; drafts: DraftList<SendEmail> } |
/**  Calendar events, each created with the CreateCalendarEvent action. */
{ kind: "calendar"; drafts: DraftList<CreateCalendarEvent_Deserialize> } |
/**  Exactly one staged import plan, approved as one item. */
{ kind: "import"; drafts: [ImportDraft] };

/**  The drafts a new review presents, keyed by the review's kind. */
export type ReviewDrafts_Serialize =
/**  Emails, each sent with the SendEmail action (Markdown body). */
{ kind: "email"; drafts: DraftList<SendEmail> } |
/**  Calendar events, each created with the CreateCalendarEvent action. */
{ kind: "calendar"; drafts: DraftList<CreateCalendarEvent_Serialize> } |
/**  Exactly one staged import plan, approved as one item. */
{ kind: "import"; drafts: [ImportDraft] };

/**  Persisted review identity. */
export type ReviewId = string;

/**  One editable item and its durable outcome. */
export type ReviewItem<Draft, Outcome> = {
	/**  Arguments for the existing composer and action. */
	draft: Draft,
	/**  The action's confirmed response, never a model assertion. */
	result: Outcome | null,
} & ReviewItemState;

/**  Item facts every kind shares. */
export type ReviewItemState = {
	/**  Stable item identity across stack navigation and edits. */
	id: string,
	/**  Whether the account holder edited this draft before deciding. */
	edited?: boolean,
	/**  Current outcome. */
	status: ItemStatus,
	/**  Failure or uncertainty description. */
	error: string | null,
};

/**  Saved items keyed by the review's kind. */
export type ReviewItems = ReviewItems_Serialize | ReviewItems_Deserialize;

/**  Saved items keyed by the review's kind. */
export type ReviewItems_Deserialize =
/**  Email drafts and their send responses. */
{ kind: "email"; items: (ReviewItem<SendEmail, SendEmailResponse>)[] } |
/**  Calendar drafts and their created events. */
{ kind: "calendar"; items: (ReviewItem<CreateCalendarEvent_Deserialize, ToolCalendarEvent>)[] } |
/**  The import plan selection and the started write's report. */
{ kind: "import"; items: [(ReviewItem<ImportDraft, NotionImportReport_Deserialize>)] };

/**  Saved items keyed by the review's kind. */
export type ReviewItems_Serialize =
/**  Email drafts and their send responses. */
{ kind: "email"; items: (ReviewItem<SendEmail, SendEmailResponse>)[] } |
/**  Calendar drafts and their created events. */
{ kind: "calendar"; items: (ReviewItem<CreateCalendarEvent_Serialize, ToolCalendarEvent>)[] } |
/**  The import plan selection and the started write's report. */
{ kind: "import"; items: [(ReviewItem<ImportDraft, NotionImportReport_Serialize>)] };

/**  Full UI record, fetched outside the model context. */
export type ReviewRecord = ReviewRecord_Serialize | ReviewRecord_Deserialize;

/**  Full UI record, fetched outside the model context. */
export type ReviewRecord_Deserialize = {
	/**  Review identity. */
	id: ReviewId,
	/**  Owning session. */
	sessionId: string,
	/**  Account whose email/calendar the drafts use. */
	actingUser: string,
	/**  Originating code execution, absent for directly presented reviews. */
	executionId: ExecutionId | null,
	/**  Durable presentation acknowledgment, separate from user decisions. */
	presentedAt?: number | null,
	/**  Stack label. */
	title: ReviewTitle,
	/**  Compare-and-swap revision for edits and submissions. */
	revision: number,
	/**  Milliseconds since epoch of the last state change. */
	updatedAt: number,
	/**  Current batch's authenticated decision, preserved for interrupted work. */
	decision?: ReviewDecisionContext | null,
} & ReviewItems_Deserialize;

/**  Full UI record, fetched outside the model context. */
export type ReviewRecord_Serialize = {
	/**  Review identity. */
	id: ReviewId,
	/**  Owning session. */
	sessionId: string,
	/**  Account whose email/calendar the drafts use. */
	actingUser: string,
	/**  Originating code execution, absent for directly presented reviews. */
	executionId: ExecutionId | null,
	/**  Durable presentation acknowledgment, separate from user decisions. */
	presentedAt: number | null,
	/**  Stack label. */
	title: ReviewTitle,
	/**  Compare-and-swap revision for edits and submissions. */
	revision: number,
	/**  Milliseconds since epoch of the last state change. */
	updatedAt: number,
	/**  Current batch's authenticated decision, preserved for interrupted work. */
	decision: ReviewDecisionContext | null,
} & ReviewItems_Serialize;

/**  A review stack label: not blank, at most 256 characters. */
export type ReviewTitle = string;

/**  Lifecycle of a discovery run (one per user × source). */
export type RunStatus =
/**
 *  Slack discovery is staging candidates, or a Notion workspace import is
 *  being planned.
 */
"running" |
/**  Discovery or planning finished; staged rows (if any) are ready. */
"ready" |
/**  An approved Notion workspace import plan is being written. */
"importing" |
/**
 *  A Notion workspace import finished writing; `error` notes objects
 *  that could not be imported.
 */
"completed" |
/**  Discovery, planning or writing failed; `error` has details. Retryable. */
"failed" |
/**
 *  A Notion workspace import was cancelled. Older rows may hold it from
 *  the removed onboarding import, where it meant a dismissed section.
 */
"dismissed";

/**  What a planning run has found in the source so far. */
export type ScanCounts = {
	/**  Pages found. */
	pages: number,
	/**  Data sources (database tables) found. */
	dataSources: number,
};

/**  Compose and send an email. Creates a draft and immediately queues it for delivery. */
export type SendEmail = {
	/**  The subject line of the email. */
	subject: string,
	/**
	 *  The address of the inbox to send from, when the user has more than one
	 *  connected and this email belongs to a particular one. Use the exact
	 *  `emailAddress` of a connected inbox — `ListInboxes` lists them, and
	 *  `GetThread` reports the `inbox` a thread belongs to. Omit it unless
	 *  you know which inbox is right: a reply then goes out from the inbox
	 *  that received the message it answers, and a new email from the user's
	 *  primary inbox. The user can change it in the composer either way.
	 */
	from?: string | null,
	/**
	 *  The body of the email, written as Markdown. A host with a composer
	 *  (chat) replaces this with the base64url-encoded HTML the composer
	 *  exported before the tool runs; a host without one (an agent session)
	 *  leaves the Markdown, and this tool renders it the same way.
	 */
	body: string,
	/**  The primary recipients (To field). */
	to: EmailRecipient[],
	/**  Carbon copy recipients (optional). */
	cc?: EmailRecipient[],
	/**  Blind carbon copy recipients (optional). */
	bcc?: EmailRecipient[],
	/**
	 *  The ID of a message to reply to (optional). When set, the email is
	 *  sent as a reply within the same thread.
	 */
	replyingToId?: string | null,
	/**
	 *  Per-message signature override, set by the composer's signature preview —
	 *  not normally by you. Omit to use the inbox's default policy (always on a
	 *  new email; on replies/forwards only when the user enabled it). `false`
	 *  excludes the signature for this one email.
	 */
	includeSignature?: boolean | null,
	/**
	 *  Macro documents to attach as files (optional). Each must be an
	 *  uploaded file the user can view; together they may total 18 MB.
	 */
	attachments?: EmailAttachment[],
};

/**  Response from the SendEmail tool. */
export type SendEmailResponse = ({ sent: {
	/**  The database ID of the sent message. */
	message_id: string,
	/**  The thread ID the message belongs to. */
	thread_id: string,
} }) & { convertedToDraft?: never } | ({ convertedToDraft: {
	draft_id: string,
} }) & { sent?: never } | "userEdited";

/**  A calendar event as returned by the create and update tools. */
export type ToolCalendarEvent = {
	/**
	 *  Macro calendar event id, used by UpdateCalendarEvent and
	 *  DeleteCalendarEvent.
	 */
	eventId: string,
	/**  Display title. */
	title: string,
	/**  Event start: RFC 3339 UTC instant, or YYYY-MM-DD for all-day events. */
	start: string,
	/**
	 *  Exclusive event end: RFC 3339 UTC instant, or YYYY-MM-DD for all-day
	 *  events.
	 */
	end: string,
	/**  Whether the event covers whole days. */
	isAllDay: boolean,
	/**  IANA time zone the event was scheduled in, when known. */
	timeZone: string | null,
	/**  Location label, when set. */
	location: string | null,
	/**  Event body, truncated for brevity. */
	description: string | null,
	/**  Event status: confirmed, tentative, or cancelled. */
	status: string,
	/**  Whether the event recurs. */
	isRecurring: boolean,
	/**  Raw RFC 5545 recurrence properties, when the event recurs. */
	recurrenceLines: string[],
	/**  Attendees, capped at 20; `attendee_count` has the full number. */
	attendees: ToolEventAttendee[],
	/**  Total number of attendees. */
	attendeeCount: number,
	/**  Organizer email address, when known. */
	organizerEmail: string | null,
	/**  Conference join URL, when a conference is attached. */
	conferenceUrl: string | null,
	/**
	 *  Join URL of the Macro call created with the event, when
	 *  CreateCalendarEvent was asked for one.
	 */
	macroCallUrl: string | null,
	/**  Whether the user's calendar prohibits modifying this event. */
	isReadOnly: boolean,
	/**  Calendar the event belongs to, when known. */
	calendarId: string | null,
	/**  Display name of that calendar, when known. */
	calendarName: string | null,
	/**
	 *  Connected inbox address syncing the calendar, when known. It stays the
	 *  user's own address on a colleague's calendar, so it never says whose
	 *  calendar it is.
	 */
	inbox: string | null,
	/**
	 *  Whether the user organizes this event or is a guest on it, through
	 *  that inbox; absent when they are neither, can only write that
	 *  calendar, or a read-only calendar names them organizer.
	 */
	myRole: ToolEventRole | null,
};

/**  An attendee of a calendar event, as returned by calendar tools. */
export type ToolEventAttendee = {
	/**  Attendee email address. */
	email: string,
	/**  RSVP state: needs_action, accepted, declined, or tentative. */
	responseStatus: string,
	/**  Whether this attendee organized the event. */
	isOrganizer: boolean,
	/**  Whether attendance is optional. */
	isOptional: boolean,
};

/**  What the user is on one copy of an event, through the inbox holding it. */
export type ToolEventRole =
/**
 *  The inbox organizes the event, or the event has no guests and is the
 *  user's own. Being able to write someone else's calendar is not this,
 *  nor is a read-only calendar naming them organizer; `viewerCan` says
 *  what the user may do there.
 */
"organizer" |
/**  The inbox is invited to the event. */
"guest";