@code-yeongyu/lazycodex 0.1.1 → 0.1.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/bin/oh-my-opencode.js +2 -1
- package/bin/oh-my-opencode.test.ts +27 -2
- package/bin/platform.d.ts +2 -0
- package/bin/platform.js +6 -1
- package/bin/platform.test.ts +25 -0
- package/dist/cli/index.js +4 -4
- package/dist/index.js +224 -224
- package/package.json +3 -3
- package/packages/ast-grep-mcp/dist/cli.js +5 -5
package/bin/oh-my-opencode.js
CHANGED
|
@@ -10,6 +10,7 @@ import { fileURLToPath } from "node:url";
|
|
|
10
10
|
import {
|
|
11
11
|
getPlatformPackageCandidates,
|
|
12
12
|
getBinaryPath,
|
|
13
|
+
getPackageBareName,
|
|
13
14
|
resolvePlatformPackageBaseName,
|
|
14
15
|
} from "./platform.js";
|
|
15
16
|
|
|
@@ -108,7 +109,7 @@ function getInvocationName() {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
function shouldRunBundledLazyCodexCli(packageName, invocationName) {
|
|
111
|
-
return packageName === "lazycodex" && invocationName === "lazycodex";
|
|
112
|
+
return getPackageBareName(packageName) === "lazycodex" && invocationName === "lazycodex";
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
function runBundledLazyCodexCli(invocationName) {
|
|
@@ -36,9 +36,34 @@ describe("lazycodex bin wrapper", () => {
|
|
|
36
36
|
"--no-tui",
|
|
37
37
|
]);
|
|
38
38
|
});
|
|
39
|
+
|
|
40
|
+
test("runs the bundled Bun CLI when published under an npm scope", async () => {
|
|
41
|
+
// #given
|
|
42
|
+
const fixture = await createLazyCodexFixture({ packageName: "@code-yeongyu/lazycodex" });
|
|
43
|
+
const nodePath = Bun.which("node") ?? "node";
|
|
44
|
+
|
|
45
|
+
// #when
|
|
46
|
+
const result = spawnSync(nodePath, [fixture.lazycodexBin, "install", "--no-tui"], {
|
|
47
|
+
encoding: "utf8",
|
|
48
|
+
env: {
|
|
49
|
+
...process.env,
|
|
50
|
+
CAPTURE_DIR: fixture.captureDir,
|
|
51
|
+
PATH: `${fixture.fakeBinDir}:${process.env.PATH ?? ""}`,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// #then
|
|
56
|
+
expect(result.status).toBe(23);
|
|
57
|
+
expect((await readFile(join(fixture.captureDir, "env"), "utf8")).trim()).toBe("lazycodex");
|
|
58
|
+
expect((await readFile(join(fixture.captureDir, "args"), "utf8")).trim().split("\n")).toEqual([
|
|
59
|
+
await realpath(fixture.bundledCli),
|
|
60
|
+
"install",
|
|
61
|
+
"--no-tui",
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
39
64
|
});
|
|
40
65
|
|
|
41
|
-
async function createLazyCodexFixture() {
|
|
66
|
+
async function createLazyCodexFixture(options: { packageName?: string } = {}) {
|
|
42
67
|
const root = await mkdtemp(join(tmpdir(), "lazycodex-bin-wrapper-"));
|
|
43
68
|
testRoots.push(root);
|
|
44
69
|
|
|
@@ -53,7 +78,7 @@ async function createLazyCodexFixture() {
|
|
|
53
78
|
|
|
54
79
|
await cp(fileURLToPath(new URL("./oh-my-opencode.js", import.meta.url)), join(binDir, "lazycodex"));
|
|
55
80
|
await cp(fileURLToPath(new URL("./platform.js", import.meta.url)), join(binDir, "platform.js"));
|
|
56
|
-
await writeFile(join(root, "package.json"), JSON.stringify({ name: "lazycodex", type: "module" }));
|
|
81
|
+
await writeFile(join(root, "package.json"), JSON.stringify({ name: options.packageName ?? "lazycodex", type: "module" }));
|
|
57
82
|
await writeFile(distCli, "#!/usr/bin/env bun\n");
|
|
58
83
|
|
|
59
84
|
const fakeBun = join(fakeBinDir, "bun");
|
package/bin/platform.d.ts
CHANGED
|
@@ -15,4 +15,6 @@ export declare function getPlatformPackageCandidates(options: {
|
|
|
15
15
|
|
|
16
16
|
export declare function getBinaryPath(pkg: string, platform: string): string;
|
|
17
17
|
|
|
18
|
+
export declare function getPackageBareName(packageName: string): string;
|
|
19
|
+
|
|
18
20
|
export declare function resolvePlatformPackageBaseName(wrapperPackageName: string): string;
|
package/bin/platform.js
CHANGED
|
@@ -5,6 +5,10 @@ const PLATFORM_PACKAGE_BASE_BY_WRAPPER_NAME = {
|
|
|
5
5
|
lazycodex: "oh-my-opencode",
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
export function getPackageBareName(packageName) {
|
|
9
|
+
return packageName.split("/").pop() || packageName;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* Resolve platform package base from a wrapper package name.
|
|
10
14
|
* Wrapper aliases can intentionally reuse an existing platform package family.
|
|
@@ -12,7 +16,8 @@ const PLATFORM_PACKAGE_BASE_BY_WRAPPER_NAME = {
|
|
|
12
16
|
* @returns {string}
|
|
13
17
|
*/
|
|
14
18
|
export function resolvePlatformPackageBaseName(wrapperPackageName) {
|
|
15
|
-
|
|
19
|
+
const bareName = getPackageBareName(wrapperPackageName);
|
|
20
|
+
return PLATFORM_PACKAGE_BASE_BY_WRAPPER_NAME[bareName] ?? wrapperPackageName;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
/**
|
package/bin/platform.test.ts
CHANGED
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
import { describe, expect, test } from "bun:test";
|
|
3
3
|
import {
|
|
4
4
|
getBinaryPath,
|
|
5
|
+
getPackageBareName,
|
|
5
6
|
getPlatformPackage,
|
|
6
7
|
getPlatformPackageCandidates,
|
|
7
8
|
resolvePlatformPackageBaseName,
|
|
8
9
|
} from "./platform.js";
|
|
9
10
|
|
|
11
|
+
describe("getPackageBareName", () => {
|
|
12
|
+
test("strips npm scope from package name", () => {
|
|
13
|
+
// #given
|
|
14
|
+
const packageName = "@code-yeongyu/lazycodex";
|
|
15
|
+
|
|
16
|
+
// #when
|
|
17
|
+
const bareName = getPackageBareName(packageName);
|
|
18
|
+
|
|
19
|
+
// #then
|
|
20
|
+
expect(bareName).toBe("lazycodex");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
10
24
|
describe("resolvePlatformPackageBaseName", () => {
|
|
11
25
|
test("maps lazycodex wrapper to oh-my-opencode platform package family", () => {
|
|
12
26
|
// #given
|
|
@@ -19,6 +33,17 @@ describe("resolvePlatformPackageBaseName", () => {
|
|
|
19
33
|
expect(resolvedPlatformBase).toBe("oh-my-opencode");
|
|
20
34
|
});
|
|
21
35
|
|
|
36
|
+
test("maps scoped lazycodex wrapper to oh-my-opencode platform package family", () => {
|
|
37
|
+
// #given
|
|
38
|
+
const wrapperPackageName = "@code-yeongyu/lazycodex";
|
|
39
|
+
|
|
40
|
+
// #when
|
|
41
|
+
const resolvedPlatformBase = resolvePlatformPackageBaseName(wrapperPackageName);
|
|
42
|
+
|
|
43
|
+
// #then
|
|
44
|
+
expect(resolvedPlatformBase).toBe("oh-my-opencode");
|
|
45
|
+
});
|
|
46
|
+
|
|
22
47
|
test("keeps oh-my-opencode wrapper mapped to oh-my-opencode platform package family", () => {
|
|
23
48
|
// #given
|
|
24
49
|
const wrapperPackageName = "oh-my-opencode";
|
package/dist/cli/index.js
CHANGED
|
@@ -61225,8 +61225,8 @@ var {
|
|
|
61225
61225
|
} = import__.default;
|
|
61226
61226
|
// package.json
|
|
61227
61227
|
var package_default = {
|
|
61228
|
-
name: "lazycodex",
|
|
61229
|
-
version: "0.1.
|
|
61228
|
+
name: "@code-yeongyu/lazycodex",
|
|
61229
|
+
version: "0.1.2",
|
|
61230
61230
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
61231
61231
|
main: "./dist/index.js",
|
|
61232
61232
|
types: "dist/index.d.ts",
|
|
@@ -61336,9 +61336,9 @@ var package_default = {
|
|
|
61336
61336
|
"vscode-jsonrpc": "^8.2.1"
|
|
61337
61337
|
},
|
|
61338
61338
|
devDependencies: {
|
|
61339
|
+
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
61339
61340
|
"@oh-my-opencode/ast-grep-core": "workspace:*",
|
|
61340
61341
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
61341
|
-
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
61342
61342
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
61343
61343
|
"@oh-my-opencode/comment-checker-core": "workspace:*",
|
|
61344
61344
|
"@oh-my-opencode/hashline-core": "workspace:*",
|
|
@@ -61348,9 +61348,9 @@ var package_default = {
|
|
|
61348
61348
|
"@oh-my-opencode/rules-engine": "workspace:*",
|
|
61349
61349
|
"@oh-my-opencode/shared-skills": "workspace:*",
|
|
61350
61350
|
"@oh-my-opencode/utils": "workspace:*",
|
|
61351
|
-
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
61352
61351
|
"@types/js-yaml": "^4.0.9",
|
|
61353
61352
|
"@types/picomatch": "^4.0.3",
|
|
61353
|
+
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
61354
61354
|
"bun-types": "1.3.14",
|
|
61355
61355
|
typescript: "^6.0.3",
|
|
61356
61356
|
zod: "^4.4.3"
|