<?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>e7addef2-05ef-4810-8dc8-e90e4bda6e08</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>OpenRouter AI for Excel</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="OpenRouter AI for Excel"/>
  <Description DefaultValue="Chat with your workbook, run =AI.* formulas, and bulk-process columns using any model on OpenRouter."/>
  <IconUrl DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://openrouter.ai/docs"/>

  <AppDomains>
    <AppDomain>https://openrouter.ai</AppDomain>
  </AppDomains>

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

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

  <DefaultSettings>
    <SourceLocation DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/taskpane.html"/>
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">

        <!-- One long-lived runtime shared by the task pane, the ribbon commands and the custom
             functions. This is what gives =AI.* full CORS access to openrouter.ai, and lets all
             three share a single settings store, result cache and cost ledger. -->
        <Runtimes>
          <Runtime resid="Taskpane.Url" lifetime="long"/>
        </Runtimes>

        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Taskpane.Url"/>
            </Script>
            <Page>
              <SourceLocation resid="Taskpane.Url"/>
            </Page>
            <Metadata>
              <SourceLocation resid="Functions.Metadata.Url"/>
            </Metadata>
            <Namespace resid="Functions.Namespace"/>
          </ExtensionPoint>
        </AllFormFactors>

        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title"/>
            <Description resid="GetStarted.Description"/>
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
          </GetStarted>

          <FunctionFile resid="Taskpane.Url"/>

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="OpenRouter.Tab">
              <Group id="OpenRouter.AssistantGroup">
                <Label resid="AssistantGroup.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>

                <Control xsi:type="Button" id="OpenRouter.BtnAssistant">
                  <Label resid="BtnAssistant.Label"/>
                  <Supertip>
                    <Title resid="BtnAssistant.Label"/>
                    <Description resid="BtnAssistant.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Assistant.16x16"/>
                    <bt:Image size="32" resid="Icon.Assistant.32x32"/>
                    <bt:Image size="80" resid="Icon.Assistant.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>openassistant</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnExplainFormula">
                  <Label resid="BtnExplainFormula.Label"/>
                  <Supertip>
                    <Title resid="BtnExplainFormula.Label"/>
                    <Description resid="BtnExplainFormula.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.ExplainFormula.16x16"/>
                    <bt:Image size="32" resid="Icon.ExplainFormula.32x32"/>
                    <bt:Image size="80" resid="Icon.ExplainFormula.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>explainformula</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnBulk">
                  <Label resid="BtnBulk.Label"/>
                  <Supertip>
                    <Title resid="BtnBulk.Label"/>
                    <Description resid="BtnBulk.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Bulk.16x16"/>
                    <bt:Image size="32" resid="Icon.Bulk.32x32"/>
                    <bt:Image size="80" resid="Icon.Bulk.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>openbulk</FunctionName>
                  </Action>
                </Control>
              </Group>

              <Group id="OpenRouter.FunctionsGroup">
                <Label resid="FunctionsGroup.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>

                <Control xsi:type="Button" id="OpenRouter.BtnHelp">
                  <Label resid="BtnHelp.Label"/>
                  <Supertip>
                    <Title resid="BtnHelp.Label"/>
                    <Description resid="BtnHelp.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Help.16x16"/>
                    <bt:Image size="32" resid="Icon.Help.32x32"/>
                    <bt:Image size="80" resid="Icon.Help.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>openhelp</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnTogglePause">
                  <Label resid="BtnTogglePause.Label"/>
                  <Supertip>
                    <Title resid="BtnTogglePause.Label"/>
                    <Description resid="BtnTogglePause.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.TogglePause.16x16"/>
                    <bt:Image size="32" resid="Icon.TogglePause.32x32"/>
                    <bt:Image size="80" resid="Icon.TogglePause.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>toggleaipaused</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnRecalc">
                  <Label resid="BtnRecalc.Label"/>
                  <Supertip>
                    <Title resid="BtnRecalc.Label"/>
                    <Description resid="BtnRecalc.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Recalc.16x16"/>
                    <bt:Image size="32" resid="Icon.Recalc.32x32"/>
                    <bt:Image size="80" resid="Icon.Recalc.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>recalcaicells</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnFreeze">
                  <Label resid="BtnFreeze.Label"/>
                  <Supertip>
                    <Title resid="BtnFreeze.Label"/>
                    <Description resid="BtnFreeze.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Freeze.16x16"/>
                    <bt:Image size="32" resid="Icon.Freeze.32x32"/>
                    <bt:Image size="80" resid="Icon.Freeze.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>freezeaicells</FunctionName>
                  </Action>
                </Control>

                <Control xsi:type="Button" id="OpenRouter.BtnClearCache">
                  <Label resid="BtnClearCache.Label"/>
                  <Supertip>
                    <Title resid="BtnClearCache.Label"/>
                    <Description resid="BtnClearCache.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.ClearCache.16x16"/>
                    <bt:Image size="32" resid="Icon.ClearCache.32x32"/>
                    <bt:Image size="80" resid="Icon.ClearCache.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>clearaicache</FunctionName>
                  </Action>
                </Control>
              </Group>

              <Group id="OpenRouter.SetupGroup">
                <Label resid="SetupGroup.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>

                <Control xsi:type="Button" id="OpenRouter.BtnSettings">
                  <Label resid="BtnSettings.Label"/>
                  <Supertip>
                    <Title resid="BtnSettings.Label"/>
                    <Description resid="BtnSettings.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.Settings.16x16"/>
                    <bt:Image size="32" resid="Icon.Settings.32x32"/>
                    <bt:Image size="80" resid="Icon.Settings.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>opensettings</FunctionName>
                  </Action>
                </Control>
              </Group>

              <Label resid="Tab.Label"/>
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/icon-80.png"/>

        <!-- One Lucide-derived mark per ribbon button (see tools/make-ribbon-icons.js),
             matching the icon used for the same concept in src/taskpane/icons.tsx. -->
        <bt:Image id="Icon.Assistant.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-assistant-16.png"/>
        <bt:Image id="Icon.Assistant.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-assistant-32.png"/>
        <bt:Image id="Icon.Assistant.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-assistant-80.png"/>

        <bt:Image id="Icon.ExplainFormula.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-explainformula-16.png"/>
        <bt:Image id="Icon.ExplainFormula.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-explainformula-32.png"/>
        <bt:Image id="Icon.ExplainFormula.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-explainformula-80.png"/>

        <bt:Image id="Icon.Bulk.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-bulk-16.png"/>
        <bt:Image id="Icon.Bulk.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-bulk-32.png"/>
        <bt:Image id="Icon.Bulk.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-bulk-80.png"/>

        <bt:Image id="Icon.Help.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-help-16.png"/>
        <bt:Image id="Icon.Help.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-help-32.png"/>
        <bt:Image id="Icon.Help.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-help-80.png"/>

        <bt:Image id="Icon.TogglePause.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-togglepause-16.png"/>
        <bt:Image id="Icon.TogglePause.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-togglepause-32.png"/>
        <bt:Image id="Icon.TogglePause.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-togglepause-80.png"/>

        <bt:Image id="Icon.Recalc.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-recalc-16.png"/>
        <bt:Image id="Icon.Recalc.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-recalc-32.png"/>
        <bt:Image id="Icon.Recalc.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-recalc-80.png"/>

        <bt:Image id="Icon.Freeze.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-freeze-16.png"/>
        <bt:Image id="Icon.Freeze.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-freeze-32.png"/>
        <bt:Image id="Icon.Freeze.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-freeze-80.png"/>

        <bt:Image id="Icon.ClearCache.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-clearcache-16.png"/>
        <bt:Image id="Icon.ClearCache.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-clearcache-32.png"/>
        <bt:Image id="Icon.ClearCache.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-clearcache-80.png"/>

        <bt:Image id="Icon.Settings.16x16" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-settings-16.png"/>
        <bt:Image id="Icon.Settings.32x32" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-settings-32.png"/>
        <bt:Image id="Icon.Settings.80x80" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/assets/ribbon-settings-80.png"/>
      </bt:Images>

      <bt:Urls>
        <bt:Url id="Taskpane.Url" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/taskpane.html"/>
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://xlsx-openrouter-addin.pkana.cloud/functions.json"/>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://openrouter.ai/docs/quickstart"/>
      </bt:Urls>

      <bt:ShortStrings>
        <bt:String id="Functions.Namespace" DefaultValue="AI"/>
        <bt:String id="Tab.Label" DefaultValue="OpenRouter"/>
        <bt:String id="AssistantGroup.Label" DefaultValue="Assistant"/>
        <bt:String id="FunctionsGroup.Label" DefaultValue="AI Functions"/>
        <bt:String id="SetupGroup.Label" DefaultValue="Setup"/>
        <bt:String id="BtnAssistant.Label" DefaultValue="Assistant"/>
        <bt:String id="BtnExplainFormula.Label" DefaultValue="Explain Formula"/>
        <bt:String id="BtnBulk.Label" DefaultValue="Bulk Run"/>
        <bt:String id="BtnHelp.Label" DefaultValue="Function Guide"/>
        <bt:String id="BtnTogglePause.Label" DefaultValue="AI Live / Paused"/>
        <bt:String id="BtnRecalc.Label" DefaultValue="Recalc AI Cells"/>
        <bt:String id="BtnFreeze.Label" DefaultValue="Freeze to Values"/>
        <bt:String id="BtnClearCache.Label" DefaultValue="Clear Cache"/>
        <bt:String id="BtnSettings.Label" DefaultValue="Settings"/>
        <bt:String id="GetStarted.Title" DefaultValue="OpenRouter AI for Excel is ready."/>
      </bt:ShortStrings>

      <bt:LongStrings>
        <bt:String id="BtnAssistant.Tooltip" DefaultValue="Open the chat assistant. It reads your workbook and can edit cells and formulas with your approval."/>
        <bt:String id="BtnExplainFormula.Tooltip" DefaultValue="Explain the formula in the selected cell in plain language, including the values it depends on."/>
        <bt:String id="BtnBulk.Tooltip" DefaultValue="Run one prompt down a column of rows and write the results into another column."/>
        <bt:String id="BtnHelp.Tooltip" DefaultValue="Browse every =AI.* function with its syntax and a working example, and insert an example into the selected cell."/>
        <bt:String id="BtnTogglePause.Tooltip" DefaultValue="Pause or resume =AI.* formulas. While paused they return cached values only and never call the API."/>
        <bt:String id="BtnRecalc.Tooltip" DefaultValue="Force every =AI.* formula in the workbook to recalculate."/>
        <bt:String id="BtnFreeze.Tooltip" DefaultValue="Replace =AI.* formulas in the selection with their current values, so they stop calling the API and open correctly without this add-in. Select one cell to do the whole sheet."/>
        <bt:String id="BtnClearCache.Tooltip" DefaultValue="Empty the cached =AI.* results so the next recalculation calls the API again."/>
        <bt:String id="BtnSettings.Tooltip" DefaultValue="Set your OpenRouter API key, pick models, and review what you have spent."/>
        <bt:String id="GetStarted.Description" DefaultValue="Open Settings on the OpenRouter tab and paste your API key to get started."/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
