Skip to content
Open

Dev #266

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ffe0b83
6.5.1
alashchev17 Jun 6, 2025
47af30a
6.5.2
MarcMcIntosh Jun 17, 2025
4cbab5e
6.5.3
alashchev17 Jun 17, 2025
9d69b71
6.5.4
MarcMcIntosh Jun 19, 2025
3544f3c
6.5.5
olegklimov Jun 19, 2025
bfcd224
6.5.6
olegklimov Jun 19, 2025
ac7b147
6.5.7
olegklimov Jun 19, 2025
2344c79
6.5.8
alashchev17 Jun 19, 2025
c4c1572
6.5.9
alashchev17 Jun 19, 2025
f9845c6
6.5.10
olegklimov Jun 20, 2025
da89cde
6.5.11
olegklimov Jun 20, 2025
f8b7282
feat: storing active workspace selected in GUI
alashchev17 Jun 20, 2025
51cb318
6.5.12
olegklimov Jun 21, 2025
e12bdc9
6.5.13
olegklimov Jun 21, 2025
00b7e4f
chore: 6.5.14
alashchev17 Jun 23, 2025
d0d53f1
6.5.15
olegklimov Jun 26, 2025
c156bcc
6.5.16
alashchev17 Jun 30, 2025
e22a795
6.5.17
MarcMcIntosh Jul 3, 2025
2a52bea
wip: allow vscode to compile with the flexus changes to chat
MarcMcIntosh Jun 30, 2025
f70179b
chore: update code lens code to use "ftm_role" and "ftm_content".
MarcMcIntosh Jun 30, 2025
5c3ad24
chore: remove console.log
MarcMcIntosh Jul 3, 2025
fa7fb01
6.5.18
MarcMcIntosh Jul 4, 2025
7bda9f2
6.5.19
MarcMcIntosh Jul 7, 2025
3c4e4f8
feat: add connections when in xpermental mode
MarcMcIntosh Jul 11, 2025
5e09164
6.5.20
MarcMcIntosh Jul 11, 2025
789e4fe
chore: remove ChatThread
MarcMcIntosh Jul 22, 2025
db69f16
6.5.21
MarcMcIntosh Jul 23, 2025
a9341fc
wip: changing lsp workspace
MarcMcIntosh Jul 24, 2025
c30a820
refactor: split setting changed and updating the ui
MarcMcIntosh Jul 24, 2025
d8d6bbe
fix: rename lsp arg to `--active-group-id`
MarcMcIntosh Jul 24, 2025
b20e2a9
refactor: don't restart the lsp when chaning group.
MarcMcIntosh Jul 24, 2025
c960338
6.5.22
MarcMcIntosh Jul 30, 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
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
"--extensionDevelopmentPath=${workspaceFolder}",
"--allow-insecure-localhost"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"url": "https://github.com/smallcloudai/refact-vscode/issues",
"email": "[email protected]"
},
"version": "6.5.0",
"version": "6.5.22",
"dependencies": {
"@types/marked": "^4.0.8",
"@types/vscode": "^1.69.0",
Expand Down Expand Up @@ -229,7 +229,10 @@
"order": 14
},
"refactai.activeGroup": {
"type": ["object", "null"],
"type": [
"object",
"null"
],
"default": null,
"description": "Active selected group in your Team Workspace. Modify via settings.json in your workspace",
"scope": "machine-overridable",
Expand Down
21 changes: 12 additions & 9 deletions src/codeLens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import * as estate from "./estate";
import * as fetchH2 from 'fetch-h2';
import * as fetchAPI from "./fetchAPI";
import {
type ChatMessages,
type ChatMessage,
type ToolUse,
setInputValue,
isUserMessage,
UserMessage,
Expand Down Expand Up @@ -169,10 +167,10 @@ const createMessageBlock = (
cursor: number | null,
text: string
) => {
if (typeof message.content === 'string') {
return replaceVariablesInText(message.content, relative_path, cursor, text);
if (typeof message.ftm_content === 'string') {
return replaceVariablesInText(message.ftm_content, relative_path, cursor, text);
} else {
return message.content.map(content => {
return message.ftm_content.map(content => {
if (('type' in content) && content.type === 'text') {
return replaceVariablesInText(content.text, relative_path, cursor, text);
}
Expand All @@ -185,13 +183,13 @@ const formatMultipleMessagesForCodeLens = (
relative_path: string,
cursor: number | null,
text: string
) => {
): ChatMessage[] => {
return messages.map(message => {
if (isUserMessage(message)) {
if (typeof message.content === 'string') {
if (typeof message.ftm_content === 'string') {
return {
...message,
content: replaceVariablesInText(message.content, relative_path, cursor, text)
ftm_content: replaceVariablesInText(message.ftm_content, relative_path, cursor, text)
};
}
}
Expand All @@ -206,7 +204,12 @@ export async function code_lens_execute(code_lens: string, range: any) {
if (custom_code_lens) {
const auto_submit = custom_code_lens[code_lens]["auto_submit"];
const new_tab = custom_code_lens[code_lens]["new_tab"];
let messages: ChatMessage[] = custom_code_lens[code_lens]["messages"];
let messages: ChatMessage[] = custom_code_lens[code_lens]["messages"].map((message: {role: string, content: unknown}) => {
return {
ftm_role: message.role,
ftm_content: message.content,
};
});

const start_of_line = new vscode.Position(range.start.line, 0);
const end_of_line = new vscode.Position(range.end.line + 1, 0);
Expand Down
58 changes: 34 additions & 24 deletions src/fetchAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import * as usabilityHints from "./usabilityHints";
import * as estate from "./estate";
import * as statusBar from "./statusBar";
import {
type CapsResponse,
type CustomPromptsResponse,
ChatMessages,
} from "refact-chat-js/dist/events";

Expand Down Expand Up @@ -458,28 +456,40 @@ export function look_for_common_errors(json: any, scope: string, url: string): b
return false;
}

export async function get_caps(): Promise<CapsResponse> {
let url = rust_url("/v1/caps");
if (!url) {
return Promise.reject("read_caps no rust binary working, very strange");
}

let req = new fetchH2.Request(url, {
method: "GET",
redirect: "follow",
cache: "no-cache",
referrer: "no-referrer",
});

let resp = await fetchH2.fetch(req);
if (resp.status !== 200) {
console.log(["read_caps http status", resp.status]);
return Promise.reject("read_caps bad status");
}
let json = await resp.json();
console.log(["successful read_caps", json]);
return json as CapsResponse;
}
// TODO: this has moved (also not used)
// export async function get_caps(): Promise<CapsResponse> {
// let url = rust_url("/v1/caps");
// if (!url) {
// return Promise.reject("read_caps no rust binary working, very strange");
// }

// let req = new fetchH2.Request(url, {
// method: "GET",
// redirect: "follow",
// cache: "no-cache",
// referrer: "no-referrer",
// });

// let resp = await fetchH2.fetch(req);
// if (resp.status !== 200) {
// console.log(["read_caps http status", resp.status]);
// return Promise.reject("read_caps bad status");
// }
// let json = await resp.json();
// console.log(["successful read_caps", json]);
// return json as CapsResponse;
// }

type SystemPrompt = {
text: string;
description: string;
};

type SystemPrompts = Record<string, SystemPrompt>;
type CustomPromptsResponse = {
system_prompts: SystemPrompts;
toolbox_commands: Record<string, unknown>;
};

export async function get_prompt_customization(): Promise<CustomPromptsResponse> {
const url = rust_url("/v1/customization");
Expand Down
15 changes: 9 additions & 6 deletions src/launchRust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export class RustBinaryBlob {
let port: number;
let ping_response: string;

// const maybe_active_workspace = global.global_context.globalState.get('active_workspace') as Workspace | undefined;
// const active_workspace_id = maybe_active_workspace ? maybe_active_workspace.workspace_id : null;

const team = global.side_panel?.context.workspaceState.get<TeamsGroup>('refactai.activeGroup');

if (xdebug === 0) {
if (this.lsp_client) { // running
port = this.port; // keep the same port
Expand Down Expand Up @@ -128,10 +129,10 @@ export class RustBinaryBlob {
"--basic-telemetry",
];

// if (active_workspace_id !== null && active_workspace_id !== undefined) {
// new_cmdline.push("--active-workspace-id");
// new_cmdline.push(active_workspace_id.toString());
// }
if (team && team.id) {
new_cmdline.push("--active-group-id");
new_cmdline.push(team.id.toString());
}

if (vscode.workspace.getConfiguration().get<boolean>("refactai.vecdb")) {
new_cmdline.push("--vecdb");
Expand Down Expand Up @@ -166,7 +167,9 @@ export class RustBinaryBlob {
break;
}
}

global.side_panel?.handleSettingsChange();

}

public async launch() {
Expand Down
Loading
Loading