oh-my-opencode 3.0.0-beta.7 → 3.0.0-beta.8

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.
Files changed (36) hide show
  1. package/README.md +7 -5
  2. package/README.zh-cn.md +5 -0
  3. package/bin/oh-my-opencode.js +80 -0
  4. package/bin/platform.js +38 -0
  5. package/bin/platform.test.ts +148 -0
  6. package/dist/agents/sisyphus-junior.d.ts +1 -1
  7. package/dist/cli/config-manager.d.ts +9 -1
  8. package/dist/cli/index.js +172 -119
  9. package/dist/config/schema.d.ts +2 -0
  10. package/dist/features/background-agent/manager.d.ts +5 -0
  11. package/dist/features/hook-message-injector/index.d.ts +1 -1
  12. package/dist/features/opencode-skill-loader/skill-content.d.ts +10 -0
  13. package/dist/features/skill-mcp-manager/manager.d.ts +10 -0
  14. package/dist/features/task-toast-manager/index.d.ts +1 -1
  15. package/dist/features/task-toast-manager/manager.d.ts +2 -1
  16. package/dist/features/task-toast-manager/types.d.ts +5 -0
  17. package/dist/hooks/comment-checker/cli.d.ts +0 -1
  18. package/dist/hooks/comment-checker/cli.test.d.ts +1 -0
  19. package/dist/hooks/index.d.ts +1 -0
  20. package/dist/hooks/sisyphus-task-retry/index.d.ts +24 -0
  21. package/dist/hooks/sisyphus-task-retry/index.test.d.ts +1 -0
  22. package/dist/index.js +2300 -413
  23. package/dist/shared/index.d.ts +2 -0
  24. package/dist/shared/session-cursor.d.ts +13 -0
  25. package/dist/shared/session-cursor.test.d.ts +1 -0
  26. package/dist/shared/shell-env.d.ts +41 -0
  27. package/dist/shared/shell-env.test.d.ts +1 -0
  28. package/dist/tools/look-at/tools.d.ts +7 -0
  29. package/dist/tools/look-at/tools.test.d.ts +1 -0
  30. package/dist/tools/lsp/client.d.ts +0 -7
  31. package/dist/tools/lsp/constants.d.ts +0 -3
  32. package/dist/tools/lsp/tools.d.ts +0 -3
  33. package/dist/tools/lsp/types.d.ts +0 -56
  34. package/dist/tools/lsp/utils.d.ts +1 -8
  35. package/package.json +18 -3
  36. package/postinstall.mjs +43 -0
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
 
6
6
  > [!TIP]
7
7
  >
8
- > [![The Orchestrator is now available in beta.](./.github/assets/orchestrator-sisyphus.png?v=3)](https://github.com/code-yeongyu/oh-my-opencode/releases/tag/v3.0.0-beta.1)
9
- > > **The Orchestrator is now available in beta. Use `oh-my-opencode@3.0.0-beta.6` to install it.**
8
+ > [![The Orchestrator is now available in beta.](./.github/assets/orchestrator-sisyphus.png?v=3)](https://github.com/code-yeongyu/oh-my-opencode/releases/tag/v3.0.0-beta.7)
9
+ > > **The Orchestrator is now available in beta. Use `oh-my-opencode@3.0.0-beta.7` to install it.**
10
10
  >
11
11
  > Be with us!
12
12
  >
@@ -261,12 +261,14 @@ If you don't want all this, as mentioned, you can just pick and choose specific
261
261
  Run the interactive installer:
262
262
 
263
263
  ```bash
264
- bunx oh-my-opencode install
265
- # or use npx if bunx doesn't work
266
264
  npx oh-my-opencode install
265
+ # or with bun
266
+ bunx oh-my-opencode install
267
267
  ```
268
268
 
269
- > **Note for Ubuntu/Debian users**: If you installed Bun via Snap (`/snap/bin/bun`), `bunx` will fail with "script not found" due to Snap's sandboxing. Either use `npx` instead, or reinstall Bun via the official installer: `curl -fsSL https://bun.sh/install | bash`
269
+ > **Note**: The CLI ships with standalone binaries for all major platforms. No runtime (Bun/Node.js) is required for CLI execution after installation.
270
+ >
271
+ > **Supported platforms**: macOS (ARM64, x64), Linux (x64, ARM64, Alpine/musl), Windows (x64)
270
272
 
271
273
  Follow the prompts to configure your Claude, ChatGPT, and Gemini subscriptions. After installation, authenticate your providers as instructed.
272
274
 
package/README.zh-cn.md CHANGED
@@ -252,6 +252,11 @@
252
252
 
253
253
  ### 面向人类用户
254
254
 
255
+ > **⚠️ 先决条件:需要安装 Bun**
256
+ >
257
+ > 此工具**需要系统中已安装 [Bun](https://bun.sh/)** 才能运行。
258
+ > 即使使用 `npx` 运行安装程序,底层运行时仍依赖于 Bun。
259
+
255
260
  运行交互式安装程序:
256
261
 
257
262
  ```bash
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ // bin/oh-my-opencode.js
3
+ // Wrapper script that detects platform and spawns the correct binary
4
+
5
+ import { spawnSync } from "node:child_process";
6
+ import { createRequire } from "node:module";
7
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
8
+
9
+ const require = createRequire(import.meta.url);
10
+
11
+ /**
12
+ * Detect libc family on Linux
13
+ * @returns {string | null} 'glibc', 'musl', or null if detection fails
14
+ */
15
+ function getLibcFamily() {
16
+ if (process.platform !== "linux") {
17
+ return undefined; // Not needed on non-Linux
18
+ }
19
+
20
+ try {
21
+ const detectLibc = require("detect-libc");
22
+ return detectLibc.familySync();
23
+ } catch {
24
+ // detect-libc not available
25
+ return null;
26
+ }
27
+ }
28
+
29
+ function main() {
30
+ const { platform, arch } = process;
31
+ const libcFamily = getLibcFamily();
32
+
33
+ // Get platform package name
34
+ let pkg;
35
+ try {
36
+ pkg = getPlatformPackage({ platform, arch, libcFamily });
37
+ } catch (error) {
38
+ console.error(`\noh-my-opencode: ${error.message}\n`);
39
+ process.exit(1);
40
+ }
41
+
42
+ // Resolve binary path
43
+ const binRelPath = getBinaryPath(pkg, platform);
44
+
45
+ let binPath;
46
+ try {
47
+ binPath = require.resolve(binRelPath);
48
+ } catch {
49
+ console.error(`\noh-my-opencode: Platform binary not installed.`);
50
+ console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
51
+ console.error(`Expected package: ${pkg}`);
52
+ console.error(`\nTo fix, run:`);
53
+ console.error(` npm install ${pkg}\n`);
54
+ process.exit(1);
55
+ }
56
+
57
+ // Spawn the binary
58
+ const result = spawnSync(binPath, process.argv.slice(2), {
59
+ stdio: "inherit",
60
+ });
61
+
62
+ // Handle spawn errors
63
+ if (result.error) {
64
+ console.error(`\noh-my-opencode: Failed to execute binary.`);
65
+ console.error(`Error: ${result.error.message}\n`);
66
+ process.exit(2);
67
+ }
68
+
69
+ // Handle signals
70
+ if (result.signal) {
71
+ const signalNum = result.signal === "SIGTERM" ? 15 :
72
+ result.signal === "SIGKILL" ? 9 :
73
+ result.signal === "SIGINT" ? 2 : 1;
74
+ process.exit(128 + signalNum);
75
+ }
76
+
77
+ process.exit(result.status ?? 1);
78
+ }
79
+
80
+ main();
@@ -0,0 +1,38 @@
1
+ // bin/platform.js
2
+ // Shared platform detection module - used by wrapper and postinstall
3
+
4
+ /**
5
+ * Get the platform-specific package name
6
+ * @param {{ platform: string, arch: string, libcFamily?: string | null }} options
7
+ * @returns {string} Package name like "oh-my-opencode-darwin-arm64"
8
+ * @throws {Error} If libc cannot be detected on Linux
9
+ */
10
+ export function getPlatformPackage({ platform, arch, libcFamily }) {
11
+ let suffix = "";
12
+ if (platform === "linux") {
13
+ if (libcFamily === null || libcFamily === undefined) {
14
+ throw new Error(
15
+ "Could not detect libc on Linux. " +
16
+ "Please ensure detect-libc is installed or report this issue."
17
+ );
18
+ }
19
+ if (libcFamily === "musl") {
20
+ suffix = "-musl";
21
+ }
22
+ }
23
+
24
+ // Map platform names: win32 -> windows (for package name)
25
+ const os = platform === "win32" ? "windows" : platform;
26
+ return `oh-my-opencode-${os}-${arch}${suffix}`;
27
+ }
28
+
29
+ /**
30
+ * Get the path to the binary within a platform package
31
+ * @param {string} pkg Package name
32
+ * @param {string} platform Process platform
33
+ * @returns {string} Relative path like "oh-my-opencode-darwin-arm64/bin/oh-my-opencode"
34
+ */
35
+ export function getBinaryPath(pkg, platform) {
36
+ const ext = platform === "win32" ? ".exe" : "";
37
+ return `${pkg}/bin/oh-my-opencode${ext}`;
38
+ }
@@ -0,0 +1,148 @@
1
+ // bin/platform.test.ts
2
+ import { describe, expect, test } from "bun:test";
3
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
4
+
5
+ describe("getPlatformPackage", () => {
6
+ // #region Darwin platforms
7
+ test("returns darwin-arm64 for macOS ARM64", () => {
8
+ // #given macOS ARM64 platform
9
+ const input = { platform: "darwin", arch: "arm64" };
10
+
11
+ // #when getting platform package
12
+ const result = getPlatformPackage(input);
13
+
14
+ // #then returns correct package name
15
+ expect(result).toBe("oh-my-opencode-darwin-arm64");
16
+ });
17
+
18
+ test("returns darwin-x64 for macOS Intel", () => {
19
+ // #given macOS x64 platform
20
+ const input = { platform: "darwin", arch: "x64" };
21
+
22
+ // #when getting platform package
23
+ const result = getPlatformPackage(input);
24
+
25
+ // #then returns correct package name
26
+ expect(result).toBe("oh-my-opencode-darwin-x64");
27
+ });
28
+ // #endregion
29
+
30
+ // #region Linux glibc platforms
31
+ test("returns linux-x64 for Linux x64 with glibc", () => {
32
+ // #given Linux x64 with glibc
33
+ const input = { platform: "linux", arch: "x64", libcFamily: "glibc" };
34
+
35
+ // #when getting platform package
36
+ const result = getPlatformPackage(input);
37
+
38
+ // #then returns correct package name
39
+ expect(result).toBe("oh-my-opencode-linux-x64");
40
+ });
41
+
42
+ test("returns linux-arm64 for Linux ARM64 with glibc", () => {
43
+ // #given Linux ARM64 with glibc
44
+ const input = { platform: "linux", arch: "arm64", libcFamily: "glibc" };
45
+
46
+ // #when getting platform package
47
+ const result = getPlatformPackage(input);
48
+
49
+ // #then returns correct package name
50
+ expect(result).toBe("oh-my-opencode-linux-arm64");
51
+ });
52
+ // #endregion
53
+
54
+ // #region Linux musl platforms
55
+ test("returns linux-x64-musl for Alpine x64", () => {
56
+ // #given Linux x64 with musl (Alpine)
57
+ const input = { platform: "linux", arch: "x64", libcFamily: "musl" };
58
+
59
+ // #when getting platform package
60
+ const result = getPlatformPackage(input);
61
+
62
+ // #then returns correct package name with musl suffix
63
+ expect(result).toBe("oh-my-opencode-linux-x64-musl");
64
+ });
65
+
66
+ test("returns linux-arm64-musl for Alpine ARM64", () => {
67
+ // #given Linux ARM64 with musl (Alpine)
68
+ const input = { platform: "linux", arch: "arm64", libcFamily: "musl" };
69
+
70
+ // #when getting platform package
71
+ const result = getPlatformPackage(input);
72
+
73
+ // #then returns correct package name with musl suffix
74
+ expect(result).toBe("oh-my-opencode-linux-arm64-musl");
75
+ });
76
+ // #endregion
77
+
78
+ // #region Windows platform
79
+ test("returns windows-x64 for Windows", () => {
80
+ // #given Windows x64 platform (win32 is Node's platform name)
81
+ const input = { platform: "win32", arch: "x64" };
82
+
83
+ // #when getting platform package
84
+ const result = getPlatformPackage(input);
85
+
86
+ // #then returns correct package name with 'windows' not 'win32'
87
+ expect(result).toBe("oh-my-opencode-windows-x64");
88
+ });
89
+ // #endregion
90
+
91
+ // #region Error cases
92
+ test("throws error for Linux with null libcFamily", () => {
93
+ // #given Linux platform with null libc detection
94
+ const input = { platform: "linux", arch: "x64", libcFamily: null };
95
+
96
+ // #when getting platform package
97
+ // #then throws descriptive error
98
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
99
+ });
100
+
101
+ test("throws error for Linux with undefined libcFamily", () => {
102
+ // #given Linux platform with undefined libc
103
+ const input = { platform: "linux", arch: "x64", libcFamily: undefined };
104
+
105
+ // #when getting platform package
106
+ // #then throws descriptive error
107
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
108
+ });
109
+ // #endregion
110
+ });
111
+
112
+ describe("getBinaryPath", () => {
113
+ test("returns path without .exe for Unix platforms", () => {
114
+ // #given Unix platform package
115
+ const pkg = "oh-my-opencode-darwin-arm64";
116
+ const platform = "darwin";
117
+
118
+ // #when getting binary path
119
+ const result = getBinaryPath(pkg, platform);
120
+
121
+ // #then returns path without extension
122
+ expect(result).toBe("oh-my-opencode-darwin-arm64/bin/oh-my-opencode");
123
+ });
124
+
125
+ test("returns path with .exe for Windows", () => {
126
+ // #given Windows platform package
127
+ const pkg = "oh-my-opencode-windows-x64";
128
+ const platform = "win32";
129
+
130
+ // #when getting binary path
131
+ const result = getBinaryPath(pkg, platform);
132
+
133
+ // #then returns path with .exe extension
134
+ expect(result).toBe("oh-my-opencode-windows-x64/bin/oh-my-opencode.exe");
135
+ });
136
+
137
+ test("returns path without .exe for Linux", () => {
138
+ // #given Linux platform package
139
+ const pkg = "oh-my-opencode-linux-x64";
140
+ const platform = "linux";
141
+
142
+ // #when getting binary path
143
+ const result = getBinaryPath(pkg, platform);
144
+
145
+ // #then returns path without extension
146
+ expect(result).toBe("oh-my-opencode-linux-x64/bin/oh-my-opencode");
147
+ });
148
+ });
@@ -4,5 +4,5 @@ export declare const SISYPHUS_JUNIOR_DEFAULTS: {
4
4
  readonly model: "anthropic/claude-sonnet-4-5";
5
5
  readonly temperature: 0.1;
6
6
  };
7
- export declare function createSisyphusJuniorAgentWithOverrides(override: AgentOverrideConfig | undefined): AgentConfig;
7
+ export declare function createSisyphusJuniorAgentWithOverrides(override: AgentOverrideConfig | undefined, systemDefaultModel?: string): AgentConfig;
8
8
  export declare function createSisyphusJuniorAgent(categoryConfig: CategoryConfig, promptAppend?: string): AgentConfig;
@@ -9,12 +9,20 @@ export declare function initConfigContext(binary: OpenCodeBinaryType, version: s
9
9
  export declare function getConfigContext(): ConfigContext;
10
10
  export declare function resetConfigContext(): void;
11
11
  export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
12
+ interface NpmDistTags {
13
+ latest?: string;
14
+ beta?: string;
15
+ next?: string;
16
+ [tag: string]: string | undefined;
17
+ }
18
+ export declare function fetchNpmDistTags(packageName: string): Promise<NpmDistTags | null>;
19
+ export declare function getPluginNameWithVersion(currentVersion: string): Promise<string>;
12
20
  type ConfigFormat = "json" | "jsonc" | "none";
13
21
  export declare function detectConfigFormat(): {
14
22
  format: ConfigFormat;
15
23
  path: string;
16
24
  };
17
- export declare function addPluginToOpenCodeConfig(): ConfigMergeResult;
25
+ export declare function addPluginToOpenCodeConfig(currentVersion: string): Promise<ConfigMergeResult>;
18
26
  export declare function generateOmoConfig(installConfig: InstallConfig): Record<string, unknown>;
19
27
  export declare function writeOmoConfig(installConfig: InstallConfig): ConfigMergeResult;
20
28
  export declare function isOpenCodeInstalled(): Promise<boolean>;