@rama_nigg/open-cursor 2.4.0 → 2.4.2
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/dist/cli/opencode-cursor.js +22 -1
- package/dist/index.js +9 -1
- package/dist/plugin-entry.js +9 -1
- package/package.json +2 -2
- package/src/cli/opencode-cursor.ts +22 -1
- package/src/tools/defaults.ts +15 -1
|
@@ -377,6 +377,7 @@ import {
|
|
|
377
377
|
existsSync as existsSync2,
|
|
378
378
|
lstatSync,
|
|
379
379
|
mkdirSync as mkdirSync2,
|
|
380
|
+
realpathSync,
|
|
380
381
|
readFileSync,
|
|
381
382
|
rmSync,
|
|
382
383
|
symlinkSync,
|
|
@@ -1634,13 +1635,33 @@ function main() {
|
|
|
1634
1635
|
process.exit(1);
|
|
1635
1636
|
}
|
|
1636
1637
|
}
|
|
1637
|
-
|
|
1638
|
+
function resolveEntrypointArg(argvPath) {
|
|
1639
|
+
if (!argvPath)
|
|
1640
|
+
return "";
|
|
1641
|
+
return resolve(argvPath);
|
|
1642
|
+
}
|
|
1643
|
+
function toRealPath(path2) {
|
|
1644
|
+
try {
|
|
1645
|
+
return realpathSync(path2);
|
|
1646
|
+
} catch {
|
|
1647
|
+
return path2;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
function isCliEntrypoint(metaUrl, argvPath) {
|
|
1651
|
+
const currentPath = fileURLToPath(metaUrl);
|
|
1652
|
+
const argvResolved = resolveEntrypointArg(argvPath);
|
|
1653
|
+
if (!argvResolved)
|
|
1654
|
+
return false;
|
|
1655
|
+
return currentPath === argvResolved || toRealPath(currentPath) === toRealPath(argvResolved);
|
|
1656
|
+
}
|
|
1657
|
+
if (isCliEntrypoint(import.meta.url, process.argv[1])) {
|
|
1638
1658
|
main();
|
|
1639
1659
|
}
|
|
1640
1660
|
export {
|
|
1641
1661
|
summarizeModelSync,
|
|
1642
1662
|
runDoctorChecks,
|
|
1643
1663
|
runDeepDoctorChecks,
|
|
1664
|
+
isCliEntrypoint,
|
|
1644
1665
|
getStatusResult,
|
|
1645
1666
|
getBrandingHeader,
|
|
1646
1667
|
explainCursorModels,
|
package/dist/index.js
CHANGED
|
@@ -13583,7 +13583,7 @@ function registerDefaultTools(registry) {
|
|
|
13583
13583
|
const cwd = resolveWorkingDirectory(args);
|
|
13584
13584
|
return new Promise((resolve2, reject) => {
|
|
13585
13585
|
const proc = spawn3(command, {
|
|
13586
|
-
shell:
|
|
13586
|
+
shell: resolveShellOption(),
|
|
13587
13587
|
cwd
|
|
13588
13588
|
});
|
|
13589
13589
|
const stdoutChunks = [];
|
|
@@ -14098,6 +14098,14 @@ function resolveTimeoutMs(value) {
|
|
|
14098
14098
|
return 30000;
|
|
14099
14099
|
return raw <= 600 ? raw * 1000 : raw;
|
|
14100
14100
|
}
|
|
14101
|
+
function resolveShellOption(deps = {}) {
|
|
14102
|
+
const platform2 = deps.platform ?? process.platform;
|
|
14103
|
+
const env = deps.env ?? process.env;
|
|
14104
|
+
if (platform2 === "win32") {
|
|
14105
|
+
return env.ComSpec || env.COMSPEC || true;
|
|
14106
|
+
}
|
|
14107
|
+
return env.SHELL || "/bin/bash";
|
|
14108
|
+
}
|
|
14101
14109
|
function resolveBoolean(value, defaultValue) {
|
|
14102
14110
|
if (typeof value === "boolean") {
|
|
14103
14111
|
return value;
|
package/dist/plugin-entry.js
CHANGED
|
@@ -13583,7 +13583,7 @@ function registerDefaultTools(registry) {
|
|
|
13583
13583
|
const cwd = resolveWorkingDirectory(args);
|
|
13584
13584
|
return new Promise((resolve2, reject) => {
|
|
13585
13585
|
const proc = spawn3(command, {
|
|
13586
|
-
shell:
|
|
13586
|
+
shell: resolveShellOption(),
|
|
13587
13587
|
cwd
|
|
13588
13588
|
});
|
|
13589
13589
|
const stdoutChunks = [];
|
|
@@ -14098,6 +14098,14 @@ function resolveTimeoutMs(value) {
|
|
|
14098
14098
|
return 30000;
|
|
14099
14099
|
return raw <= 600 ? raw * 1000 : raw;
|
|
14100
14100
|
}
|
|
14101
|
+
function resolveShellOption(deps = {}) {
|
|
14102
|
+
const platform2 = deps.platform ?? process.platform;
|
|
14103
|
+
const env = deps.env ?? process.env;
|
|
14104
|
+
if (platform2 === "win32") {
|
|
14105
|
+
return env.ComSpec || env.COMSPEC || true;
|
|
14106
|
+
}
|
|
14107
|
+
return env.SHELL || "/bin/bash";
|
|
14108
|
+
}
|
|
14101
14109
|
function resolveBoolean(value, defaultValue) {
|
|
14102
14110
|
if (typeof value === "boolean") {
|
|
14103
14111
|
return value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rama_nigg/open-cursor",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "No prompt limits. No broken streams. Full thinking + tool support. Your Cursor subscription, properly integrated.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin-entry.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "bun test",
|
|
12
12
|
"test:unit": "bun test tests/unit",
|
|
13
13
|
"test:integration": "bun test tests/integration",
|
|
14
|
-
"test:ci:unit": "bun test tests/tools/defaults.test.ts tests/tools/executor-chain.test.ts tests/tools/sdk-executor.test.ts tests/tools/mcp-executor.test.ts tests/tools/skills.test.ts tests/tools/registry.test.ts tests/unit/cli/model-discovery.test.ts tests/unit/proxy/prompt-builder.test.ts tests/unit/proxy/tool-loop.test.ts tests/unit/provider-boundary.test.ts tests/unit/provider-runtime-interception.test.ts tests/unit/provider-tool-schema-compat.test.ts tests/unit/provider-tool-loop-guard.test.ts tests/unit/plugin.test.ts tests/unit/plugin-tools-hook.test.ts tests/unit/plugin-tool-resolution.test.ts tests/unit/plugin-config.test.ts tests/unit/plugin-stream-extraction.test.ts tests/unit/auth.test.ts tests/unit/streaming/line-buffer.test.ts tests/unit/streaming/parser.test.ts tests/unit/streaming/types.test.ts tests/unit/streaming/delta-tracker.test.ts tests/unit/streaming/openai-sse.test.ts tests/unit/streaming/ai-sdk-parts.test.ts tests/competitive/edge.test.ts",
|
|
14
|
+
"test:ci:unit": "bun test tests/tools/defaults.test.ts tests/tools/executor-chain.test.ts tests/tools/sdk-executor.test.ts tests/tools/mcp-executor.test.ts tests/tools/skills.test.ts tests/tools/registry.test.ts tests/unit/cli/opencode-cursor.test.ts tests/unit/cli/model-discovery.test.ts tests/unit/proxy/prompt-builder.test.ts tests/unit/proxy/tool-loop.test.ts tests/unit/provider-boundary.test.ts tests/unit/provider-runtime-interception.test.ts tests/unit/provider-tool-schema-compat.test.ts tests/unit/provider-tool-loop-guard.test.ts tests/unit/plugin.test.ts tests/unit/plugin-tools-hook.test.ts tests/unit/plugin-tool-resolution.test.ts tests/unit/plugin-config.test.ts tests/unit/plugin-stream-extraction.test.ts tests/unit/auth.test.ts tests/unit/streaming/line-buffer.test.ts tests/unit/streaming/parser.test.ts tests/unit/streaming/types.test.ts tests/unit/streaming/delta-tracker.test.ts tests/unit/streaming/openai-sse.test.ts tests/unit/streaming/ai-sdk-parts.test.ts tests/competitive/edge.test.ts",
|
|
15
15
|
"test:ci:integration": "bun test tests/integration/comprehensive.test.ts tests/integration/tools-router.integration.test.ts tests/integration/stream-router.integration.test.ts tests/integration/opencode-loop.integration.test.ts",
|
|
16
16
|
"check:pricing": "bun run scripts/check-cursor-pricing-coverage.ts",
|
|
17
17
|
"check:pricing:fixture": "bun run scripts/check-cursor-pricing-coverage.ts --models-file tests/fixtures/cursor-pricing-models.txt --skip-doc-fetch",
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
existsSync,
|
|
7
7
|
lstatSync,
|
|
8
8
|
mkdirSync,
|
|
9
|
+
realpathSync,
|
|
9
10
|
readFileSync,
|
|
10
11
|
rmSync,
|
|
11
12
|
symlinkSync,
|
|
@@ -1035,6 +1036,26 @@ function main() {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
}
|
|
1037
1038
|
|
|
1038
|
-
|
|
1039
|
+
function resolveEntrypointArg(argvPath: string | undefined): string {
|
|
1040
|
+
if (!argvPath) return "";
|
|
1041
|
+
return resolve(argvPath);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
function toRealPath(path: string): string {
|
|
1045
|
+
try {
|
|
1046
|
+
return realpathSync(path);
|
|
1047
|
+
} catch {
|
|
1048
|
+
return path;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
export function isCliEntrypoint(metaUrl: string, argvPath: string | undefined): boolean {
|
|
1053
|
+
const currentPath = fileURLToPath(metaUrl);
|
|
1054
|
+
const argvResolved = resolveEntrypointArg(argvPath);
|
|
1055
|
+
if (!argvResolved) return false;
|
|
1056
|
+
return currentPath === argvResolved || toRealPath(currentPath) === toRealPath(argvResolved);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
if (process.env.NODE_ENV !== "test" && isCliEntrypoint(import.meta.url, process.argv[1])) {
|
|
1039
1060
|
main();
|
|
1040
1061
|
}
|
package/src/tools/defaults.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function registerDefaultTools(registry: ToolRegistry): void {
|
|
|
41
41
|
|
|
42
42
|
return new Promise<string>((resolve, reject) => {
|
|
43
43
|
const proc = spawn(command, {
|
|
44
|
-
shell:
|
|
44
|
+
shell: resolveShellOption(),
|
|
45
45
|
cwd,
|
|
46
46
|
});
|
|
47
47
|
|
|
@@ -640,6 +640,20 @@ function resolveTimeoutMs(value: unknown): number {
|
|
|
640
640
|
return raw <= 600 ? raw * 1000 : raw;
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
+
export function resolveShellOption(deps: {
|
|
644
|
+
platform?: NodeJS.Platform;
|
|
645
|
+
env?: Record<string, string | undefined>;
|
|
646
|
+
} = {}): string | boolean {
|
|
647
|
+
const platform = deps.platform ?? process.platform;
|
|
648
|
+
const env = deps.env ?? process.env;
|
|
649
|
+
|
|
650
|
+
if (platform === "win32") {
|
|
651
|
+
return env.ComSpec || env.COMSPEC || true;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return env.SHELL || "/bin/bash";
|
|
655
|
+
}
|
|
656
|
+
|
|
643
657
|
function resolveBoolean(value: unknown, defaultValue: boolean): boolean {
|
|
644
658
|
if (typeof value === "boolean") {
|
|
645
659
|
return value;
|