Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search] Search assistant plugin setup #190633

Merged
merged 23 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7cc83b4
introduce search assistant plugin
saarikabhasi Aug 15, 2024
ccc6d76
fix CI
saarikabhasi Aug 15, 2024
c09aba6
add review feedback
saarikabhasi Aug 19, 2024
b3f37bc
remove eslint file
saarikabhasi Aug 19, 2024
2fa24a4
fix eslint, add license
saarikabhasi Aug 19, 2024
2077a77
Merge branch 'main' into search-ai-assistant-plugin
elasticmachine Aug 19, 2024
07b7067
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 19, 2024
1762523
add config for FTR
saarikabhasi Aug 19, 2024
0bbf057
Merge branch 'search-ai-assistant-plugin' of github.com:saarikabhasi/…
saarikabhasi Aug 19, 2024
940fa7c
clean files in server folder
saarikabhasi Aug 20, 2024
4d9af48
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 20, 2024
22aff35
remove kibanaReact from kibana.jsonc
saarikabhasi Aug 20, 2024
3adcb0e
Merge branch 'search-ai-assistant-plugin' of github.com:saarikabhasi/…
saarikabhasi Aug 20, 2024
13b9cb1
add index.ts to server/ folder
saarikabhasi Aug 21, 2024
0cab2c2
Update plugin-list.asciidoc
saarikabhasi Aug 21, 2024
165936a
Update README.md
saarikabhasi Aug 21, 2024
6222df9
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Aug 21, 2024
22336ef
remove ui config from rendering.ts
saarikabhasi Aug 21, 2024
de3cb3c
Merge branch 'main' into search-ai-assistant-plugin
elasticmachine Aug 21, 2024
19eb409
Disable plugin by default
sphilipse Aug 22, 2024
7f17d49
Disable plugin by default
sphilipse Aug 22, 2024
5a5dc83
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 22, 2024
ad2a81a
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ src/plugins/screenshot_mode @elastic/appex-sharedux
x-pack/examples/screenshotting_example @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
packages/kbn-search-api-panels @elastic/search-kibana
x-pack/plugins/search_assistant @elastic/search-kibana
packages/kbn-search-connectors @elastic/search-kibana
x-pack/plugins/search_connectors @elastic/search-kibana
packages/kbn-search-errors @elastic/kibana-data-discovery
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,10 @@ Elastic.
It uses Chromium and Puppeteer underneath to run the browser in headless mode.


|{kib-repo}blob/{branch}/x-pack/plugins/search_assistant/README.md[searchAssistant]
|This holds the Search AI Assistant which targets Search users and Serverless Elasticsearch.


|{kib-repo}blob/{branch}/x-pack/plugins/search_connectors/README.mdx[searchConnectors]
|This plugin contains common assets and endpoints for the use of connectors in Kibana. Primarily used by the enterprise_search and serverless_search plugins.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@
"@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example",
"@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting",
"@kbn/search-api-panels": "link:packages/kbn-search-api-panels",
"@kbn/search-assistant": "link:x-pack/plugins/search_assistant",
"@kbn/search-connectors": "link:packages/kbn-search-connectors",
"@kbn/search-connectors-plugin": "link:x-pack/plugins/search_connectors",
"@kbn/search-errors": "link:packages/kbn-search-errors",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ pageLoadAssetSize:
savedSearch: 16225
screenshotMode: 17856
screenshotting: 22870
searchAssistant: 19831
searchConnectors: 30000
searchHomepage: 19831
searchInferenceEndpoints: 20470
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,8 @@
"@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"],
"@kbn/search-api-panels": ["packages/kbn-search-api-panels"],
"@kbn/search-api-panels/*": ["packages/kbn-search-api-panels/*"],
"@kbn/search-assistant": ["x-pack/plugins/search_assistant"],
"@kbn/search-assistant/*": ["x-pack/plugins/search_assistant/*"],
"@kbn/search-connectors": ["packages/kbn-search-connectors"],
"@kbn/search-connectors/*": ["packages/kbn-search-connectors/*"],
"@kbn/search-connectors-plugin": ["x-pack/plugins/search_connectors"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"xpack.searchNotebooks": "plugins/search_notebooks",
"xpack.searchPlayground": "plugins/search_playground",
"xpack.searchInferenceEndpoints": "plugins/search_inference_endpoints",
"xpack.searchAssistant": "plugins/search_assistant",
"xpack.searchProfiler": "plugins/searchprofiler",
"xpack.security": ["plugins/security", "packages/security"],
"xpack.server": "legacy/server",
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/search_assistant/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SearchAssistant

This holds the Search AI Assistant which targets Search users and Serverless Elasticsearch.
8 changes: 8 additions & 0 deletions x-pack/plugins/search_assistant/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
export const PLUGIN_ID = 'searchAssistant';
export const PLUGIN_NAME = 'searchAssistant';
24 changes: 24 additions & 0 deletions x-pack/plugins/search_assistant/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "plugin",
"id": "@kbn/search-assistant",
"owner": "@elastic/search-kibana",
"description": "AI Assistant for Search",
"plugin": {
"id": "searchAssistant",
"server": true,
"browser": true,
"configPath": [
"xpack",
"searchAssistant"
],
"requiredPlugins": [
"observabilityAIAssistant",
"observabilityAIAssistantApp"
],
"optionalPlugins": [
"cloud",
"usageCollection",
],
"requiredBundles": []
}
}
37 changes: 37 additions & 0 deletions x-pack/plugins/search_assistant/public/application.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import ReactDOM from 'react-dom';
import type { CoreStart } from '@kbn/core/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { I18nProvider } from '@kbn/i18n-react';
import { Router } from '@kbn/shared-ux-router';
import type { SearchAssistantPluginStartDependencies } from './types';
import { SearchAssistantRouter } from './router';

export const renderApp = (
core: CoreStart,
services: SearchAssistantPluginStartDependencies,
element: HTMLElement
) => {
ReactDOM.render(
<KibanaRenderContextProvider {...core}>
<KibanaContextProvider services={{ ...core, ...services }}>
<I18nProvider>
<Router history={services.history}>
<SearchAssistantRouter />
</Router>
</I18nProvider>
</KibanaContextProvider>
</KibanaRenderContextProvider>,
element
);

return () => ReactDOM.unmountComponentAtNode(element);
};
15 changes: 15 additions & 0 deletions x-pack/plugins/search_assistant/public/components/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
export const App: React.FC = () => {
return (
<KibanaPageTemplate.Section alignment="top" restrictWidth={false} grow paddingSize="none">
<div />
</KibanaPageTemplate.Section>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { EuiPageTemplate } from '@elastic/eui';
import React from 'react';
import { App } from './app';

export const SearchAssistantPage: React.FC = () => {
return (
<EuiPageTemplate
offset={0}
restrictWidth={false}
data-test-subj="svlSearchAssistantPage"
grow={false}
panelled={false}
>
<App />
</EuiPageTemplate>
);
};
13 changes: 13 additions & 0 deletions x-pack/plugins/search_assistant/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SearchAssistantPlugin } from './plugin';

export function plugin() {
return new SearchAssistantPlugin();
}
export type { SearchAssistantPluginSetup, SearchAssistantPluginStart } from './types';
29 changes: 29 additions & 0 deletions x-pack/plugins/search_assistant/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { CoreSetup, Plugin } from '@kbn/core/public';
import type {
SearchAssistantPluginSetup,
SearchAssistantPluginStart,
SearchAssistantPluginStartDependencies,
} from './types';

export class SearchAssistantPlugin
implements Plugin<SearchAssistantPluginSetup, SearchAssistantPluginStart>
{
public setup(
core: CoreSetup<SearchAssistantPluginStartDependencies, SearchAssistantPluginStart>
): SearchAssistantPluginSetup {
return {};
}

public start(): SearchAssistantPluginStart {
return {};
}

public stop() {}
}
20 changes: 20 additions & 0 deletions x-pack/plugins/search_assistant/public/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { Route, Routes } from '@kbn/shared-ux-router';
import React from 'react';
import { SearchAssistantPage } from './components/search_assistant';

export const SearchAssistantRouter: React.FC = () => {
return (
<Routes>
<Route>
<SearchAssistantPage />
</Route>
</Routes>
);
};
22 changes: 22 additions & 0 deletions x-pack/plugins/search_assistant/public/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { AppMountParameters } from '@kbn/core/public';
import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
import { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchAssistantPluginSetup {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchAssistantPluginStart {}

export interface SearchAssistantPluginStartDependencies {
history: AppMountParameters['history'];
observabilityAIAssistant: ObservabilityAIAssistantPublicStart;
usageCollection?: UsageCollectionStart;
}
19 changes: 19 additions & 0 deletions x-pack/plugins/search_assistant/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from '@kbn/core/server';

const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: false }),
});

export type SearchAssistantConfig = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<SearchAssistantConfig> = {
schema: configSchema,
};
15 changes: 15 additions & 0 deletions x-pack/plugins/search_assistant/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { SearchAssistantPlugin } from './plugin';

export { config } from './config';

export function plugin() {
return new SearchAssistantPlugin();
}

export type { SearchAssistantPluginSetup, SearchAssistantPluginStart } from './types';
26 changes: 26 additions & 0 deletions x-pack/plugins/search_assistant/server/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { Plugin } from '@kbn/core/server';

import type { SearchAssistantPluginSetup, SearchAssistantPluginStart } from './types';

export class SearchAssistantPlugin
implements Plugin<SearchAssistantPluginSetup, SearchAssistantPluginStart>
{
constructor() {}

public setup() {
return {};
}

public start() {
return {};
}

public stop() {}
}
11 changes: 11 additions & 0 deletions x-pack/plugins/search_assistant/server/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchAssistantPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchAssistantPluginStart {}
28 changes: 28 additions & 0 deletions x-pack/plugins/search_assistant/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"index.ts",
"common/**/*.ts",
"public/**/*.ts",
"public/**/*.tsx",
"server/**/*.ts",
"../../typings/**/*"
],
"kbn_references": [
"@kbn/core",
"@kbn/react-kibana-context-render",
"@kbn/kibana-react-plugin",
"@kbn/i18n-react",
"@kbn/shared-ux-router",
"@kbn/shared-ux-page-kibana-template",
"@kbn/usage-collection-plugin",
"@kbn/observability-ai-assistant-plugin",
"@kbn/config-schema"
],
"exclude": [
"target/**/*",
]
}
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6208,6 +6208,10 @@
version "0.0.0"
uid ""

"@kbn/search-assistant@link:x-pack/plugins/search_assistant":
version "0.0.0"
uid ""

"@kbn/search-connectors-plugin@link:x-pack/plugins/search_connectors":
version "0.0.0"
uid ""
Expand Down