diff --git a/common/utils/llm_chat/__tests__/traces.test.ts b/common/utils/llm_chat/__tests__/traces.test.ts deleted file mode 100644 index 4de6d1e9..00000000 --- a/common/utils/llm_chat/__tests__/traces.test.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { Run } from 'langchain/callbacks'; -import { AgentRun } from 'langchain/dist/callbacks/handlers/tracer'; -import { convertToTraces } from '../traces'; - -describe('Test', () => { - it('should convert runs to traces', () => { - const traces = convertToTraces(mockRuns); - expect(traces).toEqual([ - { - actions: [ - { - log: ' ```json\n{\n "action": "Get OpenSearch indices" \n}\n```', - tool: 'Get OpenSearch indices', - toolInput: '', - }, - ], - id: 'bbc4791c-601b-4c7c-ba62-409419e8ef41', - input: 'human input', - name: 'AgentExecutor', - output: 'ai output', - parentRunId: undefined, - startTime: 1692820695308, - type: 'chain', - }, - { - id: '3d7145a2-1cc1-43cb-9685-bfbe426f03d0', - input: '', - name: 'LLMChain', - output: 'suggestions', - parentRunId: undefined, - startTime: 1692820706240, - type: 'chain', - }, - { - id: 'ad3d36d6-ecba-4ca1-a14a-9fd54132d16b', - input: '', - name: 'Get OpenSearch indices', - output: 'tools output', - parentRunId: 'bbc4791c-601b-4c7c-ba62-409419e8ef41', - startTime: 1692820697545, - type: 'tool', - }, - { - id: '9c610e59-8abb-4f56-a9c8-5e0cb980ba15', - input: 'human message', - name: 'ChatAnthropic', - output: 'suggestions', - parentRunId: '3d7145a2-1cc1-43cb-9685-bfbe426f03d0', - startTime: 1692820706241, - type: 'llm', - }, - ]); - }); -}); - -type RecursivePartial = { - [P in keyof T]?: T[P] extends Array - ? Array> - : T[P] extends object | undefined - ? RecursivePartial - : T[P]; -}; - -// mock runs with only the fields that are being used for converting to traces -const partialMockRuns: Array> = [ - { - id: 'bbc4791c-601b-4c7c-ba62-409419e8ef41', - name: 'AgentExecutor', - start_time: 1692820695308, - inputs: { - input: 'human input', - chat_history: [ - { - lc: 1, - type: 'constructor', - id: ['langchain', 'schema', 'HumanMessage'], - kwargs: { content: 'human input', additional_kwargs: {} }, - }, - { - lc: 1, - type: 'constructor', - id: ['langchain', 'schema', 'AIMessage'], - kwargs: { content: 'ai output', additional_kwargs: {} }, - }, - ], - }, - execution_order: 1, - child_execution_order: 2, - run_type: 'chain', - child_runs: [ - { - id: 'ad3d36d6-ecba-4ca1-a14a-9fd54132d16b', - name: 'DynamicTool', - parent_run_id: 'bbc4791c-601b-4c7c-ba62-409419e8ef41', - start_time: 1692820697545, - inputs: {}, - execution_order: 2, - child_execution_order: 2, - run_type: 'tool', - child_runs: [], - end_time: 1692820697560, - outputs: { output: 'tools output' }, - }, - ], - actions: [ - { - tool: 'Get OpenSearch indices', - log: ' ```json\n{\n "action": "Get OpenSearch indices" \n}\n```', - toolInput: '', - }, - ], - end_time: 1692820706226, - outputs: { output: 'ai output' }, - }, - { - id: '3d7145a2-1cc1-43cb-9685-bfbe426f03d0', - name: 'LLMChain', - start_time: 1692820706240, - inputs: { - tools_description: 'tools description', - chat_history: 'human: human input\nai: ai output', - }, - execution_order: 1, - child_execution_order: 2, - run_type: 'chain', - child_runs: [ - { - id: '9c610e59-8abb-4f56-a9c8-5e0cb980ba15', - name: 'ChatAnthropic', - parent_run_id: '3d7145a2-1cc1-43cb-9685-bfbe426f03d0', - start_time: 1692820706241, - inputs: { - messages: [ - [ - { - lc: 1, - type: 'constructor', - id: ['langchain', 'schema', 'HumanMessage'], - kwargs: { content: 'human message', additional_kwargs: {} }, - }, - ], - ], - }, - execution_order: 2, - child_runs: [], - child_execution_order: 2, - run_type: 'llm', - end_time: 1692820709238, - outputs: { - generations: [ - [ - { - text: 'suggestions', - message: { - lc: 1, - type: 'constructor', - id: ['langchain', 'schema', 'AIMessage'], - kwargs: { content: 'suggestions', additional_kwargs: {} }, - }, - }, - ], - ], - }, - }, - ], - end_time: 1692820709238, - outputs: { text: 'suggestions' }, - }, -]; - -const mockRuns = partialMockRuns as Array; diff --git a/common/utils/llm_chat/traces.ts b/common/utils/llm_chat/traces.ts index 73ee3088..ab3dba7f 100644 --- a/common/utils/llm_chat/traces.ts +++ b/common/utils/llm_chat/traces.ts @@ -3,10 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Run } from 'langchain/callbacks'; -import { AgentRun } from 'langchain/dist/callbacks/handlers/tracer'; -import _ from 'lodash'; - export interface AgentFrameworkTrace { interactionId: string; parentInteractionId: string; @@ -16,62 +12,3 @@ export interface AgentFrameworkTrace { origin: string; traceNumber: number; } - -export interface LangchainTrace { - id: Run['id']; - parentRunId?: Run['parent_run_id']; - actions?: AgentRun['actions']; - type: Run['run_type']; - startTime: Run['start_time']; - name: string; - input: string; - output?: string; -} - -const getValue = (obj: Record, possibleKeys: string[]) => { - for (const key of possibleKeys) { - const value = _.get(obj, key); - if (value) return value; - } - return ''; -}; - -/** - * By default, tool traces have name 'DynamicTool'. Replace name for all tool - * traces with the tool used in parent run actions. - */ -const replaceToolNames = (traces: LangchainTrace[]) => { - return traces.map((trace) => ({ - ...trace, - ...(trace.type === 'tool' && { - name: _.get( - traces.find((t) => t.id === trace.parentRunId), - 'actions.0.tool', - trace.name - ), - }), - })); -}; - -const traverse = (runs: Array, traces: LangchainTrace[] = []) => { - traces.push( - ...runs.map((run) => ({ - id: run.id, - parentRunId: run.parent_run_id, - type: run.run_type, - startTime: run.start_time, - name: run.name, - input: getValue(run.inputs, ['input', 'question', 'messages.0.0.kwargs.content']), - output: run.outputs && getValue(run.outputs, ['output', 'text', 'generations.0.0.text']), - ...('actions' in run && { actions: run.actions }), - })) - ); - runs.forEach((run) => { - if (run.child_runs) traverse(run.child_runs, traces); - }); - return traces; -}; - -export const convertToTraces = (runs: Run[]) => { - return replaceToolNames(traverse(runs)); -}; diff --git a/package.json b/package.json index d79d30a9..e741789e 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "csv-parser": "^3.0.0", "dompurify": "^2.4.1", "jsdom": "^22.1.0", - "langchain": "^0.0.164", "postinstall": "^0.7.4", "web-streams-polyfill": "^3.2.1" }, diff --git a/public/components/traces.tsx b/public/components/traces.tsx deleted file mode 100644 index a1024423..00000000 --- a/public/components/traces.tsx +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - EuiAccordion, - EuiCodeBlock, - EuiEmptyPrompt, - EuiLoadingContent, - EuiSpacer, - EuiText, - EuiMarkdownFormat, - EuiHorizontalRule, -} from '@elastic/eui'; -import React from 'react'; -import { LangchainTrace } from '../../common/utils/llm_chat/traces'; -import { useFetchLangchainTraces } from '../hooks/use_fetch_langchain_traces'; - -// workaround to show LLM name as OpenSearch LLM -const formatRunName = (run: LangchainTrace) => { - if (run.type === 'llm') return 'OpenSearch LLM'; - return run.name; -}; - -interface LangchainTracesProps { - traceId: string; -} - -export const Traces: React.FC = (props) => { - const { data: traces, loading, error } = useFetchLangchainTraces(props.traceId); - - if (loading) { - return ( - <> - Loading... - - - ); - } - if (error) { - return ( - Error loading details} - body={error.toString()} - /> - ); - } - if (!traces?.length) { - return Data not available.; - } - - const question = traces[0].input; - const finalAnswer = traces[0].output; - const questionAndAnswer = ` - # How was this generated - #### Question - ${question} - #### Result - ${finalAnswer} - `; - - return ( - <> - {questionAndAnswer} - - - - -

Response

-
- {traces - .filter((run) => run.type === 'tool') - .filter((run) => run.input || run.output) - .map((run, i) => { - const stepContent = `Step ${i + 1} - ${formatRunName(run)}`; - return ( -
- - - {run.input && ( - - Input: {run.input} - - )} - {run.output && ( - - Output: {run.output} - - )} - - -
- ); - })} - - ); -}; diff --git a/public/components/traces_flyout_body.tsx b/public/components/traces_flyout_body.tsx deleted file mode 100644 index 80f3dbbc..00000000 --- a/public/components/traces_flyout_body.tsx +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - EuiButtonEmpty, - EuiFlyoutBody, - EuiPage, - EuiPageBody, - EuiPageContentBody, - EuiPageHeader, - EuiButtonIcon, - EuiPageHeaderSection, -} from '@elastic/eui'; -import React from 'react'; -import { useChatContext } from '../contexts/chat_context'; -import { Traces } from './traces'; - -export const TracesFlyoutBody: React.FC = () => { - const chatContext = useChatContext(); - const traceId = chatContext.traceId; - if (!traceId) { - return null; - } - - // docked right or fullscreen with history open - const showBack = !chatContext.flyoutFullScreen || chatContext.preSelectedTabId === 'history'; - - return ( - - - - - - {showBack && ( - { - chatContext.setSelectedTabId(chatContext.flyoutFullScreen ? 'history' : 'chat'); - }} - iconType="arrowLeft" - > - Back - - )} - - - {!showBack && ( - { - chatContext.setSelectedTabId('chat'); - }} - /> - )} - - - - - - - - - ); -}; diff --git a/public/hooks/use_fetch_langchain_traces.ts b/public/hooks/use_fetch_langchain_traces.ts deleted file mode 100644 index 46ea41a3..00000000 --- a/public/hooks/use_fetch_langchain_traces.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { Run } from 'langchain/callbacks'; -import { useEffect, useReducer } from 'react'; -import { SearchResponse } from '../../../../src/core/server'; -import { SearchRequest } from '../../../../src/plugins/data/common'; -import { DSL_BASE, DSL_SEARCH, LLM_INDEX } from '../../common/constants/llm'; -import { convertToTraces, LangchainTrace } from '../../common/utils/llm_chat/traces'; -import { useCore } from '../contexts/core_context'; -import { GenericReducer, genericReducer } from './fetch_reducer'; - -// TODO persist traces with chat objects -export const useFetchLangchainTraces = (traceId: string) => { - const core = useCore(); - const reducer: GenericReducer = genericReducer; - const [state, dispatch] = useReducer(reducer, { loading: false }); - - useEffect(() => { - const abortController = new AbortController(); - dispatch({ type: 'request' }); - if (!traceId) { - dispatch({ type: 'success', payload: undefined }); - return; - } - - const query: SearchRequest['body'] = { - query: { - term: { - trace_id: traceId, - }, - }, - sort: [ - { - start_time: { - order: 'asc', - }, - }, - ], - }; - - core.services.http - .post>(`${DSL_BASE}${DSL_SEARCH}`, { - body: JSON.stringify({ index: LLM_INDEX.TRACES, size: 100, ...query }), - signal: abortController.signal, - }) - .then((payload) => - dispatch({ - type: 'success', - payload: convertToTraces(payload.hits.hits.map((hit) => hit._source)), - }) - ) - .catch((error) => dispatch({ type: 'failure', error })); - - return () => abortController.abort(); - }, [traceId]); - - return { ...state }; -}; diff --git a/public/services/saved_object_manager.ts b/public/services/saved_object_manager.ts deleted file mode 100644 index 35ed00b2..00000000 --- a/public/services/saved_object_manager.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { SavedObjectsClientContract } from '../../../../src/core/public'; -import { SavedObjectService } from './saved_object_service'; - -export class SavedObjectManager { - private static instances: Map> = new Map(); - private constructor() {} - - public static getInstance( - savedObjectsClient: SavedObjectsClientContract, - savedObjectType: string - ) { - if (!SavedObjectManager.instances.has(savedObjectType)) { - SavedObjectManager.instances.set( - savedObjectType, - new SavedObjectService(savedObjectsClient, savedObjectType) - ); - } - return SavedObjectManager.instances.get(savedObjectType) as SavedObjectService; - } -} diff --git a/public/services/saved_object_service.ts b/public/services/saved_object_service.ts deleted file mode 100644 index cfd3defb..00000000 --- a/public/services/saved_object_service.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { BehaviorSubject } from 'rxjs'; -import { SavedObjectsClientContract } from '../../../../src/core/public'; - -export class SavedObjectService { - private objects: Record | null>> = {}; - private loadingStatus: Record> = {}; - - constructor( - private readonly client: SavedObjectsClientContract, - private readonly savedObjectType: string - ) {} - - private setLoading(id: string, loading: boolean) { - if (!this.loadingStatus[id]) { - this.loadingStatus[id] = new BehaviorSubject(loading); - } else { - this.loadingStatus[id].next(loading); - } - } - - private async load(id: string) { - // set loading to true - this.setLoading(id, true); - - const savedObject = await this.client.get>(this.savedObjectType, id); - - // set loading to false - this.setLoading(id, false); - - if (!savedObject.error) { - this.objects[id].next(savedObject.attributes); - } - return savedObject; - } - - private async create(id: string, attributes: Partial) { - this.setLoading(id, true); - const newObject = await this.client.create>(this.savedObjectType, attributes, { - id, - }); - this.objects[id].next({ ...newObject.attributes }); - this.setLoading(id, false); - return newObject.attributes; - } - - private async update(id: string, attributes: Partial) { - this.setLoading(id, true); - const newObject = await this.client.update>(this.savedObjectType, id, attributes); - this.objects[id].next({ ...newObject.attributes }); - this.setLoading(id, false); - return newObject.attributes; - } - - private async initialize(id: string) { - if (!this.objects[id]) { - this.objects[id] = new BehaviorSubject | null>(null); - await this.load(id); - } - } - - public async get(id: string) { - await this.initialize(id); - return this.objects[id].getValue(); - } - - public get$(id: string) { - this.initialize(id); - return this.objects[id]; - } - - public getLoadingStatus$(id: string) { - return this.loadingStatus[id]; - } - - public async createOrUpdate(id: string, attributes: Partial) { - const currentObject = await this.load(id); - - if (currentObject.error) { - // Object not found, create a new object - if (currentObject.error.statusCode === 404) { - return await this.create(id, attributes); - } - } else { - // object found, update existing object - return await this.update(id, attributes); - } - } -} diff --git a/public/tabs/history/chat_history_page.tsx b/public/tabs/history/chat_history_page.tsx index 2dff9e6f..69d8bb6e 100644 --- a/public/tabs/history/chat_history_page.tsx +++ b/public/tabs/history/chat_history_page.tsx @@ -20,7 +20,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { FormattedMessage } from '@osd/i18n/react'; import { useDebounce, useObservable } from 'react-use'; import cs from 'classnames'; -import { TAB_ID } from 'public/utils/constants'; +import { TAB_ID } from '../../utils/constants'; import { useChatActions } from '../../hooks/use_chat_actions'; import { useChatContext } from '../../contexts/chat_context'; import { useCore } from '../../contexts/core_context'; diff --git a/server/adaptors/constants/alerting.ts b/server/adaptors/constants/alerting.ts deleted file mode 100644 index d43b8fe8..00000000 --- a/server/adaptors/constants/alerting.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -export const API_ROUTE_PREFIX = '/_plugins/_alerting'; -export const MONITOR_BASE_API = `${API_ROUTE_PREFIX}/monitors`; -export const AD_BASE_API = `/_plugins/_anomaly_detection/detectors`; -export const DESTINATION_BASE_API = `${API_ROUTE_PREFIX}/destinations`; -export const EMAIL_ACCOUNT_BASE_API = `${DESTINATION_BASE_API}/email_accounts`; -export const EMAIL_GROUP_BASE_API = `${DESTINATION_BASE_API}/email_groups`; -export const DEFAULT_HEADERS = { - 'Content-Type': 'application/json', - Accept: 'application/json', - 'User-Agent': 'OpenSearch-Dashboards', -}; -export const CLUSTER = { - ADMIN: 'admin', - ALERTING: 'opensearch_alerting', - AD_ALERTING: 'alerting_ad', - DATA: 'data', -}; diff --git a/server/adaptors/opensearch_alerting_plugin.ts b/server/adaptors/opensearch_alerting_plugin.ts deleted file mode 100644 index c1dc4f43..00000000 --- a/server/adaptors/opensearch_alerting_plugin.ts +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - AD_BASE_API, - API_ROUTE_PREFIX, - DESTINATION_BASE_API, - EMAIL_ACCOUNT_BASE_API, - EMAIL_GROUP_BASE_API, - MONITOR_BASE_API, -} from './constants/alerting'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function OpenSearchAlertingPlugin(Client: any, config: any, components: any) { - const ca = components.clientAction.factory; - - Client.prototype.alerting = components.clientAction.namespaceFactory(); - const alerting = Client.prototype.alerting.prototype; - - alerting.getFindings = ca({ - url: { - fmt: `${API_ROUTE_PREFIX}/findings/_search`, - }, - needBody: true, - method: 'GET', - }); - - alerting.getMonitor = ca({ - url: { - fmt: `${MONITOR_BASE_API}/<%=monitorId%>`, - req: { - monitorId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - alerting.createMonitor = ca({ - url: { - fmt: `${MONITOR_BASE_API}?refresh=wait_for`, - }, - needBody: true, - method: 'POST', - }); - - alerting.deleteMonitor = ca({ - url: { - fmt: `${MONITOR_BASE_API}/<%=monitorId%>`, - req: { - monitorId: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); - - // TODO DRAFT: May need to add 'refresh' assignment here again. - alerting.updateMonitor = ca({ - url: { - fmt: `${MONITOR_BASE_API}/<%=monitorId%>`, - req: { - monitorId: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'PUT', - }); - - alerting.getMonitors = ca({ - url: { - fmt: `${MONITOR_BASE_API}/_search`, - }, - needBody: true, - method: 'POST', - }); - - alerting.acknowledgeAlerts = ca({ - url: { - fmt: `${MONITOR_BASE_API}/<%=monitorId%>/_acknowledge/alerts`, - req: { - monitorId: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'POST', - }); - - alerting.getAlerts = ca({ - url: { - fmt: `${MONITOR_BASE_API}/alerts`, - }, - method: 'GET', - }); - - alerting.executeMonitor = ca({ - url: { - fmt: `${MONITOR_BASE_API}/_execute?dryrun=<%=dryrun%>`, - req: { - dryrun: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'POST', - }); - - alerting.getDestination = ca({ - url: { - fmt: `${DESTINATION_BASE_API}/<%=destinationId%>`, - req: { - destinationId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - alerting.searchDestinations = ca({ - url: { - fmt: `${DESTINATION_BASE_API}`, - }, - method: 'GET', - }); - - alerting.createDestination = ca({ - url: { - fmt: `${DESTINATION_BASE_API}?refresh=wait_for`, - }, - needBody: true, - method: 'POST', - }); - - alerting.updateDestination = ca({ - url: { - fmt: `${DESTINATION_BASE_API}/<%=destinationId%>?if_seq_no=<%=ifSeqNo%>&if_primary_term=<%=ifPrimaryTerm%>&refresh=wait_for`, - req: { - destinationId: { - type: 'string', - required: true, - }, - ifSeqNo: { - type: 'string', - required: true, - }, - ifPrimaryTerm: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'PUT', - }); - - alerting.deleteDestination = ca({ - url: { - fmt: `${DESTINATION_BASE_API}/<%=destinationId%>`, - req: { - destinationId: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); - - alerting.getEmailAccount = ca({ - url: { - fmt: `${EMAIL_ACCOUNT_BASE_API}/<%=emailAccountId%>`, - req: { - emailAccountId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - alerting.getEmailAccounts = ca({ - url: { - fmt: `${EMAIL_ACCOUNT_BASE_API}/_search`, - }, - needBody: true, - method: 'POST', - }); - - alerting.createEmailAccount = ca({ - url: { - fmt: `${EMAIL_ACCOUNT_BASE_API}?refresh=wait_for`, - }, - needBody: true, - method: 'POST', - }); - - alerting.updateEmailAccount = ca({ - url: { - fmt: `${EMAIL_ACCOUNT_BASE_API}/<%=emailAccountId%>?if_seq_no=<%=ifSeqNo%>&if_primary_term=<%=ifPrimaryTerm%>&refresh=wait_for`, - req: { - emailAccountId: { - type: 'string', - required: true, - }, - ifSeqNo: { - type: 'string', - required: true, - }, - ifPrimaryTerm: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'PUT', - }); - - alerting.deleteEmailAccount = ca({ - url: { - fmt: `${EMAIL_ACCOUNT_BASE_API}/<%=emailAccountId%>`, - req: { - emailAccountId: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); - - alerting.getEmailGroup = ca({ - url: { - fmt: `${EMAIL_GROUP_BASE_API}/<%=emailGroupId%>`, - req: { - emailGroupId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - alerting.getEmailGroups = ca({ - url: { - fmt: `${EMAIL_GROUP_BASE_API}/_search`, - }, - needBody: true, - method: 'POST', - }); - - alerting.createEmailGroup = ca({ - url: { - fmt: `${EMAIL_GROUP_BASE_API}?refresh=wait_for`, - }, - needBody: true, - method: 'POST', - }); - - alerting.updateEmailGroup = ca({ - url: { - fmt: `${EMAIL_GROUP_BASE_API}/<%=emailGroupId%>?if_seq_no=<%=ifSeqNo%>&if_primary_term=<%=ifPrimaryTerm%>&refresh=wait_for`, - req: { - emailGroupId: { - type: 'string', - required: true, - }, - ifSeqNo: { - type: 'string', - required: true, - }, - ifPrimaryTerm: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'PUT', - }); - - alerting.deleteEmailGroup = ca({ - url: { - fmt: `${EMAIL_GROUP_BASE_API}/<%=emailGroupId%>`, - req: { - emailGroupId: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); - - alerting.getDetector = ca({ - url: { - fmt: `${AD_BASE_API}/<%=detectorId%>`, - req: { - detectorId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - alerting.searchDetectors = ca({ - url: { - fmt: `${AD_BASE_API}/_search`, - }, - needBody: true, - method: 'POST', - }); - - alerting.previewDetector = ca({ - url: { - fmt: `${AD_BASE_API}/<%=detectorId%>/_preview`, - req: { - detectorId: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'POST', - }); - - alerting.searchResults = ca({ - url: { - fmt: `${AD_BASE_API}/results/_search`, - }, - needBody: true, - method: 'POST', - }); -} diff --git a/server/adaptors/opensearch_observability_plugin.ts b/server/adaptors/opensearch_observability_plugin.ts deleted file mode 100644 index 88291401..00000000 --- a/server/adaptors/opensearch_observability_plugin.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -const BASE_OBSERVABILITY_URI = '/_plugins/_observability'; -const OPENSEARCH_PANELS_API = { - OBJECT: `${BASE_OBSERVABILITY_URI}/object`, -}; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function OpenSearchObservabilityPlugin(Client: any, config: any, components: any) { - const clientAction = components.clientAction.factory; - - Client.prototype.observability = components.clientAction.namespaceFactory(); - const observability = Client.prototype.observability.prototype; - - // Get Object - observability.getObject = clientAction({ - url: { - fmt: OPENSEARCH_PANELS_API.OBJECT, - params: { - objectId: { - type: 'string', - }, - objectIdList: { - type: 'string', - }, - objectType: { - type: 'string', - }, - sortField: { - type: 'string', - }, - sortOrder: { - type: 'string', - }, - fromIndex: { - type: 'number', - }, - maxItems: { - type: 'number', - }, - name: { - type: 'string', - }, - lastUpdatedTimeMs: { - type: 'string', - }, - createdTimeMs: { - type: 'string', - }, - }, - }, - method: 'GET', - }); - - // Get Object by Id - observability.getObjectById = clientAction({ - url: { - fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, - req: { - objectId: { - type: 'string', - required: true, - }, - }, - }, - method: 'GET', - }); - - // Create new Object - observability.createObject = clientAction({ - url: { - fmt: OPENSEARCH_PANELS_API.OBJECT, - }, - method: 'POST', - needBody: true, - }); - - // Update Object by Id - observability.updateObjectById = clientAction({ - url: { - fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, - req: { - objectId: { - type: 'string', - required: true, - }, - }, - }, - method: 'PUT', - needBody: true, - }); - - // Delete Object by Id - observability.deleteObjectById = clientAction({ - url: { - fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, - req: { - objectId: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); - - // Delete Object by Id List - observability.deleteObjectByIdList = clientAction({ - url: { - fmt: OPENSEARCH_PANELS_API.OBJECT, - params: { - objectIdList: { - type: 'string', - required: true, - }, - }, - }, - method: 'DELETE', - }); -} diff --git a/server/adaptors/ppl_plugin.ts b/server/adaptors/ppl_plugin.ts deleted file mode 100644 index 3c30a123..00000000 --- a/server/adaptors/ppl_plugin.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -// @ts-ignore -export const PPLPlugin = function (Client, config, components) { - const ca = components.clientAction.factory; - Client.prototype.ppl = components.clientAction.namespaceFactory(); - const ppl = Client.prototype.ppl.prototype; - - ppl.pplQuery = ca({ - url: { - fmt: `/_plugins/_ppl`, - params: { - format: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'POST', - }); - - ppl.sqlQuery = ca({ - url: { - fmt: `/_plugins/_sql`, - params: { - format: { - type: 'string', - required: true, - }, - }, - }, - needBody: true, - method: 'POST', - }); -}; diff --git a/server/olly/__tests__/__utils__/test_helpers.ts b/server/olly/__tests__/__utils__/test_helpers.ts deleted file mode 100644 index 6829a168..00000000 --- a/server/olly/__tests__/__utils__/test_helpers.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { IMessage } from '../../../../common/types/chat_saved_object_attributes'; -import { LangchainTrace } from '../../../../common/utils/llm_chat/traces'; - -export const createTrace = (options: Partial = {}): LangchainTrace => ({ - id: 'trace-id', - type: 'chain', - startTime: 0, - name: 'trace name', - input: 'input', - output: 'output', - ...options, -}); - -export const createMessage = (options: Partial = {}): IMessage => { - if (options.type === 'input') { - return { - type: 'input', - content: 'user input', - contentType: 'text', - ...options, - }; - } - - return { - type: 'output', - content: 'assistant output', - contentType: 'markdown', - traceId: 'session-id', - ...options, - } as IMessage; -}; diff --git a/server/olly/tools/tool_sets/ppl.ts b/server/olly/tools/tool_sets/ppl.ts deleted file mode 100644 index 1d08cbe7..00000000 --- a/server/olly/tools/tool_sets/ppl.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -export class PPLTools { - static TOOL_NAMES = { - QUERY_OPENSEARCH: 'Query OpenSearch', - LOG_INFO: 'Get log info', - LOG_ERROR_INFO: 'Get log error info', - } as const; -} diff --git a/server/olly/utils/__tests__/ppl_generator.test.ts b/server/olly/utils/__tests__/ppl_generator.test.ts deleted file mode 100644 index ee4e8902..00000000 --- a/server/olly/utils/__tests__/ppl_generator.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { ApiResponse } from '@opensearch-project/opensearch/.'; -import { IndicesGetMappingResponse } from '@opensearch-project/opensearch/api/types'; -import { SearchResponse } from 'elasticsearch'; -import { generateFieldContext } from '../ppl_generator'; - -describe('PPL generator utils', () => { - it('handles empty mappings', () => { - const fields = generateFieldContext( - ({ - body: { employee_nested: { mappings: {} } }, - } as unknown) as ApiResponse, - ({ - body: { - took: 0, - timed_out: false, - _shards: { total: 1, successful: 1, skipped: 0, failed: 0 }, - hits: { total: { value: 0, relation: 'gte' }, max_score: 1, hits: [] }, - }, - } as unknown) as ApiResponse> - ); - expect(fields).toEqual(''); - }); - - it('generates field context', () => { - const fields = generateFieldContext( - ({ - body: { - employee_nested: { - mappings: { - properties: { - comments: { - properties: { - date: { type: 'date' }, - likes: { type: 'long' }, - message: { - type: 'text', - fields: { keyword: { type: 'keyword', ignore_above: 256 } }, - }, - }, - }, - id: { type: 'long' }, - name: { type: 'keyword' }, - projects: { - properties: { - address: { - properties: { city: { type: 'keyword' }, state: { type: 'keyword' } }, - }, - name: { type: 'keyword' }, - started_year: { type: 'long' }, - }, - }, - title: { type: 'keyword' }, - }, - }, - }, - }, - } as unknown) as ApiResponse, - ({ - body: { - took: 0, - timed_out: false, - _shards: { total: 1, successful: 1, skipped: 0, failed: 0 }, - hits: { - total: { value: 10000, relation: 'gte' }, - max_score: 1, - hits: [ - { - _index: 'employee_nested', - _id: '-cIErYkBQjxNwHvKnmIS', - _score: 1, - _source: { - id: 4, - name: 'Susan Smith', - projects: [], - comments: [ - { date: '2018-06-23', message: 'I love New york', likes: 56 }, - { date: '2017-10-25', message: 'Today is good weather', likes: 22 }, - ], - }, - }, - ], - }, - }, - } as unknown) as ApiResponse> - ); - expect(fields).toEqual( - '- comments.date: date (null)\n- comments.likes: long (null)\n- comments.message: text (null)\n- id: long (4)\n- name: keyword ("Susan Smith")\n- projects.address.city: keyword (null)\n- projects.address.state: keyword (null)\n- projects.name: keyword (null)\n- projects.started_year: long (null)\n- title: keyword (null)' - ); - }); -}); diff --git a/server/olly/utils/__tests__/utils.test.ts b/server/olly/utils/__tests__/utils.test.ts deleted file mode 100644 index d83d5cb1..00000000 --- a/server/olly/utils/__tests__/utils.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { flatten, jsonToCsv } from '../utils'; - -describe('utils', () => { - it('converts json to csv', () => { - const csv = jsonToCsv([ - { key1: 'value1', key2: 'value2', key3: 'value3' }, - { key4: 'value4', key5: 'value5', key6: 'value6' }, - { key7: 'value7', key8: 'value8', key9: 'value9' }, - ]); - expect(csv).toEqual( - 'row_number,key1,key2,key3\n1,value1,value2,value3\n2,value4,value5,value6\n3,value7,value8,value9' - ); - }); - - it('handles empty json', () => { - const csv = jsonToCsv([]); - expect(csv).toEqual('row_number\n'); - }); - - it('flattens nested objects', () => { - const flattened = flatten([ - { - key1: { key2: 'value1' }, - key3: { - key4: 'value2', - key5: { key6: 'value3', key7: [{ key8: 'value4' }, { key9: 'value5' }] }, - }, - }, - { key10: { key11: 'value6' } }, - ]); - expect(flattened).toEqual([ - { - 'key1.key2': 'value1', - 'key3.key4': 'value2', - 'key3.key5.key6': 'value3', - 'key3.key5.key7.0.key8': 'value4', - 'key3.key5.key7.1.key9': 'value5', - }, - { - 'key10.key11': 'value6', - }, - ]); - }); -}); diff --git a/server/olly/utils/constants.ts b/server/olly/utils/constants.ts deleted file mode 100644 index c8ba0561..00000000 --- a/server/olly/utils/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -export const MAX_OUTPUT_CHAR = 6000; diff --git a/server/olly/utils/output_builders/__tests__/build_outputs.test.ts b/server/olly/utils/output_builders/__tests__/build_outputs.test.ts deleted file mode 100644 index 77815a06..00000000 --- a/server/olly/utils/output_builders/__tests__/build_outputs.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { LangchainTrace } from '../../../../../common/utils/llm_chat/traces'; -import { createTrace } from '../../../__tests__/__utils__/test_helpers'; -import { buildOutputs } from '../build_outputs'; - -describe('build outputs', () => { - it('builds outputs', () => { - const traces: LangchainTrace[] = [createTrace(), createTrace({ type: 'tool' })]; - const outputs = buildOutputs( - 'test question', - 'agent response', - 'test-session', - { question1: 'test suggestion 1', question2: 'test suggestion 2' }, - traces - ); - expect(outputs).toEqual([ - { - content: 'agent response', - contentType: 'markdown', - traceId: 'test-session', - suggestedActions: [ - { actionType: 'send_as_input', message: 'test suggestion 1' }, - { actionType: 'send_as_input', message: 'test suggestion 2' }, - ], - toolsUsed: ['trace name'], - type: 'output', - }, - ]); - }); - - it('sanitizes markdown outputs', () => { - const outputs = buildOutputs( - 'test question', - 'normal text image !!!!!!![](http://evil.com/) ![image](http://evil.com/) [good link](https://link)', - 'test-session', - {}, - [] - ); - expect(outputs).toEqual([ - { - content: - 'normal text [](http://evil.com/) [image](http://evil.com/) [good link](https://link)', - contentType: 'markdown', - traceId: 'test-session', - suggestedActions: [], - toolsUsed: [], - type: 'output', - }, - ]); - }); - - it('builds outputs with object type response', () => { - const outputs = buildOutputs( - 'test question', - { output: 'agent response' }, - 'test-session', - {}, - [] - ); - expect(outputs).toEqual([ - { - content: 'agent response', - contentType: 'markdown', - traceId: 'test-session', - suggestedActions: [], - toolsUsed: [], - type: 'output', - }, - ]); - }); -}); diff --git a/server/olly/utils/output_builders/__tests__/ppl.test.ts b/server/olly/utils/output_builders/__tests__/ppl.test.ts deleted file mode 100644 index 4251f44e..00000000 --- a/server/olly/utils/output_builders/__tests__/ppl.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -describe('build ppl', () => { - it.skip('builds ppl outputs', () => { - // const traces: LangchainTrace[] = [ - // createTrace({ - // type: 'tool', - // name: PPLTools.TOOL_NAMES.QUERY_OPENSEARCH, - // output: - // 'The PPL query is: source=opensearch_dashboards_sample_data_flights | stats COUNT() AS count by span(timestamp, 1h)\n', - // }), - // createTrace({ type: 'tool' }), - // ]; - // const outputs = buildPPLOutputs(traces, [createMessage()], 'input'); - // expect(outputs).toEqual([ - // createMessage(), - // { - // content: - // 'source=opensearch_dashboards_sample_data_flights | stats COUNT() AS count by span(timestamp, 1h)', - // contentType: 'ppl_visualization', - // suggestedActions: [ - // { - // actionType: 'view_ppl_visualization', - // message: 'View details', - // metadata: { - // query: - // 'source=opensearch_dashboards_sample_data_flights | stats COUNT() AS count by span(timestamp, 1h)', - // question: 'input', - // }, - // }, - // ], - // type: 'output', - // }, - // ]); - }); - - it.skip('ignores non-ppl outputs', () => { - // const traces: LangchainTrace[] = [ - // createTrace({ - // type: 'tool', - // name: PPLTools.TOOL_NAMES.QUERY_OPENSEARCH, - // output: 'Failed to generate', - // }), - // ]; - // const outputs = buildPPLOutputs(traces, [createMessage()], 'input'); - // expect(outputs).toEqual([createMessage()]); - }); -}); diff --git a/server/olly/utils/output_builders/__tests__/suggestions.test.ts b/server/olly/utils/output_builders/__tests__/suggestions.test.ts deleted file mode 100644 index eac59cc1..00000000 --- a/server/olly/utils/output_builders/__tests__/suggestions.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { createMessage } from '../../../__tests__/__utils__/test_helpers'; -import { buildSuggestions } from '../suggestions'; - -describe('build suggestions', () => { - it('builds suggestion outputs', () => { - const outputs = buildSuggestions( - { question1: 'test suggestion 1', question2: 'test suggestion 2' }, - [createMessage()] - ); - // @ts-expect-error - expect(outputs[0].suggestedActions).toEqual([ - { actionType: 'send_as_input', message: 'test suggestion 1' }, - { actionType: 'send_as_input', message: 'test suggestion 2' }, - ]); - }); - - it('builds empty suggestion outputs', () => { - const outputs = buildSuggestions({ ignored: 'test suggestion 1' }, [createMessage()]); - // @ts-expect-error - expect(outputs[0].suggestedActions).toEqual([]); - }); -}); diff --git a/server/olly/utils/output_builders/build_outputs.ts b/server/olly/utils/output_builders/build_outputs.ts deleted file mode 100644 index 7895e2ec..00000000 --- a/server/olly/utils/output_builders/build_outputs.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import createDOMPurify from 'dompurify'; -import { JSDOM } from 'jsdom'; -import { IMessage } from '../../../../common/types/chat_saved_object_attributes'; -import { LangchainTrace } from '../../../../common/utils/llm_chat/traces'; -import { buildPPLOutputs } from './ppl'; -import { buildSuggestions, SuggestedQuestions } from './suggestions'; - -export const buildOutputs = ( - question: string, - agentResponse: AgentResponse, - traceId: string, - suggestions: SuggestedQuestions, - traces: LangchainTrace[] -) => { - const content = extractContent(agentResponse); - let outputs: IMessage[] = [ - { - type: 'output', - traceId, - content, - contentType: 'markdown', - }, - ]; - outputs = buildToolsUsed(traces, outputs); - outputs = buildPPLOutputs(traces, outputs, question); - outputs = buildSuggestions(suggestions, outputs); - return sanitize(outputs); -}; - -const extractContent = (agentResponse: AgentResponse) => { - return typeof agentResponse === 'string' ? agentResponse : (agentResponse.output as string); -}; - -const buildToolsUsed = (traces: LangchainTrace[], outputs: IMessage[]) => { - const tools = traces.filter((trace) => trace.type === 'tool').map((tool) => tool.name); - if (outputs[0].type !== 'output') throw new Error('First output message type should be output.'); - outputs[0].toolsUsed = tools; - return outputs; -}; - -const sanitize = (outputs: IMessage[]) => { - const window = new JSDOM('').window; - const DOMPurify = createDOMPurify((window as unknown) as Window); - return outputs.map((output) => ({ - ...output, - ...(output.contentType === 'markdown' && { - content: DOMPurify.sanitize(output.content, { FORBID_TAGS: ['img'] }).replace(/!+\[/g, '['), - }), - })); -}; diff --git a/server/olly/utils/output_builders/ppl.ts b/server/olly/utils/output_builders/ppl.ts deleted file mode 100644 index 5c490dbb..00000000 --- a/server/olly/utils/output_builders/ppl.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { IMessage } from '../../../../common/types/chat_saved_object_attributes'; -import { LangchainTrace } from '../../../../common/utils/llm_chat/traces'; -import { PPLTools } from '../../tools/tool_sets/ppl'; -import { filterToolOutput } from './utils'; - -const extractPPLQueries = (content: string) => { - return Array.from(content.matchAll(/(^|[\n\r]|:)\s*(source\s*=\s*.+)/gi)).map( - (match) => match[2] - ); -}; - -export const buildPPLOutputs = ( - traces: LangchainTrace[], - outputs: IMessage[], - question: string -): IMessage[] => { - const ppls = traces - .filter(filterToolOutput(PPLTools.TOOL_NAMES.QUERY_OPENSEARCH)) - .flatMap((trace) => extractPPLQueries(trace.output)); - if (!ppls.length) return outputs; - - const statsPPLs = ppls.filter((ppl) => /\|\s*stats\s+[^|]+\sby\s/i.test(ppl)); - if (!statsPPLs.length) { - return outputs; - } - - const visOutputs: IMessage[] = statsPPLs.map((query) => ({ - type: 'output', - content: query, - contentType: 'ppl_visualization', - suggestedActions: [ - { - message: 'View details', - actionType: 'view_ppl_visualization', - metadata: { query, question }, - }, - ], - })); - - return outputs.concat(visOutputs); -}; diff --git a/server/olly/utils/output_builders/suggestions.ts b/server/olly/utils/output_builders/suggestions.ts deleted file mode 100644 index f4e18e62..00000000 --- a/server/olly/utils/output_builders/suggestions.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { IMessage, ISuggestedAction } from '../../../../common/types/chat_saved_object_attributes'; -import { mergeMessages } from './utils'; - -export type SuggestedQuestions = Record; - -export const buildSuggestions = (suggestions: SuggestedQuestions, outputs: IMessage[]) => { - const suggestedActions: ISuggestedAction[] = []; - - if (suggestions.question1) { - suggestedActions.push({ - message: suggestions.question1, - actionType: 'send_as_input', - }); - } - - if (suggestions.question2) { - suggestedActions.push({ - message: suggestions.question2, - actionType: 'send_as_input', - }); - } - outputs[outputs.length - 1] = mergeMessages(outputs.at(-1)!, { suggestedActions }); - return outputs; -}; diff --git a/server/olly/utils/output_builders/utils.ts b/server/olly/utils/output_builders/utils.ts deleted file mode 100644 index a90687fe..00000000 --- a/server/olly/utils/output_builders/utils.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { mergeWith } from 'lodash'; -import { IMessage } from '../../../../common/types/chat_saved_object_attributes'; -import { LangchainTrace } from '../../../../common/utils/llm_chat/traces'; - -export const filterToolOutput = (toolName: string) => { - return (trace: LangchainTrace): trace is RequiredKey => - trace.type === 'tool' && - trace.name === toolName && - trace.output !== null && - trace.output !== undefined; -}; - -/** - * Merges a list of partial messages into a given IMessage object. - * @returns merged - */ -export const mergeMessages = (message: IMessage, ...messages: Array>) => { - return mergeWith( - message, - ...messages, - (obj: IMessage[keyof IMessage], src: IMessage[keyof IMessage]) => { - if (Array.isArray(obj)) return obj.concat(src); - } - ) as IMessage; -}; diff --git a/server/olly/utils/ppl_generator.ts b/server/olly/utils/ppl_generator.ts deleted file mode 100644 index 3102a843..00000000 --- a/server/olly/utils/ppl_generator.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { ApiResponse } from '@opensearch-project/opensearch/.'; -import { - IndicesGetMappingResponse, - MappingProperty, - SearchResponse, -} from '@opensearch-project/opensearch/api/types'; -import { get } from 'lodash'; - -/** - * @template T = unknown - mapping Context - * @template U = unknown - search Context - * @param mappings - mapping from get mappings request - * @param hits - search response that contains a sample document - * @returns a string that describes fields, types, and sample values - */ -export const generateFieldContext = ( - mappings: ApiResponse, - hits: ApiResponse, U> -) => { - const flattenedFields = flattenMappings(mappings); - const source = hits.body.hits.hits[0]?._source; - - return Object.entries(flattenedFields) - .filter(([, type]) => type !== 'alias') // PPL doesn't support 'alias' type - .map(([field, type]) => { - return `- ${field}: ${type} (${extractValue(source, field, type)})`; - }) - .join('\n'); -}; - -const extractValue = (source: unknown | undefined, field: string, type: string) => { - const value = get(source, field); - if (value === undefined) return null; - if (['text', 'keyword'].includes(type)) return `"${value}"`; - return value; -}; - -/** - * Flatten mappings response to an object of fields and types. - * - * @template T = unknown - Context - * @param mappings - mapping from get mappings request - * @returns an object of fields and types - */ -const flattenMappings = (mappings: ApiResponse) => { - const fields: Record = {}; - Object.values(mappings.body).forEach((body) => - parseProperties(body.mappings.properties, undefined, fields) - ); - return fields; -}; - -const parseProperties = ( - properties: Record | undefined, - prefixes: string[] = [], - fields: Record -) => { - Object.entries(properties || {}).forEach(([key, value]) => { - if (value.properties) { - parseProperties(value.properties, [...prefixes, key], fields); - } else { - fields[[...prefixes, key].join('.')] = value.type!; - } - }); - return fields; -}; diff --git a/server/olly/utils/utils.ts b/server/olly/utils/utils.ts deleted file mode 100644 index 6e83f887..00000000 --- a/server/olly/utils/utils.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { MAX_OUTPUT_CHAR } from './constants'; - -export const truncate = (text: string, maxLength: number = MAX_OUTPUT_CHAR) => { - if (text.length <= maxLength) return text; - const tailMessage = '\n\nOutput is too long, truncated... end:\n\n'; - return ( - text.slice(0, MAX_OUTPUT_CHAR - tailMessage.length - 300) + - tailMessage + - text.slice(text.length - 300) - ); -}; - -export const jsonToCsv = (json: object[]) => { - if (json.length === 0) return 'row_number\n'; - const rows = []; - - // Add header row with keys as column names - const header = Object.keys(json[0]); - rows.push(['row_number', ...header]); - - // Add data rows - json.forEach((obj, index) => { - const values = Object.values(obj); - const row = [index + 1, ...values]; - rows.push(row); - }); - - // Convert rows to CSV string - const csv = rows.map((row) => row.join(',')).join('\n'); - - return csv; -}; - -export const flatten = (response: AggregationBucket[]) => { - // Flattens each bucket in the response - for (const bucket in response) { - if (response.hasOwnProperty(bucket)) { - response[bucket] = flattenObject(response[bucket]); - } - } - return response; -}; - -function flattenObject(object: AggregationBucket, prefix = '') { - const result: Record = {}; - - // Recursively flattens object if it's an object or an array - for (const key in object) { - if (object.hasOwnProperty(key)) { - const combinedKey = prefix ? `${prefix}.${key}` : key; - const value = object[key]; - - if (typeof value === 'object') { - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - const nestedObject = flattenObject(value[i], `${combinedKey}.${i}`); - Object.assign(result, nestedObject); - } - } else { - const nestedObject = flattenObject(value, combinedKey); - Object.assign(result, nestedObject); - } - } else { - result[combinedKey] = value.toString(); - } - } - } - return result; -} - -export type TraceAnalyticsMode = 'jaeger' | 'data_prepper'; -export interface AggregationBucket { - [key: string]: string | number | AggregationBucket | AggregationBucket[]; -} diff --git a/server/plugin.ts b/server/plugin.ts index d7489ff9..79ad969c 100644 --- a/server/plugin.ts +++ b/server/plugin.ts @@ -14,9 +14,6 @@ import { Plugin, PluginInitializerContext, } from '../../../src/core/server'; -import { OpenSearchAlertingPlugin } from './adaptors/opensearch_alerting_plugin'; -import { OpenSearchObservabilityPlugin } from './adaptors/opensearch_observability_plugin'; -import { PPLPlugin } from './adaptors/ppl_plugin'; import { setupRoutes } from './routes/index'; import { AssistantPluginSetup, AssistantPluginStart, MessageParser } from './types'; import { BasicInputOutputParser } from './parsers/basic_input_output_parser'; @@ -40,7 +37,7 @@ export class AssistantPlugin implements Plugin; + + abortAgentExecution(sessionId: string): void; } diff --git a/test/jest.config.js b/test/jest.config.js index 3a5ab955..2c0e4123 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -23,7 +23,7 @@ module.exports = { '/__utils__/', ], // https://github.com/jestjs/jest/issues/6229#issuecomment-403539460 - transformIgnorePatterns: ['node_modules/(?!langchain|langsmith)'], + transformIgnorePatterns: ['node_modules/(?!langsmith)'], moduleNameMapper: { '\\.(css|less|sass|scss)$': '/test/__mocks__/styleMock.js', '\\.(gif|ttf|eot|svg|png)$': '/test/__mocks__/fileMock.js', diff --git a/yarn.lock b/yarn.lock index 290e4f09..d8d9a1cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,20 +2,6 @@ # yarn lockfile v1 -"@anthropic-ai/sdk@^0.6.2": - version "0.6.2" - resolved "https://registry.yarnpkg.com/@anthropic-ai/sdk/-/sdk-0.6.2.tgz#4be415e6b1d948df6f8e03af84aedf102ec74b70" - integrity sha512-fB9PUj9RFT+XjkL+E9Ol864ZIJi+1P8WnbHspN3N3/GK2uSzjd0cbVIKTGgf4v3N8MwaQu+UWnU7C4BG/fap/g== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - digest-fetch "^1.3.0" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - "@babel/code-frame@^7.0.0": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -134,24 +120,11 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*": version "20.6.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== -"@types/node@^18.11.18": - version "18.17.15" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.15.tgz#31301a273b9ca7d568fe6d1c35ae52e0fb3f8d6a" - integrity sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA== - "@types/prop-types@*": version "15.7.5" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" @@ -173,11 +146,6 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/retry@0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" - integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== - "@types/scheduler@*": version "0.16.3" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5" @@ -193,11 +161,6 @@ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.4.tgz#2b38784cd16957d3782e8e2b31c03bc1d13b4d65" integrity sha512-IDaobHimLQhjwsQ/NMwRVfa/yL7L/wriQPMhw1ZJall0KX6E1oxk29XMDeilW5qTIg5aoiqf5Udy8U/51aNoQQ== -"@types/uuid@^9.0.1": - version "9.0.3" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.3.tgz#6cdd939b4316b4f81625de9f06028d848c4a1533" - integrity sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug== - "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" @@ -215,13 +178,6 @@ abab@^2.0.6: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - acorn-jsx@^5.2.0: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -239,13 +195,6 @@ agent-base@6: dependencies: debug "4" -agentkeepalive@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" - integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== - dependencies: - humanize-ms "^1.2.1" - ajv@^6.10.0, ajv@^6.10.2: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -299,11 +248,6 @@ ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - ansi-styles@^6.0.0, ansi-styles@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" @@ -316,11 +260,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -341,26 +280,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - -base64-js@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -binary-extensions@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -binary-search@^1.3.5: - version "1.3.6" - resolved "https://registry.yarnpkg.com/binary-search/-/binary-search-1.3.6.tgz#e32426016a0c5092f0f3598836a1c7da3560565c" - integrity sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA== - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -388,11 +307,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@6: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - chalk@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" @@ -420,11 +334,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -charenc@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - ci-info@^3.2.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" @@ -498,11 +407,6 @@ commander@11.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== -commander@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" - integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -528,11 +432,6 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypt@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - cssstyle@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-3.0.0.tgz#17ca9c87d26eac764bb8cfd00583cff21ce0277a" @@ -568,11 +467,6 @@ debug@4, debug@4.3.4, debug@^4.0.1: dependencies: ms "2.1.2" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - decimal.js@^10.4.3: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" @@ -588,14 +482,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -digest-fetch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661" - integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA== - dependencies: - base-64 "^0.1.0" - md5 "^2.3.0" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -751,16 +637,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -eventemitter3@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - eventemitter3@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" @@ -781,11 +657,6 @@ execa@7.2.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -expr-eval@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expr-eval/-/expr-eval-2.0.2.tgz#fa6f044a7b0c93fde830954eb9c5b0f7fbc7e201" - integrity sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg== - external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -840,30 +711,11 @@ flat-cache@^2.0.1: rimraf "2.6.3" write "1.0.3" -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== -form-data-encoder@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" - integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -873,14 +725,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -formdata-node@^4.3.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.4.1.tgz#23f6a5cb9cb55315912cbec4ff7b0f59bbd191e2" - integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ== - dependencies: - node-domexception "1.0.0" - web-streams-polyfill "4.0.0-beta.3" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -966,13 +810,6 @@ human-signals@^4.3.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== - dependencies: - ms "^2.0.0" - husky@^8.0.0: version "8.0.3" resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" @@ -1042,16 +879,6 @@ inquirer@^7.0.0: strip-ansi "^6.0.0" through "^2.3.6" -is-any-array@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-any-array/-/is-any-array-2.0.1.tgz#9233242a9c098220290aa2ec28f82ca7fa79899e" - integrity sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ== - -is-buffer@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1116,13 +943,6 @@ jest-util@^29.0.0: graceful-fs "^4.2.9" picomatch "^2.2.3" -js-tiktoken@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.7.tgz#56933fcd2093e8304060dfde3071bda91812e6f5" - integrity sha512-biba8u/clw7iesNEWLOLwrNGoBP2lA+hTaBLs/D45pJdUPFXyxD6nhcDVtADChghv4GgyAiMKYMiRx7x6h7Biw== - dependencies: - base64-js "^1.5.1" - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -1136,13 +956,6 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - jsdom@^22.1.0: version "22.1.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-22.1.0.tgz#0fca6d1a37fbeb7f4aac93d1090d782c56b611c8" @@ -1187,55 +1000,6 @@ json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonpointer@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" - integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== - -langchain@^0.0.164: - version "0.0.164" - resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.0.164.tgz#3322c02b881fd70a16310183343eca832f181f44" - integrity sha512-XDyWU/wLtzJtux5adiFgW4ztgqGlA5r0+PaMXO+qRj9ZrUFPiDrvrUysZyr+iHG45/WUyBQj+Bo7g9dIP0XK2w== - dependencies: - "@anthropic-ai/sdk" "^0.6.2" - ansi-styles "^5.0.0" - binary-extensions "^2.2.0" - camelcase "6" - decamelize "^1.2.0" - expr-eval "^2.0.2" - flat "^5.0.2" - js-tiktoken "^1.0.7" - js-yaml "^4.1.0" - jsonpointer "^5.0.1" - langchainhub "~0.0.6" - langsmith "~0.0.31" - ml-distance "^4.0.0" - object-hash "^3.0.0" - openai "~4.4.0" - openapi-types "^12.1.3" - p-queue "^6.6.2" - p-retry "4" - uuid "^9.0.0" - yaml "^2.2.1" - zod "^3.22.3" - zod-to-json-schema "^3.20.4" - -langchainhub@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/langchainhub/-/langchainhub-0.0.6.tgz#9d2d06e4ce0807b4e8a31e19611f57aef990b54d" - integrity sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w== - -langsmith@~0.0.31: - version "0.0.36" - resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.36.tgz#398e07d773c8781adba97a8aed5f59640157fa45" - integrity sha512-hGbp/mMBxH+Tqbx3hP/yN7/ETZc+kA4QlyvyXyQza/sR1xLfmjTPNaVMz2NdwcD5QulMHrSlWxuBTXNF3BSlVg== - dependencies: - "@types/uuid" "^9.0.1" - commander "^10.0.1" - p-queue "^6.6.2" - p-retry "4" - uuid "^9.0.0" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -1310,15 +1074,6 @@ make-error@1.x: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -md5@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" - integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g== - dependencies: - charenc "0.0.2" - crypt "0.0.2" - is-buffer "~1.1.6" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -1373,52 +1128,11 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.6" -ml-array-mean@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/ml-array-mean/-/ml-array-mean-1.1.6.tgz#d951a700dc8e3a17b3e0a583c2c64abd0c619c56" - integrity sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ== - dependencies: - ml-array-sum "^1.1.6" - -ml-array-sum@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/ml-array-sum/-/ml-array-sum-1.1.6.tgz#d1d89c20793cd29c37b09d40e85681aa4515a955" - integrity sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw== - dependencies: - is-any-array "^2.0.0" - -ml-distance-euclidean@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ml-distance-euclidean/-/ml-distance-euclidean-2.0.0.tgz#3a668d236649d1b8fec96380b9435c6f42c9a817" - integrity sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q== - -ml-distance@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/ml-distance/-/ml-distance-4.0.1.tgz#4741d17a1735888c5388823762271dfe604bd019" - integrity sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw== - dependencies: - ml-array-mean "^1.1.6" - ml-distance-euclidean "^2.0.0" - ml-tree-similarity "^1.0.0" - -ml-tree-similarity@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ml-tree-similarity/-/ml-tree-similarity-1.0.0.tgz#24705a107e32829e24d945e87219e892159c53f0" - integrity sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg== - dependencies: - binary-search "^1.3.5" - num-sort "^2.0.0" - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - mute-stream@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" @@ -1434,18 +1148,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-domexception@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== - -node-fetch@^2.6.7: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - npm-run-path@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00" @@ -1453,21 +1155,11 @@ npm-run-path@^5.1.0: dependencies: path-key "^4.0.0" -num-sort@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/num-sort/-/num-sort-2.1.0.tgz#1cbb37aed071329fdf41151258bc011898577a9b" - integrity sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg== - nwsapi@^2.2.4: version "2.2.7" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.7.tgz#738e0707d3128cb750dddcfe90e4610482df0f30" integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== -object-hash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" - integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1489,25 +1181,6 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" -openai@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.4.0.tgz#dbaab326eb044ddec479951b245850c482678031" - integrity sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w== - dependencies: - "@types/node" "^18.11.18" - "@types/node-fetch" "^2.6.4" - abort-controller "^3.0.0" - agentkeepalive "^4.2.1" - digest-fetch "^1.3.0" - form-data-encoder "1.7.2" - formdata-node "^4.3.2" - node-fetch "^2.6.7" - -openapi-types@^12.1.3: - version "12.1.3" - resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3" - integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw== - optionator@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -1525,34 +1198,6 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-queue@^6.6.2: - version "6.6.2" - resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" - integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== - dependencies: - eventemitter3 "^4.0.4" - p-timeout "^3.2.0" - -p-retry@4: - version "4.6.2" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" - integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== - dependencies: - "@types/retry" "0.12.0" - retry "^0.13.1" - -p-timeout@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" - integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== - dependencies: - p-finally "^1.0.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -1676,11 +1321,6 @@ restore-cursor@^4.0.0: onetime "^5.1.0" signal-exit "^3.0.2" -retry@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - rfdc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" @@ -1923,11 +1563,6 @@ tr46@^4.1.1: dependencies: punycode "^2.3.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - ts-jest@^29.1.0: version "29.1.1" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" @@ -1989,11 +1624,6 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -uuid@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - v8-compile-cache@^2.0.3: version "2.4.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" @@ -2006,21 +1636,11 @@ w3c-xmlserializer@^4.0.0: dependencies: xml-name-validator "^4.0.0" -web-streams-polyfill@4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz#2898486b74f5156095e473efe989dcf185047a38" - integrity sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug== - web-streams-polyfill@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" @@ -2046,14 +1666,6 @@ whatwg-url@^12.0.0, whatwg-url@^12.0.1: tr46 "^4.1.1" webidl-conversions "^7.0.0" -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -2119,22 +1731,7 @@ yaml@2.3.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== -yaml@^2.2.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" - integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== - yargs-parser@^21.0.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -zod-to-json-schema@^3.20.4: - version "3.21.4" - resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.21.4.tgz#de97c5b6d4a25e9d444618486cb55c0c7fb949fd" - integrity sha512-fjUZh4nQ1s6HMccgIeE0VP4QG/YRGPmyjO9sAh890aQKPEk3nqbfUXhMFaC+Dr5KvYBm8BCyvfpZf2jY9aGSsw== - -zod@^3.22.3: - version "3.22.4" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" - integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==