oh-my-opencode 5.0.0-beta.7 → 5.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +446 -336
- package/dist/cli-node/index.js +446 -336
- package/dist/index.js +272 -28
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/skills/frontend/SKILL.md +10 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +2 -2
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/dist/skills/ulw-plan/SKILL.md +2 -2
- package/dist/skills/ulw-plan/references/full-workflow.md +27 -3
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/tui.js +75 -7
- package/package.json +19 -19
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- 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 +24 -2
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +24 -2
- 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/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
- 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/references/define-goal.md +5 -3
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
- 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/frontend/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +5 -3
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
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.8",
|
|
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.16",
|
|
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:*",
|
|
@@ -2357,7 +2357,7 @@ var init_package = __esm(() => {
|
|
|
2357
2357
|
"@oh-my-opencode/utils": "workspace:*",
|
|
2358
2358
|
"@types/js-yaml": "^4.0.9",
|
|
2359
2359
|
"@types/picomatch": "^4.0.3",
|
|
2360
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
2360
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
2361
2361
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
2362
2362
|
"@xterm/xterm": "^6.0.0",
|
|
2363
2363
|
"bun-types": "1.3.14",
|
|
@@ -2366,24 +2366,24 @@ 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.8",
|
|
2370
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.8",
|
|
2371
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.8",
|
|
2372
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.8",
|
|
2373
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.8",
|
|
2374
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.8",
|
|
2375
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.8",
|
|
2376
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.8",
|
|
2377
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.8",
|
|
2378
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.8",
|
|
2379
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.8",
|
|
2380
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.8"
|
|
2381
2381
|
},
|
|
2382
2382
|
overrides: {
|
|
2383
|
-
"@earendil-works/pi-agent-core": "0.
|
|
2384
|
-
"@earendil-works/pi-ai": "0.
|
|
2385
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
2386
|
-
"@earendil-works/pi-tui": "0.
|
|
2383
|
+
"@earendil-works/pi-agent-core": "0.84.2",
|
|
2384
|
+
"@earendil-works/pi-ai": "0.84.2",
|
|
2385
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
2386
|
+
"@earendil-works/pi-tui": "0.84.2",
|
|
2387
2387
|
hono: "^4.12.18",
|
|
2388
2388
|
"@hono/node-server": "^1.19.13",
|
|
2389
2389
|
"express-rate-limit": "^8.5.1",
|
|
@@ -22584,7 +22584,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22584
22584
|
residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
|
|
22585
22585
|
});
|
|
22586
22586
|
}
|
|
22587
|
-
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22587
|
+
var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
|
|
22588
22588
|
var init_task = __esm(() => {
|
|
22589
22589
|
init_zod();
|
|
22590
22590
|
ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
|
|
@@ -22601,6 +22601,16 @@ var init_task = __esm(() => {
|
|
|
22601
22601
|
OmoTaskWarningsSchema = object({
|
|
22602
22602
|
unavailable_categories: boolean2().default(true)
|
|
22603
22603
|
}).strict();
|
|
22604
|
+
OmoTaskDagSettingsSchema = object({
|
|
22605
|
+
max_nodes_per_run: number2().int().positive().default(64),
|
|
22606
|
+
max_runs_per_session: number2().int().positive().default(16),
|
|
22607
|
+
subscriber_ring: number2().int().positive().default(1000),
|
|
22608
|
+
heartbeat_ms: number2().int().positive().default(15000),
|
|
22609
|
+
history_default_limit: number2().int().positive().default(256),
|
|
22610
|
+
history_max_limit: number2().int().positive().default(1000),
|
|
22611
|
+
retention_days: number2().int().positive().default(7),
|
|
22612
|
+
max_prompt_bytes: number2().int().positive().default(262144)
|
|
22613
|
+
}).strict();
|
|
22604
22614
|
OmoTaskSettingsSchema = object({
|
|
22605
22615
|
default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
|
|
22606
22616
|
default_concurrency: number2().int().positive().default(5),
|
|
@@ -22618,7 +22628,18 @@ var init_task = __esm(() => {
|
|
|
22618
22628
|
max_members: 8,
|
|
22619
22629
|
max_parallel_members: 4,
|
|
22620
22630
|
max_wall_clock_minutes: 120
|
|
22621
|
-
})
|
|
22631
|
+
}),
|
|
22632
|
+
dag: OmoTaskDagSettingsSchema.optional()
|
|
22633
|
+
}).strict();
|
|
22634
|
+
OmoTaskDagSettingsLayerSchema = object({
|
|
22635
|
+
max_nodes_per_run: number2().int().positive().optional(),
|
|
22636
|
+
max_runs_per_session: number2().int().positive().optional(),
|
|
22637
|
+
subscriber_ring: number2().int().positive().optional(),
|
|
22638
|
+
heartbeat_ms: number2().int().positive().optional(),
|
|
22639
|
+
history_default_limit: number2().int().positive().optional(),
|
|
22640
|
+
history_max_limit: number2().int().positive().optional(),
|
|
22641
|
+
retention_days: number2().int().positive().optional(),
|
|
22642
|
+
max_prompt_bytes: number2().int().positive().optional()
|
|
22622
22643
|
}).strict();
|
|
22623
22644
|
OmoTaskWaitLayerSchema = object({
|
|
22624
22645
|
min_ms: number2().int().positive().optional(),
|
|
@@ -22646,7 +22667,8 @@ var init_task = __esm(() => {
|
|
|
22646
22667
|
resume_children: boolean2().optional(),
|
|
22647
22668
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22648
22669
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22649
|
-
team: OmoTaskTeamSettingsLayerSchema.optional()
|
|
22670
|
+
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22671
|
+
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22650
22672
|
}).strict();
|
|
22651
22673
|
});
|
|
22652
22674
|
|
|
@@ -26471,10 +26493,10 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26471
26493
|
quick: {
|
|
26472
26494
|
fallbackChain: [
|
|
26473
26495
|
{ providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
|
|
26474
|
-
{ providers: ["
|
|
26496
|
+
{ providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
|
|
26475
26497
|
{ providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
|
|
26476
26498
|
{
|
|
26477
|
-
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "
|
|
26499
|
+
providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
|
|
26478
26500
|
model: "qwen3.6-flash",
|
|
26479
26501
|
variant: "low"
|
|
26480
26502
|
},
|
|
@@ -26490,6 +26512,11 @@ var init_category_model_requirements = __esm(() => {
|
|
|
26490
26512
|
},
|
|
26491
26513
|
"unspecified-low": {
|
|
26492
26514
|
fallbackChain: [
|
|
26515
|
+
{
|
|
26516
|
+
providers: ["xai", "github-copilot", "opencode", "vercel"],
|
|
26517
|
+
model: "grok-4.6",
|
|
26518
|
+
variant: "xhigh"
|
|
26519
|
+
},
|
|
26493
26520
|
{
|
|
26494
26521
|
providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
|
|
26495
26522
|
model: "gpt-5.6-terra",
|
|
@@ -27724,6 +27751,7 @@ var init_context_limit_resolver2 = () => {};
|
|
|
27724
27751
|
|
|
27725
27752
|
// packages/omo-opencode/src/shared/normalize-sdk-response.ts
|
|
27726
27753
|
function normalizeSDKResponse(response, fallback, options) {
|
|
27754
|
+
const fallbackIsArray = Array.isArray(fallback);
|
|
27727
27755
|
if (response == null) {
|
|
27728
27756
|
return fallback;
|
|
27729
27757
|
}
|
|
@@ -27733,14 +27761,17 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
27733
27761
|
if (typeof response === "object" && "data" in response) {
|
|
27734
27762
|
const data = response.data;
|
|
27735
27763
|
if (data != null) {
|
|
27764
|
+
if (fallbackIsArray && !Array.isArray(data)) {
|
|
27765
|
+
return fallback;
|
|
27766
|
+
}
|
|
27736
27767
|
return data;
|
|
27737
27768
|
}
|
|
27738
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27769
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27739
27770
|
return response;
|
|
27740
27771
|
}
|
|
27741
27772
|
return fallback;
|
|
27742
27773
|
}
|
|
27743
|
-
if (options?.preferResponseOnMissingData === true) {
|
|
27774
|
+
if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
|
|
27744
27775
|
return response;
|
|
27745
27776
|
}
|
|
27746
27777
|
return fallback;
|
|
@@ -28220,7 +28251,7 @@ This is NOT a default choice - it's for genuinely unclassifiable moderate-effort
|
|
|
28220
28251
|
</Category_Context>
|
|
28221
28252
|
|
|
28222
28253
|
<Caller_Warning>
|
|
28223
|
-
THIS CATEGORY USES
|
|
28254
|
+
THIS CATEGORY USES GROK 4.6 (xhigh).
|
|
28224
28255
|
|
|
28225
28256
|
**PROVIDE CLEAR STRUCTURE:**
|
|
28226
28257
|
1. MUST DO: Enumerate required actions explicitly
|
|
@@ -28252,7 +28283,7 @@ var init_openai_categories = __esm(() => {
|
|
|
28252
28283
|
},
|
|
28253
28284
|
{
|
|
28254
28285
|
name: "unspecified-low",
|
|
28255
|
-
config: { model: "
|
|
28286
|
+
config: { model: "xai/grok-4.6", variant: "xhigh" },
|
|
28256
28287
|
description: "Tasks that don't fit other categories, low effort required",
|
|
28257
28288
|
promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
|
|
28258
28289
|
}
|
|
@@ -83149,6 +83180,47 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
83149
83180
|
input: 272000,
|
|
83150
83181
|
output: 128000
|
|
83151
83182
|
}
|
|
83183
|
+
},
|
|
83184
|
+
"grok-4.6": {
|
|
83185
|
+
id: "grok-4.6",
|
|
83186
|
+
family: "grok",
|
|
83187
|
+
reasoning: true,
|
|
83188
|
+
temperature: true,
|
|
83189
|
+
toolCall: true,
|
|
83190
|
+
modalities: {
|
|
83191
|
+
input: [
|
|
83192
|
+
"text",
|
|
83193
|
+
"image"
|
|
83194
|
+
],
|
|
83195
|
+
output: [
|
|
83196
|
+
"text"
|
|
83197
|
+
]
|
|
83198
|
+
},
|
|
83199
|
+
limit: {
|
|
83200
|
+
context: 500000,
|
|
83201
|
+
output: 500000
|
|
83202
|
+
}
|
|
83203
|
+
},
|
|
83204
|
+
"xai/grok-4.6": {
|
|
83205
|
+
id: "xai/grok-4.6",
|
|
83206
|
+
family: "grok",
|
|
83207
|
+
reasoning: true,
|
|
83208
|
+
temperature: true,
|
|
83209
|
+
toolCall: true,
|
|
83210
|
+
modalities: {
|
|
83211
|
+
input: [
|
|
83212
|
+
"text",
|
|
83213
|
+
"image",
|
|
83214
|
+
"pdf"
|
|
83215
|
+
],
|
|
83216
|
+
output: [
|
|
83217
|
+
"text"
|
|
83218
|
+
]
|
|
83219
|
+
},
|
|
83220
|
+
limit: {
|
|
83221
|
+
context: 500000,
|
|
83222
|
+
output: 500000
|
|
83223
|
+
}
|
|
83152
83224
|
}
|
|
83153
83225
|
}
|
|
83154
83226
|
};
|
|
@@ -94557,7 +94629,7 @@ var package_default2;
|
|
|
94557
94629
|
var init_package2 = __esm(() => {
|
|
94558
94630
|
package_default2 = {
|
|
94559
94631
|
name: "@oh-my-opencode/omo-codex",
|
|
94560
|
-
version: "5.0.0-beta.
|
|
94632
|
+
version: "5.0.0-beta.8",
|
|
94561
94633
|
type: "module",
|
|
94562
94634
|
private: true,
|
|
94563
94635
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -95526,8 +95598,8 @@ var init_update_toasts = __esm(() => {
|
|
|
95526
95598
|
});
|
|
95527
95599
|
|
|
95528
95600
|
// packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
95529
|
-
import { existsSync as
|
|
95530
|
-
import { dirname as dirname30, join as
|
|
95601
|
+
import { existsSync as existsSync48 } from "fs";
|
|
95602
|
+
import { dirname as dirname30, join as join76 } from "path";
|
|
95531
95603
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
95532
95604
|
function defaultGetModuleHostingWorkspace() {
|
|
95533
95605
|
try {
|
|
@@ -95680,8 +95752,8 @@ var init_background_update_check = __esm(() => {
|
|
|
95680
95752
|
init_package_json_locator();
|
|
95681
95753
|
init_update_toasts();
|
|
95682
95754
|
defaultDeps4 = {
|
|
95683
|
-
existsSync:
|
|
95684
|
-
join:
|
|
95755
|
+
existsSync: existsSync48,
|
|
95756
|
+
join: join76,
|
|
95685
95757
|
runBunInstallWithDetails,
|
|
95686
95758
|
log: log2,
|
|
95687
95759
|
getOpenCodeCacheDir,
|
|
@@ -95844,7 +95916,7 @@ async function showSpinnerToast(ctx, version3, message) {
|
|
|
95844
95916
|
duration: frameInterval + 50
|
|
95845
95917
|
}
|
|
95846
95918
|
}).catch(ignoreToastError);
|
|
95847
|
-
await new Promise((
|
|
95919
|
+
await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
|
|
95848
95920
|
}
|
|
95849
95921
|
}
|
|
95850
95922
|
var SISYPHUS_SPINNER;
|
|
@@ -101456,29 +101528,55 @@ function nodeErrorCode6(error51) {
|
|
|
101456
101528
|
var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
|
|
101457
101529
|
// packages/omo-senpi/src/install/install-senpi.ts
|
|
101458
101530
|
import { execFile as execFile4 } from "child_process";
|
|
101459
|
-
import { existsSync as
|
|
101460
|
-
import { homedir as
|
|
101461
|
-
import { dirname as dirname24, join as
|
|
101531
|
+
import { existsSync as existsSync32 } from "fs";
|
|
101532
|
+
import { homedir as homedir11 } from "os";
|
|
101533
|
+
import { dirname as dirname24, join as join63, resolve as resolve20 } from "path";
|
|
101462
101534
|
import { fileURLToPath } from "url";
|
|
101463
101535
|
import { promisify as promisify2 } from "util";
|
|
101464
101536
|
|
|
101465
|
-
// packages/omo-senpi/src/
|
|
101466
|
-
import {
|
|
101537
|
+
// packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
|
|
101538
|
+
import { existsSync as existsSync30 } from "fs";
|
|
101467
101539
|
import { homedir as homedir9 } from "os";
|
|
101468
|
-
import {
|
|
101540
|
+
import { join as join59, resolve as resolve17 } from "path";
|
|
101541
|
+
var AGENT_DIR_ENV_NAMES = [
|
|
101542
|
+
"OMO_CODING_AGENT_DIR",
|
|
101543
|
+
"SENPI_CODING_AGENT_DIR",
|
|
101544
|
+
"PI_CODING_AGENT_DIR"
|
|
101545
|
+
];
|
|
101546
|
+
var AGENT_HOME_SENTINEL = "settings.json";
|
|
101547
|
+
function resolveAgentHome(options) {
|
|
101548
|
+
const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
|
|
101549
|
+
for (const name of AGENT_DIR_ENV_NAMES) {
|
|
101550
|
+
const configured = env3[name]?.trim();
|
|
101551
|
+
if (configured)
|
|
101552
|
+
return resolve17(configured);
|
|
101553
|
+
}
|
|
101554
|
+
const brandedHome = join59(homeDir, ".omo");
|
|
101555
|
+
const canonical = join59(brandedHome, "agent");
|
|
101556
|
+
if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
|
|
101557
|
+
return canonical;
|
|
101558
|
+
if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
|
|
101559
|
+
return brandedHome;
|
|
101560
|
+
return join59(homeDir, ".senpi", "agent");
|
|
101561
|
+
}
|
|
101562
|
+
|
|
101563
|
+
// packages/omo-senpi/src/install/local-launcher.ts
|
|
101564
|
+
import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
101565
|
+
import { homedir as homedir10 } from "os";
|
|
101566
|
+
import { dirname as dirname21, join as join60, resolve as resolve18 } from "path";
|
|
101469
101567
|
var MARKER = "omo-local-launcher";
|
|
101470
|
-
function localLauncherPath(homeDir =
|
|
101471
|
-
return
|
|
101568
|
+
function localLauncherPath(homeDir = homedir10()) {
|
|
101569
|
+
return join60(homeDir, ".local", "bin", "omo");
|
|
101472
101570
|
}
|
|
101473
|
-
function localLauncherCmdPath(homeDir =
|
|
101474
|
-
return
|
|
101571
|
+
function localLauncherCmdPath(homeDir = homedir10()) {
|
|
101572
|
+
return join60(homeDir, ".local", "bin", "omo.cmd");
|
|
101475
101573
|
}
|
|
101476
101574
|
function renderLocalLauncher(options) {
|
|
101477
101575
|
const brand = {
|
|
101478
101576
|
name: "omo",
|
|
101479
101577
|
displayVersion: options.version ?? "local",
|
|
101480
101578
|
configDir: ".omo",
|
|
101481
|
-
flatLayout:
|
|
101579
|
+
flatLayout: false,
|
|
101482
101580
|
envPrefix: "OMO",
|
|
101483
101581
|
userAgent: "omo",
|
|
101484
101582
|
originator: "omo",
|
|
@@ -101492,11 +101590,23 @@ function renderLocalLauncher(options) {
|
|
|
101492
101590
|
return `#!/usr/bin/env node
|
|
101493
101591
|
// ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
|
|
101494
101592
|
import { spawn } from "node:child_process"
|
|
101593
|
+
import { homedir } from "node:os"
|
|
101594
|
+
import { join } from "node:path"
|
|
101495
101595
|
|
|
101496
101596
|
const brand = ${JSON.stringify(brand)}
|
|
101497
101597
|
const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
|
|
101498
101598
|
const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
|
|
101499
|
-
|
|
101599
|
+
// The same directory the published launcher pins, so a local install shares one state location
|
|
101600
|
+
// with the published one and with anything either of them spawns.
|
|
101601
|
+
const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
|
|
101602
|
+
?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
|
|
101603
|
+
const env = {
|
|
101604
|
+
...process.env,
|
|
101605
|
+
SENPI_BRAND: JSON.stringify(brand),
|
|
101606
|
+
OMO_NATIVE: "1",
|
|
101607
|
+
OMO_CODING_AGENT_DIR: agentDir,
|
|
101608
|
+
SENPI_CODING_AGENT_DIR: agentDir,
|
|
101609
|
+
}
|
|
101500
101610
|
// Anything resolving the product by name must re-enter through this launcher, never the engine.
|
|
101501
101611
|
env.OMO_BIN = process.argv[1]
|
|
101502
101612
|
const selfUpdate = process.argv[2] === "update"
|
|
@@ -101521,7 +101631,7 @@ child.on("close", (code, signal) => {
|
|
|
101521
101631
|
}
|
|
101522
101632
|
function installLocalLauncher(options) {
|
|
101523
101633
|
const path6 = localLauncherPath(options.homeDir);
|
|
101524
|
-
if (
|
|
101634
|
+
if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
|
|
101525
101635
|
return;
|
|
101526
101636
|
mkdirSync10(dirname21(path6), { recursive: true });
|
|
101527
101637
|
writeFileSync6(path6, renderLocalLauncher(options));
|
|
@@ -101538,16 +101648,16 @@ node "%~dp0omo" %*\r
|
|
|
101538
101648
|
import { createHash as createHash5 } from "crypto";
|
|
101539
101649
|
import { constants as constants8 } from "fs";
|
|
101540
101650
|
import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
|
|
101541
|
-
import { dirname as dirname23, join as
|
|
101651
|
+
import { dirname as dirname23, join as join62 } from "path";
|
|
101542
101652
|
|
|
101543
101653
|
// packages/omo-senpi/src/install/senpi-settings.ts
|
|
101544
101654
|
import { constants as constants7 } from "fs";
|
|
101545
101655
|
import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
|
|
101546
|
-
import { dirname as dirname22, join as
|
|
101656
|
+
import { dirname as dirname22, join as join61, resolve as resolve19 } from "path";
|
|
101547
101657
|
var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
|
|
101548
101658
|
var LEGACY_BUILTIN_SHADOW_PACKAGES = [
|
|
101549
|
-
|
|
101550
|
-
|
|
101659
|
+
join61("packages", "pi-goal"),
|
|
101660
|
+
join61("packages", "pi-webfetch")
|
|
101551
101661
|
];
|
|
101552
101662
|
async function readSettings(settingsPath) {
|
|
101553
101663
|
let raw;
|
|
@@ -101576,13 +101686,13 @@ function dedupePackages(packages) {
|
|
|
101576
101686
|
return [...new Set(packages)];
|
|
101577
101687
|
}
|
|
101578
101688
|
function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
|
|
101579
|
-
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) =>
|
|
101580
|
-
return packages.filter((entry) => !shadowPaths.has(
|
|
101689
|
+
const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
|
|
101690
|
+
return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
|
|
101581
101691
|
}
|
|
101582
101692
|
async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
|
|
101583
|
-
const currentPath =
|
|
101693
|
+
const currentPath = resolve19(currentPluginPath);
|
|
101584
101694
|
const entries = await Promise.all(packages.map(async (entry) => {
|
|
101585
|
-
const packagePath =
|
|
101695
|
+
const packagePath = resolve19(agentDir, entry);
|
|
101586
101696
|
if (packagePath === currentPath)
|
|
101587
101697
|
return currentPath;
|
|
101588
101698
|
return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
|
|
@@ -101622,7 +101732,7 @@ function isRecord10(value) {
|
|
|
101622
101732
|
async function readPackageName(packagePath) {
|
|
101623
101733
|
let raw;
|
|
101624
101734
|
try {
|
|
101625
|
-
raw = await readFile25(
|
|
101735
|
+
raw = await readFile25(join61(packagePath, "package.json"), "utf8");
|
|
101626
101736
|
} catch (error51) {
|
|
101627
101737
|
if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
|
|
101628
101738
|
return;
|
|
@@ -101647,54 +101757,54 @@ function isErrno(error51, code) {
|
|
|
101647
101757
|
|
|
101648
101758
|
// packages/omo-senpi/src/install/plugin-artifacts.ts
|
|
101649
101759
|
var REQUIRED_PLUGIN_ARTIFACTS = [
|
|
101650
|
-
|
|
101651
|
-
|
|
101652
|
-
|
|
101653
|
-
|
|
101654
|
-
|
|
101655
|
-
|
|
101656
|
-
|
|
101657
|
-
|
|
101658
|
-
|
|
101659
|
-
|
|
101660
|
-
|
|
101661
|
-
|
|
101662
|
-
|
|
101663
|
-
|
|
101664
|
-
|
|
101665
|
-
|
|
101666
|
-
|
|
101667
|
-
|
|
101668
|
-
|
|
101669
|
-
|
|
101670
|
-
|
|
101671
|
-
|
|
101672
|
-
|
|
101673
|
-
|
|
101674
|
-
|
|
101675
|
-
|
|
101676
|
-
|
|
101677
|
-
|
|
101678
|
-
|
|
101679
|
-
|
|
101680
|
-
|
|
101681
|
-
|
|
101682
|
-
|
|
101683
|
-
|
|
101684
|
-
|
|
101685
|
-
|
|
101686
|
-
|
|
101687
|
-
|
|
101760
|
+
join62("extensions", "omo.js"),
|
|
101761
|
+
join62("extensions", "omo-task.js"),
|
|
101762
|
+
join62("extensions", "omo-member.js"),
|
|
101763
|
+
join62("extensions", "memory-run-supervisor.mjs"),
|
|
101764
|
+
join62("extensions", "reflection-persona.md"),
|
|
101765
|
+
join62("extensions", "dream-persona.md"),
|
|
101766
|
+
join62("extensions", "facts-persona.md"),
|
|
101767
|
+
join62("skills", "ast-grep", "SKILL.md"),
|
|
101768
|
+
join62("skills", "coding-agent-sessions", "SKILL.md"),
|
|
101769
|
+
join62("skills", "debugging", "SKILL.md"),
|
|
101770
|
+
join62("skills", "frontend", "SKILL.md"),
|
|
101771
|
+
join62("skills", "git-master", "SKILL.md"),
|
|
101772
|
+
join62("skills", "init-deep", "SKILL.md"),
|
|
101773
|
+
join62("skills", "lsp-setup", "SKILL.md"),
|
|
101774
|
+
join62("skills", "programming", "SKILL.md"),
|
|
101775
|
+
join62("skills", "refactor", "SKILL.md"),
|
|
101776
|
+
join62("skills", "remove-ai-slops", "SKILL.md"),
|
|
101777
|
+
join62("skills", "review-work", "SKILL.md"),
|
|
101778
|
+
join62("skills", "start-work", "SKILL.md"),
|
|
101779
|
+
join62("skills", "ultimate-browsing", "SKILL.md"),
|
|
101780
|
+
join62("skills", "ultrawork", "SKILL.md"),
|
|
101781
|
+
join62("skills", "ulw-loop", "SKILL.md"),
|
|
101782
|
+
join62("skills", "ulw-plan", "SKILL.md"),
|
|
101783
|
+
join62("skills", "ulw-research", "SKILL.md"),
|
|
101784
|
+
join62("skills", "visual-qa", "SKILL.md"),
|
|
101785
|
+
join62("runtime", "ast-grep-mcp", "cli.js"),
|
|
101786
|
+
join62("runtime", "agent-toolkit", "cli.js"),
|
|
101787
|
+
join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
|
|
101788
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
|
|
101789
|
+
join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
|
|
101790
|
+
join62("runtime", "lsp-daemon", "dist", "cli.js"),
|
|
101791
|
+
join62("runtime", "lsp-daemon", "dist", "index.js"),
|
|
101792
|
+
join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
|
|
101793
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
|
|
101794
|
+
join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
|
|
101795
|
+
join62("runtime", "lsp-daemon", "dist", "package.json"),
|
|
101796
|
+
join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
|
|
101797
|
+
join62("scripts", "install.mjs")
|
|
101688
101798
|
];
|
|
101689
101799
|
async function ensurePluginArtifacts(context) {
|
|
101690
101800
|
if (context.allowBuild) {
|
|
101691
|
-
await context.runCommand("node", [
|
|
101692
|
-
await context.runCommand("node", [
|
|
101693
|
-
await context.runCommand("node", [
|
|
101694
|
-
await context.runCommand("node", [
|
|
101695
|
-
await context.runCommand("node", [
|
|
101696
|
-
await context.runCommand("node", [
|
|
101697
|
-
await context.runCommand("node", [
|
|
101801
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
|
|
101802
|
+
await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
|
|
101803
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
|
|
101804
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
|
|
101805
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
|
|
101806
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
|
|
101807
|
+
await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
|
|
101698
101808
|
}
|
|
101699
101809
|
if (await hasMissingPluginArtifact(context.pluginPath)) {
|
|
101700
101810
|
throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
|
|
@@ -101703,14 +101813,14 @@ async function ensurePluginArtifacts(context) {
|
|
|
101703
101813
|
}
|
|
101704
101814
|
async function hasMissingPluginArtifact(pluginPath) {
|
|
101705
101815
|
for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
|
|
101706
|
-
if (!await fileExists2(
|
|
101816
|
+
if (!await fileExists2(join62(pluginPath, artifact)))
|
|
101707
101817
|
return true;
|
|
101708
101818
|
}
|
|
101709
101819
|
return false;
|
|
101710
101820
|
}
|
|
101711
101821
|
async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
|
|
101712
|
-
const runtimeEntry =
|
|
101713
|
-
const manifestPath =
|
|
101822
|
+
const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
|
|
101823
|
+
const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
|
|
101714
101824
|
let runtimeStat;
|
|
101715
101825
|
try {
|
|
101716
101826
|
runtimeStat = await stat6(runtimeEntry);
|
|
@@ -101785,7 +101895,7 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101785
101895
|
const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
|
|
101786
101896
|
installLocalLauncher({
|
|
101787
101897
|
pluginPath: context.pluginPath,
|
|
101788
|
-
senpiCliPath:
|
|
101898
|
+
senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
|
|
101789
101899
|
});
|
|
101790
101900
|
return {
|
|
101791
101901
|
ok: true,
|
|
@@ -101800,14 +101910,14 @@ async function runSenpiInstaller(options = {}) {
|
|
|
101800
101910
|
function resolveInstallContext(options) {
|
|
101801
101911
|
const env3 = options.env ?? process.env;
|
|
101802
101912
|
const allowBuild = options.pluginPath === undefined;
|
|
101803
|
-
const repoRoot =
|
|
101804
|
-
const agentDir =
|
|
101805
|
-
const pluginPath =
|
|
101913
|
+
const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
|
|
101914
|
+
const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
|
|
101915
|
+
const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
|
|
101806
101916
|
return {
|
|
101807
101917
|
env: env3,
|
|
101808
101918
|
repoRoot,
|
|
101809
101919
|
agentDir,
|
|
101810
|
-
settingsPath:
|
|
101920
|
+
settingsPath: join63(agentDir, "settings.json"),
|
|
101811
101921
|
pluginPath,
|
|
101812
101922
|
platform: options.platform ?? process.platform,
|
|
101813
101923
|
allowBuild,
|
|
@@ -101824,14 +101934,14 @@ async function defaultRunCommand3(command, args, options) {
|
|
|
101824
101934
|
function findRepoRoot2(importerDir) {
|
|
101825
101935
|
let current = importerDir;
|
|
101826
101936
|
for (let depth = 0;depth <= 7; depth += 1) {
|
|
101827
|
-
if (fileExistsSync(
|
|
101937
|
+
if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
|
|
101828
101938
|
return current;
|
|
101829
|
-
current =
|
|
101939
|
+
current = resolve20(current, "..");
|
|
101830
101940
|
}
|
|
101831
101941
|
throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
|
|
101832
101942
|
}
|
|
101833
101943
|
function fileExistsSync(path6) {
|
|
101834
|
-
return
|
|
101944
|
+
return existsSync32(path6);
|
|
101835
101945
|
}
|
|
101836
101946
|
// packages/omo-opencode/src/cli/star-request.ts
|
|
101837
101947
|
import { execFile as execFile5 } from "child_process";
|
|
@@ -101867,23 +101977,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
|
|
|
101867
101977
|
init_provider_availability();
|
|
101868
101978
|
|
|
101869
101979
|
// packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
|
|
101870
|
-
import { existsSync as
|
|
101871
|
-
import { join as
|
|
101980
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "fs";
|
|
101981
|
+
import { join as join65 } from "path";
|
|
101872
101982
|
|
|
101873
101983
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
101874
101984
|
init_shared();
|
|
101875
|
-
import { existsSync as
|
|
101876
|
-
import { join as
|
|
101985
|
+
import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
|
|
101986
|
+
import { join as join64 } from "path";
|
|
101877
101987
|
var TUI_SUBPATH = "tui";
|
|
101878
101988
|
var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
|
|
101879
101989
|
function fileEntryPackageJsonPath(entry) {
|
|
101880
101990
|
let path6 = entry.slice("file:".length);
|
|
101881
101991
|
if (path6.startsWith("//"))
|
|
101882
101992
|
path6 = path6.slice(2);
|
|
101883
|
-
return
|
|
101993
|
+
return join64(path6, "package.json");
|
|
101884
101994
|
}
|
|
101885
101995
|
function packageJsonExportsTui(pkgJsonPath) {
|
|
101886
|
-
if (!
|
|
101996
|
+
if (!existsSync33(pkgJsonPath))
|
|
101887
101997
|
return null;
|
|
101888
101998
|
try {
|
|
101889
101999
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
@@ -101918,14 +102028,14 @@ function packageExportsTuiForServerEntry(entry) {
|
|
|
101918
102028
|
const packageName = packageNameFromServerEntry(entry);
|
|
101919
102029
|
if (packageName === null)
|
|
101920
102030
|
return null;
|
|
101921
|
-
return packageJsonExportsTui(
|
|
102031
|
+
return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
|
|
101922
102032
|
}
|
|
101923
102033
|
function isOurFilePluginEntry(entry) {
|
|
101924
102034
|
if (typeof entry !== "string" || !entry.startsWith("file:"))
|
|
101925
102035
|
return false;
|
|
101926
102036
|
try {
|
|
101927
102037
|
const pkgJsonPath = fileEntryPackageJsonPath(entry);
|
|
101928
|
-
if (!
|
|
102038
|
+
if (!existsSync33(pkgJsonPath))
|
|
101929
102039
|
return false;
|
|
101930
102040
|
const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
101931
102041
|
return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
|
|
@@ -101960,7 +102070,7 @@ function isCanonicalNamedTuiPluginEntry(entry) {
|
|
|
101960
102070
|
}
|
|
101961
102071
|
function detectServerPluginRegistration() {
|
|
101962
102072
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
101963
|
-
const configPath =
|
|
102073
|
+
const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
|
|
101964
102074
|
if (!configPath) {
|
|
101965
102075
|
return { registered: false, configPath: null, entry: null, packageExportsTui: null };
|
|
101966
102076
|
}
|
|
@@ -101983,8 +102093,8 @@ function detectServerPluginRegistration() {
|
|
|
101983
102093
|
}
|
|
101984
102094
|
}
|
|
101985
102095
|
function detectTuiPluginRegistration() {
|
|
101986
|
-
const tuiJsonPath =
|
|
101987
|
-
if (!
|
|
102096
|
+
const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
|
|
102097
|
+
if (!existsSync33(tuiJsonPath)) {
|
|
101988
102098
|
return {
|
|
101989
102099
|
registered: false,
|
|
101990
102100
|
configPath: tuiJsonPath,
|
|
@@ -102139,11 +102249,11 @@ function readConfig(path6) {
|
|
|
102139
102249
|
return null;
|
|
102140
102250
|
}
|
|
102141
102251
|
function readServerConfig(configDir) {
|
|
102142
|
-
const jsoncPath =
|
|
102143
|
-
if (
|
|
102252
|
+
const jsoncPath = join65(configDir, "opencode.jsonc");
|
|
102253
|
+
if (existsSync34(jsoncPath))
|
|
102144
102254
|
return readConfig(jsoncPath);
|
|
102145
|
-
const jsonPath =
|
|
102146
|
-
if (
|
|
102255
|
+
const jsonPath = join65(configDir, "opencode.json");
|
|
102256
|
+
if (existsSync34(jsonPath))
|
|
102147
102257
|
return readConfig(jsonPath);
|
|
102148
102258
|
return null;
|
|
102149
102259
|
}
|
|
@@ -102163,7 +102273,7 @@ function desiredTuiEntry(serverEntry) {
|
|
|
102163
102273
|
return null;
|
|
102164
102274
|
}
|
|
102165
102275
|
function readTuiConfig(tuiJsonPath) {
|
|
102166
|
-
if (!
|
|
102276
|
+
if (!existsSync34(tuiJsonPath)) {
|
|
102167
102277
|
return { config: {}, malformed: false };
|
|
102168
102278
|
}
|
|
102169
102279
|
const config3 = readConfig(tuiJsonPath);
|
|
@@ -102184,7 +102294,7 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102184
102294
|
if (!desiredEntry) {
|
|
102185
102295
|
return { changed: false, reason: "no-server-entry" };
|
|
102186
102296
|
}
|
|
102187
|
-
const tuiJsonPath =
|
|
102297
|
+
const tuiJsonPath = join65(configDir, "tui.json");
|
|
102188
102298
|
const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
|
|
102189
102299
|
if (malformed) {
|
|
102190
102300
|
return { changed: false, reason: "malformed" };
|
|
@@ -102199,16 +102309,16 @@ function ensureTuiPluginEntry(opts = {}) {
|
|
|
102199
102309
|
}
|
|
102200
102310
|
|
|
102201
102311
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
102202
|
-
import { homedir as
|
|
102203
|
-
import { join as
|
|
102312
|
+
import { homedir as homedir12 } from "os";
|
|
102313
|
+
import { join as join66 } from "path";
|
|
102204
102314
|
|
|
102205
102315
|
// packages/shared-skills/index.mjs
|
|
102206
|
-
import { existsSync as
|
|
102316
|
+
import { existsSync as existsSync35 } from "fs";
|
|
102207
102317
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
102208
102318
|
var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
|
|
102209
102319
|
function sharedSkillsRootPath() {
|
|
102210
102320
|
const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
|
|
102211
|
-
return candidates.find((candidate2) =>
|
|
102321
|
+
return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
|
|
102212
102322
|
}
|
|
102213
102323
|
|
|
102214
102324
|
// packages/omo-opencode/src/cli/install-ast-grep-sg.ts
|
|
@@ -102222,9 +102332,9 @@ function describeResult2(result) {
|
|
|
102222
102332
|
}
|
|
102223
102333
|
async function installAstGrepForOpenCode(options = {}) {
|
|
102224
102334
|
const platform = options.platform ?? process.platform;
|
|
102225
|
-
const baseDir =
|
|
102335
|
+
const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
|
|
102226
102336
|
const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
|
|
102227
|
-
const skillDir =
|
|
102337
|
+
const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
|
|
102228
102338
|
const installer = options.installer ?? runAstGrepSkillInstall;
|
|
102229
102339
|
try {
|
|
102230
102340
|
const result = await installer({ platform, skillDir, targetDir });
|
|
@@ -106254,7 +106364,7 @@ async function resolveSession(options) {
|
|
|
106254
106364
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106255
106365
|
const delay2 = retryDelayMs * attempt;
|
|
106256
106366
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106257
|
-
await new Promise((
|
|
106367
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106258
106368
|
}
|
|
106259
106369
|
continue;
|
|
106260
106370
|
}
|
|
@@ -106265,7 +106375,7 @@ async function resolveSession(options) {
|
|
|
106265
106375
|
if (attempt < SESSION_CREATE_MAX_RETRIES) {
|
|
106266
106376
|
const delay2 = retryDelayMs * attempt;
|
|
106267
106377
|
console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
|
|
106268
|
-
await new Promise((
|
|
106378
|
+
await new Promise((resolve21) => setTimeout(resolve21, delay2));
|
|
106269
106379
|
}
|
|
106270
106380
|
}
|
|
106271
106381
|
throw new Error("Failed to create session after all retries");
|
|
@@ -106663,9 +106773,9 @@ function isClosingFence(line, fence) {
|
|
|
106663
106773
|
return run?.charAt(0) === fence.marker && run.length >= fence.length;
|
|
106664
106774
|
}
|
|
106665
106775
|
// packages/boulder-state/src/top-level-task.ts
|
|
106666
|
-
import { existsSync as
|
|
106776
|
+
import { existsSync as existsSync36, readFileSync as readFileSync17 } from "fs";
|
|
106667
106777
|
function readCurrentTopLevelTask(planPath) {
|
|
106668
|
-
if (!
|
|
106778
|
+
if (!existsSync36(planPath)) {
|
|
106669
106779
|
return null;
|
|
106670
106780
|
}
|
|
106671
106781
|
try {
|
|
@@ -106676,13 +106786,13 @@ function readCurrentTopLevelTask(planPath) {
|
|
|
106676
106786
|
}
|
|
106677
106787
|
}
|
|
106678
106788
|
// packages/boulder-state/src/storage/path.ts
|
|
106679
|
-
import { existsSync as
|
|
106680
|
-
import { isAbsolute as isAbsolute11, join as
|
|
106789
|
+
import { existsSync as existsSync37 } from "fs";
|
|
106790
|
+
import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "path";
|
|
106681
106791
|
function getBoulderFilePath(directory) {
|
|
106682
|
-
return
|
|
106792
|
+
return join67(directory, BOULDER_DIR, BOULDER_FILE);
|
|
106683
106793
|
}
|
|
106684
106794
|
function resolveTrackedPath(baseDirectory, trackedPath) {
|
|
106685
|
-
return isAbsolute11(trackedPath) ?
|
|
106795
|
+
return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
|
|
106686
106796
|
}
|
|
106687
106797
|
function resolveBoulderPlanPath(directory, state) {
|
|
106688
106798
|
const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
|
|
@@ -106690,22 +106800,22 @@ function resolveBoulderPlanPath(directory, state) {
|
|
|
106690
106800
|
if (!worktreePath) {
|
|
106691
106801
|
return absolutePlanPath;
|
|
106692
106802
|
}
|
|
106693
|
-
const absoluteDirectory =
|
|
106803
|
+
const absoluteDirectory = resolve21(directory);
|
|
106694
106804
|
const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
|
|
106695
106805
|
if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
|
|
106696
106806
|
return absolutePlanPath;
|
|
106697
106807
|
}
|
|
106698
106808
|
const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
|
|
106699
|
-
const worktreePlanPath =
|
|
106700
|
-
return
|
|
106809
|
+
const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
|
|
106810
|
+
return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
|
|
106701
106811
|
}
|
|
106702
106812
|
function resolveBoulderPlanPathForWork(directory, work) {
|
|
106703
106813
|
return resolveBoulderPlanPath(directory, work);
|
|
106704
106814
|
}
|
|
106705
106815
|
// packages/boulder-state/src/storage/plan-progress.ts
|
|
106706
|
-
import { existsSync as
|
|
106816
|
+
import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
106707
106817
|
function getPlanProgress(planPath) {
|
|
106708
|
-
if (!
|
|
106818
|
+
if (!existsSync38(planPath)) {
|
|
106709
106819
|
return { total: 0, completed: 0, isComplete: false };
|
|
106710
106820
|
}
|
|
106711
106821
|
try {
|
|
@@ -106788,10 +106898,10 @@ function selectMirrorWork(state) {
|
|
|
106788
106898
|
return sorted[0] ?? null;
|
|
106789
106899
|
}
|
|
106790
106900
|
// packages/boulder-state/src/storage/read-state.ts
|
|
106791
|
-
import { existsSync as
|
|
106901
|
+
import { existsSync as existsSync39, readFileSync as readFileSync19 } from "fs";
|
|
106792
106902
|
function readBoulderState(directory) {
|
|
106793
106903
|
const filePath = getBoulderFilePath(directory);
|
|
106794
|
-
if (!
|
|
106904
|
+
if (!existsSync39(filePath)) {
|
|
106795
106905
|
return null;
|
|
106796
106906
|
}
|
|
106797
106907
|
try {
|
|
@@ -106861,14 +106971,14 @@ init_state();
|
|
|
106861
106971
|
// packages/omo-opencode/src/features/run-continuation-state/constants.ts
|
|
106862
106972
|
var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
|
|
106863
106973
|
// packages/omo-opencode/src/features/run-continuation-state/storage.ts
|
|
106864
|
-
import { existsSync as
|
|
106865
|
-
import { join as
|
|
106974
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
106975
|
+
import { join as join68 } from "path";
|
|
106866
106976
|
function getMarkerPath(directory, sessionID) {
|
|
106867
|
-
return
|
|
106977
|
+
return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
106868
106978
|
}
|
|
106869
106979
|
function readContinuationMarker(directory, sessionID) {
|
|
106870
106980
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
106871
|
-
if (!
|
|
106981
|
+
if (!existsSync40(markerPath))
|
|
106872
106982
|
return null;
|
|
106873
106983
|
try {
|
|
106874
106984
|
const raw = readFileSync20(markerPath, "utf-8");
|
|
@@ -106937,7 +107047,7 @@ async function isSessionInBoulderLineage(input) {
|
|
|
106937
107047
|
init_shared();
|
|
106938
107048
|
init_compaction_marker();
|
|
106939
107049
|
import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "fs";
|
|
106940
|
-
import { join as
|
|
107050
|
+
import { join as join69 } from "path";
|
|
106941
107051
|
var defaultSessionLastAgentDeps = {
|
|
106942
107052
|
getMessageDir,
|
|
106943
107053
|
isSqliteBackend,
|
|
@@ -106997,7 +107107,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
|
|
|
106997
107107
|
try {
|
|
106998
107108
|
const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
|
|
106999
107109
|
try {
|
|
107000
|
-
const content = readFileSync21(
|
|
107110
|
+
const content = readFileSync21(join69(messageDir, fileName), "utf-8");
|
|
107001
107111
|
const parsed = JSON.parse(content);
|
|
107002
107112
|
return {
|
|
107003
107113
|
fileName,
|
|
@@ -107040,8 +107150,8 @@ init_agent_display_names();
|
|
|
107040
107150
|
|
|
107041
107151
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107042
107152
|
init_frontmatter2();
|
|
107043
|
-
import { existsSync as
|
|
107044
|
-
import { dirname as dirname26, join as
|
|
107153
|
+
import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
|
|
107154
|
+
import { dirname as dirname26, join as join70 } from "path";
|
|
107045
107155
|
|
|
107046
107156
|
// packages/omo-opencode/src/hooks/ralph-loop/constants.ts
|
|
107047
107157
|
var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
|
|
@@ -107050,11 +107160,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
|
|
|
107050
107160
|
|
|
107051
107161
|
// packages/omo-opencode/src/hooks/ralph-loop/storage.ts
|
|
107052
107162
|
function getStateFilePath(directory, customPath) {
|
|
107053
|
-
return customPath ?
|
|
107163
|
+
return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
|
|
107054
107164
|
}
|
|
107055
107165
|
function readState(directory, customPath) {
|
|
107056
107166
|
const filePath = getStateFilePath(directory, customPath);
|
|
107057
|
-
if (!
|
|
107167
|
+
if (!existsSync41(filePath)) {
|
|
107058
107168
|
return null;
|
|
107059
107169
|
}
|
|
107060
107170
|
try {
|
|
@@ -107284,7 +107394,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
|
|
|
107284
107394
|
const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
|
|
107285
107395
|
const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
|
|
107286
107396
|
const now = options.now ?? Date.now;
|
|
107287
|
-
const sleep = options.sleep ?? ((ms) => new Promise((
|
|
107397
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
|
|
107288
107398
|
let consecutiveCompleteChecks = 0;
|
|
107289
107399
|
let errorCycleCount = 0;
|
|
107290
107400
|
let firstWorkTimestamp = null;
|
|
@@ -107449,7 +107559,7 @@ function createAbortError() {
|
|
|
107449
107559
|
return error51;
|
|
107450
107560
|
}
|
|
107451
107561
|
function sleep(delayMs) {
|
|
107452
|
-
return new Promise((
|
|
107562
|
+
return new Promise((resolve22) => setTimeout(resolve22, delayMs));
|
|
107453
107563
|
}
|
|
107454
107564
|
function hasPromptStartEvidence(eventState) {
|
|
107455
107565
|
return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
|
|
@@ -107824,7 +107934,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
|
|
|
107824
107934
|
async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
|
|
107825
107935
|
const completed = await Promise.race([
|
|
107826
107936
|
eventProcessor.then(() => true),
|
|
107827
|
-
new Promise((
|
|
107937
|
+
new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
|
|
107828
107938
|
]);
|
|
107829
107939
|
}
|
|
107830
107940
|
async function run(options) {
|
|
@@ -108150,14 +108260,14 @@ async function getLocalVersion(options = {}) {
|
|
|
108150
108260
|
}
|
|
108151
108261
|
}
|
|
108152
108262
|
// packages/omo-opencode/src/cli/doctor/checks/system.ts
|
|
108153
|
-
import { existsSync as
|
|
108263
|
+
import { existsSync as existsSync52, readFileSync as readFileSync32 } from "fs";
|
|
108154
108264
|
|
|
108155
108265
|
// packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
|
|
108156
108266
|
init_extract_semver();
|
|
108157
108267
|
init_bun_which_shim();
|
|
108158
|
-
import { existsSync as
|
|
108159
|
-
import { homedir as
|
|
108160
|
-
import { join as
|
|
108268
|
+
import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "fs";
|
|
108269
|
+
import { homedir as homedir15 } from "os";
|
|
108270
|
+
import { join as join77 } from "path";
|
|
108161
108271
|
|
|
108162
108272
|
// packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
|
|
108163
108273
|
init_spawn_with_windows_hide();
|
|
@@ -108196,8 +108306,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
|
|
|
108196
108306
|
const stdoutPromise = readSpawnStream(proc.stdout);
|
|
108197
108307
|
const stderrPromise = readSpawnStream(proc.stderr);
|
|
108198
108308
|
let timer;
|
|
108199
|
-
const timeoutPromise = new Promise((
|
|
108200
|
-
timer = setTimeout(() =>
|
|
108309
|
+
const timeoutPromise = new Promise((resolve22) => {
|
|
108310
|
+
timer = setTimeout(() => resolve22("timeout"), timeoutMs);
|
|
108201
108311
|
});
|
|
108202
108312
|
const processPromise = (async () => {
|
|
108203
108313
|
await proc.exited;
|
|
@@ -108244,22 +108354,22 @@ function isExecutable2(path12) {
|
|
|
108244
108354
|
}
|
|
108245
108355
|
}
|
|
108246
108356
|
function getDesktopAppPaths(platform) {
|
|
108247
|
-
const home =
|
|
108357
|
+
const home = homedir15();
|
|
108248
108358
|
switch (platform) {
|
|
108249
108359
|
case "darwin":
|
|
108250
108360
|
return [
|
|
108251
108361
|
"/Applications/OpenCode.app/Contents/MacOS/OpenCode",
|
|
108252
|
-
|
|
108362
|
+
join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
|
|
108253
108363
|
];
|
|
108254
108364
|
case "win32": {
|
|
108255
108365
|
const programFiles = process.env.ProgramFiles;
|
|
108256
108366
|
const localAppData = process.env.LOCALAPPDATA;
|
|
108257
108367
|
const paths2 = [];
|
|
108258
108368
|
if (programFiles) {
|
|
108259
|
-
paths2.push(
|
|
108369
|
+
paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
|
|
108260
108370
|
}
|
|
108261
108371
|
if (localAppData) {
|
|
108262
|
-
paths2.push(
|
|
108372
|
+
paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
|
|
108263
108373
|
}
|
|
108264
108374
|
return paths2;
|
|
108265
108375
|
}
|
|
@@ -108267,8 +108377,8 @@ function getDesktopAppPaths(platform) {
|
|
|
108267
108377
|
return [
|
|
108268
108378
|
"/usr/bin/opencode",
|
|
108269
108379
|
"/usr/lib/opencode/opencode",
|
|
108270
|
-
|
|
108271
|
-
|
|
108380
|
+
join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
|
|
108381
|
+
join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
|
|
108272
108382
|
];
|
|
108273
108383
|
default:
|
|
108274
108384
|
return [];
|
|
@@ -108280,7 +108390,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
108280
108390
|
}
|
|
108281
108391
|
return [binaryPath, "--version"];
|
|
108282
108392
|
}
|
|
108283
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
108393
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108284
108394
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
108285
108395
|
if (checkExists(desktopPath)) {
|
|
108286
108396
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -108288,7 +108398,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
|
|
|
108288
108398
|
}
|
|
108289
108399
|
return null;
|
|
108290
108400
|
}
|
|
108291
|
-
async function findOpenCodeBinary(platform = process.platform, checkExists =
|
|
108401
|
+
async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
|
|
108292
108402
|
for (const binary of OPENCODE_BINARIES2) {
|
|
108293
108403
|
const path12 = bunWhich(binary);
|
|
108294
108404
|
if (path12 && checkExists(path12)) {
|
|
@@ -108300,7 +108410,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
|
|
|
108300
108410
|
const candidates = getCommandCandidates2(platform);
|
|
108301
108411
|
for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
|
|
108302
108412
|
for (const command of candidates) {
|
|
108303
|
-
const fullPath =
|
|
108413
|
+
const fullPath = join77(entry, command);
|
|
108304
108414
|
if (checkExists(fullPath) && isExecutable2(fullPath)) {
|
|
108305
108415
|
return { binary: command, path: fullPath };
|
|
108306
108416
|
}
|
|
@@ -108346,12 +108456,12 @@ function compareVersions3(current, minimum) {
|
|
|
108346
108456
|
|
|
108347
108457
|
// packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
|
|
108348
108458
|
init_shared();
|
|
108349
|
-
import { existsSync as
|
|
108459
|
+
import { existsSync as existsSync50, readFileSync as readFileSync30 } from "fs";
|
|
108350
108460
|
function detectConfigPath() {
|
|
108351
108461
|
const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
108352
|
-
if (
|
|
108462
|
+
if (existsSync50(paths2.configJsonc))
|
|
108353
108463
|
return paths2.configJsonc;
|
|
108354
|
-
if (
|
|
108464
|
+
if (existsSync50(paths2.configJson))
|
|
108355
108465
|
return paths2.configJson;
|
|
108356
108466
|
return null;
|
|
108357
108467
|
}
|
|
@@ -108439,36 +108549,36 @@ init_file_utils2();
|
|
|
108439
108549
|
init_checker();
|
|
108440
108550
|
init_auto_update_checker();
|
|
108441
108551
|
init_package_json_locator();
|
|
108442
|
-
import { existsSync as
|
|
108552
|
+
import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "fs";
|
|
108443
108553
|
import { createRequire as createRequire2 } from "module";
|
|
108444
|
-
import { homedir as
|
|
108445
|
-
import { join as
|
|
108554
|
+
import { homedir as homedir16 } from "os";
|
|
108555
|
+
import { join as join78 } from "path";
|
|
108446
108556
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
108447
108557
|
init_shared();
|
|
108448
108558
|
function getPlatformDefaultCacheDir(platform = process.platform) {
|
|
108449
108559
|
if (platform === "darwin")
|
|
108450
|
-
return
|
|
108560
|
+
return join78(homedir16(), "Library", "Caches");
|
|
108451
108561
|
if (platform === "win32")
|
|
108452
|
-
return process.env.LOCALAPPDATA ??
|
|
108453
|
-
return
|
|
108562
|
+
return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
|
|
108563
|
+
return join78(homedir16(), ".cache");
|
|
108454
108564
|
}
|
|
108455
108565
|
function resolveOpenCodeCacheDir() {
|
|
108456
108566
|
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
108457
108567
|
if (xdgCacheHome)
|
|
108458
|
-
return
|
|
108568
|
+
return join78(xdgCacheHome, "opencode");
|
|
108459
108569
|
const fromShared = getOpenCodeCacheDir();
|
|
108460
|
-
const platformDefault =
|
|
108461
|
-
if (
|
|
108570
|
+
const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
|
|
108571
|
+
if (existsSync51(fromShared) || !existsSync51(platformDefault))
|
|
108462
108572
|
return fromShared;
|
|
108463
108573
|
return platformDefault;
|
|
108464
108574
|
}
|
|
108465
108575
|
function resolveExistingDir(dirPath) {
|
|
108466
|
-
if (!
|
|
108576
|
+
if (!existsSync51(dirPath))
|
|
108467
108577
|
return dirPath;
|
|
108468
108578
|
return resolveSymlink(dirPath);
|
|
108469
108579
|
}
|
|
108470
108580
|
function readPackageJson(filePath) {
|
|
108471
|
-
if (!
|
|
108581
|
+
if (!existsSync51(filePath))
|
|
108472
108582
|
return null;
|
|
108473
108583
|
try {
|
|
108474
108584
|
const content = readFileSync31(filePath, "utf-8");
|
|
@@ -108489,26 +108599,26 @@ function normalizeVersion(value) {
|
|
|
108489
108599
|
function createPackageCandidates(rootDir) {
|
|
108490
108600
|
return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
|
|
108491
108601
|
packageName,
|
|
108492
|
-
installedPackagePath:
|
|
108602
|
+
installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
|
|
108493
108603
|
}));
|
|
108494
108604
|
}
|
|
108495
108605
|
function createTaggedInstallCandidates(rootDir) {
|
|
108496
|
-
const packagesDir =
|
|
108497
|
-
if (!
|
|
108606
|
+
const packagesDir = join78(rootDir, "packages");
|
|
108607
|
+
if (!existsSync51(packagesDir))
|
|
108498
108608
|
return [];
|
|
108499
108609
|
const candidates = [];
|
|
108500
108610
|
for (const entryName of readdirSync10(packagesDir).sort()) {
|
|
108501
108611
|
const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
|
|
108502
108612
|
if (packageName === undefined)
|
|
108503
108613
|
continue;
|
|
108504
|
-
const installDir =
|
|
108614
|
+
const installDir = join78(packagesDir, entryName);
|
|
108505
108615
|
candidates.push({
|
|
108506
108616
|
cacheDir: installDir,
|
|
108507
|
-
cachePackagePath:
|
|
108617
|
+
cachePackagePath: join78(installDir, "package.json"),
|
|
108508
108618
|
packageCandidates: [
|
|
108509
108619
|
{
|
|
108510
108620
|
packageName,
|
|
108511
|
-
installedPackagePath:
|
|
108621
|
+
installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
|
|
108512
108622
|
}
|
|
108513
108623
|
]
|
|
108514
108624
|
});
|
|
@@ -108516,7 +108626,7 @@ function createTaggedInstallCandidates(rootDir) {
|
|
|
108516
108626
|
return candidates;
|
|
108517
108627
|
}
|
|
108518
108628
|
function selectInstalledPackage(candidate2) {
|
|
108519
|
-
return candidate2.packageCandidates.find((packageCandidate) =>
|
|
108629
|
+
return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
|
|
108520
108630
|
}
|
|
108521
108631
|
function getExpectedVersion(cachePackage, packageName) {
|
|
108522
108632
|
return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
|
|
@@ -108527,7 +108637,7 @@ function resolveInstalledPackageJsonPath() {
|
|
|
108527
108637
|
for (const packageName of ACCEPTED_PACKAGE_NAMES) {
|
|
108528
108638
|
try {
|
|
108529
108639
|
const packageJsonPath = require2.resolve(`${packageName}/package.json`);
|
|
108530
|
-
if (
|
|
108640
|
+
if (existsSync51(packageJsonPath)) {
|
|
108531
108641
|
return { packageName, packageJsonPath };
|
|
108532
108642
|
}
|
|
108533
108643
|
} catch {
|
|
@@ -108553,22 +108663,22 @@ function getLoadedPluginVersion() {
|
|
|
108553
108663
|
const candidates = [
|
|
108554
108664
|
{
|
|
108555
108665
|
cacheDir: configDir,
|
|
108556
|
-
cachePackagePath:
|
|
108666
|
+
cachePackagePath: join78(configDir, "package.json"),
|
|
108557
108667
|
packageCandidates: createPackageCandidates(configDir)
|
|
108558
108668
|
},
|
|
108559
108669
|
...createTaggedInstallCandidates(configDir),
|
|
108560
108670
|
{
|
|
108561
108671
|
cacheDir,
|
|
108562
|
-
cachePackagePath:
|
|
108672
|
+
cachePackagePath: join78(cacheDir, "package.json"),
|
|
108563
108673
|
packageCandidates: createPackageCandidates(cacheDir)
|
|
108564
108674
|
},
|
|
108565
108675
|
...createTaggedInstallCandidates(cacheDir)
|
|
108566
108676
|
];
|
|
108567
|
-
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) =>
|
|
108677
|
+
const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
|
|
108568
108678
|
const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
|
|
108569
108679
|
const selectedPackage = selectInstalledPackage(selectedCandidate);
|
|
108570
108680
|
const candidateInstalledPath = selectedPackage.installedPackagePath;
|
|
108571
|
-
const candidateExists =
|
|
108681
|
+
const candidateExists = existsSync51(candidateInstalledPath);
|
|
108572
108682
|
const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
|
|
108573
108683
|
const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
|
|
108574
108684
|
const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
|
|
@@ -108604,7 +108714,7 @@ var defaultDeps6 = {
|
|
|
108604
108714
|
getLoadedPluginVersion,
|
|
108605
108715
|
getLatestPluginVersion,
|
|
108606
108716
|
getSuggestedInstallTag,
|
|
108607
|
-
configExists:
|
|
108717
|
+
configExists: existsSync52,
|
|
108608
108718
|
readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
|
|
108609
108719
|
parseConfigContent: (content) => parseJsonc(content)
|
|
108610
108720
|
};
|
|
@@ -108750,23 +108860,23 @@ async function checkSystem(deps = defaultDeps6) {
|
|
|
108750
108860
|
|
|
108751
108861
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
|
|
108752
108862
|
init_shared();
|
|
108753
|
-
import { existsSync as
|
|
108754
|
-
import { homedir as
|
|
108755
|
-
import { join as
|
|
108863
|
+
import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
|
|
108864
|
+
import { homedir as homedir17 } from "os";
|
|
108865
|
+
import { join as join79 } from "path";
|
|
108756
108866
|
function getUserConfigDir2() {
|
|
108757
108867
|
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
108758
108868
|
if (xdgConfig)
|
|
108759
|
-
return
|
|
108760
|
-
return
|
|
108869
|
+
return join79(xdgConfig, "opencode");
|
|
108870
|
+
return join79(homedir17(), ".config", "opencode");
|
|
108761
108871
|
}
|
|
108762
108872
|
function loadCustomProviderNames() {
|
|
108763
108873
|
const configDir = getUserConfigDir2();
|
|
108764
108874
|
const candidatePaths = [
|
|
108765
|
-
|
|
108766
|
-
|
|
108875
|
+
join79(configDir, "opencode.json"),
|
|
108876
|
+
join79(configDir, "opencode.jsonc")
|
|
108767
108877
|
];
|
|
108768
108878
|
for (const configPath of candidatePaths) {
|
|
108769
|
-
if (!
|
|
108879
|
+
if (!existsSync53(configPath))
|
|
108770
108880
|
continue;
|
|
108771
108881
|
try {
|
|
108772
108882
|
const content = readFileSync33(configPath, "utf-8");
|
|
@@ -108784,9 +108894,9 @@ function loadCustomProviderNames() {
|
|
|
108784
108894
|
return [];
|
|
108785
108895
|
}
|
|
108786
108896
|
function loadAvailableModelsFromCache() {
|
|
108787
|
-
const cacheFile =
|
|
108897
|
+
const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
|
|
108788
108898
|
const customProviders = loadCustomProviderNames();
|
|
108789
|
-
if (!
|
|
108899
|
+
if (!existsSync53(cacheFile)) {
|
|
108790
108900
|
if (customProviders.length > 0) {
|
|
108791
108901
|
return { providers: customProviders, modelCount: 0, cacheExists: true };
|
|
108792
108902
|
}
|
|
@@ -108846,7 +108956,7 @@ function loadOmoConfig2() {
|
|
|
108846
108956
|
|
|
108847
108957
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
|
|
108848
108958
|
init_shared();
|
|
108849
|
-
import { join as
|
|
108959
|
+
import { join as join80 } from "path";
|
|
108850
108960
|
|
|
108851
108961
|
// packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
|
|
108852
108962
|
function formatModelWithVariant(model, variant) {
|
|
@@ -108888,7 +108998,7 @@ function formatCapabilityResolutionLabel(mode) {
|
|
|
108888
108998
|
}
|
|
108889
108999
|
function buildModelResolutionDetails(options) {
|
|
108890
109000
|
const details = [];
|
|
108891
|
-
const cacheFile =
|
|
109001
|
+
const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
|
|
108892
109002
|
details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
|
|
108893
109003
|
details.push("");
|
|
108894
109004
|
if (options.available.cacheExists) {
|
|
@@ -109197,8 +109307,8 @@ async function checkConfig() {
|
|
|
109197
109307
|
|
|
109198
109308
|
// packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
|
|
109199
109309
|
init_main();
|
|
109200
|
-
import { existsSync as
|
|
109201
|
-
import { join as
|
|
109310
|
+
import { existsSync as existsSync54, readFileSync as readFileSync34 } from "fs";
|
|
109311
|
+
import { join as join81 } from "path";
|
|
109202
109312
|
var CANONICAL_REPLACEMENT = new Map([
|
|
109203
109313
|
["variant", "reasoning"],
|
|
109204
109314
|
["reasoningEffort", "reasoning"],
|
|
@@ -109253,13 +109363,13 @@ function userConfigPaths() {
|
|
|
109253
109363
|
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
109254
109364
|
if (home === undefined || home.length === 0)
|
|
109255
109365
|
return [];
|
|
109256
|
-
return [
|
|
109366
|
+
return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
|
|
109257
109367
|
}
|
|
109258
109368
|
async function checkDeprecatedReasoningKeys() {
|
|
109259
109369
|
const issues = [];
|
|
109260
109370
|
const scanned = [];
|
|
109261
109371
|
for (const configPath of userConfigPaths()) {
|
|
109262
|
-
if (!
|
|
109372
|
+
if (!existsSync54(configPath))
|
|
109263
109373
|
continue;
|
|
109264
109374
|
scanned.push(configPath);
|
|
109265
109375
|
const parsed = parse2(readFileSync34(configPath, "utf-8"));
|
|
@@ -109276,28 +109386,28 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
109276
109386
|
|
|
109277
109387
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
109278
109388
|
init_src2();
|
|
109279
|
-
import { existsSync as
|
|
109389
|
+
import { existsSync as existsSync55 } from "fs";
|
|
109280
109390
|
import { createRequire as createRequire3 } from "module";
|
|
109281
|
-
import { homedir as
|
|
109282
|
-
import { dirname as dirname31, join as
|
|
109391
|
+
import { homedir as homedir19 } from "os";
|
|
109392
|
+
import { dirname as dirname31, join as join83 } from "path";
|
|
109283
109393
|
|
|
109284
109394
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
109285
|
-
import { join as
|
|
109286
|
-
import { homedir as
|
|
109395
|
+
import { join as join82 } from "path";
|
|
109396
|
+
import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
|
|
109287
109397
|
init_binary_downloader();
|
|
109288
109398
|
init_logger2();
|
|
109289
109399
|
init_plugin_identity();
|
|
109290
109400
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
109291
|
-
var DEBUG_FILE =
|
|
109401
|
+
var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
|
|
109292
109402
|
function getCacheDir2() {
|
|
109293
109403
|
if (process.platform === "win32") {
|
|
109294
109404
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
109295
|
-
const base2 = localAppData ||
|
|
109296
|
-
return
|
|
109405
|
+
const base2 = localAppData || join82(homedir18(), "AppData", "Local");
|
|
109406
|
+
return join82(base2, CACHE_DIR_NAME, "bin");
|
|
109297
109407
|
}
|
|
109298
109408
|
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
109299
|
-
const base = xdgCache ||
|
|
109300
|
-
return
|
|
109409
|
+
const base = xdgCache || join82(homedir18(), ".cache");
|
|
109410
|
+
return join82(base, CACHE_DIR_NAME, "bin");
|
|
109301
109411
|
}
|
|
109302
109412
|
function getBinaryName() {
|
|
109303
109413
|
return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
@@ -109347,7 +109457,7 @@ async function getBinaryVersion(binary) {
|
|
|
109347
109457
|
}
|
|
109348
109458
|
}
|
|
109349
109459
|
async function checkAstGrepCli() {
|
|
109350
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
109460
|
+
const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
|
|
109351
109461
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
109352
109462
|
if (sgPath === null) {
|
|
109353
109463
|
return {
|
|
@@ -109377,11 +109487,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
|
|
|
109377
109487
|
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
109378
109488
|
try {
|
|
109379
109489
|
const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
|
|
109380
|
-
const vendorPath =
|
|
109381
|
-
if (
|
|
109490
|
+
const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
|
|
109491
|
+
if (existsSync55(vendorPath))
|
|
109382
109492
|
return vendorPath;
|
|
109383
|
-
const binPath =
|
|
109384
|
-
if (
|
|
109493
|
+
const binPath = join83(packageDir, "bin", binaryName);
|
|
109494
|
+
if (existsSync55(binPath))
|
|
109385
109495
|
return binPath;
|
|
109386
109496
|
} catch (error51) {
|
|
109387
109497
|
if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
|
|
@@ -109527,8 +109637,8 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
109527
109637
|
// packages/omo-opencode/src/mcp/lsp.ts
|
|
109528
109638
|
init_zod();
|
|
109529
109639
|
init_opencode_config_dir();
|
|
109530
|
-
import { existsSync as
|
|
109531
|
-
import { delimiter as delimiter3, dirname as dirname32, resolve as
|
|
109640
|
+
import { existsSync as existsSync56, readFileSync as readFileSync35 } from "fs";
|
|
109641
|
+
import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "path";
|
|
109532
109642
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
109533
109643
|
|
|
109534
109644
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -109575,7 +109685,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
|
|
|
109575
109685
|
}
|
|
109576
109686
|
|
|
109577
109687
|
// packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
|
|
109578
|
-
import { resolve as
|
|
109688
|
+
import { resolve as resolve22 } from "path";
|
|
109579
109689
|
function resolveJavaScriptRuntime(resolveExecutable) {
|
|
109580
109690
|
const node = resolveExecutable("node");
|
|
109581
109691
|
return node.available ? node : resolveExecutable("bun");
|
|
@@ -109583,9 +109693,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
|
|
|
109583
109693
|
function createAncestorCliCandidates(options) {
|
|
109584
109694
|
const candidates = [];
|
|
109585
109695
|
const seenPaths = new Set;
|
|
109586
|
-
let currentDirectory =
|
|
109696
|
+
let currentDirectory = resolve22(options.startDirectory);
|
|
109587
109697
|
while (true) {
|
|
109588
|
-
const distCliPath =
|
|
109698
|
+
const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
|
|
109589
109699
|
if (!seenPaths.has(distCliPath)) {
|
|
109590
109700
|
const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
|
|
109591
109701
|
seenPaths.add(distCliPath);
|
|
@@ -109597,7 +109707,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109597
109707
|
runtimeAvailable: runtime5.available
|
|
109598
109708
|
});
|
|
109599
109709
|
}
|
|
109600
|
-
const sourceCliPath =
|
|
109710
|
+
const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
|
|
109601
109711
|
if (!seenPaths.has(sourceCliPath)) {
|
|
109602
109712
|
const runtime5 = options.resolveExecutable("bun");
|
|
109603
109713
|
const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
|
|
@@ -109614,7 +109724,7 @@ function createAncestorCliCandidates(options) {
|
|
|
109614
109724
|
runtimeAvailable: runtime5.available
|
|
109615
109725
|
});
|
|
109616
109726
|
}
|
|
109617
|
-
const parentDirectory =
|
|
109727
|
+
const parentDirectory = resolve22(currentDirectory, "..");
|
|
109618
109728
|
if (parentDirectory === currentDirectory)
|
|
109619
109729
|
return candidates;
|
|
109620
109730
|
currentDirectory = parentDirectory;
|
|
@@ -109667,11 +109777,11 @@ function getModuleDirectory(moduleUrl) {
|
|
|
109667
109777
|
}
|
|
109668
109778
|
}
|
|
109669
109779
|
function findBootstrapRoot(candidates, pathExists) {
|
|
109670
|
-
return candidates.find((candidate2) => pathExists(
|
|
109780
|
+
return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
|
|
109671
109781
|
}
|
|
109672
109782
|
function readDaemonPackageVersion(root) {
|
|
109673
109783
|
try {
|
|
109674
|
-
const packageJson = JSON.parse(readFileSync35(
|
|
109784
|
+
const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
|
|
109675
109785
|
return DaemonPackageSchema.parse(packageJson).version;
|
|
109676
109786
|
} catch (error51) {
|
|
109677
109787
|
if (!(error51 instanceof Error))
|
|
@@ -109683,17 +109793,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
|
|
|
109683
109793
|
const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
|
|
109684
109794
|
const bun = resolveExecutable("bun");
|
|
109685
109795
|
const npm = resolveExecutable("npm");
|
|
109686
|
-
const packageManifestPath =
|
|
109796
|
+
const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
|
|
109687
109797
|
return {
|
|
109688
109798
|
command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
|
|
109689
109799
|
root,
|
|
109690
|
-
path:
|
|
109800
|
+
path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
|
|
109691
109801
|
exists: runtime5.available && npm.available && pathExists(packageManifestPath),
|
|
109692
109802
|
runtimeAvailable: runtime5.available
|
|
109693
109803
|
};
|
|
109694
109804
|
}
|
|
109695
109805
|
function resolveLspCommand(options = {}) {
|
|
109696
|
-
const pathExists = options.exists ??
|
|
109806
|
+
const pathExists = options.exists ?? existsSync56;
|
|
109697
109807
|
const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
|
|
109698
109808
|
const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
|
|
109699
109809
|
const candidates = moduleDirectory ? createAncestorCliCandidates({
|
|
@@ -109703,7 +109813,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109703
109813
|
sourceCliRel: SOURCE_CLI_REL,
|
|
109704
109814
|
pathExists,
|
|
109705
109815
|
resolveExecutable,
|
|
109706
|
-
isSourceCandidateAvailable: ({ root }) => pathExists(
|
|
109816
|
+
isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
|
|
109707
109817
|
}) : [];
|
|
109708
109818
|
const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
|
|
109709
109819
|
if (distCandidate) {
|
|
@@ -109717,7 +109827,7 @@ function resolveLspCommand(options = {}) {
|
|
|
109717
109827
|
}
|
|
109718
109828
|
function createLspMcpConfig(options = {}) {
|
|
109719
109829
|
const resolvedCommand = resolveLspCommand(options);
|
|
109720
|
-
const cwd =
|
|
109830
|
+
const cwd = resolve23(options.cwd ?? process.cwd());
|
|
109721
109831
|
const configDir = getOpenCodeConfigDir({ binary: "opencode" });
|
|
109722
109832
|
const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
|
|
109723
109833
|
return {
|
|
@@ -109726,9 +109836,9 @@ function createLspMcpConfig(options = {}) {
|
|
|
109726
109836
|
enabled: resolvedCommand.exists,
|
|
109727
109837
|
cwd,
|
|
109728
109838
|
environment: {
|
|
109729
|
-
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) =>
|
|
109730
|
-
LSP_TOOLS_MCP_USER_CONFIG:
|
|
109731
|
-
LSP_TOOLS_MCP_INSTALL_DECISIONS:
|
|
109839
|
+
LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
|
|
109840
|
+
LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
|
|
109841
|
+
LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
|
|
109732
109842
|
...sourceVersion ? {
|
|
109733
109843
|
[OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
|
|
109734
109844
|
[OMO_LSP_DAEMON_VERSION]: sourceVersion
|
|
@@ -109753,21 +109863,21 @@ function getInstalledLspServers(options = {}) {
|
|
|
109753
109863
|
|
|
109754
109864
|
// packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
|
|
109755
109865
|
init_shared();
|
|
109756
|
-
import { existsSync as
|
|
109757
|
-
import { homedir as
|
|
109758
|
-
import { join as
|
|
109866
|
+
import { existsSync as existsSync57, readFileSync as readFileSync36 } from "fs";
|
|
109867
|
+
import { homedir as homedir20 } from "os";
|
|
109868
|
+
import { join as join84 } from "path";
|
|
109759
109869
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
109760
109870
|
function getMcpConfigPaths() {
|
|
109761
109871
|
return [
|
|
109762
|
-
|
|
109763
|
-
|
|
109764
|
-
|
|
109872
|
+
join84(homedir20(), ".claude", ".mcp.json"),
|
|
109873
|
+
join84(process.cwd(), ".mcp.json"),
|
|
109874
|
+
join84(process.cwd(), ".claude", ".mcp.json")
|
|
109765
109875
|
];
|
|
109766
109876
|
}
|
|
109767
109877
|
function loadUserMcpConfig() {
|
|
109768
109878
|
const servers = {};
|
|
109769
109879
|
for (const configPath of getMcpConfigPaths()) {
|
|
109770
|
-
if (!
|
|
109880
|
+
if (!existsSync57(configPath))
|
|
109771
109881
|
continue;
|
|
109772
109882
|
try {
|
|
109773
109883
|
const content = readFileSync36(configPath, "utf-8");
|
|
@@ -109905,12 +110015,12 @@ async function checkTools() {
|
|
|
109905
110015
|
|
|
109906
110016
|
// packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
|
|
109907
110017
|
init_src5();
|
|
109908
|
-
import { existsSync as
|
|
110018
|
+
import { existsSync as existsSync58, readFileSync as readFileSync37 } from "fs";
|
|
109909
110019
|
function isTelemetryState(value) {
|
|
109910
110020
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
109911
110021
|
}
|
|
109912
110022
|
function readLastActiveDay(stateFilePath) {
|
|
109913
|
-
if (!
|
|
110023
|
+
if (!existsSync58(stateFilePath)) {
|
|
109914
110024
|
return "never";
|
|
109915
110025
|
}
|
|
109916
110026
|
let parsed;
|
|
@@ -109973,17 +110083,17 @@ async function probeBinary(cmd, args, spawnImpl) {
|
|
|
109973
110083
|
}
|
|
109974
110084
|
|
|
109975
110085
|
// packages/team-core/src/team-registry/paths.ts
|
|
109976
|
-
import { homedir as
|
|
110086
|
+
import { homedir as homedir21 } from "os";
|
|
109977
110087
|
import path12 from "path";
|
|
109978
110088
|
function resolveBaseDir(config4) {
|
|
109979
|
-
return expandHomeDirectory(config4.base_dir ?? path12.join(
|
|
110089
|
+
return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
|
|
109980
110090
|
}
|
|
109981
110091
|
function expandHomeDirectory(directoryPath3) {
|
|
109982
110092
|
if (directoryPath3 === "~") {
|
|
109983
|
-
return
|
|
110093
|
+
return homedir21();
|
|
109984
110094
|
}
|
|
109985
110095
|
if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
|
|
109986
|
-
return path12.join(
|
|
110096
|
+
return path12.join(homedir21(), directoryPath3.slice(2));
|
|
109987
110097
|
}
|
|
109988
110098
|
return directoryPath3;
|
|
109989
110099
|
}
|
|
@@ -110040,10 +110150,10 @@ async function pathExists(dir) {
|
|
|
110040
110150
|
|
|
110041
110151
|
// packages/omo-opencode/src/cli/doctor/checks/codex.ts
|
|
110042
110152
|
init_src2();
|
|
110043
|
-
import { existsSync as
|
|
110153
|
+
import { existsSync as existsSync59 } from "fs";
|
|
110044
110154
|
import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "fs/promises";
|
|
110045
|
-
import { homedir as
|
|
110046
|
-
import { basename as basename11, join as
|
|
110155
|
+
import { homedir as homedir22 } from "os";
|
|
110156
|
+
import { basename as basename11, join as join85, resolve as resolve24 } from "path";
|
|
110047
110157
|
// packages/omo-opencode/package.json
|
|
110048
110158
|
var package_default3 = {
|
|
110049
110159
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -110108,13 +110218,13 @@ var CODEX_BIN_NAMES = [
|
|
|
110108
110218
|
"omo-git-bash-hook"
|
|
110109
110219
|
];
|
|
110110
110220
|
async function gatherCodexSummary(deps = {}) {
|
|
110111
|
-
const codexHome =
|
|
110221
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
|
|
110112
110222
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110113
110223
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
110114
110224
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
110115
|
-
const manifest2 = pluginRoot === null ? null : await readJson(
|
|
110116
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
110117
|
-
const configPath =
|
|
110225
|
+
const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
110226
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
|
|
110227
|
+
const configPath = join85(codexHome, "config.toml");
|
|
110118
110228
|
const pluginVersion = stringField(manifest2, "version");
|
|
110119
110229
|
return {
|
|
110120
110230
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -110171,7 +110281,7 @@ function buildCodexIssues(summary) {
|
|
|
110171
110281
|
if (summary.pluginRoot === null) {
|
|
110172
110282
|
issues.push({
|
|
110173
110283
|
title: "OMO Codex plugin is not installed",
|
|
110174
|
-
description: `Expected cached plugin at ${
|
|
110284
|
+
description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
110175
110285
|
fix: "Run: npx lazycodex-ai install",
|
|
110176
110286
|
severity: "error",
|
|
110177
110287
|
affects: ["plugin loading"]
|
|
@@ -110236,15 +110346,15 @@ function buildCodexIssues(summary) {
|
|
|
110236
110346
|
return issues;
|
|
110237
110347
|
}
|
|
110238
110348
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
110239
|
-
const pluginRoot =
|
|
110240
|
-
if (!
|
|
110349
|
+
const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
110350
|
+
if (!existsSync59(pluginRoot))
|
|
110241
110351
|
return null;
|
|
110242
110352
|
const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
|
|
110243
110353
|
const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
110244
|
-
return candidates.length === 0 ? null :
|
|
110354
|
+
return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
110245
110355
|
}
|
|
110246
110356
|
async function readCodexConfigSummary(configPath) {
|
|
110247
|
-
if (!
|
|
110357
|
+
if (!existsSync59(configPath)) {
|
|
110248
110358
|
return {
|
|
110249
110359
|
exists: false,
|
|
110250
110360
|
marketplaceConfigured: false,
|
|
@@ -110269,14 +110379,14 @@ async function readCodexConfigSummary(configPath) {
|
|
|
110269
110379
|
async function readLinkedBins(binDir) {
|
|
110270
110380
|
const linked = [];
|
|
110271
110381
|
for (const name of CODEX_BIN_NAMES) {
|
|
110272
|
-
if (await pathExists2(
|
|
110382
|
+
if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
110273
110383
|
linked.push(name);
|
|
110274
110384
|
}
|
|
110275
110385
|
return linked;
|
|
110276
110386
|
}
|
|
110277
110387
|
async function readLinkedAgents(codexHome) {
|
|
110278
|
-
const agentsDir =
|
|
110279
|
-
if (!
|
|
110388
|
+
const agentsDir = join85(codexHome, "agents");
|
|
110389
|
+
if (!existsSync59(agentsDir))
|
|
110280
110390
|
return [];
|
|
110281
110391
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
110282
110392
|
return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
|
|
@@ -110390,8 +110500,8 @@ async function pathExists2(path14) {
|
|
|
110390
110500
|
// packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
|
|
110391
110501
|
init_src2();
|
|
110392
110502
|
import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
|
|
110393
|
-
import { homedir as
|
|
110394
|
-
import { dirname as dirname33, isAbsolute as isAbsolute12, join as
|
|
110503
|
+
import { homedir as homedir23 } from "os";
|
|
110504
|
+
import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
|
|
110395
110505
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
110396
110506
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
110397
110507
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -110401,7 +110511,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110401
110511
|
const env3 = deps.env ?? process.env;
|
|
110402
110512
|
const platform = deps.platform ?? process.platform;
|
|
110403
110513
|
const arch = deps.arch ?? process.arch;
|
|
110404
|
-
const codexHome =
|
|
110514
|
+
const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
|
|
110405
110515
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
110406
110516
|
if (summary.pluginRoot === null) {
|
|
110407
110517
|
return {
|
|
@@ -110426,7 +110536,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
110426
110536
|
});
|
|
110427
110537
|
}
|
|
110428
110538
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
110429
|
-
const runtimeSgPath =
|
|
110539
|
+
const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
|
|
110430
110540
|
const sg = findSgBinarySync({
|
|
110431
110541
|
arch,
|
|
110432
110542
|
env: env3,
|
|
@@ -110466,7 +110576,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
110466
110576
|
if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
|
|
110467
110577
|
continue;
|
|
110468
110578
|
const manifestRoot = dirname33(manifestPath);
|
|
110469
|
-
const isRootManifest =
|
|
110579
|
+
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
110470
110580
|
for (const server2 of Object.values(manifest2["mcpServers"])) {
|
|
110471
110581
|
if (!isRecord12(server2) || !Array.isArray(server2["args"]))
|
|
110472
110582
|
continue;
|
|
@@ -110508,8 +110618,8 @@ function recordBrokenTarget(broken, classified, origin) {
|
|
|
110508
110618
|
broken.push(entry);
|
|
110509
110619
|
}
|
|
110510
110620
|
async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
|
|
110511
|
-
const targetPath =
|
|
110512
|
-
const bundleRootPath =
|
|
110621
|
+
const targetPath = resolve25(baseRoot, relativePath);
|
|
110622
|
+
const bundleRootPath = resolve25(bundleRoot);
|
|
110513
110623
|
const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
|
|
110514
110624
|
if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
|
|
110515
110625
|
if (allowEscape)
|
|
@@ -110538,7 +110648,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
110538
110648
|
for (const entry of entries) {
|
|
110539
110649
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
110540
110650
|
continue;
|
|
110541
|
-
const entryPath =
|
|
110651
|
+
const entryPath = join86(root, entry.name);
|
|
110542
110652
|
if (entry.isDirectory()) {
|
|
110543
110653
|
paths3.push(...await findManifestPaths(entryPath, manifestName));
|
|
110544
110654
|
continue;
|
|
@@ -110582,18 +110692,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
110582
110692
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
|
|
110583
110693
|
}
|
|
110584
110694
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
110585
|
-
return
|
|
110695
|
+
return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
110586
110696
|
}
|
|
110587
110697
|
function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
|
|
110588
110698
|
const override = env3[SG_PATH_ENV_KEY]?.trim();
|
|
110589
110699
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
110590
110700
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
110591
|
-
if (sgPath ===
|
|
110701
|
+
if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
|
|
110592
110702
|
return "runtime dir";
|
|
110593
110703
|
return "PATH";
|
|
110594
110704
|
}
|
|
110595
110705
|
async function readBootstrapStateSummary(codexHome) {
|
|
110596
|
-
const statePath =
|
|
110706
|
+
const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
110597
110707
|
const raw = await readJson2(statePath);
|
|
110598
110708
|
if (raw === null)
|
|
110599
110709
|
return null;
|
|
@@ -110669,24 +110779,24 @@ function isRecord12(value) {
|
|
|
110669
110779
|
}
|
|
110670
110780
|
|
|
110671
110781
|
// packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
|
|
110672
|
-
import { existsSync as
|
|
110782
|
+
import { existsSync as existsSync60 } from "fs";
|
|
110673
110783
|
import { readFile as readFile29 } from "fs/promises";
|
|
110674
|
-
import { homedir as
|
|
110675
|
-
import { join as
|
|
110784
|
+
import { homedir as homedir24 } from "os";
|
|
110785
|
+
import { join as join87, resolve as resolve26 } from "path";
|
|
110676
110786
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
110677
110787
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
110678
110788
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
110679
110789
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
110680
|
-
const codexHome =
|
|
110790
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
|
|
110681
110791
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
110682
110792
|
const platform = deps.platform ?? process.platform;
|
|
110683
|
-
const wrapperPath =
|
|
110684
|
-
const legacyWrapperPath =
|
|
110793
|
+
const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
110794
|
+
const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
110685
110795
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
110686
110796
|
const issues = [];
|
|
110687
110797
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
110688
110798
|
const targetPath = parseRuntimeTargetPath(wrapper);
|
|
110689
|
-
if (targetPath !== null && !
|
|
110799
|
+
if (targetPath !== null && !existsSync60(targetPath)) {
|
|
110690
110800
|
issues.push({
|
|
110691
110801
|
title: "omo-agent-toolkit runtime wrapper target is missing",
|
|
110692
110802
|
description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
|
|
@@ -111201,7 +111311,7 @@ Doctor failed unexpectedly: ${message}`];
|
|
|
111201
111311
|
import { createHash as createHash6 } from "crypto";
|
|
111202
111312
|
import {
|
|
111203
111313
|
chmodSync as chmodSync5,
|
|
111204
|
-
existsSync as
|
|
111314
|
+
existsSync as existsSync63,
|
|
111205
111315
|
mkdirSync as mkdirSync15,
|
|
111206
111316
|
readdirSync as readdirSync11,
|
|
111207
111317
|
readFileSync as readFileSync39,
|
|
@@ -111209,15 +111319,15 @@ import {
|
|
|
111209
111319
|
unlinkSync as unlinkSync9,
|
|
111210
111320
|
writeFileSync as writeFileSync12
|
|
111211
111321
|
} from "fs";
|
|
111212
|
-
import { basename as basename12, dirname as dirname34, join as
|
|
111322
|
+
import { basename as basename12, dirname as dirname34, join as join90 } from "path";
|
|
111213
111323
|
|
|
111214
111324
|
// packages/mcp-client-core/src/config-dir.ts
|
|
111215
|
-
import { existsSync as
|
|
111216
|
-
import { homedir as
|
|
111217
|
-
import { join as
|
|
111325
|
+
import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
|
|
111326
|
+
import { homedir as homedir25 } from "os";
|
|
111327
|
+
import { join as join88, resolve as resolve27 } from "path";
|
|
111218
111328
|
function resolveConfigPath2(pathValue) {
|
|
111219
|
-
const resolvedPath =
|
|
111220
|
-
if (!
|
|
111329
|
+
const resolvedPath = resolve27(pathValue);
|
|
111330
|
+
if (!existsSync61(resolvedPath))
|
|
111221
111331
|
return resolvedPath;
|
|
111222
111332
|
try {
|
|
111223
111333
|
return realpathSync8(resolvedPath);
|
|
@@ -111232,13 +111342,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
|
|
|
111232
111342
|
if (customConfigDir) {
|
|
111233
111343
|
return resolveConfigPath2(customConfigDir);
|
|
111234
111344
|
}
|
|
111235
|
-
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() ||
|
|
111236
|
-
return resolveConfigPath2(
|
|
111345
|
+
const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
|
|
111346
|
+
return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
|
|
111237
111347
|
}
|
|
111238
111348
|
|
|
111239
111349
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
111240
|
-
import { chmodSync as chmodSync4, existsSync as
|
|
111241
|
-
import { join as
|
|
111350
|
+
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "fs";
|
|
111351
|
+
import { join as join89 } from "path";
|
|
111242
111352
|
var INDEX_FILE_NAME = "index.json";
|
|
111243
111353
|
function isTokenIndex(value) {
|
|
111244
111354
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -111246,11 +111356,11 @@ function isTokenIndex(value) {
|
|
|
111246
111356
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
111247
111357
|
}
|
|
111248
111358
|
function getIndexPath(storageDir) {
|
|
111249
|
-
return
|
|
111359
|
+
return join89(storageDir, INDEX_FILE_NAME);
|
|
111250
111360
|
}
|
|
111251
111361
|
function readTokenIndex(storageDir) {
|
|
111252
111362
|
const indexPath = getIndexPath(storageDir);
|
|
111253
|
-
if (!
|
|
111363
|
+
if (!existsSync62(indexPath))
|
|
111254
111364
|
return {};
|
|
111255
111365
|
try {
|
|
111256
111366
|
const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
|
|
@@ -111290,16 +111400,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
|
|
|
111290
111400
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
111291
111401
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
111292
111402
|
function getMcpOauthStorageDir() {
|
|
111293
|
-
return
|
|
111403
|
+
return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
111294
111404
|
}
|
|
111295
111405
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
111296
111406
|
return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
111297
111407
|
}
|
|
111298
111408
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
111299
|
-
return
|
|
111409
|
+
return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
111300
111410
|
}
|
|
111301
111411
|
function getLegacyStoragePath() {
|
|
111302
|
-
return
|
|
111412
|
+
return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
111303
111413
|
}
|
|
111304
111414
|
function normalizeHost2(serverHost) {
|
|
111305
111415
|
let host = serverHost.trim();
|
|
@@ -111360,7 +111470,7 @@ function isOAuthTokenData(value) {
|
|
|
111360
111470
|
return clientSecret === undefined || typeof clientSecret === "string";
|
|
111361
111471
|
}
|
|
111362
111472
|
function readTokenFile(filePath) {
|
|
111363
|
-
if (!
|
|
111473
|
+
if (!existsSync63(filePath))
|
|
111364
111474
|
return null;
|
|
111365
111475
|
try {
|
|
111366
111476
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111373,7 +111483,7 @@ function readTokenFile(filePath) {
|
|
|
111373
111483
|
}
|
|
111374
111484
|
function readLegacyStore() {
|
|
111375
111485
|
const filePath = getLegacyStoragePath();
|
|
111376
|
-
if (!
|
|
111486
|
+
if (!existsSync63(filePath))
|
|
111377
111487
|
return null;
|
|
111378
111488
|
try {
|
|
111379
111489
|
const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
|
|
@@ -111394,7 +111504,7 @@ function readLegacyStore() {
|
|
|
111394
111504
|
function writeTokenFile(filePath, token) {
|
|
111395
111505
|
try {
|
|
111396
111506
|
const dir = dirname34(filePath);
|
|
111397
|
-
if (!
|
|
111507
|
+
if (!existsSync63(dir)) {
|
|
111398
111508
|
mkdirSync15(dir, { recursive: true });
|
|
111399
111509
|
}
|
|
111400
111510
|
const tempPath = `${filePath}.tmp.${Date.now()}`;
|
|
@@ -111418,7 +111528,7 @@ function saveToken(serverHost, resource, token) {
|
|
|
111418
111528
|
}
|
|
111419
111529
|
function deleteToken(serverHost, resource) {
|
|
111420
111530
|
const filePath = getMcpOauthStoragePath(serverHost, resource);
|
|
111421
|
-
if (!
|
|
111531
|
+
if (!existsSync63(filePath))
|
|
111422
111532
|
return deleteLegacyToken(serverHost, resource);
|
|
111423
111533
|
try {
|
|
111424
111534
|
unlinkSync9(filePath);
|
|
@@ -111440,7 +111550,7 @@ function deleteLegacyToken(serverHost, resource) {
|
|
|
111440
111550
|
if (Object.keys(store2).length === 0) {
|
|
111441
111551
|
try {
|
|
111442
111552
|
const filePath = getLegacyStoragePath();
|
|
111443
|
-
if (
|
|
111553
|
+
if (existsSync63(filePath))
|
|
111444
111554
|
unlinkSync9(filePath);
|
|
111445
111555
|
return true;
|
|
111446
111556
|
} catch (deleteError) {
|
|
@@ -111478,7 +111588,7 @@ function listTokensByHost(serverHost) {
|
|
|
111478
111588
|
for (const [hash2, indexedKey] of Object.entries(index)) {
|
|
111479
111589
|
if (!indexedKey.startsWith(prefix))
|
|
111480
111590
|
continue;
|
|
111481
|
-
const indexedToken = readTokenFile(
|
|
111591
|
+
const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
|
|
111482
111592
|
if (indexedToken)
|
|
111483
111593
|
result[indexedKey] = indexedToken;
|
|
111484
111594
|
}
|
|
@@ -111487,13 +111597,13 @@ function listTokensByHost(serverHost) {
|
|
|
111487
111597
|
function listAllTokens() {
|
|
111488
111598
|
const result = { ...readLegacyStore() ?? {} };
|
|
111489
111599
|
const dir = getMcpOauthStorageDir();
|
|
111490
|
-
if (!
|
|
111600
|
+
if (!existsSync63(dir))
|
|
111491
111601
|
return result;
|
|
111492
111602
|
const index = readTokenIndex(dir);
|
|
111493
111603
|
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
111494
111604
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
111495
111605
|
continue;
|
|
111496
|
-
const token = readTokenFile(
|
|
111606
|
+
const token = readTokenFile(join90(dir, entry.name));
|
|
111497
111607
|
const hash2 = basename12(entry.name, ".json");
|
|
111498
111608
|
if (token)
|
|
111499
111609
|
result[index[hash2] ?? hash2] = token;
|
|
@@ -111693,7 +111803,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
|
|
|
111693
111803
|
}
|
|
111694
111804
|
var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
111695
111805
|
function startCallbackServer(port) {
|
|
111696
|
-
return new Promise((
|
|
111806
|
+
return new Promise((resolve28, reject) => {
|
|
111697
111807
|
let timeoutId;
|
|
111698
111808
|
const server2 = createServer2((request, response) => {
|
|
111699
111809
|
clearTimeout(timeoutId);
|
|
@@ -111719,7 +111829,7 @@ function startCallbackServer(port) {
|
|
|
111719
111829
|
response.writeHead(200, { "content-type": "text/html" });
|
|
111720
111830
|
response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
|
|
111721
111831
|
server2.close();
|
|
111722
|
-
|
|
111832
|
+
resolve28({ code, state: state2 });
|
|
111723
111833
|
});
|
|
111724
111834
|
timeoutId = setTimeout(() => {
|
|
111725
111835
|
server2.close();
|
|
@@ -112059,7 +112169,7 @@ function createMcpOAuthCommand() {
|
|
|
112059
112169
|
}
|
|
112060
112170
|
|
|
112061
112171
|
// packages/omo-opencode/src/cli/boulder/boulder.ts
|
|
112062
|
-
import { existsSync as
|
|
112172
|
+
import { existsSync as existsSync64 } from "fs";
|
|
112063
112173
|
|
|
112064
112174
|
// packages/omo-opencode/src/cli/boulder/formatter.ts
|
|
112065
112175
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
@@ -112196,10 +112306,10 @@ async function boulder(options) {
|
|
|
112196
112306
|
const boulderFilePath = getBoulderFilePath(directory);
|
|
112197
112307
|
const state2 = readBoulderState(directory);
|
|
112198
112308
|
if (!state2) {
|
|
112199
|
-
const message =
|
|
112309
|
+
const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
|
|
112200
112310
|
process.stderr.write(`${message}
|
|
112201
112311
|
`);
|
|
112202
|
-
return
|
|
112312
|
+
return existsSync64(boulderFilePath) ? 2 : 1;
|
|
112203
112313
|
}
|
|
112204
112314
|
const works = getBoulderWorks(state2);
|
|
112205
112315
|
const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
|
|
@@ -112217,12 +112327,12 @@ async function boulder(options) {
|
|
|
112217
112327
|
}
|
|
112218
112328
|
// packages/omo-opencode/src/cli/codex-ulw-loop.ts
|
|
112219
112329
|
import { spawn as spawn5 } from "child_process";
|
|
112220
|
-
import { existsSync as
|
|
112221
|
-
import { homedir as
|
|
112330
|
+
import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "fs";
|
|
112331
|
+
import { homedir as homedir26 } from "os";
|
|
112222
112332
|
var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
|
|
112223
112333
|
function resolveCodexUlwLoopCommand(input = {}) {
|
|
112224
112334
|
const env3 = input.env ?? process.env;
|
|
112225
|
-
const homeDir = input.homeDir ??
|
|
112335
|
+
const homeDir = input.homeDir ?? homedir26();
|
|
112226
112336
|
const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
|
|
112227
112337
|
if (localComponentBin !== null)
|
|
112228
112338
|
return { executable: localComponentBin, argsPrefix: [] };
|
|
@@ -112245,25 +112355,25 @@ async function codexUlwLoop(args) {
|
|
|
112245
112355
|
console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
|
|
112246
112356
|
return 1;
|
|
112247
112357
|
}
|
|
112248
|
-
const { promise: promise2, resolve:
|
|
112358
|
+
const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
|
|
112249
112359
|
const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
|
|
112250
112360
|
stdio: "inherit",
|
|
112251
112361
|
env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
|
|
112252
112362
|
});
|
|
112253
112363
|
child.on("error", (error51) => {
|
|
112254
112364
|
console.error(error51.message);
|
|
112255
|
-
|
|
112365
|
+
resolve28(1);
|
|
112256
112366
|
});
|
|
112257
|
-
child.on("close", (code) =>
|
|
112367
|
+
child.on("close", (code) => resolve28(code ?? 1));
|
|
112258
112368
|
return promise2;
|
|
112259
112369
|
}
|
|
112260
112370
|
function resolveLocalUlwLoopBin(env3, homeDir) {
|
|
112261
112371
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
|
|
112262
|
-
return candidates.find((candidate2) =>
|
|
112372
|
+
return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
|
|
112263
112373
|
}
|
|
112264
112374
|
function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
|
|
112265
112375
|
const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
|
|
112266
|
-
return candidates.find((candidate2) =>
|
|
112376
|
+
return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
|
|
112267
112377
|
}
|
|
112268
112378
|
function isGeneratedRuntimeWrapper(candidate2) {
|
|
112269
112379
|
try {
|