Skip to content

Commit e02cffe

Browse files
rudolfclaude
andauthored
Remove unused files in @kbn/ai-assistant (dead code cleanup) (#266814)
## Summary Removes **4 unused source files** (183 LoC) from `@kbn/ai-assistant`, owned by `@elastic/unknown`. All verified to have **zero static importers** anywhere in the repo. This is one slice of a broader sweep across the codebase removing **399 files / 18.5k LoC** of dead code. Co-PRs cover the other ~28 teams' slices. The methodology is in #266635 (skill PR). ## Files removed See the diff. Removals span the package — common shapes include: - Orphan barrel `index.ts` files where consumers consistently deep-import the sibling modules directly. - Dead React components, hooks, route handlers, or test helpers no longer referenced anywhere. ## Verification For every file: 1. **`knip` flagged it as unreachable** from the package's declared entry points (`server/index.ts`, `public/index.ts`, `common/index.ts`, plus deep-import-derived entries). 2. **Resolve-aware import scan** confirmed zero importers across the repo (Node-style: `<base>.ts`, `<base>.tsx`, `<base>/index.ts`, `<base>/index.tsx`). 3. **Package-id deep-import grep** for `@kbn/ai-assistant/<sub>` references from other packages. 4. **`jest.mock()` string scan** for test mocks pointing at the path. 5. **Type-check passes** (`node scripts/type_check --project x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json`). ## Patterns observed (for context) The most common dead-code shapes in this slice: - **Orphan barrel `index.ts`** that re-exports from siblings — the commonest shape across the cleanup. - Other patterns vary by package (dead React components, dead route handlers, dead test fixtures). The full pattern catalog (across all teams) is in #266635. 🤖 Generated by an AI agent following a verification recipe at `.agents/skills/dead-code-cleanup/SKILL.md` (PR #266635). --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ee4a823 commit e02cffe

8 files changed

Lines changed: 0 additions & 203 deletions

File tree

x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/ask_assistant_button.tsx

Lines changed: 0 additions & 99 deletions
This file was deleted.

x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/hide_expand_conversation_list_button.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_item_title.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_current_inference_id.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

x-pack/platform/plugins/private/translations/translations/de-DE.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11643,13 +11643,10 @@
1164311643
"xpack.agentBuilder.welcomeMessage.documentationLink": "Dokumentation",
1164411644
"xpack.agentBuilder.welcomeMessage.genAiSettingsLink": "GenAI-Einstellungen",
1164511645
"xpack.agentBuilder.welcomeMessage.title": "Willkommen zu unserer neuen agentischen Erfahrung",
11646-
"xpack.aiAssistant.aiAssistantLabel": "AI Assistant",
1164711646
"xpack.aiAssistant.archiveConversationErrorToast": "Konversation konnte nicht archiviert werden",
1164811647
"xpack.aiAssistant.archiveConversationSuccessToast": "Gespräch erfolgreich archiviert",
1164911648
"xpack.aiAssistant.archivedBanner.ownerDescription": "Sie können dieses Gespräch nicht bearbeiten oder fortsetzen, da sie archiviert wurde, aber Sie können die Archivierung aufheben.",
1165011649
"xpack.aiAssistant.archivedBanner.title": "Dieses Gespräch wurde archiviert.",
11651-
"xpack.aiAssistant.askAssistantButton.buttonLabel": "Assistenten fragen",
11652-
"xpack.aiAssistant.askAssistantButton.popoverContent": "Erhalten Sie Einblicke in Ihre Daten mit dem Elastic Assistant",
1165311650
"xpack.aiAssistant.assistantSetup.title": "Willkommen beim Elastic AI Assistant",
1165411651
"xpack.aiAssistant.banner.viewerDescription": "Sie können dieses Gespräch nicht bearbeiten oder fortsetzen, aber Sie können es in ein neues privates Gespräch duplizieren. Das ursprüngliche Gespräch bleibt unverändert.",
1165511652
"xpack.aiAssistant.chatActionsMenu.euiButtonIcon.menuLabel": "Menü",
@@ -11731,8 +11728,6 @@
1173111728
"xpack.aiAssistant.flyout.confirmDeleteConversationContent": "Diese Aktion ist dauerhaft und kann nicht rückgängig gemacht werden.",
1173211729
"xpack.aiAssistant.flyout.confirmDeleteConversationTitle": "Konversation löschen",
1173311730
"xpack.aiAssistant.flyout.deleteConversationErrorToast": "Konversation konnte nicht gelöscht werden",
11734-
"xpack.aiAssistant.hideExpandConversationButton.hide": "Chats ausblenden",
11735-
"xpack.aiAssistant.hideExpandConversationButton.show": "Chats anzeigen",
1173611731
"xpack.aiAssistant.incorrectLicense.body": "Sie benötigen eine Enterprise-Lizenz, um den Elastic AI Assistant zu nutzen.",
1173711732
"xpack.aiAssistant.incorrectLicense.manageLicense": "Lizenz verwalten",
1173811733
"xpack.aiAssistant.incorrectLicense.subscriptionPlansButton": "Abonnementpläne",

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11618,13 +11618,10 @@
1161811618
"xpack.agentBuilder.welcomeMessage.documentationLink": "documentation",
1161911619
"xpack.agentBuilder.welcomeMessage.genAiSettingsLink": "Paramètres de l'IA générative",
1162011620
"xpack.agentBuilder.welcomeMessage.title": "Bienvenue dans notre nouvelle expérience agentique",
11621-
"xpack.aiAssistant.aiAssistantLabel": "Assistant d'IA",
1162211621
"xpack.aiAssistant.archiveConversationErrorToast": "Impossible d'archiver la conversation",
1162311622
"xpack.aiAssistant.archiveConversationSuccessToast": "Conversation archivée avec succès",
1162411623
"xpack.aiAssistant.archivedBanner.ownerDescription": "Vous ne pouvez ni modifier ni poursuivre cette conversation, car elle a été archivée, mais vous pouvez annuler son archivage.",
1162511624
"xpack.aiAssistant.archivedBanner.title": "Cette conversation a été archivée.",
11626-
"xpack.aiAssistant.askAssistantButton.buttonLabel": "Demander à l'assistant",
11627-
"xpack.aiAssistant.askAssistantButton.popoverContent": "Obtenez des informations relatives à vos données grâce à l'assistant d'Elastic",
1162811625
"xpack.aiAssistant.assistantSetup.title": "Bienvenue sur Elastic AI Assistant",
1162911626
"xpack.aiAssistant.banner.viewerDescription": "Vous ne pouvez pas modifier ou poursuivre cette conversation, mais vous pouvez la dupliquer dans une nouvelle conversation privée. La conversation originale restera inchangée.",
1163011627
"xpack.aiAssistant.chatActionsMenu.euiButtonIcon.menuLabel": "Menu",
@@ -11706,8 +11703,6 @@
1170611703
"xpack.aiAssistant.flyout.confirmDeleteConversationContent": "Cette action est permanente et ne peut pas être annulée.",
1170711704
"xpack.aiAssistant.flyout.confirmDeleteConversationTitle": "Supprimer la conversation",
1170811705
"xpack.aiAssistant.flyout.deleteConversationErrorToast": "Impossible de supprimer la conversation",
11709-
"xpack.aiAssistant.hideExpandConversationButton.hide": "Masquer les chats",
11710-
"xpack.aiAssistant.hideExpandConversationButton.show": "Afficher les chats",
1171111706
"xpack.aiAssistant.incorrectLicense.body": "Une licence d'entreprise est requise pour utiliser l'assistant d'intelligence artificielle d'Elastic.",
1171211707
"xpack.aiAssistant.incorrectLicense.manageLicense": "Gérer la licence",
1171311708
"xpack.aiAssistant.incorrectLicense.subscriptionPlansButton": "Plans d'abonnement",

x-pack/platform/plugins/private/translations/translations/ja-JP.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11671,13 +11671,10 @@
1167111671
"xpack.agentBuilder.welcomeMessage.documentationLink": "ドキュメント",
1167211672
"xpack.agentBuilder.welcomeMessage.genAiSettingsLink": "生成AI設定",
1167311673
"xpack.agentBuilder.welcomeMessage.title": "新しいエージェントエクスペリエンスへようこそ",
11674-
"xpack.aiAssistant.aiAssistantLabel": "AI Assistant",
1167511674
"xpack.aiAssistant.archiveConversationErrorToast": "会話をアーカイブできませんでした",
1167611675
"xpack.aiAssistant.archiveConversationSuccessToast": "会話が正常にアーカイブされました",
1167711676
"xpack.aiAssistant.archivedBanner.ownerDescription": "この会話はアーカイブされているため編集や続行はできませんが、アーカイブ解除は可能です。",
1167811677
"xpack.aiAssistant.archivedBanner.title": "この会話はアーカイブされました。",
11679-
"xpack.aiAssistant.askAssistantButton.buttonLabel": "アシスタントに聞く",
11680-
"xpack.aiAssistant.askAssistantButton.popoverContent": "Elastic Assistantでデータに関するインサイトを得ましょう",
1168111678
"xpack.aiAssistant.assistantSetup.title": "Elastic AI Assistantへようこそ",
1168211679
"xpack.aiAssistant.banner.viewerDescription": "この会話の編集や続行はできませんが、新しいプライベート会話に複製することはできます。元の会話は変更されません。",
1168311680
"xpack.aiAssistant.chatActionsMenu.euiButtonIcon.menuLabel": "メニュー",
@@ -11759,8 +11756,6 @@
1175911756
"xpack.aiAssistant.flyout.confirmDeleteConversationContent": "この操作は永続的であり、元に戻すことはできません。",
1176011757
"xpack.aiAssistant.flyout.confirmDeleteConversationTitle": "会話を削除",
1176111758
"xpack.aiAssistant.flyout.deleteConversationErrorToast": "会話を削除できませんでした",
11762-
"xpack.aiAssistant.hideExpandConversationButton.hide": "チャットを非表示",
11763-
"xpack.aiAssistant.hideExpandConversationButton.show": "チャットを表示",
1176411759
"xpack.aiAssistant.incorrectLicense.body": "Elastic AI Assistantを使用するにはEnterpriseライセンスが必要です。",
1176511760
"xpack.aiAssistant.incorrectLicense.manageLicense": "ライセンスの管理",
1176611761
"xpack.aiAssistant.incorrectLicense.subscriptionPlansButton": "サブスクリプションオプション",

x-pack/platform/plugins/private/translations/translations/zh-CN.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11669,13 +11669,10 @@
1166911669
"xpack.agentBuilder.welcomeMessage.documentationLink": "文档",
1167011670
"xpack.agentBuilder.welcomeMessage.genAiSettingsLink": "GenAI 设置",
1167111671
"xpack.agentBuilder.welcomeMessage.title": "欢迎体验我们的全新智能体服务",
11672-
"xpack.aiAssistant.aiAssistantLabel": "AI 助手",
1167311672
"xpack.aiAssistant.archiveConversationErrorToast": "无法归档对话",
1167411673
"xpack.aiAssistant.archiveConversationSuccessToast": "对话已成功存档",
1167511674
"xpack.aiAssistant.archivedBanner.ownerDescription": "由于此对话已被归档,您无法编辑或继续此对话,但您可以将其取消归档。",
1167611675
"xpack.aiAssistant.archivedBanner.title": "此对话已归档。",
11677-
"xpack.aiAssistant.askAssistantButton.buttonLabel": "询问助手",
11678-
"xpack.aiAssistant.askAssistantButton.popoverContent": "使用 Elastic 助手深入了解您的数据",
1167911676
"xpack.aiAssistant.assistantSetup.title": "欢迎使用 Elastic AI 助手",
1168011677
"xpack.aiAssistant.banner.viewerDescription": "您不能编辑或继续此对话,但可以将其复制到新的私人对话中。原对话内容将保持不变。",
1168111678
"xpack.aiAssistant.chatActionsMenu.euiButtonIcon.menuLabel": "菜单",
@@ -11757,8 +11754,6 @@
1175711754
"xpack.aiAssistant.flyout.confirmDeleteConversationContent": "此操作是永久的,无法撤销。",
1175811755
"xpack.aiAssistant.flyout.confirmDeleteConversationTitle": "删除对话",
1175911756
"xpack.aiAssistant.flyout.deleteConversationErrorToast": "无法删除对话",
11760-
"xpack.aiAssistant.hideExpandConversationButton.hide": "隐藏聊天",
11761-
"xpack.aiAssistant.hideExpandConversationButton.show": "显示聊天",
1176211757
"xpack.aiAssistant.incorrectLicense.body": "您需要企业级许可证才能使用 Elastic AI 助手。",
1176311758
"xpack.aiAssistant.incorrectLicense.manageLicense": "管理许可证",
1176411759
"xpack.aiAssistant.incorrectLicense.subscriptionPlansButton": "订阅计划",

0 commit comments

Comments
 (0)