oh-my-opencode 5.0.0-beta.5 → 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 +341 -214
- package/dist/cli-node/index.js +341 -214
- package/dist/index.js +1217 -1112
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/tui.js +97 -5
- package/package.json +15 -14
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
- package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +83 -29
- package/packages/lsp-daemon/dist/client.js +76 -22
- package/packages/lsp-daemon/dist/index.js +81 -27
- package/packages/lsp-tools-mcp/dist/cli.js +76 -22
- package/packages/lsp-tools-mcp/dist/mcp.js +76 -22
- package/packages/lsp-tools-mcp/dist/tools.js +76 -22
- 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 +90 -4
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +90 -4
- 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 +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +83 -29
- 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/dist/cli.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
- 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/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +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 +39 -16
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
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:*",
|
|
@@ -2342,6 +2342,7 @@ var init_package = __esm(() => {
|
|
|
2342
2342
|
"@oh-my-opencode/model-core": "workspace:*",
|
|
2343
2343
|
"@oh-my-opencode/omo-codex": "workspace:*",
|
|
2344
2344
|
"@oh-my-opencode/omo-config-core": "workspace:*",
|
|
2345
|
+
"@oh-my-opencode/omo-opencode": "workspace:*",
|
|
2345
2346
|
"@oh-my-opencode/omo-senpi": "workspace:*",
|
|
2346
2347
|
"@oh-my-opencode/openclaw-core": "workspace:*",
|
|
2347
2348
|
"@oh-my-opencode/pi-goal": "workspace:*",
|
|
@@ -2366,18 +2367,18 @@ var init_package = __esm(() => {
|
|
|
2366
2367
|
typescript: "^7.0.2"
|
|
2367
2368
|
},
|
|
2368
2369
|
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.
|
|
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"
|
|
2381
2382
|
},
|
|
2382
2383
|
overrides: {
|
|
2383
2384
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -22405,15 +22406,16 @@ var init_codegraph = __esm(() => {
|
|
|
22405
22406
|
});
|
|
22406
22407
|
|
|
22407
22408
|
// packages/omo-config-core/src/schema/memory.ts
|
|
22408
|
-
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;
|
|
22409
22410
|
var init_memory = __esm(() => {
|
|
22410
22411
|
init_zod();
|
|
22411
22412
|
OmoMemoryReflectionTriggerSchema = object({
|
|
22412
|
-
step_count: number2().int().nonnegative().default(
|
|
22413
|
+
step_count: number2().int().nonnegative().default(25),
|
|
22413
22414
|
on_compaction: boolean2().default(true)
|
|
22414
22415
|
}).strict();
|
|
22415
22416
|
OmoMemoryReflectionSchema = object({
|
|
22416
|
-
|
|
22417
|
+
enabled: boolean2().default(true),
|
|
22418
|
+
trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
|
|
22417
22419
|
merge: _enum2(["auto", "integration"]).default("auto"),
|
|
22418
22420
|
category: string2().min(1).default("quick"),
|
|
22419
22421
|
timeout_minutes: number2().int().positive().default(15),
|
|
@@ -22426,11 +22428,36 @@ var init_memory = __esm(() => {
|
|
|
22426
22428
|
OmoMemorySearchSchema = object({
|
|
22427
22429
|
enabled: boolean2().default(true)
|
|
22428
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();
|
|
22429
22455
|
OmoMemoryReflectionTriggerLayerSchema = object({
|
|
22430
22456
|
step_count: number2().int().nonnegative().optional(),
|
|
22431
22457
|
on_compaction: boolean2().optional()
|
|
22432
22458
|
}).strict();
|
|
22433
22459
|
OmoMemoryReflectionLayerSchema = object({
|
|
22460
|
+
enabled: boolean2().optional(),
|
|
22434
22461
|
trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
|
|
22435
22462
|
merge: _enum2(["auto", "integration"]).optional(),
|
|
22436
22463
|
category: string2().min(1).optional(),
|
|
@@ -22444,10 +22471,39 @@ var init_memory = __esm(() => {
|
|
|
22444
22471
|
OmoMemorySearchLayerSchema = object({
|
|
22445
22472
|
enabled: boolean2().optional()
|
|
22446
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();
|
|
22447
22498
|
OmoMemoryAgentOverridesSchema = object({
|
|
22448
22499
|
enabled: boolean2().optional(),
|
|
22449
22500
|
agent: string2().min(1).optional(),
|
|
22450
22501
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22502
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22503
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22504
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22505
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22506
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22451
22507
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22452
22508
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22453
22509
|
compile_warn_tokens: number2().int().positive().optional()
|
|
@@ -22457,12 +22513,25 @@ var init_memory = __esm(() => {
|
|
|
22457
22513
|
agent: string2().min(1).default("auto"),
|
|
22458
22514
|
tool_exposure: _enum2(["direct", "search"]).default("direct"),
|
|
22459
22515
|
reflection: OmoMemoryReflectionSchema.default({
|
|
22460
|
-
|
|
22516
|
+
enabled: true,
|
|
22517
|
+
trigger: { step_count: 25, on_compaction: true },
|
|
22461
22518
|
merge: "auto",
|
|
22462
22519
|
category: "quick",
|
|
22463
22520
|
timeout_minutes: 15,
|
|
22464
22521
|
sandbox: "auto"
|
|
22465
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 }),
|
|
22466
22535
|
sync: OmoMemorySyncSchema.default({ enabled: true }),
|
|
22467
22536
|
search: OmoMemorySearchSchema.default({ enabled: true }),
|
|
22468
22537
|
compile_warn_tokens: number2().int().positive().default(30000),
|
|
@@ -22473,6 +22542,11 @@ var init_memory = __esm(() => {
|
|
|
22473
22542
|
agent: string2().min(1).optional(),
|
|
22474
22543
|
tool_exposure: _enum2(["direct", "search"]).optional(),
|
|
22475
22544
|
reflection: OmoMemoryReflectionLayerSchema.optional(),
|
|
22545
|
+
nudge: OmoMemoryNudgeLayerSchema.optional(),
|
|
22546
|
+
facts: OmoMemoryFactsLayerSchema.optional(),
|
|
22547
|
+
dream: OmoMemoryDreamLayerSchema.optional(),
|
|
22548
|
+
people: OmoMemoryPeopleLayerSchema.optional(),
|
|
22549
|
+
soul: OmoMemorySoulLayerSchema.optional(),
|
|
22476
22550
|
sync: OmoMemorySyncLayerSchema.optional(),
|
|
22477
22551
|
search: OmoMemorySearchLayerSchema.optional(),
|
|
22478
22552
|
compile_warn_tokens: number2().int().positive().optional(),
|
|
@@ -22628,6 +22702,19 @@ var init_team = __esm(() => {
|
|
|
22628
22702
|
OmoTeamsConfigLayerSchema = record(string2(), OmoTeamSpecLayerSchema);
|
|
22629
22703
|
});
|
|
22630
22704
|
|
|
22705
|
+
// packages/omo-config-core/src/schema/telemetry.ts
|
|
22706
|
+
var OmoTelemetrySettingsShape, OmoTelemetrySettingsLayerSchema, OmoTelemetrySettingsSchema;
|
|
22707
|
+
var init_telemetry = __esm(() => {
|
|
22708
|
+
init_zod();
|
|
22709
|
+
OmoTelemetrySettingsShape = {
|
|
22710
|
+
enabled: boolean2()
|
|
22711
|
+
};
|
|
22712
|
+
OmoTelemetrySettingsLayerSchema = object(OmoTelemetrySettingsShape).partial().strict();
|
|
22713
|
+
OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
|
|
22714
|
+
enabled: boolean2().default(true)
|
|
22715
|
+
}).strict();
|
|
22716
|
+
});
|
|
22717
|
+
|
|
22631
22718
|
// packages/omo-config-core/src/schema/config.ts
|
|
22632
22719
|
var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
|
|
22633
22720
|
var init_config = __esm(() => {
|
|
@@ -22639,6 +22726,7 @@ var init_config = __esm(() => {
|
|
|
22639
22726
|
init_model_catalog();
|
|
22640
22727
|
init_task();
|
|
22641
22728
|
init_team();
|
|
22729
|
+
init_telemetry();
|
|
22642
22730
|
OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
|
|
22643
22731
|
OmoTypedHarnessConfigSchema = object({
|
|
22644
22732
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22647,7 +22735,8 @@ var init_config = __esm(() => {
|
|
|
22647
22735
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
22648
22736
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22649
22737
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22650
|
-
memory: OmoMemorySettingsLayerSchema.optional()
|
|
22738
|
+
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22739
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional()
|
|
22651
22740
|
}).strict();
|
|
22652
22741
|
OmoConfigProfileSchema = object({
|
|
22653
22742
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
@@ -22657,6 +22746,7 @@ var init_config = __esm(() => {
|
|
|
22657
22746
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22658
22747
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22659
22748
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22749
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22660
22750
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22661
22751
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22662
22752
|
"[codex]": OmoTypedHarnessConfigSchema.optional()
|
|
@@ -22670,6 +22760,7 @@ var init_config = __esm(() => {
|
|
|
22670
22760
|
teams: OmoTeamsConfigSchema.optional(),
|
|
22671
22761
|
models: OmoModelCatalogSchema.optional(),
|
|
22672
22762
|
memory: OmoMemorySettingsSchema.optional(),
|
|
22763
|
+
telemetry: OmoTelemetrySettingsSchema.optional(),
|
|
22673
22764
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22674
22765
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22675
22766
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22686,6 +22777,7 @@ var init_config = __esm(() => {
|
|
|
22686
22777
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
22687
22778
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
22688
22779
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
22780
|
+
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
22689
22781
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
22690
22782
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
22691
22783
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
@@ -22708,6 +22800,7 @@ var init_schema = __esm(() => {
|
|
|
22708
22800
|
init_model_ref();
|
|
22709
22801
|
init_task();
|
|
22710
22802
|
init_team();
|
|
22803
|
+
init_telemetry();
|
|
22711
22804
|
});
|
|
22712
22805
|
|
|
22713
22806
|
// packages/omo-config-core/src/loader/merge.ts
|
|
@@ -88770,7 +88863,7 @@ var init_activity_state = __esm(() => {
|
|
|
88770
88863
|
});
|
|
88771
88864
|
|
|
88772
88865
|
// packages/telemetry-core/src/constants.ts
|
|
88773
|
-
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
|
|
88866
|
+
var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74", UNCONFIGURED_POSTHOG_API_KEY = "phc_REPLACE_ME_OMO_NATIVE";
|
|
88774
88867
|
|
|
88775
88868
|
// packages/telemetry-core/src/diagnostics.ts
|
|
88776
88869
|
import { appendFileSync as appendFileSync2, existsSync as existsSync27, mkdirSync as mkdirSync9, readFileSync as readFileSync13 } from "node:fs";
|
|
@@ -88908,6 +89001,9 @@ function shouldDisableTelemetry(input) {
|
|
|
88908
89001
|
const env2 = input.env ?? process.env;
|
|
88909
89002
|
const globalPrefix = input.globalEnvPrefix ?? "OMO";
|
|
88910
89003
|
const prefixes = Array.from(new Set([globalPrefix, input.productEnvPrefix]));
|
|
89004
|
+
if (isDisableFlag(env2["DO_NOT_TRACK"])) {
|
|
89005
|
+
return true;
|
|
89006
|
+
}
|
|
88911
89007
|
for (const prefix of prefixes) {
|
|
88912
89008
|
if (isDisableFlag(env2[`${prefix}_DISABLE_POSTHOG`])) {
|
|
88913
89009
|
return true;
|
|
@@ -88921,6 +89017,13 @@ function shouldDisableTelemetry(input) {
|
|
|
88921
89017
|
function getTelemetryApiKey(env2 = process.env, defaultApiKey = DEFAULT_POSTHOG_API_KEY) {
|
|
88922
89018
|
return env2["POSTHOG_API_KEY"]?.trim() ?? defaultApiKey;
|
|
88923
89019
|
}
|
|
89020
|
+
function isConfiguredTelemetryApiKey(apiKey) {
|
|
89021
|
+
const normalized = apiKey.trim();
|
|
89022
|
+
return normalized.length > 0 && normalized !== UNCONFIGURED_POSTHOG_API_KEY;
|
|
89023
|
+
}
|
|
89024
|
+
function hasTelemetryApiKey(env2, defaultApiKey) {
|
|
89025
|
+
return isConfiguredTelemetryApiKey(getTelemetryApiKey(env2, defaultApiKey));
|
|
89026
|
+
}
|
|
88924
89027
|
function getTelemetryHost(env2 = process.env, defaultHost = DEFAULT_POSTHOG_HOST) {
|
|
88925
89028
|
return env2["POSTHOG_HOST"]?.trim() || defaultHost;
|
|
88926
89029
|
}
|
|
@@ -88930,17 +89033,6 @@ var init_env2 = __esm(() => {
|
|
|
88930
89033
|
SEND_OPT_OUT_VALUES = ["0", "false", "no", "yes"];
|
|
88931
89034
|
});
|
|
88932
89035
|
|
|
88933
|
-
// packages/telemetry-core/src/machine-id.ts
|
|
88934
|
-
import { createHash as createHash4 } from "node:crypto";
|
|
88935
|
-
import os4 from "node:os";
|
|
88936
|
-
function getDefaultTelemetryOsProvider() {
|
|
88937
|
-
return os4;
|
|
88938
|
-
}
|
|
88939
|
-
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
88940
|
-
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
88941
|
-
}
|
|
88942
|
-
var init_machine_id = () => {};
|
|
88943
|
-
|
|
88944
89036
|
// node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
88945
89037
|
import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
|
|
88946
89038
|
function createModulerModifier() {
|
|
@@ -94315,6 +94407,17 @@ var init_index_node = __esm(() => {
|
|
|
94315
94407
|
};
|
|
94316
94408
|
});
|
|
94317
94409
|
|
|
94410
|
+
// packages/telemetry-core/src/machine-id.ts
|
|
94411
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
94412
|
+
import os4 from "node:os";
|
|
94413
|
+
function getDefaultTelemetryOsProvider() {
|
|
94414
|
+
return os4;
|
|
94415
|
+
}
|
|
94416
|
+
function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
|
|
94417
|
+
return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
|
|
94418
|
+
}
|
|
94419
|
+
var init_machine_id = () => {};
|
|
94420
|
+
|
|
94318
94421
|
// packages/telemetry-core/src/posthog-client.ts
|
|
94319
94422
|
class PostHogTelemetryTransport {
|
|
94320
94423
|
#client;
|
|
@@ -94336,7 +94439,7 @@ function createDefaultPostHogTransport(apiKey, options) {
|
|
|
94336
94439
|
}
|
|
94337
94440
|
function isTelemetryClientEnabled(input) {
|
|
94338
94441
|
const env2 = input.env ?? process.env;
|
|
94339
|
-
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) &&
|
|
94442
|
+
return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && hasTelemetryApiKey(env2, input.product.defaultApiKey);
|
|
94340
94443
|
}
|
|
94341
94444
|
function createTelemetryClient(input) {
|
|
94342
94445
|
if (!isTelemetryClientEnabled(input)) {
|
|
@@ -94402,7 +94505,8 @@ function createTransport(input) {
|
|
|
94402
94505
|
flushAt: 1,
|
|
94403
94506
|
flushInterval: 0,
|
|
94404
94507
|
host: getTelemetryHost(env2, input.product.defaultHost),
|
|
94405
|
-
disableGeoip: false
|
|
94508
|
+
disableGeoip: input.product.disableGeoip ?? false,
|
|
94509
|
+
...input.product.transportOptions
|
|
94406
94510
|
});
|
|
94407
94511
|
} catch (error51) {
|
|
94408
94512
|
input.diagnostics?.({
|
|
@@ -94479,6 +94583,17 @@ var init_posthog_client = __esm(() => {
|
|
|
94479
94583
|
};
|
|
94480
94584
|
});
|
|
94481
94585
|
|
|
94586
|
+
// packages/telemetry-core/src/events.ts
|
|
94587
|
+
var ALLOWED_DOLLAR_KEYS;
|
|
94588
|
+
var init_events = __esm(() => {
|
|
94589
|
+
ALLOWED_DOLLAR_KEYS = new Set([
|
|
94590
|
+
"$os",
|
|
94591
|
+
"$os_version",
|
|
94592
|
+
"$process_person_profile",
|
|
94593
|
+
"$session_id"
|
|
94594
|
+
]);
|
|
94595
|
+
});
|
|
94596
|
+
|
|
94482
94597
|
// packages/telemetry-core/src/record-daily-active.ts
|
|
94483
94598
|
var init_record_daily_active = () => {};
|
|
94484
94599
|
|
|
@@ -94487,6 +94602,7 @@ var init_src5 = __esm(() => {
|
|
|
94487
94602
|
init_activity_state();
|
|
94488
94603
|
init_diagnostics();
|
|
94489
94604
|
init_env2();
|
|
94605
|
+
init_events();
|
|
94490
94606
|
init_machine_id();
|
|
94491
94607
|
init_posthog_client();
|
|
94492
94608
|
init_record_daily_active();
|
|
@@ -94497,7 +94613,7 @@ var package_default2;
|
|
|
94497
94613
|
var init_package2 = __esm(() => {
|
|
94498
94614
|
package_default2 = {
|
|
94499
94615
|
name: "@oh-my-opencode/omo-codex",
|
|
94500
|
-
version: "5.0.0-beta.
|
|
94616
|
+
version: "5.0.0-beta.7",
|
|
94501
94617
|
type: "module",
|
|
94502
94618
|
private: true,
|
|
94503
94619
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -94711,7 +94827,7 @@ __export(exports_telemetry, {
|
|
|
94711
94827
|
__resetOsProviderForTesting: () => __resetOsProviderForTesting,
|
|
94712
94828
|
__resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting
|
|
94713
94829
|
});
|
|
94714
|
-
var
|
|
94830
|
+
var init_telemetry2 = __esm(() => {
|
|
94715
94831
|
init_posthog();
|
|
94716
94832
|
});
|
|
94717
94833
|
|
|
@@ -95467,19 +95583,19 @@ var init_update_toasts = __esm(() => {
|
|
|
95467
95583
|
|
|
95468
95584
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95469
95585
|
import { existsSync as existsSync47 } from "node:fs";
|
|
95470
|
-
import { dirname as
|
|
95586
|
+
import { dirname as dirname30, join as join75 } from "node:path";
|
|
95471
95587
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
95472
95588
|
function defaultGetModuleHostingWorkspace() {
|
|
95473
95589
|
try {
|
|
95474
|
-
const currentDir =
|
|
95590
|
+
const currentDir = dirname30(fileURLToPath5(import.meta.url));
|
|
95475
95591
|
const pkgJsonPath = findPackageJsonUp(currentDir);
|
|
95476
95592
|
if (!pkgJsonPath)
|
|
95477
95593
|
return null;
|
|
95478
|
-
const pkgDir =
|
|
95479
|
-
const nodeModulesDir =
|
|
95594
|
+
const pkgDir = dirname30(pkgJsonPath);
|
|
95595
|
+
const nodeModulesDir = dirname30(pkgDir);
|
|
95480
95596
|
if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
|
|
95481
95597
|
return null;
|
|
95482
|
-
return
|
|
95598
|
+
return dirname30(nodeModulesDir);
|
|
95483
95599
|
} catch (error51) {
|
|
95484
95600
|
if (error51 instanceof Error) {
|
|
95485
95601
|
return null;
|
|
@@ -95621,7 +95737,7 @@ var init_background_update_check = __esm(() => {
|
|
|
95621
95737
|
init_update_toasts();
|
|
95622
95738
|
defaultDeps4 = {
|
|
95623
95739
|
existsSync: existsSync47,
|
|
95624
|
-
join:
|
|
95740
|
+
join: join75,
|
|
95625
95741
|
runBunInstallWithDetails,
|
|
95626
95742
|
log: log2,
|
|
95627
95743
|
getOpenCodeCacheDir,
|
|
@@ -100576,7 +100692,7 @@ async function installAstGrepForCodex(options) {
|
|
|
100576
100692
|
// packages/omo-codex/src/install/codex-install-telemetry.ts
|
|
100577
100693
|
async function trackCodexInstallTelemetry() {
|
|
100578
100694
|
try {
|
|
100579
|
-
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (
|
|
100695
|
+
const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry2(), exports_telemetry));
|
|
100580
100696
|
const posthog = createInstallPostHog2();
|
|
100581
100697
|
posthog.trackActive(getPostHogDistinctId2(), "install_completed");
|
|
100582
100698
|
await posthog.shutdown();
|
|
@@ -101396,11 +101512,9 @@ function nodeErrorCode6(error51) {
|
|
|
101396
101512
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101397
101513
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101398
101514
|
import { execFile as execFile4 } from "node:child_process";
|
|
101399
|
-
import {
|
|
101400
|
-
import { constants as constants8, existsSync as existsSync31 } from "node:fs";
|
|
101401
|
-
import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
|
|
101515
|
+
import { existsSync as existsSync31 } from "node:fs";
|
|
101402
101516
|
import { homedir as homedir10 } from "node:os";
|
|
101403
|
-
import { dirname as
|
|
101517
|
+
import { dirname as dirname24, join as join62, resolve as resolve19 } from "node:path";
|
|
101404
101518
|
import { fileURLToPath } from "node:url";
|
|
101405
101519
|
import { promisify as promisify2 } from "node:util";
|
|
101406
101520
|
|
|
@@ -101476,6 +101590,12 @@ node "%~dp0omo" %*\r
|
|
|
101476
101590
|
return path6;
|
|
101477
101591
|
}
|
|
101478
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
|
+
|
|
101479
101599
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101480
101600
|
import { constants as constants7 } from "node:fs";
|
|
101481
101601
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
|
|
@@ -101581,11 +101701,15 @@ function isErrno(error51, code) {
|
|
|
101581
101701
|
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101582
101702
|
}
|
|
101583
101703
|
|
|
101584
|
-
// packages/omo-senpi/src/install/
|
|
101585
|
-
var execFileAsync2 = promisify2(execFile4);
|
|
101704
|
+
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101586
101705
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101587
101706
|
join61("extensions", "omo.js"),
|
|
101707
|
+
join61("extensions", "omo-task.js"),
|
|
101708
|
+
join61("extensions", "omo-member.js"),
|
|
101709
|
+
join61("extensions", "memory-run-supervisor.mjs"),
|
|
101588
101710
|
join61("extensions", "reflection-persona.md"),
|
|
101711
|
+
join61("extensions", "dream-persona.md"),
|
|
101712
|
+
join61("extensions", "facts-persona.md"),
|
|
101589
101713
|
join61("skills", "ast-grep", "SKILL.md"),
|
|
101590
101714
|
join61("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101591
101715
|
join61("skills", "debugging", "SKILL.md"),
|
|
@@ -101618,47 +101742,6 @@ var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
|
101618
101742
|
join61("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101619
101743
|
join61("scripts", "install.mjs")
|
|
101620
101744
|
];
|
|
101621
|
-
async function runSenpiInstaller(options = {}) {
|
|
101622
|
-
const context = resolveInstallContext(options);
|
|
101623
|
-
await ensurePluginArtifacts(context);
|
|
101624
|
-
const settings = await readSettings(context.settingsPath);
|
|
101625
|
-
const before = JSON.stringify(settings);
|
|
101626
|
-
const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
|
|
101627
|
-
if (!packages.includes(context.pluginPath))
|
|
101628
|
-
packages.push(context.pluginPath);
|
|
101629
|
-
settings.packages = packages;
|
|
101630
|
-
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101631
|
-
installLocalLauncher({
|
|
101632
|
-
pluginPath: context.pluginPath,
|
|
101633
|
-
senpiCliPath: join61(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101634
|
-
});
|
|
101635
|
-
return {
|
|
101636
|
-
ok: true,
|
|
101637
|
-
action: "install",
|
|
101638
|
-
agentDir: context.agentDir,
|
|
101639
|
-
settingsPath: context.settingsPath,
|
|
101640
|
-
pluginPath: context.pluginPath,
|
|
101641
|
-
changed: JSON.stringify(settings) !== before,
|
|
101642
|
-
backupPath
|
|
101643
|
-
};
|
|
101644
|
-
}
|
|
101645
|
-
function resolveInstallContext(options) {
|
|
101646
|
-
const env3 = options.env ?? process.env;
|
|
101647
|
-
const allowBuild = options.pluginPath === undefined;
|
|
101648
|
-
const repoRoot = resolve19(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname23(fileURLToPath(import.meta.url))) : dirname23(resolve19(options.pluginPath))));
|
|
101649
|
-
const agentDir = resolve19(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join61(homedir10(), ".senpi", "agent"));
|
|
101650
|
-
const pluginPath = resolve19(options.pluginPath ?? join61(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101651
|
-
return {
|
|
101652
|
-
env: env3,
|
|
101653
|
-
repoRoot,
|
|
101654
|
-
agentDir,
|
|
101655
|
-
settingsPath: join61(agentDir, "settings.json"),
|
|
101656
|
-
pluginPath,
|
|
101657
|
-
platform: options.platform ?? process.platform,
|
|
101658
|
-
allowBuild,
|
|
101659
|
-
runCommand: options.runCommand ?? defaultRunCommand3
|
|
101660
|
-
};
|
|
101661
|
-
}
|
|
101662
101745
|
async function ensurePluginArtifacts(context) {
|
|
101663
101746
|
if (context.allowBuild) {
|
|
101664
101747
|
await context.runCommand("node", [join61(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
@@ -101730,6 +101813,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
|
|
|
101730
101813
|
function messageOf(error51) {
|
|
101731
101814
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
101732
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
|
+
}
|
|
101733
101873
|
async function defaultRunCommand3(command, args, options) {
|
|
101734
101874
|
const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
|
|
101735
101875
|
if (result.stderr.trim().length > 0)
|
|
@@ -101740,28 +101880,15 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101740
101880
|
function findRepoRoot2(importerDir) {
|
|
101741
101881
|
let current = importerDir;
|
|
101742
101882
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101743
|
-
if (fileExistsSync(
|
|
101883
|
+
if (fileExistsSync(join62(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101744
101884
|
return current;
|
|
101745
101885
|
current = resolve19(current, "..");
|
|
101746
101886
|
}
|
|
101747
101887
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101748
101888
|
}
|
|
101749
|
-
async function fileExists2(path6) {
|
|
101750
|
-
try {
|
|
101751
|
-
await access2(path6, constants8.F_OK);
|
|
101752
|
-
return true;
|
|
101753
|
-
} catch (error51) {
|
|
101754
|
-
if (isErrno2(error51, "ENOENT"))
|
|
101755
|
-
return false;
|
|
101756
|
-
throw error51;
|
|
101757
|
-
}
|
|
101758
|
-
}
|
|
101759
101889
|
function fileExistsSync(path6) {
|
|
101760
101890
|
return existsSync31(path6);
|
|
101761
101891
|
}
|
|
101762
|
-
function isErrno2(error51, code) {
|
|
101763
|
-
return error51 instanceof Error && "code" in error51 && error51.code === code;
|
|
101764
|
-
}
|
|
101765
101892
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101766
101893
|
import { execFile as execFile5 } from "node:child_process";
|
|
101767
101894
|
import { promisify as promisify3 } from "node:util";
|
|
@@ -101797,19 +101924,19 @@ init_provider_availability();
|
|
|
101797
101924
|
|
|
101798
101925
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101799
101926
|
import { existsSync as existsSync33, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "node:fs";
|
|
101800
|
-
import { join as
|
|
101927
|
+
import { join as join64 } from "node:path";
|
|
101801
101928
|
|
|
101802
101929
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101803
101930
|
init_shared();
|
|
101804
101931
|
import { existsSync as existsSync32, readFileSync as readFileSync15 } from "node:fs";
|
|
101805
|
-
import { join as
|
|
101932
|
+
import { join as join63 } from "node:path";
|
|
101806
101933
|
var TUI_SUBPATH = "tui";
|
|
101807
101934
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101808
101935
|
function fileEntryPackageJsonPath(entry) {
|
|
101809
101936
|
let path6 = entry.slice("file:".length);
|
|
101810
101937
|
if (path6.startsWith("//"))
|
|
101811
101938
|
path6 = path6.slice(2);
|
|
101812
|
-
return
|
|
101939
|
+
return join63(path6, "package.json");
|
|
101813
101940
|
}
|
|
101814
101941
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101815
101942
|
if (!existsSync32(pkgJsonPath))
|
|
@@ -101847,7 +101974,7 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101847
101974
|
const packageName = packageNameFromServerEntry(entry);
|
|
101848
101975
|
if (packageName === null)
|
|
101849
101976
|
return null;
|
|
101850
|
-
return packageJsonExportsTui(
|
|
101977
|
+
return packageJsonExportsTui(join63(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101851
101978
|
}
|
|
101852
101979
|
function isOurFilePluginEntry(entry) {
|
|
101853
101980
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
@@ -101912,7 +102039,7 @@ function detectServerPluginRegistration() {
|
|
|
101912
102039
|
}
|
|
101913
102040
|
}
|
|
101914
102041
|
function detectTuiPluginRegistration() {
|
|
101915
|
-
const tuiJsonPath =
|
|
102042
|
+
const tuiJsonPath = join63(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
101916
102043
|
if (!existsSync32(tuiJsonPath)) {
|
|
101917
102044
|
return {
|
|
101918
102045
|
registered: false,
|
|
@@ -102068,10 +102195,10 @@ function readConfig(path6) {
|
|
|
102068
102195
|
return null;
|
|
102069
102196
|
}
|
|
102070
102197
|
function readServerConfig(configDir) {
|
|
102071
|
-
const jsoncPath =
|
|
102198
|
+
const jsoncPath = join64(configDir, "opencode.jsonc");
|
|
102072
102199
|
if (existsSync33(jsoncPath))
|
|
102073
102200
|
return readConfig(jsoncPath);
|
|
102074
|
-
const jsonPath =
|
|
102201
|
+
const jsonPath = join64(configDir, "opencode.json");
|
|
102075
102202
|
if (existsSync33(jsonPath))
|
|
102076
102203
|
return readConfig(jsonPath);
|
|
102077
102204
|
return null;
|
|
@@ -102113,7 +102240,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102113
102240
|
if (!desiredEntry) {
|
|
102114
102241
|
return { changed: false, reason: "no-server-entry" };
|
|
102115
102242
|
}
|
|
102116
|
-
const tuiJsonPath =
|
|
102243
|
+
const tuiJsonPath = join64(configDir, "tui.json");
|
|
102117
102244
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102118
102245
|
if (malformed) {
|
|
102119
102246
|
return { changed: false, reason: "malformed" };
|
|
@@ -102129,7 +102256,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102129
102256
|
|
|
102130
102257
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102131
102258
|
import { homedir as homedir11 } from "node:os";
|
|
102132
|
-
import { join as
|
|
102259
|
+
import { join as join65 } from "node:path";
|
|
102133
102260
|
|
|
102134
102261
|
// packages/shared-skills/index.mjs
|
|
102135
102262
|
import { existsSync as existsSync34 } from "node:fs";
|
|
@@ -102151,9 +102278,9 @@ function describeResult2(result) {
|
|
|
102151
102278
|
}
|
|
102152
102279
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102153
102280
|
const platform = options.platform ?? process.platform;
|
|
102154
|
-
const baseDir =
|
|
102281
|
+
const baseDir = join65(options.homeDir ?? homedir11(), ".omo");
|
|
102155
102282
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102156
|
-
const skillDir =
|
|
102283
|
+
const skillDir = join65(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102157
102284
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102158
102285
|
try {
|
|
102159
102286
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -105956,7 +106083,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
|
105956
106083
|
// packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
|
|
105957
106084
|
init_bun_which_shim();
|
|
105958
106085
|
init_spawn_with_windows_hide();
|
|
105959
|
-
import { delimiter as delimiter2, dirname as
|
|
106086
|
+
import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "node:path";
|
|
105960
106087
|
var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
|
|
105961
106088
|
var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
|
|
105962
106089
|
function getCommandCandidates(platform) {
|
|
@@ -106014,7 +106141,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
|
|
|
106014
106141
|
return null;
|
|
106015
106142
|
}
|
|
106016
106143
|
function buildPathWithBinaryFirst(pathEnv, binaryPath) {
|
|
106017
|
-
const preferredDir =
|
|
106144
|
+
const preferredDir = dirname25(binaryPath);
|
|
106018
106145
|
const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
|
|
106019
106146
|
return [preferredDir, ...existing].join(delimiter2);
|
|
106020
106147
|
}
|
|
@@ -106606,9 +106733,9 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106606
106733
|
}
|
|
106607
106734
|
// packages/boulder-state/src/storage/path.ts
|
|
106608
106735
|
import { existsSync as existsSync36 } from "node:fs";
|
|
106609
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106736
|
+
import { isAbsolute as isAbsolute11, join as join66, relative as relative8, resolve as resolve20 } from "node:path";
|
|
106610
106737
|
function getBoulderFilePath(directory) {
|
|
106611
|
-
return
|
|
106738
|
+
return join66(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106612
106739
|
}
|
|
106613
106740
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106614
106741
|
return isAbsolute11(trackedPath) ? resolve20(trackedPath) : resolve20(baseDirectory, trackedPath);
|
|
@@ -106791,9 +106918,9 @@ init_state();
|
|
|
106791
106918
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106792
106919
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106793
106920
|
import { existsSync as existsSync39, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
|
|
106794
|
-
import { join as
|
|
106921
|
+
import { join as join67 } from "node:path";
|
|
106795
106922
|
function getMarkerPath(directory, sessionID) {
|
|
106796
|
-
return
|
|
106923
|
+
return join67(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106797
106924
|
}
|
|
106798
106925
|
function readContinuationMarker(directory, sessionID) {
|
|
106799
106926
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
@@ -106866,7 +106993,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106866
106993
|
init_shared();
|
|
106867
106994
|
init_compaction_marker();
|
|
106868
106995
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
|
|
106869
|
-
import { join as
|
|
106996
|
+
import { join as join68 } from "node:path";
|
|
106870
106997
|
var defaultSessionLastAgentDeps = {
|
|
106871
106998
|
getMessageDir,
|
|
106872
106999
|
isSqliteBackend,
|
|
@@ -106926,7 +107053,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106926
107053
|
try {
|
|
106927
107054
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106928
107055
|
try {
|
|
106929
|
-
const content = readFileSync21(
|
|
107056
|
+
const content = readFileSync21(join68(messageDir, fileName), "utf-8");
|
|
106930
107057
|
const parsed = JSON.parse(content);
|
|
106931
107058
|
return {
|
|
106932
107059
|
fileName,
|
|
@@ -106970,7 +107097,7 @@ init_agent_display_names();
|
|
|
106970
107097
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106971
107098
|
init_frontmatter2();
|
|
106972
107099
|
import { existsSync as existsSync40, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
|
|
106973
|
-
import { dirname as
|
|
107100
|
+
import { dirname as dirname26, join as join69 } from "node:path";
|
|
106974
107101
|
|
|
106975
107102
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
106976
107103
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -106979,7 +107106,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
106979
107106
|
|
|
106980
107107
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
106981
107108
|
function getStateFilePath(directory, customPath) {
|
|
106982
|
-
return customPath ?
|
|
107109
|
+
return customPath ? join69(directory, customPath) : join69(directory, DEFAULT_STATE_FILE);
|
|
106983
107110
|
}
|
|
106984
107111
|
function readState(directory, customPath) {
|
|
106985
107112
|
const filePath = getStateFilePath(directory, customPath);
|
|
@@ -107816,10 +107943,10 @@ Interrupted. Shutting down...`));
|
|
|
107816
107943
|
abortController,
|
|
107817
107944
|
verbose: options.verbose ?? false
|
|
107818
107945
|
};
|
|
107819
|
-
const
|
|
107946
|
+
const events2 = await client3.event.subscribe({ query: { directory } });
|
|
107820
107947
|
const eventState = createEventState();
|
|
107821
107948
|
eventState.agentColorsByName = await loadAgentProfileColors(client3);
|
|
107822
|
-
const eventProcessor = processEvents(ctx,
|
|
107949
|
+
const eventProcessor = processEvents(ctx, events2.stream, eventState).catch(() => {});
|
|
107823
107950
|
const promptResult = await dispatchInternalPrompt({
|
|
107824
107951
|
mode: "async",
|
|
107825
107952
|
client: client3,
|
|
@@ -108086,7 +108213,7 @@ init_extract_semver();
|
|
|
108086
108213
|
init_bun_which_shim();
|
|
108087
108214
|
import { existsSync as existsSync48, accessSync as accessSync4, constants as constants11 } from "node:fs";
|
|
108088
108215
|
import { homedir as homedir14 } from "node:os";
|
|
108089
|
-
import { join as
|
|
108216
|
+
import { join as join76 } from "node:path";
|
|
108090
108217
|
|
|
108091
108218
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108092
108219
|
init_spawn_with_windows_hide();
|
|
@@ -108178,17 +108305,17 @@ function getDesktopAppPaths(platform) {
|
|
|
108178
108305
|
case "darwin":
|
|
108179
108306
|
return [
|
|
108180
108307
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108181
|
-
|
|
108308
|
+
join76(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108182
108309
|
];
|
|
108183
108310
|
case "win32": {
|
|
108184
108311
|
const programFiles = process.env.ProgramFiles;
|
|
108185
108312
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108186
108313
|
const paths2 = [];
|
|
108187
108314
|
if (programFiles) {
|
|
108188
|
-
paths2.push(
|
|
108315
|
+
paths2.push(join76(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108189
108316
|
}
|
|
108190
108317
|
if (localAppData) {
|
|
108191
|
-
paths2.push(
|
|
108318
|
+
paths2.push(join76(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108192
108319
|
}
|
|
108193
108320
|
return paths2;
|
|
108194
108321
|
}
|
|
@@ -108196,8 +108323,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108196
108323
|
return [
|
|
108197
108324
|
"/usr/bin/opencode",
|
|
108198
108325
|
"/usr/lib/opencode/opencode",
|
|
108199
|
-
|
|
108200
|
-
|
|
108326
|
+
join76(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108327
|
+
join76(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108201
108328
|
];
|
|
108202
108329
|
default:
|
|
108203
108330
|
return [];
|
|
@@ -108229,7 +108356,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108229
108356
|
const candidates = getCommandCandidates2(platform);
|
|
108230
108357
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108231
108358
|
for (const command of candidates) {
|
|
108232
|
-
const fullPath =
|
|
108359
|
+
const fullPath = join76(entry, command);
|
|
108233
108360
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108234
108361
|
return { binary: command, path: fullPath };
|
|
108235
108362
|
}
|
|
@@ -108371,22 +108498,22 @@ init_package_json_locator();
|
|
|
108371
108498
|
import { existsSync as existsSync50, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "node:fs";
|
|
108372
108499
|
import { createRequire as createRequire3 } from "node:module";
|
|
108373
108500
|
import { homedir as homedir15 } from "node:os";
|
|
108374
|
-
import { join as
|
|
108501
|
+
import { join as join77 } from "node:path";
|
|
108375
108502
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
108376
108503
|
init_shared();
|
|
108377
108504
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108378
108505
|
if (platform === "darwin")
|
|
108379
|
-
return
|
|
108506
|
+
return join77(homedir15(), "Library", "Caches");
|
|
108380
108507
|
if (platform === "win32")
|
|
108381
|
-
return process.env.LOCALAPPDATA ??
|
|
108382
|
-
return
|
|
108508
|
+
return process.env.LOCALAPPDATA ?? join77(homedir15(), "AppData", "Local");
|
|
108509
|
+
return join77(homedir15(), ".cache");
|
|
108383
108510
|
}
|
|
108384
108511
|
function resolveOpenCodeCacheDir() {
|
|
108385
108512
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108386
108513
|
if (xdgCacheHome)
|
|
108387
|
-
return
|
|
108514
|
+
return join77(xdgCacheHome, "opencode");
|
|
108388
108515
|
const fromShared = getOpenCodeCacheDir();
|
|
108389
|
-
const platformDefault =
|
|
108516
|
+
const platformDefault = join77(getPlatformDefaultCacheDir(), "opencode");
|
|
108390
108517
|
if (existsSync50(fromShared) || !existsSync50(platformDefault))
|
|
108391
108518
|
return fromShared;
|
|
108392
108519
|
return platformDefault;
|
|
@@ -108418,11 +108545,11 @@ function normalizeVersion(value) {
|
|
|
108418
108545
|
function createPackageCandidates(rootDir) {
|
|
108419
108546
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108420
108547
|
packageName,
|
|
108421
|
-
installedPackagePath:
|
|
108548
|
+
installedPackagePath: join77(rootDir, "node_modules", packageName, "package.json")
|
|
108422
108549
|
}));
|
|
108423
108550
|
}
|
|
108424
108551
|
function createTaggedInstallCandidates(rootDir) {
|
|
108425
|
-
const packagesDir =
|
|
108552
|
+
const packagesDir = join77(rootDir, "packages");
|
|
108426
108553
|
if (!existsSync50(packagesDir))
|
|
108427
108554
|
return [];
|
|
108428
108555
|
const candidates = [];
|
|
@@ -108430,14 +108557,14 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108430
108557
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108431
108558
|
if (packageName === undefined)
|
|
108432
108559
|
continue;
|
|
108433
|
-
const installDir =
|
|
108560
|
+
const installDir = join77(packagesDir, entryName);
|
|
108434
108561
|
candidates.push({
|
|
108435
108562
|
cacheDir: installDir,
|
|
108436
|
-
cachePackagePath:
|
|
108563
|
+
cachePackagePath: join77(installDir, "package.json"),
|
|
108437
108564
|
packageCandidates: [
|
|
108438
108565
|
{
|
|
108439
108566
|
packageName,
|
|
108440
|
-
installedPackagePath:
|
|
108567
|
+
installedPackagePath: join77(installDir, "node_modules", packageName, "package.json")
|
|
108441
108568
|
}
|
|
108442
108569
|
]
|
|
108443
108570
|
});
|
|
@@ -108482,13 +108609,13 @@ function getLoadedPluginVersion() {
|
|
|
108482
108609
|
const candidates = [
|
|
108483
108610
|
{
|
|
108484
108611
|
cacheDir: configDir,
|
|
108485
|
-
cachePackagePath:
|
|
108612
|
+
cachePackagePath: join77(configDir, "package.json"),
|
|
108486
108613
|
packageCandidates: createPackageCandidates(configDir)
|
|
108487
108614
|
},
|
|
108488
108615
|
...createTaggedInstallCandidates(configDir),
|
|
108489
108616
|
{
|
|
108490
108617
|
cacheDir,
|
|
108491
|
-
cachePackagePath:
|
|
108618
|
+
cachePackagePath: join77(cacheDir, "package.json"),
|
|
108492
108619
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108493
108620
|
},
|
|
108494
108621
|
...createTaggedInstallCandidates(cacheDir)
|
|
@@ -108681,18 +108808,18 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108681
108808
|
init_shared();
|
|
108682
108809
|
import { existsSync as existsSync52, readFileSync as readFileSync33 } from "node:fs";
|
|
108683
108810
|
import { homedir as homedir16 } from "node:os";
|
|
108684
|
-
import { join as
|
|
108811
|
+
import { join as join78 } from "node:path";
|
|
108685
108812
|
function getUserConfigDir2() {
|
|
108686
108813
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108687
108814
|
if (xdgConfig)
|
|
108688
|
-
return
|
|
108689
|
-
return
|
|
108815
|
+
return join78(xdgConfig, "opencode");
|
|
108816
|
+
return join78(homedir16(), ".config", "opencode");
|
|
108690
108817
|
}
|
|
108691
108818
|
function loadCustomProviderNames() {
|
|
108692
108819
|
const configDir = getUserConfigDir2();
|
|
108693
108820
|
const candidatePaths = [
|
|
108694
|
-
|
|
108695
|
-
|
|
108821
|
+
join78(configDir, "opencode.json"),
|
|
108822
|
+
join78(configDir, "opencode.jsonc")
|
|
108696
108823
|
];
|
|
108697
108824
|
for (const configPath of candidatePaths) {
|
|
108698
108825
|
if (!existsSync52(configPath))
|
|
@@ -108713,7 +108840,7 @@ function loadCustomProviderNames() {
|
|
|
108713
108840
|
return [];
|
|
108714
108841
|
}
|
|
108715
108842
|
function loadAvailableModelsFromCache() {
|
|
108716
|
-
const cacheFile =
|
|
108843
|
+
const cacheFile = join78(getOpenCodeCacheDir(), "models.json");
|
|
108717
108844
|
const customProviders = loadCustomProviderNames();
|
|
108718
108845
|
if (!existsSync52(cacheFile)) {
|
|
108719
108846
|
if (customProviders.length > 0) {
|
|
@@ -108775,7 +108902,7 @@ function loadOmoConfig2() {
|
|
|
108775
108902
|
|
|
108776
108903
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108777
108904
|
init_shared();
|
|
108778
|
-
import { join as
|
|
108905
|
+
import { join as join79 } from "node:path";
|
|
108779
108906
|
|
|
108780
108907
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108781
108908
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108817,7 +108944,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108817
108944
|
}
|
|
108818
108945
|
function buildModelResolutionDetails(options) {
|
|
108819
108946
|
const details = [];
|
|
108820
|
-
const cacheFile =
|
|
108947
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108821
108948
|
details.push("═══ Available Models (from cache) ═══");
|
|
108822
108949
|
details.push("");
|
|
108823
108950
|
if (options.available.cacheExists) {
|
|
@@ -109127,7 +109254,7 @@ async function checkConfig() {
|
|
|
109127
109254
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109128
109255
|
init_main();
|
|
109129
109256
|
import { existsSync as existsSync53, readFileSync as readFileSync34 } from "node:fs";
|
|
109130
|
-
import { join as
|
|
109257
|
+
import { join as join80 } from "node:path";
|
|
109131
109258
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109132
109259
|
["variant", "reasoning"],
|
|
109133
109260
|
["reasoningEffort", "reasoning"],
|
|
@@ -109182,7 +109309,7 @@ function userConfigPaths() {
|
|
|
109182
109309
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109183
109310
|
if (home === undefined || home.length === 0)
|
|
109184
109311
|
return [];
|
|
109185
|
-
return [
|
|
109312
|
+
return [join80(home, ".omo", "omo.jsonc"), join80(home, ".omo", "omo.json")];
|
|
109186
109313
|
}
|
|
109187
109314
|
async function checkDeprecatedReasoningKeys() {
|
|
109188
109315
|
const issues = [];
|
|
@@ -109208,25 +109335,25 @@ init_src2();
|
|
|
109208
109335
|
import { existsSync as existsSync54 } from "node:fs";
|
|
109209
109336
|
import { createRequire as createRequire4 } from "node:module";
|
|
109210
109337
|
import { homedir as homedir18 } from "node:os";
|
|
109211
|
-
import { dirname as
|
|
109338
|
+
import { dirname as dirname31, join as join82 } from "node:path";
|
|
109212
109339
|
|
|
109213
109340
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109214
|
-
import { join as
|
|
109341
|
+
import { join as join81 } from "path";
|
|
109215
109342
|
import { homedir as homedir17, tmpdir as tmpdir4 } from "os";
|
|
109216
109343
|
init_binary_downloader();
|
|
109217
109344
|
init_logger2();
|
|
109218
109345
|
init_plugin_identity();
|
|
109219
109346
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109220
|
-
var DEBUG_FILE =
|
|
109347
|
+
var DEBUG_FILE = join81(tmpdir4(), "comment-checker-debug.log");
|
|
109221
109348
|
function getCacheDir2() {
|
|
109222
109349
|
if (process.platform === "win32") {
|
|
109223
109350
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109224
|
-
const base2 = localAppData ||
|
|
109225
|
-
return
|
|
109351
|
+
const base2 = localAppData || join81(homedir17(), "AppData", "Local");
|
|
109352
|
+
return join81(base2, CACHE_DIR_NAME, "bin");
|
|
109226
109353
|
}
|
|
109227
109354
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109228
|
-
const base = xdgCache ||
|
|
109229
|
-
return
|
|
109355
|
+
const base = xdgCache || join81(homedir17(), ".cache");
|
|
109356
|
+
return join81(base, CACHE_DIR_NAME, "bin");
|
|
109230
109357
|
}
|
|
109231
109358
|
function getBinaryName() {
|
|
109232
109359
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109276,7 +109403,7 @@ async function getBinaryVersion(binary) {
|
|
|
109276
109403
|
}
|
|
109277
109404
|
}
|
|
109278
109405
|
async function checkAstGrepCli() {
|
|
109279
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109406
|
+
const runtimeDir = astGrepRuntimeDir(join82(homedir18(), ".omo"));
|
|
109280
109407
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109281
109408
|
if (sgPath === null) {
|
|
109282
109409
|
return {
|
|
@@ -109305,11 +109432,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109305
109432
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
109306
109433
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109307
109434
|
try {
|
|
109308
|
-
const packageDir = baseDirOverride ??
|
|
109309
|
-
const vendorPath =
|
|
109435
|
+
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109436
|
+
const vendorPath = join82(packageDir, "vendor", platformKey, binaryName);
|
|
109310
109437
|
if (existsSync54(vendorPath))
|
|
109311
109438
|
return vendorPath;
|
|
109312
|
-
const binPath =
|
|
109439
|
+
const binPath = join82(packageDir, "bin", binaryName);
|
|
109313
109440
|
if (existsSync54(binPath))
|
|
109314
109441
|
return binPath;
|
|
109315
109442
|
} catch (error51) {
|
|
@@ -109457,7 +109584,7 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109457
109584
|
init_zod();
|
|
109458
109585
|
init_opencode_config_dir();
|
|
109459
109586
|
import { existsSync as existsSync55, readFileSync as readFileSync35 } from "node:fs";
|
|
109460
|
-
import { delimiter as delimiter3, dirname as
|
|
109587
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve22 } from "node:path";
|
|
109461
109588
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
109462
109589
|
|
|
109463
109590
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109588,7 +109715,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
109588
109715
|
].join(";");
|
|
109589
109716
|
function getModuleDirectory(moduleUrl) {
|
|
109590
109717
|
try {
|
|
109591
|
-
return
|
|
109718
|
+
return dirname32(fileURLToPath7(moduleUrl));
|
|
109592
109719
|
} catch (error51) {
|
|
109593
109720
|
if (!(error51 instanceof Error))
|
|
109594
109721
|
throw error51;
|
|
@@ -109684,13 +109811,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
109684
109811
|
init_shared();
|
|
109685
109812
|
import { existsSync as existsSync56, readFileSync as readFileSync36 } from "node:fs";
|
|
109686
109813
|
import { homedir as homedir19 } from "node:os";
|
|
109687
|
-
import { join as
|
|
109814
|
+
import { join as join83 } from "node:path";
|
|
109688
109815
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109689
109816
|
function getMcpConfigPaths() {
|
|
109690
109817
|
return [
|
|
109691
|
-
|
|
109692
|
-
|
|
109693
|
-
|
|
109818
|
+
join83(homedir19(), ".claude", ".mcp.json"),
|
|
109819
|
+
join83(process.cwd(), ".mcp.json"),
|
|
109820
|
+
join83(process.cwd(), ".claude", ".mcp.json")
|
|
109694
109821
|
];
|
|
109695
109822
|
}
|
|
109696
109823
|
function loadUserMcpConfig() {
|
|
@@ -109972,7 +110099,7 @@ init_src2();
|
|
|
109972
110099
|
import { existsSync as existsSync58 } from "node:fs";
|
|
109973
110100
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
|
|
109974
110101
|
import { homedir as homedir21 } from "node:os";
|
|
109975
|
-
import { basename as basename11, join as
|
|
110102
|
+
import { basename as basename11, join as join84, resolve as resolve23 } from "node:path";
|
|
109976
110103
|
// packages/omo-opencode/package.json
|
|
109977
110104
|
var package_default3 = {
|
|
109978
110105
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110037,13 +110164,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110037
110164
|
"omo-git-bash-hook"
|
|
110038
110165
|
];
|
|
110039
110166
|
async function gatherCodexSummary(deps = {}) {
|
|
110040
|
-
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110167
|
+
const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir21(), ".codex"));
|
|
110041
110168
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110042
110169
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110043
110170
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110044
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110045
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110046
|
-
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");
|
|
110047
110174
|
const pluginVersion = stringField(manifest2, "version");
|
|
110048
110175
|
return {
|
|
110049
110176
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110100,7 +110227,7 @@ function buildCodexIssues(summary) {
|
|
|
110100
110227
|
if (summary.pluginRoot === null) {
|
|
110101
110228
|
issues.push({
|
|
110102
110229
|
title: "OMO Codex plugin is not installed",
|
|
110103
|
-
description: `Expected cached plugin at ${
|
|
110230
|
+
description: `Expected cached plugin at ${join84("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110104
110231
|
fix: "Run: npx lazycodex-ai install",
|
|
110105
110232
|
severity: "error",
|
|
110106
110233
|
affects: ["plugin loading"]
|
|
@@ -110165,12 +110292,12 @@ function buildCodexIssues(summary) {
|
|
|
110165
110292
|
return issues;
|
|
110166
110293
|
}
|
|
110167
110294
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110168
|
-
const pluginRoot =
|
|
110295
|
+
const pluginRoot = join84(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110169
110296
|
if (!existsSync58(pluginRoot))
|
|
110170
110297
|
return null;
|
|
110171
110298
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110172
110299
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110173
|
-
return candidates.length === 0 ? null :
|
|
110300
|
+
return candidates.length === 0 ? null : join84(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110174
110301
|
}
|
|
110175
110302
|
async function readCodexConfigSummary(configPath) {
|
|
110176
110303
|
if (!existsSync58(configPath)) {
|
|
@@ -110198,13 +110325,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110198
110325
|
async function readLinkedBins(binDir) {
|
|
110199
110326
|
const linked = [];
|
|
110200
110327
|
for (const name of CODEX_BIN_NAMES) {
|
|
110201
|
-
if (await pathExists2(
|
|
110328
|
+
if (await pathExists2(join84(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110202
110329
|
linked.push(name);
|
|
110203
110330
|
}
|
|
110204
110331
|
return linked;
|
|
110205
110332
|
}
|
|
110206
110333
|
async function readLinkedAgents(codexHome) {
|
|
110207
|
-
const agentsDir =
|
|
110334
|
+
const agentsDir = join84(codexHome, "agents");
|
|
110208
110335
|
if (!existsSync58(agentsDir))
|
|
110209
110336
|
return [];
|
|
110210
110337
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
@@ -110251,16 +110378,16 @@ function formatCompanionPluginStatus(config4) {
|
|
|
110251
110378
|
return "none";
|
|
110252
110379
|
}
|
|
110253
110380
|
function readCompanionLifecycleHookStateEvents(content) {
|
|
110254
|
-
const
|
|
110381
|
+
const events2 = new Set;
|
|
110255
110382
|
for (const section of splitTomlSections(content)) {
|
|
110256
110383
|
if (section.header === null)
|
|
110257
110384
|
continue;
|
|
110258
110385
|
const key = parseHookStateHeaderKey(section.header);
|
|
110259
110386
|
const event = key === null ? null : companionLifecycleEventFromHookStateKey(key);
|
|
110260
110387
|
if (event !== null)
|
|
110261
|
-
|
|
110388
|
+
events2.add(event);
|
|
110262
110389
|
}
|
|
110263
|
-
return [...
|
|
110390
|
+
return [...events2].sort(compareCompanionLifecycleEvents);
|
|
110264
110391
|
}
|
|
110265
110392
|
function companionLifecycleEventFromHookStateKey(key) {
|
|
110266
110393
|
if (!key.startsWith(`${COMPANION_PLUGIN_KEY}:`))
|
|
@@ -110274,8 +110401,8 @@ function compareCompanionLifecycleEvents(left, right) {
|
|
|
110274
110401
|
function companionLifecycleEventOrder(event) {
|
|
110275
110402
|
return event === "session_start" ? 0 : event === "stop" ? 1 : 2;
|
|
110276
110403
|
}
|
|
110277
|
-
function formatCompanionLifecycleEvents(
|
|
110278
|
-
return
|
|
110404
|
+
function formatCompanionLifecycleEvents(events2) {
|
|
110405
|
+
return events2.map(formatCompanionLifecycleEvent).join(", ");
|
|
110279
110406
|
}
|
|
110280
110407
|
function formatCompanionLifecycleEvent(event) {
|
|
110281
110408
|
switch (event) {
|
|
@@ -110320,7 +110447,7 @@ async function pathExists2(path14) {
|
|
|
110320
110447
|
init_src2();
|
|
110321
110448
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
|
|
110322
110449
|
import { homedir as homedir22 } from "node:os";
|
|
110323
|
-
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";
|
|
110324
110451
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110325
110452
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110326
110453
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110330,7 +110457,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110330
110457
|
const env3 = deps.env ?? process.env;
|
|
110331
110458
|
const platform = deps.platform ?? process.platform;
|
|
110332
110459
|
const arch = deps.arch ?? process.arch;
|
|
110333
|
-
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ??
|
|
110460
|
+
const codexHome = resolve24(deps.codexHome ?? env3["CODEX_HOME"] ?? join85(homedir22(), ".codex"));
|
|
110334
110461
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110335
110462
|
if (summary.pluginRoot === null) {
|
|
110336
110463
|
return {
|
|
@@ -110355,7 +110482,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110355
110482
|
});
|
|
110356
110483
|
}
|
|
110357
110484
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110358
|
-
const runtimeSgPath =
|
|
110485
|
+
const runtimeSgPath = join85(runtimeSgDir, sgBinaryName(platform));
|
|
110359
110486
|
const sg = findSgBinarySync({
|
|
110360
110487
|
arch,
|
|
110361
110488
|
env: env3,
|
|
@@ -110394,7 +110521,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110394
110521
|
const manifest2 = await readJson2(manifestPath);
|
|
110395
110522
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110396
110523
|
continue;
|
|
110397
|
-
const manifestRoot =
|
|
110524
|
+
const manifestRoot = dirname33(manifestPath);
|
|
110398
110525
|
const isRootManifest = resolve24(manifestRoot) === resolve24(pluginRoot);
|
|
110399
110526
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110400
110527
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
@@ -110415,7 +110542,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110415
110542
|
continue;
|
|
110416
110543
|
const commands2 = [];
|
|
110417
110544
|
collectHookCommands(manifest2, commands2);
|
|
110418
|
-
const hookPluginRoot =
|
|
110545
|
+
const hookPluginRoot = dirname33(dirname33(hookManifestPath));
|
|
110419
110546
|
for (const command of commands2) {
|
|
110420
110547
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
110421
110548
|
referencedCount += 1;
|
|
@@ -110454,7 +110581,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
110454
110581
|
}
|
|
110455
110582
|
async function findHookManifestPaths(root) {
|
|
110456
110583
|
const paths3 = await findManifestPaths(root, "hooks.json");
|
|
110457
|
-
return paths3.filter((path14) =>
|
|
110584
|
+
return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
|
|
110458
110585
|
}
|
|
110459
110586
|
async function findManifestPaths(root, manifestName) {
|
|
110460
110587
|
let entries;
|
|
@@ -110467,7 +110594,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110467
110594
|
for (const entry of entries) {
|
|
110468
110595
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110469
110596
|
continue;
|
|
110470
|
-
const entryPath =
|
|
110597
|
+
const entryPath = join85(root, entry.name);
|
|
110471
110598
|
if (entry.isDirectory()) {
|
|
110472
110599
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110473
110600
|
continue;
|
|
@@ -110511,18 +110638,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110511
110638
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110512
110639
|
}
|
|
110513
110640
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110514
|
-
return
|
|
110641
|
+
return join85(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110515
110642
|
}
|
|
110516
110643
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110517
110644
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110518
110645
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110519
110646
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110520
|
-
if (sgPath ===
|
|
110647
|
+
if (sgPath === join85(runtimeSgDir, sgBinaryName(platform)))
|
|
110521
110648
|
return "runtime dir";
|
|
110522
110649
|
return "PATH";
|
|
110523
110650
|
}
|
|
110524
110651
|
async function readBootstrapStateSummary(codexHome) {
|
|
110525
|
-
const statePath =
|
|
110652
|
+
const statePath = join85(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110526
110653
|
const raw = await readJson2(statePath);
|
|
110527
110654
|
if (raw === null)
|
|
110528
110655
|
return null;
|
|
@@ -110601,16 +110728,16 @@ function isRecord12(value) {
|
|
|
110601
110728
|
import { existsSync as existsSync59 } from "node:fs";
|
|
110602
110729
|
import { readFile as readFile29 } from "node:fs/promises";
|
|
110603
110730
|
import { homedir as homedir23 } from "node:os";
|
|
110604
|
-
import { join as
|
|
110731
|
+
import { join as join86, resolve as resolve25 } from "node:path";
|
|
110605
110732
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110606
110733
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110607
110734
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110608
110735
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110609
|
-
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
110736
|
+
const codexHome = resolve25(deps.codexHome ?? process.env.CODEX_HOME ?? join86(homedir23(), ".codex"));
|
|
110610
110737
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110611
110738
|
const platform = deps.platform ?? process.platform;
|
|
110612
|
-
const wrapperPath =
|
|
110613
|
-
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");
|
|
110614
110741
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110615
110742
|
const issues = [];
|
|
110616
110743
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -111138,12 +111265,12 @@ import {
|
|
|
111138
111265
|
unlinkSync as unlinkSync9,
|
|
111139
111266
|
writeFileSync as writeFileSync12
|
|
111140
111267
|
} from "node:fs";
|
|
111141
|
-
import { basename as basename12, dirname as
|
|
111268
|
+
import { basename as basename12, dirname as dirname34, join as join89 } from "node:path";
|
|
111142
111269
|
|
|
111143
111270
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111144
111271
|
import { existsSync as existsSync60, realpathSync as realpathSync8 } from "node:fs";
|
|
111145
111272
|
import { homedir as homedir24 } from "node:os";
|
|
111146
|
-
import { join as
|
|
111273
|
+
import { join as join87, resolve as resolve26 } from "node:path";
|
|
111147
111274
|
function resolveConfigPath2(pathValue) {
|
|
111148
111275
|
const resolvedPath = resolve26(pathValue);
|
|
111149
111276
|
if (!existsSync60(resolvedPath))
|
|
@@ -111161,13 +111288,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111161
111288
|
if (customConfigDir) {
|
|
111162
111289
|
return resolveConfigPath2(customConfigDir);
|
|
111163
111290
|
}
|
|
111164
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111165
|
-
return resolveConfigPath2(
|
|
111291
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join87(homedir24(), ".config");
|
|
111292
|
+
return resolveConfigPath2(join87(xdgConfigDir, "opencode"));
|
|
111166
111293
|
}
|
|
111167
111294
|
|
|
111168
111295
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111169
111296
|
import { chmodSync as chmodSync4, existsSync as existsSync61, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
111170
|
-
import { join as
|
|
111297
|
+
import { join as join88 } from "node:path";
|
|
111171
111298
|
var INDEX_FILE_NAME = "index.json";
|
|
111172
111299
|
function isTokenIndex(value) {
|
|
111173
111300
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111175,7 +111302,7 @@ function isTokenIndex(value) {
|
|
|
111175
111302
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111176
111303
|
}
|
|
111177
111304
|
function getIndexPath(storageDir) {
|
|
111178
|
-
return
|
|
111305
|
+
return join88(storageDir, INDEX_FILE_NAME);
|
|
111179
111306
|
}
|
|
111180
111307
|
function readTokenIndex(storageDir) {
|
|
111181
111308
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -111219,16 +111346,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111219
111346
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111220
111347
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111221
111348
|
function getMcpOauthStorageDir() {
|
|
111222
|
-
return
|
|
111349
|
+
return join89(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111223
111350
|
}
|
|
111224
111351
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111225
111352
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111226
111353
|
}
|
|
111227
111354
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111228
|
-
return
|
|
111355
|
+
return join89(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111229
111356
|
}
|
|
111230
111357
|
function getLegacyStoragePath() {
|
|
111231
|
-
return
|
|
111358
|
+
return join89(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111232
111359
|
}
|
|
111233
111360
|
function normalizeHost2(serverHost) {
|
|
111234
111361
|
let host = serverHost.trim();
|
|
@@ -111322,7 +111449,7 @@ function readLegacyStore() {
|
|
|
111322
111449
|
}
|
|
111323
111450
|
function writeTokenFile(filePath, token) {
|
|
111324
111451
|
try {
|
|
111325
|
-
const dir =
|
|
111452
|
+
const dir = dirname34(filePath);
|
|
111326
111453
|
if (!existsSync62(dir)) {
|
|
111327
111454
|
mkdirSync15(dir, { recursive: true });
|
|
111328
111455
|
}
|
|
@@ -111407,7 +111534,7 @@ function listTokensByHost(serverHost) {
|
|
|
111407
111534
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111408
111535
|
if (!indexedKey.startsWith(prefix))
|
|
111409
111536
|
continue;
|
|
111410
|
-
const indexedToken = readTokenFile(
|
|
111537
|
+
const indexedToken = readTokenFile(join89(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111411
111538
|
if (indexedToken)
|
|
111412
111539
|
result[indexedKey] = indexedToken;
|
|
111413
111540
|
}
|
|
@@ -111422,7 +111549,7 @@ function listAllTokens() {
|
|
|
111422
111549
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111423
111550
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111424
111551
|
continue;
|
|
111425
|
-
const token = readTokenFile(
|
|
111552
|
+
const token = readTokenFile(join89(dir, entry.name));
|
|
111426
111553
|
const hash2 = basename12(entry.name, ".json");
|
|
111427
111554
|
if (token)
|
|
111428
111555
|
result[index[hash2] ?? hash2] = token;
|