// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { defInterface, defMessage } from '../transport/messaging.js';
// Shared between host and client.
export const ActorHostDef = defInterface({
    name: 'ActorHost',
    methods: [
        {
            name: 'getContextForActorFromTab',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 11,
            },
        },
        {
            name: 'createTask',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 60,
            },
        },
        {
            name: 'performActions',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 61,
            },
        },
        {
            name: 'cancelActions',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 85,
            },
        },
        {
            name: 'stopActorTask',
            request: defMessage(),
            histogram: {
                id: 13,
            },
        },
        {
            name: 'pauseActorTask',
            request: defMessage(),
            histogram: {
                id: 14,
            },
        },
        {
            name: 'resumeActorTask',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 15,
            },
        },
        {
            name: 'interruptActorTask',
            request: defMessage(),
            histogram: {
                id: 74,
            },
        },
        {
            name: 'uninterruptActorTask',
            request: defMessage(),
            histogram: {
                id: 75,
            },
        },
        {
            name: 'createActorTab',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 77,
            },
        },
        {
            name: 'logBeginAsyncEvent',
            request: defMessage(),
            histogram: {
                id: 30,
            },
        },
        {
            name: 'logEndAsyncEvent',
            request: defMessage(),
            histogram: {
                id: 31,
            },
        },
        {
            name: 'logInstantEvent',
            request: defMessage(),
            histogram: {
                id: 32,
            },
        },
        {
            name: 'journalClear',
            histogram: {
                id: 33,
            },
        },
        {
            name: 'journalSnapshot',
            request: defMessage(),
            response: defMessage(),
            histogram: {
                id: 34,
            },
        },
        {
            name: 'journalStart',
            request: defMessage(),
            histogram: {
                id: 35,
            },
        },
        {
            name: 'journalStop',
            histogram: {
                id: 36,
            },
        },
        {
            name: 'journalRecordFeedback',
            request: defMessage(),
            histogram: {
                id: 37,
            },
        },
        {
            name: 'autofillSuggestionDialogOnFormPresented',
            request: defMessage(),
            histogram: {
                id: 87,
            },
        },
        {
            name: 'autofillSuggestionDialogOnFormPreviewChanged',
            request: defMessage(),
            histogram: {
                id: 88,
            },
        },
        {
            name: 'autofillSuggestionDialogOnFormConfirmed',
            request: defMessage(),
            histogram: {
                id: 89,
            },
        },
    ],
});
export const ActorClientDef = defInterface({
    name: 'ActorClient',
    methods: [
        {
            name: 'notifyActorTaskStateChanged',
            request: defMessage(),
        },
        {
            name: 'requestToShowDialog',
            request: defMessage(),
            response: defMessage(),
        },
        {
            name: 'requestToShowConfirmationDialog',
            request: defMessage(),
            response: defMessage(),
        },
        {
            name: 'requestToConfirmNavigation',
            request: defMessage(),
            response: defMessage(),
        },
        {
            name: 'requestToShowAutofillSuggestionsDialog',
            request: defMessage(),
            response: defMessage(),
        },
        {
            name: 'requestToShowGmailOtpOptInDialog',
            request: defMessage(),
            response: defMessage(),
            backgroundAllowed: true,
        },
    ],
});
export var ConfirmationRequestErrorReason;
(function (ConfirmationRequestErrorReason) {
    // The hosting WebUI received the request, but the web client has not
    // subscribed to the request yet. We couldn't show the dialog in this case.
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["REQUEST_PROMISE_NO_SUBSCRIBER"] = 0] = "REQUEST_PROMISE_NO_SUBSCRIBER";
    // The task requested a new user confirmation dialog before the current
    // one completed.
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["PREEMPTED_BY_NEW_REQUEST"] = 1] = "PREEMPTED_BY_NEW_REQUEST";
})(ConfirmationRequestErrorReason || (ConfirmationRequestErrorReason = {}));
/** Reasons why the credential selection dialog request failed. */
export var SelectCredentialDialogErrorReason;
(function (SelectCredentialDialogErrorReason) {
    // The hosting WebUI received the request, but the web client has not
    // subscribed to the request yet. We couldn't show the dialog in this case.
    SelectCredentialDialogErrorReason[SelectCredentialDialogErrorReason["DIALOG_PROMISE_NO_SUBSCRIBER"] = 0] = "DIALOG_PROMISE_NO_SUBSCRIBER";
})(SelectCredentialDialogErrorReason || (SelectCredentialDialogErrorReason = {}));
// LINT.IfChange(SelectAutofillSuggestionsDialogErrorReason)
/** Reasons why the autofill suggestion selection dialog request failed. */
export var SelectAutofillSuggestionsDialogErrorReason;
(function (SelectAutofillSuggestionsDialogErrorReason) {
    // The hosting WebUI received the request, but the web client has not
    // subscribed to the request yet. We couldn't show the dialog in this case.
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["DIALOG_PROMISE_NO_SUBSCRIBER"] = 0] = "DIALOG_PROMISE_NO_SUBSCRIBER";
    // The requested task id did not match the response task id. This error is
    // internal to the browser and not sent by the client over mojo.
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["MISMATCHED_TASK_ID"] = 1] = "MISMATCHED_TASK_ID";
    // The task is not connected to a delegate. I.e. attempting to run the task
    // from the experimental actor API. This error is internal to the browser and
    // not sent by the client over mojo.
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["NO_ACTOR_TASK_DELEGATE"] = 2] = "NO_ACTOR_TASK_DELEGATE";
})(SelectAutofillSuggestionsDialogErrorReason || (SelectAutofillSuggestionsDialogErrorReason = {}));
// LINT.IfChange(GmailOtpOptInErrorReason)
export var GmailOtpOptInErrorReason;
(function (GmailOtpOptInErrorReason) {
    GmailOtpOptInErrorReason[GmailOtpOptInErrorReason["REQUEST_PROMISE_NO_SUBSCRIBER"] = 0] = "REQUEST_PROMISE_NO_SUBSCRIBER";
})(GmailOtpOptInErrorReason || (GmailOtpOptInErrorReason = {}));
// LINT.ThenChange(//chrome/common/actor_webui.mojom:GmailOtpOptInErrorReason)
