Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Conversation

@MarcMcIntosh
Copy link
Contributor

@MarcMcIntosh MarcMcIntosh commented Nov 11, 2024

Knowledge db

Description

Works with dev lsp branch.
Adds a UI for the knowledge db.

Also adds a hidden features menu.

  • What was the problem?
  • How did you solve it?
  • Any background context or related links?

Issues enountered.

  • streams not hanging up when unmounted, a thunk is used instead.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, only code improvements)
  • Documentation update

How to Test

  • Step 1: go the the history list, make sure nothing is focused then press up, up, down, down, left, right, left, right, escape, enter and enabled knowledge from the hidden features menu.
  • Step 2: to see knowledge items select manage knowledge from the dropdown menu.
  • Step 3: start a chat and until a knowledge tool call shows up, this can be clicked on to view more details.

Screenshots (if applicable)

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have updated the documentation where necessary.

Linked Issues

Additional Notes

@MarcMcIntosh MarcMcIntosh changed the base branch from main to alpha January 10, 2025 16:56
 Conflicts:
	src/__fixtures__/msw.ts
	src/app/store.ts
	src/components/Toolbar/Dropdown.tsx
	src/features/App.tsx
	src/features/Chat/Thread/types.ts
	src/features/Pages/pagesSlice.ts

 Changes to be committed:
	modified:   .prettierignore
	new file:   .refact/integrations.d/cmdline_install_dependencies.yaml
	new file:   .refact/integrations.d/service_storybook.yaml
	new file:   .refact/integrations.d/service_webserver.yaml
	modified:   package-lock.json
	modified:   package.json
	new file:   public/agent.gif
	new file:   public/commands.gif
	modified:   src/__fixtures__/chat.ts
	modified:   src/__fixtures__/chat_config_thread.ts
	new file:   src/__fixtures__/checkpoints.ts
	new file:   src/__fixtures__/confirmation.ts
	modified:   src/__fixtures__/msw.ts
	modified:   src/__tests__/PinMessages.test.tsx
	modified:   src/__tests__/RestoreChat.test.tsx
	modified:   src/__tests__/StartNewChat.test.tsx
	modified:   src/__tests__/UserSurvey.test.tsx
	modified:   src/app/middleware.ts
	modified:   src/app/store.ts
	new file:   src/components/Accordion/Accordion.module.css
	new file:   src/components/Accordion/Accordion.stories.tsx
	new file:   src/components/Accordion/Accordion.tsx
	new file:   src/components/Accordion/index.ts
	deleted:    src/components/BringYourOwnKey/BringYourOwnKey.tsx
	modified:   src/components/Buttons/Buttons.tsx
	modified:   src/components/Callout/Callout.tsx
	modified:   src/components/Chat/Chat.stories.tsx
	modified:   src/components/Chat/Chat.tsx
	modified:   src/components/ChatContent/ChatContent.stories.tsx
	modified:   src/components/ChatContent/ChatContent.tsx
	modified:   src/components/ChatContent/ContextFiles.tsx
	modified:   src/components/ChatContent/UserInput.tsx
	modified:   src/components/ChatContent/useAutoScroll.ts
	new file:   src/components/ChatForm/AgentCapabilities.tsx
	modified:   src/components/ChatForm/ChatControls.tsx
	modified:   src/components/ChatForm/ChatForm.test.tsx
	modified:   src/components/ChatForm/ChatForm.tsx
	modified:   src/components/ChatForm/FilesPreview.tsx
	modified:   src/components/ChatForm/RetryForm.tsx
	new file:   src/components/ChatForm/ToolConfirmation.stories.tsx
	modified:   src/components/ChatForm/ToolConfirmation.tsx
	modified:   src/components/ChatLinks/ChatLinks.tsx
	deleted:    src/components/CloudLogin/CloudLogin.stories.tsx
	deleted:    src/components/CloudLogin/CloudLogin.tsx
	deleted:    src/components/CloudLogin/index.ts
	modified:   src/components/Dropzone/Dropzone.tsx
	deleted:    src/components/EnterpriseSetup/EnterpriseSetup.stories.tsx
	deleted:    src/components/EnterpriseSetup/EnterpriseSetup.tsx
	deleted:    src/components/EnterpriseSetup/index.ts
	deleted:    src/components/InitialSetup/InitialSetup.stories.tsx
	deleted:    src/components/InitialSetup/InitialSetup.tsx
	deleted:    src/components/InitialSetup/index.ts
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationAvailability.tsx
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationForm.module.css
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationForm.tsx
	modified:   src/components/IntegrationsView/IntegrationsHeader.module.css
	modified:   src/components/IntegrationsView/IntegrationsHeader.tsx
	modified:   src/components/IntegrationsView/IntegrationsView.module.css
	modified:   src/components/IntegrationsView/IntegrationsView.tsx
	modified:   src/components/Markdown/CodeBlock.tsx
	modified:   src/components/Markdown/Markdown.tsx
	modified:   src/components/PageWrapper/PageWrapper.module.css
	deleted:    src/components/SelfHostingSetup/SelfHostingSetup.stories.tsx
	deleted:    src/components/SelfHostingSetup/SelfHostingSetup.tsx
	deleted:    src/components/SelfHostingSetup/index.ts
	modified:   src/components/Toolbar/Dropdown.tsx
	new file:   src/components/Toolbar/Toolbar.module.css
	modified:   src/components/Toolbar/Toolbar.tsx
	modified:   src/components/Tour/Tour.tsx
	modified:   src/components/Tour/TourBubble.tsx
	modified:   src/components/Tour/TourEnd.tsx
	modified:   src/features/AgentUsage/AgentUsage.stories.tsx
	modified:   src/features/AgentUsage/AgentUsage.tsx
	modified:   src/features/AgentUsage/agentUsageSlice.ts
	new file:   src/features/App.module.css
	modified:   src/features/App.tsx
	modified:   src/features/Chat/Thread/actions.ts
	modified:   src/features/Chat/Thread/reducer.ts
	modified:   src/features/Chat/Thread/selectors.ts
	modified:   src/features/Chat/Thread/types.ts
	modified:   src/features/Chat/Thread/utils.ts
	new file:   src/features/Checkpoints/CheckpointButton.tsx
	new file:   src/features/Checkpoints/Checkpoints.module.css
	new file:   src/features/Checkpoints/Checkpoints.stories.tsx
	new file:   src/features/Checkpoints/Checkpoints.tsx
	new file:   src/features/Checkpoints/CheckpointsStatusIndicator.tsx
	new file:   src/features/Checkpoints/checkpointsSlice.ts
	new file:   src/features/Checkpoints/index.ts
	new file:   src/features/Checkpoints/types.ts
	renamed:    src/components/BringYourOwnKey/index.tsx -> src/features/Checkpoints/utils.ts
	modified:   src/features/Errors/errorsSlice.ts
	modified:   src/features/History/historySlice.ts
	modified:   src/features/Integrations/Integrations.tsx
	modified:   src/features/Integrations/renderIntegrationFormField.module.css
	new file:   src/features/Login/LoginPage.stories.tsx
	new file:   src/features/Login/LoginPage.tsx
	new file:   src/features/Login/index.ts
	modified:   src/features/Pages/pagesSlice.ts
	modified:   src/features/Tour.tsx
	modified:   src/hooks/useAgentUsage.ts
	modified:   src/hooks/useAttachedImages.ts
	modified:   src/hooks/useCapsForToolUse.ts
	new file:   src/hooks/useCheckpoints.ts
	modified:   src/hooks/useGetUser.ts
	modified:   src/hooks/useLinksFromLsp.ts
	modified:   src/hooks/useLogin.ts
	modified:   src/hooks/useOpenUrl.ts
	new file:   src/hooks/useRestoreCheckpoints.ts
	modified:   src/hooks/useSendChatRequest.ts
	modified:   src/hooks/useSmartLinks.ts
	new file:   src/images/GoogleIcon.tsx
	modified:   src/services/refact/caps.ts
	modified:   src/services/refact/chat.ts
	new file:   src/services/refact/checkpoints.ts
	modified:   src/services/refact/consts.ts
	modified:   src/services/refact/links.ts
	modified:   src/services/refact/types.ts
	modified:   src/services/smallcloud/index.ts
	new file:   src/utils/extractLinkFromPuzzle.test.ts
	modified:   src/utils/extractLinkFromPuzzle.ts
	new file:   src/utils/formatDateToHumanReadable.ts
	new file:   src/utils/formatPathName.ts
@MarcMcIntosh MarcMcIntosh changed the title [WIP]: Chat db [WIP]: knowledge db Feb 5, 2025
@MarcMcIntosh MarcMcIntosh changed the base branch from main to alpha February 5, 2025 11:43
@MarcMcIntosh MarcMcIntosh marked this pull request as ready for review February 5, 2025 11:43
@MarcMcIntosh MarcMcIntosh changed the title [WIP]: knowledge db Knowledge db Feb 5, 2025
 Conflicts:
	src/features/Config/configSlice.ts
	src/services/refact/types.ts

 Changes to be committed:
	modified:   package-lock.json
	modified:   package.json
	modified:   src/__fixtures__/caps.ts
	modified:   src/__fixtures__/msw.ts
	modified:   src/__tests__/ChatCapsFetchError.test.tsx
	modified:   src/__tests__/DeleteChat.test.tsx
	modified:   src/__tests__/PinMessages.test.tsx
	modified:   src/__tests__/RestoreChat.test.tsx
	modified:   src/__tests__/StartNewChat.test.tsx
	modified:   src/__tests__/UserSurvey.test.tsx
	modified:   src/components/ChatForm/ChatControls.tsx
	modified:   src/components/ChatForm/ChatForm.tsx
	new file:   src/components/IntegrationsView/DisplayIntegrations/GlobalIntegrations.tsx
	renamed:    src/components/IntegrationsView/IntegrationCard.module.css -> src/components/IntegrationsView/DisplayIntegrations/IntegrationCard.module.css
	renamed:    src/components/IntegrationsView/IntegrationCard.tsx -> src/components/IntegrationsView/DisplayIntegrations/IntegrationCard.tsx
	new file:   src/components/IntegrationsView/DisplayIntegrations/IntegrationsList.tsx
	new file:   src/components/IntegrationsView/DisplayIntegrations/NewIntegrations.tsx
	new file:   src/components/IntegrationsView/DisplayIntegrations/ProjectIntegrations.tsx
	renamed:    src/components/IntegrationsView/IntegrationsHeader.module.css -> src/components/IntegrationsView/Header/IntegrationsHeader.module.css
	renamed:    src/components/IntegrationsView/IntegrationsHeader.tsx -> src/components/IntegrationsView/Header/IntegrationsHeader.tsx
	modified:   src/components/IntegrationsView/IntegrationDocker/IntegrationDocker.tsx
	new file:   src/components/IntegrationsView/IntegrationForm/ErrorState.tsx
	new file:   src/components/IntegrationsView/IntegrationForm/FormAvailabilityAndDelete.tsx
	new file:   src/components/IntegrationsView/IntegrationForm/FormFields.tsx
	new file:   src/components/IntegrationsView/IntegrationForm/FormSmartlinks.tsx
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationForm.tsx
	new file:   src/components/IntegrationsView/IntegrationsTable/ArgumentsTable.tsx
	modified:   src/components/IntegrationsView/IntegrationsTable/ConfirmationTable.tsx
	modified:   src/components/IntegrationsView/IntegrationsTable/DefaultCell.tsx
	new file:   src/components/IntegrationsView/IntegrationsTable/EnvironmentVariablesTable.tsx
	modified:   src/components/IntegrationsView/IntegrationsTable/ParametersTable.tsx
	modified:   src/components/IntegrationsView/IntegrationsView.tsx
	deleted:    src/components/IntegrationsView/JSONFormStyles.css
	new file:   src/components/IntegrationsView/hooks/useFormAvailability.ts
	new file:   src/components/IntegrationsView/hooks/useFormFields.ts
	new file:   src/components/IntegrationsView/hooks/useIntegrations.ts
	deleted:    src/components/IntegrationsView/icons/chrome.png
	deleted:    src/components/IntegrationsView/icons/cmdline.png
	deleted:    src/components/IntegrationsView/icons/docker.png
	deleted:    src/components/IntegrationsView/icons/github-dark.png
	deleted:    src/components/IntegrationsView/icons/github-light.png
	deleted:    src/components/IntegrationsView/icons/gitlab.png
	deleted:    src/components/IntegrationsView/icons/iconMap.ts
	deleted:    src/components/IntegrationsView/icons/mysql.png
	deleted:    src/components/IntegrationsView/icons/pdb.png
	deleted:    src/components/IntegrationsView/icons/postgres.png
	modified:   src/components/Markdown/CodeBlock.tsx
	modified:   src/features/Chat/Chat.test.tsx
	modified:   src/features/Chat/Thread/reducer.ts
	modified:   src/features/Checkpoints/CheckpointButton.tsx
	modified:   src/features/Config/configSlice.ts
	modified:   src/features/History/historySlice.ts
	renamed:    src/features/Integrations/renderIntegrationFormField.module.css -> src/features/Integrations/IntegrationFormField.module.css
	new file:   src/features/Integrations/IntegrationFormField.tsx
	modified:   src/features/Integrations/index.ts
	deleted:    src/features/Integrations/renderIntegrationFormField.tsx
	modified:   src/features/Login/LoginPage.tsx
	modified:   src/hooks/useCheckpoints.ts
	modified:   src/hooks/useLogin.ts
	modified:   src/hooks/useLogout.ts
	modified:   src/services/refact/integrations.ts
	modified:   src/services/refact/types.ts
	new file:   src/utils/formatIntegrationIconPath.ts
	new file:   src/utils/getIntegrationInfo.ts
	modified:   src/utils/trimIndent.ts
	modified:   src/utils/utils.test.tsx
	modified:   src/utils/validateSnakeCase.ts
Copy link
Member

@alashchev17 alashchev17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It mostly looks good, a few comments and changes requested

return (
<Flex justify="end" px="2" minHeight="28px">
<IconButton
title="create a trajectory from this chat"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it an action button to save actual trajectory based on chat thread history?
Title should start from uppercased letter to match overall styling of all other titles for buttons and active elements

title="create a trajectory from this chat"
variant="ghost"
onClick={submitLike}
disabled={likeResponse.isSuccess}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button can be clicked while waiting for response from v1/trajectory-save

void submit(memory);
}
// setOpenForm(false);
// TBD: should we clear the form after submit?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes, why should we keep that data in the form?

@MarcMcIntosh MarcMcIntosh merged commit a5971d1 into alpha Feb 11, 2025
2 checks passed
@MarcMcIntosh MarcMcIntosh deleted the chat-db branch February 11, 2025 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants