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/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: "5.0.0-beta.
|
|
2148
|
+
version: "5.0.0-beta.7",
|
|
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",
|
|
@@ -2325,7 +2325,7 @@ var init_package = __esm(() => {
|
|
|
2325
2325
|
zod: "^4.4.3"
|
|
2326
2326
|
},
|
|
2327
2327
|
devDependencies: {
|
|
2328
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
2328
|
+
"@code-yeongyu/senpi": "2026.8.12-4",
|
|
2329
2329
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
2330
2330
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
2331
2331
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -2366,18 +2366,18 @@ var init_package = __esm(() => {
|
|
|
2366
2366
|
typescript: "^7.0.2"
|
|
2367
2367
|
},
|
|
2368
2368
|
optionalDependencies: {
|
|
2369
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
2370
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
2371
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
2372
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
2373
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
2374
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
2375
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
2376
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
2377
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
2378
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
2379
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
2380
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
2369
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.7",
|
|
2370
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.7",
|
|
2371
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.7",
|
|
2372
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.7",
|
|
2373
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.7",
|
|
2374
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.7",
|
|
2375
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.7",
|
|
2376
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.7",
|
|
2377
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.7",
|
|
2378
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.7",
|
|
2379
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.7",
|
|
2380
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.7"
|
|
2381
2381
|
},
|
|
2382
2382
|
overrides: {
|
|
2383
2383
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -22405,15 +22405,16 @@ var init_codegraph = __esm(() => {
|
|
|
22405
22405
|
});
|
|
22406
22406
|
|
|
22407
22407
|
// packages/omo-config-core/src/schema/memory.ts
|
|
22408
|
-
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22408
|
+
var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
|
|
22409
22409
|
var init_memory = __esm(() => {
|
|
22410
22410
|
init_zod();
|
|
22411
22411
|
OmoMemoryReflectionTriggerSchema = object({
|
|
22412
|
-
step_count: number2().int().nonnegative().default(
|
|
22412
|
+
step_count: number2().int().nonnegative().default(25),
|
|
22413
22413
|
on_compaction: boolean2().default(true)
|
|
22414
22414
|
}).strict();
|
|
22415
22415
|
OmoMemoryReflectionSchema = object({
|
|
22416
|
-
|
|
22416
|
+
enabled: boolean2().default(true),
|
|
22417
|
+
trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
|
|
22417
22418
|
merge: _enum2(["auto", "integration"]).default("auto"),
|
|
22418
22419
|
category: string2().min(1).default("quick"),
|
|
22419
22420
|
timeout_minutes: number2().int().positive().default(15),
|
|
@@ -22426,11 +22427,36 @@ var init_memory = __esm(() => {
|
|
|
22426
22427
|
OmoMemorySearchSchema = object({
|
|
22427
22428
|
enabled: boolean2().default(true)
|
|
22428
22429
|
}).strict();
|
|
22430
|
+
OmoMemoryNudgeSchema = object({
|
|
22431
|
+
enabled: boolean2().default(true),
|
|
22432
|
+
every_user_turns: number2().int().min(1).default(10)
|
|
22433
|
+
}).strict();
|
|
22434
|
+
OmoMemoryFactsSchema = object({
|
|
22435
|
+
enabled: boolean2().default(true),
|
|
22436
|
+
debounce_settles: number2().int().min(1).default(4)
|
|
22437
|
+
}).strict();
|
|
22438
|
+
OmoMemoryDreamSchema = object({
|
|
22439
|
+
enabled: boolean2().default(true),
|
|
22440
|
+
idle_minutes: number2().int().min(0).default(30),
|
|
22441
|
+
min_hours_between: number2().int().min(1).default(24),
|
|
22442
|
+
shutdown_launch: boolean2().default(true),
|
|
22443
|
+
auto_select_max: number2().int().min(1).max(10).default(5),
|
|
22444
|
+
auto_select_max_chars: number2().int().min(1e4).default(150000)
|
|
22445
|
+
}).strict();
|
|
22446
|
+
OmoMemoryPeopleSchema = object({
|
|
22447
|
+
enabled: boolean2().default(true),
|
|
22448
|
+
max_entries: number2().int().min(1).max(100).default(40),
|
|
22449
|
+
max_entry_chars: number2().int().min(50).max(500).default(200)
|
|
22450
|
+
}).strict();
|
|
22451
|
+
OmoMemorySoulSchema = object({
|
|
22452
|
+
edit_notice: boolean2().default(true)
|
|
22453
|
+
}).strict();
|
|
22429
22454
|
OmoMemoryReflectionTriggerLayerSchema = object({
|
|
22430
22455
|
step_count: number2().int().nonnegative().optional(),
|
|
22431
22456
|
on_compaction: boolean2().optional()
|
|
22432
22457
|
}).strict();
|
|
22433
22458
|
OmoMemoryReflectionLayerSchema = object({
|
|
22459
|
+
enabled: boolean2().optional(),
|
|
22434
22460
|
trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
|
|
22435
22461
|
merge: _enum2(["auto", "integration"]).optional(),
|
|
22436
22462
|
category: string2().min(1).optional(),
|
|
@@ -22444,10 +22470,39 @@ var init_memory = __esm(() => {
|
|
|
22444
22470
|
OmoMemorySearchLayerSchema = object({
|
|
22445
22471
|
enabled: boolean2().optional()
|
|
22446
22472
|
}).strict();
|
|
22473
|
+
OmoMemoryNudgeLayerSchema = object({
|
|
22474
|
+
enabled: boolean2().optional(),
|
|
22475
|
+
every_user_turns: number2().int().min(1).optional()
|
|
22476
|
+
}).strict();
|
|
22477
|
+
OmoMemoryFactsLayerSchema = object({
|
|
22478
|
+
enabled: boolean2().optional(),
|
|
22479
|
+
debounce_settles: number2().int().min(1).optional()
|
|
22480
|
+
}).strict();
|
|
22481
|
+
OmoMemoryDreamLayerSchema = object({
|
|
22482
|
+
enabled: boolean2().optional(),
|
|
22483
|
+
idle_minutes: number2().int().min(0).optional(),
|
|
22484
|
+
min_hours_between: number2().int().min(1).optional(),
|
|
22485
|
+
shutdown_launch: boolean2().optional(),
|
|
22486
|
+
auto_select_max: number2().int().min(1).max(10).optional(),
|
|
22487
|
+
auto_select_max_chars: number2().int().min(1e4).optional()
|
|
22488
|
+
}).strict();
|
|
22489
|
+
OmoMemoryPeopleLayerSchema = object({
|
|
22490
|
+
enabled: boolean2().optional(),
|
|
22491
|
+
max_entries: number2().int().min(1).max(100).optional(),
|
|
22492
|
+
max_entry_chars: number2().int().min(50).max(500).optional()
|
|
22493
|
+
}).strict();
|
|
22494
|
+
OmoMemorySoulLayerSchema = object({
|
|
22495
|
+
edit_notice: boolean2().optional()
|
|
22496
|
+
}).strict();
|
|
22447
22497
|
OmoMemoryAgentOverridesSchema = object({
|
|
22448
22498
|
enabled: boolean2().optional(),
|
|
22449
22499
|
agent: string2().min(1).optional(),
|
|
22450
22500
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22501
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22502
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22503
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22504
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22505
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22451
22506
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22452
22507
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22453
22508
|
compile_warn_tokens: number2().int().positive().optional()
|
|
@@ -22457,12 +22512,25 @@ var init_memory = __esm(() => {
|
|
|
22457
22512
|
agent: string2().min(1).default("auto"),
|
|
22458
22513
|
tool_exposure: _enum2(["direct", "search"]).default("direct"),
|
|
22459
22514
|
reflection: OmoMemoryReflectionSchema.default({
|
|
22460
|
-
|
|
22515
|
+
enabled: true,
|
|
22516
|
+
trigger: { step_count: 25, on_compaction: true },
|
|
22461
22517
|
merge: "auto",
|
|
22462
22518
|
category: "quick",
|
|
22463
22519
|
timeout_minutes: 15,
|
|
22464
22520
|
sandbox: "auto"
|
|
22465
22521
|
}),
|
|
22522
|
+
nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
|
|
22523
|
+
facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
|
|
22524
|
+
dream: OmoMemoryDreamSchema.default({
|
|
22525
|
+
enabled: true,
|
|
22526
|
+
idle_minutes: 30,
|
|
22527
|
+
min_hours_between: 24,
|
|
22528
|
+
shutdown_launch: true,
|
|
22529
|
+
auto_select_max: 5,
|
|
22530
|
+
auto_select_max_chars: 150000
|
|
22531
|
+
}),
|
|
22532
|
+
people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
|
|
22533
|
+
soul: OmoMemorySoulSchema.default({ edit_notice: true }),
|
|
22466
22534
|
sync: OmoMemorySyncSchema.default({ enabled: true }),
|
|
22467
22535
|
search: OmoMemorySearchSchema.default({ enabled: true }),
|
|
22468
22536
|
compile_warn_tokens: number2().int().positive().default(30000),
|
|
@@ -22473,6 +22541,11 @@ var init_memory = __esm(() => {
|
|
|
22473
22541
|
agent: string2().min(1).optional(),
|
|
22474
22542
|
tool_exposure: _enum2(["direct", "search"]).optional(),
|
|
22475
22543
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22544
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22545
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22546
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22547
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22548
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22476
22549
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22477
22550
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22478
22551
|
compile_warn_tokens: number2().int().positive().optional(),
|
|
@@ -94484,7 +94557,7 @@ var package_default2;
|
|
|
94484
94557
|
var init_package2 = __esm(() => {
|
|
94485
94558
|
package_default2 = {
|
|
94486
94559
|
name: "@oh-my-opencode/omo-codex",
|
|
94487
|
-
version: "5.0.0-beta.
|
|
94560
|
+
version: "5.0.0-beta.7",
|
|
94488
94561
|
type: "module",
|
|
94489
94562
|
private: true,
|
|
94490
94563
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -95454,19 +95527,19 @@ var init_update_toasts = __esm(() => {
|
|
|
95454
95527
|
|
|
95455
95528
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95456
95529
|
import { existsSync as existsSync47 } from "fs";
|
|
95457
|
-
import { dirname as
|
|
95530
|
+
import { dirname as dirname30, join as join75 } from "path";
|
|
95458
95531
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
95459
95532
|
function defaultGetModuleHostingWorkspace() {
|
|
95460
95533
|
try {
|
|
95461
|
-
const currentDir =
|
|
95534
|
+
const currentDir = dirname30(fileURLToPath5(import.meta.url));
|
|
95462
95535
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
95463
95536
|
if (!pkgJsonPath)
|
|
95464
95537
|
return null;
|
|
95465
|
-
const pkgDir =
|
|
95466
|
-
const nodeModulesDir =
|
|
95538
|
+
const pkgDir = dirname30(pkgJsonPath);
|
|
95539
|
+
const nodeModulesDir = dirname30(pkgDir);
|
|
95467
95540
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
95468
95541
|
return null;
|
|
95469
|
-
return
|
|
95542
|
+
return dirname30(nodeModulesDir);
|
|
95470
95543
|
} catch (error51) {
|
|
95471
95544
|
if (error51 instanceof Error) {
|
|
95472
95545
|
return null;
|
|
@@ -95608,7 +95681,7 @@ var init_background_update_check = __esm(() => {
|
|
|
95608
95681
|
init_update_toasts();
|
|
95609
95682
|
defaultDeps4 = {
|
|
95610
95683
|
existsSync: existsSync47,
|
|
95611
|
-
join:
|
|
95684
|
+
join: join75,
|
|
95612
95685
|
runBunInstallWithDetails,
|
|
95613
95686
|
log: log2,
|
|
95614
95687
|
getOpenCodeCacheDir,
|
|
@@ -101383,11 +101456,9 @@ function nodeErrorCode6(error51) {
|
|
|
101383
101456
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101384
101457
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101385
101458
|
import { execFile as execFile4 } from "child_process";
|
|
101386
|
-
import {
|
|
101387
|
-
import { constants as constants8, existsSync as existsSync31 } from "fs";
|
|
101388
|
-
import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
|
|
101459
|
+
import { existsSync as existsSync31 } from "fs";
|
|
101389
101460
|
import { homedir as homedir10 } from "os";
|
|
101390
|
-
import { dirname as
|
|
101461
|
+
import { dirname as dirname24, join as join62, resolve as resolve19 } from "path";
|
|
101391
101462
|
import { fileURLToPath } from "url";
|
|
101392
101463
|
import { promisify as promisify2 } from "util";
|
|
101393
101464
|
|
|
@@ -101463,6 +101534,12 @@ node "%~dp0omo" %*\r
|
|
|
101463
101534
|
return path6;
|
|
101464
101535
|
}
|
|
101465
101536
|
|
|
101537
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101538
|
+
import { createHash as createHash5 } from "crypto";
|
|
101539
|
+
import { constants as constants8 } from "fs";
|
|
101540
|
+
import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
|
|
101541
|
+
import { dirname as dirname23, join as join61 } from "path";
|
|
101542
|
+
|
|
101466
101543
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101467
101544
|
import { constants as constants7 } from "fs";
|
|
101468
101545
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
|
|
@@ -101568,11 +101645,15 @@ function isErrno(error51, code) {
|
|
|
101568
101645
|
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101569
101646
|
}
|
|
101570
101647
|
|
|
101571
|
-
// packages/omo-senpi/src/install/
|
|
101572
|
-
var execFileAsync2 = promisify2(execFile4);
|
|
101648
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101573
101649
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101574
101650
|
join61("extensions", "omo.js"),
|
|
101651
|
+
join61("extensions", "omo-task.js"),
|
|
101652
|
+
join61("extensions", "omo-member.js"),
|
|
101653
|
+
join61("extensions", "memory-run-supervisor.mjs"),
|
|
101575
101654
|
join61("extensions", "reflection-persona.md"),
|
|
101655
|
+
join61("extensions", "dream-persona.md"),
|
|
101656
|
+
join61("extensions", "facts-persona.md"),
|
|
101576
101657
|
join61("skills", "ast-grep", "SKILL.md"),
|
|
101577
101658
|
join61("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101578
101659
|
join61("skills", "debugging", "SKILL.md"),
|
|
@@ -101605,47 +101686,6 @@ var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
|
101605
101686
|
join61("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101606
101687
|
join61("scripts", "install.mjs")
|
|
101607
101688
|
];
|
|
101608
|
-
async function runSenpiInstaller(options = {}) {
|
|
101609
|
-
const context = resolveInstallContext(options);
|
|
101610
|
-
await ensurePluginArtifacts(context);
|
|
101611
|
-
const settings = await readSettings(context.settingsPath);
|
|
101612
|
-
const before = JSON.stringify(settings);
|
|
101613
|
-
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101614
|
-
if (!packages.includes(context.pluginPath))
|
|
101615
|
-
packages.push(context.pluginPath);
|
|
101616
|
-
settings.packages = packages;
|
|
101617
|
-
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101618
|
-
installLocalLauncher({
|
|
101619
|
-
pluginPath: context.pluginPath,
|
|
101620
|
-
senpiCliPath: join61(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101621
|
-
});
|
|
101622
|
-
return {
|
|
101623
|
-
ok: true,
|
|
101624
|
-
action: "install",
|
|
101625
|
-
agentDir: context.agentDir,
|
|
101626
|
-
settingsPath: context.settingsPath,
|
|
101627
|
-
pluginPath: context.pluginPath,
|
|
101628
|
-
changed: JSON.stringify(settings) !== before,
|
|
101629
|
-
backupPath
|
|
101630
|
-
};
|
|
101631
|
-
}
|
|
101632
|
-
function resolveInstallContext(options) {
|
|
101633
|
-
const env3 = options.env ?? process.env;
|
|
101634
|
-
const allowBuild = options.pluginPath === undefined;
|
|
101635
|
-
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname23(fileURLToPath(import.meta.url))) : dirname23(resolve19(options.pluginPath))));
|
|
101636
|
-
const agentDir = resolve19(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join61(homedir10(), ".senpi", "agent"));
|
|
101637
|
-
const pluginPath = resolve19(options.pluginPath ?? join61(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101638
|
-
return {
|
|
101639
|
-
env: env3,
|
|
101640
|
-
repoRoot,
|
|
101641
|
-
agentDir,
|
|
101642
|
-
settingsPath: join61(agentDir, "settings.json"),
|
|
101643
|
-
pluginPath,
|
|
101644
|
-
platform: options.platform ?? process.platform,
|
|
101645
|
-
allowBuild,
|
|
101646
|
-
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101647
|
-
};
|
|
101648
|
-
}
|
|
101649
101689
|
async function ensurePluginArtifacts(context) {
|
|
101650
101690
|
if (context.allowBuild) {
|
|
101651
101691
|
await context.runCommand("node", [join61(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
@@ -101717,6 +101757,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
|
|
|
101717
101757
|
function messageOf(error51) {
|
|
101718
101758
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
101719
101759
|
}
|
|
101760
|
+
async function fileExists2(path6) {
|
|
101761
|
+
try {
|
|
101762
|
+
await access2(path6, constants8.F_OK);
|
|
101763
|
+
return true;
|
|
101764
|
+
} catch (error51) {
|
|
101765
|
+
if (isErrno2(error51, "ENOENT"))
|
|
101766
|
+
return false;
|
|
101767
|
+
throw error51;
|
|
101768
|
+
}
|
|
101769
|
+
}
|
|
101770
|
+
function isErrno2(error51, code) {
|
|
101771
|
+
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101772
|
+
}
|
|
101773
|
+
|
|
101774
|
+
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101775
|
+
var execFileAsync2 = promisify2(execFile4);
|
|
101776
|
+
async function runSenpiInstaller(options = {}) {
|
|
101777
|
+
const context = resolveInstallContext(options);
|
|
101778
|
+
await ensurePluginArtifacts(context);
|
|
101779
|
+
const settings = await readSettings(context.settingsPath);
|
|
101780
|
+
const before = JSON.stringify(settings);
|
|
101781
|
+
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101782
|
+
if (!packages.includes(context.pluginPath))
|
|
101783
|
+
packages.push(context.pluginPath);
|
|
101784
|
+
settings.packages = packages;
|
|
101785
|
+
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101786
|
+
installLocalLauncher({
|
|
101787
|
+
pluginPath: context.pluginPath,
|
|
101788
|
+
senpiCliPath: join62(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101789
|
+
});
|
|
101790
|
+
return {
|
|
101791
|
+
ok: true,
|
|
101792
|
+
action: "install",
|
|
101793
|
+
agentDir: context.agentDir,
|
|
101794
|
+
settingsPath: context.settingsPath,
|
|
101795
|
+
pluginPath: context.pluginPath,
|
|
101796
|
+
changed: JSON.stringify(settings) !== before,
|
|
101797
|
+
backupPath
|
|
101798
|
+
};
|
|
101799
|
+
}
|
|
101800
|
+
function resolveInstallContext(options) {
|
|
101801
|
+
const env3 = options.env ?? process.env;
|
|
101802
|
+
const allowBuild = options.pluginPath === undefined;
|
|
101803
|
+
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve19(options.pluginPath))));
|
|
101804
|
+
const agentDir = resolve19(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join62(homedir10(), ".senpi", "agent"));
|
|
101805
|
+
const pluginPath = resolve19(options.pluginPath ?? join62(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101806
|
+
return {
|
|
101807
|
+
env: env3,
|
|
101808
|
+
repoRoot,
|
|
101809
|
+
agentDir,
|
|
101810
|
+
settingsPath: join62(agentDir, "settings.json"),
|
|
101811
|
+
pluginPath,
|
|
101812
|
+
platform: options.platform ?? process.platform,
|
|
101813
|
+
allowBuild,
|
|
101814
|
+
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101815
|
+
};
|
|
101816
|
+
}
|
|
101720
101817
|
async function defaultRunCommand3(command, args, options) {
|
|
101721
101818
|
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
101722
101819
|
if (result.stderr.trim().length > 0)
|
|
@@ -101727,28 +101824,15 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101727
101824
|
function findRepoRoot2(importerDir) {
|
|
101728
101825
|
let current = importerDir;
|
|
101729
101826
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101730
|
-
if (fileExistsSync(
|
|
101827
|
+
if (fileExistsSync(join62(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101731
101828
|
return current;
|
|
101732
101829
|
current = resolve19(current, "..");
|
|
101733
101830
|
}
|
|
101734
101831
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101735
101832
|
}
|
|
101736
|
-
async function fileExists2(path6) {
|
|
101737
|
-
try {
|
|
101738
|
-
await access2(path6, constants8.F_OK);
|
|
101739
|
-
return true;
|
|
101740
|
-
} catch (error51) {
|
|
101741
|
-
if (isErrno2(error51, "ENOENT"))
|
|
101742
|
-
return false;
|
|
101743
|
-
throw error51;
|
|
101744
|
-
}
|
|
101745
|
-
}
|
|
101746
101833
|
function fileExistsSync(path6) {
|
|
101747
101834
|
return existsSync31(path6);
|
|
101748
101835
|
}
|
|
101749
|
-
function isErrno2(error51, code) {
|
|
101750
|
-
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101751
|
-
}
|
|
101752
101836
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101753
101837
|
import { execFile as execFile5 } from "child_process";
|
|
101754
101838
|
import { promisify as promisify3 } from "util";
|
|
@@ -101784,19 +101868,19 @@ init_provider_availability();
|
|
|
101784
101868
|
|
|
101785
101869
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101786
101870
|
import { existsSync as existsSync33, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "fs";
|
|
101787
|
-
import { join as
|
|
101871
|
+
import { join as join64 } from "path";
|
|
101788
101872
|
|
|
101789
101873
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101790
101874
|
init_shared();
|
|
101791
101875
|
import { existsSync as existsSync32, readFileSync as readFileSync15 } from "fs";
|
|
101792
|
-
import { join as
|
|
101876
|
+
import { join as join63 } from "path";
|
|
101793
101877
|
var TUI_SUBPATH = "tui";
|
|
101794
101878
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101795
101879
|
function fileEntryPackageJsonPath(entry) {
|
|
101796
101880
|
let path6 = entry.slice("file:".length);
|
|
101797
101881
|
if (path6.startsWith("//"))
|
|
101798
101882
|
path6 = path6.slice(2);
|
|
101799
|
-
return
|
|
101883
|
+
return join63(path6, "package.json");
|
|
101800
101884
|
}
|
|
101801
101885
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101802
101886
|
if (!existsSync32(pkgJsonPath))
|
|
@@ -101834,7 +101918,7 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101834
101918
|
const packageName = packageNameFromServerEntry(entry);
|
|
101835
101919
|
if (packageName === null)
|
|
101836
101920
|
return null;
|
|
101837
|
-
return packageJsonExportsTui(
|
|
101921
|
+
return packageJsonExportsTui(join63(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101838
101922
|
}
|
|
101839
101923
|
function isOurFilePluginEntry(entry) {
|
|
101840
101924
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
@@ -101899,7 +101983,7 @@ function detectServerPluginRegistration() {
|
|
|
101899
101983
|
}
|
|
101900
101984
|
}
|
|
101901
101985
|
function detectTuiPluginRegistration() {
|
|
101902
|
-
const tuiJsonPath =
|
|
101986
|
+
const tuiJsonPath = join63(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
101903
101987
|
if (!existsSync32(tuiJsonPath)) {
|
|
101904
101988
|
return {
|
|
101905
101989
|
registered: false,
|
|
@@ -102055,10 +102139,10 @@ function readConfig(path6) {
|
|
|
102055
102139
|
return null;
|
|
102056
102140
|
}
|
|
102057
102141
|
function readServerConfig(configDir) {
|
|
102058
|
-
const jsoncPath =
|
|
102142
|
+
const jsoncPath = join64(configDir, "opencode.jsonc");
|
|
102059
102143
|
if (existsSync33(jsoncPath))
|
|
102060
102144
|
return readConfig(jsoncPath);
|
|
102061
|
-
const jsonPath =
|
|
102145
|
+
const jsonPath = join64(configDir, "opencode.json");
|
|
102062
102146
|
if (existsSync33(jsonPath))
|
|
102063
102147
|
return readConfig(jsonPath);
|
|
102064
102148
|
return null;
|
|
@@ -102100,7 +102184,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102100
102184
|
if (!desiredEntry) {
|
|
102101
102185
|
return { changed: false, reason: "no-server-entry" };
|
|
102102
102186
|
}
|
|
102103
|
-
const tuiJsonPath =
|
|
102187
|
+
const tuiJsonPath = join64(configDir, "tui.json");
|
|
102104
102188
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102105
102189
|
if (malformed) {
|
|
102106
102190
|
return { changed: false, reason: "malformed" };
|
|
@@ -102116,7 +102200,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102116
102200
|
|
|
102117
102201
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102118
102202
|
import { homedir as homedir11 } from "os";
|
|
102119
|
-
import { join as
|
|
102203
|
+
import { join as join65 } from "path";
|
|
102120
102204
|
|
|
102121
102205
|
// packages/shared-skills/index.mjs
|
|
102122
102206
|
import { existsSync as existsSync34 } from "fs";
|
|
@@ -102138,9 +102222,9 @@ function describeResult2(result) {
|
|
|
102138
102222
|
}
|
|
102139
102223
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102140
102224
|
const platform = options.platform ?? process.platform;
|
|
102141
|
-
const baseDir =
|
|
102225
|
+
const baseDir = join65(options.homeDir ?? homedir11(), ".omo");
|
|
102142
102226
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102143
|
-
const skillDir =
|
|
102227
|
+
const skillDir = join65(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102144
102228
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102145
102229
|
try {
|
|
102146
102230
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -105943,7 +106027,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
105943
106027
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
105944
106028
|
init_bun_which_shim();
|
|
105945
106029
|
init_spawn_with_windows_hide();
|
|
105946
|
-
import { delimiter as delimiter2, dirname as
|
|
106030
|
+
import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "path";
|
|
105947
106031
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
105948
106032
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
105949
106033
|
function getCommandCandidates(platform) {
|
|
@@ -106001,7 +106085,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
106001
106085
|
return null;
|
|
106002
106086
|
}
|
|
106003
106087
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
106004
|
-
const preferredDir =
|
|
106088
|
+
const preferredDir = dirname25(binaryPath);
|
|
106005
106089
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
106006
106090
|
return [preferredDir, ...existing].join(delimiter2);
|
|
106007
106091
|
}
|
|
@@ -106593,9 +106677,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106593
106677
|
}
|
|
106594
106678
|
// packages/boulder-state/src/storage/path.ts
|
|
106595
106679
|
import { existsSync as existsSync36 } from "fs";
|
|
106596
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106680
|
+
import { isAbsolute as isAbsolute11, join as join66, relative as relative8, resolve as resolve20 } from "path";
|
|
106597
106681
|
function getBoulderFilePath(directory) {
|
|
106598
|
-
return
|
|
106682
|
+
return join66(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106599
106683
|
}
|
|
106600
106684
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106601
106685
|
return isAbsolute11(trackedPath) ? resolve20(trackedPath) : resolve20(baseDirectory, trackedPath);
|
|
@@ -106778,9 +106862,9 @@ init_state();
|
|
|
106778
106862
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106779
106863
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106780
106864
|
import { existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
106781
|
-
import { join as
|
|
106865
|
+
import { join as join67 } from "path";
|
|
106782
106866
|
function getMarkerPath(directory, sessionID) {
|
|
106783
|
-
return
|
|
106867
|
+
return join67(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106784
106868
|
}
|
|
106785
106869
|
function readContinuationMarker(directory, sessionID) {
|
|
106786
106870
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -106853,7 +106937,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106853
106937
|
init_shared();
|
|
106854
106938
|
init_compaction_marker();
|
|
106855
106939
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "fs";
|
|
106856
|
-
import { join as
|
|
106940
|
+
import { join as join68 } from "path";
|
|
106857
106941
|
var defaultSessionLastAgentDeps = {
|
|
106858
106942
|
getMessageDir,
|
|
106859
106943
|
isSqliteBackend,
|
|
@@ -106913,7 +106997,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106913
106997
|
try {
|
|
106914
106998
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106915
106999
|
try {
|
|
106916
|
-
const content = readFileSync21(
|
|
107000
|
+
const content = readFileSync21(join68(messageDir, fileName), "utf-8");
|
|
106917
107001
|
const parsed = JSON.parse(content);
|
|
106918
107002
|
return {
|
|
106919
107003
|
fileName,
|
|
@@ -106957,7 +107041,7 @@ init_agent_display_names();
|
|
|
106957
107041
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106958
107042
|
init_frontmatter2();
|
|
106959
107043
|
import { existsSync as existsSync40, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
106960
|
-
import { dirname as
|
|
107044
|
+
import { dirname as dirname26, join as join69 } from "path";
|
|
106961
107045
|
|
|
106962
107046
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
106963
107047
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -106966,7 +107050,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
106966
107050
|
|
|
106967
107051
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106968
107052
|
function getStateFilePath(directory, customPath) {
|
|
106969
|
-
return customPath ?
|
|
107053
|
+
return customPath ? join69(directory, customPath) : join69(directory, DEFAULT_STATE_FILE);
|
|
106970
107054
|
}
|
|
106971
107055
|
function readState(directory, customPath) {
|
|
106972
107056
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -108073,7 +108157,7 @@ init_extract_semver();
|
|
|
108073
108157
|
init_bun_which_shim();
|
|
108074
108158
|
import { existsSync as existsSync48, accessSync as accessSync4, constants as constants11 } from "fs";
|
|
108075
108159
|
import { homedir as homedir14 } from "os";
|
|
108076
|
-
import { join as
|
|
108160
|
+
import { join as join76 } from "path";
|
|
108077
108161
|
|
|
108078
108162
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108079
108163
|
init_spawn_with_windows_hide();
|
|
@@ -108165,17 +108249,17 @@ function getDesktopAppPaths(platform) {
|
|
|
108165
108249
|
case "darwin":
|
|
108166
108250
|
return [
|
|
108167
108251
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108168
|
-
|
|
108252
|
+
join76(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108169
108253
|
];
|
|
108170
108254
|
case "win32": {
|
|
108171
108255
|
const programFiles = process.env.ProgramFiles;
|
|
108172
108256
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108173
108257
|
const paths2 = [];
|
|
108174
108258
|
if (programFiles) {
|
|
108175
|
-
paths2.push(
|
|
108259
|
+
paths2.push(join76(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108176
108260
|
}
|
|
108177
108261
|
if (localAppData) {
|
|
108178
|
-
paths2.push(
|
|
108262
|
+
paths2.push(join76(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108179
108263
|
}
|
|
108180
108264
|
return paths2;
|
|
108181
108265
|
}
|
|
@@ -108183,8 +108267,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108183
108267
|
return [
|
|
108184
108268
|
"/usr/bin/opencode",
|
|
108185
108269
|
"/usr/lib/opencode/opencode",
|
|
108186
|
-
|
|
108187
|
-
|
|
108270
|
+
join76(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108271
|
+
join76(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108188
108272
|
];
|
|
108189
108273
|
default:
|
|
108190
108274
|
return [];
|
|
@@ -108216,7 +108300,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108216
108300
|
const candidates = getCommandCandidates2(platform);
|
|
108217
108301
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108218
108302
|
for (const command of candidates) {
|
|
108219
|
-
const fullPath =
|
|
108303
|
+
const fullPath = join76(entry, command);
|
|
108220
108304
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108221
108305
|
return { binary: command, path: fullPath };
|
|
108222
108306
|
}
|
|
@@ -108358,22 +108442,22 @@ init_package_json_locator();
|
|
|
108358
108442
|
import { existsSync as existsSync50, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "fs";
|
|
108359
108443
|
import { createRequire as createRequire2 } from "module";
|
|
108360
108444
|
import { homedir as homedir15 } from "os";
|
|
108361
|
-
import { join as
|
|
108445
|
+
import { join as join77 } from "path";
|
|
108362
108446
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
108363
108447
|
init_shared();
|
|
108364
108448
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108365
108449
|
if (platform === "darwin")
|
|
108366
|
-
return
|
|
108450
|
+
return join77(homedir15(), "Library", "Caches");
|
|
108367
108451
|
if (platform === "win32")
|
|
108368
|
-
return process.env.LOCALAPPDATA ??
|
|
108369
|
-
return
|
|
108452
|
+
return process.env.LOCALAPPDATA ?? join77(homedir15(), "AppData", "Local");
|
|
108453
|
+
return join77(homedir15(), ".cache");
|
|
108370
108454
|
}
|
|
108371
108455
|
function resolveOpenCodeCacheDir() {
|
|
108372
108456
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108373
108457
|
if (xdgCacheHome)
|
|
108374
|
-
return
|
|
108458
|
+
return join77(xdgCacheHome, "opencode");
|
|
108375
108459
|
const fromShared = getOpenCodeCacheDir();
|
|
108376
|
-
const platformDefault =
|
|
108460
|
+
const platformDefault = join77(getPlatformDefaultCacheDir(), "opencode");
|
|
108377
108461
|
if (existsSync50(fromShared) || !existsSync50(platformDefault))
|
|
108378
108462
|
return fromShared;
|
|
108379
108463
|
return platformDefault;
|
|
@@ -108405,11 +108489,11 @@ function normalizeVersion(value) {
|
|
|
108405
108489
|
function createPackageCandidates(rootDir) {
|
|
108406
108490
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108407
108491
|
packageName,
|
|
108408
|
-
installedPackagePath:
|
|
108492
|
+
installedPackagePath: join77(rootDir, "node_modules", packageName, "package.json")
|
|
108409
108493
|
}));
|
|
108410
108494
|
}
|
|
108411
108495
|
function createTaggedInstallCandidates(rootDir) {
|
|
108412
|
-
const packagesDir =
|
|
108496
|
+
const packagesDir = join77(rootDir, "packages");
|
|
108413
108497
|
if (!existsSync50(packagesDir))
|
|
108414
108498
|
return [];
|
|
108415
108499
|
const candidates = [];
|
|
@@ -108417,14 +108501,14 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108417
108501
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108418
108502
|
if (packageName === undefined)
|
|
108419
108503
|
continue;
|
|
108420
|
-
const installDir =
|
|
108504
|
+
const installDir = join77(packagesDir, entryName);
|
|
108421
108505
|
candidates.push({
|
|
108422
108506
|
cacheDir: installDir,
|
|
108423
|
-
cachePackagePath:
|
|
108507
|
+
cachePackagePath: join77(installDir, "package.json"),
|
|
108424
108508
|
packageCandidates: [
|
|
108425
108509
|
{
|
|
108426
108510
|
packageName,
|
|
108427
|
-
installedPackagePath:
|
|
108511
|
+
installedPackagePath: join77(installDir, "node_modules", packageName, "package.json")
|
|
108428
108512
|
}
|
|
108429
108513
|
]
|
|
108430
108514
|
});
|
|
@@ -108469,13 +108553,13 @@ function getLoadedPluginVersion() {
|
|
|
108469
108553
|
const candidates = [
|
|
108470
108554
|
{
|
|
108471
108555
|
cacheDir: configDir,
|
|
108472
|
-
cachePackagePath:
|
|
108556
|
+
cachePackagePath: join77(configDir, "package.json"),
|
|
108473
108557
|
packageCandidates: createPackageCandidates(configDir)
|
|
108474
108558
|
},
|
|
108475
108559
|
...createTaggedInstallCandidates(configDir),
|
|
108476
108560
|
{
|
|
108477
108561
|
cacheDir,
|
|
108478
|
-
cachePackagePath:
|
|
108562
|
+
cachePackagePath: join77(cacheDir, "package.json"),
|
|
108479
108563
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108480
108564
|
},
|
|
108481
108565
|
...createTaggedInstallCandidates(cacheDir)
|
|
@@ -108668,18 +108752,18 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108668
108752
|
init_shared();
|
|
108669
108753
|
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "fs";
|
|
108670
108754
|
import { homedir as homedir16 } from "os";
|
|
108671
|
-
import { join as
|
|
108755
|
+
import { join as join78 } from "path";
|
|
108672
108756
|
function getUserConfigDir2() {
|
|
108673
108757
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108674
108758
|
if (xdgConfig)
|
|
108675
|
-
return
|
|
108676
|
-
return
|
|
108759
|
+
return join78(xdgConfig, "opencode");
|
|
108760
|
+
return join78(homedir16(), ".config", "opencode");
|
|
108677
108761
|
}
|
|
108678
108762
|
function loadCustomProviderNames() {
|
|
108679
108763
|
const configDir = getUserConfigDir2();
|
|
108680
108764
|
const candidatePaths = [
|
|
108681
|
-
|
|
108682
|
-
|
|
108765
|
+
join78(configDir, "opencode.json"),
|
|
108766
|
+
join78(configDir, "opencode.jsonc")
|
|
108683
108767
|
];
|
|
108684
108768
|
for (const configPath of candidatePaths) {
|
|
108685
108769
|
if (!existsSync52(configPath))
|
|
@@ -108700,7 +108784,7 @@ function loadCustomProviderNames() {
|
|
|
108700
108784
|
return [];
|
|
108701
108785
|
}
|
|
108702
108786
|
function loadAvailableModelsFromCache() {
|
|
108703
|
-
const cacheFile =
|
|
108787
|
+
const cacheFile = join78(getOpenCodeCacheDir(), "models.json");
|
|
108704
108788
|
const customProviders = loadCustomProviderNames();
|
|
108705
108789
|
if (!existsSync52(cacheFile)) {
|
|
108706
108790
|
if (customProviders.length > 0) {
|
|
@@ -108762,7 +108846,7 @@ function loadOmoConfig2() {
|
|
|
108762
108846
|
|
|
108763
108847
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108764
108848
|
init_shared();
|
|
108765
|
-
import { join as
|
|
108849
|
+
import { join as join79 } from "path";
|
|
108766
108850
|
|
|
108767
108851
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108768
108852
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108804,7 +108888,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108804
108888
|
}
|
|
108805
108889
|
function buildModelResolutionDetails(options) {
|
|
108806
108890
|
const details = [];
|
|
108807
|
-
const cacheFile =
|
|
108891
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108808
108892
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
108809
108893
|
details.push("");
|
|
108810
108894
|
if (options.available.cacheExists) {
|
|
@@ -109114,7 +109198,7 @@ async function checkConfig() {
|
|
|
109114
109198
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109115
109199
|
init_main();
|
|
109116
109200
|
import { existsSync as existsSync53, readFileSync as readFileSync34 } from "fs";
|
|
109117
|
-
import { join as
|
|
109201
|
+
import { join as join80 } from "path";
|
|
109118
109202
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109119
109203
|
["variant", "reasoning"],
|
|
109120
109204
|
["reasoningEffort", "reasoning"],
|
|
@@ -109169,7 +109253,7 @@ function userConfigPaths() {
|
|
|
109169
109253
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109170
109254
|
if (home === undefined || home.length === 0)
|
|
109171
109255
|
return [];
|
|
109172
|
-
return [
|
|
109256
|
+
return [join80(home, ".omo", "omo.jsonc"), join80(home, ".omo", "omo.json")];
|
|
109173
109257
|
}
|
|
109174
109258
|
async function checkDeprecatedReasoningKeys() {
|
|
109175
109259
|
const issues = [];
|
|
@@ -109195,25 +109279,25 @@ init_src2();
|
|
|
109195
109279
|
import { existsSync as existsSync54 } from "fs";
|
|
109196
109280
|
import { createRequire as createRequire3 } from "module";
|
|
109197
109281
|
import { homedir as homedir18 } from "os";
|
|
109198
|
-
import { dirname as
|
|
109282
|
+
import { dirname as dirname31, join as join82 } from "path";
|
|
109199
109283
|
|
|
109200
109284
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109201
|
-
import { join as
|
|
109285
|
+
import { join as join81 } from "path";
|
|
109202
109286
|
import { homedir as homedir17, tmpdir as tmpdir4 } from "os";
|
|
109203
109287
|
init_binary_downloader();
|
|
109204
109288
|
init_logger2();
|
|
109205
109289
|
init_plugin_identity();
|
|
109206
109290
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109207
|
-
var DEBUG_FILE =
|
|
109291
|
+
var DEBUG_FILE = join81(tmpdir4(), "comment-checker-debug.log");
|
|
109208
109292
|
function getCacheDir2() {
|
|
109209
109293
|
if (process.platform === "win32") {
|
|
109210
109294
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109211
|
-
const base2 = localAppData ||
|
|
109212
|
-
return
|
|
109295
|
+
const base2 = localAppData || join81(homedir17(), "AppData", "Local");
|
|
109296
|
+
return join81(base2, CACHE_DIR_NAME, "bin");
|
|
109213
109297
|
}
|
|
109214
109298
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109215
|
-
const base = xdgCache ||
|
|
109216
|
-
return
|
|
109299
|
+
const base = xdgCache || join81(homedir17(), ".cache");
|
|
109300
|
+
return join81(base, CACHE_DIR_NAME, "bin");
|
|
109217
109301
|
}
|
|
109218
109302
|
function getBinaryName() {
|
|
109219
109303
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109263,7 +109347,7 @@ async function getBinaryVersion(binary) {
|
|
|
109263
109347
|
}
|
|
109264
109348
|
}
|
|
109265
109349
|
async function checkAstGrepCli() {
|
|
109266
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109350
|
+
const runtimeDir = astGrepRuntimeDir(join82(homedir18(), ".omo"));
|
|
109267
109351
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109268
109352
|
if (sgPath === null) {
|
|
109269
109353
|
return {
|
|
@@ -109292,11 +109376,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109292
109376
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
109293
109377
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109294
109378
|
try {
|
|
109295
|
-
const packageDir = baseDirOverride ??
|
|
109296
|
-
const vendorPath =
|
|
109379
|
+
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109380
|
+
const vendorPath = join82(packageDir, "vendor", platformKey, binaryName);
|
|
109297
109381
|
if (existsSync54(vendorPath))
|
|
109298
109382
|
return vendorPath;
|
|
109299
|
-
const binPath =
|
|
109383
|
+
const binPath = join82(packageDir, "bin", binaryName);
|
|
109300
109384
|
if (existsSync54(binPath))
|
|
109301
109385
|
return binPath;
|
|
109302
109386
|
} catch (error51) {
|
|
@@ -109444,7 +109528,7 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109444
109528
|
init_zod();
|
|
109445
109529
|
init_opencode_config_dir();
|
|
109446
109530
|
import { existsSync as existsSync55, readFileSync as readFileSync35 } from "fs";
|
|
109447
|
-
import { delimiter as delimiter3, dirname as
|
|
109531
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve22 } from "path";
|
|
109448
109532
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
109449
109533
|
|
|
109450
109534
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109575,7 +109659,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
109575
109659
|
].join(";");
|
|
109576
109660
|
function getModuleDirectory(moduleUrl) {
|
|
109577
109661
|
try {
|
|
109578
|
-
return
|
|
109662
|
+
return dirname32(fileURLToPath7(moduleUrl));
|
|
109579
109663
|
} catch (error51) {
|
|
109580
109664
|
if (!(error51 instanceof Error))
|
|
109581
109665
|
throw error51;
|
|
@@ -109671,13 +109755,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
109671
109755
|
init_shared();
|
|
109672
109756
|
import { existsSync as existsSync56, readFileSync as readFileSync36 } from "fs";
|
|
109673
109757
|
import { homedir as homedir19 } from "os";
|
|
109674
|
-
import { join as
|
|
109758
|
+
import { join as join83 } from "path";
|
|
109675
109759
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109676
109760
|
function getMcpConfigPaths() {
|
|
109677
109761
|
return [
|
|
109678
|
-
|
|
109679
|
-
|
|
109680
|
-
|
|
109762
|
+
join83(homedir19(), ".claude", ".mcp.json"),
|
|
109763
|
+
join83(process.cwd(), ".mcp.json"),
|
|
109764
|
+
join83(process.cwd(), ".claude", ".mcp.json")
|
|
109681
109765
|
];
|
|
109682
109766
|
}
|
|
109683
109767
|
function loadUserMcpConfig() {
|
|
@@ -109959,7 +110043,7 @@ init_src2();
|
|
|
109959
110043
|
import { existsSync as existsSync58 } from "fs";
|
|
109960
110044
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "fs/promises";
|
|
109961
110045
|
import { homedir as homedir21 } from "os";
|
|
109962
|
-
import { basename as basename11, join as
|
|
110046
|
+
import { basename as basename11, join as join84, resolve as resolve23 } from "path";
|
|
109963
110047
|
// packages/omo-opencode/package.json
|
|
109964
110048
|
var package_default3 = {
|
|
109965
110049
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110024,13 +110108,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110024
110108
|
"omo-git-bash-hook"
|
|
110025
110109
|
];
|
|
110026
110110
|
async function gatherCodexSummary(deps = {}) {
|
|
110027
|
-
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110111
|
+
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir21(), ".codex"));
|
|
110028
110112
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110029
110113
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110030
110114
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110031
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110032
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110033
|
-
const configPath =
|
|
110115
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join84(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110116
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join84(pluginRoot, "lazycodex-install.json"));
|
|
110117
|
+
const configPath = join84(codexHome, "config.toml");
|
|
110034
110118
|
const pluginVersion = stringField(manifest2, "version");
|
|
110035
110119
|
return {
|
|
110036
110120
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110087,7 +110171,7 @@ function buildCodexIssues(summary) {
|
|
|
110087
110171
|
if (summary.pluginRoot === null) {
|
|
110088
110172
|
issues.push({
|
|
110089
110173
|
title: "OMO Codex plugin is not installed",
|
|
110090
|
-
description: `Expected cached plugin at ${
|
|
110174
|
+
description: `Expected cached plugin at ${join84("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110091
110175
|
fix: "Run: npx lazycodex-ai install",
|
|
110092
110176
|
severity: "error",
|
|
110093
110177
|
affects: ["plugin loading"]
|
|
@@ -110152,12 +110236,12 @@ function buildCodexIssues(summary) {
|
|
|
110152
110236
|
return issues;
|
|
110153
110237
|
}
|
|
110154
110238
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110155
|
-
const pluginRoot =
|
|
110239
|
+
const pluginRoot = join84(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110156
110240
|
if (!existsSync58(pluginRoot))
|
|
110157
110241
|
return null;
|
|
110158
110242
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110159
110243
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110160
|
-
return candidates.length === 0 ? null :
|
|
110244
|
+
return candidates.length === 0 ? null : join84(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110161
110245
|
}
|
|
110162
110246
|
async function readCodexConfigSummary(configPath) {
|
|
110163
110247
|
if (!existsSync58(configPath)) {
|
|
@@ -110185,13 +110269,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110185
110269
|
async function readLinkedBins(binDir) {
|
|
110186
110270
|
const linked = [];
|
|
110187
110271
|
for (const name of CODEX_BIN_NAMES) {
|
|
110188
|
-
if (await pathExists2(
|
|
110272
|
+
if (await pathExists2(join84(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110189
110273
|
linked.push(name);
|
|
110190
110274
|
}
|
|
110191
110275
|
return linked;
|
|
110192
110276
|
}
|
|
110193
110277
|
async function readLinkedAgents(codexHome) {
|
|
110194
|
-
const agentsDir =
|
|
110278
|
+
const agentsDir = join84(codexHome, "agents");
|
|
110195
110279
|
if (!existsSync58(agentsDir))
|
|
110196
110280
|
return [];
|
|
110197
110281
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
@@ -110307,7 +110391,7 @@ async function pathExists2(path14) {
|
|
|
110307
110391
|
init_src2();
|
|
110308
110392
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
|
|
110309
110393
|
import { homedir as homedir22 } from "os";
|
|
110310
|
-
import { dirname as
|
|
110394
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join85, relative as relative9, resolve as resolve24, sep as sep9 } from "path";
|
|
110311
110395
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110312
110396
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110313
110397
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110317,7 +110401,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110317
110401
|
const env3 = deps.env ?? process.env;
|
|
110318
110402
|
const platform = deps.platform ?? process.platform;
|
|
110319
110403
|
const arch = deps.arch ?? process.arch;
|
|
110320
|
-
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ??
|
|
110404
|
+
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ?? join85(homedir22(), ".codex"));
|
|
110321
110405
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110322
110406
|
if (summary.pluginRoot === null) {
|
|
110323
110407
|
return {
|
|
@@ -110342,7 +110426,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110342
110426
|
});
|
|
110343
110427
|
}
|
|
110344
110428
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110345
|
-
const runtimeSgPath =
|
|
110429
|
+
const runtimeSgPath = join85(runtimeSgDir, sgBinaryName(platform));
|
|
110346
110430
|
const sg = findSgBinarySync({
|
|
110347
110431
|
arch,
|
|
110348
110432
|
env: env3,
|
|
@@ -110381,7 +110465,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110381
110465
|
const manifest2 = await readJson2(manifestPath);
|
|
110382
110466
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110383
110467
|
continue;
|
|
110384
|
-
const manifestRoot =
|
|
110468
|
+
const manifestRoot = dirname33(manifestPath);
|
|
110385
110469
|
const isRootManifest = resolve24(manifestRoot) === resolve24(pluginRoot);
|
|
110386
110470
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110387
110471
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
@@ -110402,7 +110486,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110402
110486
|
continue;
|
|
110403
110487
|
const commands2 = [];
|
|
110404
110488
|
collectHookCommands(manifest2, commands2);
|
|
110405
|
-
const hookPluginRoot =
|
|
110489
|
+
const hookPluginRoot = dirname33(dirname33(hookManifestPath));
|
|
110406
110490
|
for (const command of commands2) {
|
|
110407
110491
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
110408
110492
|
referencedCount += 1;
|
|
@@ -110441,7 +110525,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
110441
110525
|
}
|
|
110442
110526
|
async function findHookManifestPaths(root) {
|
|
110443
110527
|
const paths3 = await findManifestPaths(root, "hooks.json");
|
|
110444
|
-
return paths3.filter((path14) =>
|
|
110528
|
+
return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
|
|
110445
110529
|
}
|
|
110446
110530
|
async function findManifestPaths(root, manifestName) {
|
|
110447
110531
|
let entries;
|
|
@@ -110454,7 +110538,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110454
110538
|
for (const entry of entries) {
|
|
110455
110539
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110456
110540
|
continue;
|
|
110457
|
-
const entryPath =
|
|
110541
|
+
const entryPath = join85(root, entry.name);
|
|
110458
110542
|
if (entry.isDirectory()) {
|
|
110459
110543
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110460
110544
|
continue;
|
|
@@ -110498,18 +110582,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110498
110582
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110499
110583
|
}
|
|
110500
110584
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110501
|
-
return
|
|
110585
|
+
return join85(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110502
110586
|
}
|
|
110503
110587
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110504
110588
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110505
110589
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110506
110590
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110507
|
-
if (sgPath ===
|
|
110591
|
+
if (sgPath === join85(runtimeSgDir, sgBinaryName(platform)))
|
|
110508
110592
|
return "runtime dir";
|
|
110509
110593
|
return "PATH";
|
|
110510
110594
|
}
|
|
110511
110595
|
async function readBootstrapStateSummary(codexHome) {
|
|
110512
|
-
const statePath =
|
|
110596
|
+
const statePath = join85(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110513
110597
|
const raw = await readJson2(statePath);
|
|
110514
110598
|
if (raw === null)
|
|
110515
110599
|
return null;
|
|
@@ -110588,16 +110672,16 @@ function isRecord12(value) {
|
|
|
110588
110672
|
import { existsSync as existsSync59 } from "fs";
|
|
110589
110673
|
import { readFile as readFile29 } from "fs/promises";
|
|
110590
110674
|
import { homedir as homedir23 } from "os";
|
|
110591
|
-
import { join as
|
|
110675
|
+
import { join as join86, resolve as resolve25 } from "path";
|
|
110592
110676
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110593
110677
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110594
110678
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110595
110679
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110596
|
-
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110680
|
+
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ?? join86(homedir23(), ".codex"));
|
|
110597
110681
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110598
110682
|
const platform = deps.platform ?? process.platform;
|
|
110599
|
-
const wrapperPath =
|
|
110600
|
-
const legacyWrapperPath =
|
|
110683
|
+
const wrapperPath = join86(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110684
|
+
const legacyWrapperPath = join86(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110601
110685
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110602
110686
|
const issues = [];
|
|
110603
110687
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -111125,12 +111209,12 @@ import {
|
|
|
111125
111209
|
unlinkSync as unlinkSync9,
|
|
111126
111210
|
writeFileSync as writeFileSync12
|
|
111127
111211
|
} from "fs";
|
|
111128
|
-
import { basename as basename12, dirname as
|
|
111212
|
+
import { basename as basename12, dirname as dirname34, join as join89 } from "path";
|
|
111129
111213
|
|
|
111130
111214
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111131
111215
|
import { existsSync as existsSync60, realpathSync as realpathSync8 } from "fs";
|
|
111132
111216
|
import { homedir as homedir24 } from "os";
|
|
111133
|
-
import { join as
|
|
111217
|
+
import { join as join87, resolve as resolve26 } from "path";
|
|
111134
111218
|
function resolveConfigPath2(pathValue) {
|
|
111135
111219
|
const resolvedPath = resolve26(pathValue);
|
|
111136
111220
|
if (!existsSync60(resolvedPath))
|
|
@@ -111148,13 +111232,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111148
111232
|
if (customConfigDir) {
|
|
111149
111233
|
return resolveConfigPath2(customConfigDir);
|
|
111150
111234
|
}
|
|
111151
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111152
|
-
return resolveConfigPath2(
|
|
111235
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join87(homedir24(), ".config");
|
|
111236
|
+
return resolveConfigPath2(join87(xdgConfigDir, "opencode"));
|
|
111153
111237
|
}
|
|
111154
111238
|
|
|
111155
111239
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111156
111240
|
import { chmodSync as chmodSync4, existsSync as existsSync61, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
111157
|
-
import { join as
|
|
111241
|
+
import { join as join88 } from "path";
|
|
111158
111242
|
var INDEX_FILE_NAME = "index.json";
|
|
111159
111243
|
function isTokenIndex(value) {
|
|
111160
111244
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111162,7 +111246,7 @@ function isTokenIndex(value) {
|
|
|
111162
111246
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111163
111247
|
}
|
|
111164
111248
|
function getIndexPath(storageDir) {
|
|
111165
|
-
return
|
|
111249
|
+
return join88(storageDir, INDEX_FILE_NAME);
|
|
111166
111250
|
}
|
|
111167
111251
|
function readTokenIndex(storageDir) {
|
|
111168
111252
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -111206,16 +111290,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111206
111290
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111207
111291
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111208
111292
|
function getMcpOauthStorageDir() {
|
|
111209
|
-
return
|
|
111293
|
+
return join89(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111210
111294
|
}
|
|
111211
111295
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111212
111296
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111213
111297
|
}
|
|
111214
111298
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111215
|
-
return
|
|
111299
|
+
return join89(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111216
111300
|
}
|
|
111217
111301
|
function getLegacyStoragePath() {
|
|
111218
|
-
return
|
|
111302
|
+
return join89(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111219
111303
|
}
|
|
111220
111304
|
function normalizeHost2(serverHost) {
|
|
111221
111305
|
let host = serverHost.trim();
|
|
@@ -111309,7 +111393,7 @@ function readLegacyStore() {
|
|
|
111309
111393
|
}
|
|
111310
111394
|
function writeTokenFile(filePath, token) {
|
|
111311
111395
|
try {
|
|
111312
|
-
const dir =
|
|
111396
|
+
const dir = dirname34(filePath);
|
|
111313
111397
|
if (!existsSync62(dir)) {
|
|
111314
111398
|
mkdirSync15(dir, { recursive: true });
|
|
111315
111399
|
}
|
|
@@ -111394,7 +111478,7 @@ function listTokensByHost(serverHost) {
|
|
|
111394
111478
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111395
111479
|
if (!indexedKey.startsWith(prefix))
|
|
111396
111480
|
continue;
|
|
111397
|
-
const indexedToken = readTokenFile(
|
|
111481
|
+
const indexedToken = readTokenFile(join89(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111398
111482
|
if (indexedToken)
|
|
111399
111483
|
result[indexedKey] = indexedToken;
|
|
111400
111484
|
}
|
|
@@ -111409,7 +111493,7 @@ function listAllTokens() {
|
|
|
111409
111493
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111410
111494
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111411
111495
|
continue;
|
|
111412
|
-
const token = readTokenFile(
|
|
111496
|
+
const token = readTokenFile(join89(dir, entry.name));
|
|
111413
111497
|
const hash2 = basename12(entry.name, ".json");
|
|
111414
111498
|
if (token)
|
|
111415
111499
|
result[index[hash2] ?? hash2] = token;
|