<?xml version="1.0" encoding="UTF-8"?>
<!--
  Outlook mail add-in manifest (read surface only for Phase 0).

  Phase 2 adds "Log to Sapphire" and attachment analysis on this same surface.
  Compose surface is deliberately absent until there is a reason for it.
-->
<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>3f5a1c60-0f1e-4a5e-9d2a-000000000002</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Sapphire Legal</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Sapphire Legal" />
  <Description DefaultValue="File email to a matter and review attached contracts." />
  <IconUrl DefaultValue="https://app.sapphirelegal.ai/addins/assets/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://app.sapphirelegal.ai/addins/assets/icon-128.png" />
  <SupportUrl DefaultValue="https://www.sapphirelegal.ai/support" />

  <AppDomains>
    <AppDomain>https://app.sapphirelegal.ai</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.8" />
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://app.sapphirelegal.ai/addins/outlook.html" />
        <RequestedHeight>350</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <!-- ReadItem covers everything Phase 2 does: reading the message, its
       Message-ID, and attachment content. Filing happens against Sapphire's own
       API, not the mailbox, so no write permission is needed. Widen only if a
       feature genuinely requires it — Outlook re-prompts users on permission
       jumps, and ReadWriteMailbox in particular reads as alarming. -->
  <Permissions>ReadItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.8">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="Sapphire.Group">
                <Label resid="Sapphire.Group.Label" />
                <Control xsi:type="Button" id="Sapphire.OpenPane">
                  <Label resid="Sapphire.OpenPane.Label" />
                  <Supertip>
                    <Title resid="Sapphire.OpenPane.Label" />
                    <Description resid="Sapphire.OpenPane.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.sapphirelegal.ai/addins/assets/icon-16.png" />
        <bt:Image id="Icon.32x32" DefaultValue="https://app.sapphirelegal.ai/addins/assets/icon-32.png" />
        <bt:Image id="Icon.80x80" DefaultValue="https://app.sapphirelegal.ai/addins/assets/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Taskpane.Url" DefaultValue="https://app.sapphirelegal.ai/addins/outlook.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Sapphire.Group.Label" DefaultValue="Sapphire Legal" />
        <bt:String id="Sapphire.OpenPane.Label" DefaultValue="Open Sapphire" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Sapphire.OpenPane.Tooltip" DefaultValue="File this email to a matter, or review an attached contract." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
