Skip to content

Applies to Cowork 0.1.41 · For everyone who uses Cowork

Interaction ​

MAESTROSDK.confirm(request) ​

Shows a native confirmation dialog attached to the Cowork window and waits for the person's answer.

Parameters ​

NameTypeRequiredDescription
request.titlestringYesDialog title
request.messagestringYesThe question
request.confirmLabelstringNoText of the confirm button; default Cowork's own OK
request.cancelLabelstringNoText of the cancel button; default Cowork's own Cancel

Returns ​

Promise<boolean>: true when the person confirms, otherwise false.

Returns false when ​

CaseWhy
The person cancels or closes the dialogNo answer is a no
This tab is not the active tabOnly the tab in front may ask, so a background tab cannot interrupt. Inside a beforeRefresh handler for a refresh the person started, the tab may ask even if it is not in front
title or message is missing or not a stringInvalid request
Another confirmation is already open in the same windowOne dialog at a time
The page has no Cowork tab identity, or Cowork cannot show the dialogNot available

Example ​

js
const ok = await MAESTROSDK.confirm({
  title: 'Delete draft',
  message: 'Delete this draft? This cannot be undone.',
  confirmLabel: 'Delete',
  cancelLabel: 'Keep'
});
if (ok) deleteDraft();

For Micromeet Cowork 0.1.41 · build 261111110020