@box/box-ai-agent-selector 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +379 -0
- package/chunks/types.js +6 -0
- package/esm/index.js +12 -0
- package/esm/lib/box-ai-agent-selector-with-api-container.js +22 -0
- package/esm/lib/box-ai-agent-selector-with-api.js +59 -0
- package/esm/lib/box-ai-agent-selector.js +116 -0
- package/esm/lib/box-ai-agent.js +61 -0
- package/esm/lib/constants.js +19 -0
- package/esm/lib/contexts/actions.js +6 -0
- package/esm/lib/contexts/constants.js +9 -0
- package/esm/lib/contexts/context.js +38 -0
- package/esm/lib/contexts/index.js +8 -0
- package/esm/lib/contexts/reducer.js +44 -0
- package/esm/lib/messages.js +34 -0
- package/i18n/bn-IN.js +9 -0
- package/i18n/bn-IN.properties +14 -0
- package/i18n/da-DK.js +9 -0
- package/i18n/da-DK.properties +14 -0
- package/i18n/de-DE.js +9 -0
- package/i18n/de-DE.properties +14 -0
- package/i18n/en-AU.js +9 -0
- package/i18n/en-AU.properties +14 -0
- package/i18n/en-CA.js +9 -0
- package/i18n/en-CA.properties +14 -0
- package/i18n/en-GB.js +9 -0
- package/i18n/en-GB.properties +14 -0
- package/i18n/en-US.js +9 -0
- package/i18n/en-US.properties +14 -0
- package/i18n/en-x-pseudo.js +9 -0
- package/i18n/en-x-pseudo.properties +14 -0
- package/i18n/es-419.js +9 -0
- package/i18n/es-419.properties +14 -0
- package/i18n/es-ES.js +9 -0
- package/i18n/es-ES.properties +14 -0
- package/i18n/fi-FI.js +9 -0
- package/i18n/fi-FI.properties +14 -0
- package/i18n/fr-CA.js +9 -0
- package/i18n/fr-CA.properties +14 -0
- package/i18n/fr-FR.js +9 -0
- package/i18n/fr-FR.properties +14 -0
- package/i18n/hi-IN.js +9 -0
- package/i18n/hi-IN.properties +14 -0
- package/i18n/it-IT.js +9 -0
- package/i18n/it-IT.properties +14 -0
- package/i18n/ja-JP.js +9 -0
- package/i18n/ja-JP.properties +14 -0
- package/i18n/json/src/lib/messages.json +1 -0
- package/i18n/ko-KR.js +9 -0
- package/i18n/ko-KR.properties +14 -0
- package/i18n/nb-NO.js +9 -0
- package/i18n/nb-NO.properties +14 -0
- package/i18n/nl-NL.js +9 -0
- package/i18n/nl-NL.properties +14 -0
- package/i18n/pl-PL.js +9 -0
- package/i18n/pl-PL.properties +14 -0
- package/i18n/pt-BR.js +9 -0
- package/i18n/pt-BR.properties +14 -0
- package/i18n/ru-RU.js +9 -0
- package/i18n/ru-RU.properties +14 -0
- package/i18n/sv-SE.js +9 -0
- package/i18n/sv-SE.properties +14 -0
- package/i18n/tr-TR.js +9 -0
- package/i18n/tr-TR.properties +14 -0
- package/i18n/zh-CN.js +9 -0
- package/i18n/zh-CN.properties +14 -0
- package/i18n/zh-TW.js +9 -0
- package/i18n/zh-TW.properties +14 -0
- package/package.json +50 -0
- package/styles/box-ai-agent-selector.css +1 -0
- package/styles/box-ai-agent.css +1 -0
- package/types/index.d.ts +3 -0
- package/types/lib/box-ai-agent-selector-with-api-container.d.ts +25 -0
- package/types/lib/box-ai-agent-selector-with-api.d.ts +25 -0
- package/types/lib/box-ai-agent-selector.d.ts +25 -0
- package/types/lib/box-ai-agent.d.ts +13 -0
- package/types/lib/constants.d.ts +13 -0
- package/types/lib/contexts/actions.d.ts +6 -0
- package/types/lib/contexts/constants.d.ts +2 -0
- package/types/lib/contexts/context.d.ts +10 -0
- package/types/lib/contexts/index.d.ts +2 -0
- package/types/lib/contexts/reducer.d.ts +2 -0
- package/types/lib/contexts/stories/shared.d.ts +4 -0
- package/types/lib/messages.d.ts +38 -0
- package/types/lib/test-utils/mocks.d.ts +3 -0
- package/types/lib/types.d.ts +41 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = 에이전트
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = 기본
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = 기본
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = 사용 가능한 에이전트를 로드하지 못했습니다. 현재 조직의 기본 에이전트를 사용하고 있습니다. 재시도 하려면 여기를 클릭하십시오
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = 사용 가능한 에이전트를 로드하지 못했습니다
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = 사용 가능한 에이전트 로드
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = 에이전트 선택
|
package/i18n/nb-NO.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Agent",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Standard",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "STANDARD",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Kunne ikke laste inn tilgjengelige agenter. Du bruker for øyeblikket organisasjonens standardagent. Klikk her for å prøve på nytt.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Kunne ikke laste inn tilgjengelige agenter",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Laster tilgjengelige agenter",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Velg en agent"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Agent
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Standard
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = STANDARD
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Kunne ikke laste inn tilgjengelige agenter. Du bruker for øyeblikket organisasjonens standardagent. Klikk her for å prøve på nytt.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Kunne ikke laste inn tilgjengelige agenter
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Laster tilgjengelige agenter
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Velg en agent
|
package/i18n/nl-NL.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Agent",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Standaard",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "STANDAARD",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Kan beschikbare agenten niet laden. U gebruikt momenteel de standaardagent van uw organisatie. Klik hier om het opnieuw te proberen.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Kan beschikbare agenten niet laden",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Beschikbare agenten laden",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Selecteer een agent"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Agent
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Standaard
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = STANDAARD
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Kan beschikbare agenten niet laden. U gebruikt momenteel de standaardagent van uw organisatie. Klik hier om het opnieuw te proberen.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Kan beschikbare agenten niet laden
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Beschikbare agenten laden
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Selecteer een agent
|
package/i18n/pl-PL.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Agent",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Domyślne",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "DOMYŚLNE",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Nie udało się wczytać dostępnych agentów. Obecnie używasz domyślnego agenta organizacji. Kliknij tutaj, aby spróbować ponownie",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Nie udało się wczytać dostępnych agentów",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Wczytywanie dostępnych agentów",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Wybierz agenta"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Agent
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Domyślne
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = DOMYŚLNE
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Nie udało się wczytać dostępnych agentów. Obecnie używasz domyślnego agenta organizacji. Kliknij tutaj, aby spróbować ponownie
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Nie udało się wczytać dostępnych agentów
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Wczytywanie dostępnych agentów
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Wybierz agenta
|
package/i18n/pt-BR.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Agente",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Padrão",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "PADRÃO",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Falha ao carregar agentes disponíveis. Você está usando atualmente o agente padrão de sua organização. Clique aqui para tentar novamente.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Falha ao carregar agentes disponíveis",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Carregando agentes disponíveis",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Selecionar um agente"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Agente
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Padrão
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = PADRÃO
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Falha ao carregar agentes disponíveis. Você está usando atualmente o agente padrão de sua organização. Clique aqui para tentar novamente.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Falha ao carregar agentes disponíveis
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Carregando agentes disponíveis
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Selecionar um agente
|
package/i18n/ru-RU.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Агент",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "По умолчанию",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "ПО УМОЛЧАНИЮ",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Не удалось загрузить доступные агенты. В настоящее время вы используете агент вашей организации по умолчанию. Нажмите здесь для повторной попытки.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Не удалось загрузить доступные агенты",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Загрузка доступных агентов",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Выберите агента"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Агент
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = По умолчанию
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = ПО УМОЛЧАНИЮ
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Не удалось загрузить доступные агенты. В настоящее время вы используете агент вашей организации по умолчанию. Нажмите здесь для повторной попытки.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Не удалось загрузить доступные агенты
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Загрузка доступных агентов
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Выберите агента
|
package/i18n/sv-SE.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Agent",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Standard",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "STANDARD",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Det gick inte att ladda tillgängliga agenter. Du använder för närvarande din organisations standardagent. Klicka här för att försöka igen.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Det gick inte att ladda tillgängliga agenter",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Laddar tillgängliga agenter",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Välj en agent"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Agent
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Standard
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = STANDARD
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Det gick inte att ladda tillgängliga agenter. Du använder för närvarande din organisations standardagent. Klicka här för att försöka igen.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Det gick inte att ladda tillgängliga agenter
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Laddar tillgängliga agenter
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Välj en agent
|
package/i18n/tr-TR.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "Aracı",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "Varsayılan",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "VARSAYILAN",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "Mevcut aracılar yüklenemedi. Şu anda kuruluşunuzun varsayılan aracısını kullanıyorsunuz. Yeniden denemek için buraya tıklayın.",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "Mevcut aracılar yüklenemedi",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "Mevcut aracılar yükleniyor",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "Bir Aracı seçin"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = Aracı
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = Varsayılan
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = VARSAYILAN
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = Mevcut aracılar yüklenemedi. Şu anda kuruluşunuzun varsayılan aracısını kullanıyorsunuz. Yeniden denemek için buraya tıklayın.
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = Mevcut aracılar yüklenemedi
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = Mevcut aracılar yükleniyor
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = Bir Aracı seçin
|
package/i18n/zh-CN.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "代理",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "默认",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "默认",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "无法加载可用代理。您当前正使用组织的默认代理。单击此处重试。",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "无法加载可用代理",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "正在加载可用代理",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "选择一个代理"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = 代理
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = 默认
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = 默认
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = 无法加载可用代理。您当前正使用组织的默认代理。单击此处重试。
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = 无法加载可用代理
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = 正在加载可用代理
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = 选择一个代理
|
package/i18n/zh-TW.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"boxAI.agentSelector.agent": "代理",
|
|
3
|
+
"boxAI.agentSelector.defaultAgent": "預設",
|
|
4
|
+
"boxAI.agentSelector.defaultStatus": "預設",
|
|
5
|
+
"boxAI.agentSelector.errorMessage": "載入可用代理失敗。 您目前正在使用您組織的預設代理。 按一下這裡以重試。",
|
|
6
|
+
"boxAI.agentSelector.errorTooltip": "載入可用的代理失敗",
|
|
7
|
+
"boxAI.agentSelector.loadingMessage": "正在載入可用的代理",
|
|
8
|
+
"boxAI.agentSelector.selectAgent": "選擇代理"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# AI agent label
|
|
2
|
+
boxAI.agentSelector.agent = 代理
|
|
3
|
+
# Label for the default agent used when no other agents are available
|
|
4
|
+
boxAI.agentSelector.defaultAgent = 預設
|
|
5
|
+
# Status indicator to define whether or not the agent on the list is the default for the enterprise
|
|
6
|
+
boxAI.agentSelector.defaultStatus = 預設
|
|
7
|
+
# Error message for retry option when the agents failed to load
|
|
8
|
+
boxAI.agentSelector.errorMessage = 載入可用代理失敗。 您目前正在使用您組織的預設代理。 按一下這裡以重試。
|
|
9
|
+
# Error tooltip content for agent selector when the agents failed to load
|
|
10
|
+
boxAI.agentSelector.errorTooltip = 載入可用的代理失敗
|
|
11
|
+
# Message for loading indicator while loading available agents
|
|
12
|
+
boxAI.agentSelector.loadingMessage = 正在載入可用的代理
|
|
13
|
+
# Label for the AI agent selector when the user has not selected any agent
|
|
14
|
+
boxAI.agentSelector.selectAgent = 選擇代理
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@box/box-ai-agent-selector",
|
|
3
|
+
"version": "0.12.2",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@box/blueprint-web": "^7.31.1",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.26.0",
|
|
8
|
+
"react": "^17.0.0",
|
|
9
|
+
"react-dom": "^17.0.0",
|
|
10
|
+
"react-intl": "^6.4.2"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@box/blueprint-web": "^8.2.1",
|
|
14
|
+
"@box/blueprint-web-assets": "^4.28.0",
|
|
15
|
+
"@box/eslint-plugin-blueprint": "*",
|
|
16
|
+
"@box/storybook-utils": "^0.7.0",
|
|
17
|
+
"react-intl": "^6.4.2"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prepare": "yarn nx run box-ai-agent-selector:prepare"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"directory": "dist",
|
|
25
|
+
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"main": "./esm/index.js",
|
|
28
|
+
"module": "./esm/index.js",
|
|
29
|
+
"types": "./types/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"require": "./esm/index.js",
|
|
33
|
+
"import": "./esm/index.js",
|
|
34
|
+
"types": "./types/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./*": {
|
|
37
|
+
"require": "./esm/*",
|
|
38
|
+
"import": "./esm/*",
|
|
39
|
+
"types": "./types/*"
|
|
40
|
+
},
|
|
41
|
+
"./i18n/*": {
|
|
42
|
+
"require": "./i18n/*",
|
|
43
|
+
"import": "./i18n/*"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": [
|
|
47
|
+
"**/*.css"
|
|
48
|
+
],
|
|
49
|
+
"gitHead": "96011024263060e997f2e1fe8ae9e496bc68be33"
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._agentSelector_1vtwj_1{margin-inline-start:.75rem}._agentSelector_1vtwj_1 ._agentStatus_1vtwj_4{margin-inline-start:.5rem}._agentSelector_1vtwj_1 ._agentStatus_1vtwj_4>span{background:linear-gradient(#f4f4f4 0,#f4f4f4 0) padding-box,linear-gradient(135deg,#fe01da,#2486fc) border-box;border:.0625rem solid rgba(0,0,0,0)}._agentSelector_1vtwj_1 ._agentStatus_1vtwj_4>span span{background:linear-gradient(135deg,#fe01da,#2486fc);color:transparent;-webkit-background-clip:text;background-clip:text;text-transform:uppercase}._agentSelector_1vtwj_1 ._agentLoader_1vtwj_18{position:inherit}._agentSelector_1vtwj_1 ._agentError_1vtwj_21 path{fill:#d5324e}._agentListItemIcon_1vtwj_25{height:2rem;width:2rem}._agentListContainer_1vtwj_30{min-width:320px;max-width:500px}._agentListRetryButton_1vtwj_35{margin:.25rem;max-width:320px;text-wrap:wrap}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._agentListItem_1s7vn_1 ._agentListItemIcon_1s7vn_1{height:2rem;width:2rem}._agentListItem_1s7vn_1 ._defaultAgentHeader_1s7vn_5{display:flex!important;align-items:center}._agentListItem_1s7vn_1 ._defaultAgentName_1s7vn_9{flex-grow:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._agentListItem_1s7vn_1 ._defaultAgentStatus_1s7vn_15{margin-inline-start:var(--space-2);flex-shrink:0}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type AgentListResponse, type RecordActionType } from './types';
|
|
2
|
+
export interface BoxAiAgentSelectorWithApiContainerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Function responsible for fetching the list of agents,
|
|
5
|
+
* typically passed from the parent component.
|
|
6
|
+
* The function returns a promise that resolves to the agent list response.
|
|
7
|
+
*/
|
|
8
|
+
fetcher: () => Promise<AgentListResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Name of the host application for resin event tracking
|
|
11
|
+
* */
|
|
12
|
+
hostAppName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback function to handle logging resin events
|
|
15
|
+
* */
|
|
16
|
+
recordAction?: (payload: RecordActionType) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether the agent selector component should remain hidden
|
|
19
|
+
* until the initial data fetch is complete.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
shouldHideAgentSelectorOnLoad?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function BoxAiAgentSelectorWithApiContainer({ fetcher, shouldHideAgentSelectorOnLoad, hostAppName, recordAction, }: BoxAiAgentSelectorWithApiContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default BoxAiAgentSelectorWithApiContainer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type AgentListResponse, type RecordActionType } from './types';
|
|
2
|
+
export interface BoxAiAgentSelectorWithApiProps {
|
|
3
|
+
/**
|
|
4
|
+
* Function responsible for fetching the list of agents,
|
|
5
|
+
* typically passed from the parent component.
|
|
6
|
+
* The function returns a promise that resolves to the agent list response.
|
|
7
|
+
*/
|
|
8
|
+
fetcher: () => Promise<AgentListResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Name of the host application for resin event tracking
|
|
11
|
+
* */
|
|
12
|
+
hostAppName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback function to handle logging resin events
|
|
15
|
+
* */
|
|
16
|
+
recordAction?: (payload: RecordActionType) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether the agent selector component should remain hidden
|
|
19
|
+
* until the initial data fetch is complete.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
shouldHideAgentSelectorOnLoad?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function BoxAiAgentSelectorWithApi({ fetcher, shouldHideAgentSelectorOnLoad, hostAppName, recordAction, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
export default BoxAiAgentSelectorWithApi;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { REQUEST_STATE, type AgentType, type RecordActionType } from './types';
|
|
2
|
+
export interface BoxAiAgentSelectorProps {
|
|
3
|
+
/**
|
|
4
|
+
* Array of available agents to select from.
|
|
5
|
+
*/
|
|
6
|
+
agents: AgentType[];
|
|
7
|
+
/**
|
|
8
|
+
* Callback function triggered when an error occurs, used to retry fetching the agent list.
|
|
9
|
+
*/
|
|
10
|
+
onErrorAction: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Callback function to handle logging resin events
|
|
13
|
+
* */
|
|
14
|
+
recordAction?: (payload: RecordActionType) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Current state of the request to fetch agents, representing one of: Success, Error, In Progress, or Not Started.
|
|
17
|
+
*/
|
|
18
|
+
requestState: REQUEST_STATE;
|
|
19
|
+
/**
|
|
20
|
+
* The currently selected agent, or null if no agent is selected.
|
|
21
|
+
*/
|
|
22
|
+
selectedAgent: AgentType | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function BoxAiAgentSelector({ agents, onErrorAction, requestState, selectedAgent, recordAction, }: BoxAiAgentSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default BoxAiAgentSelector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AgentType } from './types';
|
|
2
|
+
export interface BoxAiAgentProps {
|
|
3
|
+
/**
|
|
4
|
+
* Object representation of agent.
|
|
5
|
+
*/
|
|
6
|
+
agent: AgentType;
|
|
7
|
+
/**
|
|
8
|
+
* Callback function triggered when an agent is selected
|
|
9
|
+
*/
|
|
10
|
+
onAction: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function BoxAiAgent({ agent, onAction }: BoxAiAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default BoxAiAgent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type RecordActionType } from './types';
|
|
2
|
+
export declare const LOGGER_ACTION_CLICK = "click";
|
|
3
|
+
export declare const LOGGER_ACTION_PROGRAMMATIC = "programmatic";
|
|
4
|
+
export declare const LOGGER_COMPONENT = "selector";
|
|
5
|
+
export declare const LOGGER_FEATURE = "agentSelector";
|
|
6
|
+
export declare const LOGGER_TARGET: {
|
|
7
|
+
LOADED_AGENTS: string;
|
|
8
|
+
ERROR_LOADING_AGENTS: string;
|
|
9
|
+
RETRY_LOADING_AGENTS: string;
|
|
10
|
+
OPEN_SELECTOR: string;
|
|
11
|
+
SELECT_AGENT: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const LOGGER_BASE_CONFIG: RecordActionType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AgentAction, type AgentState } from '../types';
|
|
2
|
+
type DispatchType = React.Dispatch<AgentAction>;
|
|
3
|
+
export declare function useAgents(): AgentState;
|
|
4
|
+
export declare function useAgentsDispatch(): DispatchType;
|
|
5
|
+
export interface AgentsProviderProps {
|
|
6
|
+
children: React.JSX.Element;
|
|
7
|
+
value?: AgentState;
|
|
8
|
+
}
|
|
9
|
+
export declare function AgentsProvider({ children, value }: AgentsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type AgentState } from '../../types';
|
|
2
|
+
import { type AgentsProviderProps } from '../context';
|
|
3
|
+
export declare const initialState: AgentState;
|
|
4
|
+
export declare const DefaultContextProvider: ({ value }: AgentsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
agent: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
selectAgent: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
defaultAgent: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
defaultStatus: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
errorMessage: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
errorTooltip: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
loadingMessage: {
|
|
33
|
+
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default messages;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type LOGGER_ACTION_CLICK, type LOGGER_ACTION_PROGRAMMATIC } from './constants';
|
|
2
|
+
import { type ACTIONS } from './contexts';
|
|
3
|
+
export type AgentType = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
ask?: object;
|
|
7
|
+
description?: string;
|
|
8
|
+
imageURL?: string;
|
|
9
|
+
isEnterpriseDefault?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare enum REQUEST_STATE {
|
|
12
|
+
NOT_STARTED = "not_started",
|
|
13
|
+
IN_PROGRESS = "in_progress",
|
|
14
|
+
SUCCESS = "success",
|
|
15
|
+
ERROR = "error",
|
|
16
|
+
CANCELLED = "cancelled"
|
|
17
|
+
}
|
|
18
|
+
export type AgentState = {
|
|
19
|
+
agents: AgentType[];
|
|
20
|
+
requestState: REQUEST_STATE;
|
|
21
|
+
selectedAgent: AgentType | null;
|
|
22
|
+
};
|
|
23
|
+
export type AgentAction = {
|
|
24
|
+
type: ACTIONS;
|
|
25
|
+
id?: string;
|
|
26
|
+
ask?: object;
|
|
27
|
+
agents?: AgentType[];
|
|
28
|
+
requestState?: REQUEST_STATE;
|
|
29
|
+
};
|
|
30
|
+
export type AgentListResponse = {
|
|
31
|
+
agents: AgentType[];
|
|
32
|
+
};
|
|
33
|
+
export type RecordActionType = {
|
|
34
|
+
action: typeof LOGGER_ACTION_CLICK | typeof LOGGER_ACTION_PROGRAMMATIC;
|
|
35
|
+
data?: {
|
|
36
|
+
hostAppName?: string;
|
|
37
|
+
};
|
|
38
|
+
component: string;
|
|
39
|
+
feature: string;
|
|
40
|
+
target?: string;
|
|
41
|
+
};
|