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

Alpha #338

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

Alpha #338

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a5971d1
Knowledge db (#196)
MarcMcIntosh Feb 11, 2025
59642e6
2.0.5-alpha.5
MarcMcIntosh Feb 11, 2025
1b245bc
Merge branch 'main' into alpha
MarcMcIntosh Feb 11, 2025
dc935db
2.0.6-alpha.0
MarcMcIntosh Feb 11, 2025
e2bcc4d
fix(package-lock): fix merge conflicts.
MarcMcIntosh Feb 11, 2025
772d1a8
fix(package-lock): merge conflicts.
MarcMcIntosh Feb 11, 2025
22b2f9b
fix(vscode): `Cannot find module 'redux-persist/es/persistReducer' or…
MarcMcIntosh Feb 11, 2025
bfbd031
2.0.6-alpha.1
MarcMcIntosh Feb 11, 2025
b7349cc
fix: support for new textdoc tools from LSP
alashchev17 Feb 10, 2025
8d38348
fix: include text_edit tool to list of all patch-like tools
alashchev17 Feb 11, 2025
9804fe5
chore: removed duplicate hot keys option in main dropdown
alashchev17 Feb 11, 2025
147f86c
Merge branch 'main' into alpha
alashchev17 Feb 11, 2025
ca4a0f2
Merge branch 'main' into alpha
alashchev17 Feb 11, 2025
ecb19ff
chore: bump version to 2.0.7-alpha.1
alashchev17 Feb 12, 2025
6862a0c
Merge branch 'main' into alpha
alashchev17 Feb 12, 2025
65ea9c7
feat: updating integration availability values on switch click from g…
alashchev17 Feb 12, 2025
08acc15
feat: error handling & better styling & better code structure
alashchev17 Feb 12, 2025
4ed6c18
fix: handling form fields change in better way
alashchev17 Feb 13, 2025
50c8314
fix: if threadMode is AGENT or THINKING_AGENT, returning generic AGEN…
alashchev17 Feb 14, 2025
08767e8
chore: remove console statement
alashchev17 Feb 14, 2025
a15b3b1
Feature: Suggestion popup to open a new chat (#331)
alashchev17 Feb 14, 2025
958e450
fix: mention o3-mini as reasoning model in switch
alashchev17 Feb 14, 2025
149e2b0
WIP: Patch impovements (#345)
MarcMcIntosh Feb 18, 2025
4604ee4
wip: preventing too frequent double-pastes
alashchev17 Feb 13, 2025
830e466
wip: fixed tests of undo/redo & lowercase take of event.key for redo …
alashchev17 Feb 13, 2025
36d02f2
chore: return commented test case for textarea
alashchev17 Feb 13, 2025
c82f260
wip: disable no-console rule for reviewing purposes
alashchev17 Feb 13, 2025
49f19bd
fix: cut off handlePaste event since it's not used
alashchev17 Feb 14, 2025
4095620
fix: defining isPasteEvent by inputType, not by length of characters
alashchev17 Feb 17, 2025
fd15fd0
fix: using native event timestamp instead of Date.now() & removed con…
alashchev17 Feb 18, 2025
f367eaf
fix: resending messages on click on error message
alashchev17 Feb 11, 2025
6104b56
fix: using selectChatError instead of errorSlice error state & not re…
alashchev17 Feb 11, 2025
db50246
fix: before retrying, checking for chat error not to be null & fix tests
alashchev17 Feb 11, 2025
6f3c2cf
2.0.8-alpha.2
alashchev17 Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "refact-chat-js",
"version": "2.0.7",
"version": "2.0.8-alpha.2",
"type": "module",
"license": "BSD-3-Clause",
"files": [
Expand Down Expand Up @@ -72,6 +72,7 @@
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/debug": "^4.1.12",
"@types/diff": "^7.0.1",
"@types/js-cookie": "^3.0.6",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.isequal": "^4.5.8",
Expand All @@ -86,6 +87,7 @@
"@vitest/coverage-v8": "^1.1.0",
"@vitest/ui": "^1.1.0",
"classnames": "^2.3.2",
"diff": "^7.0.0",
"echarts": "^5.4.3",
"echarts-for-react": "^3.0.2",
"eslint": "^8.55.0",
Expand Down
585 changes: 585 additions & 0 deletions src/__fixtures__/chat.ts

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/__fixtures__/chat_config_thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ export const CHAT_CONFIG_THREAD: Chat = {
project: "",
},
read: true,
new_chat_suggested: {
wasSuggested: false,
},
createdAt: "2024-12-02T14:42:18.902Z",
updatedAt: "2024-12-02T14:42:18.902Z",
},
Expand Down
2 changes: 1 addition & 1 deletion src/__fixtures__/chat_links_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LinksForChatResponse } from "../services/refact/links";
export const STUB_LINKS_FOR_CHAT_RESPONSE: LinksForChatResponse = {
uncommited_changes_warning:
"You have uncommitted changes:\n```\nIn project refact-lsp: A tests/emergency_frog_situation/.refact/project_summary.yaml, M tests/emergency_frog_situation/frog.py, M tests/emergency_frog_situation/jump_to_conclusions.py, ...\n```\n⚠️ You might have a problem rolling back agent's changes.",

new_chat_suggestion: false,
links: [
{
link_text: "Save and return",
Expand Down
1,104 changes: 1,104 additions & 0 deletions src/__fixtures__/chat_textdoc.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/__fixtures__/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export const HISTORY: ChatHistoryItem[] = [
"Write a program that solves word-chain puzzles.\n\nThere’s a type of puzzle where the challenge is to build a chain of words, starting with one particular word and ending with another. Successive entries in the chain must all be real words, and each can differ from the previous word by just one letter. For example, you can get from “cat” to “dog” using the following chain.\n",
model: "",
isTitleGenerated: true,
new_chat_suggested: {
wasSuggested: false,
},
createdAt: "2024-07-02T10:43:13.401Z",
updatedAt: "2024-07-02T10:44:38.325Z",
tool_use: "explore",
Expand Down Expand Up @@ -115,6 +118,9 @@ export const HISTORY: ChatHistoryItem[] = [
"In this project, what is the difference between a toad and a frog?\n",
model: "",
isTitleGenerated: true,
new_chat_suggested: {
wasSuggested: false,
},
createdAt: "2024-07-02T10:40:27.354Z",
updatedAt: "2024-07-02T10:40:32.341Z",
tool_use: "explore",
Expand Down
1 change: 1 addition & 0 deletions src/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from "./integrations";
export * from "./survey_questions";
export * from "./chat_links_response";
export * from "./chat_config_thread";
export * from "./chat_textdoc";
264 changes: 264 additions & 0 deletions src/__fixtures__/knowledge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
import type {
MemdbSubEvent,
MemoRecord,
VecDbStatus,
} from "../services/refact";

export const STUB_MEMORIES: MemoRecord[] = [
{
memid: "7666487b81",
m_type: "proj-fact",
m_goal: "compile",
m_project: "proj1",
m_payload: "Looks like proj1 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 1,
mstat_relevant: -1,
mstat_times_used: 1,
},
{
memid: "cdec854819",
m_type: "seq-of-acts",
m_goal: "compile",
m_project: "proj2",
m_payload: "Wow, running cargo build on proj2 was successful!",
m_origin: "local-committed",
mstat_correct: 0,
mstat_relevant: 0,
mstat_times_used: 0,
},
{
memid: "eb1d64684b",
m_type: "proj-fact",
m_goal: "compile",
m_project: "proj2",
m_payload: "Looks like proj2 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 0,
mstat_relevant: 0,
mstat_times_used: 0,
},

{
memid: "eb1d64684c",
m_type: "proj-fact",
m_goal:
"Long goal Long goal Long goal Long goal Long goal Long goal Long goal Long goal Long goal Long goal",
m_project: "proj2",
m_payload: "Looks like proj2 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 0,
mstat_relevant: 0,
mstat_times_used: 0,
},
];

export const STUB_SUB_RESPONSE: MemdbSubEvent[] = [
{
pubevent_id: 19,
pubevent_action: "INSERT",
pubevent_json: {
memid: "66a072d699",
m_type: "seq-of-acts",
m_goal: "compile",
m_project: "proj1",
m_payload: "Wow, running cargo build on proj1 was successful!",
m_origin: "local-committed",
mstat_correct: 0.0,
mstat_relevant: 0.0,
mstat_times_used: 0,
},
},
{
pubevent_id: 26,
pubevent_action: "INSERT",
pubevent_json: {
memid: "d688925823",
m_type: "proj-fact",
m_goal: "compile",
m_project: "proj1",
m_payload: "Looks like proj1 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 0.0,
mstat_relevant: 0.0,
mstat_times_used: 0,
},
},
{
pubevent_id: 27,
pubevent_action: "INSERT",
pubevent_json: {
memid: "08f9374753",
m_type: "seq-of-acts",
m_goal: "compile",
m_project: "proj2",
m_payload: "Wow, running cargo build on proj2 was successful!",
m_origin: "local-committed",
mstat_correct: 0.0,
mstat_relevant: 0.0,
mstat_times_used: 0,
},
},
{
pubevent_id: 28,
pubevent_action: "INSERT",
pubevent_json: {
memid: "c9cefe3ff4",
m_type: "proj-fact",
m_goal: "compile",
m_project: "proj2",
m_payload: "Looks like proj2 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 0.0,
mstat_relevant: 0.0,
mstat_times_used: 0,
},
},
{
pubevent_id: 29,
pubevent_action: "UPDATE",
pubevent_json: {
memid: "d688925823",
m_type: "proj-fact",
m_goal: "compile",
m_project: "proj1",
m_payload: "Looks like proj1 is written in fact in Rust.",
m_origin: "local-committed",
mstat_correct: 1.0,
mstat_relevant: -1.0,
mstat_times_used: 1,
},
},
{
pubevent_id: 30,
pubevent_action: "DELETE",
pubevent_json: {
memid: "9d2a679b09",
m_type: "",
m_goal: "",
m_project: "",
m_payload: "",
m_origin: "",
mstat_correct: 0,
mstat_relevant: 0,
mstat_times_used: 0,
},
},
];

// export const STUB_SUB_RESPONSE_WITH_STATUS: (
// | MemdbSubEventUnparsed
// | VecDbStatus
// )[] = [];

export const VECDB_STATUS_STARTING: VecDbStatus = {
files_unprocessed: 0,
files_total: 0,
requests_made_since_start: 1,
vectors_made_since_start: 33,
db_size: 33,
db_cache_size: 37,
state: "starting",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDB_STATUS_PARSING: VecDbStatus = {
files_unprocessed: 377,
files_total: 404,
requests_made_since_start: 5,
vectors_made_since_start: 296,
db_size: 168,
db_cache_size: 333,
state: "parsing",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDB_STATUS_PARSING_2: VecDbStatus = {
files_unprocessed: 372,
files_total: 404,
requests_made_since_start: 6,
vectors_made_since_start: 303,
db_size: 303,
db_cache_size: 340,
state: "parsing",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDV_STATUS_PARISING_3: VecDbStatus = {
files_unprocessed: 192,
files_total: 404,
requests_made_since_start: 21,
vectors_made_since_start: 990,
db_size: 1021,
db_cache_size: 1027,
state: "parsing",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDB_STATUS_PARSING_4: VecDbStatus = {
files_unprocessed: 12,
files_total: 404,
requests_made_since_start: 52,
vectors_made_since_start: 2494,
db_size: 2524,
db_cache_size: 2531,
state: "parsing",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDB_STATUS_COOLDOWN: VecDbStatus = {
files_unprocessed: 1,
files_total: 404,
requests_made_since_start: 52,
vectors_made_since_start: 2494,
db_size: 2524,
db_cache_size: 2533,
state: "cooldown",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const VECDB_STATUS_DONE: VecDbStatus = {
files_unprocessed: 0,
files_total: 0,
requests_made_since_start: 54,
vectors_made_since_start: 2535,
db_size: 2629,
db_cache_size: 2574,
state: "done",
queue_additions: false,
vecdb_max_files_hit: false,
vecdb_errors: {},
};

export const STUB_SUB_RESPONSE_WITH_STATUS = [
VECDB_STATUS_STARTING,
// ...STUB_SUB_RESPONSE,
VECDB_STATUS_PARSING,
VECDB_STATUS_PARSING_2,
VECDV_STATUS_PARISING_3,
VECDB_STATUS_PARSING_4,
VECDB_STATUS_COOLDOWN,
VECDB_STATUS_DONE,
];

export const STB_LOADING_VECDB = {
VECDB_STATUS_STARTING,
VECDB_STATUS_PARSING,
VECDB_STATUS_PARSING_2,
VECDV_STATUS_PARISING_3,
VECDB_STATUS_PARSING_4,
VECDB_STATUS_COOLDOWN,
VECDB_STATUS_DONE,
};
Loading