oh-my-opencode 3.8.5 → 3.10.0
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/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +3 -3
- package/README.ru.md +367 -0
- package/README.zh-cn.md +3 -3
- package/bin/oh-my-opencode.js +96 -34
- package/bin/platform.d.ts +14 -0
- package/bin/platform.js +44 -0
- package/bin/platform.test.ts +56 -1
- package/dist/agents/atlas/agent.d.ts +1 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -0
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/hephaestus.d.ts +1 -1
- package/dist/agents/sisyphus-gemini-overlays.d.ts +2 -0
- package/dist/agents/sisyphus.d.ts +1 -1
- package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +3 -3
- package/dist/cli/index.js +208 -64
- package/dist/cli/run/event-state.d.ts +2 -0
- package/dist/cli/run/poll-for-completion.d.ts +2 -0
- package/dist/config/schema/agent-overrides.d.ts +1 -0
- package/dist/config/schema/categories.d.ts +2 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +3 -12
- package/dist/create-hooks.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +9 -0
- package/dist/features/boulder-state/storage.d.ts +1 -1
- package/dist/features/boulder-state/types.d.ts +2 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/claude-code-plugin-loader/types.d.ts +13 -3
- package/dist/features/context-injector/types.d.ts +2 -2
- package/dist/features/hook-message-injector/injector.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +1 -0
- package/dist/hooks/atlas/boulder-continuation-injector.d.ts +1 -0
- package/dist/hooks/atlas/types.d.ts +1 -0
- package/dist/hooks/background-notification/hook.d.ts +11 -0
- package/dist/hooks/claude-code-hooks/dispatch-hook.d.ts +4 -0
- package/dist/hooks/claude-code-hooks/execute-http-hook.d.ts +4 -0
- package/dist/hooks/claude-code-hooks/types.d.ts +9 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/no-hephaestus-non-gpt/hook.d.ts +5 -1
- package/dist/hooks/ralph-loop/completion-promise-detector.d.ts +1 -0
- package/dist/hooks/ralph-loop/loop-state-controller.d.ts +2 -0
- package/dist/hooks/ralph-loop/ralph-loop-hook.d.ts +1 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/read-image-resizer/hook.d.ts +12 -0
- package/dist/hooks/read-image-resizer/image-dimensions.d.ts +2 -0
- package/dist/hooks/read-image-resizer/image-resizer.d.ts +3 -0
- package/dist/hooks/read-image-resizer/index.d.ts +1 -0
- package/dist/hooks/read-image-resizer/types.d.ts +14 -0
- package/dist/hooks/session-notification.d.ts +1 -0
- package/dist/hooks/start-work/index.d.ts +3 -0
- package/dist/hooks/start-work/parse-user-request.d.ts +5 -0
- package/dist/hooks/start-work/worktree-detector.d.ts +1 -0
- package/dist/hooks/stop-continuation-guard/hook.d.ts +6 -1
- package/dist/hooks/think-mode/hook.d.ts +14 -2
- package/dist/hooks/think-mode/switcher.d.ts +0 -56
- package/dist/hooks/think-mode/types.d.ts +1 -15
- package/dist/hooks/todo-continuation-enforcer/constants.d.ts +1 -1
- package/dist/hooks/todo-continuation-enforcer/pending-question-detection.d.ts +14 -0
- package/dist/index.js +2203 -704
- package/dist/oh-my-opencode.schema.json +10 -14
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/shared/model-suggestion-retry.d.ts +4 -2
- package/dist/shared/prompt-timeout-context.d.ts +12 -0
- package/dist/shared/spawn-with-windows-hide.d.ts +15 -0
- package/dist/tools/delegate-task/category-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/token-limiter.d.ts +4 -0
- package/dist/tools/delegate-task/types.d.ts +9 -0
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/hashline-edit/validation.d.ts +1 -0
- package/package.json +13 -8
- package/postinstall.mjs +23 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/dev/assets/oh-my-opencode.schema.json",
|
|
4
4
|
"title": "Oh My OpenCode Configuration",
|
|
5
5
|
"description": "Configuration schema for oh-my-opencode plugin",
|
|
6
6
|
"type": "object",
|
|
@@ -24,19 +24,7 @@
|
|
|
24
24
|
"disabled_agents": {
|
|
25
25
|
"type": "array",
|
|
26
26
|
"items": {
|
|
27
|
-
"type": "string"
|
|
28
|
-
"enum": [
|
|
29
|
-
"sisyphus",
|
|
30
|
-
"hephaestus",
|
|
31
|
-
"prometheus",
|
|
32
|
-
"oracle",
|
|
33
|
-
"librarian",
|
|
34
|
-
"explore",
|
|
35
|
-
"multimodal-looker",
|
|
36
|
-
"metis",
|
|
37
|
-
"momus",
|
|
38
|
-
"atlas"
|
|
39
|
-
]
|
|
27
|
+
"type": "string"
|
|
40
28
|
}
|
|
41
29
|
},
|
|
42
30
|
"disabled_skills": {
|
|
@@ -960,6 +948,9 @@
|
|
|
960
948
|
}
|
|
961
949
|
},
|
|
962
950
|
"additionalProperties": false
|
|
951
|
+
},
|
|
952
|
+
"allow_non_gpt_model": {
|
|
953
|
+
"type": "boolean"
|
|
963
954
|
}
|
|
964
955
|
},
|
|
965
956
|
"additionalProperties": false
|
|
@@ -3248,6 +3239,11 @@
|
|
|
3248
3239
|
"prompt_append": {
|
|
3249
3240
|
"type": "string"
|
|
3250
3241
|
},
|
|
3242
|
+
"max_prompt_tokens": {
|
|
3243
|
+
"type": "integer",
|
|
3244
|
+
"exclusiveMinimum": 0,
|
|
3245
|
+
"maximum": 9007199254740991
|
|
3246
|
+
},
|
|
3251
3247
|
"is_unstable_agent": {
|
|
3252
3248
|
"type": "boolean"
|
|
3253
3249
|
},
|
|
@@ -22,6 +22,7 @@ export declare function createCoreHooks(args: {
|
|
|
22
22
|
writeExistingFileGuard: ReturnType<typeof import("../../hooks").createWriteExistingFileGuardHook> | null;
|
|
23
23
|
hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
|
|
24
24
|
jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
|
|
25
|
+
readImageResizer: ReturnType<typeof import("../../hooks").createReadImageResizerHook> | null;
|
|
25
26
|
contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
|
|
26
27
|
preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
|
|
27
28
|
sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HookName, OhMyOpenCodeConfig } from "../../config";
|
|
2
2
|
import type { ModelCacheState } from "../../plugin-state";
|
|
3
3
|
import type { PluginContext } from "../types";
|
|
4
|
-
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook } from "../../hooks";
|
|
4
|
+
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook } from "../../hooks";
|
|
5
5
|
export type ToolGuardHooks = {
|
|
6
6
|
commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
|
|
7
7
|
toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
|
|
@@ -13,6 +13,7 @@ export type ToolGuardHooks = {
|
|
|
13
13
|
writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null;
|
|
14
14
|
hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
|
|
15
15
|
jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
|
|
16
|
+
readImageResizer: ReturnType<typeof createReadImageResizerHook> | null;
|
|
16
17
|
};
|
|
17
18
|
export declare function createToolGuardHooks(args: {
|
|
18
19
|
ctx: PluginContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { createOpencodeClient } from "@opencode-ai/sdk";
|
|
2
|
+
import { type PromptRetryOptions } from "./prompt-timeout-context";
|
|
2
3
|
type Client = ReturnType<typeof createOpencodeClient>;
|
|
3
4
|
export interface ModelSuggestionInfo {
|
|
4
5
|
providerID: string;
|
|
@@ -18,9 +19,10 @@ interface PromptArgs {
|
|
|
18
19
|
id: string;
|
|
19
20
|
};
|
|
20
21
|
body: PromptBody;
|
|
22
|
+
signal?: AbortSignal;
|
|
21
23
|
[key: string]: unknown;
|
|
22
24
|
}
|
|
23
|
-
export declare function promptWithModelSuggestionRetry(client: Client, args: PromptArgs): Promise<void>;
|
|
25
|
+
export declare function promptWithModelSuggestionRetry(client: Client, args: PromptArgs, options?: PromptRetryOptions): Promise<void>;
|
|
24
26
|
/**
|
|
25
27
|
* Synchronous variant of promptWithModelSuggestionRetry.
|
|
26
28
|
*
|
|
@@ -30,5 +32,5 @@ export declare function promptWithModelSuggestionRetry(client: Client, args: Pro
|
|
|
30
32
|
* Required by callers that need the response to be available immediately after
|
|
31
33
|
* the call returns — e.g. look_at, which reads session messages right away.
|
|
32
34
|
*/
|
|
33
|
-
export declare function promptSyncWithModelSuggestionRetry(client: Client, args: PromptArgs): Promise<void>;
|
|
35
|
+
export declare function promptSyncWithModelSuggestionRetry(client: Client, args: PromptArgs, options?: PromptRetryOptions): Promise<void>;
|
|
34
36
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PromptTimeoutArgs {
|
|
2
|
+
signal?: AbortSignal;
|
|
3
|
+
}
|
|
4
|
+
export interface PromptRetryOptions {
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const PROMPT_TIMEOUT_MS = 120000;
|
|
8
|
+
export declare function createPromptTimeoutContext(args: PromptTimeoutArgs, timeoutMs: number): {
|
|
9
|
+
signal: AbortSignal;
|
|
10
|
+
wasTimedOut: () => boolean;
|
|
11
|
+
cleanup: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SpawnOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
env?: Record<string, string | undefined>;
|
|
4
|
+
stdin?: "pipe" | "inherit" | "ignore";
|
|
5
|
+
stdout?: "pipe" | "inherit" | "ignore";
|
|
6
|
+
stderr?: "pipe" | "inherit" | "ignore";
|
|
7
|
+
}
|
|
8
|
+
export interface SpawnedProcess {
|
|
9
|
+
readonly exitCode: number | null;
|
|
10
|
+
readonly exited: Promise<number>;
|
|
11
|
+
readonly stdout: ReadableStream<Uint8Array> | undefined;
|
|
12
|
+
readonly stderr: ReadableStream<Uint8Array> | undefined;
|
|
13
|
+
kill(signal?: NodeJS.Signals): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function spawnWithWindowsHide(command: string[], options: SpawnOptions): SpawnedProcess;
|
|
@@ -10,6 +10,7 @@ export interface CategoryResolutionResult {
|
|
|
10
10
|
variant?: string;
|
|
11
11
|
} | undefined;
|
|
12
12
|
categoryPromptAppend: string | undefined;
|
|
13
|
+
maxPromptTokens?: number;
|
|
13
14
|
modelInfo: ModelFallbackInfo | undefined;
|
|
14
15
|
actualModel: string | undefined;
|
|
15
16
|
isUnstableAgent: boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuildSystemContentInput } from "./types";
|
|
2
|
+
export declare function estimateTokenCount(text: string): number;
|
|
3
|
+
export declare function truncateToTokenBudget(content: string, maxTokens: number): string;
|
|
4
|
+
export declare function buildSystemContentWithTokenLimit(input: BuildSystemContentInput, maxTokens: number | undefined): string | undefined;
|
|
@@ -66,7 +66,16 @@ export interface DelegateTaskToolOptions {
|
|
|
66
66
|
}
|
|
67
67
|
export interface BuildSystemContentInput {
|
|
68
68
|
skillContent?: string;
|
|
69
|
+
skillContents?: string[];
|
|
69
70
|
categoryPromptAppend?: string;
|
|
71
|
+
agentsContext?: string;
|
|
72
|
+
planAgentPrepend?: string;
|
|
73
|
+
maxPromptTokens?: number;
|
|
74
|
+
model?: {
|
|
75
|
+
providerID: string;
|
|
76
|
+
modelID: string;
|
|
77
|
+
variant?: string;
|
|
78
|
+
};
|
|
70
79
|
agentName?: string;
|
|
71
80
|
availableCategories?: AvailableCategory[];
|
|
72
81
|
availableSkills?: AvailableSkill[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"|content\").\n\nVALIDATION:\n Payload shape: { \"filePath\": string, \"edits\": [...], \"delete\"?: boolean, \"rename\"?: string }\n Each edit must be one of: replace, append, prepend\n Edit shape: { \"op\": \"replace\"|\"append\"|\"prepend\", \"pos\"?: \"LINE#ID\", \"end\"?: \"LINE#ID\", \"lines\"
|
|
1
|
+
export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"|content\").\n\nVALIDATION:\n Payload shape: { \"filePath\": string, \"edits\": [...], \"delete\"?: boolean, \"rename\"?: string }\n Each edit must be one of: replace, append, prepend\n Edit shape: { \"op\": \"replace\"|\"append\"|\"prepend\", \"pos\"?: \"LINE#ID\", \"end\"?: \"LINE#ID\", \"lines\": string|string[]|null }\n lines must contain plain replacement text only (no LINE#ID prefixes, no diff + markers)\n CRITICAL: all operations validate against the same pre-edit file snapshot and apply bottom-up. Refs/tags are interpreted against the last-read version of the file.\n\nLINE#ID FORMAT (CRITICAL):\n Each line reference must be in \"{line_number}#{hash_id}\" format where:\n {line_number}: 1-based line number\n {hash_id}: Two CID letters from the set ZPMQVRWSNKTXJBYH\n\nFILE MODES:\n delete=true deletes file and requires edits=[] with no rename\n rename moves final content to a new path and removes old path\n\nCONTENT FORMAT:\n lines can be a string (single line) or string[] (multi-line, preferred).\n If you pass a multi-line string, it is split by real newline characters.\n Literal \"\\n\" is preserved as text.\n\nFILE CREATION:\n append without anchors adds content at EOF. If file does not exist, creates it.\n prepend without anchors adds content at BOF. If file does not exist, creates it.\n CRITICAL: only unanchored append/prepend can create a missing file.\n\nOPERATION CHOICE:\n replace with pos only -> replace one line at pos (MOST COMMON for single-line edits)\n replace with pos+end -> replace ENTIRE range pos..end as a block (ranges MUST NOT overlap across edits)\n append with pos/end anchor -> insert after that anchor\n prepend with pos/end anchor -> insert before that anchor\n append/prepend without anchors -> EOF/BOF insertion\n\nRULES (CRITICAL):\n 1. Minimize scope: one logical mutation site per operation.\n 2. Preserve formatting: keep indentation, punctuation, line breaks, trailing commas, brace style.\n 3. Prefer insertion over neighbor rewrites: anchor to structural boundaries (}, ], },), not interior property lines.\n 4. No no-ops: replacement content must differ from current content.\n 5. Touch only requested code: avoid incidental edits.\n 6. Use exact current tokens: NEVER rewrite approximately.\n 7. For swaps/moves: prefer one range operation over multiple single-line operations.\n 8. Output tool calls only; no prose or commentary between them.\n\nTAG CHOICE (ALWAYS):\n - Copy tags exactly from read output or >>> mismatch output.\n - NEVER guess tags.\n - Anchor to structural lines (function/class/brace), NEVER blank lines.\n - Anti-pattern warning: blank/whitespace anchors are fragile.\n - Re-read after each successful edit call before issuing another on the same file.\n\nAUTOCORRECT (built-in - you do NOT need to handle these):\n Merged lines are auto-expanded back to original line count.\n Indentation is auto-restored from original lines.\n BOM and CRLF line endings are preserved automatically.\n Hashline prefixes and diff markers in text are auto-stripped.\n\nRECOVERY (when >>> mismatch error appears):\n Copy the updated LINE#ID tags shown in the error output directly.\n Re-read only if the needed tags are missing from the error snippet.\n ALWAYS batch all edits for one file in a single call.";
|
|
@@ -6,6 +6,7 @@ interface HashMismatch {
|
|
|
6
6
|
line: number;
|
|
7
7
|
expected: string;
|
|
8
8
|
}
|
|
9
|
+
export declare function normalizeLineRef(ref: string): string;
|
|
9
10
|
export declare function parseLineRef(ref: string): LineRef;
|
|
10
11
|
export declare function validateLineRef(lines: string[], ref: string): void;
|
|
11
12
|
export declare class HashlineMismatchError extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@opencode-ai/sdk": "^1.1.19",
|
|
61
61
|
"commander": "^14.0.2",
|
|
62
62
|
"detect-libc": "^2.0.0",
|
|
63
|
+
"diff": "^8.0.3",
|
|
63
64
|
"js-yaml": "^4.1.1",
|
|
64
65
|
"jsonc-parser": "^3.3.1",
|
|
65
66
|
"picocolors": "^1.1.1",
|
|
@@ -74,13 +75,17 @@
|
|
|
74
75
|
"typescript": "^5.7.3"
|
|
75
76
|
},
|
|
76
77
|
"optionalDependencies": {
|
|
77
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
78
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
79
|
-
"oh-my-opencode-
|
|
80
|
-
"oh-my-opencode-linux-arm64
|
|
81
|
-
"oh-my-opencode-linux-
|
|
82
|
-
"oh-my-opencode-linux-x64
|
|
83
|
-
"oh-my-opencode-
|
|
78
|
+
"oh-my-opencode-darwin-arm64": "3.10.0",
|
|
79
|
+
"oh-my-opencode-darwin-x64": "3.10.0",
|
|
80
|
+
"oh-my-opencode-darwin-x64-baseline": "3.10.0",
|
|
81
|
+
"oh-my-opencode-linux-arm64": "3.10.0",
|
|
82
|
+
"oh-my-opencode-linux-arm64-musl": "3.10.0",
|
|
83
|
+
"oh-my-opencode-linux-x64": "3.10.0",
|
|
84
|
+
"oh-my-opencode-linux-x64-baseline": "3.10.0",
|
|
85
|
+
"oh-my-opencode-linux-x64-musl": "3.10.0",
|
|
86
|
+
"oh-my-opencode-linux-x64-musl-baseline": "3.10.0",
|
|
87
|
+
"oh-my-opencode-windows-x64": "3.10.0",
|
|
88
|
+
"oh-my-opencode-windows-x64-baseline": "3.10.0"
|
|
84
89
|
},
|
|
85
90
|
"trustedDependencies": [
|
|
86
91
|
"@ast-grep/cli",
|
package/postinstall.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Runs after npm install to verify platform binary is available
|
|
3
3
|
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
import {
|
|
5
|
+
import { getPlatformPackageCandidates, getBinaryPath } from "./bin/platform.js";
|
|
6
6
|
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
|
|
@@ -27,12 +27,28 @@ function main() {
|
|
|
27
27
|
const libcFamily = getLibcFamily();
|
|
28
28
|
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const packageCandidates = getPlatformPackageCandidates({
|
|
31
|
+
platform,
|
|
32
|
+
arch,
|
|
33
|
+
libcFamily,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const resolvedPackage = packageCandidates.find((pkg) => {
|
|
37
|
+
try {
|
|
38
|
+
require.resolve(getBinaryPath(pkg, platform));
|
|
39
|
+
return true;
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (!resolvedPackage) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`No platform binary package installed. Tried: ${packageCandidates.join(", ")}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`✓ oh-my-opencode binary installed for ${platform}-${arch} (${resolvedPackage})`);
|
|
36
52
|
} catch (error) {
|
|
37
53
|
console.warn(`⚠ oh-my-opencode: ${error.message}`);
|
|
38
54
|
console.warn(` The CLI may not work on this platform.`);
|