<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- MIER AI for Outlook (Phase F). A separate MailApp manifest: XML manifests cannot mix
     mail and task-pane hosts. DRAFT-ONLY: the add-in reads the selected email and prepares
     replies / new messages; the user always sends. ReadWriteItem lets it edit the draft the
     user is writing — it grants no send, and the code has no send path (CI-audited). -->
<OfficeApp
  xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
  xsi:type="MailApp">

  <Id>b5e38e78-c498-56f8-8b1f-4a77abc878e6</Id>
  <Version>1.2.0.0</Version>
  <ProviderName>MIER AI</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="MIER AI"/>
  <Description DefaultValue="Sovereign AI assistant for email: understand, summarise and draft replies you review and send."/>
  <IconUrl DefaultValue="https://app.mier.work/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://app.mier.work/assets/icon-128.png"/>
  <SupportUrl DefaultValue="https://app.mier.work"/>

  <AppDomains>
    <AppDomain>https://app.mier.work</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.3"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://app.mier.work"/>
        <RequestedHeight>450</RequestedHeight>
      </DesktopSettings>
    </Form>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://app.mier.work"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </Rule>
  <DisableEntityHighlighting>true</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox"/>
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="mier.read.group">
                <Label resid="Group.Label"/>
                <Control xsi:type="Button" id="mier.read.open">
                  <Label resid="Button.Label"/>
                  <Supertip>
                    <Title resid="Button.Label"/>
                    <Description resid="Button.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
          <ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="mier.compose.group">
                <Label resid="Group.Label"/>
                <Control xsi:type="Button" id="mier.compose.open">
                  <Label resid="Button.Label"/>
                  <Supertip>
                    <Title resid="Button.Label"/>
                    <Description resid="Button.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://app.mier.work/assets/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://app.mier.work/assets/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://app.mier.work/assets/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Taskpane.Url" DefaultValue="https://app.mier.work"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Group.Label" DefaultValue="MIER AI"/>
        <bt:String id="Button.Label" DefaultValue="MIER AI"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Button.Tooltip" DefaultValue="Understand this email and draft a reply. You review and send."/>
      </bt:LongStrings>
    </Resources>
    <!-- Mailbox 1.12+: the same buttons plus the send check. Older Outlook ignores this block and uses the one above. -->
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.12">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>
  <Hosts>
        <Host xsi:type="MailHost">
          <!-- MIER Quality send check (H-Q9): runtime for OnMessageSend; classic Outlook on Windows uses the JS file -->
          <Runtimes>
            <Runtime resid="SendCheck.Url">
              <Override type="javascript" resid="SendCheck.JS"/>
            </Runtime>
          </Runtimes>
          <DesktopFormFactor>
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="mier.read.group">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Button" id="mier.read.open">
                    <Label resid="Button.Label"/>
                    <Supertip>
                      <Title resid="Button.Label"/>
                      <Description resid="Button.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16x16"/>
                      <bt:Image size="32" resid="Icon.32x32"/>
                      <bt:Image size="80" resid="Icon.80x80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="mier.compose.group">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Button" id="mier.compose.open">
                    <Label resid="Button.Label"/>
                    <Supertip>
                      <Title resid="Button.Label"/>
                      <Description resid="Button.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16x16"/>
                      <bt:Image size="32" resid="Icon.32x32"/>
                      <bt:Image size="80" resid="Icon.80x80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <!-- PromptUser: Outlook offers "Send anyway"; if the add-in can't load, the email is sent -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="PromptUser"/>
              </LaunchEvents>
              <SourceLocation resid="SendCheck.Url"/>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
  <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://app.mier.work/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://app.mier.work/assets/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://app.mier.work/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Taskpane.Url" DefaultValue="https://app.mier.work"/>
          <bt:Url id="SendCheck.Url" DefaultValue="https://app.mier.work/send-check.html"/>
          <bt:Url id="SendCheck.JS" DefaultValue="https://app.mier.work/send-check.js"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="Group.Label" DefaultValue="MIER AI"/>
          <bt:String id="Button.Label" DefaultValue="MIER AI"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="Button.Tooltip" DefaultValue="Understand this email and draft a reply. You review and send."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
