@qoder-ai/qodercli 1.1.82 → 1.1.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/codemode-worker.mjs +1 -0
- package/bundle/qoder-worker-runtime.mjs +2 -2
- package/bundle/qodercli.js +2 -2
- package/package.json +7 -7
- package/postinstall.cjs +172 -142
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bundle/qoder-worker-runtime.mjs
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 35360683 bytes
|
|
4
|
+
sha256: 896c88b57b35bb4e406b14eea870d8d2f067ac5066dedba0e81f14f9eba25492
|
package/bundle/qodercli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bundle/qodercli.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 35146350 bytes
|
|
4
|
+
sha256: 4269479aa05c991fb8bd365bc0e0238bf39faf501036d60e57e6e7e2260bc163
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qoder-ai/qodercli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.84",
|
|
4
4
|
"description": "Qoder AI CLI - AI-powered coding assistant",
|
|
5
5
|
"author": "Qoder AI",
|
|
6
6
|
"type": "module",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"sharp": "^0.34.5"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@qoder-ai/qodercli-ripgrep-darwin-arm64": "1.1.
|
|
24
|
-
"@qoder-ai/qodercli-ripgrep-darwin-x64": "1.1.
|
|
25
|
-
"@qoder-ai/qodercli-ripgrep-linux-arm64": "1.1.
|
|
26
|
-
"@qoder-ai/qodercli-ripgrep-linux-x64": "1.1.
|
|
27
|
-
"@qoder-ai/qodercli-ripgrep-win32-arm64": "1.1.
|
|
28
|
-
"@qoder-ai/qodercli-ripgrep-win32-x64": "1.1.
|
|
23
|
+
"@qoder-ai/qodercli-ripgrep-darwin-arm64": "1.1.84",
|
|
24
|
+
"@qoder-ai/qodercli-ripgrep-darwin-x64": "1.1.84",
|
|
25
|
+
"@qoder-ai/qodercli-ripgrep-linux-arm64": "1.1.84",
|
|
26
|
+
"@qoder-ai/qodercli-ripgrep-linux-x64": "1.1.84",
|
|
27
|
+
"@qoder-ai/qodercli-ripgrep-win32-arm64": "1.1.84",
|
|
28
|
+
"@qoder-ai/qodercli-ripgrep-win32-x64": "1.1.84"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=20.0.0"
|
package/postinstall.cjs
CHANGED
|
@@ -1,215 +1,245 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
|
|
24
|
+
// packages/cli/src/installation/install/windowsRegistryPath.ts
|
|
25
|
+
var windowsRegistryPath_exports = {};
|
|
26
|
+
__export(windowsRegistryPath_exports, {
|
|
27
|
+
readWindowsRegistryPath: () => readWindowsRegistryPath
|
|
28
|
+
});
|
|
29
|
+
function readWindowsRegistryPath(runReg) {
|
|
30
|
+
const directory = (0, import_node_fs.mkdtempSync)((0, import_node_path.join)((0, import_node_os.tmpdir)(), "qoder-registry-path-"));
|
|
31
|
+
try {
|
|
32
|
+
const file = (0, import_node_path.join)(directory, "environment.reg");
|
|
33
|
+
runReg(["export", "HKCU\\Environment", file, "/y"]);
|
|
34
|
+
return parseRegistryPathExport((0, import_node_fs.readFileSync)(file));
|
|
35
|
+
} finally {
|
|
36
|
+
(0, import_node_fs.rmSync)(directory, { recursive: true, force: true });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function parseRegistryPathExport(bytes) {
|
|
40
|
+
if (bytes.length % 2 !== 0 || bytes[0] !== 255 || bytes[1] !== 254) {
|
|
41
|
+
throw new Error("Registry export is not BOM-marked UTF-16LE");
|
|
42
|
+
}
|
|
43
|
+
const text = new TextDecoder("utf-16le", { fatal: true }).decode(bytes);
|
|
44
|
+
if (!text.startsWith("Windows Registry Editor Version 5.00\r\n") || !text.endsWith("\r\n\r\n")) {
|
|
45
|
+
throw new Error("Unexpected registry export header");
|
|
46
|
+
}
|
|
47
|
+
const lines = text.replace(/\\\r?\n[ \t]*/g, "").split(/\r?\n/);
|
|
48
|
+
let inEnvironment = false;
|
|
49
|
+
let foundEnvironment = false;
|
|
50
|
+
let entry = null;
|
|
51
|
+
for (const line of lines) {
|
|
52
|
+
if (line.startsWith("[")) {
|
|
53
|
+
inEnvironment = /^\[HKEY_CURRENT_USER\\Environment\]$/i.test(line);
|
|
54
|
+
foundEnvironment ||= inEnvironment;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!inEnvironment || !/^"Path"/i.test(line)) continue;
|
|
58
|
+
if (!/^"Path"=/i.test(line)) {
|
|
59
|
+
throw new Error("Malformed PATH entry in registry export");
|
|
60
|
+
}
|
|
61
|
+
if (entry !== null) throw new Error("Duplicate PATH in registry export");
|
|
62
|
+
const data = line.slice('"Path"='.length);
|
|
63
|
+
if (data.startsWith('"')) {
|
|
64
|
+
const value2 = JSON.parse(data);
|
|
65
|
+
if (typeof value2 !== "string" || value2.includes("\0")) {
|
|
66
|
+
throw new Error("Invalid registry PATH string");
|
|
67
|
+
}
|
|
68
|
+
entry = { value: value2, type: "REG_SZ" };
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const hex = /^hex\(([12])\):((?:[0-9a-f]{2},)*[0-9a-f]{2})$/i.exec(data);
|
|
72
|
+
if (!hex) throw new Error("Unsupported or malformed registry PATH value");
|
|
73
|
+
const valueBytes = Buffer.from(hex[2].replace(/,/g, ""), "hex");
|
|
74
|
+
if (valueBytes.length < 2 || valueBytes.length % 2 !== 0 || valueBytes.readUInt16LE(valueBytes.length - 2) !== 0) {
|
|
75
|
+
throw new Error("Invalid registry PATH string terminator");
|
|
76
|
+
}
|
|
77
|
+
const value = new TextDecoder("utf-16le", {
|
|
78
|
+
fatal: true,
|
|
79
|
+
ignoreBOM: true
|
|
80
|
+
}).decode(valueBytes.subarray(0, -2));
|
|
81
|
+
if (value.includes("\0")) throw new Error("Invalid registry PATH string");
|
|
82
|
+
entry = { value, type: hex[1] === "2" ? "REG_EXPAND_SZ" : "REG_SZ" };
|
|
83
|
+
}
|
|
84
|
+
if (!foundEnvironment) throw new Error("Registry export omitted Environment");
|
|
85
|
+
return entry;
|
|
86
|
+
}
|
|
87
|
+
var import_node_fs, import_node_os, import_node_path;
|
|
88
|
+
var init_windowsRegistryPath = __esm({
|
|
89
|
+
"packages/cli/src/installation/install/windowsRegistryPath.ts"() {
|
|
90
|
+
"use strict";
|
|
91
|
+
import_node_fs = require("node:fs");
|
|
92
|
+
import_node_os = require("node:os");
|
|
93
|
+
import_node_path = require("node:path");
|
|
94
|
+
}
|
|
95
|
+
});
|
|
25
96
|
|
|
97
|
+
// scripts/postinstall-npm-bundle.cjs
|
|
26
98
|
try {
|
|
27
99
|
warnIfRipgrepUnavailable();
|
|
28
100
|
} catch {
|
|
29
|
-
// Silent — never break npm install
|
|
30
101
|
}
|
|
31
|
-
|
|
32
|
-
// --- Windows PATH registration ---
|
|
33
|
-
if (process.platform === 'win32') {
|
|
102
|
+
if (process.platform === "win32") {
|
|
34
103
|
try {
|
|
35
104
|
ensureNpmBinOnPath();
|
|
36
105
|
} catch {
|
|
37
|
-
// Silent — never break npm install
|
|
38
106
|
}
|
|
39
107
|
}
|
|
40
|
-
|
|
41
|
-
// --- Dispatcher + PATH configuration (all platforms) ---
|
|
42
|
-
// `qoder` should resolve to the entry-point dispatcher rather than the npm
|
|
43
|
-
// shim so multi-channel users (npm + IDE) get consistent routing. We invoke
|
|
44
|
-
// the freshly-installed CLI's hidden `configure-path` subcommand which
|
|
45
|
-
// writes `~/.qoder/entry/<brand>` and prepends the entry dir onto PATH.
|
|
46
|
-
//
|
|
47
|
-
// Brand-neutral: we read the CLI bin path from the package's own
|
|
48
|
-
// package.json `bin` field so the same script handles Global (qodercli) and
|
|
49
|
-
// CN (qoderclicn) without publish-time sed rendering.
|
|
50
108
|
try {
|
|
51
109
|
configurePathBestEffort();
|
|
52
110
|
} catch {
|
|
53
|
-
// Never break npm install
|
|
54
111
|
}
|
|
55
|
-
|
|
56
112
|
function configurePathBestEffort() {
|
|
57
|
-
const fs = require(
|
|
58
|
-
const path = require(
|
|
59
|
-
const { spawnSync } = require(
|
|
60
|
-
|
|
61
|
-
const pkgJsonPath = path.resolve(__dirname, 'package.json');
|
|
113
|
+
const fs = require("node:fs");
|
|
114
|
+
const path = require("node:path");
|
|
115
|
+
const { spawnSync } = require("node:child_process");
|
|
116
|
+
const pkgJsonPath = path.resolve(__dirname, "package.json");
|
|
62
117
|
if (!fs.existsSync(pkgJsonPath)) return;
|
|
63
|
-
|
|
64
|
-
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
118
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
65
119
|
const bins = pkgJson.bin || {};
|
|
66
|
-
const cliBinName = [
|
|
120
|
+
const cliBinName = ["qodercli", "qoderclicn"].find((name) => bins[name]);
|
|
67
121
|
if (!cliBinName) return;
|
|
68
|
-
|
|
69
122
|
const cliPath = path.resolve(__dirname, bins[cliBinName]);
|
|
70
123
|
if (!fs.existsSync(cliPath)) return;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// returns exit code 0, and its stdout banner is the user-facing signal.
|
|
75
|
-
spawnSync(process.execPath, [cliPath, 'configure-path'], {
|
|
76
|
-
stdio: 'inherit',
|
|
77
|
-
timeout: 30_000,
|
|
124
|
+
spawnSync(process.execPath, [cliPath, "configure-path"], {
|
|
125
|
+
stdio: "inherit",
|
|
126
|
+
timeout: 3e4
|
|
78
127
|
});
|
|
79
128
|
}
|
|
80
|
-
|
|
81
129
|
function warnIfRipgrepUnavailable() {
|
|
82
|
-
const { execFileSync } = require(
|
|
83
|
-
const { readFileSync } = require(
|
|
84
|
-
const path = require(
|
|
130
|
+
const { execFileSync } = require("node:child_process");
|
|
131
|
+
const { readFileSync: readFileSync2 } = require("node:fs");
|
|
132
|
+
const path = require("node:path");
|
|
85
133
|
const manifest = JSON.parse(
|
|
86
|
-
|
|
134
|
+
readFileSync2(path.join(__dirname, "package.json"), "utf8")
|
|
87
135
|
);
|
|
88
136
|
const packageSuffix = `-ripgrep-${process.platform}-${process.arch}`;
|
|
89
137
|
const ripgrepPackage = Object.keys(manifest.optionalDependencies || {}).find(
|
|
90
|
-
(packageName) => packageName.endsWith(packageSuffix)
|
|
138
|
+
(packageName) => packageName.endsWith(packageSuffix)
|
|
91
139
|
);
|
|
92
|
-
const binaryName = process.platform ===
|
|
93
|
-
|
|
140
|
+
const binaryName = process.platform === "win32" ? "rg.exe" : "rg";
|
|
94
141
|
if (ripgrepPackage) {
|
|
95
142
|
try {
|
|
96
143
|
require.resolve(`${ripgrepPackage}/bin/${binaryName}`, {
|
|
97
|
-
paths: [__dirname]
|
|
144
|
+
paths: [__dirname]
|
|
98
145
|
});
|
|
99
146
|
return;
|
|
100
147
|
} catch {
|
|
101
|
-
// The optional dependency may have been explicitly omitted.
|
|
102
148
|
}
|
|
103
149
|
}
|
|
104
|
-
|
|
105
150
|
try {
|
|
106
|
-
execFileSync(
|
|
107
|
-
stdio:
|
|
108
|
-
windowsHide: true
|
|
151
|
+
execFileSync("rg", ["--version"], {
|
|
152
|
+
stdio: "ignore",
|
|
153
|
+
windowsHide: true
|
|
109
154
|
});
|
|
110
155
|
return;
|
|
111
156
|
} catch {
|
|
112
|
-
// Fall through to an actionable, non-fatal warning.
|
|
113
157
|
}
|
|
114
|
-
|
|
115
158
|
console.log(
|
|
116
|
-
|
|
117
|
-
'\n Glob and Grep require ripgrep.\n',
|
|
159
|
+
"\n ripgrep is unavailable. Reinstall without --omit=optional, or install rg on PATH.\n Glob and Grep require ripgrep.\n"
|
|
118
160
|
);
|
|
119
161
|
}
|
|
120
|
-
|
|
121
162
|
function ensureNpmBinOnPath() {
|
|
122
|
-
const { execSync } = require(
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// (not in a /bin subfolder like Unix).
|
|
163
|
+
const { execFileSync, execSync } = require("node:child_process");
|
|
164
|
+
const {
|
|
165
|
+
readWindowsRegistryPath: readWindowsRegistryPath2
|
|
166
|
+
} = (init_windowsRegistryPath(), __toCommonJS(windowsRegistryPath_exports));
|
|
167
|
+
const path = require("node:path");
|
|
128
168
|
let npmBinDir;
|
|
129
169
|
if (process.env.npm_config_prefix) {
|
|
130
|
-
// npm sets this env var during lifecycle scripts
|
|
131
170
|
npmBinDir = process.env.npm_config_prefix;
|
|
132
171
|
} else {
|
|
133
|
-
// Fallback: ask npm directly
|
|
134
172
|
try {
|
|
135
|
-
npmBinDir = execSync(
|
|
136
|
-
encoding:
|
|
137
|
-
timeout:
|
|
173
|
+
npmBinDir = execSync("npm prefix -g", {
|
|
174
|
+
encoding: "utf-8",
|
|
175
|
+
timeout: 1e4
|
|
138
176
|
}).trim();
|
|
139
177
|
} catch {
|
|
140
|
-
return;
|
|
178
|
+
return;
|
|
141
179
|
}
|
|
142
180
|
}
|
|
143
|
-
|
|
144
181
|
if (!npmBinDir) return;
|
|
145
|
-
|
|
146
|
-
// Normalize path for consistent comparison
|
|
147
182
|
npmBinDir = path.normalize(npmBinDir);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
// HKEY_CURRENT_USER\Environment
|
|
158
|
-
// Path REG_EXPAND_SZ value
|
|
159
|
-
const match = output.match(/Path\s+REG_(?:EXPAND_SZ|SZ)\s+(.*)/i);
|
|
160
|
-
if (match) currentPath = match[1].trim();
|
|
161
|
-
} catch {
|
|
162
|
-
// Key might not exist — start fresh
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// 3. Check if already present (case-insensitive, normalized comparison)
|
|
166
|
-
const entries = currentPath
|
|
167
|
-
.split(';')
|
|
168
|
-
.map((p) => path.normalize(p.trim()).toLowerCase())
|
|
169
|
-
.filter((p) => p.length > 0);
|
|
170
|
-
|
|
183
|
+
const registry = readWindowsRegistryPath2(
|
|
184
|
+
(args) => execFileSync("reg.exe", args, {
|
|
185
|
+
timeout: 1e4,
|
|
186
|
+
windowsHide: true,
|
|
187
|
+
stdio: "ignore"
|
|
188
|
+
})
|
|
189
|
+
);
|
|
190
|
+
const currentPath = registry?.value ?? "";
|
|
191
|
+
const entries = currentPath.split(";").map((p) => path.normalize(p.trim()).toLowerCase()).filter((p) => p.length > 0);
|
|
171
192
|
if (entries.includes(npmBinDir.toLowerCase())) {
|
|
172
|
-
return;
|
|
193
|
+
return;
|
|
173
194
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
195
|
+
const newPath = currentPath ? currentPath + ";" + npmBinDir : npmBinDir;
|
|
196
|
+
execFileSync(
|
|
197
|
+
"reg.exe",
|
|
198
|
+
[
|
|
199
|
+
"add",
|
|
200
|
+
"HKCU\\Environment",
|
|
201
|
+
"/v",
|
|
202
|
+
"Path",
|
|
203
|
+
"/t",
|
|
204
|
+
registry?.type ?? "REG_EXPAND_SZ",
|
|
205
|
+
"/d",
|
|
206
|
+
newPath,
|
|
207
|
+
"/f"
|
|
208
|
+
],
|
|
209
|
+
{ timeout: 1e4, stdio: "ignore", windowsHide: true }
|
|
184
210
|
);
|
|
185
|
-
|
|
186
|
-
// 6. Broadcast WM_SETTINGCHANGE so new Explorer/shell windows pick up
|
|
187
|
-
// the change without requiring a reboot.
|
|
188
|
-
// Note: Already-open PowerShell/CMD windows will NOT refresh.
|
|
189
211
|
try {
|
|
190
212
|
const ps = [
|
|
191
213
|
"Add-Type -Namespace Win32 -Name NM -MemberDefinition '",
|
|
192
214
|
'[DllImport("user32.dll",SetLastError=true,CharSet=CharSet.Auto)]',
|
|
193
|
-
|
|
194
|
-
|
|
215
|
+
"public static extern IntPtr SendMessageTimeout(",
|
|
216
|
+
"IntPtr hWnd,uint Msg,UIntPtr wParam,string lParam,",
|
|
195
217
|
"uint fuFlags,uint uTimeout,out UIntPtr lpdwResult);';",
|
|
196
|
-
|
|
197
|
-
|
|
218
|
+
"$r=[UIntPtr]::Zero;",
|
|
219
|
+
"[Win32.NM]::SendMessageTimeout(",
|
|
198
220
|
'[IntPtr]0xFFFF,0x001A,[UIntPtr]::Zero,"Environment",',
|
|
199
|
-
|
|
200
|
-
].join(
|
|
221
|
+
"2,5000,[ref]$r)|Out-Null"
|
|
222
|
+
].join(" ");
|
|
201
223
|
execSync(`powershell -NoProfile -Command "${ps}"`, {
|
|
202
|
-
encoding:
|
|
203
|
-
timeout:
|
|
204
|
-
stdio:
|
|
224
|
+
encoding: "utf-8",
|
|
225
|
+
timeout: 15e3,
|
|
226
|
+
stdio: "ignore"
|
|
205
227
|
});
|
|
206
228
|
} catch {
|
|
207
|
-
// Non-fatal — PATH change is persisted in registry regardless
|
|
208
229
|
}
|
|
209
|
-
|
|
210
|
-
// 7. User-facing hint
|
|
211
230
|
console.log(
|
|
212
|
-
'\n \u2713 Added npm global bin directory to PATH
|
|
213
|
-
'\n Please restart your terminal to use "qodercli".\n',
|
|
231
|
+
'\n \u2713 Added npm global bin directory to PATH.\n Please restart your terminal to use "qodercli".\n'
|
|
214
232
|
);
|
|
215
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @license
|
|
236
|
+
* Copyright 2026 Google LLC
|
|
237
|
+
* Copyright 2026 Qwen Team
|
|
238
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
239
|
+
*/
|
|
240
|
+
/**
|
|
241
|
+
* @license
|
|
242
|
+
* Copyright 2025 Google LLC
|
|
243
|
+
* Copyright 2026 Qwen Team
|
|
244
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
245
|
+
*/
|