oh-my-openagent 5.1.2 → 5.1.4
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/dist/cli/index.js +233 -81
- package/dist/cli-node/index.js +233 -81
- package/dist/index.js +187 -24
- package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
- package/dist/tui.js +148 -18
- package/package.json +14 -14
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +1 -1
- package/packages/lsp-core/src/missing-dependency-result.test.ts +32 -2
- package/packages/lsp-core/src/missing-dependency-result.ts +3 -0
- package/packages/lsp-core/src/post-edit/file-location.ts +50 -0
- package/packages/lsp-core/src/post-edit/index.ts +2 -0
- package/packages/lsp-core/src/post-edit/not-installed-guidance.ts +36 -0
- package/packages/lsp-core/src/post-edit/not-installed.test.ts +199 -0
- package/packages/lsp-core/src/post-edit/orchestration.ts +26 -5
- package/packages/lsp-daemon/dist/cli.js +2 -1
- package/packages/lsp-daemon/dist/client.js +2 -1
- package/packages/lsp-daemon/dist/index.js +2 -1
- package/packages/lsp-tools-mcp/dist/cli.js +2 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +2 -1
- package/packages/lsp-tools-mcp/dist/tools.js +2 -1
- 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/comment-checker/dist/cli.js +33 -7
- 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/comment-checker/src/runner.ts +4 -4
- 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 +4 -4
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +141 -107
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +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/lsp/src/lsp-session-state.ts +2 -2
- 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/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/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +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-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/post-tool-use-recording-spawn-admission.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-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-ulw-execute-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-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 +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var package_default;
|
|
|
64
64
|
var init_package = __esm(() => {
|
|
65
65
|
package_default = {
|
|
66
66
|
name: "oh-my-opencode",
|
|
67
|
-
version: "5.1.
|
|
67
|
+
version: "5.1.4",
|
|
68
68
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
69
69
|
main: "./dist/index.js",
|
|
70
70
|
types: "dist/index.d.ts",
|
|
@@ -241,7 +241,7 @@ var init_package = __esm(() => {
|
|
|
241
241
|
},
|
|
242
242
|
devDependencies: {
|
|
243
243
|
"@clack/prompts": "^1.8.1",
|
|
244
|
-
"@code-yeongyu/senpi": "2026.9.29-
|
|
244
|
+
"@code-yeongyu/senpi": "2026.9.29-5",
|
|
245
245
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
246
246
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
247
247
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
@@ -299,18 +299,18 @@ var init_package = __esm(() => {
|
|
|
299
299
|
typescript: "^7.0.2"
|
|
300
300
|
},
|
|
301
301
|
optionalDependencies: {
|
|
302
|
-
"oh-my-opencode-darwin-arm64": "5.1.
|
|
303
|
-
"oh-my-opencode-darwin-x64": "5.1.
|
|
304
|
-
"oh-my-opencode-darwin-x64-baseline": "5.1.
|
|
305
|
-
"oh-my-opencode-linux-arm64": "5.1.
|
|
306
|
-
"oh-my-opencode-linux-arm64-musl": "5.1.
|
|
307
|
-
"oh-my-opencode-linux-x64": "5.1.
|
|
308
|
-
"oh-my-opencode-linux-x64-baseline": "5.1.
|
|
309
|
-
"oh-my-opencode-linux-x64-musl": "5.1.
|
|
310
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.1.
|
|
311
|
-
"oh-my-opencode-windows-arm64": "5.1.
|
|
312
|
-
"oh-my-opencode-windows-x64": "5.1.
|
|
313
|
-
"oh-my-opencode-windows-x64-baseline": "5.1.
|
|
302
|
+
"oh-my-opencode-darwin-arm64": "5.1.4",
|
|
303
|
+
"oh-my-opencode-darwin-x64": "5.1.4",
|
|
304
|
+
"oh-my-opencode-darwin-x64-baseline": "5.1.4",
|
|
305
|
+
"oh-my-opencode-linux-arm64": "5.1.4",
|
|
306
|
+
"oh-my-opencode-linux-arm64-musl": "5.1.4",
|
|
307
|
+
"oh-my-opencode-linux-x64": "5.1.4",
|
|
308
|
+
"oh-my-opencode-linux-x64-baseline": "5.1.4",
|
|
309
|
+
"oh-my-opencode-linux-x64-musl": "5.1.4",
|
|
310
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.1.4",
|
|
311
|
+
"oh-my-opencode-windows-arm64": "5.1.4",
|
|
312
|
+
"oh-my-opencode-windows-x64": "5.1.4",
|
|
313
|
+
"oh-my-opencode-windows-x64-baseline": "5.1.4"
|
|
314
314
|
},
|
|
315
315
|
overrides: {
|
|
316
316
|
hono: "^4.13.8",
|
|
@@ -7392,6 +7392,8 @@ var init_category_model_requirements = __esm(() => {
|
|
|
7392
7392
|
},
|
|
7393
7393
|
"deep-low": {
|
|
7394
7394
|
fallbackChain: [
|
|
7395
|
+
{ providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol", variant: "medium" },
|
|
7396
|
+
{ providers: ["openai", "chatgpt-subscription"], model: "gpt-6.1-sol-fast", variant: "medium" },
|
|
7395
7397
|
{
|
|
7396
7398
|
providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
|
|
7397
7399
|
model: "gpt-5.6-sol",
|
|
@@ -7444,7 +7446,9 @@ var init_category_model_requirements = __esm(() => {
|
|
|
7444
7446
|
providers: ["anthropic", "anthropic-api", "github-copilot"],
|
|
7445
7447
|
model: "claude-haiku-4-5",
|
|
7446
7448
|
variant: "off"
|
|
7447
|
-
}
|
|
7449
|
+
},
|
|
7450
|
+
{ providers: ["zai-coding-plan"], model: "glm-5.3-flash", variant: "low" },
|
|
7451
|
+
{ providers: ["xiaomi"], model: "mimo-v2.6-flash", variant: "low" }
|
|
7448
7452
|
]
|
|
7449
7453
|
},
|
|
7450
7454
|
"unspecified-low": {
|
|
@@ -7609,7 +7613,7 @@ var init_model_capability_aliases = __esm(() => {
|
|
|
7609
7613
|
description: "Normalizes OpenCode's OpenAI GPT fast service-tier IDs to canonical snapshot IDs.",
|
|
7610
7614
|
providerIDs: ["openai"],
|
|
7611
7615
|
allowedSubproviderHosts: ["vercel"],
|
|
7612
|
-
match: (normalizedModelID) => /^(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:astra|sol|luna))-fast$/.test(normalizedModelID),
|
|
7616
|
+
match: (normalizedModelID) => /^(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:astra|sol|luna)|gpt-6\.1-sol)-fast$/.test(normalizedModelID),
|
|
7613
7617
|
canonicalize: (normalizedModelID) => normalizedModelID.slice(0, -"-fast".length)
|
|
7614
7618
|
},
|
|
7615
7619
|
{
|
|
@@ -7757,6 +7761,14 @@ var init_model_capability_heuristics = __esm(() => {
|
|
|
7757
7761
|
reasoningEffortAliases: { none: "low", minimal: "low" },
|
|
7758
7762
|
supportsTemperature: false
|
|
7759
7763
|
},
|
|
7764
|
+
{
|
|
7765
|
+
family: "gpt-6.1-sol",
|
|
7766
|
+
pattern: /gpt-6-1-sol/,
|
|
7767
|
+
variants: ["low", "medium", "high", "xhigh", "max"],
|
|
7768
|
+
reasoningEfforts: ["low", "medium", "high", "xhigh", "max"],
|
|
7769
|
+
reasoningEffortAliases: { none: "low", minimal: "low" },
|
|
7770
|
+
supportsTemperature: false
|
|
7771
|
+
},
|
|
7760
7772
|
{
|
|
7761
7773
|
family: "gpt-6",
|
|
7762
7774
|
includes: ["gpt-6"],
|
|
@@ -8188,6 +8200,36 @@ var init_supplemental_entries = __esm(() => {
|
|
|
8188
8200
|
output: 128000
|
|
8189
8201
|
}
|
|
8190
8202
|
},
|
|
8203
|
+
"gpt-6.1-sol": {
|
|
8204
|
+
id: "gpt-6.1-sol",
|
|
8205
|
+
family: "gpt",
|
|
8206
|
+
reasoning: true,
|
|
8207
|
+
temperature: false,
|
|
8208
|
+
toolCall: true,
|
|
8209
|
+
modalities: {
|
|
8210
|
+
input: ["text", "image"],
|
|
8211
|
+
output: ["text"]
|
|
8212
|
+
},
|
|
8213
|
+
limit: {
|
|
8214
|
+
context: 400000,
|
|
8215
|
+
output: 128000
|
|
8216
|
+
}
|
|
8217
|
+
},
|
|
8218
|
+
"gpt-6.1-sol-fast": {
|
|
8219
|
+
id: "gpt-6.1-sol-fast",
|
|
8220
|
+
family: "gpt",
|
|
8221
|
+
reasoning: true,
|
|
8222
|
+
temperature: false,
|
|
8223
|
+
toolCall: true,
|
|
8224
|
+
modalities: {
|
|
8225
|
+
input: ["text", "image"],
|
|
8226
|
+
output: ["text"]
|
|
8227
|
+
},
|
|
8228
|
+
limit: {
|
|
8229
|
+
context: 400000,
|
|
8230
|
+
output: 128000
|
|
8231
|
+
}
|
|
8232
|
+
},
|
|
8191
8233
|
"gpt-6-luna": {
|
|
8192
8234
|
id: "gpt-6-luna",
|
|
8193
8235
|
family: "gpt-nano",
|
|
@@ -9454,7 +9496,7 @@ You are working on tasks that don't fit specific categories but require substant
|
|
|
9454
9496
|
</Category_Context>`, UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits and substantial effort spans systems/modules with broad impact. Use unspecified-low for contained moderate work.</Selection_Gate>`, DEEP_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Route here when one subsystem plus its callers holds the mechanism and the evidence, once read, leaves one right answer. Wide but mechanical work belongs here or in a quick batch. When unsure, choose deep-low: a misrouted child returns \`ESCALATE: deep-high\` after one cheap attempt; re-spawn the same brief as deep-high with its findings.</Selection_Gate>`, DEEP_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Route here only when you can name the decision evidence cannot settle: a trade-off with no single right answer, a contract change crossing a package or process boundary, a mechanism with no in-repo pattern to copy, or correctness argued from invariants rather than observed in a test. Wide scope with easy decisions is deep-low or unspecified-high; reasoning as the deliverable is ultrabrain.</Selection_Gate>`, DEEP_LOW_GATE_MODELS, DEEP_HIGH_GATE_MODEL = "gpt-6-astra", OPENAI_CATEGORIES;
|
|
9455
9497
|
var init_openai_categories = __esm(() => {
|
|
9456
9498
|
init_types();
|
|
9457
|
-
DEEP_LOW_GATE_MODELS = ["gpt-5.6-sol-fast", "gpt-5.6-sol"];
|
|
9499
|
+
DEEP_LOW_GATE_MODELS = ["gpt-6.1-sol", "gpt-6.1-sol-fast", "gpt-5.6-sol-fast", "gpt-5.6-sol"];
|
|
9458
9500
|
OPENAI_CATEGORIES = [
|
|
9459
9501
|
{
|
|
9460
9502
|
name: "ultrabrain",
|
|
@@ -9465,7 +9507,7 @@ var init_openai_categories = __esm(() => {
|
|
|
9465
9507
|
},
|
|
9466
9508
|
{
|
|
9467
9509
|
name: "deep-low",
|
|
9468
|
-
config: { model: "openai/gpt-
|
|
9510
|
+
config: { model: "openai/gpt-6.1-sol", variant: "medium" },
|
|
9469
9511
|
description: "Default deep lane: one goal, one deliverable, decisions the child can settle from what it reads. **3D graphics, computer/browser use, CAPTCHA, multimodal, backend, logic, and algorithm work is routed here.** Multiple goals fan out as parallel calls.",
|
|
9470
9512
|
callerGuidance: DEEP_LOW_CATEGORY_CALLER_GUIDANCE,
|
|
9471
9513
|
promptAppend: DEEP_LOW_CATEGORY_PROMPT_APPEND,
|
|
@@ -64779,6 +64821,94 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
64779
64821
|
context: 1e6,
|
|
64780
64822
|
output: 128000
|
|
64781
64823
|
}
|
|
64824
|
+
},
|
|
64825
|
+
"glm-5.3-flash": {
|
|
64826
|
+
id: "glm-5.3-flash",
|
|
64827
|
+
family: "glm-flash",
|
|
64828
|
+
reasoning: true,
|
|
64829
|
+
temperature: true,
|
|
64830
|
+
toolCall: true,
|
|
64831
|
+
modalities: {
|
|
64832
|
+
input: [
|
|
64833
|
+
"text",
|
|
64834
|
+
"image",
|
|
64835
|
+
"video"
|
|
64836
|
+
],
|
|
64837
|
+
output: [
|
|
64838
|
+
"text"
|
|
64839
|
+
]
|
|
64840
|
+
},
|
|
64841
|
+
limit: {
|
|
64842
|
+
context: 1048576,
|
|
64843
|
+
output: 1048576
|
|
64844
|
+
}
|
|
64845
|
+
},
|
|
64846
|
+
"zai/glm-5.3-flash": {
|
|
64847
|
+
id: "zai/glm-5.3-flash",
|
|
64848
|
+
family: "glm-flash",
|
|
64849
|
+
reasoning: true,
|
|
64850
|
+
temperature: true,
|
|
64851
|
+
toolCall: true,
|
|
64852
|
+
modalities: {
|
|
64853
|
+
input: [
|
|
64854
|
+
"text",
|
|
64855
|
+
"image",
|
|
64856
|
+
"video",
|
|
64857
|
+
"pdf"
|
|
64858
|
+
],
|
|
64859
|
+
output: [
|
|
64860
|
+
"text"
|
|
64861
|
+
]
|
|
64862
|
+
},
|
|
64863
|
+
limit: {
|
|
64864
|
+
context: 1e6,
|
|
64865
|
+
output: 131072
|
|
64866
|
+
}
|
|
64867
|
+
},
|
|
64868
|
+
"mimo-v2.6-flash": {
|
|
64869
|
+
id: "mimo-v2.6-flash",
|
|
64870
|
+
family: "mimo",
|
|
64871
|
+
reasoning: true,
|
|
64872
|
+
temperature: true,
|
|
64873
|
+
toolCall: true,
|
|
64874
|
+
modalities: {
|
|
64875
|
+
input: [
|
|
64876
|
+
"text",
|
|
64877
|
+
"image",
|
|
64878
|
+
"audio",
|
|
64879
|
+
"video"
|
|
64880
|
+
],
|
|
64881
|
+
output: [
|
|
64882
|
+
"text"
|
|
64883
|
+
]
|
|
64884
|
+
},
|
|
64885
|
+
limit: {
|
|
64886
|
+
context: 1048576,
|
|
64887
|
+
output: 131072
|
|
64888
|
+
}
|
|
64889
|
+
},
|
|
64890
|
+
"xiaomi/mimo-v2.6-flash": {
|
|
64891
|
+
id: "xiaomi/mimo-v2.6-flash",
|
|
64892
|
+
family: "mimo",
|
|
64893
|
+
reasoning: true,
|
|
64894
|
+
temperature: true,
|
|
64895
|
+
toolCall: true,
|
|
64896
|
+
modalities: {
|
|
64897
|
+
input: [
|
|
64898
|
+
"text",
|
|
64899
|
+
"image",
|
|
64900
|
+
"audio",
|
|
64901
|
+
"video"
|
|
64902
|
+
],
|
|
64903
|
+
output: [
|
|
64904
|
+
"text"
|
|
64905
|
+
]
|
|
64906
|
+
},
|
|
64907
|
+
limit: {
|
|
64908
|
+
context: 1048576,
|
|
64909
|
+
input: 1048576,
|
|
64910
|
+
output: 131072
|
|
64911
|
+
}
|
|
64782
64912
|
}
|
|
64783
64913
|
}
|
|
64784
64914
|
};
|
|
@@ -89020,7 +89150,7 @@ var package_default2;
|
|
|
89020
89150
|
var init_package2 = __esm(() => {
|
|
89021
89151
|
package_default2 = {
|
|
89022
89152
|
name: "@oh-my-opencode/omo-codex",
|
|
89023
|
-
version: "5.1.
|
|
89153
|
+
version: "5.1.4",
|
|
89024
89154
|
type: "module",
|
|
89025
89155
|
private: true,
|
|
89026
89156
|
description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
|
|
@@ -106453,15 +106583,10 @@ async function checkDeprecatedReasoningKeys() {
|
|
|
106453
106583
|
}
|
|
106454
106584
|
|
|
106455
106585
|
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
106456
|
-
init_src();
|
|
106457
106586
|
import { existsSync as existsSync55 } from "fs";
|
|
106458
|
-
import { createRequire as
|
|
106587
|
+
import { createRequire as createRequire3 } from "module";
|
|
106459
106588
|
import { homedir as homedir20 } from "os";
|
|
106460
|
-
import {
|
|
106461
|
-
|
|
106462
|
-
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
106463
|
-
import { join as join87 } from "path";
|
|
106464
|
-
import { homedir as homedir19, tmpdir as tmpdir4 } from "os";
|
|
106589
|
+
import { join as join89 } from "path";
|
|
106465
106590
|
// packages/comment-checker-core/src/release.ts
|
|
106466
106591
|
import { join as join85 } from "path";
|
|
106467
106592
|
var COMMENT_CHECKER_RELEASE_VERSION = "0.8.0";
|
|
@@ -106488,12 +106613,45 @@ function isCachedCommentCheckerCurrent(cacheDir, readFile = (path) => readFileSy
|
|
|
106488
106613
|
return false;
|
|
106489
106614
|
}
|
|
106490
106615
|
}
|
|
106616
|
+
// packages/comment-checker-core/src/package-binary.ts
|
|
106617
|
+
import { createRequire as createRequire2 } from "module";
|
|
106618
|
+
import { dirname as dirname33, join as join87 } from "path";
|
|
106619
|
+
var COMMENT_CHECKER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
106620
|
+
function isModuleResolutionMiss(error) {
|
|
106621
|
+
return error instanceof Error || typeof error === "object" && error !== null && "name" in error && error.name === "ResolveMessage";
|
|
106622
|
+
}
|
|
106623
|
+
function findCommentCheckerPackageBinary(input) {
|
|
106624
|
+
const packageName = input.packageName ?? COMMENT_CHECKER_PACKAGE_NAME;
|
|
106625
|
+
const platformKey = `${input.platform ?? process.platform}-${input.arch ?? process.arch}`;
|
|
106626
|
+
const packageDir = dirname33(input.packageJsonPath);
|
|
106627
|
+
const candidates = [
|
|
106628
|
+
resolvePlatformPackageBinary(input.packageJsonPath, `${packageName}-${platformKey}`, input.binaryName),
|
|
106629
|
+
join87(packageDir, "vendor", platformKey, input.binaryName),
|
|
106630
|
+
join87(packageDir, "bin", input.binaryName)
|
|
106631
|
+
];
|
|
106632
|
+
return candidates.find((candidate) => candidate !== null && input.existsSync(candidate)) ?? null;
|
|
106633
|
+
}
|
|
106634
|
+
function resolvePlatformPackageBinary(packageJsonPath, platformPackageName, binaryName) {
|
|
106635
|
+
try {
|
|
106636
|
+
const manifestPath = createRequire2(packageJsonPath).resolve(`${platformPackageName}/package.json`);
|
|
106637
|
+
return join87(dirname33(manifestPath), "bin", binaryName);
|
|
106638
|
+
} catch (error) {
|
|
106639
|
+
if (isModuleResolutionMiss(error))
|
|
106640
|
+
return null;
|
|
106641
|
+
throw error;
|
|
106642
|
+
}
|
|
106643
|
+
}
|
|
106644
|
+
// packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
|
|
106645
|
+
init_src();
|
|
106646
|
+
|
|
106491
106647
|
// packages/omo-opencode/src/hooks/comment-checker/downloader.ts
|
|
106648
|
+
import { join as join88 } from "path";
|
|
106649
|
+
import { homedir as homedir19, tmpdir as tmpdir4 } from "os";
|
|
106492
106650
|
init_binary_downloader();
|
|
106493
106651
|
init_logger2();
|
|
106494
106652
|
init_plugin_identity();
|
|
106495
106653
|
var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
|
|
106496
|
-
var DEBUG_FILE =
|
|
106654
|
+
var DEBUG_FILE = join88(tmpdir4(), "comment-checker-debug.log");
|
|
106497
106655
|
function getCacheDir2() {
|
|
106498
106656
|
return commentCheckerCacheDir({
|
|
106499
106657
|
platform: process.platform,
|
|
@@ -106552,7 +106710,7 @@ async function getBinaryVersion(binary) {
|
|
|
106552
106710
|
}
|
|
106553
106711
|
}
|
|
106554
106712
|
async function checkAstGrepCli() {
|
|
106555
|
-
const runtimeDir = astGrepRuntimeDir(
|
|
106713
|
+
const runtimeDir = astGrepRuntimeDir(join89(homedir20(), ".omo"));
|
|
106556
106714
|
const sgPath = findSgBinarySync({ runtimeDir });
|
|
106557
106715
|
if (sgPath === null) {
|
|
106558
106716
|
return {
|
|
@@ -106574,20 +106732,14 @@ async function checkAstGrepCli() {
|
|
|
106574
106732
|
};
|
|
106575
106733
|
}
|
|
106576
106734
|
function resolveCommentCheckerPackageJson() {
|
|
106577
|
-
const require2 =
|
|
106735
|
+
const require2 = createRequire3(import.meta.url);
|
|
106578
106736
|
return require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
106579
106737
|
}
|
|
106580
|
-
function
|
|
106738
|
+
function findCommentCheckerPackageBinary2(baseDirOverride, resolvePackageJsonPath = resolveCommentCheckerPackageJson) {
|
|
106581
106739
|
const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
|
|
106582
|
-
const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
106583
106740
|
try {
|
|
106584
|
-
const
|
|
106585
|
-
|
|
106586
|
-
if (existsSync55(vendorPath))
|
|
106587
|
-
return vendorPath;
|
|
106588
|
-
const binPath = join88(packageDir, "bin", binaryName);
|
|
106589
|
-
if (existsSync55(binPath))
|
|
106590
|
-
return binPath;
|
|
106741
|
+
const packageJsonPath = baseDirOverride === undefined ? resolvePackageJsonPath() : join89(baseDirOverride, "package.json");
|
|
106742
|
+
return findCommentCheckerPackageBinary({ packageJsonPath, binaryName, existsSync: existsSync55 });
|
|
106591
106743
|
} catch (error) {
|
|
106592
106744
|
if (!(error instanceof Error) && !isModuleResolutionFailure(error))
|
|
106593
106745
|
throw error;
|
|
@@ -106607,7 +106759,7 @@ async function checkCommentChecker() {
|
|
|
106607
106759
|
};
|
|
106608
106760
|
}
|
|
106609
106761
|
const binaryCheck = await checkBinaryExists("comment-checker");
|
|
106610
|
-
const resolvedPath = binaryCheck.exists ? binaryCheck.path :
|
|
106762
|
+
const resolvedPath = binaryCheck.exists ? binaryCheck.path : findCommentCheckerPackageBinary2();
|
|
106611
106763
|
if (!resolvedPath) {
|
|
106612
106764
|
return {
|
|
106613
106765
|
name: "Comment Checker",
|
|
@@ -106733,7 +106885,7 @@ async function getGhCliInfo(dependencies = {}) {
|
|
|
106733
106885
|
init_zod();
|
|
106734
106886
|
init_opencode_config_dir();
|
|
106735
106887
|
import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
|
|
106736
|
-
import { delimiter as delimiter3, dirname as
|
|
106888
|
+
import { delimiter as delimiter3, dirname as dirname35, resolve as resolve23 } from "path";
|
|
106737
106889
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
106738
106890
|
|
|
106739
106891
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
@@ -106864,7 +107016,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
|
|
|
106864
107016
|
].join(";");
|
|
106865
107017
|
function getModuleDirectory(moduleUrl) {
|
|
106866
107018
|
try {
|
|
106867
|
-
return
|
|
107019
|
+
return dirname35(fileURLToPath7(moduleUrl));
|
|
106868
107020
|
} catch (error) {
|
|
106869
107021
|
if (!(error instanceof Error))
|
|
106870
107022
|
throw error;
|
|
@@ -106961,13 +107113,13 @@ function getInstalledLspServers(options = {}) {
|
|
|
106961
107113
|
init_shared();
|
|
106962
107114
|
import { existsSync as existsSync57, readFileSync as readFileSync39 } from "fs";
|
|
106963
107115
|
import { homedir as homedir21 } from "os";
|
|
106964
|
-
import { join as
|
|
107116
|
+
import { join as join90 } from "path";
|
|
106965
107117
|
var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
|
|
106966
107118
|
function getMcpConfigPaths() {
|
|
106967
107119
|
return [
|
|
106968
|
-
|
|
106969
|
-
|
|
106970
|
-
|
|
107120
|
+
join90(homedir21(), ".claude", ".mcp.json"),
|
|
107121
|
+
join90(process.cwd(), ".mcp.json"),
|
|
107122
|
+
join90(process.cwd(), ".claude", ".mcp.json")
|
|
106971
107123
|
];
|
|
106972
107124
|
}
|
|
106973
107125
|
function loadUserMcpConfig() {
|
|
@@ -107249,7 +107401,7 @@ init_src();
|
|
|
107249
107401
|
import { existsSync as existsSync59 } from "fs";
|
|
107250
107402
|
import { lstat as lstat16, readdir as readdir14, readFile as readFile30 } from "fs/promises";
|
|
107251
107403
|
import { homedir as homedir23 } from "os";
|
|
107252
|
-
import { basename as basename12, join as
|
|
107404
|
+
import { basename as basename12, join as join91, resolve as resolve24 } from "path";
|
|
107253
107405
|
// packages/omo-opencode/package.json
|
|
107254
107406
|
var package_default3 = {
|
|
107255
107407
|
name: "@oh-my-opencode/omo-opencode",
|
|
@@ -107318,13 +107470,13 @@ var CODEX_BIN_NAMES = [
|
|
|
107318
107470
|
"omo-git-bash-hook"
|
|
107319
107471
|
];
|
|
107320
107472
|
async function gatherCodexSummary(deps = {}) {
|
|
107321
|
-
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
107473
|
+
const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join91(homedir23(), ".codex"));
|
|
107322
107474
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
107323
107475
|
const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
|
|
107324
107476
|
const pluginRoot = await resolveInstalledPluginRoot(codexHome);
|
|
107325
|
-
const manifest = pluginRoot === null ? null : await readJson(
|
|
107326
|
-
const installSnapshot = pluginRoot === null ? null : await readJson(
|
|
107327
|
-
const configPath =
|
|
107477
|
+
const manifest = pluginRoot === null ? null : await readJson(join91(pluginRoot, ".codex-plugin", "plugin.json"));
|
|
107478
|
+
const installSnapshot = pluginRoot === null ? null : await readJson(join91(pluginRoot, "lazycodex-install.json"));
|
|
107479
|
+
const configPath = join91(codexHome, "config.toml");
|
|
107328
107480
|
const pluginVersion = stringField(manifest, "version");
|
|
107329
107481
|
return {
|
|
107330
107482
|
codexPath: detection.found && "path" in detection ? detection.path : null,
|
|
@@ -107381,7 +107533,7 @@ function buildCodexIssues(summary) {
|
|
|
107381
107533
|
if (summary.pluginRoot === null) {
|
|
107382
107534
|
issues.push({
|
|
107383
107535
|
title: "OMO Codex plugin is not installed",
|
|
107384
|
-
description: `Expected cached plugin at ${
|
|
107536
|
+
description: `Expected cached plugin at ${join91("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
|
|
107385
107537
|
fix: "Run: npx lazycodex-ai install",
|
|
107386
107538
|
severity: "error",
|
|
107387
107539
|
affects: ["plugin loading"]
|
|
@@ -107446,12 +107598,12 @@ function buildCodexIssues(summary) {
|
|
|
107446
107598
|
return issues;
|
|
107447
107599
|
}
|
|
107448
107600
|
async function resolveInstalledPluginRoot(codexHome) {
|
|
107449
|
-
const pluginRoot =
|
|
107601
|
+
const pluginRoot = join91(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
|
|
107450
107602
|
if (!existsSync59(pluginRoot))
|
|
107451
107603
|
return null;
|
|
107452
107604
|
const versions = await readdir14(pluginRoot, { withFileTypes: true });
|
|
107453
107605
|
const candidates = versions.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
|
|
107454
|
-
return candidates.length === 0 ? null :
|
|
107606
|
+
return candidates.length === 0 ? null : join91(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
|
|
107455
107607
|
}
|
|
107456
107608
|
async function readCodexConfigSummary(configPath) {
|
|
107457
107609
|
if (!existsSync59(configPath)) {
|
|
@@ -107479,13 +107631,13 @@ async function readCodexConfigSummary(configPath) {
|
|
|
107479
107631
|
async function readLinkedBins(binDir) {
|
|
107480
107632
|
const linked = [];
|
|
107481
107633
|
for (const name of CODEX_BIN_NAMES) {
|
|
107482
|
-
if (await pathExists3(
|
|
107634
|
+
if (await pathExists3(join91(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
|
|
107483
107635
|
linked.push(name);
|
|
107484
107636
|
}
|
|
107485
107637
|
return linked;
|
|
107486
107638
|
}
|
|
107487
107639
|
async function readLinkedAgents(codexHome) {
|
|
107488
|
-
const agentsDir =
|
|
107640
|
+
const agentsDir = join91(codexHome, "agents");
|
|
107489
107641
|
if (!existsSync59(agentsDir))
|
|
107490
107642
|
return [];
|
|
107491
107643
|
const entries = await readdir14(agentsDir, { withFileTypes: true });
|
|
@@ -107619,7 +107771,7 @@ function resolveLatestVersion(input) {
|
|
|
107619
107771
|
init_src();
|
|
107620
107772
|
import { readdir as readdir15, readFile as readFile31, stat as stat7 } from "fs/promises";
|
|
107621
107773
|
import { homedir as homedir24 } from "os";
|
|
107622
|
-
import { dirname as
|
|
107774
|
+
import { dirname as dirname36, isAbsolute as isAbsolute14, join as join92, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
|
|
107623
107775
|
var CODEX_COMPONENTS_CHECK_ID = "codex-components";
|
|
107624
107776
|
var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
|
|
107625
107777
|
var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
|
|
@@ -107629,7 +107781,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
107629
107781
|
const env = deps.env ?? process.env;
|
|
107630
107782
|
const platform = deps.platform ?? process.platform;
|
|
107631
107783
|
const arch = deps.arch ?? process.arch;
|
|
107632
|
-
const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ??
|
|
107784
|
+
const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ?? join92(homedir24(), ".codex"));
|
|
107633
107785
|
const summary = await gatherCodexSummary({ ...deps, codexHome });
|
|
107634
107786
|
if (summary.pluginRoot === null) {
|
|
107635
107787
|
return {
|
|
@@ -107654,7 +107806,7 @@ async function checkCodexComponents(deps = {}) {
|
|
|
107654
107806
|
});
|
|
107655
107807
|
}
|
|
107656
107808
|
const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
|
|
107657
|
-
const runtimeSgPath =
|
|
107809
|
+
const runtimeSgPath = join92(runtimeSgDir, sgBinaryName(platform));
|
|
107658
107810
|
const sg = findSgBinarySync({
|
|
107659
107811
|
arch,
|
|
107660
107812
|
env,
|
|
@@ -107693,7 +107845,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
107693
107845
|
const manifest = await readJson2(manifestPath);
|
|
107694
107846
|
if (manifest === null || !isRecord18(manifest["mcpServers"]))
|
|
107695
107847
|
continue;
|
|
107696
|
-
const manifestRoot =
|
|
107848
|
+
const manifestRoot = dirname36(manifestPath);
|
|
107697
107849
|
const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
|
|
107698
107850
|
for (const server of Object.values(manifest["mcpServers"])) {
|
|
107699
107851
|
if (!isRecord18(server) || !Array.isArray(server["args"]))
|
|
@@ -107714,7 +107866,7 @@ async function auditBundleTargets(pluginRoot) {
|
|
|
107714
107866
|
continue;
|
|
107715
107867
|
const commands = [];
|
|
107716
107868
|
collectHookCommands(manifest, commands);
|
|
107717
|
-
const hookPluginRoot =
|
|
107869
|
+
const hookPluginRoot = dirname36(dirname36(hookManifestPath));
|
|
107718
107870
|
for (const command of commands) {
|
|
107719
107871
|
for (const relativePath of extractPluginRootPaths(command)) {
|
|
107720
107872
|
referencedCount += 1;
|
|
@@ -107753,7 +107905,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
|
|
|
107753
107905
|
}
|
|
107754
107906
|
async function findHookManifestPaths(root) {
|
|
107755
107907
|
const paths = await findManifestPaths(root, "hooks.json");
|
|
107756
|
-
return paths.filter((path) =>
|
|
107908
|
+
return paths.filter((path) => dirname36(path).endsWith(`${sep9}hooks`));
|
|
107757
107909
|
}
|
|
107758
107910
|
async function findManifestPaths(root, manifestName) {
|
|
107759
107911
|
let entries;
|
|
@@ -107766,7 +107918,7 @@ async function findManifestPaths(root, manifestName) {
|
|
|
107766
107918
|
for (const entry of entries) {
|
|
107767
107919
|
if (entry.name === "node_modules" || entry.name === ".git")
|
|
107768
107920
|
continue;
|
|
107769
|
-
const entryPath =
|
|
107921
|
+
const entryPath = join92(root, entry.name);
|
|
107770
107922
|
if (entry.isDirectory()) {
|
|
107771
107923
|
paths.push(...await findManifestPaths(entryPath, manifestName));
|
|
107772
107924
|
continue;
|
|
@@ -107810,18 +107962,18 @@ function isPluginRuntimePathArg(arg) {
|
|
|
107810
107962
|
return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute14(arg));
|
|
107811
107963
|
}
|
|
107812
107964
|
function runtimeSgDirectory(codexHome, platform, arch) {
|
|
107813
|
-
return
|
|
107965
|
+
return join92(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
|
|
107814
107966
|
}
|
|
107815
107967
|
function describeSgSource(sgPath, env, runtimeSgDir, platform) {
|
|
107816
107968
|
const override = env[SG_PATH_ENV_KEY]?.trim();
|
|
107817
107969
|
if (override !== undefined && override.length > 0 && sgPath === override)
|
|
107818
107970
|
return `env override ${SG_PATH_ENV_KEY}`;
|
|
107819
|
-
if (sgPath ===
|
|
107971
|
+
if (sgPath === join92(runtimeSgDir, sgBinaryName(platform)))
|
|
107820
107972
|
return "runtime dir";
|
|
107821
107973
|
return "PATH";
|
|
107822
107974
|
}
|
|
107823
107975
|
async function readBootstrapStateSummary(codexHome) {
|
|
107824
|
-
const statePath =
|
|
107976
|
+
const statePath = join92(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
|
|
107825
107977
|
const raw = await readJson2(statePath);
|
|
107826
107978
|
if (raw === null)
|
|
107827
107979
|
return null;
|
|
@@ -107900,16 +108052,16 @@ function isRecord18(value) {
|
|
|
107900
108052
|
import { existsSync as existsSync60 } from "fs";
|
|
107901
108053
|
import { readFile as readFile32 } from "fs/promises";
|
|
107902
108054
|
import { homedir as homedir25 } from "os";
|
|
107903
|
-
import { join as
|
|
108055
|
+
import { join as join93, resolve as resolve26 } from "path";
|
|
107904
108056
|
var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
107905
108057
|
var CHECK_NAME = "codex-runtime-wrapper";
|
|
107906
108058
|
var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
|
|
107907
108059
|
async function checkCodexRuntimeWrapper(deps = {}) {
|
|
107908
|
-
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ??
|
|
108060
|
+
const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join93(homedir25(), ".codex"));
|
|
107909
108061
|
const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
|
|
107910
108062
|
const platform = deps.platform ?? process.platform;
|
|
107911
|
-
const wrapperPath =
|
|
107912
|
-
const legacyWrapperPath =
|
|
108063
|
+
const wrapperPath = join93(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
|
|
108064
|
+
const legacyWrapperPath = join93(binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
107913
108065
|
const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
|
|
107914
108066
|
const issues = [];
|
|
107915
108067
|
if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
|
|
@@ -108445,12 +108597,12 @@ import {
|
|
|
108445
108597
|
unlinkSync as unlinkSync9,
|
|
108446
108598
|
writeFileSync as writeFileSync14
|
|
108447
108599
|
} from "fs";
|
|
108448
|
-
import { basename as basename13, dirname as
|
|
108600
|
+
import { basename as basename13, dirname as dirname37, join as join96 } from "path";
|
|
108449
108601
|
|
|
108450
108602
|
// packages/mcp-client-core/src/config-dir.ts
|
|
108451
108603
|
import { existsSync as existsSync61, realpathSync as realpathSync10 } from "fs";
|
|
108452
108604
|
import { homedir as homedir26 } from "os";
|
|
108453
|
-
import { join as
|
|
108605
|
+
import { join as join94, resolve as resolve27 } from "path";
|
|
108454
108606
|
function resolveConfigPath2(pathValue) {
|
|
108455
108607
|
const resolvedPath = resolve27(pathValue);
|
|
108456
108608
|
if (!existsSync61(resolvedPath))
|
|
@@ -108468,13 +108620,13 @@ function getOpenCodeCliConfigDir(env = process.env) {
|
|
|
108468
108620
|
if (customConfigDir) {
|
|
108469
108621
|
return resolveConfigPath2(customConfigDir);
|
|
108470
108622
|
}
|
|
108471
|
-
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() ||
|
|
108472
|
-
return resolveConfigPath2(
|
|
108623
|
+
const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join94(homedir26(), ".config");
|
|
108624
|
+
return resolveConfigPath2(join94(xdgConfigDir, "opencode"));
|
|
108473
108625
|
}
|
|
108474
108626
|
|
|
108475
108627
|
// packages/mcp-client-core/src/mcp-oauth/storage-index.ts
|
|
108476
108628
|
import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync7, writeFileSync as writeFileSync13 } from "fs";
|
|
108477
|
-
import { join as
|
|
108629
|
+
import { join as join95 } from "path";
|
|
108478
108630
|
var INDEX_FILE_NAME = "index.json";
|
|
108479
108631
|
function isTokenIndex(value) {
|
|
108480
108632
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
@@ -108482,7 +108634,7 @@ function isTokenIndex(value) {
|
|
|
108482
108634
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
108483
108635
|
}
|
|
108484
108636
|
function getIndexPath(storageDir) {
|
|
108485
|
-
return
|
|
108637
|
+
return join95(storageDir, INDEX_FILE_NAME);
|
|
108486
108638
|
}
|
|
108487
108639
|
function readTokenIndex(storageDir) {
|
|
108488
108640
|
const indexPath = getIndexPath(storageDir);
|
|
@@ -108526,16 +108678,16 @@ function deleteTokenIndexEntry(storageDir, hash) {
|
|
|
108526
108678
|
var STORAGE_DIR_NAME = "mcp-oauth";
|
|
108527
108679
|
var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
108528
108680
|
function getMcpOauthStorageDir() {
|
|
108529
|
-
return
|
|
108681
|
+
return join96(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
|
|
108530
108682
|
}
|
|
108531
108683
|
function getMcpOauthServerHash(serverHost, resource) {
|
|
108532
108684
|
return createHash7("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
|
|
108533
108685
|
}
|
|
108534
108686
|
function getMcpOauthStoragePath(serverHost, resource) {
|
|
108535
|
-
return
|
|
108687
|
+
return join96(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
|
|
108536
108688
|
}
|
|
108537
108689
|
function getLegacyStoragePath() {
|
|
108538
|
-
return
|
|
108690
|
+
return join96(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
|
|
108539
108691
|
}
|
|
108540
108692
|
function normalizeHost2(serverHost) {
|
|
108541
108693
|
let host = serverHost.trim();
|
|
@@ -108629,7 +108781,7 @@ function readLegacyStore() {
|
|
|
108629
108781
|
}
|
|
108630
108782
|
function writeTokenFile(filePath, token) {
|
|
108631
108783
|
try {
|
|
108632
|
-
const dir =
|
|
108784
|
+
const dir = dirname37(filePath);
|
|
108633
108785
|
if (!existsSync63(dir)) {
|
|
108634
108786
|
mkdirSync17(dir, { recursive: true });
|
|
108635
108787
|
}
|
|
@@ -108714,7 +108866,7 @@ function listTokensByHost(serverHost) {
|
|
|
108714
108866
|
for (const [hash, indexedKey] of Object.entries(index)) {
|
|
108715
108867
|
if (!indexedKey.startsWith(prefix))
|
|
108716
108868
|
continue;
|
|
108717
|
-
const indexedToken = readTokenFile(
|
|
108869
|
+
const indexedToken = readTokenFile(join96(getMcpOauthStorageDir(), `${hash}.json`));
|
|
108718
108870
|
if (indexedToken)
|
|
108719
108871
|
result[indexedKey] = indexedToken;
|
|
108720
108872
|
}
|
|
@@ -108729,7 +108881,7 @@ function listAllTokens() {
|
|
|
108729
108881
|
for (const entry of readdirSync13(dir, { withFileTypes: true })) {
|
|
108730
108882
|
if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
|
|
108731
108883
|
continue;
|
|
108732
|
-
const token = readTokenFile(
|
|
108884
|
+
const token = readTokenFile(join96(dir, entry.name));
|
|
108733
108885
|
const hash = basename13(entry.name, ".json");
|
|
108734
108886
|
if (token)
|
|
108735
108887
|
result[index[hash] ?? hash] = token;
|