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.

26.4 KB
Raw Blame
// This file has been generated by Specta. Do not edit this file manually.
/**  A calendar event an agenda lists. */
export type AgendaEvent = AgendaEvent_Serialize | AgendaEvent_Deserialize;

/**  A calendar event an agenda lists. */
export type AgendaEvent_Deserialize = {
  /**  The eventId a calendar tool such as ListCalendarEvents returned. */
  eventId: string;
  /**
   *  One instance of a recurring event: that instance's recurrenceId from
   *  ListCalendarEvents.
   */
  occurrenceKey?: string;
};

/**  A calendar event an agenda lists. */
export type AgendaEvent_Serialize = {
  /**  The eventId a calendar tool such as ListCalendarEvents returned. */
  eventId: string;
  /**
   *  One instance of a recurring event: that instance's recurrenceId from
   *  ListCalendarEvents.
   */
  occurrenceKey?: string;
};

/**  How a container aligns its children across its axis. */
export type Align = 'start' | 'center' | 'end' | 'stretch';

/**  Whether a call was attended. */
export type CallStatus = 'ATTENDED' | 'MISSED' | 'UNATTENDED';

/**  A workspace item a card shows. */
export type CardItem = {
  type: CardItemType;
  /**
   *  The item's id exactly as a tool returned it: a document id (documents
   *  and spreadsheets), an email thread id, a calendar eventId, or a
   *  project, channel, routine, form or initiative id.
   */
  id: string;
};

/**  The kinds of workspace item a card shows. */
export type CardItemType =
  | 'document'
  | 'email_thread'
  | 'calendar_event'
  | 'project'
  | 'channel'
  | 'routine'
  | 'form'
  | 'initiative';

/**  Bounds on a timestamp, as ISO 8601 strings. */
export type DateRangeFilter =
  | DateRangeFilter_Serialize
  | DateRangeFilter_Deserialize;

/**  Bounds on a timestamp, as ISO 8601 strings. */
export type DateRangeFilter_Deserialize = {
  gt?: string;
  gte?: string;
  lt?: string;
  lte?: string;
};

/**  Bounds on a timestamp, as ISO 8601 strings. */
export type DateRangeFilter_Serialize = {
  gt?: string;
  gte?: string;
  lt?: string;
  lte?: string;
};

/**  The axis a container lays its children along. */
export type Direction = 'row' | 'col';

/**  The filters that apply to documents. */
export type DocumentFieldFilters =
  | DocumentFieldFilters_Serialize
  | DocumentFieldFilters_Deserialize;

/**  The filters that apply to documents. */
export type DocumentFieldFilters_Deserialize = {
  documentId?: string[];
  fileType?: string[];
  fileAssoc?: string[];
  subType?: string[];
  projectId?: string[];
  documentOwnerId?: string[];
  documentSeen?: boolean;
  documentDone?: boolean;
  /**  For tasks, whether the current user is an assignee. */
  documentImportance?: boolean;
  isEmailAttachment?: boolean;
  documentCreatedAt?: DateRangeFilter_Deserialize;
  documentUpdatedAt?: DateRangeFilter_Deserialize;
};

/**  The filters that apply to documents. */
export type DocumentFieldFilters_Serialize = {
  documentId?: string[];
  fileType?: string[];
  fileAssoc?: string[];
  subType?: string[];
  projectId?: string[];
  documentOwnerId?: string[];
  documentSeen?: boolean;
  documentDone?: boolean;
  /**  For tasks, whether the current user is an assignee. */
  documentImportance?: boolean;
  isEmailAttachment?: boolean;
  documentCreatedAt?: DateRangeFilter_Serialize;
  documentUpdatedAt?: DateRangeFilter_Serialize;
};

/**  Documents to include and exclude. */
export type DocumentFilterClause =
  | DocumentFilterClause_Serialize
  | DocumentFilterClause_Deserialize;

/**  Documents to include and exclude. */
export type DocumentFilterClause_Deserialize = {
  include?: DocumentFieldFilters_Deserialize;
  exclude?: DocumentFieldFilters_Deserialize;
};

/**  Documents to include and exclude. */
export type DocumentFilterClause_Serialize = {
  include?: DocumentFieldFilters_Serialize;
  exclude?: DocumentFieldFilters_Serialize;
};

/**  Document filter expressions combined. */
export type DocumentFilterCombination =
  | DocumentFilterCombination_Serialize
  | DocumentFilterCombination_Deserialize;

/**  Document filter expressions combined. */
export type DocumentFilterCombination_Deserialize =
  | ({ op: 'and'; clauses: DocumentFilterExpression_Deserialize[] } & {
      clause?: never;
    })
  | ({ op: 'or'; clauses: DocumentFilterExpression_Deserialize[] } & {
      clause?: never;
    })
  | ({ op: 'not'; clause: DocumentFilterExpression_Deserialize } & {
      clauses?: never;
    });

/**  Document filter expressions combined. */
export type DocumentFilterCombination_Serialize =
  | ({ op: 'and'; clauses: DocumentFilterExpression_Serialize[] } & {
      clause?: never;
    })
  | ({ op: 'or'; clauses: DocumentFilterExpression_Serialize[] } & {
      clause?: never;
    })
  | ({ op: 'not'; clause: DocumentFilterExpression_Serialize } & {
      clauses?: never;
    });

/**  A document filter: a clause, or clauses combined with `op`. */
export type DocumentFilterExpression =
  | DocumentFilterExpression_Serialize
  | DocumentFilterExpression_Deserialize;

/**  A document filter: a clause, or clauses combined with `op`. */
export type DocumentFilterExpression_Deserialize =
  | DocumentFilterCombination_Deserialize
  | DocumentFilterClause_Deserialize;

/**  A document filter: a clause, or clauses combined with `op`. */
export type DocumentFilterExpression_Serialize =
  | DocumentFilterCombination_Serialize
  | DocumentFilterClause_Serialize;

/**
 *  Several document filter expressions that all apply, or one. Several comes
 *  first: serde reads a struct from an array too, so a clause would take one.
 */
export type DocumentWhere = DocumentWhere_Serialize | DocumentWhere_Deserialize;

/**
 *  Several document filter expressions that all apply, or one. Several comes
 *  first: serde reads a struct from an array too, so a clause would take one.
 */
export type DocumentWhere_Deserialize =
  | DocumentFilterExpression_Deserialize[]
  | DocumentFilterExpression_Deserialize;

/**
 *  Several document filter expressions that all apply, or one. Several comes
 *  first: serde reads a struct from an array too, so a clause would take one.
 */
export type DocumentWhere_Serialize =
  | DocumentFilterExpression_Serialize[]
  | DocumentFilterExpression_Serialize;

/**  Which shared emails to match. */
export type EmailShared = 'exclude' | 'include' | 'only';

/**  Which mailbox a query reads. */
export type EmailView = 'inbox' | 'drafts' | 'sent' | 'all';

/**  A reference to a workspace item. */
export type EntityRef = {
  id: string;
  type: EntityType;
};

/**  The kinds of workspace item a view can show. */
export type EntityType =
  | 'user'
  | 'chat'
  | 'channel'
  | 'channel_message'
  | 'document'
  | 'project'
  | 'email_thread'
  | 'calendar_event'
  | 'team'
  | 'call'
  | 'foreign_entity'
  | 'static_file'
  | 'crm_company'
  | 'crm_contact'
  | 'crm_pipeline'
  | 'reminder'
  | 'skill'
  | 'agent_session'
  | 'scheduled_action'
  | 'initiative'
  | 'database'
  | 'database_row'
  | 'form'
  | 'external_chat'
  | 'email'
  | 'routine'
  | 'channel_thread';

/**
 *  Every filter, each over one field of one kind of item. Id lists match any
 *  of their ids.
 */
export type FieldFilters = FieldFilters_Serialize | FieldFilters_Deserialize;

/**
 *  Every filter, each over one field of one kind of item. Id lists match any
 *  of their ids.
 */
export type FieldFilters_Deserialize = {
  calendarEventId?: string[];
  threadId?: string[];
  emailLinkId?: string[];
  emailProjectId?: string[];
  emailSender?: string[];
  channelId?: string[];
  channelType?: string[];
  /**
   *  Membership states to match: `[true]` for channels the user is in,
   *  `[true, false]` to also match team channels they have not joined.
   */
  channelIsParticipant?: boolean[];
  channelSenderId?: string[];
  channelMessageThreadId?: string[];
  channelThreadId?: string[];
  channelThreadRootSenderId?: string[];
  channelThreadParticipantId?: string[];
  agentSessionId?: string[];
  agentSessionOwnerId?: string[];
  chatId?: string[];
  chatOwnerId?: string[];
  chatProjectId?: string[];
  folderId?: string[];
  folderOwnerId?: string[];
  callId?: string[];
  callChannelId?: string[];
  callSpeakerId?: string[];
  foreignEntityRecordId?: string[];
  foreignEntitySource?: string[];
  crmCompanyId?: string[];
  /**  Property values to match; distinct properties all apply. */
  properties?: PropertyFilter[];
  /**  Selected tags, combined by `tagFilterMode`. */
  tagFilters?: PropertyFilter[];
  tagFilterMode?: TagFilterMode;
  emailSeen?: boolean;
  emailDone?: boolean;
  emailImportance?: boolean;
  emailShared?: EmailShared;
  emailCalendarOnly?: boolean;
  channelSeen?: boolean;
  channelDone?: boolean;
  channelImportance?: boolean;
  channelThreadSeen?: boolean;
  channelThreadDone?: boolean;
  chatSeen?: boolean;
  chatDone?: boolean;
  folderSeen?: boolean;
  folderDone?: boolean;
  initiativeSeen?: boolean;
  initiativeDone?: boolean;
  foreignEntitySeen?: boolean;
  foreignEntityDone?: boolean;
  foreignEntityIncludesMe?: boolean;
  callStatus?: CallStatus;
  callAttended?: boolean;
  crmCompanyHidden?: boolean;
  crmContactHidden?: boolean;
  /**  Literal text matched against a CRM contact's name or email. */
  crmContactSearch?: string;
  calendarEventSeen?: boolean;
  calendarEventDone?: boolean;
  includeAgentSessions?: boolean;
  chatCreatedAt?: DateRangeFilter_Deserialize;
  chatUpdatedAt?: DateRangeFilter_Deserialize;
  folderCreatedAt?: DateRangeFilter_Deserialize;
  folderUpdatedAt?: DateRangeFilter_Deserialize;
  emailUpdatedAt?: DateRangeFilter_Deserialize;
} & DocumentFieldFilters_Deserialize;

/**
 *  Every filter, each over one field of one kind of item. Id lists match any
 *  of their ids.
 */
export type FieldFilters_Serialize = {
  calendarEventId?: string[];
  threadId?: string[];
  emailLinkId?: string[];
  emailProjectId?: string[];
  emailSender?: string[];
  channelId?: string[];
  channelType?: string[];
  /**
   *  Membership states to match: `[true]` for channels the user is in,
   *  `[true, false]` to also match team channels they have not joined.
   */
  channelIsParticipant?: boolean[];
  channelSenderId?: string[];
  channelMessageThreadId?: string[];
  channelThreadId?: string[];
  channelThreadRootSenderId?: string[];
  channelThreadParticipantId?: string[];
  agentSessionId?: string[];
  agentSessionOwnerId?: string[];
  chatId?: string[];
  chatOwnerId?: string[];
  chatProjectId?: string[];
  folderId?: string[];
  folderOwnerId?: string[];
  callId?: string[];
  callChannelId?: string[];
  callSpeakerId?: string[];
  foreignEntityRecordId?: string[];
  foreignEntitySource?: string[];
  crmCompanyId?: string[];
  /**  Property values to match; distinct properties all apply. */
  properties?: PropertyFilter[];
  /**  Selected tags, combined by `tagFilterMode`. */
  tagFilters?: PropertyFilter[];
  tagFilterMode?: TagFilterMode;
  emailSeen?: boolean;
  emailDone?: boolean;
  emailImportance?: boolean;
  emailShared?: EmailShared;
  emailCalendarOnly?: boolean;
  channelSeen?: boolean;
  channelDone?: boolean;
  channelImportance?: boolean;
  channelThreadSeen?: boolean;
  channelThreadDone?: boolean;
  chatSeen?: boolean;
  chatDone?: boolean;
  folderSeen?: boolean;
  folderDone?: boolean;
  initiativeSeen?: boolean;
  initiativeDone?: boolean;
  foreignEntitySeen?: boolean;
  foreignEntityDone?: boolean;
  foreignEntityIncludesMe?: boolean;
  callStatus?: CallStatus;
  callAttended?: boolean;
  crmCompanyHidden?: boolean;
  crmContactHidden?: boolean;
  /**  Literal text matched against a CRM contact's name or email. */
  crmContactSearch?: string;
  calendarEventSeen?: boolean;
  calendarEventDone?: boolean;
  includeAgentSessions?: boolean;
  chatCreatedAt?: DateRangeFilter_Serialize;
  chatUpdatedAt?: DateRangeFilter_Serialize;
  folderCreatedAt?: DateRangeFilter_Serialize;
  folderUpdatedAt?: DateRangeFilter_Serialize;
  emailUpdatedAt?: DateRangeFilter_Serialize;
} & DocumentFieldFilters_Serialize;

/**  The space between a container's children, as a Tailwind-ish step. */
export type Gap = number;

/**  The facet a list groups its rows by. */
export type GroupBy = 'date' | 'entity_type' | 'project';

/**  How a container spaces its children along its axis. */
export type Justify = 'start' | 'center' | 'end' | 'between';

/**  Where a list's items come from. */
export type ListSource = ListSource_Serialize | ListSource_Deserialize;

/**  Where a list's items come from. */
export type ListSource_Deserialize =
  /**  The items a filter matches, fetched by the list itself. */
  | ({ kind: 'query'; query: Query_Deserialize } & { entities?: never })
  /**  A fixed set of items. */
  | ({ kind: 'items'; entities: EntityRef[] } & { query?: never });

/**  Where a list's items come from. */
export type ListSource_Serialize =
  /**  The items a filter matches, fetched by the list itself. */
  | ({ kind: 'query'; query: Query_Serialize } & { entities?: never })
  /**  A fixed set of items. */
  | ({ kind: 'items'; entities: EntityRef[] } & { query?: never });

/**  One value of one property. */
export type PropertyFilter = {
  propertyId: string;
  type: PropertyFilterType;
  value: string;
};

/**  What a property filter's value is. */
export type PropertyFilterType = 'select' | 'entity';

/**  A Soup filter query: the items to include and exclude. */
export type Query = Query_Serialize | Query_Deserialize;

/**  A Soup filter query: the items to include and exclude. */
export type Query_Deserialize = {
  include?: FieldFilters_Deserialize;
  exclude?: FieldFilters_Deserialize;
  documentWhere?: DocumentWhere_Deserialize;
  emailView?: EmailView;
};

/**  A Soup filter query: the items to include and exclude. */
export type Query_Serialize = {
  include?: FieldFilters_Serialize;
  exclude?: FieldFilters_Serialize;
  documentWhere?: DocumentWhere_Serialize;
  emailView?: EmailView;
};

/**  How selected tags combine: items with any of them, or with all of them. */
export type TagFilterMode = 'any' | 'all';

/**
 *  One tag of an ontology and the narrower tags under it. A tag may exist
 *  already, or be one the answer proposes.
 */
export type TagNode = TagNode_Serialize | TagNode_Deserialize;

/**
 *  One tag of an ontology and the narrower tags under it. A tag may exist
 *  already, or be one the answer proposes.
 */
export type TagNode_Deserialize = {
  /**
   *  The tag's name. Name a narrower tag on its own: "bug" under "Type",
   *  not "Type/bug".
   */
  label: string;
  /**
   *  One of the tag colours: red, tomato, orange, amber, yellow, green,
   *  teal, blue, indigo, purple, pink, gray. Gray when omitted.
   */
  color?: string;
  /**  What the tag is for, in a few words. */
  description?: string;
  /**
   *  For a tag that exists, the id ListTags or CreateTag returned: the tag
   *  then shows its current name and colour, and opens what is tagged with
   *  it.
   */
  tagId?: string;
  /**  The narrower tags under this one. */
  children?: TagNode_Deserialize[];
};

/**
 *  One tag of an ontology and the narrower tags under it. A tag may exist
 *  already, or be one the answer proposes.
 */
export type TagNode_Serialize = {
  /**
   *  The tag's name. Name a narrower tag on its own: "bug" under "Type",
   *  not "Type/bug".
   */
  label: string;
  /**
   *  One of the tag colours: red, tomato, orange, amber, yellow, green,
   *  teal, blue, indigo, purple, pink, gray. Gray when omitted.
   */
  color?: string;
  /**  What the tag is for, in a few words. */
  description?: string;
  /**
   *  For a tag that exists, the id ListTags or CreateTag returned: the tag
   *  then shows its current name and colour, and opens what is tagged with
   *  it.
   */
  tagId?: string;
  /**  The narrower tags under this one. */
  children?: TagNode_Serialize[];
};

/**  One event of a timeline. */
export type TimelineEvent = TimelineEvent_Serialize | TimelineEvent_Deserialize;

/**  One event of a timeline. */
export type TimelineEvent_Deserialize = {
  /**  Human-readable timestamp, e.g. "9:32am" or "Yesterday". */
  time: string;
  title: string;
  description?: string;
  /**  Links the event to a workspace entity. */
  entity?: EntityRef;
  /**
   *  true = upcoming/future event, rendered gray; omitted/false = past,
   *  rendered accent.
   */
  future?: boolean;
};

/**  One event of a timeline. */
export type TimelineEvent_Serialize = {
  /**  Human-readable timestamp, e.g. "9:32am" or "Yesterday". */
  time: string;
  title: string;
  description?: string;
  /**  Links the event to a workspace entity. */
  entity?: EntityRef;
  /**
   *  true = upcoming/future event, rendered gray; omitted/false = past,
   *  rendered accent.
   */
  future?: boolean;
};

/**  A top-level composed view: a flex column of widgets. */
export type View = View_Serialize | View_Deserialize;

/**  A top-level composed view: a flex column of widgets. */
export type View_Deserialize = {
  title?: string;
  widgets: Widget_Deserialize[];
};

/**  A top-level composed view: a flex column of widgets. */
export type View_Serialize = {
  title?: string;
  widgets: Widget_Serialize[];
};

/**
 *  One block of a view. Layout is order-driven; nesting is achieved with the
 *  `container` widget.
 */
export type Widget = Widget_Serialize | Widget_Deserialize;

/**
 *  One block of a view. Layout is order-driven; nesting is achieved with the
 *  `container` widget.
 */
export type Widget_Deserialize =
  /**
   *  Markdown text: the narrative between the other widgets. Its type is
   *  "md", never "markdown".
   */
  | ({ type: 'md'; markdown: string } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      title?: never;
      wrap?: never;
    })
  /**  A chronological sequence of events. Great for "what happened" answers. */
  | ({
      type: 'timeline';
      title?: string;
      events: TimelineEvent_Deserialize[];
    } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  A list of workspace items, fetched by a filter query or given as a
   *  fixed set of entity references.
   */
  | ({
      type: 'list';
      title?: string;
      source: ListSource_Deserialize;
      /**  Group rows by a facet. */
      groupBy?: GroupBy;
      /**  Cap the number of rows shown. */
      limit?: number;
    } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      items?: never;
      justify?: never;
      markdown?: never;
      messageId?: never;
      tags?: never;
      wrap?: never;
    })
  /**  A single channel message with surrounding context. */
  | ({
      type: 'channelMessage';
      /**  The channel the message belongs to. */
      channelId: string;
      /**  The message to render. */
      messageId: string;
    } & {
      align?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      source?: never;
      tags?: never;
      title?: never;
      wrap?: never;
    })
  /**
   *  A calendar agenda: the events grouped by day with their times, places
   *  and attendees, loaded live from the user's calendars. Use it whenever
   *  an answer is about calendar events instead of listing them in text.
   */
  | ({ type: 'events'; title?: string; events: AgendaEvent_Deserialize[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  Rich cards for the one to four specific items the answer is about: a
   *  document or spreadsheet, an email thread, a calendar event, a project,
   *  a channel, a routine, a form or an initiative. Each card opens its
   *  item, and a routine's card can pause it or run it now. Use a list
   *  widget for longer sets.
   */
  | ({ type: 'cards'; title?: string; items: CardItem[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  Tags as coloured pills, nested to any depth: the user's tags, a
   *  taxonomy the answer proposes, or any other ontology of tags, each with
   *  what it is for. Use it whenever an answer is about tags, instead of a
   *  table or a list in markdown.
   */
  | ({ type: 'tags'; title?: string; tags: TagNode_Deserialize[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      wrap?: never;
    })
  /**  A nestable flex container of widgets. */
  | ({
      type: 'container';
      direction?: Direction;
      /**  Tailwind-ish gap step, 0-8. Defaults to 3. */
      gap?: Gap;
      wrap?: boolean;
      align?: Align;
      justify?: Justify;
      title?: string;
      children: Widget_Deserialize[];
    } & {
      channelId?: never;
      events?: never;
      groupBy?: never;
      items?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
    });

/**
 *  One block of a view. Layout is order-driven; nesting is achieved with the
 *  `container` widget.
 */
export type Widget_Serialize =
  /**
   *  Markdown text: the narrative between the other widgets. Its type is
   *  "md", never "markdown".
   */
  | ({ type: 'md'; markdown: string } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      title?: never;
      wrap?: never;
    })
  /**  A chronological sequence of events. Great for "what happened" answers. */
  | ({ type: 'timeline'; title?: string; events: TimelineEvent_Serialize[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  A list of workspace items, fetched by a filter query or given as a
   *  fixed set of entity references.
   */
  | ({
      type: 'list';
      title?: string;
      source: ListSource_Serialize;
      /**  Group rows by a facet. */
      groupBy?: GroupBy;
      /**  Cap the number of rows shown. */
      limit?: number;
    } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      items?: never;
      justify?: never;
      markdown?: never;
      messageId?: never;
      tags?: never;
      wrap?: never;
    })
  /**  A single channel message with surrounding context. */
  | ({
      type: 'channelMessage';
      /**  The channel the message belongs to. */
      channelId: string;
      /**  The message to render. */
      messageId: string;
    } & {
      align?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      source?: never;
      tags?: never;
      title?: never;
      wrap?: never;
    })
  /**
   *  A calendar agenda: the events grouped by day with their times, places
   *  and attendees, loaded live from the user's calendars. Use it whenever
   *  an answer is about calendar events instead of listing them in text.
   */
  | ({ type: 'events'; title?: string; events: AgendaEvent_Serialize[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  Rich cards for the one to four specific items the answer is about: a
   *  document or spreadsheet, an email thread, a calendar event, a project,
   *  a channel, a routine, a form or an initiative. Each card opens its
   *  item, and a routine's card can pause it or run it now. Use a list
   *  widget for longer sets.
   */
  | ({ type: 'cards'; title?: string; items: CardItem[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
      wrap?: never;
    })
  /**
   *  Tags as coloured pills, nested to any depth: the user's tags, a
   *  taxonomy the answer proposes, or any other ontology of tags, each with
   *  what it is for. Use it whenever an answer is about tags, instead of a
   *  table or a list in markdown.
   */
  | ({ type: 'tags'; title?: string; tags: TagNode_Serialize[] } & {
      align?: never;
      channelId?: never;
      children?: never;
      direction?: never;
      events?: never;
      gap?: never;
      groupBy?: never;
      items?: never;
      justify?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      wrap?: never;
    })
  /**  A nestable flex container of widgets. */
  | ({
      type: 'container';
      direction?: Direction;
      /**  Tailwind-ish gap step, 0-8. Defaults to 3. */
      gap?: Gap;
      wrap?: boolean;
      align?: Align;
      justify?: Justify;
      title?: string;
      children: Widget_Serialize[];
    } & {
      channelId?: never;
      events?: never;
      groupBy?: never;
      items?: never;
      limit?: never;
      markdown?: never;
      messageId?: never;
      source?: never;
      tags?: never;
    });