Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miu-ll/Cody-assistant/llms.txt

Use this file to discover all available pages before exploring further.

All types described on this page are exported from src/types.ts and shared between the renderer, the Electron main process, and the preload bridge. Import them directly in renderer code:
import type {
  AppState,
  AppSettings,
  Task,
  Meeting,
  InboxSuggestion,
  Reminder,
  FocusState,
  FocusMode,
  PetUpdate,
  PetMood,
  PetVariant,
  AiConfig,
  AiProvider,
  OutlookSyncResult,
  Priority,
  TaskStatus,
  Source,
  Recurrence,
} from '../../src/types'
These types are used verbatim in the window.desktop bridge methods. Passing an object that does not match the expected shape will either be rejected by the main-process validation helpers or silently coerced — always use the correct types.

Primitive Union Types

Priority

export type Priority = 'urgent' | 'high' | 'normal'
Represents the importance level of a task. Used to drive sort order and visual priority badges in the UI.
ValueMeaning
'urgent'Requires immediate attention; surfaced at the top of task lists
'high'Important but not time-critical
'normal'Standard priority

TaskStatus

export type TaskStatus = 'pending' | 'done'
Lifecycle state of a task.
ValueMeaning
'pending'Task is active and incomplete
'done'Task has been completed

Source

export type Source = 'email' | 'calendar' | 'manual'
Indicates how a task or item originated.
ValueMeaning
'email'Extracted from an Outlook inbox item
'calendar'Derived from a calendar event
'manual'Created directly by the user

Recurrence

export type Recurrence = 'none' | 'daily' | 'weekly' | 'biweekly' | 'monthly'
Controls how often a recurring task repeats.
ValueMeaning
'none'One-time task
'daily'Repeats every day
'weekly'Repeats every week
'biweekly'Repeats every two weeks
'monthly'Repeats once a month

PetVariant

export type PetVariant = 'bunny' | 'froggo' | 'panda' | 'cow' | 'cat' | 'dog'
The visual character skin for the desktop pet. The selected variant is persisted in AppSettings.petVariant.

Task

export interface Task {
  id: string
  title: string
  detail: string
  category: string
  priority: Priority
  dueAt?: string
  status: TaskStatus
  source: Source
  confidence: number
  sender?: string
  subcategory?: string
  workflowStatus?: string
  owner?: string
  recurrence?: Recurrence
  createdAt?: string
  completedAt?: string
}
The core data model for a work item in Cody. Tasks are stored in AppState.tasks.
id
string
required
Unique identifier for the task. Used as a key for reminder scheduling and list reconciliation.
title
string
required
Short, human-readable task title displayed in lists and notifications.
detail
string
required
Extended description or body of the task. May be empty.
category
string
required
Primary category label (e.g. "Work", "Personal"). Categories are managed in AppState.categories.
priority
Priority
required
Urgency level — 'urgent', 'high', or 'normal'.
dueAt
string
ISO 8601 date-time string for when the task is due. Optional; tasks without a due date are considered undated.
status
TaskStatus
required
Current lifecycle status — 'pending' or 'done'.
source
Source
required
Origin of the task — 'email', 'calendar', or 'manual'.
confidence
number
required
AI confidence score in the range 0–1 for tasks extracted by the AI pipeline. Manually created tasks should use 1.
sender
string
Email address or display name of the person who sent the originating message. Present only for source: 'email' tasks.
subcategory
string
Optional finer-grained classification within the primary category.
workflowStatus
string
Optional custom workflow stage label (e.g. "In Review", "Blocked").
owner
string
Optional assignee or owner name for delegated tasks.
recurrence
Recurrence
Recurrence frequency. Defaults to 'none' when not set.
createdAt
string
ISO 8601 timestamp of when the task was created.
completedAt
string
ISO 8601 timestamp of when the task was marked done.

InboxSuggestion

export interface InboxSuggestion extends Omit<Task, 'status'> {
  excerpt: string
  needsReview?: boolean
}
A candidate task extracted from the Outlook inbox by the AI sync pipeline. It extends Task (minus status, since suggestions are pre-acceptance items) and adds two extra fields.
excerpt
string
required
A short snippet from the originating email body, shown in the Inbox review UI so the user can judge relevance before accepting the suggestion.
needsReview
boolean
When true, the AI classifier flagged this suggestion as low-confidence or ambiguous and the user should review it before accepting. Defaults to false when absent.
All other fields (id, title, detail, category, priority, source, confidence, etc.) are inherited from Task. Refer to the Task documentation above for their semantics.

Meeting

export interface Meeting {
  id: string
  title: string
  startsAt: string
  endsAt?: string
  attendees: string[]
  joinUrl?: string
  location?: string
  mode?: 'virtual' | 'in-person' | 'hybrid'
}
A calendar event imported from Outlook. Meetings are stored in AppState.meetings.
id
string
required
Unique identifier for the meeting (typically the Outlook entry ID or a derived hash). Reminder IDs for meetings are prefixed with meeting- followed by this value.
title
string
required
Subject line of the calendar event.
startsAt
string
required
ISO 8601 date-time string for when the meeting begins.
endsAt
string
ISO 8601 date-time string for when the meeting ends. Optional for open-ended or all-day events.
attendees
string[]
required
List of attendee display names or email addresses.
joinUrl
string
Teams or other conferencing join URL. When present and the platform is Windows, the reminder notification includes an action button that opens this URL directly.
location
string
Physical or virtual location string from the calendar event.
mode
'virtual' | 'in-person' | 'hybrid'
Meeting format classification. Derived from the presence of a joinUrl and the calendar event body.

AiProvider

export type AiProvider = 'azure' | 'openai'
Identifies which AI backend to use for email classification.
ValueMeaning
'azure'Azure OpenAI Service (requires endpoint and deployment)
'openai'OpenAI API (requires only apiKey)

AiConfig

export interface AiConfig {
  provider: AiProvider
  apiKey: string
  endpoint?: string
  deployment?: string
}
Credentials and routing information for the AI classification backend used during Outlook sync.
provider
AiProvider
required
The AI backend to use — 'azure' or 'openai'.
apiKey
string
required
API key for the chosen provider. Stored in AppSettings.aiApiKey.
endpoint
string
Base URL for Azure OpenAI Service (e.g. https://my-resource.openai.azure.com/). Required when provider is 'azure'; unused for 'openai'.
deployment
string
Azure deployment name (model deployment) to target. Required when provider is 'azure'; unused for 'openai'.
apiKey is stored in plaintext in cody-data.json inside the Electron userData folder. Avoid logging or transmitting AiConfig objects.

AppSettings

export interface AppSettings {
  userName: string
  reminderMinutes: number
  autoSyncMinutes?: number
  briefingsEnabled?: boolean
  briefingHour?: number
  closingHour?: number
  textScale?: number
  petVariant?: PetVariant
  launchAtLogin?: boolean
  onboarded?: boolean
  aiProvider?: AiProvider
  aiApiKey?: string
  aiEndpoint?: string
  aiDeployment?: string
  outlookAccount?: string
  lastOutlookSync?: string
}
User-facing configuration stored inside AppState.settings.
userName
string
required
The user’s display name. Used in morning/closing briefing messages.
reminderMinutes
number
required
How many minutes before a meeting due time to fire a reminder notification.
autoSyncMinutes
number
Interval in minutes between automatic Outlook syncs. When absent or 0, automatic sync is disabled.
briefingsEnabled
boolean
When true, Cody sends a morning briefing notification and an evening closing briefing.
briefingHour
number
Hour of the day (0–23) at which the morning briefing fires.
closingHour
number
Hour of the day (0–23) at which the closing briefing fires.
textScale
number
UI text scale factor. 1 is the default; 1.25 increases text by 25%.
petVariant
PetVariant
Which pet character skin to display. Defaults to the app’s built-in default when absent.
launchAtLogin
boolean
Whether Cody is registered to start automatically with Windows.
onboarded
boolean
true once the user has completed the onboarding flow. Controls whether the setup wizard is shown on startup.
aiProvider
AiProvider
The AI provider selected by the user.
aiApiKey
string
API key for the configured AI provider.
aiEndpoint
string
Azure OpenAI endpoint URL. Only relevant when aiProvider is 'azure'.
aiDeployment
string
Azure deployment name. Only relevant when aiProvider is 'azure'.
outlookAccount
string
The email address of the Outlook account used for COM sync. Populated after the first successful sync.
lastOutlookSync
string
ISO 8601 timestamp of the most recent successful Outlook sync.

AppState

export interface AppState {
  tasks: Task[]
  suggestions: InboxSuggestion[]
  categories: string[]
  meetings: Meeting[]
  settings: AppSettings
  dismissedSuggestionIds?: string[]
  lastMorningBriefing?: string
  lastClosingBriefing?: string
}
The complete serialized state of the Cody application. This is the shape read and written by loadData and saveData.
tasks
Task[]
required
All active and completed tasks.
suggestions
InboxSuggestion[]
required
Pending inbox suggestions awaiting user review.
categories
string[]
required
The full list of user-defined category labels (e.g. ["Work", "Personal", "Finance"]).
meetings
Meeting[]
required
Calendar events synced from Outlook.
settings
AppSettings
required
User preferences and configuration. See AppSettings.
dismissedSuggestionIds
string[]
IDs of InboxSuggestion items that the user explicitly dismissed (neither accepted nor converted to a task). Used to prevent re-surfacing the same suggestion after the next sync.
lastMorningBriefing
string
ISO 8601 date string of the last day a morning briefing was sent. Used to prevent duplicate briefings.
lastClosingBriefing
string
ISO 8601 date string of the last day a closing briefing was sent.

Reminder

export interface Reminder {
  id: string
  title: string
  body: string
  at: string
  url?: string
}
A scheduled notification payload. Pass this to scheduleReminder.
id
string
required
Unique identifier. Used to deduplicate and cancel reminders. Meeting reminders should use the prefix meeting- (e.g. "meeting-abc123") to receive special Focus-mode handling.
title
string
required
Notification title. Truncated to 240 characters by the main process.
body
string
required
Notification body text. Truncated to 240 characters by the main process.
at
string
required
ISO 8601 date-time string for when the notification should fire. Past timestamps cause scheduleReminder to return false.
url
string
An optional https:// URL. On Windows, the notification is rendered as a rich Toast with an action button that opens this URL (useful for Teams meeting join links). Non-HTTPS URLs are stripped.

FocusMode

export type FocusMode = 'focus' | 'dnd'
The two available focus session modes.
ValueBehaviour
'focus'Suppresses non-meeting reminders; meeting reminders and ad-hoc notifications still fire
'dnd'Suppresses all reminders and notifications for the duration

FocusState

export interface FocusState {
  mode: FocusMode
  until: string
}
The current state of an active focus session, as returned by getFocus and broadcast via onFocusChanged.
mode
FocusMode
required
The active focus mode — 'focus' or 'dnd'.
until
string
required
ISO 8601 date-time string representing when the focus session will automatically end.

PetMood

export type PetMood = 'calm' | 'alert' | 'worried' | 'happy'
The current emotional state of the desktop pet, driven by the state of the task list.
ValueTypical trigger
'calm'No pending urgent tasks
'alert'One or more high-priority tasks
'worried'One or more urgent tasks
'happy'A task was just completed (precedes a 'celebrate' update)

PetUpdate

export type PetUpdate =
  | { type: 'state'; mood: PetMood; urgent: number; pending: number; variant?: PetVariant }
  | { type: 'celebrate' }
A discriminated union passed to petUpdate and received via onPetUpdate. Always check payload.type before accessing other fields. type: 'state' variant
type
'state'
required
Discriminant — identifies this as a state update.
mood
PetMood
required
The pet’s current mood. Controls which animation the pet plays.
urgent
number
required
Count of tasks currently in priority: 'urgent' and status: 'pending'. Displayed as a badge on the pet widget.
pending
number
required
Total count of tasks with status: 'pending' (all priorities).
variant
PetVariant
When present, instructs the pet window to switch to this character skin. Used when the user changes their pet in settings.
type: 'celebrate' variant
type
'celebrate'
required
Discriminant — triggers a one-shot celebration animation in the pet window. No additional fields.
// Sending a state update from the assistant renderer:
await window.desktop.petUpdate({
  type: 'state',
  mood: 'worried',
  urgent: 2,
  pending: 7,
})

// Sending a celebration after a task is completed:
await window.desktop.petUpdate({ type: 'celebrate' })

OutlookSyncResult

export interface OutlookSyncResult {
  accountName: string
  suggestions: InboxSuggestion[]
  meetings: Meeting[]
  categories: string[]
  syncedAt: string
}
The result returned by syncOutlookClassic after a successful COM sync.
accountName
string
required
The email address of the Outlook account that was synced (e.g. "alice@contoso.com"). Persisted to AppSettings.outlookAccount.
suggestions
InboxSuggestion[]
required
New inbox suggestions extracted from unread emails, optionally classified by the AI pipeline.
meetings
Meeting[]
required
Calendar events found in the Outlook calendar for the look-ahead window.
categories
string[]
required
Category labels discovered during the sync (from email folders or AI classification). Merged into AppState.categories.
syncedAt
string
required
ISO 8601 timestamp of when the sync completed. Written to AppSettings.lastOutlookSync.

Build docs developers (and LLMs) love