Build on Malini

Events

Every event Malini emits, when it fires, and the TypeScript shape of its payload.

Open as markdown

Malini announces everything that happens on the platform as an event on a <domain>:<event> channel. An automation can start on any of them, and agents inside Malini can list them with the events_list tool. An automation an event starts sees only the fields listed under An automation sees, unless you let it see the whole event on its page in Automations. This page is generated from the contract in apps/malini/src/contract/events.ts, so it always matches the app.

chat:agent-event

Fires for every event an agent run streams in a chat, such as text, tool calls, approvals and the end of the run, in sequence order. Malini does not keep it in its event log.

An automation sees: sessionId, runId, seq, emittedAt, event.type

Payload: LiveEventEnvelope

interface AgentEventEnvelope {
	sessionId: string;
	runId: string;
	seq: number;
	event: Record<string, unknown>;
	emittedAt?: string;
}

type LiveEventEnvelope = AgentEventEnvelope & { ephemeral?: true };

chat:run-changes-captured

Fires after an agent run that changed files finishes and Malini has recorded the diff of that run.

An automation sees: sessionId, runId

Payload: RunChangesCapturedPayload

interface RunChangesCapturedPayload {
	sessionId: string;
	runId: string;
}

chat:checkpoint-restored

Fires after a workstream's files are restored to a chat checkpoint, rewinding the changes made after it.

An automation sees: workstreamId, checkpointId, sessionId

Payload: CheckpointRestoredPayload

interface CheckpointRestoredPayload {
	workstreamId: string;
	checkpointId: string;
	sessionId: string;
}

chat:session-renamed

Fires when a chat gets a new name, from the user or from the Name chats automation.

An automation sees: workstreamId, sessionId

Payload: SessionRenamedPayload

interface SessionRenamedPayload {
	workstreamId: string;
	sessionId: string;
	name: string;
}

chat:turn-finished

Fires when a turn of one of your chats ends, not an automation's, with how it ended and the Outcome: and Needs: lines of its report; needs is null when the turn needs nothing from you. A turn that ends with its report while only background commands run, such as a dev server, fires it at once, naming them in backgroundCommands, and fires it again when the agent goes on after them and ends; backgroundCommands is null once the run itself ended. A turn that ends without its report while a command it started runs, such as a test suite the agent waits for, fires nothing until the agent goes on and ends, and a prompt sent during that wait carries the turn, so only its run fires. A turn that Malini quitting, an agent restart or a reset cut short ends interrupted, not failed, so where status is failed skips it.

An automation sees: workstreamId, sessionId, runId, status

Payload: ChatTurnFinishedPayload

type RunEnding = 'succeeded' | 'failed' | 'cancelled' | 'interrupted';

type ChatTurnFinishedStatus = RunEnding;

interface ChatTurnFinishedPayload {
	workstreamId: string;
	sessionId: string;
	runId: string;
	status: ChatTurnFinishedStatus;
	outcome: string | null;
	needs: string | null;
	backgroundCommands: readonly string[] | null;
}

chat:delivery-changed

Fires when Malini holds a prompt for a chat that is on a turn, delivers it once that turn ends, or cannot deliver it, such as a prompt one chat sends the chat of a workstream it started. Malini does not keep it in its event log.

An automation sees: delivery.id, delivery.sessionId, delivery.fromSessionId, delivery.status, delivery.runId, delivery.createdAt, delivery.deliveredAt

Payload: ChatDeliveryChangedEvent

type ChatDeliveryStatus = 'waiting' | 'delivered' | 'failed';

type ChatDelivery = Readonly<{
	id: string;
	sessionId: string;
	fromSessionId: string | null;
	status: ChatDeliveryStatus;
	runId: string | null;
	detail: string | null;
	createdAt: string;
	deliveredAt: string | null;
}>;

type ChatDeliveryChangedEvent = Readonly<{ delivery: ChatDelivery }>;

chat:mcp-server-changed

Fires when a sign-in to an MCP server ends, or a retry outside a chat reads its status, with the server and its new status; every open chat reconnects a server that connected.

An automation sees: name, status, source, toolCount

Payload: McpServerReport

type McpServerReport = Readonly<{
	name: string;
	status: string;
	error?: string;
	source?: string;
	toolCount?: number;
	browser?: boolean;
}>;

chat:mcp-servers-listed

Fires while the MCP servers page is open, each time the Claude Code that watches a folder sees a server connect, fail, or change, with every server of that folder and whether any is still connecting. Malini does not keep it in its event log.

An automation sees: workstreamId, settled

Payload: McpServerListing

type McpServerReport = Readonly<{
	name: string;
	status: string;
	error?: string;
	source?: string;
	toolCount?: number;
	browser?: boolean;
}>;

type McpServerListing = Readonly<{
	workstreamId: string | null;
	servers: readonly McpServerReport[];
	settled: boolean;
	error?: string;
}>;

chat:shell-run-changed

Fires when you run a command from a code block's Run button, while it prints, and when it ends, with the command, anchor: the message and the code block in it it ran from, its output so far, and state: running, exited with its exitCode, stopped, or failed when it could not start. Malini does not keep it in its event log.

An automation sees: id, workstreamId, sessionId, anchor.message, anchor.block, state, exitCode, startedAt, finishedAt

Payload: ShellRun

type ShellRunAnchor = Readonly<{ message: string; block: number }>;

type ShellRunState = 'running' | 'exited' | 'stopped' | 'failed';

type ShellRun = Readonly<{
	id: string;
	workstreamId: string;
	sessionId: string;
	anchor: ShellRunAnchor;
	command: string;
	state: ShellRunState;
	exitCode: number | null;
	output: string;
	startedAt: string;
	finishedAt: string | null;
}>;

repositories:workstream-created

Fires when a new workstream exists: its git worktree is checked out and it is ready for chats. workstream.startedBy is the id of the workstream whose chat started it.

An automation sees: workstreamId, project.id, project.name, project.defaultBranch, workstream.id, workstream.projectId, workstream.path, workstream.branch, workstream.baseBranch, workstream.status, workstream.createdAt, workstream.startedBy

Payload: WorktreeAddedPayload

interface GitProjectRecord {
	id: string;
	name: string;
	repoPath: string;
	defaultBranch: string;
	createdAt: string;
}

interface GitWorkstreamRecord {
	id: string;
	projectId: string;
	name: string;
	path: string;
	branch: string;
	baseBranch: string;
	status: string;
	createdAt: string;
	startedBy: string | null;
}

interface WorktreeAddedPayload {
	workstreamId: string;
	project: GitProjectRecord;
	workstream: GitWorkstreamRecord;
}

repositories:workstream-removed

Fires when a workstream leaves the sidebar, with archived set when it was archived and deleted set when it was deleted.

An automation sees: workstreamId, worktreePath, archived, deleted

Payload: WorktreeRemovedPayload

interface WorktreeRemovedPayload {
	workstreamId: string;
	worktreePath: string;
	archived?: true;
	deleted?: true;
}

repositories:workstream-files-changed

Fires when files change in a workstream's checkout, with the changed paths, or null paths when Malini could not tell which files changed.

An automation sees: workstreamId, changedAt, paths

Payload: WorkstreamFilesChangedPayload

interface WorkstreamFilesChangedPayload {
	workstreamId: string;
	changedAt: string;
	paths: string[] | null;
}

repositories:workstream-renamed

Fires when a workstream gets a new name.

An automation sees: workstreamId

Payload: WorkstreamRenamedPayload

interface WorkstreamRenamedPayload {
	workstreamId: string;
	name: string;
}

repositories:workstream-install-status

Fires as a new workstream's dependency install moves through its states: running, succeeded, failed, skipped or aborted.

An automation sees: type, workstreamId, status, command, reason, durationMs, exitCode

Payload: WorkstreamInstallStatusPayload

type InstallStatus = 'running' | 'succeeded' | 'failed' | 'skipped' | 'aborted';

type InstallSkipReason = 'already-installed' | 'no-manifest' | 'unrecognized-project';

interface WorkstreamInstallStatusPayload {
	type: 'repositories:workstream-install-status';
	workstreamId: string;
	status: InstallStatus;
	command?: string;
	reason?: InstallSkipReason;
	detail?: string;
	durationMs?: number;
	exitCode?: number;
}

repositories:workstream-setup-status

Fires when Malini starts setting up a workstream an agent or an automation started, updating its base branch and installing its dependencies, and again with done once it finishes.

An automation sees: workstreamId, status

Payload: WorkstreamSetupStatusPayload

interface WorkstreamSetupStatusPayload {
	workstreamId: string;
	status: 'running' | 'done';
}

repositories:workstream-merge-conflicted

Fires when a merge in a workstream stops on conflicts, whoever started it, with the workstream's base branch and the conflicted files.

An automation sees: workstreamId, baseBranch, conflictedPaths

Payload: WorkstreamMergeConflictedPayload

interface WorkstreamMergeConflictedPayload {
	workstreamId: string;
	baseBranch: string;
	conflictedPaths: string[];
}

repositories:workstream-base-overlapped

Fires when a workstream's base branch has commits the workstream lacks, once for each pair of head and baseHead commits. Malini looks after each commit in the workstream, each time it fetches the base branch, every five minutes, and right after its merge queue lands a pull request; once the base branch moves, it waits until it has held still for 30 seconds, and it looks only while no agent works there, nothing is left uncommitted and no service the workstream started runs. overlapping says whether those commits conflict with the workstream or change files it changed too; it fires with overlapping false only for a workstream someone worked in during the last 7 days. conflicts says whether merging the base branch would stop on conflicts, with the conflictedPaths; overlappingPaths are the files both sides changed, leaving out lockfiles, changelogs and files .gitattributes marks linguist-generated unless they conflict. A workstream with no commits of its own fires nothing: it fast-forwards to the base branch when it started from it, and stays where it started when it started from a tag or a commit. Update from main runs on it where overlapping is true, or on every one once you pick Always.

An automation sees: workstreamId, baseBranch, head, baseHead, behind, overlapping, conflicts, conflictedPaths, overlappingPaths

Payload: WorkstreamBaseOverlappedPayload

interface WorkstreamBaseOverlappedPayload {
	workstreamId: string;
	baseBranch: string;
	head: string;
	baseHead: string;
	behind: number;
	overlapping: boolean;
	conflicts: boolean;
	conflictedPaths: string[];
	overlappingPaths: string[];
}

repositories:workstream-head-moved

Fires when the commit a workstream's checkout points to changes, whoever moved it: a commit, a merge, a pull or a reset, with the branch, or null when the checkout is detached, and the commits before and after; previousHead is null for the first commit of a new branch.

An automation sees: workstreamId, branch, head, previousHead

Payload: WorkstreamHeadMovedPayload

interface WorkstreamHeadMovedPayload {
	workstreamId: string;
	branch: string | null;
	head: string;
	previousHead: string | null;
}

repositories:workstream-pushed

Fires when a workstream's branch on origin moves, after a push or a fetch that brings in someone else's push, with the commit it points to now.

An automation sees: workstreamId, branch, head

Payload: WorkstreamPushedPayload

interface WorkstreamPushedPayload {
	workstreamId: string;
	branch: string;
	head: string;
}

repositories:clone-progress

Fires repeatedly while Malini clones a repository, with the stage and the fraction done, and once more when it is done. Malini does not keep it in its event log.

An automation sees: repo_id, stage, fraction

Payload: CloneProgressPayload

interface CloneProgressPayload {
	repo_id: string;
	stage: 'fetch' | 'checkout' | 'done';
	fraction: number;
}

repositories:github-cli-install-progress

Fires repeatedly while Malini downloads the GitHub CLI after you press Install, with the bytes received and the size when known, and once more when the download ends. Malini does not keep it in its event log.

An automation sees: received, total

Payload: InstallProgressPayload

interface InstallProgressPayload {
	received: number;
	total: number | null;
}

repositories:changed

Fires when a repository is added, cloned, hidden or shown again, or origin renames its default branch, so every list of repositories and workstreams reloads.

An automation sees none of its fields.

Payload: EmptyEventPayload

type EmptyEventPayload = Readonly<Record<string, never>>;

repositories:github-reach-changed

Fires when GitHub stops or starts answering Malini's gh calls, with reach: ok, unreachable when GitHub does not respond, down when GitHub answers with a server error, or rate-limited when GitHub limits your account.

An automation sees: reach

Payload: GithubReachChangedPayload

type GithubFailure = 'unreachable' | 'down' | 'rate-limited';

type GithubReach = 'ok' | GithubFailure;

type GithubReachChangedPayload = Readonly<{ reach: GithubReach }>;

repositories:workstream-checkout-health

Fires when a workstream's checkout breaks, while Malini repairs it, and when it reads again, with state and the finding Malini made about what broke.

An automation sees: workstreamId, state, finding, repairable

Payload: WorkstreamCheckoutHealthPayload

const CHECKOUT_HEALTH_STATES = ['healthy', 'broken', 'repairing'] as const;

type CheckoutHealthState = (typeof CHECKOUT_HEALTH_STATES)[number];

const CHECKOUT_FINDINGS = [
	'folder-missing',
	'git-link-missing',
	'admin-missing',
	'base-repository-missing',
	'github-signed-out',
	'remote-missing',
	'checkouts-folder-missing',
	'stale-lock',
	'index-corrupt',
	'head-invalid',
	'dubious-ownership',
	'git-unavailable',
	'developer-tools-missing',
	'xcode-license',
	'permission-denied',
	'disk-full',
	'unknown',
] as const;

type CheckoutFinding = (typeof CHECKOUT_FINDINGS)[number];

const CHECKOUT_RESTORES = ['branch-from-github', 'commits-as-edits', 'nothing-lost'] as const;

type CheckoutRestore = (typeof CHECKOUT_RESTORES)[number];

type CheckoutHealth = Readonly<{
	state: CheckoutHealthState;
	finding: CheckoutFinding | null;
	repairable: boolean;
	said: string | null;
	restored: CheckoutRestore | null;
}>;

type WorkstreamCheckoutHealthPayload = CheckoutHealth & Readonly<{ workstreamId: string }>;

providers:claude-code-install-progress

Fires repeatedly while Malini downloads Claude Code after you press Install, with the bytes received and the size, and once more when the download ends. Malini does not keep it in its event log.

An automation sees: received, total

Payload: InstallProgressPayload

interface InstallProgressPayload {
	received: number;
	total: number | null;
}

pull-requests:local-base-synced

Fires after Malini merges a pull request and tries to bring the repository's local base branch up to date, with the outcome.

An automation sees: workstreamId, checkout, branch, outcome

Payload: LocalBaseSyncedPayload

interface LocalBaseSyncedPayload {
	workstreamId: string | null;
	checkout: string;
	branch: string;
	outcome: 'advanced' | 'diverged' | 'failed';
	detail?: string;
}

pull-requests:ship-changed

Fires whenever a workstream's shipping state changes: its pull request phase, the step Malini is on, or a reason it needs you. A click on the pull request bar's Draft, Merge, Retry or Cancel fires pull-requests:button-clicked instead, with the new state.

An automation sees: workstreamId, state.phase, state.step, state.pullRequestNumber, state.pullRequestUrl, state.queuedAt, state.attempts, state.checks, state.activeAutomationRunId, state.failures, state.failedSince, state.nextAttemptAt, state.waitsFor, state.updatedAt, merged.pullRequestNumber, merged.pullRequestUrl

Payload: ShipChangedEvent

type ShipPhase = 'local' | 'draft' | 'queued' | 'needs-you';

type ShipStep =
	| 'waiting-for-agent'
	| 'opening-draft'
	| 'pushing'
	| 'marking-ready'
	| 'updating-branch'
	| 'updating-from-main'
	| 'resolving-conflicts'
	| 'rerunning-checks'
	| 'fixing-checks'
	| 'addressing-review'
	| 'waiting-for-checks'
	| 'waiting-for-review'
	| 'waiting-for-github'
	| 'merging'
	| 'archiving';

type ShipNeedsYouReason =
	| 'reply-to-reviewer'
	| 'fix-gave-up'
	| 'merge-not-permitted'
	| 'pull-request-closed'
	| 'github-reconnect'
	| 'operation-in-progress';

type ShipNeedsYou = Readonly<{
	reason: ShipNeedsYouReason;
	detail: string;
	automationRunId: string | null;
}>;

type ShipWaitsFor = 'workflow-scope' | 'workflow-permission' | 'push-access';

type ShipStateRecord = Readonly<{
	workstreamId: string;
	phase: ShipPhase;
	step: ShipStep | null;
	keep: boolean;
	pullRequestNumber: number | null;
	pullRequestUrl: string | null;
	needsYou: ShipNeedsYou | null;
	queuedAt: string | null;
	attempts: number;
	checks: readonly string[];
	activeAutomationRunId: string | null;
	lastError: string | null;
	githubSaid: string | null;
	failures: number;
	failedSince: string | null;
	nextAttemptAt: string | null;
	waitsFor: ShipWaitsFor | null;
	updatedAt: string;
}>;

type ShipMerged = Readonly<{ pullRequestNumber: number; pullRequestUrl: string | null }>;

type ShipChangedEvent = Readonly<{
	workstreamId: string;
	state: ShipStateRecord | null;
	merged?: ShipMerged;
}>;

pull-requests:pull-request-changed

Fires when Malini reads a workstream's pull request on GitHub and something the Shipping rule decides on changed since the last read it logged: its state (open, draft, closed or merged), its checks, whether any is checksPending, the failingChecks by name and the blockingChecks with when each finished, its reviewDecision, the unresolved threads and the changeRequests of each review with who left it, how many commits it is behindBase, its mergeability, whether you may merge it and how. Malini reads it every time the pull request bar does, and on its own while shipping waits on GitHub and, for up to an hour after it pushes to a draft, until the checks of what it pushed settle. Every automation the Shipping rule starts for that pull request names the latest one as its cause.

An automation sees: workstreamId, pullRequestNumber, pullRequestUrl, state, baseBranch, headSha, checks, checksPending, failingChecks, blockingChecks, reviewDecision, unresolvedThreads, changeRequests, threads, behindBase, conflicts, mergeability, viewerCanMerge, mergeMethod

Payload: PullRequestChangedEvent

type PullRequestFailedCheck = Readonly<{
	name: string;
	state: string;
	required: boolean | null;
	appId: number | null;
	url: string | null;
	completedAt: string | null;
}>;

type PullRequestReviewItem = Readonly<{ id: string; by: string | null; bot: boolean }>;

type PullRequestMergeability = 'ready' | 'conflicts' | 'behind' | 'blocked' | 'unknown';

type PullRequestChangedEvent = Readonly<{
	workstreamId: string;
	pullRequestNumber: number;
	pullRequestUrl: string | null;
	state: 'open' | 'draft' | 'closed' | 'merged';
	baseBranch: string;
	headSha: string | null;
	checks: 'none' | 'success' | 'pending' | 'failed' | 'unknown';
	checksPending: boolean;
	failingChecks: readonly string[];
	blockingChecks: readonly PullRequestFailedCheck[];
	reviewDecision: 'approved' | 'changes_requested' | 'review_required' | null;
	unresolvedThreads: number | null;
	changeRequests: readonly PullRequestReviewItem[] | null;
	threads: readonly PullRequestReviewItem[] | null;
	behindBase: number | null;
	conflicts: boolean;
	mergeability: PullRequestMergeability;
	viewerCanMerge: boolean | null;
	mergeMethod: string | null;
}>;

pull-requests:button-clicked

Fires when you click Draft, Merge, Retry or Cancel on a workstream's pull request bar, with the button and the workstream's new shipping state; the reconciler's Shipping rule takes the workstream from there.

An automation sees: workstreamId, button

Payload: ShipButtonClickedEvent

type ShipButton = 'draft' | 'merge' | 'retry' | 'cancel' | 'keep';

type ShipPhase = 'local' | 'draft' | 'queued' | 'needs-you';

type ShipStep =
	| 'waiting-for-agent'
	| 'opening-draft'
	| 'pushing'
	| 'marking-ready'
	| 'updating-branch'
	| 'updating-from-main'
	| 'resolving-conflicts'
	| 'rerunning-checks'
	| 'fixing-checks'
	| 'addressing-review'
	| 'waiting-for-checks'
	| 'waiting-for-review'
	| 'waiting-for-github'
	| 'merging'
	| 'archiving';

type ShipNeedsYouReason =
	| 'reply-to-reviewer'
	| 'fix-gave-up'
	| 'merge-not-permitted'
	| 'pull-request-closed'
	| 'github-reconnect'
	| 'operation-in-progress';

type ShipNeedsYou = Readonly<{
	reason: ShipNeedsYouReason;
	detail: string;
	automationRunId: string | null;
}>;

type ShipWaitsFor = 'workflow-scope' | 'workflow-permission' | 'push-access';

type ShipStateRecord = Readonly<{
	workstreamId: string;
	phase: ShipPhase;
	step: ShipStep | null;
	keep: boolean;
	pullRequestNumber: number | null;
	pullRequestUrl: string | null;
	needsYou: ShipNeedsYou | null;
	queuedAt: string | null;
	attempts: number;
	checks: readonly string[];
	activeAutomationRunId: string | null;
	lastError: string | null;
	githubSaid: string | null;
	failures: number;
	failedSince: string | null;
	nextAttemptAt: string | null;
	waitsFor: ShipWaitsFor | null;
	updatedAt: string;
}>;

type ShipButtonClickedEvent = Readonly<{
	workstreamId: string;
	button: ShipButton;
	state: ShipStateRecord | null;
}>;

pull-requests:workstream-opened

Fires each time you open a workstream, for automations to start on. Malini does not update a workstream from main on it: only merging does.

An automation sees: workstreamId

Payload: WorkstreamOpenedEvent

type WorkstreamOpenedEvent = Readonly<{ workstreamId: string }>;

automations:run-changed

Fires whenever an automation run waits for you, is queued, starts, needs you, finishes as succeeded, failed or cancelled, or runs again because its agent went on after the background commands its turn ended over. Malini does not keep it in its event log: it keeps automations:run-started and automations:run-finished.

An automation sees: run.id, run.definitionId, run.workstreamId, run.repositoryId, run.sessionId, run.agentRunId, run.origin, run.status, run.parentRunId, run.chatSessionId, run.chatAfterRunId, run.chainId, run.createdAt, run.startedAt, run.finishedAt

Payload: AutomationRunChangedEvent

const AUTOMATION_RUN_ORIGINS = [
	'merge-queue',
	'manual',
	'trigger',
	'then',
	'schedule',
	'reconciler',
	'compatibility',
] as const;

type AutomationRunOrigin = (typeof AUTOMATION_RUN_ORIGINS)[number];

const AUTOMATION_RUN_STATUSES = [
	'waiting',
	'queued',
	'running',
	'needs-you',
	'succeeded',
	'failed',
	'cancelled',
] as const;

type AutomationRunStatus = (typeof AUTOMATION_RUN_STATUSES)[number];

type AutomationRunRecord = Readonly<{
	id: string;
	definitionId: string;
	title: string;
	workstreamId: string | null;
	repositoryId: string | null;
	sessionId: string | null;
	agentRunId: string | null;
	origin: AutomationRunOrigin;
	status: AutomationRunStatus;
	interrupted: boolean;
	detail: string | null;
	parentRunId: string | null;
	chatSessionId: string | null;
	chatAfterRunId: string | null;
	chainId: string;
	requests: number;
	createdAt: string;
	startedAt: string | null;
	finishedAt: string | null;
}>;

type AutomationRunChangedEvent = Readonly<{ run: AutomationRunRecord }>;

automations:run-started

Fires when an automation run starts working, with the run; a run Malini puts back in the queue fires it again when it starts again.

An automation sees: run.id, run.definitionId, run.workstreamId, run.repositoryId, run.sessionId, run.agentRunId, run.origin, run.status, run.parentRunId, run.chatSessionId, run.chatAfterRunId, run.chainId, run.createdAt, run.startedAt, run.finishedAt

Payload: AutomationRunChangedEvent

const AUTOMATION_RUN_ORIGINS = [
	'merge-queue',
	'manual',
	'trigger',
	'then',
	'schedule',
	'reconciler',
	'compatibility',
] as const;

type AutomationRunOrigin = (typeof AUTOMATION_RUN_ORIGINS)[number];

const AUTOMATION_RUN_STATUSES = [
	'waiting',
	'queued',
	'running',
	'needs-you',
	'succeeded',
	'failed',
	'cancelled',
] as const;

type AutomationRunStatus = (typeof AUTOMATION_RUN_STATUSES)[number];

type AutomationRunRecord = Readonly<{
	id: string;
	definitionId: string;
	title: string;
	workstreamId: string | null;
	repositoryId: string | null;
	sessionId: string | null;
	agentRunId: string | null;
	origin: AutomationRunOrigin;
	status: AutomationRunStatus;
	interrupted: boolean;
	detail: string | null;
	parentRunId: string | null;
	chatSessionId: string | null;
	chatAfterRunId: string | null;
	chainId: string;
	requests: number;
	createdAt: string;
	startedAt: string | null;
	finishedAt: string | null;
}>;

type AutomationRunChangedEvent = Readonly<{ run: AutomationRunRecord }>;

automations:run-finished

Fires when an automation run ends, with the run and its status: succeeded, failed or cancelled. An automation runs after another on it, such as on automations:run-finished where run.status is failed. A run whose turn ended while only background commands run finishes at once, and when its agent goes on once they end, it runs again and fires this again at its next end.

An automation sees: run.id, run.definitionId, run.workstreamId, run.repositoryId, run.sessionId, run.agentRunId, run.origin, run.status, run.parentRunId, run.chatSessionId, run.chatAfterRunId, run.chainId, run.createdAt, run.startedAt, run.finishedAt

Payload: AutomationRunChangedEvent

const AUTOMATION_RUN_ORIGINS = [
	'merge-queue',
	'manual',
	'trigger',
	'then',
	'schedule',
	'reconciler',
	'compatibility',
] as const;

type AutomationRunOrigin = (typeof AUTOMATION_RUN_ORIGINS)[number];

const AUTOMATION_RUN_STATUSES = [
	'waiting',
	'queued',
	'running',
	'needs-you',
	'succeeded',
	'failed',
	'cancelled',
] as const;

type AutomationRunStatus = (typeof AUTOMATION_RUN_STATUSES)[number];

type AutomationRunRecord = Readonly<{
	id: string;
	definitionId: string;
	title: string;
	workstreamId: string | null;
	repositoryId: string | null;
	sessionId: string | null;
	agentRunId: string | null;
	origin: AutomationRunOrigin;
	status: AutomationRunStatus;
	interrupted: boolean;
	detail: string | null;
	parentRunId: string | null;
	chatSessionId: string | null;
	chatAfterRunId: string | null;
	chainId: string;
	requests: number;
	createdAt: string;
	startedAt: string | null;
	finishedAt: string | null;
}>;

type AutomationRunChangedEvent = Readonly<{ run: AutomationRunRecord }>;

automations:definition-changed

Fires when an automation is created, edited, reset to its defaults or deleted; definition is null after a delete.

An automation sees: definitionId, definition.id, definition.name, definition.model, definition.effort, definition.runsIn, definition.builtin, definition.thenAutomationId, definition.createdAt, definition.updatedAt

Payload: AutomationDefinitionChangedEvent

type AgentReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';

type AutomationRunsIn = 'workstream' | 'new-workstream';

type AutomationBuiltin =
	| 'name-chats'
	| 'name-services'
	| 'fix-checks'
	| 'update-from-main'
	| 'resolve-conflicts'
	| 'address-review'
	| 'check-compatibility'
	| 'update-docs'
	| 'open-draft'
	| 'merge'
	| 'reconcile'
	| 'suggest-automations'
	| 'capture-brain'
	| 'write-brain-notes';

type AutomationRunMode = 'off' | 'ask' | 'auto';

type AutomationTrigger = Readonly<{ when: string; mode: AutomationRunMode }>;

type AutomationEventSight = 'facts' | 'full';

type AutomationChatSight = 'none' | 'starter' | 'all';

type AutomationBoundary = Readonly<{
	event: AutomationEventSight;
	before: boolean;
	chats: AutomationChatSight;
	attachments: boolean;
	internet: boolean;
}>;

type AutomationDefinitionRecord = Readonly<{
	id: string;
	name: string;
	instructions: string;
	provider: string;
	model: string;
	effort: AgentReasoningEffort;
	runsIn: AutomationRunsIn;
	skills: readonly string[];
	builtin: AutomationBuiltin | null;
	trigger: AutomationTrigger | null;
	thenAutomationId: string | null;
	boundary: AutomationBoundary;
	createdAt: string;
	updatedAt: string;
}>;

type AutomationDefinitionChangedEvent = Readonly<{
	definitionId: string;
	definition: AutomationDefinitionRecord | null;
}>;

automations:suggested

Fires when you ask for the same follow-up after another pull request merges in a repository, and Malini drafts an automation that does it after each merge. Also fires when you save or dismiss that draft.

An automation sees: suggestion.id, suggestion.repositoryId, suggestion.sessionId, suggestion.name, suggestion.when, suggestion.status, suggestion.definitionId, suggestion.createdAt, suggestion.updatedAt

Payload: AutomationSuggestedEvent

const AUTOMATION_SUGGESTION_STATUSES = ['open', 'dismissed', 'accepted'] as const;

type AutomationSuggestionStatus = (typeof AUTOMATION_SUGGESTION_STATUSES)[number];

type AutomationAskRecord = Readonly<{
	text: string;
	workstreamId: string;
	pullRequestNumber: number | null;
	askedAt: string;
}>;

type AutomationSuggestionRecord = Readonly<{
	id: string;
	repositoryId: string;
	sessionId: string;
	afterRunId: string;
	name: string;
	instructions: string;
	when: string;
	status: AutomationSuggestionStatus;
	definitionId: string | null;
	asks: readonly AutomationAskRecord[];
	createdAt: string;
	updatedAt: string;
}>;

type AutomationSuggestedEvent = Readonly<{ suggestion: AutomationSuggestionRecord }>;

automations:experiment-changed

Fires when an experiment on an automation's Improve page finishes replaying the automation's recent tasks, with every result.

An automation sees: experiment.id, experiment.definitionId, experiment.name, experiment.model, experiment.current, experiment.running, experiment.createdAt

Payload: AutomationExperimentChangedEvent

type AutomationExperimentResult = Readonly<{
	outputId: string;
	output: string | null;
	error: string | null;
}>;

type AutomationExperimentRecord = Readonly<{
	id: string;
	definitionId: string;
	name: string;
	provider: string;
	model: string;
	instructions: string;
	current: boolean;
	running: boolean;
	results: readonly AutomationExperimentResult[];
	createdAt: string;
}>;

type AutomationExperimentChangedEvent = Readonly<{ experiment: AutomationExperimentRecord }>;

automations:agent-action-changed

Fires when an agent calls one of Malini's tools, when the user denies the call, and when the call finishes, with the tool, its input, the approval and the outcome. Malini does not keep it in its event log: it keeps automations:tool-called.

An automation sees: action.id, action.sessionId, action.runId, action.workstreamId, action.tool, action.status, action.approval, action.startedAt, action.finishedAt

Payload: AgentActionChangedEvent

const AGENT_ACTION_STATUSES = ['running', 'succeeded', 'failed', 'denied'] as const;

type AgentActionStatus = (typeof AGENT_ACTION_STATUSES)[number];

const AGENT_ACTION_APPROVALS = ['not-needed', 'allowed', 'always-allowed', 'denied'] as const;

type AgentActionApproval = (typeof AGENT_ACTION_APPROVALS)[number];

type AgentActionRecord = Readonly<{
	id: string;
	sessionId: string;
	runId: string;
	workstreamId: string | null;
	tool: string;
	input: Readonly<Record<string, unknown>>;
	status: AgentActionStatus;
	approval: AgentActionApproval;
	output: string | null;
	startedAt: string;
	finishedAt: string | null;
}>;

type AgentActionChangedEvent = Readonly<{ action: AgentActionRecord }>;

automations:tool-called

Fires once when an agent calls one of Malini's tools, with the tool, its input and whether the call needed your yes.

An automation sees: action.id, action.sessionId, action.runId, action.workstreamId, action.tool, action.status, action.approval, action.startedAt, action.finishedAt

Payload: AgentActionChangedEvent

const AGENT_ACTION_STATUSES = ['running', 'succeeded', 'failed', 'denied'] as const;

type AgentActionStatus = (typeof AGENT_ACTION_STATUSES)[number];

const AGENT_ACTION_APPROVALS = ['not-needed', 'allowed', 'always-allowed', 'denied'] as const;

type AgentActionApproval = (typeof AGENT_ACTION_APPROVALS)[number];

type AgentActionRecord = Readonly<{
	id: string;
	sessionId: string;
	runId: string;
	workstreamId: string | null;
	tool: string;
	input: Readonly<Record<string, unknown>>;
	status: AgentActionStatus;
	approval: AgentActionApproval;
	output: string | null;
	startedAt: string;
	finishedAt: string | null;
}>;

type AgentActionChangedEvent = Readonly<{ action: AgentActionRecord }>;

automations:decision-changed

Fires when the event reconciler decides what to do about an event no trigger handled, records that it does nothing because other work already takes it, waits to wake a busy chat, asks you, or carries out what you picked, with the facts it saw, the candidates and the pick. Malini keeps it in the decision log, not in its event log.

An automation sees: decision.id, decision.eventId, decision.channel, decision.chainId, decision.workstreamId, decision.pick, decision.chosen, decision.decidedBy, decision.status, decision.automationRunId, decision.subjectRunId, decision.createdAt, decision.finishedAt

Payload: ReconcilerDecisionChangedEvent

type WakeAbout = 'workstream' | 'automation' | 'conflict';

type ReconcilerCandidate =
	| Readonly<{ kind: 'nothing'; label: string }>
	| Readonly<{
			kind: 'wake-chat';
			label: string;
			sessionId: string;
			workstreamId: string;
			from: string;
			report: string;
			about?: WakeAbout;
	  }>
	| Readonly<{
			kind: 'run-automation';
			label: string;
			definitionId: string;
			workstreamId: string;
			context: string;
	  }>
	| Readonly<{ kind: 'ask-you'; label: string; reason: string }>;

const RECONCILER_DECIDERS = ['model', 'rules', 'you'] as const;

type ReconcilerDecider = (typeof RECONCILER_DECIDERS)[number];

const RECONCILER_DECISION_STATUSES = ['pending', 'done', 'asking', 'dismissed', 'failed'] as const;

type ReconcilerDecisionStatus = (typeof RECONCILER_DECISION_STATUSES)[number];

type ReconcilerDecisionRecord = Readonly<{
	id: string;
	eventId: number;
	channel: string;
	chainId: string;
	workstreamId: string | null;
	facts: readonly string[];
	candidates: readonly ReconcilerCandidate[];
	pick: number | null;
	chosen: number;
	decidedBy: ReconcilerDecider;
	status: ReconcilerDecisionStatus;
	detail: string | null;
	automationRunId: string | null;
	subjectRunId: string | null;
	createdAt: string;
	finishedAt: string | null;
}>;

type ReconcilerDecisionChangedEvent = Readonly<{ decision: ReconcilerDecisionRecord }>;

automations:time-reached

Fires when the time an automation's schedule names comes, with the automation, its schedule and the time it was due, once per time, and once on return for the latest time Malini missed while the Mac slept or Malini was closed. The reconciler's Schedules rule starts the automation on it, unless the automation has a run that has not finished; a run its schedule started that waits for your yes gives way to the new one. It also fires with a workstreamId and a wait when a wait the Shipping rule set for that workstream ends: retry after a step failed or when a step Malini took brought no event back, checks once a fix had a minute for its failing checks to run again or a draft's checks watch ran out, idle once the workstream's agent has been idle long enough to act; causeEventId names the event whose decision set the wait. With wait set to resume, it names the sessionId and runId of a turn a usage limit or an outage paused, and the Resume rule continues that turn.

An automation sees: definitionId, name, when, due

Payload: TimeReachedEvent

type ScheduleTimeReached = Readonly<{
	definitionId: string;
	name: string;
	when: string;
	due: string;
}>;

type ShippingWait = 'retry' | 'checks' | 'idle';

type ShippingTimeReached = Readonly<{
	workstreamId: string;
	wait: ShippingWait;
	due: string;
	causeEventId?: number;
}>;

type ResumeTimeReached = Readonly<{
	workstreamId: string;
	sessionId: string;
	runId: string;
	wait: 'resume';
	due: string;
}>;

type AlarmTimeReached = ShippingTimeReached | ResumeTimeReached;

type TimeReachedEvent = ScheduleTimeReached | AlarmTimeReached;

app:started

Fires once each time Malini starts, as soon as its event log listens, with the version that started. The reconciler's Resume rule continues the chat turns a restart cut short on it, and its Shipping rule picks up every workstream it was shipping.

An automation sees: version

Payload: AppStartedPayload

type AppStartedPayload = Readonly<{ version: string }>;

app:close-requested

Fires when you close the Malini window, so Malini can show what is still running and ask before it quits.

An automation sees none of its fields.

Payload: EmptyEventPayload

type EmptyEventPayload = Readonly<Record<string, never>>;

app:scale-changed

Fires when the interface scale or the display the window sits on changes, so layouts can measure again. Malini does not keep it in its event log.

An automation sees none of its fields.

Payload: EmptyEventPayload

type EmptyEventPayload = Readonly<Record<string, never>>;

app:full-screen-changed

Fires when the Malini window enters or leaves full screen, with whether it is full screen now. Malini does not keep it in its event log.

An automation sees: fullScreen

Payload: FullScreenChangedPayload

type FullScreenChangedPayload = Readonly<{ fullScreen: boolean }>;

app:notification-opened

Fires when you click a Malini notification, with the chat it points to.

An automation sees: workstreamId, sessionId

Payload: NotificationTarget

type NotificationTarget = Readonly<{ workstreamId: string; sessionId: string }>;

app:menu-command-chosen

Fires when you pick New Workstream, New Chat, Reopen Closed Chat, Open Folder…, Find Repository…, Accounts… or Settings… from Malini's menu bar or its menu bar icon, with which one you picked.

An automation sees: command

Payload: MenuCommandChosen

type MenuCommand =
	| 'new-workstream'
	| 'new-chat'
	| 'reopen-chat'
	| 'open-folder'
	| 'find-repository'
	| 'accounts'
	| 'settings';

type MenuCommandChosen = Readonly<{ command: MenuCommand }>;

app:streaming-changed

Fires when streamer mode turns on or off, because a screen recording or streaming app started or stopped.

An automation sees: streaming

Payload: StreamingChangedPayload

type StreamingChangedPayload = Readonly<{ streaming: boolean }>;

app:updated

Fires once at startup after Malini updated to a new version whose events changed, with the old and new version and the events added, removed or whose payload changed. The reconciler's Compatibility rule runs Check compatibility on it.

An automation sees: from, to, changes

Payload: AppUpdatedPayload

type ContractPayloadChange = Readonly<{ channel: string; before: string; after: string }>;

type ContractChanges = Readonly<{
	added: readonly string[];
	removed: readonly string[];
	changed: readonly ContractPayloadChange[];
}>;

type AppUpdatedPayload = Readonly<{ from: string; to: string; changes: ContractChanges }>;

app:update-staged

Fires when a new Malini version has downloaded and installs on the next restart, with that version.

An automation sees: version

Payload: UpdateStagedPayload

type UpdateStagedPayload = Readonly<{ version: string }>;

app:update-status-changed

Fires when the update status in the sidebar changes: checking or downloading after you chose Check for Updates…, up to date, failed, a version ready to install, or nothing to show. Malini does not keep it in its event log.

An automation sees: state, version

Payload: UpdateStatus

type UpdateChange = Readonly<{ kind: 'feature' | 'fix' | 'perf'; summary: string }>;

type UpdateRelease = Readonly<{ version: string; changes: readonly UpdateChange[] }>;

type UpdateStatus = Readonly<
	| { state: 'idle' }
	| { state: 'checking' }
	| { state: 'downloading'; version: string }
	| { state: 'up-to-date'; version: string }
	| { state: 'failed'; error: string }
	| { state: 'ready'; version: string; installed: string; releases: readonly UpdateRelease[] }
>;

browser:state-changed

Fires whenever a workstream's browser tab changes its page, title, icon, loading state, history or load failure. Malini does not keep it in its event log.

An automation sees: workstreamId, tabId, loading, canGoBack, canGoForward

Payload: BrowserState

type BrowserState = Readonly<{
	workstreamId: string;
	tabId: string;
	url: string;
	title: string;
	favicon: string | null;
	loading: boolean;
	canGoBack: boolean;
	canGoForward: boolean;
	failure: string | null;
}>;

browser:tab-opened

Fires when a new browser tab opens in a workstream: when an agent opens a page, or when a page opens a link or a window in a new tab, with the tab it opened from and whether it opened in the background.

An automation sees: workstreamId, tabId, openerTabId, background

Payload: BrowserTabOpened

type BrowserTabArgs = Readonly<{ workstreamId: string; tabId: string }>;

type BrowserTabOpened = BrowserTabArgs &
	Readonly<{ openerTabId: string | null; background: boolean }>;

browser:tab-closed

Fires when an agent closes the browser tab it opened in a workstream, or a page closes its own tab, as a sign-in window does once it is done; Malini takes the tab out of the inspector and closes its page. Tabs you opened stay when an agent closes its own.

An automation sees: workstreamId, tabId

Payload: BrowserTabArgs

type BrowserTabArgs = Readonly<{ workstreamId: string; tabId: string }>;

browser:resize-requested

Fires when an agent asks to make the browser tab you see wider or narrower, with the width it asked for in Malini's pixels; Malini moves the divider between the chat and the inspector to match.

An automation sees: workstreamId, tabId, requestId, width

Payload: BrowserResizeRequest

type BrowserTabArgs = Readonly<{ workstreamId: string; tabId: string }>;

type BrowserResizeRequest = BrowserTabArgs & Readonly<{ requestId: string; width: number }>;

browser:autofill-offered

Fires when you submit a form in a browser tab with contact details that differ from the ones Malini keeps for you, so Malini can ask above the page whether to save them. It carries only the tab and the offer, never the details. Malini does not keep it in its event log.

An automation sees: workstreamId, tabId

Payload: AutofillOffered

type BrowserTabArgs = Readonly<{ workstreamId: string; tabId: string }>;

type AutofillOffered = BrowserTabArgs & Readonly<{ offerId: string }>;

extensions:file-open-requested

Fires when an agent opens a file for the user to edit, with the workstream, the file's path (relative to the worktree, or absolute outside it) and the line to show; Malini opens it in a File tab beside the workstream's chats.

An automation sees: workstreamId, path, line

Payload: FileOpenRequestedPayload

type FileOpenRequestedPayload = Readonly<{
	workstreamId: string;
	path: string;
	line: number | null;
}>;

stats:resources-sampled

Fires every few seconds with a sample of the memory and CPU that Malini, its agents, browser tabs and containers use. Malini does not keep it in its event log.

An automation sees: sampledAt, memoryBytes, cpuPercent, processes

Payload: ResourceSample

type ResourceKind = 'malini' | 'browser' | 'agents' | 'tools' | 'docker';

type ResourceUsage = Readonly<{
	kind: ResourceKind;
	memoryBytes: number;
	cpuPercent: number;
	processes: number;
}>;

type ResourceSample = Readonly<{
	sampledAt: number;
	memoryBytes: number;
	cpuPercent: number;
	processes: number;
	usage: readonly ResourceUsage[];
}>;

stats:workstream-running-changed

Fires when what keeps running in any workstream changes, with every workstream that still runs background services, tasks or containers. Malini does not keep it in its event log.

An automation sees none of its fields.

Payload: readonly WorkstreamRunning[]

type RunningItemOrigin = 'agent' | 'docker';

type RunningItemKind = 'service' | 'task';

type RunningItem = Readonly<{
	id: string;
	origin: RunningItemOrigin;
	name: string;
	kind: RunningItemKind;
	detail: string;
	group: string | null;
	startedAt: number;
	ports: readonly number[];
}>;

type NamedPort = Readonly<{ name: string; port: number }>;

type WorkstreamTurn = Readonly<{
	endedAt: number;
	outcome: string | null;
	need: string | null;
}>;

type WorkstreamRunning = Readonly<{
	workstreamId: string;
	items: readonly RunningItem[];
	namedPorts: readonly NamedPort[];
	behind: readonly string[];
	turn: WorkstreamTurn | null;
}>;

stats:profile-changed

Fires when your Bestboy profile changes in Malini: you sign in or out, Publish my stats turns on or off, you pick other public repositories, or an upload or a removal of your stats finishes or fails. Malini does not keep it in its event log.

An automation sees: profile.handle, profile.public, profile.url, signingIn, signInNeeded, publishing

Payload: ProfileState

type BestboyAccount = Readonly<{ name: string; email: string }>;

type BestboyProfile = Readonly<{
	handle: string | null;
	public: boolean;
	url: string | null;
}>;

type BestboyTerms = Readonly<{ date: string; termsUrl: string; privacyUrl: string }>;

type StatsPublishing = 'off' | 'on' | 'removing';

type StatsUpload =
	| Readonly<{ state: 'idle' }>
	| Readonly<{ state: 'sending' }>
	| Readonly<{ state: 'published'; through: string }>
	| Readonly<{ state: 'no-full-day' }>
	| Readonly<{ state: 'failed'; reason: string; retrying: boolean }>;

type ProfileState = Readonly<{
	account: BestboyAccount | null;
	profile: BestboyProfile | null;
	unacceptedTerms: BestboyTerms | null;
	signingIn: boolean;
	signInNeeded: boolean;
	signInProblem: string | null;
	publishing: StatsPublishing;
	upload: StatsUpload;
	pickedRepositories: readonly string[];
	suggestedHandle: string | null;
}>;

stats:profile-published

Fires when you claim your @handle and Publish my stats turns on, with your Bestboy profile: its handle, whether it is public, and its address.

An automation sees: handle, public, url

Payload: BestboyProfile

type BestboyProfile = Readonly<{
	handle: string | null;
	public: boolean;
	url: string | null;
}>;

stats:projects-changed

Fires when your projects on Bestboy change in Malini: you turn one on or off, change its link, sign in or out, or an upload of them finishes or fails, with the state bestboy.dev last answered for each. Malini does not keep it in its event log.

An automation sees: signedIn, problem

Payload: BestboyProjects

type BestboyProjectState = 'preview' | 'ready' | 'submitted' | 'live' | 'asked' | 'removed';

type BestboyProject = Readonly<{
	repositoryId: string;
	fullName: string;
	private: boolean;
	runs: number;
	days: number;
	link: string;
	on: boolean;
	state: BestboyProjectState | null;
	url: string | null;
	problem: string | null;
}>;

type BestboyProjects = Readonly<{
	signedIn: boolean;
	projects: readonly BestboyProject[];
	problem: string | null;
}>;

secrets:requested

Fires when an agent asks you for secrets by name with secrets_request, with the chat that asked, the names, why it needs them and which of them you already saved; the chat shows a card where you paste them. It carries no value.

An automation sees: request.id, request.sessionId, request.names, request.repository, request.saved, request.askedAt

Payload: SecretsRequestedEvent

type SecretRequest = Readonly<{
	id: string;
	sessionId: string;
	names: readonly string[];
	why: string;
	repository: string | null;
	saved: readonly string[];
	askedAt: string;
}>;

type SecretsRequestedEvent = Readonly<{ request: SecretRequest }>;

brain:changed

Fires when your second brain changes: it is set up, a capture or new notes land in it, a push to GitHub goes through or stops on a problem, or you turn its sync on or off, with its status. It never carries what the brain says.

An automation sees: status.set, status.repository, status.sync, status.syncedAt, status.unpushed, status.problem

Payload: BrainChangedEvent

type BrainStatus = Readonly<{
	set: boolean;
	repository: string | null;
	sync: boolean;
	workstreamId: string | null;
	location: string | null;
	syncedAt: string | null;
	unpushed: number;
	problem: string | null;
}>;

type BrainChangedEvent = Readonly<{ status: BrainStatus }>;

secrets:saved

Fires when you save secrets, on the card a chat showed or under Tools, Secrets, with their names, the repository they are for (null for everywhere), and the request and chat they answer, or null from Tools. It never carries a value.

An automation sees: names, unsaved, repository, requestId, sessionId

Payload: SecretsSavedEvent

type SecretsSavedEvent = Readonly<{
	names: readonly string[];
	unsaved: readonly string[];
	repository: string | null;
	requestId: string | null;
	sessionId: string | null;
}>;

secrets:request-dismissed

Fires when you dismiss the card where an agent asked you for secrets, with the request and its chat.

An automation sees: requestId, sessionId

Payload: SecretRequestDismissedEvent

type SecretRequestDismissedEvent = Readonly<{ requestId: string; sessionId: string }>;

secrets:deleted

Fires when you delete a secret under Tools, Secrets, with its name and the repository it was for (null for everywhere).

An automation sees: name, repository

Payload: SecretDeletedEvent

type SecretDeletedEvent = Readonly<{ name: string; repository: string | null }>;

extensions:changed

Fires when an extension from the marketplace is installed, updated, uninstalled, turned on or off, or withdrawn because its publisher pulled the version you have, with its publisher, name, version and that change. Every chat picks the change up at its next prompt.

An automation sees: publisher, name, version, change

Payload: ExtensionChangedEvent

type ExtensionChange =
	'installed' | 'updated' | 'uninstalled' | 'turned-on' | 'turned-off' | 'withdrawn';

type ExtensionChangedEvent = Readonly<{
	publisher: string;
	name: string;
	version: string;
	change: ExtensionChange;
}>;

extensions:published

Fires when you publish an extension from one of your repositories to the marketplace on bestboy.dev, with its publisher, name, the version that went live and the repository it came from.

An automation sees: publisher, name, version, repository

Payload: ExtensionPublishedEvent

type ExtensionPublishedEvent = Readonly<{
	publisher: string;
	name: string;
	version: string;
	repository: string;
}>;

widgets:board-changed

Fires when a widget board changes: an agent saves a widget, a shared widget changes on the default branch, or you add, move, resize or remove a widget, with the board it belongs to. Malini does not keep it in its event log.

An automation sees: board

Payload: WidgetBoardChangedEvent

type WidgetBoardChangedEvent = Readonly<{ board: string }>;

widgets:reading-changed

Fires when a widget reads its source, starts a read or a read fails, with the board, the widget, when it last read and the error of a failed read. Malini does not keep it in its event log.

An automation sees: board, widgetId, readAt, error, reading

Payload: WidgetReading

const WIDGET_STATES = ['success', 'failure', 'running', 'idle'] as const;

type WidgetState = (typeof WIDGET_STATES)[number];

type WidgetRow = Readonly<{
	label: string;
	value: number | string | null;
	max: number | null;
	detail: string | null;
	state: WidgetState | null;
	url: string | null;
}>;

const WIDGET_CHART_KINDS = ['line', 'bar'] as const;

type WidgetChartKind = (typeof WIDGET_CHART_KINDS)[number];

type WidgetChartSeries = Readonly<{
	label: string | null;
	values: readonly (number | null)[];
}>;

type WidgetChart = Readonly<{
	kind: WidgetChartKind;
	labels: readonly string[];
	series: readonly WidgetChartSeries[];
}>;

type WidgetData = Readonly<{
	value: number | string | null;
	unit: string | null;
	caption: string | null;
	delta: string | null;
	percent: number | null;
	state: WidgetState | null;
	history: readonly WidgetState[];
	rows: readonly WidgetRow[];
	chart: WidgetChart | null;
	url: string | null;
}>;

type WidgetNeed = Readonly<{ connect: string }>;

type WidgetReading = Readonly<{
	board: string;
	widgetId: string;
	fingerprint: string;
	data: WidgetData | null;
	readAt: string | null;
	error: string | null;
	need: WidgetNeed | null;
	attemptedAt: string | null;
	reading: boolean;
}>;

scratchpad:synced

Fires when a repository's shared scratchpad syncs with its private plan repository and the notes on this Mac changed, with the repository and the GitHub login of each teammate who edited them there.

An automation sees: repositoryFullName, people

Payload: ScratchpadSyncedEvent

type ScratchpadSyncedEvent = Readonly<{
	repositoryFullName: string;
	people: readonly string[];
}>;

scratchpad:share-requested

Fires when someone asks to share the scratchpad of a repository you own, with the repository and the GitHub login of each person who asks.

An automation sees: repositoryFullName, people

Payload: ScratchpadShareRequest

type ScratchpadShareRequest = Readonly<{
	repositoryFullName: string;
	people: readonly string[];
}>;

scratchpad:share-accepted

Fires when the owner you asked shares a repository's scratchpad and Malini joins its private plan repository, with the repository and the owner's GitHub login.

An automation sees: repositoryFullName, owner

Payload: ScratchpadShareAcceptedEvent

type ScratchpadShareAcceptedEvent = Readonly<{ repositoryFullName: string; owner: string }>;