oh-my-opencode 4.16.0 → 4.16.1
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/.agents/skills/codex-qa/SKILL.md +9 -7
- package/.agents/skills/codex-qa/references/logging-debug.md +6 -4
- package/.agents/skills/opencode-qa/SKILL.md +9 -9
- package/.agents/skills/opencode-qa/references/tui-tmux.md +10 -8
- package/dist/cli/codex-ulw-loop.d.ts +8 -0
- package/dist/cli/get-local-version/types.d.ts +1 -1
- package/dist/cli/index.js +260 -207
- package/dist/cli-node/index.js +260 -207
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/monitor/process.d.ts +17 -1
- package/dist/index.js +1048 -1001
- package/dist/skills/frontend/SKILL.md +9 -9
- package/dist/skills/frontend/references/design/README.md +7 -3
- package/dist/skills/frontend/references/design/_INDEX.md +1 -1
- package/dist/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/dist/skills/frontend/references/designpowers/README.md +2 -2
- package/dist/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/dist/skills/start-work/SKILL.md +2 -2
- package/dist/skills/visual-qa/SKILL.md +13 -17
- package/docs/reference/web-terminal-visual-qa.md +39 -45
- package/package.json +31 -25
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +18 -10
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +18 -10
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +11 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +22 -1
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +18 -10
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +15 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +89 -27
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +55 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.d.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.js +33 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +15 -11
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +7 -7
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +59 -11
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-snapshot.ts +38 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-types.ts +11 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +15 -7
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +260 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-snapshot.test.ts +124 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +101 -2
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +10 -6
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +7 -3
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +18 -10
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +7 -7
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +11 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +13 -17
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -4
- package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +22 -9
- package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/ulw-plan-skill-contract.test.mjs +52 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +65 -39
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +2 -2
- package/packages/shared-skills/skills/frontend/SKILL.md +9 -9
- package/packages/shared-skills/skills/frontend/references/design/README.md +7 -3
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +24 -2
- package/packages/shared-skills/skills/frontend/references/designpowers/README.md +2 -2
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
- package/packages/shared-skills/skills/start-work/SKILL.md +2 -2
- package/packages/shared-skills/skills/visual-qa/SKILL.md +13 -17
- package/script/qa/strip-ansi.mjs +10 -0
- package/script/qa/web-terminal-visual-qa.mjs +112 -195
- package/script/qa/xterm-live-terminal.mjs +180 -0
- package/script/qa/web-terminal-renderer.mjs +0 -218
package/dist/cli/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-opencode",
|
|
2148
|
-
version: "4.16.
|
|
2148
|
+
version: "4.16.1",
|
|
2149
2149
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2150
2150
|
main: "./dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2191,10 +2191,11 @@ var init_package = __esm(() => {
|
|
|
2191
2191
|
"dist",
|
|
2192
2192
|
"bin",
|
|
2193
2193
|
"postinstall.mjs",
|
|
2194
|
+
"script/qa/strip-ansi.mjs",
|
|
2194
2195
|
"script/qa/web-terminal-redaction.d.mts",
|
|
2195
2196
|
"script/qa/web-terminal-redaction.mjs",
|
|
2196
|
-
"script/qa/web-terminal-renderer.mjs",
|
|
2197
2197
|
"script/qa/web-terminal-visual-qa.mjs",
|
|
2198
|
+
"script/qa/xterm-live-terminal.mjs",
|
|
2198
2199
|
"docs/reference/github-attachment-upload.md",
|
|
2199
2200
|
"docs/reference/web-terminal-visual-qa.md",
|
|
2200
2201
|
".opencode/command",
|
|
@@ -2260,6 +2261,7 @@ var init_package = __esm(() => {
|
|
|
2260
2261
|
"build:all": "bun run build && bun run build:binaries",
|
|
2261
2262
|
"build:binaries": "bun run script/build-binaries.ts",
|
|
2262
2263
|
"build:schema": "bun run script/build-schema.ts",
|
|
2264
|
+
"build:omo-schema": "bun run script/build-omo-schema.ts",
|
|
2263
2265
|
"build:model-capabilities": "bun run script/build-model-capabilities.ts",
|
|
2264
2266
|
clean: "rm -rf dist",
|
|
2265
2267
|
prepack: "bun run build:materialize-frontend",
|
|
@@ -2316,51 +2318,55 @@ var init_package = __esm(() => {
|
|
|
2316
2318
|
zod: "^4.4.3"
|
|
2317
2319
|
},
|
|
2318
2320
|
devDependencies: {
|
|
2319
|
-
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2320
|
-
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2321
|
-
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2322
|
-
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2323
2321
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2324
2322
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
2325
2323
|
"@oh-my-opencode/claude-code-compat-core": "workspace:*",
|
|
2326
|
-
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2327
2324
|
"@oh-my-opencode/comment-checker-core": "workspace:*",
|
|
2328
2325
|
"@oh-my-opencode/delegate-core": "workspace:*",
|
|
2326
|
+
"@oh-my-opencode/git-bash-mcp": "workspace:*",
|
|
2329
2327
|
"@oh-my-opencode/hashline-core": "workspace:*",
|
|
2330
|
-
"@oh-my-opencode/
|
|
2331
|
-
"@oh-my-opencode/
|
|
2332
|
-
"@oh-my-opencode/
|
|
2328
|
+
"@oh-my-opencode/lsp-core": "workspace:*",
|
|
2329
|
+
"@oh-my-opencode/mcp-client-core": "workspace:*",
|
|
2330
|
+
"@oh-my-opencode/mcp-stdio-core": "workspace:*",
|
|
2333
2331
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2334
|
-
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2335
2332
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2333
|
+
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2336
2334
|
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2337
|
-
"@oh-my-opencode/
|
|
2335
|
+
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2338
2336
|
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
2339
2337
|
"@oh-my-opencode/pi-webfetch": "workspace:*",
|
|
2340
2338
|
"@oh-my-opencode/prompts-core": "workspace:*",
|
|
2341
2339
|
"@oh-my-opencode/rules-engine": "workspace:*",
|
|
2340
|
+
"@oh-my-opencode/senpi-task": "workspace:*",
|
|
2342
2341
|
"@oh-my-opencode/shared-skills": "workspace:*",
|
|
2342
|
+
"@oh-my-opencode/skills-loader-core": "workspace:*",
|
|
2343
|
+
"@oh-my-opencode/team-core": "workspace:*",
|
|
2343
2344
|
"@oh-my-opencode/telemetry-core": "workspace:*",
|
|
2345
|
+
"@oh-my-opencode/tmux-core": "workspace:*",
|
|
2344
2346
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2345
|
-
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2346
2347
|
"@types/js-yaml": "^4.0.9",
|
|
2347
2348
|
"@types/picomatch": "^4.0.3",
|
|
2349
|
+
"@typescript/native-preview": "7.0.0-dev.20260518.1",
|
|
2350
|
+
"@xterm/addon-unicode11": "^0.9.0",
|
|
2351
|
+
"@xterm/xterm": "^6.0.0",
|
|
2348
2352
|
"bun-types": "1.3.14",
|
|
2353
|
+
"node-pty": "^1.1.0",
|
|
2354
|
+
"puppeteer-core": "^25.3.0",
|
|
2349
2355
|
typescript: "^6.0.3"
|
|
2350
2356
|
},
|
|
2351
2357
|
optionalDependencies: {
|
|
2352
|
-
"oh-my-opencode-darwin-arm64": "4.16.
|
|
2353
|
-
"oh-my-opencode-darwin-x64": "4.16.
|
|
2354
|
-
"oh-my-opencode-darwin-x64-baseline": "4.16.
|
|
2355
|
-
"oh-my-opencode-linux-arm64": "4.16.
|
|
2356
|
-
"oh-my-opencode-linux-arm64-musl": "4.16.
|
|
2357
|
-
"oh-my-opencode-linux-x64": "4.16.
|
|
2358
|
-
"oh-my-opencode-linux-x64-baseline": "4.16.
|
|
2359
|
-
"oh-my-opencode-linux-x64-musl": "4.16.
|
|
2360
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.16.
|
|
2361
|
-
"oh-my-opencode-windows-arm64": "4.16.
|
|
2362
|
-
"oh-my-opencode-windows-x64": "4.16.
|
|
2363
|
-
"oh-my-opencode-windows-x64-baseline": "4.16.
|
|
2358
|
+
"oh-my-opencode-darwin-arm64": "4.16.1",
|
|
2359
|
+
"oh-my-opencode-darwin-x64": "4.16.1",
|
|
2360
|
+
"oh-my-opencode-darwin-x64-baseline": "4.16.1",
|
|
2361
|
+
"oh-my-opencode-linux-arm64": "4.16.1",
|
|
2362
|
+
"oh-my-opencode-linux-arm64-musl": "4.16.1",
|
|
2363
|
+
"oh-my-opencode-linux-x64": "4.16.1",
|
|
2364
|
+
"oh-my-opencode-linux-x64-baseline": "4.16.1",
|
|
2365
|
+
"oh-my-opencode-linux-x64-musl": "4.16.1",
|
|
2366
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.16.1",
|
|
2367
|
+
"oh-my-opencode-windows-arm64": "4.16.1",
|
|
2368
|
+
"oh-my-opencode-windows-x64": "4.16.1",
|
|
2369
|
+
"oh-my-opencode-windows-x64-baseline": "4.16.1"
|
|
2364
2370
|
},
|
|
2365
2371
|
overrides: {
|
|
2366
2372
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -66628,20 +66634,20 @@ var init_config_manager = __esm(() => {
|
|
|
66628
66634
|
|
|
66629
66635
|
// packages/telemetry-core/src/activity-state.ts
|
|
66630
66636
|
import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "fs";
|
|
66631
|
-
import { basename as basename10, join as
|
|
66637
|
+
import { basename as basename10, join as join51 } from "path";
|
|
66632
66638
|
function resolveTelemetryStateDir(product, options = {}) {
|
|
66633
66639
|
const dataDir = resolveXdgDataDir(product.cacheDirName, {
|
|
66634
66640
|
env: options.env,
|
|
66635
66641
|
osProvider: options.osProvider
|
|
66636
66642
|
});
|
|
66637
|
-
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined :
|
|
66643
|
+
const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
|
|
66638
66644
|
if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
|
|
66639
66645
|
return dataDir;
|
|
66640
66646
|
}
|
|
66641
|
-
return
|
|
66647
|
+
return join51(dataDir, product.cacheDirName);
|
|
66642
66648
|
}
|
|
66643
66649
|
function getTelemetryActivityStateFilePath(stateDir) {
|
|
66644
|
-
return
|
|
66650
|
+
return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
|
|
66645
66651
|
}
|
|
66646
66652
|
function getDailyActiveCaptureState(input) {
|
|
66647
66653
|
const state = readPostHogActivityState(input.stateDir, input.diagnostics);
|
|
@@ -66712,9 +66718,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
|
|
|
66712
66718
|
|
|
66713
66719
|
// packages/telemetry-core/src/diagnostics.ts
|
|
66714
66720
|
import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "fs";
|
|
66715
|
-
import { join as
|
|
66721
|
+
import { join as join52 } from "path";
|
|
66716
66722
|
function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
|
|
66717
|
-
return
|
|
66723
|
+
return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
|
|
66718
66724
|
}
|
|
66719
66725
|
function writeTelemetryDiagnostic(input, options) {
|
|
66720
66726
|
const now = options.now ?? new Date;
|
|
@@ -72435,7 +72441,7 @@ var package_default2;
|
|
|
72435
72441
|
var init_package2 = __esm(() => {
|
|
72436
72442
|
package_default2 = {
|
|
72437
72443
|
name: "@oh-my-opencode/omo-codex",
|
|
72438
|
-
version: "4.16.
|
|
72444
|
+
version: "4.16.1",
|
|
72439
72445
|
type: "module",
|
|
72440
72446
|
private: true,
|
|
72441
72447
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -73405,7 +73411,7 @@ var init_update_toasts = __esm(() => {
|
|
|
73405
73411
|
|
|
73406
73412
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
73407
73413
|
import { existsSync as existsSync49 } from "fs";
|
|
73408
|
-
import { dirname as dirname27, join as
|
|
73414
|
+
import { dirname as dirname27, join as join70 } from "path";
|
|
73409
73415
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
73410
73416
|
function defaultGetModuleHostingWorkspace() {
|
|
73411
73417
|
try {
|
|
@@ -73559,7 +73565,7 @@ var init_background_update_check = __esm(() => {
|
|
|
73559
73565
|
init_update_toasts();
|
|
73560
73566
|
defaultDeps4 = {
|
|
73561
73567
|
existsSync: existsSync49,
|
|
73562
|
-
join:
|
|
73568
|
+
join: join70,
|
|
73563
73569
|
runBunInstallWithDetails,
|
|
73564
73570
|
log: log2,
|
|
73565
73571
|
getOpenCodeCacheDir,
|
|
@@ -74168,7 +74174,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
|
|
|
74168
74174
|
}
|
|
74169
74175
|
|
|
74170
74176
|
// packages/omo-codex/src/install/install-codex.ts
|
|
74171
|
-
import { join as
|
|
74177
|
+
import { join as join53, resolve as resolve15 } from "path";
|
|
74172
74178
|
import { existsSync as existsSync30 } from "fs";
|
|
74173
74179
|
import { homedir as homedir6 } from "os";
|
|
74174
74180
|
|
|
@@ -77126,7 +77132,11 @@ function stampHookGroups(hooks, version) {
|
|
|
77126
77132
|
function stampHookStatusMessage(hook, version) {
|
|
77127
77133
|
if (!isPlainRecord3(hook) || typeof hook.statusMessage !== "string")
|
|
77128
77134
|
return;
|
|
77129
|
-
hook.statusMessage = hook.statusMessage.replace(/^LazyCodex\([^)]+\)
|
|
77135
|
+
hook.statusMessage = hook.statusMessage.replace(/^(?:LazyCodex\([^)]+\):|\(OmO(?:\s+[^)]+)?\))\s*/, `(OmO ${normalizeHookStatusVersion(version)}) `);
|
|
77136
|
+
}
|
|
77137
|
+
function normalizeHookStatusVersion(version) {
|
|
77138
|
+
const normalized = version.trim();
|
|
77139
|
+
return normalized.length === 0 ? "local" : normalized;
|
|
77130
77140
|
}
|
|
77131
77141
|
|
|
77132
77142
|
// packages/omo-codex/src/install/codex-process.ts
|
|
@@ -77471,11 +77481,32 @@ function resolveCodexInstallerBinDir(input) {
|
|
|
77471
77481
|
return resolve14(homeDir, ".local", "bin");
|
|
77472
77482
|
}
|
|
77473
77483
|
|
|
77474
|
-
// packages/omo-codex/src/install/
|
|
77484
|
+
// packages/omo-codex/src/install/codex-git-bash-hooks.ts
|
|
77485
|
+
import { readFile as readFile19, writeFile as writeFile10 } from "fs/promises";
|
|
77475
77486
|
import { join as join48 } from "path";
|
|
77487
|
+
var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
|
|
77488
|
+
"./hooks/pre-tool-use-recommending-git-bash-mcp.json",
|
|
77489
|
+
"./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
|
|
77490
|
+
]);
|
|
77491
|
+
async function removeGitBashHooksOffWindows(input) {
|
|
77492
|
+
if (input.platform === "win32")
|
|
77493
|
+
return;
|
|
77494
|
+
const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
|
|
77495
|
+
const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
|
|
77496
|
+
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
|
|
77497
|
+
return;
|
|
77498
|
+
const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
|
|
77499
|
+
if (hooks.length === parsed.hooks.length)
|
|
77500
|
+
return;
|
|
77501
|
+
await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
|
|
77502
|
+
`);
|
|
77503
|
+
}
|
|
77504
|
+
|
|
77505
|
+
// packages/omo-codex/src/install/omo-sot-migration.ts
|
|
77506
|
+
import { join as join49 } from "path";
|
|
77476
77507
|
async function seedAndMigrateOmoSot(input) {
|
|
77477
77508
|
const commandEnv = { ...input.env };
|
|
77478
|
-
const scriptPath =
|
|
77509
|
+
const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
|
|
77479
77510
|
try {
|
|
77480
77511
|
await input.runCommand(process.execPath, [scriptPath, "--seed"], {
|
|
77481
77512
|
cwd: input.repoRoot,
|
|
@@ -77490,7 +77521,7 @@ async function seedAndMigrateOmoSot(input) {
|
|
|
77490
77521
|
|
|
77491
77522
|
// packages/omo-codex/src/install/install-ast-grep-sg.ts
|
|
77492
77523
|
init_src();
|
|
77493
|
-
import { join as
|
|
77524
|
+
import { join as join50 } from "path";
|
|
77494
77525
|
function describeResult(result) {
|
|
77495
77526
|
if (result.kind === "succeeded")
|
|
77496
77527
|
return null;
|
|
@@ -77504,7 +77535,7 @@ async function installAstGrepForCodex(options) {
|
|
|
77504
77535
|
return;
|
|
77505
77536
|
const platform = options.platform ?? process.platform;
|
|
77506
77537
|
const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
|
|
77507
|
-
const skillDir =
|
|
77538
|
+
const skillDir = join50(plugin.path, "skills", "ast-grep");
|
|
77508
77539
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
77509
77540
|
try {
|
|
77510
77541
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -77538,7 +77569,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77538
77569
|
const env3 = options.env ?? process.env;
|
|
77539
77570
|
const platform = options.platform ?? process.platform;
|
|
77540
77571
|
const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
|
|
77541
|
-
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ??
|
|
77572
|
+
const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
|
|
77542
77573
|
const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
|
|
77543
77574
|
const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
|
|
77544
77575
|
const runCommand = options.runCommand ?? defaultRunCommand;
|
|
@@ -77554,9 +77585,9 @@ async function runCodexInstaller(options = {}) {
|
|
|
77554
77585
|
if (!gitBashResolution.found) {
|
|
77555
77586
|
throw new Error(gitBashResolution.installHint);
|
|
77556
77587
|
}
|
|
77557
|
-
const codexPackageRoot =
|
|
77588
|
+
const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
|
|
77558
77589
|
const marketplace = await readMarketplace(repoRoot, {
|
|
77559
|
-
marketplacePath:
|
|
77590
|
+
marketplacePath: join53(codexPackageRoot, "marketplace.json")
|
|
77560
77591
|
});
|
|
77561
77592
|
const distributionManifest = await readDistributionManifest(repoRoot);
|
|
77562
77593
|
const installed = [];
|
|
@@ -77588,6 +77619,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77588
77619
|
if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
|
|
77589
77620
|
await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version: version2 });
|
|
77590
77621
|
await writeLazyCodexInstallSnapshot({ pluginRoot: plugin.path, distributionManifest });
|
|
77622
|
+
await removeGitBashHooksOffWindows({ platform, pluginRoot: plugin.path });
|
|
77591
77623
|
}
|
|
77592
77624
|
const links = await linkCachedPluginBins({ binDir, pluginRoot: plugin.path, platform });
|
|
77593
77625
|
for (const link of links) {
|
|
@@ -77598,7 +77630,7 @@ async function runCodexInstaller(options = {}) {
|
|
|
77598
77630
|
if (runtimeLink !== null)
|
|
77599
77631
|
log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
|
|
77600
77632
|
else
|
|
77601
|
-
log4(`Warning: skipped the omo runtime wrapper because ${
|
|
77633
|
+
log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
|
|
77602
77634
|
}
|
|
77603
77635
|
pluginSources.push({ name: entry.name, sourcePath });
|
|
77604
77636
|
installed.push(plugin);
|
|
@@ -77652,13 +77684,13 @@ async function runCodexInstaller(options = {}) {
|
|
|
77652
77684
|
});
|
|
77653
77685
|
}
|
|
77654
77686
|
await reapLspDaemons(codexHome).catch(() => []);
|
|
77655
|
-
const marketplaceRoot =
|
|
77687
|
+
const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
|
|
77656
77688
|
await writeCachedMarketplaceManifest({
|
|
77657
77689
|
marketplaceName: marketplace.name,
|
|
77658
77690
|
marketplaceRoot,
|
|
77659
77691
|
plugins: installed
|
|
77660
77692
|
});
|
|
77661
|
-
const configPath =
|
|
77693
|
+
const configPath = join53(codexHome, "config.toml");
|
|
77662
77694
|
await updateCodexConfig({
|
|
77663
77695
|
configPath,
|
|
77664
77696
|
repoRoot: codexPackageRoot,
|
|
@@ -77718,7 +77750,7 @@ function findRepoRootFromImporter(importerDir) {
|
|
|
77718
77750
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
77719
77751
|
if (isRepoRootWithCodexPlugin(current))
|
|
77720
77752
|
return current;
|
|
77721
|
-
for (const wrapperPackageRoot of [
|
|
77753
|
+
for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
|
|
77722
77754
|
if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
|
|
77723
77755
|
return wrapperPackageRoot;
|
|
77724
77756
|
}
|
|
@@ -77736,7 +77768,7 @@ function findRepoRoot(input) {
|
|
|
77736
77768
|
return findRepoRootFromImporter(input.importerDir);
|
|
77737
77769
|
}
|
|
77738
77770
|
function isRepoRootWithCodexPlugin(repoRoot) {
|
|
77739
|
-
return existsSync30(
|
|
77771
|
+
return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
|
|
77740
77772
|
}
|
|
77741
77773
|
function codexMarketplaceSource(marketplaceRoot) {
|
|
77742
77774
|
return { sourceType: "local", source: marketplaceRoot };
|
|
@@ -77871,12 +77903,12 @@ function defaultRunCommand2(command, args) {
|
|
|
77871
77903
|
});
|
|
77872
77904
|
}
|
|
77873
77905
|
// packages/omo-codex/src/install/codex-cleanup.ts
|
|
77874
|
-
import { lstat as lstat11, readFile as
|
|
77906
|
+
import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "fs/promises";
|
|
77875
77907
|
import { homedir as homedir8 } from "os";
|
|
77876
|
-
import { isAbsolute as isAbsolute10, join as
|
|
77908
|
+
import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "path";
|
|
77877
77909
|
|
|
77878
77910
|
// packages/omo-codex/src/install/codex-cleanup-config.ts
|
|
77879
|
-
import { lstat as lstat10, mkdir as mkdir8, readFile as
|
|
77911
|
+
import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
|
|
77880
77912
|
import { dirname as dirname18 } from "path";
|
|
77881
77913
|
var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
|
|
77882
77914
|
var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
|
|
@@ -77906,14 +77938,14 @@ function cleanupCodexLightConfigText(config) {
|
|
|
77906
77938
|
async function cleanupCodexConfig(configPath, now) {
|
|
77907
77939
|
if (!await configExists(configPath))
|
|
77908
77940
|
return { changed: false };
|
|
77909
|
-
const original = await
|
|
77941
|
+
const original = await readFile20(configPath, "utf8");
|
|
77910
77942
|
const next = cleanupCodexLightConfigText(original);
|
|
77911
77943
|
if (next === original)
|
|
77912
77944
|
return { changed: false };
|
|
77913
77945
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
|
|
77914
77946
|
await mkdir8(dirname18(configPath), { recursive: true });
|
|
77915
|
-
await
|
|
77916
|
-
await
|
|
77947
|
+
await writeFile11(backupPath, original);
|
|
77948
|
+
await writeFile11(configPath, `${next.trimEnd()}
|
|
77917
77949
|
`);
|
|
77918
77950
|
return { changed: true, backupPath };
|
|
77919
77951
|
}
|
|
@@ -77990,7 +78022,7 @@ function nodeErrorCode4(error) {
|
|
|
77990
78022
|
}
|
|
77991
78023
|
|
|
77992
78024
|
// packages/omo-codex/src/install/codex-cleanup-safety.ts
|
|
77993
|
-
import { dirname as dirname19, isAbsolute as isAbsolute9, join as
|
|
78025
|
+
import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "path";
|
|
77994
78026
|
function validateManagedCleanupTarget(input) {
|
|
77995
78027
|
if (!isAbsolute9(input.path))
|
|
77996
78028
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
@@ -78003,11 +78035,11 @@ function validateManagedCleanupTarget(input) {
|
|
|
78003
78035
|
if (target === codexHome)
|
|
78004
78036
|
return skipped(input.path, "outside managed Codex cleanup scope");
|
|
78005
78037
|
const exactManagedRoots = new Set([
|
|
78006
|
-
resolve16(
|
|
78007
|
-
resolve16(
|
|
78008
|
-
resolve16(
|
|
78009
|
-
resolve16(
|
|
78010
|
-
resolve16(
|
|
78038
|
+
resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
|
|
78039
|
+
resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
|
|
78040
|
+
resolve16(join54(codexHome, "runtime", "ast-grep")),
|
|
78041
|
+
resolve16(join54(codexHome, "runtime", "node")),
|
|
78042
|
+
resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
|
|
78011
78043
|
]);
|
|
78012
78044
|
if (exactManagedRoots.has(target))
|
|
78013
78045
|
return null;
|
|
@@ -78037,8 +78069,8 @@ function skipped(path7, reason) {
|
|
|
78037
78069
|
var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
|
|
78038
78070
|
async function cleanupCodexLight(input = {}) {
|
|
78039
78071
|
const env3 = input.env ?? process.env;
|
|
78040
|
-
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ??
|
|
78041
|
-
const configPath =
|
|
78072
|
+
const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
|
|
78073
|
+
const configPath = join55(codexHome, "config.toml");
|
|
78042
78074
|
const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
|
|
78043
78075
|
const configCleanup = await cleanupCodexConfig(configPath, input.now);
|
|
78044
78076
|
const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
|
|
@@ -78077,17 +78109,17 @@ async function cleanupCodexLight(input = {}) {
|
|
|
78077
78109
|
}
|
|
78078
78110
|
function managedGlobalStatePaths(codexHome) {
|
|
78079
78111
|
return [
|
|
78080
|
-
|
|
78081
|
-
|
|
78082
|
-
|
|
78083
|
-
|
|
78084
|
-
|
|
78112
|
+
join55(codexHome, "plugins", "cache", "sisyphuslabs"),
|
|
78113
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
|
|
78114
|
+
join55(codexHome, "runtime", "ast-grep"),
|
|
78115
|
+
join55(codexHome, "runtime", "node"),
|
|
78116
|
+
join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
|
|
78085
78117
|
];
|
|
78086
78118
|
}
|
|
78087
78119
|
var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
|
|
78088
78120
|
async function collectBootstrapDataDirsByGlob(codexHome) {
|
|
78089
78121
|
const results = [];
|
|
78090
|
-
await walkForManagedBootstrapDirs(
|
|
78122
|
+
await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
|
|
78091
78123
|
return results;
|
|
78092
78124
|
}
|
|
78093
78125
|
async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
@@ -78099,9 +78131,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
|
|
|
78099
78131
|
for (const entry of entries) {
|
|
78100
78132
|
if (!entry.isDirectory())
|
|
78101
78133
|
continue;
|
|
78102
|
-
const childPath =
|
|
78134
|
+
const childPath = join55(directory, entry.name);
|
|
78103
78135
|
if (isManagedBootstrapOwnerName(entry.name)) {
|
|
78104
|
-
const bootstrapDir =
|
|
78136
|
+
const bootstrapDir = join55(childPath, "bootstrap");
|
|
78105
78137
|
if (await exists5(bootstrapDir))
|
|
78106
78138
|
results.push(bootstrapDir);
|
|
78107
78139
|
continue;
|
|
@@ -78135,7 +78167,7 @@ async function attemptRemove(path7) {
|
|
|
78135
78167
|
}
|
|
78136
78168
|
async function pruneEmptyRuntimeDirBestEffort(codexHome) {
|
|
78137
78169
|
try {
|
|
78138
|
-
await rmdir(
|
|
78170
|
+
await rmdir(join55(codexHome, "runtime"));
|
|
78139
78171
|
} catch (error) {
|
|
78140
78172
|
if (isExpectedRuntimePruneFailure(error))
|
|
78141
78173
|
return;
|
|
@@ -78147,14 +78179,14 @@ function isExpectedRuntimePruneFailure(error) {
|
|
|
78147
78179
|
}
|
|
78148
78180
|
async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
78149
78181
|
const manifestPaths = [
|
|
78150
|
-
|
|
78182
|
+
join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
|
|
78151
78183
|
];
|
|
78152
|
-
const versionRoot =
|
|
78184
|
+
const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
|
|
78153
78185
|
if (await exists5(versionRoot)) {
|
|
78154
78186
|
const entries = await readdir9(versionRoot, { withFileTypes: true });
|
|
78155
78187
|
for (const entry of entries) {
|
|
78156
78188
|
if (entry.isDirectory())
|
|
78157
|
-
manifestPaths.push(
|
|
78189
|
+
manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
|
|
78158
78190
|
}
|
|
78159
78191
|
}
|
|
78160
78192
|
const paths = new Set;
|
|
@@ -78171,19 +78203,19 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
|
|
|
78171
78203
|
async function readManagedAgentPathsFromConfig(codexHome, configPath) {
|
|
78172
78204
|
if (!await exists5(configPath))
|
|
78173
78205
|
return [];
|
|
78174
|
-
const config = await
|
|
78175
|
-
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) =>
|
|
78206
|
+
const config = await readFile21(configPath, "utf8");
|
|
78207
|
+
return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
|
|
78176
78208
|
}
|
|
78177
78209
|
async function readInstalledAgentManifest(manifestPath) {
|
|
78178
78210
|
if (!await exists5(manifestPath))
|
|
78179
78211
|
return [];
|
|
78180
|
-
const parsed = JSON.parse(await
|
|
78212
|
+
const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
|
|
78181
78213
|
if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
|
|
78182
78214
|
return [];
|
|
78183
78215
|
return parsed.agents.filter((path7) => typeof path7 === "string");
|
|
78184
78216
|
}
|
|
78185
78217
|
async function removeManifestListedAgentLinks(codexHome, paths) {
|
|
78186
|
-
const agentsDir =
|
|
78218
|
+
const agentsDir = join55(codexHome, "agents");
|
|
78187
78219
|
const removed = [];
|
|
78188
78220
|
const skipped2 = [];
|
|
78189
78221
|
for (const path7 of paths) {
|
|
@@ -78236,16 +78268,16 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
|
|
|
78236
78268
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
78237
78269
|
import { execFile as execFile3 } from "child_process";
|
|
78238
78270
|
import { constants as constants7, existsSync as existsSync32 } from "fs";
|
|
78239
|
-
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as
|
|
78271
|
+
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "fs/promises";
|
|
78240
78272
|
import { homedir as homedir9 } from "os";
|
|
78241
|
-
import { dirname as dirname20, join as
|
|
78273
|
+
import { dirname as dirname20, join as join56, resolve as resolve18 } from "path";
|
|
78242
78274
|
import { fileURLToPath } from "url";
|
|
78243
78275
|
import { promisify as promisify2 } from "util";
|
|
78244
78276
|
var execFileAsync2 = promisify2(execFile3);
|
|
78245
78277
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
78246
|
-
|
|
78247
|
-
|
|
78248
|
-
|
|
78278
|
+
join56("extensions", "omo.js"),
|
|
78279
|
+
join56("skills", "ultrawork", "SKILL.md"),
|
|
78280
|
+
join56("skills", "ulw-loop", "SKILL.md")
|
|
78249
78281
|
];
|
|
78250
78282
|
async function runSenpiInstaller(options = {}) {
|
|
78251
78283
|
const context = resolveInstallContext(options);
|
|
@@ -78270,13 +78302,13 @@ async function runSenpiInstaller(options = {}) {
|
|
|
78270
78302
|
function resolveInstallContext(options) {
|
|
78271
78303
|
const env3 = options.env ?? process.env;
|
|
78272
78304
|
const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
|
|
78273
|
-
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ??
|
|
78274
|
-
const pluginPath = resolve18(options.pluginPath ??
|
|
78305
|
+
const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
|
|
78306
|
+
const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
78275
78307
|
return {
|
|
78276
78308
|
env: env3,
|
|
78277
78309
|
repoRoot,
|
|
78278
78310
|
agentDir,
|
|
78279
|
-
settingsPath:
|
|
78311
|
+
settingsPath: join56(agentDir, "settings.json"),
|
|
78280
78312
|
pluginPath,
|
|
78281
78313
|
runCommand: options.runCommand ?? defaultRunCommand3
|
|
78282
78314
|
};
|
|
@@ -78285,12 +78317,12 @@ async function ensurePluginArtifacts(context) {
|
|
|
78285
78317
|
const missing = await hasMissingPluginArtifact(context.pluginPath);
|
|
78286
78318
|
if (!missing)
|
|
78287
78319
|
return;
|
|
78288
|
-
await context.runCommand("node", [
|
|
78289
|
-
await context.runCommand("node", [
|
|
78320
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
78321
|
+
await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
78290
78322
|
}
|
|
78291
78323
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
78292
78324
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
78293
|
-
if (!await fileExists(
|
|
78325
|
+
if (!await fileExists(join56(pluginPath, artifact)))
|
|
78294
78326
|
return true;
|
|
78295
78327
|
}
|
|
78296
78328
|
return false;
|
|
@@ -78305,7 +78337,7 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
78305
78337
|
async function readSettings(settingsPath) {
|
|
78306
78338
|
let raw;
|
|
78307
78339
|
try {
|
|
78308
|
-
raw = await
|
|
78340
|
+
raw = await readFile22(settingsPath, "utf8");
|
|
78309
78341
|
} catch (error) {
|
|
78310
78342
|
if (isErrno(error, "ENOENT"))
|
|
78311
78343
|
return {};
|
|
@@ -78334,11 +78366,11 @@ async function writeSettingsAtomically(settingsPath, settings) {
|
|
|
78334
78366
|
if (await fileExists(settingsPath)) {
|
|
78335
78367
|
await copyFile3(settingsPath, backupPath);
|
|
78336
78368
|
} else {
|
|
78337
|
-
await
|
|
78369
|
+
await writeFile12(backupPath, `{}
|
|
78338
78370
|
`, "utf8");
|
|
78339
78371
|
}
|
|
78340
78372
|
const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
|
|
78341
|
-
await
|
|
78373
|
+
await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
|
|
78342
78374
|
`, "utf8");
|
|
78343
78375
|
await rename5(tempPath, settingsPath);
|
|
78344
78376
|
return backupPath;
|
|
@@ -78358,7 +78390,7 @@ function timestampForBackup() {
|
|
|
78358
78390
|
function findRepoRoot2(importerDir) {
|
|
78359
78391
|
let current = importerDir;
|
|
78360
78392
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
78361
|
-
if (fileExistsSync(
|
|
78393
|
+
if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
78362
78394
|
return current;
|
|
78363
78395
|
current = resolve18(current, "..");
|
|
78364
78396
|
}
|
|
@@ -78418,19 +78450,19 @@ init_provider_availability();
|
|
|
78418
78450
|
|
|
78419
78451
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
78420
78452
|
import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
|
|
78421
|
-
import { join as
|
|
78453
|
+
import { join as join58 } from "path";
|
|
78422
78454
|
|
|
78423
78455
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
78424
78456
|
init_shared();
|
|
78425
78457
|
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
|
|
78426
|
-
import { join as
|
|
78458
|
+
import { join as join57 } from "path";
|
|
78427
78459
|
var TUI_SUBPATH = "tui";
|
|
78428
78460
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
78429
78461
|
function fileEntryPackageJsonPath(entry) {
|
|
78430
78462
|
let path7 = entry.slice("file:".length);
|
|
78431
78463
|
if (path7.startsWith("//"))
|
|
78432
78464
|
path7 = path7.slice(2);
|
|
78433
|
-
return
|
|
78465
|
+
return join57(path7, "package.json");
|
|
78434
78466
|
}
|
|
78435
78467
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
78436
78468
|
if (!existsSync33(pkgJsonPath))
|
|
@@ -78468,7 +78500,7 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
78468
78500
|
const packageName = packageNameFromServerEntry(entry);
|
|
78469
78501
|
if (packageName === null)
|
|
78470
78502
|
return null;
|
|
78471
|
-
return packageJsonExportsTui(
|
|
78503
|
+
return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
78472
78504
|
}
|
|
78473
78505
|
function isOurFilePluginEntry(entry) {
|
|
78474
78506
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
@@ -78533,7 +78565,7 @@ function detectServerPluginRegistration() {
|
|
|
78533
78565
|
}
|
|
78534
78566
|
}
|
|
78535
78567
|
function detectTuiPluginRegistration() {
|
|
78536
|
-
const tuiJsonPath =
|
|
78568
|
+
const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
78537
78569
|
if (!existsSync33(tuiJsonPath)) {
|
|
78538
78570
|
return {
|
|
78539
78571
|
registered: false,
|
|
@@ -78689,10 +78721,10 @@ function readConfig(path7) {
|
|
|
78689
78721
|
return null;
|
|
78690
78722
|
}
|
|
78691
78723
|
function readServerConfig(configDir) {
|
|
78692
|
-
const jsoncPath =
|
|
78724
|
+
const jsoncPath = join58(configDir, "opencode.jsonc");
|
|
78693
78725
|
if (existsSync34(jsoncPath))
|
|
78694
78726
|
return readConfig(jsoncPath);
|
|
78695
|
-
const jsonPath =
|
|
78727
|
+
const jsonPath = join58(configDir, "opencode.json");
|
|
78696
78728
|
if (existsSync34(jsonPath))
|
|
78697
78729
|
return readConfig(jsonPath);
|
|
78698
78730
|
return null;
|
|
@@ -78734,7 +78766,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78734
78766
|
if (!desiredEntry) {
|
|
78735
78767
|
return { changed: false, reason: "no-server-entry" };
|
|
78736
78768
|
}
|
|
78737
|
-
const tuiJsonPath =
|
|
78769
|
+
const tuiJsonPath = join58(configDir, "tui.json");
|
|
78738
78770
|
const { config, malformed } = readTuiConfig(tuiJsonPath);
|
|
78739
78771
|
if (malformed) {
|
|
78740
78772
|
return { changed: false, reason: "malformed" };
|
|
@@ -78750,7 +78782,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
78750
78782
|
|
|
78751
78783
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
78752
78784
|
import { homedir as homedir10 } from "os";
|
|
78753
|
-
import { join as
|
|
78785
|
+
import { join as join59 } from "path";
|
|
78754
78786
|
|
|
78755
78787
|
// packages/shared-skills/index.mjs
|
|
78756
78788
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
@@ -78769,9 +78801,9 @@ function describeResult2(result) {
|
|
|
78769
78801
|
}
|
|
78770
78802
|
async function installAstGrepForOpenCode(options = {}) {
|
|
78771
78803
|
const platform = options.platform ?? process.platform;
|
|
78772
|
-
const baseDir =
|
|
78804
|
+
const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
|
|
78773
78805
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
78774
|
-
const skillDir =
|
|
78806
|
+
const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
78775
78807
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
78776
78808
|
try {
|
|
78777
78809
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -97270,9 +97302,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
97270
97302
|
}
|
|
97271
97303
|
// packages/boulder-state/src/storage/path.ts
|
|
97272
97304
|
import { existsSync as existsSync38 } from "fs";
|
|
97273
|
-
import { isAbsolute as isAbsolute11, join as
|
|
97305
|
+
import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "path";
|
|
97274
97306
|
function getBoulderFilePath(directory) {
|
|
97275
|
-
return
|
|
97307
|
+
return join61(directory, BOULDER_DIR, BOULDER_FILE);
|
|
97276
97308
|
}
|
|
97277
97309
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
97278
97310
|
return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
|
|
@@ -97499,9 +97531,9 @@ init_state();
|
|
|
97499
97531
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
97500
97532
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
97501
97533
|
import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
|
|
97502
|
-
import { join as
|
|
97534
|
+
import { join as join62 } from "path";
|
|
97503
97535
|
function getMarkerPath(directory, sessionID) {
|
|
97504
|
-
return
|
|
97536
|
+
return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
97505
97537
|
}
|
|
97506
97538
|
function readContinuationMarker(directory, sessionID) {
|
|
97507
97539
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -97574,7 +97606,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
97574
97606
|
init_shared();
|
|
97575
97607
|
init_compaction_marker();
|
|
97576
97608
|
import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
|
|
97577
|
-
import { join as
|
|
97609
|
+
import { join as join63 } from "path";
|
|
97578
97610
|
var defaultSessionLastAgentDeps = {
|
|
97579
97611
|
getMessageDir,
|
|
97580
97612
|
isSqliteBackend,
|
|
@@ -97634,7 +97666,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
97634
97666
|
try {
|
|
97635
97667
|
const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
97636
97668
|
try {
|
|
97637
|
-
const content = readFileSync22(
|
|
97669
|
+
const content = readFileSync22(join63(messageDir, fileName), "utf-8");
|
|
97638
97670
|
const parsed = JSON.parse(content);
|
|
97639
97671
|
return {
|
|
97640
97672
|
fileName,
|
|
@@ -97678,7 +97710,7 @@ init_agent_display_names();
|
|
|
97678
97710
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97679
97711
|
init_frontmatter2();
|
|
97680
97712
|
import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
|
|
97681
|
-
import { dirname as dirname23, join as
|
|
97713
|
+
import { dirname as dirname23, join as join64 } from "path";
|
|
97682
97714
|
|
|
97683
97715
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
97684
97716
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -97687,7 +97719,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
97687
97719
|
|
|
97688
97720
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
97689
97721
|
function getStateFilePath(directory, customPath) {
|
|
97690
|
-
return customPath ?
|
|
97722
|
+
return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
|
|
97691
97723
|
}
|
|
97692
97724
|
function readState(directory, customPath) {
|
|
97693
97725
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -98659,6 +98691,10 @@ function formatVersionOutput(info) {
|
|
|
98659
98691
|
lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
|
|
98660
98692
|
lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
|
|
98661
98693
|
break;
|
|
98694
|
+
case "pinned-mismatch":
|
|
98695
|
+
lines.push(` ${SYMBOLS3.warn} ${import_picocolors17.default.yellow(`Version pinned to ${info.pinnedVersion} but running ${info.currentVersion}`)}`);
|
|
98696
|
+
lines.push(` ${import_picocolors17.default.dim("The pin only skips the update check; it does not control which version OpenCode loads")}`);
|
|
98697
|
+
break;
|
|
98662
98698
|
case "error":
|
|
98663
98699
|
lines.push(` ${SYMBOLS3.cross} ${import_picocolors17.default.red("Unable to check for updates")}`);
|
|
98664
98700
|
lines.push(` ${import_picocolors17.default.dim("Network error or npm registry unavailable")}`);
|
|
@@ -98695,14 +98731,16 @@ async function getLocalVersion(options = {}) {
|
|
|
98695
98731
|
}
|
|
98696
98732
|
const pluginInfo = findPluginEntry(directory);
|
|
98697
98733
|
if (pluginInfo?.isPinned) {
|
|
98734
|
+
const actualVersion = getCachedVersion();
|
|
98735
|
+
const isMismatch = actualVersion !== null && actualVersion !== pluginInfo.pinnedVersion;
|
|
98698
98736
|
const info2 = {
|
|
98699
|
-
currentVersion: pluginInfo.pinnedVersion,
|
|
98737
|
+
currentVersion: isMismatch ? actualVersion : pluginInfo.pinnedVersion,
|
|
98700
98738
|
latestVersion: null,
|
|
98701
98739
|
isUpToDate: false,
|
|
98702
98740
|
isLocalDev: false,
|
|
98703
98741
|
isPinned: true,
|
|
98704
98742
|
pinnedVersion: pluginInfo.pinnedVersion,
|
|
98705
|
-
status: "pinned"
|
|
98743
|
+
status: isMismatch ? "pinned-mismatch" : "pinned"
|
|
98706
98744
|
};
|
|
98707
98745
|
console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
|
|
98708
98746
|
return 0;
|
|
@@ -98771,7 +98809,7 @@ init_extract_semver();
|
|
|
98771
98809
|
init_bun_which_shim();
|
|
98772
98810
|
import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "fs";
|
|
98773
98811
|
import { homedir as homedir14 } from "os";
|
|
98774
|
-
import { join as
|
|
98812
|
+
import { join as join71 } from "path";
|
|
98775
98813
|
|
|
98776
98814
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
98777
98815
|
init_spawn_with_windows_hide();
|
|
@@ -98863,17 +98901,17 @@ function getDesktopAppPaths(platform) {
|
|
|
98863
98901
|
case "darwin":
|
|
98864
98902
|
return [
|
|
98865
98903
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
98866
|
-
|
|
98904
|
+
join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
98867
98905
|
];
|
|
98868
98906
|
case "win32": {
|
|
98869
98907
|
const programFiles = process.env.ProgramFiles;
|
|
98870
98908
|
const localAppData = process.env.LOCALAPPDATA;
|
|
98871
98909
|
const paths = [];
|
|
98872
98910
|
if (programFiles) {
|
|
98873
|
-
paths.push(
|
|
98911
|
+
paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
|
|
98874
98912
|
}
|
|
98875
98913
|
if (localAppData) {
|
|
98876
|
-
paths.push(
|
|
98914
|
+
paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
|
|
98877
98915
|
}
|
|
98878
98916
|
return paths;
|
|
98879
98917
|
}
|
|
@@ -98881,8 +98919,8 @@ function getDesktopAppPaths(platform) {
|
|
|
98881
98919
|
return [
|
|
98882
98920
|
"/usr/bin/opencode",
|
|
98883
98921
|
"/usr/lib/opencode/opencode",
|
|
98884
|
-
|
|
98885
|
-
|
|
98922
|
+
join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
98923
|
+
join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
98886
98924
|
];
|
|
98887
98925
|
default:
|
|
98888
98926
|
return [];
|
|
@@ -98914,7 +98952,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
98914
98952
|
const candidates = getCommandCandidates2(platform);
|
|
98915
98953
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
98916
98954
|
for (const command of candidates) {
|
|
98917
|
-
const fullPath =
|
|
98955
|
+
const fullPath = join71(entry, command);
|
|
98918
98956
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
98919
98957
|
return { binary: command, path: fullPath };
|
|
98920
98958
|
}
|
|
@@ -99056,22 +99094,22 @@ init_package_json_locator();
|
|
|
99056
99094
|
import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
|
|
99057
99095
|
import { createRequire as createRequire2 } from "module";
|
|
99058
99096
|
import { homedir as homedir15 } from "os";
|
|
99059
|
-
import { join as
|
|
99097
|
+
import { join as join72 } from "path";
|
|
99060
99098
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
99061
99099
|
init_shared();
|
|
99062
99100
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
99063
99101
|
if (platform === "darwin")
|
|
99064
|
-
return
|
|
99102
|
+
return join72(homedir15(), "Library", "Caches");
|
|
99065
99103
|
if (platform === "win32")
|
|
99066
|
-
return process.env.LOCALAPPDATA ??
|
|
99067
|
-
return
|
|
99104
|
+
return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
|
|
99105
|
+
return join72(homedir15(), ".cache");
|
|
99068
99106
|
}
|
|
99069
99107
|
function resolveOpenCodeCacheDir() {
|
|
99070
99108
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
99071
99109
|
if (xdgCacheHome)
|
|
99072
|
-
return
|
|
99110
|
+
return join72(xdgCacheHome, "opencode");
|
|
99073
99111
|
const fromShared = getOpenCodeCacheDir();
|
|
99074
|
-
const platformDefault =
|
|
99112
|
+
const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
|
|
99075
99113
|
if (existsSync52(fromShared) || !existsSync52(platformDefault))
|
|
99076
99114
|
return fromShared;
|
|
99077
99115
|
return platformDefault;
|
|
@@ -99103,11 +99141,11 @@ function normalizeVersion(value) {
|
|
|
99103
99141
|
function createPackageCandidates(rootDir) {
|
|
99104
99142
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
99105
99143
|
packageName,
|
|
99106
|
-
installedPackagePath:
|
|
99144
|
+
installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
|
|
99107
99145
|
}));
|
|
99108
99146
|
}
|
|
99109
99147
|
function createTaggedInstallCandidates(rootDir) {
|
|
99110
|
-
const packagesDir =
|
|
99148
|
+
const packagesDir = join72(rootDir, "packages");
|
|
99111
99149
|
if (!existsSync52(packagesDir))
|
|
99112
99150
|
return [];
|
|
99113
99151
|
const candidates = [];
|
|
@@ -99115,14 +99153,14 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
99115
99153
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
99116
99154
|
if (packageName === undefined)
|
|
99117
99155
|
continue;
|
|
99118
|
-
const installDir =
|
|
99156
|
+
const installDir = join72(packagesDir, entryName);
|
|
99119
99157
|
candidates.push({
|
|
99120
99158
|
cacheDir: installDir,
|
|
99121
|
-
cachePackagePath:
|
|
99159
|
+
cachePackagePath: join72(installDir, "package.json"),
|
|
99122
99160
|
packageCandidates: [
|
|
99123
99161
|
{
|
|
99124
99162
|
packageName,
|
|
99125
|
-
installedPackagePath:
|
|
99163
|
+
installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
|
|
99126
99164
|
}
|
|
99127
99165
|
]
|
|
99128
99166
|
});
|
|
@@ -99167,13 +99205,13 @@ function getLoadedPluginVersion() {
|
|
|
99167
99205
|
const candidates = [
|
|
99168
99206
|
{
|
|
99169
99207
|
cacheDir: configDir,
|
|
99170
|
-
cachePackagePath:
|
|
99208
|
+
cachePackagePath: join72(configDir, "package.json"),
|
|
99171
99209
|
packageCandidates: createPackageCandidates(configDir)
|
|
99172
99210
|
},
|
|
99173
99211
|
...createTaggedInstallCandidates(configDir),
|
|
99174
99212
|
{
|
|
99175
99213
|
cacheDir,
|
|
99176
|
-
cachePackagePath:
|
|
99214
|
+
cachePackagePath: join72(cacheDir, "package.json"),
|
|
99177
99215
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
99178
99216
|
},
|
|
99179
99217
|
...createTaggedInstallCandidates(cacheDir)
|
|
@@ -99480,18 +99518,18 @@ function validatePluginConfig(directory) {
|
|
|
99480
99518
|
init_shared();
|
|
99481
99519
|
import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
|
|
99482
99520
|
import { homedir as homedir17 } from "os";
|
|
99483
|
-
import { join as
|
|
99521
|
+
import { join as join73 } from "path";
|
|
99484
99522
|
function getUserConfigDir2() {
|
|
99485
99523
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
99486
99524
|
if (xdgConfig)
|
|
99487
|
-
return
|
|
99488
|
-
return
|
|
99525
|
+
return join73(xdgConfig, "opencode");
|
|
99526
|
+
return join73(homedir17(), ".config", "opencode");
|
|
99489
99527
|
}
|
|
99490
99528
|
function loadCustomProviderNames() {
|
|
99491
99529
|
const configDir = getUserConfigDir2();
|
|
99492
99530
|
const candidatePaths = [
|
|
99493
|
-
|
|
99494
|
-
|
|
99531
|
+
join73(configDir, "opencode.json"),
|
|
99532
|
+
join73(configDir, "opencode.jsonc")
|
|
99495
99533
|
];
|
|
99496
99534
|
for (const configPath of candidatePaths) {
|
|
99497
99535
|
if (!existsSync54(configPath))
|
|
@@ -99512,7 +99550,7 @@ function loadCustomProviderNames() {
|
|
|
99512
99550
|
return [];
|
|
99513
99551
|
}
|
|
99514
99552
|
function loadAvailableModelsFromCache() {
|
|
99515
|
-
const cacheFile =
|
|
99553
|
+
const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
|
|
99516
99554
|
const customProviders = loadCustomProviderNames();
|
|
99517
99555
|
if (!existsSync54(cacheFile)) {
|
|
99518
99556
|
if (customProviders.length > 0) {
|
|
@@ -99549,8 +99587,8 @@ init_model_capabilities2();
|
|
|
99549
99587
|
init_shared();
|
|
99550
99588
|
init_plugin_identity();
|
|
99551
99589
|
import { readFileSync as readFileSync36 } from "fs";
|
|
99552
|
-
import { join as
|
|
99553
|
-
var PROJECT_CONFIG_DIR =
|
|
99590
|
+
import { join as join74 } from "path";
|
|
99591
|
+
var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
|
|
99554
99592
|
function loadOmoConfig() {
|
|
99555
99593
|
const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
|
|
99556
99594
|
basenames: [CONFIG_BASENAME],
|
|
@@ -99588,7 +99626,7 @@ function loadOmoConfig() {
|
|
|
99588
99626
|
|
|
99589
99627
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
99590
99628
|
init_shared();
|
|
99591
|
-
import { join as
|
|
99629
|
+
import { join as join75 } from "path";
|
|
99592
99630
|
|
|
99593
99631
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
99594
99632
|
function formatModelWithVariant(model, variant) {
|
|
@@ -99630,7 +99668,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
99630
99668
|
}
|
|
99631
99669
|
function buildModelResolutionDetails(options) {
|
|
99632
99670
|
const details = [];
|
|
99633
|
-
const cacheFile =
|
|
99671
|
+
const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
|
|
99634
99672
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
99635
99673
|
details.push("");
|
|
99636
99674
|
if (options.available.cacheExists) {
|
|
@@ -99909,25 +99947,25 @@ init_src();
|
|
|
99909
99947
|
import { existsSync as existsSync55 } from "fs";
|
|
99910
99948
|
import { createRequire as createRequire3 } from "module";
|
|
99911
99949
|
import { homedir as homedir19 } from "os";
|
|
99912
|
-
import { dirname as dirname29, join as
|
|
99950
|
+
import { dirname as dirname29, join as join77 } from "path";
|
|
99913
99951
|
|
|
99914
99952
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
99915
|
-
import { join as
|
|
99953
|
+
import { join as join76 } from "path";
|
|
99916
99954
|
import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
|
|
99917
99955
|
init_binary_downloader();
|
|
99918
99956
|
init_logger2();
|
|
99919
99957
|
init_plugin_identity();
|
|
99920
99958
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
99921
|
-
var DEBUG_FILE =
|
|
99959
|
+
var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
|
|
99922
99960
|
function getCacheDir2() {
|
|
99923
99961
|
if (process.platform === "win32") {
|
|
99924
99962
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
99925
|
-
const base2 = localAppData ||
|
|
99926
|
-
return
|
|
99963
|
+
const base2 = localAppData || join76(homedir18(), "AppData", "Local");
|
|
99964
|
+
return join76(base2, CACHE_DIR_NAME, "bin");
|
|
99927
99965
|
}
|
|
99928
99966
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
99929
|
-
const base = xdgCache ||
|
|
99930
|
-
return
|
|
99967
|
+
const base = xdgCache || join76(homedir18(), ".cache");
|
|
99968
|
+
return join76(base, CACHE_DIR_NAME, "bin");
|
|
99931
99969
|
}
|
|
99932
99970
|
function getBinaryName() {
|
|
99933
99971
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -99977,7 +100015,7 @@ async function getBinaryVersion(binary) {
|
|
|
99977
100015
|
}
|
|
99978
100016
|
}
|
|
99979
100017
|
async function checkAstGrepCli() {
|
|
99980
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
100018
|
+
const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
|
|
99981
100019
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
99982
100020
|
if (sgPath === null) {
|
|
99983
100021
|
return {
|
|
@@ -100007,10 +100045,10 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
100007
100045
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
100008
100046
|
try {
|
|
100009
100047
|
const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
|
|
100010
|
-
const vendorPath =
|
|
100048
|
+
const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
|
|
100011
100049
|
if (existsSync55(vendorPath))
|
|
100012
100050
|
return vendorPath;
|
|
100013
|
-
const binPath =
|
|
100051
|
+
const binPath = join77(packageDir, "bin", binaryName);
|
|
100014
100052
|
if (existsSync55(binPath))
|
|
100015
100053
|
return binPath;
|
|
100016
100054
|
} catch (error51) {
|
|
@@ -100156,7 +100194,7 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
100156
100194
|
|
|
100157
100195
|
// packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
|
|
100158
100196
|
import { readFileSync as readFileSync37 } from "fs";
|
|
100159
|
-
import { join as
|
|
100197
|
+
import { join as join78 } from "path";
|
|
100160
100198
|
|
|
100161
100199
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
100162
100200
|
import { existsSync as existsSync56 } from "fs";
|
|
@@ -100363,7 +100401,7 @@ function readOmoConfig(configDirectory) {
|
|
|
100363
100401
|
}
|
|
100364
100402
|
function isLspMcpDisabled(options) {
|
|
100365
100403
|
const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
|
|
100366
|
-
const projectConfigDirectory =
|
|
100404
|
+
const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
|
|
100367
100405
|
const userConfig = readOmoConfig(userConfigDirectory);
|
|
100368
100406
|
const projectConfig = readOmoConfig(projectConfigDirectory);
|
|
100369
100407
|
const disabledMcps = new Set([
|
|
@@ -100384,13 +100422,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
100384
100422
|
init_shared();
|
|
100385
100423
|
import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
|
|
100386
100424
|
import { homedir as homedir20 } from "os";
|
|
100387
|
-
import { join as
|
|
100425
|
+
import { join as join79 } from "path";
|
|
100388
100426
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
100389
100427
|
function getMcpConfigPaths() {
|
|
100390
100428
|
return [
|
|
100391
|
-
|
|
100392
|
-
|
|
100393
|
-
|
|
100429
|
+
join79(homedir20(), ".claude", ".mcp.json"),
|
|
100430
|
+
join79(process.cwd(), ".mcp.json"),
|
|
100431
|
+
join79(process.cwd(), ".claude", ".mcp.json")
|
|
100394
100432
|
];
|
|
100395
100433
|
}
|
|
100396
100434
|
function loadUserMcpConfig() {
|
|
@@ -100690,9 +100728,9 @@ async function pathExists(dir) {
|
|
|
100690
100728
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
100691
100729
|
init_src();
|
|
100692
100730
|
import { existsSync as existsSync59 } from "fs";
|
|
100693
|
-
import { lstat as lstat12, readdir as readdir10, readFile as
|
|
100731
|
+
import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "fs/promises";
|
|
100694
100732
|
import { homedir as homedir22 } from "os";
|
|
100695
|
-
import { basename as basename13, join as
|
|
100733
|
+
import { basename as basename13, join as join80, resolve as resolve22 } from "path";
|
|
100696
100734
|
// packages/omo-opencode/package.json
|
|
100697
100735
|
var package_default3 = {
|
|
100698
100736
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -100750,13 +100788,13 @@ var CODEX_BIN_NAMES = [
|
|
|
100750
100788
|
"omo-git-bash-hook"
|
|
100751
100789
|
];
|
|
100752
100790
|
async function gatherCodexSummary(deps = {}) {
|
|
100753
|
-
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
100791
|
+
const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
|
|
100754
100792
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
100755
100793
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
100756
100794
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
100757
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
100758
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
100759
|
-
const configPath =
|
|
100795
|
+
const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
100796
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
|
|
100797
|
+
const configPath = join80(codexHome, "config.toml");
|
|
100760
100798
|
const pluginVersion = stringField(manifest, "version");
|
|
100761
100799
|
return {
|
|
100762
100800
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -100813,7 +100851,7 @@ function buildCodexIssues(summary) {
|
|
|
100813
100851
|
if (summary.pluginRoot === null) {
|
|
100814
100852
|
issues.push({
|
|
100815
100853
|
title: "OMO Codex plugin is not installed",
|
|
100816
|
-
description: `Expected cached plugin at ${
|
|
100854
|
+
description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
100817
100855
|
fix: "Run: npx lazycodex-ai install",
|
|
100818
100856
|
severity: "error",
|
|
100819
100857
|
affects: ["plugin loading"]
|
|
@@ -100878,12 +100916,12 @@ function buildCodexIssues(summary) {
|
|
|
100878
100916
|
return issues;
|
|
100879
100917
|
}
|
|
100880
100918
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
100881
|
-
const pluginRoot =
|
|
100919
|
+
const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
100882
100920
|
if (!existsSync59(pluginRoot))
|
|
100883
100921
|
return null;
|
|
100884
100922
|
const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
|
|
100885
100923
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
100886
|
-
return candidates.length === 0 ? null :
|
|
100924
|
+
return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
100887
100925
|
}
|
|
100888
100926
|
async function readCodexConfigSummary(configPath) {
|
|
100889
100927
|
if (!existsSync59(configPath)) {
|
|
@@ -100897,7 +100935,7 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100897
100935
|
companionLifecycleHookStateEvents: []
|
|
100898
100936
|
};
|
|
100899
100937
|
}
|
|
100900
|
-
const content = await
|
|
100938
|
+
const content = await readFile23(configPath, "utf8");
|
|
100901
100939
|
return {
|
|
100902
100940
|
exists: true,
|
|
100903
100941
|
marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
|
|
@@ -100911,13 +100949,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
100911
100949
|
async function readLinkedBins(binDir) {
|
|
100912
100950
|
const linked = [];
|
|
100913
100951
|
for (const name of CODEX_BIN_NAMES) {
|
|
100914
|
-
if (await pathExists2(
|
|
100952
|
+
if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
100915
100953
|
linked.push(name);
|
|
100916
100954
|
}
|
|
100917
100955
|
return linked;
|
|
100918
100956
|
}
|
|
100919
100957
|
async function readLinkedAgents(codexHome) {
|
|
100920
|
-
const agentsDir =
|
|
100958
|
+
const agentsDir = join80(codexHome, "agents");
|
|
100921
100959
|
if (!existsSync59(agentsDir))
|
|
100922
100960
|
return [];
|
|
100923
100961
|
const entries = await readdir10(agentsDir, { withFileTypes: true });
|
|
@@ -100925,7 +100963,7 @@ async function readLinkedAgents(codexHome) {
|
|
|
100925
100963
|
}
|
|
100926
100964
|
async function readJson(path16) {
|
|
100927
100965
|
try {
|
|
100928
|
-
const parsed = JSON.parse(await
|
|
100966
|
+
const parsed = JSON.parse(await readFile23(path16, "utf8"));
|
|
100929
100967
|
return isPlainRecord(parsed) ? parsed : null;
|
|
100930
100968
|
} catch (error51) {
|
|
100931
100969
|
if (error51 instanceof Error)
|
|
@@ -101031,9 +101069,9 @@ async function pathExists2(path16) {
|
|
|
101031
101069
|
|
|
101032
101070
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
101033
101071
|
init_src();
|
|
101034
|
-
import { readdir as readdir11, readFile as
|
|
101072
|
+
import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "fs/promises";
|
|
101035
101073
|
import { homedir as homedir23 } from "os";
|
|
101036
|
-
import { dirname as dirname31, isAbsolute as isAbsolute12, join as
|
|
101074
|
+
import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
|
|
101037
101075
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
101038
101076
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
101039
101077
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -101043,7 +101081,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101043
101081
|
const env3 = deps.env ?? process.env;
|
|
101044
101082
|
const platform = deps.platform ?? process.platform;
|
|
101045
101083
|
const arch = deps.arch ?? process.arch;
|
|
101046
|
-
const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ??
|
|
101084
|
+
const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
|
|
101047
101085
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
101048
101086
|
if (summary.pluginRoot === null) {
|
|
101049
101087
|
return {
|
|
@@ -101068,7 +101106,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
101068
101106
|
});
|
|
101069
101107
|
}
|
|
101070
101108
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
101071
|
-
const runtimeSgPath =
|
|
101109
|
+
const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
|
|
101072
101110
|
const sg = findSgBinarySync({
|
|
101073
101111
|
arch,
|
|
101074
101112
|
env: env3,
|
|
@@ -101180,7 +101218,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
101180
101218
|
for (const entry of entries) {
|
|
101181
101219
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
101182
101220
|
continue;
|
|
101183
|
-
const entryPath =
|
|
101221
|
+
const entryPath = join81(root, entry.name);
|
|
101184
101222
|
if (entry.isDirectory()) {
|
|
101185
101223
|
paths2.push(...await findManifestPaths(entryPath, manifestName));
|
|
101186
101224
|
continue;
|
|
@@ -101224,18 +101262,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
101224
101262
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
101225
101263
|
}
|
|
101226
101264
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
101227
|
-
return
|
|
101265
|
+
return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
101228
101266
|
}
|
|
101229
101267
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
101230
101268
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
101231
101269
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
101232
101270
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
101233
|
-
if (sgPath ===
|
|
101271
|
+
if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
|
|
101234
101272
|
return "runtime dir";
|
|
101235
101273
|
return "PATH";
|
|
101236
101274
|
}
|
|
101237
101275
|
async function readBootstrapStateSummary(codexHome) {
|
|
101238
|
-
const statePath =
|
|
101276
|
+
const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
101239
101277
|
const raw = await readJson2(statePath);
|
|
101240
101278
|
if (raw === null)
|
|
101241
101279
|
return null;
|
|
@@ -101284,7 +101322,7 @@ function degradedDetailLines(entries) {
|
|
|
101284
101322
|
}
|
|
101285
101323
|
async function readJson2(path16) {
|
|
101286
101324
|
try {
|
|
101287
|
-
const parsed = JSON.parse(await
|
|
101325
|
+
const parsed = JSON.parse(await readFile24(path16, "utf8"));
|
|
101288
101326
|
return isRecord5(parsed) ? parsed : null;
|
|
101289
101327
|
} catch (error51) {
|
|
101290
101328
|
if (error51 instanceof Error)
|
|
@@ -101312,17 +101350,17 @@ function isRecord5(value) {
|
|
|
101312
101350
|
|
|
101313
101351
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
101314
101352
|
import { existsSync as existsSync60 } from "fs";
|
|
101315
|
-
import { readFile as
|
|
101353
|
+
import { readFile as readFile25 } from "fs/promises";
|
|
101316
101354
|
import { homedir as homedir24 } from "os";
|
|
101317
|
-
import { join as
|
|
101355
|
+
import { join as join82, resolve as resolve24 } from "path";
|
|
101318
101356
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
101319
101357
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
101320
101358
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
101321
101359
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
101322
|
-
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
101360
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
|
|
101323
101361
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
101324
101362
|
const platform = deps.platform ?? process.platform;
|
|
101325
|
-
const wrapperPath =
|
|
101363
|
+
const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
101326
101364
|
const wrapper = await readRuntimeWrapper(wrapperPath);
|
|
101327
101365
|
const issues = [];
|
|
101328
101366
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -101347,7 +101385,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
|
|
|
101347
101385
|
}
|
|
101348
101386
|
async function readRuntimeWrapper(path16) {
|
|
101349
101387
|
try {
|
|
101350
|
-
return await
|
|
101388
|
+
return await readFile25(path16, "utf8");
|
|
101351
101389
|
} catch (error51) {
|
|
101352
101390
|
if (error51 instanceof Error)
|
|
101353
101391
|
return null;
|
|
@@ -101834,12 +101872,12 @@ import {
|
|
|
101834
101872
|
unlinkSync as unlinkSync8,
|
|
101835
101873
|
writeFileSync as writeFileSync11
|
|
101836
101874
|
} from "fs";
|
|
101837
|
-
import { basename as basename14, dirname as dirname32, join as
|
|
101875
|
+
import { basename as basename14, dirname as dirname32, join as join85 } from "path";
|
|
101838
101876
|
|
|
101839
101877
|
// packages/mcp-client-core/src/config-dir.ts
|
|
101840
101878
|
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
101841
101879
|
import { homedir as homedir25 } from "os";
|
|
101842
|
-
import { join as
|
|
101880
|
+
import { join as join83, resolve as resolve25 } from "path";
|
|
101843
101881
|
function resolveConfigPath2(pathValue) {
|
|
101844
101882
|
const resolvedPath = resolve25(pathValue);
|
|
101845
101883
|
if (!existsSync61(resolvedPath))
|
|
@@ -101857,13 +101895,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
101857
101895
|
if (customConfigDir) {
|
|
101858
101896
|
return resolveConfigPath2(customConfigDir);
|
|
101859
101897
|
}
|
|
101860
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
101861
|
-
return resolveConfigPath2(
|
|
101898
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
|
|
101899
|
+
return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
|
|
101862
101900
|
}
|
|
101863
101901
|
|
|
101864
101902
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
101865
101903
|
import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
|
|
101866
|
-
import { join as
|
|
101904
|
+
import { join as join84 } from "path";
|
|
101867
101905
|
var INDEX_FILE_NAME = "index.json";
|
|
101868
101906
|
function isTokenIndex(value) {
|
|
101869
101907
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -101871,7 +101909,7 @@ function isTokenIndex(value) {
|
|
|
101871
101909
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
101872
101910
|
}
|
|
101873
101911
|
function getIndexPath(storageDir) {
|
|
101874
|
-
return
|
|
101912
|
+
return join84(storageDir, INDEX_FILE_NAME);
|
|
101875
101913
|
}
|
|
101876
101914
|
function readTokenIndex(storageDir) {
|
|
101877
101915
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -101915,16 +101953,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
101915
101953
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
101916
101954
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
101917
101955
|
function getMcpOauthStorageDir() {
|
|
101918
|
-
return
|
|
101956
|
+
return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
101919
101957
|
}
|
|
101920
101958
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
101921
101959
|
return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
101922
101960
|
}
|
|
101923
101961
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
101924
|
-
return
|
|
101962
|
+
return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
101925
101963
|
}
|
|
101926
101964
|
function getLegacyStoragePath() {
|
|
101927
|
-
return
|
|
101965
|
+
return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
101928
101966
|
}
|
|
101929
101967
|
function normalizeHost2(serverHost) {
|
|
101930
101968
|
let host = serverHost.trim();
|
|
@@ -102103,7 +102141,7 @@ function listTokensByHost(serverHost) {
|
|
|
102103
102141
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
102104
102142
|
if (!indexedKey.startsWith(prefix))
|
|
102105
102143
|
continue;
|
|
102106
|
-
const indexedToken = readTokenFile(
|
|
102144
|
+
const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
102107
102145
|
if (indexedToken)
|
|
102108
102146
|
result[indexedKey] = indexedToken;
|
|
102109
102147
|
}
|
|
@@ -102118,7 +102156,7 @@ function listAllTokens() {
|
|
|
102118
102156
|
for (const entry of readdirSync9(dir, { withFileTypes: true })) {
|
|
102119
102157
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
102120
102158
|
continue;
|
|
102121
|
-
const token = readTokenFile(
|
|
102159
|
+
const token = readTokenFile(join85(dir, entry.name));
|
|
102122
102160
|
const hash2 = basename14(entry.name, ".json");
|
|
102123
102161
|
if (token)
|
|
102124
102162
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -102842,8 +102880,9 @@ async function boulder(options) {
|
|
|
102842
102880
|
}
|
|
102843
102881
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
102844
102882
|
import { spawn as spawn5 } from "child_process";
|
|
102845
|
-
import { existsSync as existsSync65, realpathSync as realpathSync9 } from "fs";
|
|
102883
|
+
import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "fs";
|
|
102846
102884
|
import { homedir as homedir26 } from "os";
|
|
102885
|
+
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
102847
102886
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
102848
102887
|
const env3 = input.env ?? process.env;
|
|
102849
102888
|
const homeDir = input.homeDir ?? homedir26();
|
|
@@ -102856,6 +102895,8 @@ function resolveCodexUlwLoopCommand(input = {}) {
|
|
|
102856
102895
|
});
|
|
102857
102896
|
if (componentCli !== null)
|
|
102858
102897
|
return { executable: process.execPath, argsPrefix: [componentCli] };
|
|
102898
|
+
if (env3[ULW_LOOP_DELEGATION_SENTINEL] === "1")
|
|
102899
|
+
return null;
|
|
102859
102900
|
const legacyLocalBin = resolveLegacyLocalOmoBin(env3, homeDir, input.currentExecutablePaths ?? [process.argv[1]].filter((value) => typeof value === "string"));
|
|
102860
102901
|
if (legacyLocalBin !== null)
|
|
102861
102902
|
return { executable: legacyLocalBin, argsPrefix: ["ulw-loop"] };
|
|
@@ -102867,14 +102908,17 @@ async function codexUlwLoop(args) {
|
|
|
102867
102908
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
102868
102909
|
return 1;
|
|
102869
102910
|
}
|
|
102870
|
-
|
|
102871
|
-
|
|
102872
|
-
|
|
102873
|
-
|
|
102874
|
-
resolve26(1);
|
|
102875
|
-
});
|
|
102876
|
-
child.on("close", (code) => resolve26(code ?? 1));
|
|
102911
|
+
const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
|
|
102912
|
+
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
102913
|
+
stdio: "inherit",
|
|
102914
|
+
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
102877
102915
|
});
|
|
102916
|
+
child.on("error", (error51) => {
|
|
102917
|
+
console.error(error51.message);
|
|
102918
|
+
resolve26(1);
|
|
102919
|
+
});
|
|
102920
|
+
child.on("close", (code) => resolve26(code ?? 1));
|
|
102921
|
+
return promise2;
|
|
102878
102922
|
}
|
|
102879
102923
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
102880
102924
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
@@ -102882,7 +102926,16 @@ function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
|
102882
102926
|
}
|
|
102883
102927
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
102884
102928
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
102885
|
-
return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
|
|
102929
|
+
return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
|
|
102930
|
+
}
|
|
102931
|
+
function isGeneratedRuntimeWrapper(candidate) {
|
|
102932
|
+
try {
|
|
102933
|
+
return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
|
|
102934
|
+
} catch (error51) {
|
|
102935
|
+
if (error51 instanceof Error)
|
|
102936
|
+
return false;
|
|
102937
|
+
return false;
|
|
102938
|
+
}
|
|
102886
102939
|
}
|
|
102887
102940
|
function isCurrentExecutable(candidate, currentExecutablePaths) {
|
|
102888
102941
|
const candidateRealPath = realpathOrSelf(candidate);
|