<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
           xsi:type="TaskPaneApp">

  <Id>a1b2c3d4-e5f6-7890-abcd-ef1234567890</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Local AI</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Local AI" />
  <Description DefaultValue="Call local LLMs from Excel using =AI_LOCAL()" />
  <IconUrl DefaultValue="https://127.0.0.1:1235/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://127.0.0.1:1235/icon-128.png" />
  <SupportUrl DefaultValue="https://127.0.0.1:1235/" />

  <AppDomains>
    <AppDomain>https://127.0.0.1</AppDomain>
    <AppDomain>https://127.0.0.1:1235</AppDomain>
  </AppDomains>

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

  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="SharedRuntime" MinVersion="1.1" />
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://127.0.0.1:1235/taskpane.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <Runtimes>
          <Runtime resid="FunctionsRuntime.Url" lifetime="long" />
        </Runtimes>
        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="FunctionsRuntime.Url" />
            </Script>
            <Page>
              <SourceLocation resid="FunctionsRuntime.Url" />
            </Page>
            <Metadata>
              <SourceLocation resid="FunctionsMetadata.Url" />
            </Metadata>
          </ExtensionPoint>
        </AllFormFactors>
        <DesktopFormFactor>
          <FunctionFile resid="FunctionsRuntime.Url" />
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="LocalAIGroup">
                <Label resid="GroupLabel" />
                <Control xsi:type="Button" id="LocalAIButton">
                  <Label resid="ButtonLabel" />
                  <Supertip>
                    <Title resid="ButtonLabel" />
                    <Description resid="ButtonTooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon16" />
                    <bt:Image size="32" resid="Icon32" />
                    <bt:Image size="80" resid="Icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>LocalAITaskPane</TaskpaneId>
                    <SourceLocation resid="FunctionsRuntime.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon16" DefaultValue="https://127.0.0.1:1235/icon-16.png" />
        <bt:Image id="Icon32" DefaultValue="https://127.0.0.1:1235/icon-32.png" />
        <bt:Image id="Icon80" DefaultValue="https://127.0.0.1:1235/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="FunctionsRuntime.Url" DefaultValue="https://127.0.0.1:1235/taskpane.html" />
        <bt:Url id="FunctionsMetadata.Url" DefaultValue="https://127.0.0.1:1235/functions.json" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GroupLabel" DefaultValue="Local AI" />
        <bt:String id="ButtonLabel" DefaultValue="AI Chat" />
        <bt:String id="ButtonTooltip" DefaultValue="Open local AI chat panel" />
      </bt:ShortStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
