Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,774 changes: 720 additions & 1,054 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@janole/code-bandit",
"description": "Your AI-powered codebase companion that speaks your language",
"version": "0.3.19",
"version": "0.5.20",
"author": "Jan Ole Suhr <ole@janole.com> (https://janole.com)",
"homepage": "https://github.com/janole/code-bandit?#readme",
"repository": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"ok": "npm run lint:fix && npm run typecheck",
"prebuild": "npm run genversion && patch-package && npm run ok",
"prebuild": "npm run genversion && npm run ok",
"build": "rimraf dist && tsc -p tsconfig.dts.json && node esbuild.js",
"genversion": "COMMIT_HASH=$(git rev-parse --short HEAD) && echo \"export const VERSION = \\\"${npm_package_version}\\\";\\nexport const COMMIT_HASH = \\\"${COMMIT_HASH}\\\";\" > src/.version.ts",
"prepack": "npm run build"
Expand All @@ -57,20 +57,20 @@
"LICENSE"
],
"dependencies": {
"@langchain/anthropic": "^0.3.24",
"@langchain/core": "^0.3.62",
"@langchain/google-genai": "^0.2.14",
"@langchain/groq": "^0.2.3",
"@langchain/ollama": "^0.2.3",
"@langchain/openai": "^0.6.2",
"@langchain/anthropic": "^1.3.21",
"@langchain/core": "^1.1.29",
"@langchain/google-genai": "^2.1.22",
"@langchain/groq": "^1.1.3",
"@langchain/ollama": "^1.2.5",
"@langchain/openai": "^1.2.11",
"chalk": "^5.4.1",
"clipboardy": "^4.0.0",
"commander": "^14.0.0",
"execa": "^9.6.0",
"fast-glob": "^3.3.3",
"globby": "^14.1.0",
"ink": "^6.0.1",
"langchain": "^0.3.29",
"langchain": "^1.2.28",
"marked": "^15.0.12",
"marked-terminal": "^7.3.0",
"react": "^19.1.0",
Expand All @@ -97,7 +97,6 @@
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^61.0.1",
"globals": "^16.3.0",
"patch-package": "^8.0.0",
"rimraf": "^6.0.1",
"typescript": "^5.8.3"
}
Expand Down
24 changes: 0 additions & 24 deletions patches/@langchain+ollama+0.2.4.patch

This file was deleted.

5 changes: 3 additions & 2 deletions src/ai/tools/clipboard-tools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import clipboard from "clipboardy";
import { z } from "zod";

import { TTools } from "./types.js";
import { createTool } from "./utils.js";

/**
Expand Down Expand Up @@ -29,9 +30,9 @@ const _tools = [
}),
];

function getTools()
function getTools(): TTools
{
return _tools.reduce((tools, t) => ({ ...tools, [t.name]: t }), {});
return _tools.reduce<TTools>((tools, t) => ({ ...tools, [t.name]: t }), {});
}

export { getTools };
5 changes: 3 additions & 2 deletions src/ai/tools/git-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { execa } from "execa";
import { z } from "zod";

import tryCatch from "../../utils/try-catch.js";
import { TTools } from "./types.js";
import { createTool, formatEmptyToolOutput } from "./utils.js";

async function execGit(args: string[] = [], options: { cwd?: string; timeout?: number; } = {}): Promise<string | null>
Expand Down Expand Up @@ -75,11 +76,11 @@ const _tools = [
}),
];

function getTools(props: { includeDestructiveTools?: boolean })
function getTools(props: { includeDestructiveTools?: boolean }): TTools
{
return _tools
.filter(t => props.includeDestructiveTools || !t.metadata?.["destructive"])
.reduce((tools, t) => ({ ...tools, [t.name]: t }), {});
.reduce<TTools>((tools, t) => ({ ...tools, [t.name]: t }), {});
}

export
Expand Down
5 changes: 3 additions & 2 deletions src/ai/tools/npm-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { execa } from "execa";
import { z } from "zod";

import tryCatch from "../../utils/try-catch.js";
import { TTools } from "./types.js";
import { createTool, resolveWithinWorkDir } from "./utils.js";

async function runNpm(args: string[] = [], config?: RunnableConfig, opts: { timeout?: number } = {}): Promise<string>
Expand Down Expand Up @@ -211,11 +212,11 @@ const _tools = [
}),
];

function getTools(props: { includeDestructiveTools?: boolean })
function getTools(props: { includeDestructiveTools?: boolean }): TTools
{
return _tools
.filter(t => props.includeDestructiveTools || !t.metadata?.["destructive"])
.reduce((tools, t) => ({ ...tools, [t.name]: t }), {} as Record<string, ReturnType<typeof createTool>>);
.reduce((tools, t) => ({ ...tools, [t.name]: t }), {});
}

export { getTools };
2 changes: 1 addition & 1 deletion src/ai/tools/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DynamicStructuredTool } from "langchain/tools";
import { DynamicStructuredTool } from "@langchain/core/tools";

import { IChatSession } from "../session/session.js";

Expand Down
4 changes: 2 additions & 2 deletions src/ai/tools/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RunnableConfig } from "@langchain/core/runnables";
import { tool } from "@langchain/core/tools";
import { DynamicStructuredTool, tool } from "@langchain/core/tools";
import { realpathSync } from "fs";
import path from "path";

Expand Down Expand Up @@ -32,7 +32,7 @@ export function funcName(f: Function): string
}

/** create tool and automatically infer tool name from function */
export function createTool(f: (p: any, config: RunnableConfig) => unknown, fields: Omit<Parameters<typeof tool>[1], "name">)
export function createTool(f: (p: any, config: RunnableConfig) => unknown, fields: Omit<Parameters<typeof tool>[1], "name">): DynamicStructuredTool
{
return tool(f, { ...fields, name: funcName(f) });
}
Expand Down