gemini-cli: 0.2.2 -> 0.3.4 (#440896)
This commit is contained in:
@@ -3,25 +3,33 @@
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
ripgrep,
|
||||
}:
|
||||
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "gemini-cli";
|
||||
version = "0.2.2";
|
||||
version = "0.3.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google-gemini";
|
||||
repo = "gemini-cli";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-ykNgtHtH+PPCycRn9j1lc8UIEHqYj54l0MTeVz6OhsQ=";
|
||||
hash = "sha256-nlDXWAfFmhRwfZ46knUeF5ar6huPFLJ5wSxcts4bjfM=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# FIXME: remove once https://github.com/google-gemini/gemini-cli/pull/5336 is merged
|
||||
# FIXME: PR is merged though package is failing without the patch
|
||||
./restore-missing-dependencies-fields.patch
|
||||
# removes @lvce-editor/ripgrep and make upstream code to use ripgrep from nixpkgs
|
||||
./replace-npm-s-ripgrep-with-local.patch
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-gpNt581BHDA12s+3nm95UOYHjoa7Nfe46vgPwFr7ZOU=";
|
||||
npmDepsHash = "sha256-q7E5YEMjHs9RvfT4ctzltqHr/+cCh3M+G6D2MkLiJFg=";
|
||||
|
||||
buildInputs = [
|
||||
ripgrep
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
mkdir -p packages/generated
|
||||
@@ -36,10 +44,12 @@ buildNpmPackage (finalAttrs: {
|
||||
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-core
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-a2a-server
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-test-utils
|
||||
rm -f $out/share/gemini-cli/node_modules/gemini-cli-vscode-ide-companion
|
||||
cp -r packages/cli $out/share/gemini-cli/node_modules/@google/gemini-cli
|
||||
cp -r packages/core $out/share/gemini-cli/node_modules/@google/gemini-cli-core
|
||||
cp -r packages/a2a-server $out/share/gemini-cli/node_modules/@google/gemini-cli-a2a-server
|
||||
|
||||
ln -s $out/share/gemini-cli/node_modules/@google/gemini-cli/dist/index.js $out/bin/gemini
|
||||
chmod +x "$out/bin/gemini"
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
From aee25e0140635d1d9c51b6b171c2a311c2061f1d Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Volkov <taranarmo@gmail.com>
|
||||
Date: Sun, 7 Sep 2025 13:12:02 +0200
|
||||
Subject: [PATCH] replace npm's ripgrep with local
|
||||
|
||||
---
|
||||
package-lock.json | 28 ----------------------------
|
||||
package.json | 1 -
|
||||
packages/core/package.json | 1 -
|
||||
packages/core/src/tools/ripGrep.ts | 4 ++--
|
||||
4 files changed, 2 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/package-lock.json b/package-lock.json
|
||||
index 7448c7e6..809cb322 100644
|
||||
--- a/package-lock.json
|
||||
+++ b/package-lock.json
|
||||
@@ -11,7 +11,6 @@
|
||||
"packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
- "@lvce-editor/ripgrep": "^1.6.0",
|
||||
"simple-git": "^3.28.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
@@ -1603,32 +1602,6 @@
|
||||
"integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
- "node_modules/@lvce-editor/ripgrep": {
|
||||
- "version": "1.6.0",
|
||||
- "resolved": "https://registry.npmjs.org/@lvce-editor/ripgrep/-/ripgrep-1.6.0.tgz",
|
||||
- "integrity": "sha512-880taWBVULNXmcPHXdxnFUI0FvLErBOjY9OigMXEsLZ2Q1rjcm6LixOkaccKWC8qFMpzm/ldkO7WOMK+ZRfk5Q==",
|
||||
- "hasInstallScript": true,
|
||||
- "license": "MIT",
|
||||
- "dependencies": {
|
||||
- "@lvce-editor/verror": "^1.6.0",
|
||||
- "execa": "^9.5.2",
|
||||
- "extract-zip": "^2.0.1",
|
||||
- "fs-extra": "^11.3.0",
|
||||
- "got": "^14.4.5",
|
||||
- "path-exists": "^5.0.0",
|
||||
- "tempy": "^3.1.0",
|
||||
- "xdg-basedir": "^5.1.0"
|
||||
- }
|
||||
- },
|
||||
- "node_modules/@lvce-editor/ripgrep/node_modules/path-exists": {
|
||||
- "version": "5.0.0",
|
||||
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
|
||||
- "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==",
|
||||
- "license": "MIT",
|
||||
- "engines": {
|
||||
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
- }
|
||||
- },
|
||||
"node_modules/@lvce-editor/verror": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@lvce-editor/verror/-/verror-1.7.0.tgz",
|
||||
@@ -14693,7 +14666,6 @@
|
||||
"version": "0.3.4",
|
||||
"dependencies": {
|
||||
"@google/genai": "1.13.0",
|
||||
- "@lvce-editor/ripgrep": "^1.6.0",
|
||||
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@opentelemetry/exporter-logs-otlp-grpc": "^0.203.0",
|
||||
diff --git a/package.json b/package.json
|
||||
index 232ee82c..7efc1072 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -92,7 +92,6 @@
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
- "@lvce-editor/ripgrep": "^1.6.0",
|
||||
"simple-git": "^3.28.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
diff --git a/packages/core/package.json b/packages/core/package.json
|
||||
index a8ef7a22..37fbd775 100644
|
||||
--- a/packages/core/package.json
|
||||
+++ b/packages/core/package.json
|
||||
@@ -21,7 +21,6 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@google/genai": "1.13.0",
|
||||
- "@lvce-editor/ripgrep": "^1.6.0",
|
||||
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@opentelemetry/exporter-logs-otlp-grpc": "^0.203.0",
|
||||
diff --git a/packages/core/src/tools/ripGrep.ts b/packages/core/src/tools/ripGrep.ts
|
||||
index b851c2cd..fa846a38 100644
|
||||
--- a/packages/core/src/tools/ripGrep.ts
|
||||
+++ b/packages/core/src/tools/ripGrep.ts
|
||||
@@ -8,7 +8,7 @@ import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { EOL } from 'node:os';
|
||||
import { spawn } from 'node:child_process';
|
||||
-import { rgPath } from '@lvce-editor/ripgrep';
|
||||
+
|
||||
import type { ToolInvocation, ToolResult } from './tools.js';
|
||||
import { BaseDeclarativeTool, BaseToolInvocation, Kind } from './tools.js';
|
||||
import { SchemaValidator } from '../utils/schemaValidator.js';
|
||||
@@ -293,7 +293,7 @@ class GrepToolInvocation extends BaseToolInvocation<
|
||||
|
||||
try {
|
||||
const output = await new Promise<string>((resolve, reject) => {
|
||||
- const child = spawn(rgPath, rgArgs, {
|
||||
+ const child = spawn('rg', rgArgs, {
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
--
|
||||
2.50.1
|
||||
|
||||
Reference in New Issue
Block a user