oh-my-opencode 5.0.0-beta.6 → 5.0.0-beta.7
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.md +12 -1
- package/dist/cli/index.js +274 -190
- package/dist/cli-node/index.js +274 -190
- package/dist/index.js +95 -22
- package/dist/tui.js +77 -4
- package/package.json +14 -14
- 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/dist/cli.js +76 -3
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +76 -3
- 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/dist/.omo-runtime-manifest.json +2 -2
- 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/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 +6 -0
- 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 +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- 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 +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +106 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
- 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-guarding-ulw-loop-spawns.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/stop-checking-ulw-loop-resume.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/skills/ultrawork/SKILL.md +6 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +106 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
package/dist/cli-node/index.js
CHANGED
|
@@ -2146,7 +2146,7 @@ var package_default;
|
|
|
2146
2146
|
var init_package = __esm(() => {
|
|
2147
2147
|
package_default = {
|
|
2148
2148
|
name: "oh-my-opencode",
|
|
2149
|
-
version: "5.0.0-beta.
|
|
2149
|
+
version: "5.0.0-beta.7",
|
|
2150
2150
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
2151
2151
|
main: "./dist/index.js",
|
|
2152
2152
|
types: "dist/index.d.ts",
|
|
@@ -2326,7 +2326,7 @@ var init_package = __esm(() => {
|
|
|
2326
2326
|
zod: "^4.4.3"
|
|
2327
2327
|
},
|
|
2328
2328
|
devDependencies: {
|
|
2329
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2329
|
+
"@code-yeongyu/senpi": "2026.8.12-4",
|
|
2330
2330
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2331
2331
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2332
2332
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2367,18 +2367,18 @@ var init_package = __esm(() => {
|
|
|
2367
2367
|
typescript: "^7.0.2"
|
|
2368
2368
|
},
|
|
2369
2369
|
optionalDependencies: {
|
|
2370
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
2371
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
2372
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
2373
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
2374
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
2375
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
2376
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
2377
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
2378
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
2379
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
2380
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
2381
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
2370
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.7",
|
|
2371
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.7",
|
|
2372
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.7",
|
|
2373
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.7",
|
|
2374
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.7",
|
|
2375
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.7",
|
|
2376
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.7",
|
|
2377
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.7",
|
|
2378
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.7",
|
|
2379
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.7",
|
|
2380
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.7",
|
|
2381
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.7"
|
|
2382
2382
|
},
|
|
2383
2383
|
overrides: {
|
|
2384
2384
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -22406,15 +22406,16 @@ var init_codegraph = __esm(() => {
|
|
|
22406
22406
|
});
|
|
22407
22407
|
|
|
22408
22408
|
// packages/omo-config-core/src/schema/memory.ts
|
|
22409
|
-
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22409
|
+
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22410
22410
|
var init_memory = __esm(() => {
|
|
22411
22411
|
init_zod();
|
|
22412
22412
|
OmoMemoryReflectionTriggerSchema = object({
|
|
22413
|
-
step_count: number2().int().nonnegative().default(
|
|
22413
|
+
step_count: number2().int().nonnegative().default(25),
|
|
22414
22414
|
on_compaction: boolean2().default(true)
|
|
22415
22415
|
}).strict();
|
|
22416
22416
|
OmoMemoryReflectionSchema = object({
|
|
22417
|
-
|
|
22417
|
+
enabled: boolean2().default(true),
|
|
22418
|
+
trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
|
|
22418
22419
|
merge: _enum2(["auto", "integration"]).default("auto"),
|
|
22419
22420
|
category: string2().min(1).default("quick"),
|
|
22420
22421
|
timeout_minutes: number2().int().positive().default(15),
|
|
@@ -22427,11 +22428,36 @@ var init_memory = __esm(() => {
|
|
|
22427
22428
|
OmoMemorySearchSchema = object({
|
|
22428
22429
|
enabled: boolean2().default(true)
|
|
22429
22430
|
}).strict();
|
|
22431
|
+
OmoMemoryNudgeSchema = object({
|
|
22432
|
+
enabled: boolean2().default(true),
|
|
22433
|
+
every_user_turns: number2().int().min(1).default(10)
|
|
22434
|
+
}).strict();
|
|
22435
|
+
OmoMemoryFactsSchema = object({
|
|
22436
|
+
enabled: boolean2().default(true),
|
|
22437
|
+
debounce_settles: number2().int().min(1).default(4)
|
|
22438
|
+
}).strict();
|
|
22439
|
+
OmoMemoryDreamSchema = object({
|
|
22440
|
+
enabled: boolean2().default(true),
|
|
22441
|
+
idle_minutes: number2().int().min(0).default(30),
|
|
22442
|
+
min_hours_between: number2().int().min(1).default(24),
|
|
22443
|
+
shutdown_launch: boolean2().default(true),
|
|
22444
|
+
auto_select_max: number2().int().min(1).max(10).default(5),
|
|
22445
|
+
auto_select_max_chars: number2().int().min(1e4).default(150000)
|
|
22446
|
+
}).strict();
|
|
22447
|
+
OmoMemoryPeopleSchema = object({
|
|
22448
|
+
enabled: boolean2().default(true),
|
|
22449
|
+
max_entries: number2().int().min(1).max(100).default(40),
|
|
22450
|
+
max_entry_chars: number2().int().min(50).max(500).default(200)
|
|
22451
|
+
}).strict();
|
|
22452
|
+
OmoMemorySoulSchema = object({
|
|
22453
|
+
edit_notice: boolean2().default(true)
|
|
22454
|
+
}).strict();
|
|
22430
22455
|
OmoMemoryReflectionTriggerLayerSchema = object({
|
|
22431
22456
|
step_count: number2().int().nonnegative().optional(),
|
|
22432
22457
|
on_compaction: boolean2().optional()
|
|
22433
22458
|
}).strict();
|
|
22434
22459
|
OmoMemoryReflectionLayerSchema = object({
|
|
22460
|
+
enabled: boolean2().optional(),
|
|
22435
22461
|
trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
|
|
22436
22462
|
merge: _enum2(["auto", "integration"]).optional(),
|
|
22437
22463
|
category: string2().min(1).optional(),
|
|
@@ -22445,10 +22471,39 @@ var init_memory = __esm(() => {
|
|
|
22445
22471
|
OmoMemorySearchLayerSchema = object({
|
|
22446
22472
|
enabled: boolean2().optional()
|
|
22447
22473
|
}).strict();
|
|
22474
|
+
OmoMemoryNudgeLayerSchema = object({
|
|
22475
|
+
enabled: boolean2().optional(),
|
|
22476
|
+
every_user_turns: number2().int().min(1).optional()
|
|
22477
|
+
}).strict();
|
|
22478
|
+
OmoMemoryFactsLayerSchema = object({
|
|
22479
|
+
enabled: boolean2().optional(),
|
|
22480
|
+
debounce_settles: number2().int().min(1).optional()
|
|
22481
|
+
}).strict();
|
|
22482
|
+
OmoMemoryDreamLayerSchema = object({
|
|
22483
|
+
enabled: boolean2().optional(),
|
|
22484
|
+
idle_minutes: number2().int().min(0).optional(),
|
|
22485
|
+
min_hours_between: number2().int().min(1).optional(),
|
|
22486
|
+
shutdown_launch: boolean2().optional(),
|
|
22487
|
+
auto_select_max: number2().int().min(1).max(10).optional(),
|
|
22488
|
+
auto_select_max_chars: number2().int().min(1e4).optional()
|
|
22489
|
+
}).strict();
|
|
22490
|
+
OmoMemoryPeopleLayerSchema = object({
|
|
22491
|
+
enabled: boolean2().optional(),
|
|
22492
|
+
max_entries: number2().int().min(1).max(100).optional(),
|
|
22493
|
+
max_entry_chars: number2().int().min(50).max(500).optional()
|
|
22494
|
+
}).strict();
|
|
22495
|
+
OmoMemorySoulLayerSchema = object({
|
|
22496
|
+
edit_notice: boolean2().optional()
|
|
22497
|
+
}).strict();
|
|
22448
22498
|
OmoMemoryAgentOverridesSchema = object({
|
|
22449
22499
|
enabled: boolean2().optional(),
|
|
22450
22500
|
agent: string2().min(1).optional(),
|
|
22451
22501
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22502
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22503
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22504
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22505
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22506
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22452
22507
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22453
22508
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22454
22509
|
compile_warn_tokens: number2().int().positive().optional()
|
|
@@ -22458,12 +22513,25 @@ var init_memory = __esm(() => {
|
|
|
22458
22513
|
agent: string2().min(1).default("auto"),
|
|
22459
22514
|
tool_exposure: _enum2(["direct", "search"]).default("direct"),
|
|
22460
22515
|
reflection: OmoMemoryReflectionSchema.default({
|
|
22461
|
-
|
|
22516
|
+
enabled: true,
|
|
22517
|
+
trigger: { step_count: 25, on_compaction: true },
|
|
22462
22518
|
merge: "auto",
|
|
22463
22519
|
category: "quick",
|
|
22464
22520
|
timeout_minutes: 15,
|
|
22465
22521
|
sandbox: "auto"
|
|
22466
22522
|
}),
|
|
22523
|
+
nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
|
|
22524
|
+
facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
|
|
22525
|
+
dream: OmoMemoryDreamSchema.default({
|
|
22526
|
+
enabled: true,
|
|
22527
|
+
idle_minutes: 30,
|
|
22528
|
+
min_hours_between: 24,
|
|
22529
|
+
shutdown_launch: true,
|
|
22530
|
+
auto_select_max: 5,
|
|
22531
|
+
auto_select_max_chars: 150000
|
|
22532
|
+
}),
|
|
22533
|
+
people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
|
|
22534
|
+
soul: OmoMemorySoulSchema.default({ edit_notice: true }),
|
|
22467
22535
|
sync: OmoMemorySyncSchema.default({ enabled: true }),
|
|
22468
22536
|
search: OmoMemorySearchSchema.default({ enabled: true }),
|
|
22469
22537
|
compile_warn_tokens: number2().int().positive().default(30000),
|
|
@@ -22474,6 +22542,11 @@ var init_memory = __esm(() => {
|
|
|
22474
22542
|
agent: string2().min(1).optional(),
|
|
22475
22543
|
tool_exposure: _enum2(["direct", "search"]).optional(),
|
|
22476
22544
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22545
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22546
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22547
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22548
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22549
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22477
22550
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22478
22551
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22479
22552
|
compile_warn_tokens: number2().int().positive().optional(),
|
|
@@ -94540,7 +94613,7 @@ var package_default2;
|
|
|
94540
94613
|
var init_package2 = __esm(() => {
|
|
94541
94614
|
package_default2 = {
|
|
94542
94615
|
name: "@oh-my-opencode/omo-codex",
|
|
94543
|
-
version: "5.0.0-beta.
|
|
94616
|
+
version: "5.0.0-beta.7",
|
|
94544
94617
|
type: "module",
|
|
94545
94618
|
private: true,
|
|
94546
94619
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -95510,19 +95583,19 @@ var init_update_toasts = __esm(() => {
|
|
|
95510
95583
|
|
|
95511
95584
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95512
95585
|
import { existsSync as existsSync47 } from "node:fs";
|
|
95513
|
-
import { dirname as
|
|
95586
|
+
import { dirname as dirname30, join as join75 } from "node:path";
|
|
95514
95587
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
95515
95588
|
function defaultGetModuleHostingWorkspace() {
|
|
95516
95589
|
try {
|
|
95517
|
-
const currentDir =
|
|
95590
|
+
const currentDir = dirname30(fileURLToPath5(import.meta.url));
|
|
95518
95591
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
95519
95592
|
if (!pkgJsonPath)
|
|
95520
95593
|
return null;
|
|
95521
|
-
const pkgDir =
|
|
95522
|
-
const nodeModulesDir =
|
|
95594
|
+
const pkgDir = dirname30(pkgJsonPath);
|
|
95595
|
+
const nodeModulesDir = dirname30(pkgDir);
|
|
95523
95596
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
95524
95597
|
return null;
|
|
95525
|
-
return
|
|
95598
|
+
return dirname30(nodeModulesDir);
|
|
95526
95599
|
} catch (error51) {
|
|
95527
95600
|
if (error51 instanceof Error) {
|
|
95528
95601
|
return null;
|
|
@@ -95664,7 +95737,7 @@ var init_background_update_check = __esm(() => {
|
|
|
95664
95737
|
init_update_toasts();
|
|
95665
95738
|
defaultDeps4 = {
|
|
95666
95739
|
existsSync: existsSync47,
|
|
95667
|
-
join:
|
|
95740
|
+
join: join75,
|
|
95668
95741
|
runBunInstallWithDetails,
|
|
95669
95742
|
log: log2,
|
|
95670
95743
|
getOpenCodeCacheDir,
|
|
@@ -101439,11 +101512,9 @@ function nodeErrorCode6(error51) {
|
|
|
101439
101512
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101440
101513
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101441
101514
|
import { execFile as execFile4 } from "node:child_process";
|
|
101442
|
-
import {
|
|
101443
|
-
import { constants as constants8, existsSync as existsSync31 } from "node:fs";
|
|
101444
|
-
import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
|
|
101515
|
+
import { existsSync as existsSync31 } from "node:fs";
|
|
101445
101516
|
import { homedir as homedir10 } from "node:os";
|
|
101446
|
-
import { dirname as
|
|
101517
|
+
import { dirname as dirname24, join as join62, resolve as resolve19 } from "node:path";
|
|
101447
101518
|
import { fileURLToPath } from "node:url";
|
|
101448
101519
|
import { promisify as promisify2 } from "node:util";
|
|
101449
101520
|
|
|
@@ -101519,6 +101590,12 @@ node "%~dp0omo" %*\r
|
|
|
101519
101590
|
return path6;
|
|
101520
101591
|
}
|
|
101521
101592
|
|
|
101593
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101594
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
101595
|
+
import { constants as constants8 } from "node:fs";
|
|
101596
|
+
import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
|
|
101597
|
+
import { dirname as dirname23, join as join61 } from "node:path";
|
|
101598
|
+
|
|
101522
101599
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101523
101600
|
import { constants as constants7 } from "node:fs";
|
|
101524
101601
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
|
|
@@ -101624,11 +101701,15 @@ function isErrno(error51, code) {
|
|
|
101624
101701
|
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101625
101702
|
}
|
|
101626
101703
|
|
|
101627
|
-
// packages/omo-senpi/src/install/
|
|
101628
|
-
var execFileAsync2 = promisify2(execFile4);
|
|
101704
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101629
101705
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101630
101706
|
join61("extensions", "omo.js"),
|
|
101707
|
+
join61("extensions", "omo-task.js"),
|
|
101708
|
+
join61("extensions", "omo-member.js"),
|
|
101709
|
+
join61("extensions", "memory-run-supervisor.mjs"),
|
|
101631
101710
|
join61("extensions", "reflection-persona.md"),
|
|
101711
|
+
join61("extensions", "dream-persona.md"),
|
|
101712
|
+
join61("extensions", "facts-persona.md"),
|
|
101632
101713
|
join61("skills", "ast-grep", "SKILL.md"),
|
|
101633
101714
|
join61("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101634
101715
|
join61("skills", "debugging", "SKILL.md"),
|
|
@@ -101661,47 +101742,6 @@ var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
|
101661
101742
|
join61("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101662
101743
|
join61("scripts", "install.mjs")
|
|
101663
101744
|
];
|
|
101664
|
-
async function runSenpiInstaller(options = {}) {
|
|
101665
|
-
const context = resolveInstallContext(options);
|
|
101666
|
-
await ensurePluginArtifacts(context);
|
|
101667
|
-
const settings = await readSettings(context.settingsPath);
|
|
101668
|
-
const before = JSON.stringify(settings);
|
|
101669
|
-
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101670
|
-
if (!packages.includes(context.pluginPath))
|
|
101671
|
-
packages.push(context.pluginPath);
|
|
101672
|
-
settings.packages = packages;
|
|
101673
|
-
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101674
|
-
installLocalLauncher({
|
|
101675
|
-
pluginPath: context.pluginPath,
|
|
101676
|
-
senpiCliPath: join61(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101677
|
-
});
|
|
101678
|
-
return {
|
|
101679
|
-
ok: true,
|
|
101680
|
-
action: "install",
|
|
101681
|
-
agentDir: context.agentDir,
|
|
101682
|
-
settingsPath: context.settingsPath,
|
|
101683
|
-
pluginPath: context.pluginPath,
|
|
101684
|
-
changed: JSON.stringify(settings) !== before,
|
|
101685
|
-
backupPath
|
|
101686
|
-
};
|
|
101687
|
-
}
|
|
101688
|
-
function resolveInstallContext(options) {
|
|
101689
|
-
const env3 = options.env ?? process.env;
|
|
101690
|
-
const allowBuild = options.pluginPath === undefined;
|
|
101691
|
-
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname23(fileURLToPath(import.meta.url))) : dirname23(resolve19(options.pluginPath))));
|
|
101692
|
-
const agentDir = resolve19(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join61(homedir10(), ".senpi", "agent"));
|
|
101693
|
-
const pluginPath = resolve19(options.pluginPath ?? join61(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101694
|
-
return {
|
|
101695
|
-
env: env3,
|
|
101696
|
-
repoRoot,
|
|
101697
|
-
agentDir,
|
|
101698
|
-
settingsPath: join61(agentDir, "settings.json"),
|
|
101699
|
-
pluginPath,
|
|
101700
|
-
platform: options.platform ?? process.platform,
|
|
101701
|
-
allowBuild,
|
|
101702
|
-
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101703
|
-
};
|
|
101704
|
-
}
|
|
101705
101745
|
async function ensurePluginArtifacts(context) {
|
|
101706
101746
|
if (context.allowBuild) {
|
|
101707
101747
|
await context.runCommand("node", [join61(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
@@ -101773,6 +101813,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
|
|
|
101773
101813
|
function messageOf(error51) {
|
|
101774
101814
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
101775
101815
|
}
|
|
101816
|
+
async function fileExists2(path6) {
|
|
101817
|
+
try {
|
|
101818
|
+
await access2(path6, constants8.F_OK);
|
|
101819
|
+
return true;
|
|
101820
|
+
} catch (error51) {
|
|
101821
|
+
if (isErrno2(error51, "ENOENT"))
|
|
101822
|
+
return false;
|
|
101823
|
+
throw error51;
|
|
101824
|
+
}
|
|
101825
|
+
}
|
|
101826
|
+
function isErrno2(error51, code) {
|
|
101827
|
+
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101828
|
+
}
|
|
101829
|
+
|
|
101830
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101831
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
101832
|
+
async function runSenpiInstaller(options = {}) {
|
|
101833
|
+
const context = resolveInstallContext(options);
|
|
101834
|
+
await ensurePluginArtifacts(context);
|
|
101835
|
+
const settings = await readSettings(context.settingsPath);
|
|
101836
|
+
const before = JSON.stringify(settings);
|
|
101837
|
+
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101838
|
+
if (!packages.includes(context.pluginPath))
|
|
101839
|
+
packages.push(context.pluginPath);
|
|
101840
|
+
settings.packages = packages;
|
|
101841
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101842
|
+
installLocalLauncher({
|
|
101843
|
+
pluginPath: context.pluginPath,
|
|
101844
|
+
senpiCliPath: join62(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101845
|
+
});
|
|
101846
|
+
return {
|
|
101847
|
+
ok: true,
|
|
101848
|
+
action: "install",
|
|
101849
|
+
agentDir: context.agentDir,
|
|
101850
|
+
settingsPath: context.settingsPath,
|
|
101851
|
+
pluginPath: context.pluginPath,
|
|
101852
|
+
changed: JSON.stringify(settings) !== before,
|
|
101853
|
+
backupPath
|
|
101854
|
+
};
|
|
101855
|
+
}
|
|
101856
|
+
function resolveInstallContext(options) {
|
|
101857
|
+
const env3 = options.env ?? process.env;
|
|
101858
|
+
const allowBuild = options.pluginPath === undefined;
|
|
101859
|
+
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve19(options.pluginPath))));
|
|
101860
|
+
const agentDir = resolve19(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join62(homedir10(), ".senpi", "agent"));
|
|
101861
|
+
const pluginPath = resolve19(options.pluginPath ?? join62(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101862
|
+
return {
|
|
101863
|
+
env: env3,
|
|
101864
|
+
repoRoot,
|
|
101865
|
+
agentDir,
|
|
101866
|
+
settingsPath: join62(agentDir, "settings.json"),
|
|
101867
|
+
pluginPath,
|
|
101868
|
+
platform: options.platform ?? process.platform,
|
|
101869
|
+
allowBuild,
|
|
101870
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101871
|
+
};
|
|
101872
|
+
}
|
|
101776
101873
|
async function defaultRunCommand3(command, args, options) {
|
|
101777
101874
|
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
101778
101875
|
if (result.stderr.trim().length > 0)
|
|
@@ -101783,28 +101880,15 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101783
101880
|
function findRepoRoot2(importerDir) {
|
|
101784
101881
|
let current = importerDir;
|
|
101785
101882
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101786
|
-
if (fileExistsSync(
|
|
101883
|
+
if (fileExistsSync(join62(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101787
101884
|
return current;
|
|
101788
101885
|
current = resolve19(current, "..");
|
|
101789
101886
|
}
|
|
101790
101887
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101791
101888
|
}
|
|
101792
|
-
async function fileExists2(path6) {
|
|
101793
|
-
try {
|
|
101794
|
-
await access2(path6, constants8.F_OK);
|
|
101795
|
-
return true;
|
|
101796
|
-
} catch (error51) {
|
|
101797
|
-
if (isErrno2(error51, "ENOENT"))
|
|
101798
|
-
return false;
|
|
101799
|
-
throw error51;
|
|
101800
|
-
}
|
|
101801
|
-
}
|
|
101802
101889
|
function fileExistsSync(path6) {
|
|
101803
101890
|
return existsSync31(path6);
|
|
101804
101891
|
}
|
|
101805
|
-
function isErrno2(error51, code) {
|
|
101806
|
-
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101807
|
-
}
|
|
101808
101892
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101809
101893
|
import { execFile as execFile5 } from "node:child_process";
|
|
101810
101894
|
import { promisify as promisify3 } from "node:util";
|
|
@@ -101840,19 +101924,19 @@ init_provider_availability();
|
|
|
101840
101924
|
|
|
101841
101925
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101842
101926
|
import { existsSync as existsSync33, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "node:fs";
|
|
101843
|
-
import { join as
|
|
101927
|
+
import { join as join64 } from "node:path";
|
|
101844
101928
|
|
|
101845
101929
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101846
101930
|
init_shared();
|
|
101847
101931
|
import { existsSync as existsSync32, readFileSync as readFileSync15 } from "node:fs";
|
|
101848
|
-
import { join as
|
|
101932
|
+
import { join as join63 } from "node:path";
|
|
101849
101933
|
var TUI_SUBPATH = "tui";
|
|
101850
101934
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101851
101935
|
function fileEntryPackageJsonPath(entry) {
|
|
101852
101936
|
let path6 = entry.slice("file:".length);
|
|
101853
101937
|
if (path6.startsWith("//"))
|
|
101854
101938
|
path6 = path6.slice(2);
|
|
101855
|
-
return
|
|
101939
|
+
return join63(path6, "package.json");
|
|
101856
101940
|
}
|
|
101857
101941
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101858
101942
|
if (!existsSync32(pkgJsonPath))
|
|
@@ -101890,7 +101974,7 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101890
101974
|
const packageName = packageNameFromServerEntry(entry);
|
|
101891
101975
|
if (packageName === null)
|
|
101892
101976
|
return null;
|
|
101893
|
-
return packageJsonExportsTui(
|
|
101977
|
+
return packageJsonExportsTui(join63(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101894
101978
|
}
|
|
101895
101979
|
function isOurFilePluginEntry(entry) {
|
|
101896
101980
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
@@ -101955,7 +102039,7 @@ function detectServerPluginRegistration() {
|
|
|
101955
102039
|
}
|
|
101956
102040
|
}
|
|
101957
102041
|
function detectTuiPluginRegistration() {
|
|
101958
|
-
const tuiJsonPath =
|
|
102042
|
+
const tuiJsonPath = join63(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
101959
102043
|
if (!existsSync32(tuiJsonPath)) {
|
|
101960
102044
|
return {
|
|
101961
102045
|
registered: false,
|
|
@@ -102111,10 +102195,10 @@ function readConfig(path6) {
|
|
|
102111
102195
|
return null;
|
|
102112
102196
|
}
|
|
102113
102197
|
function readServerConfig(configDir) {
|
|
102114
|
-
const jsoncPath =
|
|
102198
|
+
const jsoncPath = join64(configDir, "opencode.jsonc");
|
|
102115
102199
|
if (existsSync33(jsoncPath))
|
|
102116
102200
|
return readConfig(jsoncPath);
|
|
102117
|
-
const jsonPath =
|
|
102201
|
+
const jsonPath = join64(configDir, "opencode.json");
|
|
102118
102202
|
if (existsSync33(jsonPath))
|
|
102119
102203
|
return readConfig(jsonPath);
|
|
102120
102204
|
return null;
|
|
@@ -102156,7 +102240,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102156
102240
|
if (!desiredEntry) {
|
|
102157
102241
|
return { changed: false, reason: "no-server-entry" };
|
|
102158
102242
|
}
|
|
102159
|
-
const tuiJsonPath =
|
|
102243
|
+
const tuiJsonPath = join64(configDir, "tui.json");
|
|
102160
102244
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102161
102245
|
if (malformed) {
|
|
102162
102246
|
return { changed: false, reason: "malformed" };
|
|
@@ -102172,7 +102256,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102172
102256
|
|
|
102173
102257
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102174
102258
|
import { homedir as homedir11 } from "node:os";
|
|
102175
|
-
import { join as
|
|
102259
|
+
import { join as join65 } from "node:path";
|
|
102176
102260
|
|
|
102177
102261
|
// packages/shared-skills/index.mjs
|
|
102178
102262
|
import { existsSync as existsSync34 } from "node:fs";
|
|
@@ -102194,9 +102278,9 @@ function describeResult2(result) {
|
|
|
102194
102278
|
}
|
|
102195
102279
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102196
102280
|
const platform = options.platform ?? process.platform;
|
|
102197
|
-
const baseDir =
|
|
102281
|
+
const baseDir = join65(options.homeDir ?? homedir11(), ".omo");
|
|
102198
102282
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102199
|
-
const skillDir =
|
|
102283
|
+
const skillDir = join65(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102200
102284
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102201
102285
|
try {
|
|
102202
102286
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -105999,7 +106083,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
105999
106083
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
106000
106084
|
init_bun_which_shim();
|
|
106001
106085
|
init_spawn_with_windows_hide();
|
|
106002
|
-
import { delimiter as delimiter2, dirname as
|
|
106086
|
+
import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "node:path";
|
|
106003
106087
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
106004
106088
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
106005
106089
|
function getCommandCandidates(platform) {
|
|
@@ -106057,7 +106141,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
106057
106141
|
return null;
|
|
106058
106142
|
}
|
|
106059
106143
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
106060
|
-
const preferredDir =
|
|
106144
|
+
const preferredDir = dirname25(binaryPath);
|
|
106061
106145
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
106062
106146
|
return [preferredDir, ...existing].join(delimiter2);
|
|
106063
106147
|
}
|
|
@@ -106649,9 +106733,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106649
106733
|
}
|
|
106650
106734
|
// packages/boulder-state/src/storage/path.ts
|
|
106651
106735
|
import { existsSync as existsSync36 } from "node:fs";
|
|
106652
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106736
|
+
import { isAbsolute as isAbsolute11, join as join66, relative as relative8, resolve as resolve20 } from "node:path";
|
|
106653
106737
|
function getBoulderFilePath(directory) {
|
|
106654
|
-
return
|
|
106738
|
+
return join66(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106655
106739
|
}
|
|
106656
106740
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106657
106741
|
return isAbsolute11(trackedPath) ? resolve20(trackedPath) : resolve20(baseDirectory, trackedPath);
|
|
@@ -106834,9 +106918,9 @@ init_state();
|
|
|
106834
106918
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106835
106919
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106836
106920
|
import { existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
|
|
106837
|
-
import { join as
|
|
106921
|
+
import { join as join67 } from "node:path";
|
|
106838
106922
|
function getMarkerPath(directory, sessionID) {
|
|
106839
|
-
return
|
|
106923
|
+
return join67(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106840
106924
|
}
|
|
106841
106925
|
function readContinuationMarker(directory, sessionID) {
|
|
106842
106926
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -106909,7 +106993,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106909
106993
|
init_shared();
|
|
106910
106994
|
init_compaction_marker();
|
|
106911
106995
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
|
|
106912
|
-
import { join as
|
|
106996
|
+
import { join as join68 } from "node:path";
|
|
106913
106997
|
var defaultSessionLastAgentDeps = {
|
|
106914
106998
|
getMessageDir,
|
|
106915
106999
|
isSqliteBackend,
|
|
@@ -106969,7 +107053,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106969
107053
|
try {
|
|
106970
107054
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106971
107055
|
try {
|
|
106972
|
-
const content = readFileSync21(
|
|
107056
|
+
const content = readFileSync21(join68(messageDir, fileName), "utf-8");
|
|
106973
107057
|
const parsed = JSON.parse(content);
|
|
106974
107058
|
return {
|
|
106975
107059
|
fileName,
|
|
@@ -107013,7 +107097,7 @@ init_agent_display_names();
|
|
|
107013
107097
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107014
107098
|
init_frontmatter2();
|
|
107015
107099
|
import { existsSync as existsSync40, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
|
|
107016
|
-
import { dirname as
|
|
107100
|
+
import { dirname as dirname26, join as join69 } from "node:path";
|
|
107017
107101
|
|
|
107018
107102
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
107019
107103
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -107022,7 +107106,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
107022
107106
|
|
|
107023
107107
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107024
107108
|
function getStateFilePath(directory, customPath) {
|
|
107025
|
-
return customPath ?
|
|
107109
|
+
return customPath ? join69(directory, customPath) : join69(directory, DEFAULT_STATE_FILE);
|
|
107026
107110
|
}
|
|
107027
107111
|
function readState(directory, customPath) {
|
|
107028
107112
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -108129,7 +108213,7 @@ init_extract_semver();
|
|
|
108129
108213
|
init_bun_which_shim();
|
|
108130
108214
|
import { existsSync as existsSync48, accessSync as accessSync4, constants as constants11 } from "node:fs";
|
|
108131
108215
|
import { homedir as homedir14 } from "node:os";
|
|
108132
|
-
import { join as
|
|
108216
|
+
import { join as join76 } from "node:path";
|
|
108133
108217
|
|
|
108134
108218
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108135
108219
|
init_spawn_with_windows_hide();
|
|
@@ -108221,17 +108305,17 @@ function getDesktopAppPaths(platform) {
|
|
|
108221
108305
|
case "darwin":
|
|
108222
108306
|
return [
|
|
108223
108307
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108224
|
-
|
|
108308
|
+
join76(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108225
108309
|
];
|
|
108226
108310
|
case "win32": {
|
|
108227
108311
|
const programFiles = process.env.ProgramFiles;
|
|
108228
108312
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108229
108313
|
const paths2 = [];
|
|
108230
108314
|
if (programFiles) {
|
|
108231
|
-
paths2.push(
|
|
108315
|
+
paths2.push(join76(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108232
108316
|
}
|
|
108233
108317
|
if (localAppData) {
|
|
108234
|
-
paths2.push(
|
|
108318
|
+
paths2.push(join76(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108235
108319
|
}
|
|
108236
108320
|
return paths2;
|
|
108237
108321
|
}
|
|
@@ -108239,8 +108323,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108239
108323
|
return [
|
|
108240
108324
|
"/usr/bin/opencode",
|
|
108241
108325
|
"/usr/lib/opencode/opencode",
|
|
108242
|
-
|
|
108243
|
-
|
|
108326
|
+
join76(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108327
|
+
join76(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108244
108328
|
];
|
|
108245
108329
|
default:
|
|
108246
108330
|
return [];
|
|
@@ -108272,7 +108356,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108272
108356
|
const candidates = getCommandCandidates2(platform);
|
|
108273
108357
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108274
108358
|
for (const command of candidates) {
|
|
108275
|
-
const fullPath =
|
|
108359
|
+
const fullPath = join76(entry, command);
|
|
108276
108360
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108277
108361
|
return { binary: command, path: fullPath };
|
|
108278
108362
|
}
|
|
@@ -108414,22 +108498,22 @@ init_package_json_locator();
|
|
|
108414
108498
|
import { existsSync as existsSync50, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "node:fs";
|
|
108415
108499
|
import { createRequire as createRequire3 } from "node:module";
|
|
108416
108500
|
import { homedir as homedir15 } from "node:os";
|
|
108417
|
-
import { join as
|
|
108501
|
+
import { join as join77 } from "node:path";
|
|
108418
108502
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
108419
108503
|
init_shared();
|
|
108420
108504
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108421
108505
|
if (platform === "darwin")
|
|
108422
|
-
return
|
|
108506
|
+
return join77(homedir15(), "Library", "Caches");
|
|
108423
108507
|
if (platform === "win32")
|
|
108424
|
-
return process.env.LOCALAPPDATA ??
|
|
108425
|
-
return
|
|
108508
|
+
return process.env.LOCALAPPDATA ?? join77(homedir15(), "AppData", "Local");
|
|
108509
|
+
return join77(homedir15(), ".cache");
|
|
108426
108510
|
}
|
|
108427
108511
|
function resolveOpenCodeCacheDir() {
|
|
108428
108512
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108429
108513
|
if (xdgCacheHome)
|
|
108430
|
-
return
|
|
108514
|
+
return join77(xdgCacheHome, "opencode");
|
|
108431
108515
|
const fromShared = getOpenCodeCacheDir();
|
|
108432
|
-
const platformDefault =
|
|
108516
|
+
const platformDefault = join77(getPlatformDefaultCacheDir(), "opencode");
|
|
108433
108517
|
if (existsSync50(fromShared) || !existsSync50(platformDefault))
|
|
108434
108518
|
return fromShared;
|
|
108435
108519
|
return platformDefault;
|
|
@@ -108461,11 +108545,11 @@ function normalizeVersion(value) {
|
|
|
108461
108545
|
function createPackageCandidates(rootDir) {
|
|
108462
108546
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108463
108547
|
packageName,
|
|
108464
|
-
installedPackagePath:
|
|
108548
|
+
installedPackagePath: join77(rootDir, "node_modules", packageName, "package.json")
|
|
108465
108549
|
}));
|
|
108466
108550
|
}
|
|
108467
108551
|
function createTaggedInstallCandidates(rootDir) {
|
|
108468
|
-
const packagesDir =
|
|
108552
|
+
const packagesDir = join77(rootDir, "packages");
|
|
108469
108553
|
if (!existsSync50(packagesDir))
|
|
108470
108554
|
return [];
|
|
108471
108555
|
const candidates = [];
|
|
@@ -108473,14 +108557,14 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108473
108557
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108474
108558
|
if (packageName === undefined)
|
|
108475
108559
|
continue;
|
|
108476
|
-
const installDir =
|
|
108560
|
+
const installDir = join77(packagesDir, entryName);
|
|
108477
108561
|
candidates.push({
|
|
108478
108562
|
cacheDir: installDir,
|
|
108479
|
-
cachePackagePath:
|
|
108563
|
+
cachePackagePath: join77(installDir, "package.json"),
|
|
108480
108564
|
packageCandidates: [
|
|
108481
108565
|
{
|
|
108482
108566
|
packageName,
|
|
108483
|
-
installedPackagePath:
|
|
108567
|
+
installedPackagePath: join77(installDir, "node_modules", packageName, "package.json")
|
|
108484
108568
|
}
|
|
108485
108569
|
]
|
|
108486
108570
|
});
|
|
@@ -108525,13 +108609,13 @@ function getLoadedPluginVersion() {
|
|
|
108525
108609
|
const candidates = [
|
|
108526
108610
|
{
|
|
108527
108611
|
cacheDir: configDir,
|
|
108528
|
-
cachePackagePath:
|
|
108612
|
+
cachePackagePath: join77(configDir, "package.json"),
|
|
108529
108613
|
packageCandidates: createPackageCandidates(configDir)
|
|
108530
108614
|
},
|
|
108531
108615
|
...createTaggedInstallCandidates(configDir),
|
|
108532
108616
|
{
|
|
108533
108617
|
cacheDir,
|
|
108534
|
-
cachePackagePath:
|
|
108618
|
+
cachePackagePath: join77(cacheDir, "package.json"),
|
|
108535
108619
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108536
108620
|
},
|
|
108537
108621
|
...createTaggedInstallCandidates(cacheDir)
|
|
@@ -108724,18 +108808,18 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108724
108808
|
init_shared();
|
|
108725
108809
|
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "node:fs";
|
|
108726
108810
|
import { homedir as homedir16 } from "node:os";
|
|
108727
|
-
import { join as
|
|
108811
|
+
import { join as join78 } from "node:path";
|
|
108728
108812
|
function getUserConfigDir2() {
|
|
108729
108813
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108730
108814
|
if (xdgConfig)
|
|
108731
|
-
return
|
|
108732
|
-
return
|
|
108815
|
+
return join78(xdgConfig, "opencode");
|
|
108816
|
+
return join78(homedir16(), ".config", "opencode");
|
|
108733
108817
|
}
|
|
108734
108818
|
function loadCustomProviderNames() {
|
|
108735
108819
|
const configDir = getUserConfigDir2();
|
|
108736
108820
|
const candidatePaths = [
|
|
108737
|
-
|
|
108738
|
-
|
|
108821
|
+
join78(configDir, "opencode.json"),
|
|
108822
|
+
join78(configDir, "opencode.jsonc")
|
|
108739
108823
|
];
|
|
108740
108824
|
for (const configPath of candidatePaths) {
|
|
108741
108825
|
if (!existsSync52(configPath))
|
|
@@ -108756,7 +108840,7 @@ function loadCustomProviderNames() {
|
|
|
108756
108840
|
return [];
|
|
108757
108841
|
}
|
|
108758
108842
|
function loadAvailableModelsFromCache() {
|
|
108759
|
-
const cacheFile =
|
|
108843
|
+
const cacheFile = join78(getOpenCodeCacheDir(), "models.json");
|
|
108760
108844
|
const customProviders = loadCustomProviderNames();
|
|
108761
108845
|
if (!existsSync52(cacheFile)) {
|
|
108762
108846
|
if (customProviders.length > 0) {
|
|
@@ -108818,7 +108902,7 @@ function loadOmoConfig2() {
|
|
|
108818
108902
|
|
|
108819
108903
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108820
108904
|
init_shared();
|
|
108821
|
-
import { join as
|
|
108905
|
+
import { join as join79 } from "node:path";
|
|
108822
108906
|
|
|
108823
108907
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108824
108908
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108860,7 +108944,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108860
108944
|
}
|
|
108861
108945
|
function buildModelResolutionDetails(options) {
|
|
108862
108946
|
const details = [];
|
|
108863
|
-
const cacheFile =
|
|
108947
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108864
108948
|
details.push("═══ Available Models (from cache) ═══");
|
|
108865
108949
|
details.push("");
|
|
108866
108950
|
if (options.available.cacheExists) {
|
|
@@ -109170,7 +109254,7 @@ async function checkConfig() {
|
|
|
109170
109254
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109171
109255
|
init_main();
|
|
109172
109256
|
import { existsSync as existsSync53, readFileSync as readFileSync34 } from "node:fs";
|
|
109173
|
-
import { join as
|
|
109257
|
+
import { join as join80 } from "node:path";
|
|
109174
109258
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109175
109259
|
["variant", "reasoning"],
|
|
109176
109260
|
["reasoningEffort", "reasoning"],
|
|
@@ -109225,7 +109309,7 @@ function userConfigPaths() {
|
|
|
109225
109309
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109226
109310
|
if (home === undefined || home.length === 0)
|
|
109227
109311
|
return [];
|
|
109228
|
-
return [
|
|
109312
|
+
return [join80(home, ".omo", "omo.jsonc"), join80(home, ".omo", "omo.json")];
|
|
109229
109313
|
}
|
|
109230
109314
|
async function checkDeprecatedReasoningKeys() {
|
|
109231
109315
|
const issues = [];
|
|
@@ -109251,25 +109335,25 @@ init_src2();
|
|
|
109251
109335
|
import { existsSync as existsSync54 } from "node:fs";
|
|
109252
109336
|
import { createRequire as createRequire4 } from "node:module";
|
|
109253
109337
|
import { homedir as homedir18 } from "node:os";
|
|
109254
|
-
import { dirname as
|
|
109338
|
+
import { dirname as dirname31, join as join82 } from "node:path";
|
|
109255
109339
|
|
|
109256
109340
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109257
|
-
import { join as
|
|
109341
|
+
import { join as join81 } from "path";
|
|
109258
109342
|
import { homedir as homedir17, tmpdir as tmpdir4 } from "os";
|
|
109259
109343
|
init_binary_downloader();
|
|
109260
109344
|
init_logger2();
|
|
109261
109345
|
init_plugin_identity();
|
|
109262
109346
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109263
|
-
var DEBUG_FILE =
|
|
109347
|
+
var DEBUG_FILE = join81(tmpdir4(), "comment-checker-debug.log");
|
|
109264
109348
|
function getCacheDir2() {
|
|
109265
109349
|
if (process.platform === "win32") {
|
|
109266
109350
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109267
|
-
const base2 = localAppData ||
|
|
109268
|
-
return
|
|
109351
|
+
const base2 = localAppData || join81(homedir17(), "AppData", "Local");
|
|
109352
|
+
return join81(base2, CACHE_DIR_NAME, "bin");
|
|
109269
109353
|
}
|
|
109270
109354
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109271
|
-
const base = xdgCache ||
|
|
109272
|
-
return
|
|
109355
|
+
const base = xdgCache || join81(homedir17(), ".cache");
|
|
109356
|
+
return join81(base, CACHE_DIR_NAME, "bin");
|
|
109273
109357
|
}
|
|
109274
109358
|
function getBinaryName() {
|
|
109275
109359
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109319,7 +109403,7 @@ async function getBinaryVersion(binary) {
|
|
|
109319
109403
|
}
|
|
109320
109404
|
}
|
|
109321
109405
|
async function checkAstGrepCli() {
|
|
109322
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109406
|
+
const runtimeDir = astGrepRuntimeDir(join82(homedir18(), ".omo"));
|
|
109323
109407
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109324
109408
|
if (sgPath === null) {
|
|
109325
109409
|
return {
|
|
@@ -109348,11 +109432,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109348
109432
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
109349
109433
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109350
109434
|
try {
|
|
109351
|
-
const packageDir = baseDirOverride ??
|
|
109352
|
-
const vendorPath =
|
|
109435
|
+
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109436
|
+
const vendorPath = join82(packageDir, "vendor", platformKey, binaryName);
|
|
109353
109437
|
if (existsSync54(vendorPath))
|
|
109354
109438
|
return vendorPath;
|
|
109355
|
-
const binPath =
|
|
109439
|
+
const binPath = join82(packageDir, "bin", binaryName);
|
|
109356
109440
|
if (existsSync54(binPath))
|
|
109357
109441
|
return binPath;
|
|
109358
109442
|
} catch (error51) {
|
|
@@ -109500,7 +109584,7 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109500
109584
|
init_zod();
|
|
109501
109585
|
init_opencode_config_dir();
|
|
109502
109586
|
import { existsSync as existsSync55, readFileSync as readFileSync35 } from "node:fs";
|
|
109503
|
-
import { delimiter as delimiter3, dirname as
|
|
109587
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve22 } from "node:path";
|
|
109504
109588
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
109505
109589
|
|
|
109506
109590
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109631,7 +109715,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
109631
109715
|
].join(";");
|
|
109632
109716
|
function getModuleDirectory(moduleUrl) {
|
|
109633
109717
|
try {
|
|
109634
|
-
return
|
|
109718
|
+
return dirname32(fileURLToPath7(moduleUrl));
|
|
109635
109719
|
} catch (error51) {
|
|
109636
109720
|
if (!(error51 instanceof Error))
|
|
109637
109721
|
throw error51;
|
|
@@ -109727,13 +109811,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
109727
109811
|
init_shared();
|
|
109728
109812
|
import { existsSync as existsSync56, readFileSync as readFileSync36 } from "node:fs";
|
|
109729
109813
|
import { homedir as homedir19 } from "node:os";
|
|
109730
|
-
import { join as
|
|
109814
|
+
import { join as join83 } from "node:path";
|
|
109731
109815
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109732
109816
|
function getMcpConfigPaths() {
|
|
109733
109817
|
return [
|
|
109734
|
-
|
|
109735
|
-
|
|
109736
|
-
|
|
109818
|
+
join83(homedir19(), ".claude", ".mcp.json"),
|
|
109819
|
+
join83(process.cwd(), ".mcp.json"),
|
|
109820
|
+
join83(process.cwd(), ".claude", ".mcp.json")
|
|
109737
109821
|
];
|
|
109738
109822
|
}
|
|
109739
109823
|
function loadUserMcpConfig() {
|
|
@@ -110015,7 +110099,7 @@ init_src2();
|
|
|
110015
110099
|
import { existsSync as existsSync58 } from "node:fs";
|
|
110016
110100
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
|
|
110017
110101
|
import { homedir as homedir21 } from "node:os";
|
|
110018
|
-
import { basename as basename11, join as
|
|
110102
|
+
import { basename as basename11, join as join84, resolve as resolve23 } from "node:path";
|
|
110019
110103
|
// packages/omo-opencode/package.json
|
|
110020
110104
|
var package_default3 = {
|
|
110021
110105
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110080,13 +110164,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110080
110164
|
"omo-git-bash-hook"
|
|
110081
110165
|
];
|
|
110082
110166
|
async function gatherCodexSummary(deps = {}) {
|
|
110083
|
-
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110167
|
+
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir21(), ".codex"));
|
|
110084
110168
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110085
110169
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110086
110170
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110087
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110088
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110089
|
-
const configPath =
|
|
110171
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join84(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110172
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join84(pluginRoot, "lazycodex-install.json"));
|
|
110173
|
+
const configPath = join84(codexHome, "config.toml");
|
|
110090
110174
|
const pluginVersion = stringField(manifest2, "version");
|
|
110091
110175
|
return {
|
|
110092
110176
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110143,7 +110227,7 @@ function buildCodexIssues(summary) {
|
|
|
110143
110227
|
if (summary.pluginRoot === null) {
|
|
110144
110228
|
issues.push({
|
|
110145
110229
|
title: "OMO Codex plugin is not installed",
|
|
110146
|
-
description: `Expected cached plugin at ${
|
|
110230
|
+
description: `Expected cached plugin at ${join84("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110147
110231
|
fix: "Run: npx lazycodex-ai install",
|
|
110148
110232
|
severity: "error",
|
|
110149
110233
|
affects: ["plugin loading"]
|
|
@@ -110208,12 +110292,12 @@ function buildCodexIssues(summary) {
|
|
|
110208
110292
|
return issues;
|
|
110209
110293
|
}
|
|
110210
110294
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110211
|
-
const pluginRoot =
|
|
110295
|
+
const pluginRoot = join84(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110212
110296
|
if (!existsSync58(pluginRoot))
|
|
110213
110297
|
return null;
|
|
110214
110298
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110215
110299
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110216
|
-
return candidates.length === 0 ? null :
|
|
110300
|
+
return candidates.length === 0 ? null : join84(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110217
110301
|
}
|
|
110218
110302
|
async function readCodexConfigSummary(configPath) {
|
|
110219
110303
|
if (!existsSync58(configPath)) {
|
|
@@ -110241,13 +110325,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110241
110325
|
async function readLinkedBins(binDir) {
|
|
110242
110326
|
const linked = [];
|
|
110243
110327
|
for (const name of CODEX_BIN_NAMES) {
|
|
110244
|
-
if (await pathExists2(
|
|
110328
|
+
if (await pathExists2(join84(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110245
110329
|
linked.push(name);
|
|
110246
110330
|
}
|
|
110247
110331
|
return linked;
|
|
110248
110332
|
}
|
|
110249
110333
|
async function readLinkedAgents(codexHome) {
|
|
110250
|
-
const agentsDir =
|
|
110334
|
+
const agentsDir = join84(codexHome, "agents");
|
|
110251
110335
|
if (!existsSync58(agentsDir))
|
|
110252
110336
|
return [];
|
|
110253
110337
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
@@ -110363,7 +110447,7 @@ async function pathExists2(path14) {
|
|
|
110363
110447
|
init_src2();
|
|
110364
110448
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
|
|
110365
110449
|
import { homedir as homedir22 } from "node:os";
|
|
110366
|
-
import { dirname as
|
|
110450
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join85, relative as relative9, resolve as resolve24, sep as sep9 } from "node:path";
|
|
110367
110451
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110368
110452
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110369
110453
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110373,7 +110457,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110373
110457
|
const env3 = deps.env ?? process.env;
|
|
110374
110458
|
const platform = deps.platform ?? process.platform;
|
|
110375
110459
|
const arch = deps.arch ?? process.arch;
|
|
110376
|
-
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ??
|
|
110460
|
+
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ?? join85(homedir22(), ".codex"));
|
|
110377
110461
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110378
110462
|
if (summary.pluginRoot === null) {
|
|
110379
110463
|
return {
|
|
@@ -110398,7 +110482,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110398
110482
|
});
|
|
110399
110483
|
}
|
|
110400
110484
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110401
|
-
const runtimeSgPath =
|
|
110485
|
+
const runtimeSgPath = join85(runtimeSgDir, sgBinaryName(platform));
|
|
110402
110486
|
const sg = findSgBinarySync({
|
|
110403
110487
|
arch,
|
|
110404
110488
|
env: env3,
|
|
@@ -110437,7 +110521,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110437
110521
|
const manifest2 = await readJson2(manifestPath);
|
|
110438
110522
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110439
110523
|
continue;
|
|
110440
|
-
const manifestRoot =
|
|
110524
|
+
const manifestRoot = dirname33(manifestPath);
|
|
110441
110525
|
const isRootManifest = resolve24(manifestRoot) === resolve24(pluginRoot);
|
|
110442
110526
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110443
110527
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
@@ -110458,7 +110542,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110458
110542
|
continue;
|
|
110459
110543
|
const commands2 = [];
|
|
110460
110544
|
collectHookCommands(manifest2, commands2);
|
|
110461
|
-
const hookPluginRoot =
|
|
110545
|
+
const hookPluginRoot = dirname33(dirname33(hookManifestPath));
|
|
110462
110546
|
for (const command of commands2) {
|
|
110463
110547
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
110464
110548
|
referencedCount += 1;
|
|
@@ -110497,7 +110581,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
110497
110581
|
}
|
|
110498
110582
|
async function findHookManifestPaths(root) {
|
|
110499
110583
|
const paths3 = await findManifestPaths(root, "hooks.json");
|
|
110500
|
-
return paths3.filter((path14) =>
|
|
110584
|
+
return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
|
|
110501
110585
|
}
|
|
110502
110586
|
async function findManifestPaths(root, manifestName) {
|
|
110503
110587
|
let entries;
|
|
@@ -110510,7 +110594,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110510
110594
|
for (const entry of entries) {
|
|
110511
110595
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110512
110596
|
continue;
|
|
110513
|
-
const entryPath =
|
|
110597
|
+
const entryPath = join85(root, entry.name);
|
|
110514
110598
|
if (entry.isDirectory()) {
|
|
110515
110599
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110516
110600
|
continue;
|
|
@@ -110554,18 +110638,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110554
110638
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110555
110639
|
}
|
|
110556
110640
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110557
|
-
return
|
|
110641
|
+
return join85(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110558
110642
|
}
|
|
110559
110643
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110560
110644
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110561
110645
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110562
110646
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110563
|
-
if (sgPath ===
|
|
110647
|
+
if (sgPath === join85(runtimeSgDir, sgBinaryName(platform)))
|
|
110564
110648
|
return "runtime dir";
|
|
110565
110649
|
return "PATH";
|
|
110566
110650
|
}
|
|
110567
110651
|
async function readBootstrapStateSummary(codexHome) {
|
|
110568
|
-
const statePath =
|
|
110652
|
+
const statePath = join85(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110569
110653
|
const raw = await readJson2(statePath);
|
|
110570
110654
|
if (raw === null)
|
|
110571
110655
|
return null;
|
|
@@ -110644,16 +110728,16 @@ function isRecord12(value) {
|
|
|
110644
110728
|
import { existsSync as existsSync59 } from "node:fs";
|
|
110645
110729
|
import { readFile as readFile29 } from "node:fs/promises";
|
|
110646
110730
|
import { homedir as homedir23 } from "node:os";
|
|
110647
|
-
import { join as
|
|
110731
|
+
import { join as join86, resolve as resolve25 } from "node:path";
|
|
110648
110732
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110649
110733
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110650
110734
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110651
110735
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110652
|
-
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110736
|
+
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ?? join86(homedir23(), ".codex"));
|
|
110653
110737
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110654
110738
|
const platform = deps.platform ?? process.platform;
|
|
110655
|
-
const wrapperPath =
|
|
110656
|
-
const legacyWrapperPath =
|
|
110739
|
+
const wrapperPath = join86(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110740
|
+
const legacyWrapperPath = join86(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110657
110741
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110658
110742
|
const issues = [];
|
|
110659
110743
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -111181,12 +111265,12 @@ import {
|
|
|
111181
111265
|
unlinkSync as unlinkSync9,
|
|
111182
111266
|
writeFileSync as writeFileSync12
|
|
111183
111267
|
} from "node:fs";
|
|
111184
|
-
import { basename as basename12, dirname as
|
|
111268
|
+
import { basename as basename12, dirname as dirname34, join as join89 } from "node:path";
|
|
111185
111269
|
|
|
111186
111270
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111187
111271
|
import { existsSync as existsSync60, realpathSync as realpathSync8 } from "node:fs";
|
|
111188
111272
|
import { homedir as homedir24 } from "node:os";
|
|
111189
|
-
import { join as
|
|
111273
|
+
import { join as join87, resolve as resolve26 } from "node:path";
|
|
111190
111274
|
function resolveConfigPath2(pathValue) {
|
|
111191
111275
|
const resolvedPath = resolve26(pathValue);
|
|
111192
111276
|
if (!existsSync60(resolvedPath))
|
|
@@ -111204,13 +111288,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111204
111288
|
if (customConfigDir) {
|
|
111205
111289
|
return resolveConfigPath2(customConfigDir);
|
|
111206
111290
|
}
|
|
111207
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111208
|
-
return resolveConfigPath2(
|
|
111291
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join87(homedir24(), ".config");
|
|
111292
|
+
return resolveConfigPath2(join87(xdgConfigDir, "opencode"));
|
|
111209
111293
|
}
|
|
111210
111294
|
|
|
111211
111295
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111212
111296
|
import { chmodSync as chmodSync4, existsSync as existsSync61, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
111213
|
-
import { join as
|
|
111297
|
+
import { join as join88 } from "node:path";
|
|
111214
111298
|
var INDEX_FILE_NAME = "index.json";
|
|
111215
111299
|
function isTokenIndex(value) {
|
|
111216
111300
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111218,7 +111302,7 @@ function isTokenIndex(value) {
|
|
|
111218
111302
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111219
111303
|
}
|
|
111220
111304
|
function getIndexPath(storageDir) {
|
|
111221
|
-
return
|
|
111305
|
+
return join88(storageDir, INDEX_FILE_NAME);
|
|
111222
111306
|
}
|
|
111223
111307
|
function readTokenIndex(storageDir) {
|
|
111224
111308
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -111262,16 +111346,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111262
111346
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111263
111347
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111264
111348
|
function getMcpOauthStorageDir() {
|
|
111265
|
-
return
|
|
111349
|
+
return join89(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111266
111350
|
}
|
|
111267
111351
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111268
111352
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111269
111353
|
}
|
|
111270
111354
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111271
|
-
return
|
|
111355
|
+
return join89(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111272
111356
|
}
|
|
111273
111357
|
function getLegacyStoragePath() {
|
|
111274
|
-
return
|
|
111358
|
+
return join89(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111275
111359
|
}
|
|
111276
111360
|
function normalizeHost2(serverHost) {
|
|
111277
111361
|
let host = serverHost.trim();
|
|
@@ -111365,7 +111449,7 @@ function readLegacyStore() {
|
|
|
111365
111449
|
}
|
|
111366
111450
|
function writeTokenFile(filePath, token) {
|
|
111367
111451
|
try {
|
|
111368
|
-
const dir =
|
|
111452
|
+
const dir = dirname34(filePath);
|
|
111369
111453
|
if (!existsSync62(dir)) {
|
|
111370
111454
|
mkdirSync15(dir, { recursive: true });
|
|
111371
111455
|
}
|
|
@@ -111450,7 +111534,7 @@ function listTokensByHost(serverHost) {
|
|
|
111450
111534
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111451
111535
|
if (!indexedKey.startsWith(prefix))
|
|
111452
111536
|
continue;
|
|
111453
|
-
const indexedToken = readTokenFile(
|
|
111537
|
+
const indexedToken = readTokenFile(join89(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111454
111538
|
if (indexedToken)
|
|
111455
111539
|
result[indexedKey] = indexedToken;
|
|
111456
111540
|
}
|
|
@@ -111465,7 +111549,7 @@ function listAllTokens() {
|
|
|
111465
111549
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111466
111550
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111467
111551
|
continue;
|
|
111468
|
-
const token = readTokenFile(
|
|
111552
|
+
const token = readTokenFile(join89(dir, entry.name));
|
|
111469
111553
|
const hash2 = basename12(entry.name, ".json");
|
|
111470
111554
|
if (token)
|
|
111471
111555
|
result[index[hash2] ?? hash2] = token;
|