opencode-matrixx 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -7
- package/dist/agents/architect/default.d.ts +1 -1
- package/dist/agents/architect/gpt.d.ts +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/mouse/agent.d.ts +1 -1
- package/dist/agents/oracle/behavioral-summary.d.ts +1 -1
- package/dist/agents/oracle/high-accuracy-mode.d.ts +1 -1
- package/dist/agents/oracle/identity-constraints.d.ts +1 -1
- package/dist/agents/oracle/interview-mode.d.ts +1 -1
- package/dist/agents/oracle/plan-generation.d.ts +1 -1
- package/dist/agents/oracle/plan-template.d.ts +1 -1
- package/dist/agents/oracle/system-prompt.d.ts +1 -1
- package/dist/agents/smith.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/agents/zion.d.ts +7 -0
- package/dist/cli/index.js +724 -171
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema/agent-definitions.d.ts +4 -0
- package/dist/config/schema/agent-names.d.ts +7 -0
- package/dist/config/schema/categories.d.ts +2 -0
- package/dist/config/schema/hooks.d.ts +6 -0
- package/dist/config/schema/matrixx-config.d.ts +30 -0
- package/dist/config/schema/model-capabilities.d.ts +8 -0
- package/dist/config/schema/runtime-fallback.d.ts +10 -0
- package/dist/config/schema/tdd-enforcer.d.ts +5 -0
- package/dist/config/schema.d.ts +4 -0
- package/dist/create-hooks.d.ts +6 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-commands/templates/pickup.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-skills/skills/crypto-market-analysis.d.ts +4 -0
- package/dist/features/builtin-skills/skills/crypto-onchain.d.ts +4 -0
- package/dist/features/builtin-skills/skills/crypto-trading.d.ts +4 -0
- package/dist/features/builtin-skills/skills/index.d.ts +5 -0
- package/dist/features/builtin-skills/skills/review-work.d.ts +4 -0
- package/dist/features/builtin-skills/skills/tdd-enforcer.d.ts +4 -0
- package/dist/features/mission-state/constants.d.ts +4 -4
- package/dist/features/mission-state/storage.d.ts +1 -1
- package/dist/features/run-continuation-state/constants.d.ts +1 -0
- package/dist/features/run-continuation-state/index.d.ts +3 -0
- package/dist/features/run-continuation-state/storage.d.ts +6 -0
- package/dist/features/run-continuation-state/types.d.ts +12 -0
- package/dist/features/team-mode/index.d.ts +2 -0
- package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -0
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +15 -0
- package/dist/features/team-mode/team-worktree/cleanup.d.ts +3 -0
- package/dist/features/team-mode/team-worktree/index.d.ts +2 -0
- package/dist/features/team-mode/team-worktree/manager.d.ts +15 -0
- package/dist/features/team-mode/types.d.ts +210 -0
- package/dist/hooks/handoff-injector/constants.d.ts +2 -2
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +28 -0
- package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -1
- package/dist/hooks/matrix-loop/constants.d.ts +1 -1
- package/dist/hooks/mouse-notepad/constants.d.ts +1 -1
- package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +55 -0
- package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +18 -0
- package/dist/hooks/preemptive-compaction-trigger.d.ts +13 -0
- package/dist/hooks/preemptive-compaction-types.d.ts +53 -0
- package/dist/hooks/preemptive-compaction.d.ts +5 -13
- package/dist/hooks/prometheus-md-only/constants.d.ts +1 -1
- package/dist/hooks/prometheus-md-only/path-policy.d.ts +3 -3
- package/dist/hooks/read-image-resizer/hook.d.ts +12 -0
- package/dist/hooks/read-image-resizer/image-dimensions.d.ts +2 -0
- package/dist/hooks/read-image-resizer/image-resizer.d.ts +5 -0
- package/dist/hooks/read-image-resizer/index.d.ts +1 -0
- package/dist/hooks/read-image-resizer/png-fallback-resizer.d.ts +2 -0
- package/dist/hooks/read-image-resizer/types.d.ts +14 -0
- package/dist/hooks/runtime-fallback/agent-resolver.d.ts +6 -0
- package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +4 -0
- package/dist/hooks/runtime-fallback/auto-retry.d.ts +10 -0
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +20 -0
- package/dist/hooks/runtime-fallback/constants.d.ts +4 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +13 -0
- package/dist/hooks/runtime-fallback/event-handler.d.ts +8 -0
- package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
- package/dist/hooks/runtime-fallback/fallback-models.d.ts +2 -0
- package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
- package/dist/hooks/runtime-fallback/fallback-state.d.ts +6 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +2 -0
- package/dist/hooks/runtime-fallback/index.d.ts +3 -0
- package/dist/hooks/runtime-fallback/is-abort-error.d.ts +1 -0
- package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +4 -0
- package/dist/hooks/runtime-fallback/model-utils.d.ts +7 -0
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +11 -0
- package/dist/hooks/runtime-fallback/retry-status-utils.d.ts +2 -0
- package/dist/hooks/runtime-fallback/session-category-registry.d.ts +6 -0
- package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
- package/dist/hooks/runtime-fallback/types.d.ts +113 -0
- package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
- package/dist/hooks/shared/compaction-model-resolver.d.ts +5 -0
- package/dist/hooks/todo-description-override/description.d.ts +1 -0
- package/dist/hooks/todo-description-override/hook.d.ts +8 -0
- package/dist/hooks/todo-description-override/index.d.ts +1 -0
- package/dist/hooks/tool-pair-validator/hook.d.ts +28 -0
- package/dist/hooks/tool-pair-validator/index.d.ts +1 -0
- package/dist/hooks/webfetch-redirect-guard/constants.d.ts +6 -0
- package/dist/hooks/webfetch-redirect-guard/hook.d.ts +19 -0
- package/dist/hooks/webfetch-redirect-guard/index.d.ts +1 -0
- package/dist/hooks/webfetch-redirect-guard/redirect-resolution.d.ts +16 -0
- package/dist/index.js +5562 -792
- package/dist/plugin/hooks/create-core-hooks.d.ts +6 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +5 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
- package/dist/plugin/tool-definition.d.ts +9 -0
- package/dist/shared/context-limit-resolver.d.ts +5 -0
- package/dist/shared/session-model-state.d.ts +7 -0
- package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -0
- package/dist/tools/ast-grep/pattern-hints.d.ts +4 -0
- package/dist/tools/ast-grep/tool-descriptions.d.ts +3 -0
- package/dist/tools/delegate-task/constants.d.ts +2 -3
- package/dist/tools/delegate-task/prompt-builder.d.ts +1 -0
- package/package.json +28 -15
package/dist/cli/index.js
CHANGED
|
@@ -6775,158 +6775,136 @@ var init_model_requirements = __esm(() => {
|
|
|
6775
6775
|
morpheus: {
|
|
6776
6776
|
fallbackChain: [
|
|
6777
6777
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6778
|
-
{ providers: ["
|
|
6779
|
-
{ providers: ["opencode"], model: "big-pickle" }
|
|
6778
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6780
6779
|
],
|
|
6781
6780
|
requiresAnyModel: true
|
|
6782
6781
|
},
|
|
6783
6782
|
keymaker: {
|
|
6784
6783
|
fallbackChain: [
|
|
6785
|
-
{ providers: ["
|
|
6786
|
-
{ providers: ["github-copilot"
|
|
6787
|
-
]
|
|
6788
|
-
requiresProvider: ["openai", "github-copilot", "venice", "opencode"]
|
|
6784
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6785
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6786
|
+
]
|
|
6789
6787
|
},
|
|
6790
6788
|
merovingian: {
|
|
6791
6789
|
fallbackChain: [
|
|
6792
|
-
{ providers: ["
|
|
6793
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro", variant: "high" },
|
|
6790
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6794
6791
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6795
6792
|
]
|
|
6796
6793
|
},
|
|
6797
6794
|
operator: {
|
|
6798
6795
|
fallbackChain: [
|
|
6799
|
-
{ providers: ["opencode"], model: "
|
|
6800
|
-
{ providers: ["opencode"], model: "minimax-m2.5-free" },
|
|
6796
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" },
|
|
6801
6797
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6802
6798
|
]
|
|
6803
6799
|
},
|
|
6804
6800
|
trinity: {
|
|
6805
6801
|
fallbackChain: [
|
|
6806
|
-
{ providers: ["github-copilot"], model: "
|
|
6807
|
-
{ providers: ["opencode"], model: "
|
|
6808
|
-
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
6809
|
-
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6802
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" },
|
|
6803
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6810
6804
|
]
|
|
6811
6805
|
},
|
|
6812
6806
|
construct: {
|
|
6813
6807
|
fallbackChain: [
|
|
6814
|
-
{ providers: ["
|
|
6815
|
-
{ providers: ["
|
|
6816
|
-
{ providers: ["zai-coding-plan"], model: "glm-4.6v" },
|
|
6817
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5-nano" }
|
|
6808
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6809
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6818
6810
|
]
|
|
6819
6811
|
},
|
|
6820
6812
|
oracle: {
|
|
6821
6813
|
fallbackChain: [
|
|
6822
6814
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6823
|
-
{ providers: ["
|
|
6824
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
|
|
6825
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro" }
|
|
6815
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6826
6816
|
]
|
|
6827
6817
|
},
|
|
6828
6818
|
seraph: {
|
|
6829
6819
|
fallbackChain: [
|
|
6830
6820
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6831
|
-
{ providers: ["
|
|
6832
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro", variant: "high" }
|
|
6821
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6833
6822
|
]
|
|
6834
6823
|
},
|
|
6835
6824
|
smith: {
|
|
6836
6825
|
fallbackChain: [
|
|
6837
|
-
{ providers: ["
|
|
6838
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6839
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro", variant: "high" }
|
|
6826
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6827
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6840
6828
|
]
|
|
6841
6829
|
},
|
|
6842
6830
|
architect: {
|
|
6843
6831
|
fallbackChain: [
|
|
6844
6832
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6845
|
-
{ providers: ["
|
|
6833
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" }
|
|
6846
6834
|
]
|
|
6847
6835
|
},
|
|
6848
6836
|
cipher: {
|
|
6849
6837
|
fallbackChain: [
|
|
6850
6838
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6851
|
-
{ providers: ["
|
|
6852
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
|
|
6853
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro" }
|
|
6839
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6854
6840
|
]
|
|
6855
6841
|
},
|
|
6856
6842
|
niobe: {
|
|
6857
6843
|
fallbackChain: [
|
|
6858
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-
|
|
6859
|
-
{ providers: ["
|
|
6860
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
|
|
6861
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro" }
|
|
6844
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6845
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6862
6846
|
]
|
|
6863
6847
|
},
|
|
6864
6848
|
sentinel: {
|
|
6865
6849
|
fallbackChain: [
|
|
6866
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-
|
|
6867
|
-
{ providers: ["
|
|
6868
|
-
|
|
6869
|
-
|
|
6850
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6851
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6852
|
+
]
|
|
6853
|
+
},
|
|
6854
|
+
zion: {
|
|
6855
|
+
fallbackChain: [
|
|
6856
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6857
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6870
6858
|
]
|
|
6871
6859
|
}
|
|
6872
6860
|
};
|
|
6873
6861
|
CATEGORY_MODEL_REQUIREMENTS = {
|
|
6874
6862
|
construct: {
|
|
6875
6863
|
fallbackChain: [
|
|
6876
|
-
{ providers: ["
|
|
6877
|
-
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
6864
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6878
6865
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6879
6866
|
]
|
|
6880
6867
|
},
|
|
6881
6868
|
source: {
|
|
6882
6869
|
fallbackChain: [
|
|
6883
|
-
{ providers: ["
|
|
6884
|
-
{ providers: ["
|
|
6885
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6870
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6871
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6886
6872
|
]
|
|
6887
6873
|
},
|
|
6888
6874
|
"deep-jack": {
|
|
6889
6875
|
fallbackChain: [
|
|
6890
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "medium" },
|
|
6891
6876
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6892
|
-
{ providers: ["
|
|
6893
|
-
]
|
|
6894
|
-
requiresModel: "gpt-5.3-codex"
|
|
6877
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6878
|
+
]
|
|
6895
6879
|
},
|
|
6896
6880
|
"matrix-bend": {
|
|
6897
6881
|
fallbackChain: [
|
|
6898
|
-
{ providers: ["
|
|
6899
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6900
|
-
|
|
6901
|
-
],
|
|
6902
|
-
requiresModel: "gemini-3.1-pro"
|
|
6882
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6883
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" }
|
|
6884
|
+
]
|
|
6903
6885
|
},
|
|
6904
6886
|
"bullet-time": {
|
|
6905
6887
|
fallbackChain: [
|
|
6906
|
-
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4-mini" },
|
|
6907
6888
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" },
|
|
6908
|
-
{ providers: ["
|
|
6909
|
-
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6889
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6910
6890
|
]
|
|
6911
6891
|
},
|
|
6912
6892
|
"blue-pill": {
|
|
6913
6893
|
fallbackChain: [
|
|
6914
6894
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6915
|
-
{ providers: ["
|
|
6916
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-flash" }
|
|
6895
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" }
|
|
6917
6896
|
]
|
|
6918
6897
|
},
|
|
6919
6898
|
"red-pill": {
|
|
6920
6899
|
fallbackChain: [
|
|
6921
6900
|
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
|
|
6922
|
-
{ providers: ["
|
|
6923
|
-
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3.1-pro" }
|
|
6901
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" }
|
|
6924
6902
|
]
|
|
6925
6903
|
},
|
|
6926
6904
|
broadcast: {
|
|
6927
6905
|
fallbackChain: [
|
|
6928
|
-
{ providers: ["
|
|
6929
|
-
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-
|
|
6906
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
|
|
6907
|
+
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-haiku-4-5" }
|
|
6930
6908
|
]
|
|
6931
6909
|
}
|
|
6932
6910
|
};
|
|
@@ -8268,6 +8246,462 @@ var require_src = __commonJS((exports, module) => {
|
|
|
8268
8246
|
module.exports = { cursor, scroll, erase, beep };
|
|
8269
8247
|
});
|
|
8270
8248
|
|
|
8249
|
+
// node_modules/isexe/windows.js
|
|
8250
|
+
var require_windows = __commonJS((exports, module) => {
|
|
8251
|
+
module.exports = isexe;
|
|
8252
|
+
isexe.sync = sync;
|
|
8253
|
+
var fs4 = __require("fs");
|
|
8254
|
+
function checkPathExt(path4, options) {
|
|
8255
|
+
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
|
|
8256
|
+
if (!pathext) {
|
|
8257
|
+
return true;
|
|
8258
|
+
}
|
|
8259
|
+
pathext = pathext.split(";");
|
|
8260
|
+
if (pathext.indexOf("") !== -1) {
|
|
8261
|
+
return true;
|
|
8262
|
+
}
|
|
8263
|
+
for (var i2 = 0;i2 < pathext.length; i2++) {
|
|
8264
|
+
var p2 = pathext[i2].toLowerCase();
|
|
8265
|
+
if (p2 && path4.substr(-p2.length).toLowerCase() === p2) {
|
|
8266
|
+
return true;
|
|
8267
|
+
}
|
|
8268
|
+
}
|
|
8269
|
+
return false;
|
|
8270
|
+
}
|
|
8271
|
+
function checkStat(stat, path4, options) {
|
|
8272
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
8273
|
+
return false;
|
|
8274
|
+
}
|
|
8275
|
+
return checkPathExt(path4, options);
|
|
8276
|
+
}
|
|
8277
|
+
function isexe(path4, options, cb) {
|
|
8278
|
+
fs4.stat(path4, function(er, stat) {
|
|
8279
|
+
cb(er, er ? false : checkStat(stat, path4, options));
|
|
8280
|
+
});
|
|
8281
|
+
}
|
|
8282
|
+
function sync(path4, options) {
|
|
8283
|
+
return checkStat(fs4.statSync(path4), path4, options);
|
|
8284
|
+
}
|
|
8285
|
+
});
|
|
8286
|
+
|
|
8287
|
+
// node_modules/isexe/mode.js
|
|
8288
|
+
var require_mode = __commonJS((exports, module) => {
|
|
8289
|
+
module.exports = isexe;
|
|
8290
|
+
isexe.sync = sync;
|
|
8291
|
+
var fs4 = __require("fs");
|
|
8292
|
+
function isexe(path4, options, cb) {
|
|
8293
|
+
fs4.stat(path4, function(er, stat) {
|
|
8294
|
+
cb(er, er ? false : checkStat(stat, options));
|
|
8295
|
+
});
|
|
8296
|
+
}
|
|
8297
|
+
function sync(path4, options) {
|
|
8298
|
+
return checkStat(fs4.statSync(path4), options);
|
|
8299
|
+
}
|
|
8300
|
+
function checkStat(stat, options) {
|
|
8301
|
+
return stat.isFile() && checkMode(stat, options);
|
|
8302
|
+
}
|
|
8303
|
+
function checkMode(stat, options) {
|
|
8304
|
+
var mod = stat.mode;
|
|
8305
|
+
var uid = stat.uid;
|
|
8306
|
+
var gid = stat.gid;
|
|
8307
|
+
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
8308
|
+
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
8309
|
+
var u2 = parseInt("100", 8);
|
|
8310
|
+
var g2 = parseInt("010", 8);
|
|
8311
|
+
var o2 = parseInt("001", 8);
|
|
8312
|
+
var ug = u2 | g2;
|
|
8313
|
+
var ret = mod & o2 || mod & g2 && gid === myGid || mod & u2 && uid === myUid || mod & ug && myUid === 0;
|
|
8314
|
+
return ret;
|
|
8315
|
+
}
|
|
8316
|
+
});
|
|
8317
|
+
|
|
8318
|
+
// node_modules/isexe/index.js
|
|
8319
|
+
var require_isexe = __commonJS((exports, module) => {
|
|
8320
|
+
var fs4 = __require("fs");
|
|
8321
|
+
var core3;
|
|
8322
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
8323
|
+
core3 = require_windows();
|
|
8324
|
+
} else {
|
|
8325
|
+
core3 = require_mode();
|
|
8326
|
+
}
|
|
8327
|
+
module.exports = isexe;
|
|
8328
|
+
isexe.sync = sync;
|
|
8329
|
+
function isexe(path4, options, cb) {
|
|
8330
|
+
if (typeof options === "function") {
|
|
8331
|
+
cb = options;
|
|
8332
|
+
options = {};
|
|
8333
|
+
}
|
|
8334
|
+
if (!cb) {
|
|
8335
|
+
if (typeof Promise !== "function") {
|
|
8336
|
+
throw new TypeError("callback not provided");
|
|
8337
|
+
}
|
|
8338
|
+
return new Promise(function(resolve2, reject) {
|
|
8339
|
+
isexe(path4, options || {}, function(er, is) {
|
|
8340
|
+
if (er) {
|
|
8341
|
+
reject(er);
|
|
8342
|
+
} else {
|
|
8343
|
+
resolve2(is);
|
|
8344
|
+
}
|
|
8345
|
+
});
|
|
8346
|
+
});
|
|
8347
|
+
}
|
|
8348
|
+
core3(path4, options || {}, function(er, is) {
|
|
8349
|
+
if (er) {
|
|
8350
|
+
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
8351
|
+
er = null;
|
|
8352
|
+
is = false;
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
cb(er, is);
|
|
8356
|
+
});
|
|
8357
|
+
}
|
|
8358
|
+
function sync(path4, options) {
|
|
8359
|
+
try {
|
|
8360
|
+
return core3.sync(path4, options || {});
|
|
8361
|
+
} catch (er) {
|
|
8362
|
+
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
8363
|
+
return false;
|
|
8364
|
+
} else {
|
|
8365
|
+
throw er;
|
|
8366
|
+
}
|
|
8367
|
+
}
|
|
8368
|
+
}
|
|
8369
|
+
});
|
|
8370
|
+
|
|
8371
|
+
// node_modules/which/which.js
|
|
8372
|
+
var require_which = __commonJS((exports, module) => {
|
|
8373
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
8374
|
+
var path4 = __require("path");
|
|
8375
|
+
var COLON = isWindows ? ";" : ":";
|
|
8376
|
+
var isexe = require_isexe();
|
|
8377
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
8378
|
+
var getPathInfo = (cmd, opt) => {
|
|
8379
|
+
const colon = opt.colon || COLON;
|
|
8380
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
8381
|
+
...isWindows ? [process.cwd()] : [],
|
|
8382
|
+
...(opt.path || process.env.PATH || "").split(colon)
|
|
8383
|
+
];
|
|
8384
|
+
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
8385
|
+
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
8386
|
+
if (isWindows) {
|
|
8387
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
8388
|
+
pathExt.unshift("");
|
|
8389
|
+
}
|
|
8390
|
+
return {
|
|
8391
|
+
pathEnv,
|
|
8392
|
+
pathExt,
|
|
8393
|
+
pathExtExe
|
|
8394
|
+
};
|
|
8395
|
+
};
|
|
8396
|
+
var which = (cmd, opt, cb) => {
|
|
8397
|
+
if (typeof opt === "function") {
|
|
8398
|
+
cb = opt;
|
|
8399
|
+
opt = {};
|
|
8400
|
+
}
|
|
8401
|
+
if (!opt)
|
|
8402
|
+
opt = {};
|
|
8403
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
8404
|
+
const found = [];
|
|
8405
|
+
const step = (i2) => new Promise((resolve2, reject) => {
|
|
8406
|
+
if (i2 === pathEnv.length)
|
|
8407
|
+
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
8408
|
+
const ppRaw = pathEnv[i2];
|
|
8409
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
8410
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
8411
|
+
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
8412
|
+
resolve2(subStep(p2, i2, 0));
|
|
8413
|
+
});
|
|
8414
|
+
const subStep = (p2, i2, ii) => new Promise((resolve2, reject) => {
|
|
8415
|
+
if (ii === pathExt.length)
|
|
8416
|
+
return resolve2(step(i2 + 1));
|
|
8417
|
+
const ext = pathExt[ii];
|
|
8418
|
+
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
8419
|
+
if (!er && is) {
|
|
8420
|
+
if (opt.all)
|
|
8421
|
+
found.push(p2 + ext);
|
|
8422
|
+
else
|
|
8423
|
+
return resolve2(p2 + ext);
|
|
8424
|
+
}
|
|
8425
|
+
return resolve2(subStep(p2, i2, ii + 1));
|
|
8426
|
+
});
|
|
8427
|
+
});
|
|
8428
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
8429
|
+
};
|
|
8430
|
+
var whichSync = (cmd, opt) => {
|
|
8431
|
+
opt = opt || {};
|
|
8432
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
8433
|
+
const found = [];
|
|
8434
|
+
for (let i2 = 0;i2 < pathEnv.length; i2++) {
|
|
8435
|
+
const ppRaw = pathEnv[i2];
|
|
8436
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
8437
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
8438
|
+
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
8439
|
+
for (let j2 = 0;j2 < pathExt.length; j2++) {
|
|
8440
|
+
const cur = p2 + pathExt[j2];
|
|
8441
|
+
try {
|
|
8442
|
+
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
8443
|
+
if (is) {
|
|
8444
|
+
if (opt.all)
|
|
8445
|
+
found.push(cur);
|
|
8446
|
+
else
|
|
8447
|
+
return cur;
|
|
8448
|
+
}
|
|
8449
|
+
} catch (ex) {}
|
|
8450
|
+
}
|
|
8451
|
+
}
|
|
8452
|
+
if (opt.all && found.length)
|
|
8453
|
+
return found;
|
|
8454
|
+
if (opt.nothrow)
|
|
8455
|
+
return null;
|
|
8456
|
+
throw getNotFoundError(cmd);
|
|
8457
|
+
};
|
|
8458
|
+
module.exports = which;
|
|
8459
|
+
which.sync = whichSync;
|
|
8460
|
+
});
|
|
8461
|
+
|
|
8462
|
+
// node_modules/path-key/index.js
|
|
8463
|
+
var require_path_key = __commonJS((exports, module) => {
|
|
8464
|
+
var pathKey = (options = {}) => {
|
|
8465
|
+
const environment = options.env || process.env;
|
|
8466
|
+
const platform = options.platform || process.platform;
|
|
8467
|
+
if (platform !== "win32") {
|
|
8468
|
+
return "PATH";
|
|
8469
|
+
}
|
|
8470
|
+
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
8471
|
+
};
|
|
8472
|
+
module.exports = pathKey;
|
|
8473
|
+
module.exports.default = pathKey;
|
|
8474
|
+
});
|
|
8475
|
+
|
|
8476
|
+
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
8477
|
+
var require_resolveCommand = __commonJS((exports, module) => {
|
|
8478
|
+
var path4 = __require("path");
|
|
8479
|
+
var which = require_which();
|
|
8480
|
+
var getPathKey = require_path_key();
|
|
8481
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
8482
|
+
const env = parsed.options.env || process.env;
|
|
8483
|
+
const cwd = process.cwd();
|
|
8484
|
+
const hasCustomCwd = parsed.options.cwd != null;
|
|
8485
|
+
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
8486
|
+
if (shouldSwitchCwd) {
|
|
8487
|
+
try {
|
|
8488
|
+
process.chdir(parsed.options.cwd);
|
|
8489
|
+
} catch (err) {}
|
|
8490
|
+
}
|
|
8491
|
+
let resolved;
|
|
8492
|
+
try {
|
|
8493
|
+
resolved = which.sync(parsed.command, {
|
|
8494
|
+
path: env[getPathKey({ env })],
|
|
8495
|
+
pathExt: withoutPathExt ? path4.delimiter : undefined
|
|
8496
|
+
});
|
|
8497
|
+
} catch (e2) {} finally {
|
|
8498
|
+
if (shouldSwitchCwd) {
|
|
8499
|
+
process.chdir(cwd);
|
|
8500
|
+
}
|
|
8501
|
+
}
|
|
8502
|
+
if (resolved) {
|
|
8503
|
+
resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
8504
|
+
}
|
|
8505
|
+
return resolved;
|
|
8506
|
+
}
|
|
8507
|
+
function resolveCommand(parsed) {
|
|
8508
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
8509
|
+
}
|
|
8510
|
+
module.exports = resolveCommand;
|
|
8511
|
+
});
|
|
8512
|
+
|
|
8513
|
+
// node_modules/cross-spawn/lib/util/escape.js
|
|
8514
|
+
var require_escape = __commonJS((exports, module) => {
|
|
8515
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
8516
|
+
function escapeCommand(arg) {
|
|
8517
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
8518
|
+
return arg;
|
|
8519
|
+
}
|
|
8520
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
8521
|
+
arg = `${arg}`;
|
|
8522
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
8523
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
8524
|
+
arg = `"${arg}"`;
|
|
8525
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
8526
|
+
if (doubleEscapeMetaChars) {
|
|
8527
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
8528
|
+
}
|
|
8529
|
+
return arg;
|
|
8530
|
+
}
|
|
8531
|
+
exports.command = escapeCommand;
|
|
8532
|
+
exports.argument = escapeArgument;
|
|
8533
|
+
});
|
|
8534
|
+
|
|
8535
|
+
// node_modules/shebang-regex/index.js
|
|
8536
|
+
var require_shebang_regex = __commonJS((exports, module) => {
|
|
8537
|
+
module.exports = /^#!(.*)/;
|
|
8538
|
+
});
|
|
8539
|
+
|
|
8540
|
+
// node_modules/shebang-command/index.js
|
|
8541
|
+
var require_shebang_command = __commonJS((exports, module) => {
|
|
8542
|
+
var shebangRegex = require_shebang_regex();
|
|
8543
|
+
module.exports = (string4 = "") => {
|
|
8544
|
+
const match = string4.match(shebangRegex);
|
|
8545
|
+
if (!match) {
|
|
8546
|
+
return null;
|
|
8547
|
+
}
|
|
8548
|
+
const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
8549
|
+
const binary2 = path4.split("/").pop();
|
|
8550
|
+
if (binary2 === "env") {
|
|
8551
|
+
return argument;
|
|
8552
|
+
}
|
|
8553
|
+
return argument ? `${binary2} ${argument}` : binary2;
|
|
8554
|
+
};
|
|
8555
|
+
});
|
|
8556
|
+
|
|
8557
|
+
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
8558
|
+
var require_readShebang = __commonJS((exports, module) => {
|
|
8559
|
+
var fs4 = __require("fs");
|
|
8560
|
+
var shebangCommand = require_shebang_command();
|
|
8561
|
+
function readShebang(command) {
|
|
8562
|
+
const size = 150;
|
|
8563
|
+
const buffer = Buffer.alloc(size);
|
|
8564
|
+
let fd;
|
|
8565
|
+
try {
|
|
8566
|
+
fd = fs4.openSync(command, "r");
|
|
8567
|
+
fs4.readSync(fd, buffer, 0, size, 0);
|
|
8568
|
+
fs4.closeSync(fd);
|
|
8569
|
+
} catch (e2) {}
|
|
8570
|
+
return shebangCommand(buffer.toString());
|
|
8571
|
+
}
|
|
8572
|
+
module.exports = readShebang;
|
|
8573
|
+
});
|
|
8574
|
+
|
|
8575
|
+
// node_modules/cross-spawn/lib/parse.js
|
|
8576
|
+
var require_parse = __commonJS((exports, module) => {
|
|
8577
|
+
var path4 = __require("path");
|
|
8578
|
+
var resolveCommand = require_resolveCommand();
|
|
8579
|
+
var escape = require_escape();
|
|
8580
|
+
var readShebang = require_readShebang();
|
|
8581
|
+
var isWin = process.platform === "win32";
|
|
8582
|
+
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
8583
|
+
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
8584
|
+
function detectShebang(parsed) {
|
|
8585
|
+
parsed.file = resolveCommand(parsed);
|
|
8586
|
+
const shebang = parsed.file && readShebang(parsed.file);
|
|
8587
|
+
if (shebang) {
|
|
8588
|
+
parsed.args.unshift(parsed.file);
|
|
8589
|
+
parsed.command = shebang;
|
|
8590
|
+
return resolveCommand(parsed);
|
|
8591
|
+
}
|
|
8592
|
+
return parsed.file;
|
|
8593
|
+
}
|
|
8594
|
+
function parseNonShell(parsed) {
|
|
8595
|
+
if (!isWin) {
|
|
8596
|
+
return parsed;
|
|
8597
|
+
}
|
|
8598
|
+
const commandFile = detectShebang(parsed);
|
|
8599
|
+
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
8600
|
+
if (parsed.options.forceShell || needsShell) {
|
|
8601
|
+
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
8602
|
+
parsed.command = path4.normalize(parsed.command);
|
|
8603
|
+
parsed.command = escape.command(parsed.command);
|
|
8604
|
+
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
8605
|
+
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
8606
|
+
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
8607
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
8608
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
8609
|
+
}
|
|
8610
|
+
return parsed;
|
|
8611
|
+
}
|
|
8612
|
+
function parse7(command, args, options) {
|
|
8613
|
+
if (args && !Array.isArray(args)) {
|
|
8614
|
+
options = args;
|
|
8615
|
+
args = null;
|
|
8616
|
+
}
|
|
8617
|
+
args = args ? args.slice(0) : [];
|
|
8618
|
+
options = Object.assign({}, options);
|
|
8619
|
+
const parsed = {
|
|
8620
|
+
command,
|
|
8621
|
+
args,
|
|
8622
|
+
options,
|
|
8623
|
+
file: undefined,
|
|
8624
|
+
original: {
|
|
8625
|
+
command,
|
|
8626
|
+
args
|
|
8627
|
+
}
|
|
8628
|
+
};
|
|
8629
|
+
return options.shell ? parsed : parseNonShell(parsed);
|
|
8630
|
+
}
|
|
8631
|
+
module.exports = parse7;
|
|
8632
|
+
});
|
|
8633
|
+
|
|
8634
|
+
// node_modules/cross-spawn/lib/enoent.js
|
|
8635
|
+
var require_enoent = __commonJS((exports, module) => {
|
|
8636
|
+
var isWin = process.platform === "win32";
|
|
8637
|
+
function notFoundError(original, syscall) {
|
|
8638
|
+
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
8639
|
+
code: "ENOENT",
|
|
8640
|
+
errno: "ENOENT",
|
|
8641
|
+
syscall: `${syscall} ${original.command}`,
|
|
8642
|
+
path: original.command,
|
|
8643
|
+
spawnargs: original.args
|
|
8644
|
+
});
|
|
8645
|
+
}
|
|
8646
|
+
function hookChildProcess(cp, parsed) {
|
|
8647
|
+
if (!isWin) {
|
|
8648
|
+
return;
|
|
8649
|
+
}
|
|
8650
|
+
const originalEmit = cp.emit;
|
|
8651
|
+
cp.emit = function(name, arg1) {
|
|
8652
|
+
if (name === "exit") {
|
|
8653
|
+
const err = verifyENOENT(arg1, parsed);
|
|
8654
|
+
if (err) {
|
|
8655
|
+
return originalEmit.call(cp, "error", err);
|
|
8656
|
+
}
|
|
8657
|
+
}
|
|
8658
|
+
return originalEmit.apply(cp, arguments);
|
|
8659
|
+
};
|
|
8660
|
+
}
|
|
8661
|
+
function verifyENOENT(status, parsed) {
|
|
8662
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
8663
|
+
return notFoundError(parsed.original, "spawn");
|
|
8664
|
+
}
|
|
8665
|
+
return null;
|
|
8666
|
+
}
|
|
8667
|
+
function verifyENOENTSync(status, parsed) {
|
|
8668
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
8669
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
8670
|
+
}
|
|
8671
|
+
return null;
|
|
8672
|
+
}
|
|
8673
|
+
module.exports = {
|
|
8674
|
+
hookChildProcess,
|
|
8675
|
+
verifyENOENT,
|
|
8676
|
+
verifyENOENTSync,
|
|
8677
|
+
notFoundError
|
|
8678
|
+
};
|
|
8679
|
+
});
|
|
8680
|
+
|
|
8681
|
+
// node_modules/cross-spawn/index.js
|
|
8682
|
+
var require_cross_spawn = __commonJS((exports, module) => {
|
|
8683
|
+
var cp = __require("child_process");
|
|
8684
|
+
var parse7 = require_parse();
|
|
8685
|
+
var enoent = require_enoent();
|
|
8686
|
+
function spawn(command, args, options) {
|
|
8687
|
+
const parsed = parse7(command, args, options);
|
|
8688
|
+
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
8689
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
8690
|
+
return spawned;
|
|
8691
|
+
}
|
|
8692
|
+
function spawnSync(command, args, options) {
|
|
8693
|
+
const parsed = parse7(command, args, options);
|
|
8694
|
+
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
8695
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
8696
|
+
return result;
|
|
8697
|
+
}
|
|
8698
|
+
module.exports = spawn;
|
|
8699
|
+
module.exports.spawn = spawn;
|
|
8700
|
+
module.exports.sync = spawnSync;
|
|
8701
|
+
module.exports._parse = parse7;
|
|
8702
|
+
module.exports._enoent = enoent;
|
|
8703
|
+
});
|
|
8704
|
+
|
|
8271
8705
|
// src/hooks/auto-update-checker/constants.ts
|
|
8272
8706
|
import * as path4 from "path";
|
|
8273
8707
|
import * as os3 from "os";
|
|
@@ -9040,7 +9474,7 @@ var {
|
|
|
9040
9474
|
// package.json
|
|
9041
9475
|
var package_default = {
|
|
9042
9476
|
name: "opencode-matrixx",
|
|
9043
|
-
version: "1.0
|
|
9477
|
+
version: "1.1.0",
|
|
9044
9478
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
9045
9479
|
main: "dist/index.js",
|
|
9046
9480
|
types: "dist/index.d.ts",
|
|
@@ -9073,12 +9507,25 @@ var package_default = {
|
|
|
9073
9507
|
},
|
|
9074
9508
|
keywords: [
|
|
9075
9509
|
"opencode",
|
|
9076
|
-
"plugin",
|
|
9077
|
-
"
|
|
9078
|
-
"
|
|
9079
|
-
"
|
|
9510
|
+
"opencode-plugin",
|
|
9511
|
+
"claude",
|
|
9512
|
+
"claude-code",
|
|
9513
|
+
"anthropic",
|
|
9514
|
+
"openai",
|
|
9515
|
+
"gemini",
|
|
9080
9516
|
"ai",
|
|
9081
|
-
"llm"
|
|
9517
|
+
"llm",
|
|
9518
|
+
"multi-agent",
|
|
9519
|
+
"agent-orchestration",
|
|
9520
|
+
"coding-assistant",
|
|
9521
|
+
"ai-coding",
|
|
9522
|
+
"vibe-coding",
|
|
9523
|
+
"agentic",
|
|
9524
|
+
"autonomous-agents",
|
|
9525
|
+
"developer-tools",
|
|
9526
|
+
"typescript",
|
|
9527
|
+
"plugin",
|
|
9528
|
+
"cli"
|
|
9082
9529
|
],
|
|
9083
9530
|
author: "YeonGyu-Kim",
|
|
9084
9531
|
license: "SUL-1.0",
|
|
@@ -9096,8 +9543,8 @@ var package_default = {
|
|
|
9096
9543
|
"@clack/prompts": "^0.11.0",
|
|
9097
9544
|
"@code-yeongyu/comment-checker": "^0.6.1",
|
|
9098
9545
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
9099
|
-
"@opencode-ai/plugin": "
|
|
9100
|
-
"@opencode-ai/sdk": "
|
|
9546
|
+
"@opencode-ai/plugin": "1.3.15",
|
|
9547
|
+
"@opencode-ai/sdk": "1.3.15",
|
|
9101
9548
|
commander: "^14.0.2",
|
|
9102
9549
|
"detect-libc": "^2.0.0",
|
|
9103
9550
|
"js-yaml": "^4.1.1",
|
|
@@ -9115,13 +9562,13 @@ var package_default = {
|
|
|
9115
9562
|
typescript: "^5.7.3"
|
|
9116
9563
|
},
|
|
9117
9564
|
optionalDependencies: {
|
|
9118
|
-
"opencode-matrixx-darwin-arm64": "1.0
|
|
9119
|
-
"opencode-matrixx-darwin-x64": "1.0
|
|
9120
|
-
"opencode-matrixx-linux-arm64": "1.0
|
|
9121
|
-
"opencode-matrixx-linux-arm64-musl": "1.0
|
|
9122
|
-
"opencode-matrixx-linux-x64": "1.0
|
|
9123
|
-
"opencode-matrixx-linux-x64-musl": "1.0
|
|
9124
|
-
"opencode-matrixx-windows-x64": "1.0
|
|
9565
|
+
"opencode-matrixx-darwin-arm64": "1.1.0",
|
|
9566
|
+
"opencode-matrixx-darwin-x64": "1.1.0",
|
|
9567
|
+
"opencode-matrixx-linux-arm64": "1.1.0",
|
|
9568
|
+
"opencode-matrixx-linux-arm64-musl": "1.1.0",
|
|
9569
|
+
"opencode-matrixx-linux-x64": "1.1.0",
|
|
9570
|
+
"opencode-matrixx-linux-x64-musl": "1.1.0",
|
|
9571
|
+
"opencode-matrixx-windows-x64": "1.1.0"
|
|
9125
9572
|
},
|
|
9126
9573
|
trustedDependencies: [
|
|
9127
9574
|
"@ast-grep/cli",
|
|
@@ -10504,92 +10951,86 @@ import * as path3 from "path";
|
|
|
10504
10951
|
|
|
10505
10952
|
// src/config/profiles.ts
|
|
10506
10953
|
var PROFILE_NAMES = ["budget", "economy", "balanced", "performance"];
|
|
10507
|
-
var OPUS = "
|
|
10508
|
-
var SONNET = "
|
|
10509
|
-
var HAIKU = "
|
|
10510
|
-
var GEMINI_PRO = "google-vertex/gemini-3.1-pro-preview";
|
|
10511
|
-
var GEMINI_FLASH = "google-vertex/gemini-3-flash-preview";
|
|
10512
|
-
var GEMINI_FAST = "google-vertex/gemini-2.5-flash";
|
|
10954
|
+
var OPUS = "anthropic/claude-opus-4-6";
|
|
10955
|
+
var SONNET = "anthropic/claude-sonnet-4-6";
|
|
10956
|
+
var HAIKU = "anthropic/claude-haiku-4-5";
|
|
10513
10957
|
var PROFILES = {
|
|
10514
10958
|
budget: {
|
|
10515
10959
|
agents: {
|
|
10516
10960
|
morpheus: { model: SONNET },
|
|
10517
|
-
oracle: { model: GEMINI_PRO },
|
|
10518
|
-
cipher: { model: GEMINI_PRO },
|
|
10519
|
-
niobe: { model: GEMINI_PRO },
|
|
10520
|
-
sentinel: { model: GEMINI_PRO },
|
|
10521
|
-
seraph: { model: GEMINI_PRO },
|
|
10522
|
-
merovingian: { model: GEMINI_PRO },
|
|
10523
|
-
smith: { model: GEMINI_PRO },
|
|
10524
|
-
architect: { model: GEMINI_FAST },
|
|
10525
|
-
construct: { model: GEMINI_FAST },
|
|
10526
|
-
trinity: { model: GEMINI_FAST },
|
|
10527
|
-
operator: { model: GEMINI_FAST }
|
|
10528
|
-
},
|
|
10529
|
-
categories: {
|
|
10530
|
-
source: { model: GEMINI_PRO },
|
|
10531
|
-
"dsl-engineering": { model: GEMINI_PRO },
|
|
10532
|
-
"deep-jack": { model: GEMINI_FAST },
|
|
10533
|
-
"matrix-bend": { model: GEMINI_FAST },
|
|
10534
|
-
construct: { model: GEMINI_FAST },
|
|
10535
|
-
"red-pill": { model: GEMINI_FAST },
|
|
10536
|
-
"blue-pill": { model: GEMINI_FAST },
|
|
10537
|
-
broadcast: { model: GEMINI_FAST },
|
|
10538
|
-
"bullet-time": { model: GEMINI_FAST }
|
|
10539
|
-
}
|
|
10540
|
-
},
|
|
10541
|
-
economy: {
|
|
10542
|
-
agents: {
|
|
10543
|
-
morpheus: { model: HAIKU },
|
|
10544
10961
|
oracle: { model: HAIKU },
|
|
10545
10962
|
cipher: { model: HAIKU },
|
|
10546
10963
|
niobe: { model: HAIKU },
|
|
10547
10964
|
sentinel: { model: HAIKU },
|
|
10548
10965
|
seraph: { model: HAIKU },
|
|
10549
|
-
merovingian: { model:
|
|
10550
|
-
smith: { model:
|
|
10551
|
-
architect: { model:
|
|
10552
|
-
construct: { model:
|
|
10553
|
-
trinity: { model:
|
|
10554
|
-
operator: { model:
|
|
10966
|
+
merovingian: { model: HAIKU },
|
|
10967
|
+
smith: { model: HAIKU },
|
|
10968
|
+
architect: { model: HAIKU },
|
|
10969
|
+
construct: { model: HAIKU },
|
|
10970
|
+
trinity: { model: HAIKU },
|
|
10971
|
+
operator: { model: HAIKU }
|
|
10555
10972
|
},
|
|
10556
10973
|
categories: {
|
|
10557
|
-
source: { model:
|
|
10558
|
-
"
|
|
10559
|
-
"
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
"red-pill": { model: GEMINI_PRO },
|
|
10974
|
+
source: { model: SONNET },
|
|
10975
|
+
"deep-jack": { model: HAIKU },
|
|
10976
|
+
"matrix-bend": { model: HAIKU },
|
|
10977
|
+
construct: { model: HAIKU },
|
|
10978
|
+
"red-pill": { model: SONNET },
|
|
10563
10979
|
"blue-pill": { model: HAIKU },
|
|
10564
|
-
broadcast: { model:
|
|
10565
|
-
"bullet-time": { model:
|
|
10980
|
+
broadcast: { model: HAIKU },
|
|
10981
|
+
"bullet-time": { model: HAIKU }
|
|
10566
10982
|
}
|
|
10567
10983
|
},
|
|
10568
|
-
|
|
10984
|
+
economy: {
|
|
10569
10985
|
agents: {
|
|
10570
|
-
morpheus: { model:
|
|
10986
|
+
morpheus: { model: SONNET },
|
|
10571
10987
|
oracle: { model: SONNET },
|
|
10572
10988
|
cipher: { model: SONNET },
|
|
10573
10989
|
niobe: { model: SONNET },
|
|
10574
10990
|
sentinel: { model: SONNET },
|
|
10575
10991
|
seraph: { model: SONNET },
|
|
10576
|
-
merovingian: { model:
|
|
10577
|
-
smith: { model:
|
|
10578
|
-
architect: { model:
|
|
10579
|
-
construct: { model:
|
|
10580
|
-
trinity: { model:
|
|
10581
|
-
operator: { model:
|
|
10992
|
+
merovingian: { model: SONNET },
|
|
10993
|
+
smith: { model: SONNET },
|
|
10994
|
+
architect: { model: HAIKU },
|
|
10995
|
+
construct: { model: HAIKU },
|
|
10996
|
+
trinity: { model: HAIKU },
|
|
10997
|
+
operator: { model: HAIKU }
|
|
10582
10998
|
},
|
|
10583
10999
|
categories: {
|
|
10584
11000
|
source: { model: SONNET },
|
|
10585
|
-
"
|
|
10586
|
-
"
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
"red-pill": { model: GEMINI_PRO },
|
|
11001
|
+
"deep-jack": { model: SONNET },
|
|
11002
|
+
"matrix-bend": { model: SONNET },
|
|
11003
|
+
construct: { model: SONNET },
|
|
11004
|
+
"red-pill": { model: SONNET },
|
|
10590
11005
|
"blue-pill": { model: SONNET },
|
|
10591
|
-
broadcast: { model:
|
|
10592
|
-
"bullet-time": { model:
|
|
11006
|
+
broadcast: { model: HAIKU },
|
|
11007
|
+
"bullet-time": { model: HAIKU }
|
|
11008
|
+
}
|
|
11009
|
+
},
|
|
11010
|
+
balanced: {
|
|
11011
|
+
agents: {
|
|
11012
|
+
morpheus: { model: OPUS },
|
|
11013
|
+
oracle: { model: SONNET },
|
|
11014
|
+
cipher: { model: SONNET },
|
|
11015
|
+
niobe: { model: SONNET },
|
|
11016
|
+
sentinel: { model: SONNET },
|
|
11017
|
+
seraph: { model: OPUS },
|
|
11018
|
+
merovingian: { model: SONNET },
|
|
11019
|
+
smith: { model: SONNET },
|
|
11020
|
+
architect: { model: SONNET },
|
|
11021
|
+
construct: { model: SONNET },
|
|
11022
|
+
trinity: { model: HAIKU },
|
|
11023
|
+
operator: { model: HAIKU }
|
|
11024
|
+
},
|
|
11025
|
+
categories: {
|
|
11026
|
+
source: { model: OPUS },
|
|
11027
|
+
"deep-jack": { model: SONNET },
|
|
11028
|
+
"matrix-bend": { model: SONNET },
|
|
11029
|
+
construct: { model: SONNET },
|
|
11030
|
+
"red-pill": { model: OPUS },
|
|
11031
|
+
"blue-pill": { model: SONNET },
|
|
11032
|
+
broadcast: { model: SONNET },
|
|
11033
|
+
"bullet-time": { model: HAIKU }
|
|
10593
11034
|
}
|
|
10594
11035
|
},
|
|
10595
11036
|
performance: {
|
|
@@ -10599,24 +11040,23 @@ var PROFILES = {
|
|
|
10599
11040
|
cipher: { model: OPUS },
|
|
10600
11041
|
niobe: { model: OPUS },
|
|
10601
11042
|
sentinel: { model: OPUS },
|
|
10602
|
-
seraph: { model:
|
|
10603
|
-
merovingian: { model:
|
|
10604
|
-
smith: { model:
|
|
10605
|
-
architect: { model:
|
|
10606
|
-
construct: { model:
|
|
10607
|
-
trinity: { model:
|
|
10608
|
-
operator: { model:
|
|
11043
|
+
seraph: { model: OPUS },
|
|
11044
|
+
merovingian: { model: SONNET },
|
|
11045
|
+
smith: { model: SONNET },
|
|
11046
|
+
architect: { model: SONNET },
|
|
11047
|
+
construct: { model: SONNET },
|
|
11048
|
+
trinity: { model: HAIKU },
|
|
11049
|
+
operator: { model: SONNET }
|
|
10609
11050
|
},
|
|
10610
11051
|
categories: {
|
|
10611
11052
|
source: { model: OPUS },
|
|
10612
|
-
"
|
|
10613
|
-
"
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
"red-pill": { model: GEMINI_PRO },
|
|
11053
|
+
"deep-jack": { model: OPUS },
|
|
11054
|
+
"matrix-bend": { model: OPUS },
|
|
11055
|
+
construct: { model: OPUS },
|
|
11056
|
+
"red-pill": { model: OPUS },
|
|
10617
11057
|
"blue-pill": { model: SONNET },
|
|
10618
|
-
broadcast: { model:
|
|
10619
|
-
"bullet-time": { model:
|
|
11058
|
+
broadcast: { model: SONNET },
|
|
11059
|
+
"bullet-time": { model: HAIKU }
|
|
10620
11060
|
}
|
|
10621
11061
|
}
|
|
10622
11062
|
};
|
|
@@ -22952,7 +23392,8 @@ var BuiltinAgentNameSchema = exports_external.enum([
|
|
|
22952
23392
|
"architect",
|
|
22953
23393
|
"cipher",
|
|
22954
23394
|
"niobe",
|
|
22955
|
-
"sentinel"
|
|
23395
|
+
"sentinel",
|
|
23396
|
+
"zion"
|
|
22956
23397
|
]);
|
|
22957
23398
|
var BuiltinSkillNameSchema = exports_external.enum([
|
|
22958
23399
|
"playwright",
|
|
@@ -22991,7 +23432,11 @@ var BuiltinSkillNameSchema = exports_external.enum([
|
|
|
22991
23432
|
"security-api",
|
|
22992
23433
|
"security-crypto",
|
|
22993
23434
|
"security-infra",
|
|
22994
|
-
"security-review"
|
|
23435
|
+
"security-review",
|
|
23436
|
+
"crypto-market-analysis",
|
|
23437
|
+
"crypto-trading",
|
|
23438
|
+
"crypto-onchain",
|
|
23439
|
+
"tdd-enforcer"
|
|
22995
23440
|
]);
|
|
22996
23441
|
var OverridableAgentNameSchema = exports_external.enum([
|
|
22997
23442
|
"build",
|
|
@@ -23010,7 +23455,8 @@ var OverridableAgentNameSchema = exports_external.enum([
|
|
|
23010
23455
|
"architect",
|
|
23011
23456
|
"cipher",
|
|
23012
23457
|
"niobe",
|
|
23013
|
-
"sentinel"
|
|
23458
|
+
"sentinel",
|
|
23459
|
+
"zion"
|
|
23014
23460
|
]);
|
|
23015
23461
|
// src/config/schema/internal/permission.ts
|
|
23016
23462
|
var PermissionValueSchema = exports_external.enum(["ask", "allow", "deny"]);
|
|
@@ -23122,7 +23568,8 @@ var CategoryConfigSchema = exports_external.object({
|
|
|
23122
23568
|
tools: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
|
|
23123
23569
|
prompt_append: exports_external.string().optional(),
|
|
23124
23570
|
is_unstable_agent: exports_external.boolean().optional(),
|
|
23125
|
-
disable: exports_external.boolean().optional()
|
|
23571
|
+
disable: exports_external.boolean().optional(),
|
|
23572
|
+
fallback_models: exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).optional()
|
|
23126
23573
|
});
|
|
23127
23574
|
var BuiltinCategoryNameSchema = exports_external.enum([
|
|
23128
23575
|
"construct",
|
|
@@ -23207,6 +23654,10 @@ var GitMasterConfigSchema = exports_external.object({
|
|
|
23207
23654
|
commit_footer: exports_external.union([exports_external.boolean(), exports_external.string()]).default(false),
|
|
23208
23655
|
include_co_authored_by: exports_external.boolean().default(false)
|
|
23209
23656
|
});
|
|
23657
|
+
// src/config/schema/tdd-enforcer.ts
|
|
23658
|
+
var TddEnforcerConfigSchema = exports_external.object({
|
|
23659
|
+
enabled: exports_external.boolean().default(false)
|
|
23660
|
+
});
|
|
23210
23661
|
// src/config/schema/hooks.ts
|
|
23211
23662
|
var HookNameSchema = exports_external.enum([
|
|
23212
23663
|
"todo-continuation-enforcer",
|
|
@@ -23255,7 +23706,13 @@ var HookNameSchema = exports_external.enum([
|
|
|
23255
23706
|
"secret-leak-guard",
|
|
23256
23707
|
"env-file-write-guard",
|
|
23257
23708
|
"json-error-recovery",
|
|
23258
|
-
"bash-file-read-guard"
|
|
23709
|
+
"bash-file-read-guard",
|
|
23710
|
+
"todo-description-override",
|
|
23711
|
+
"runtime-fallback",
|
|
23712
|
+
"read-image-resizer",
|
|
23713
|
+
"webfetch-redirect-guard",
|
|
23714
|
+
"hashline-edit-diff-enhancer",
|
|
23715
|
+
"tool-pair-validator"
|
|
23259
23716
|
]);
|
|
23260
23717
|
// src/config/schema/notification.ts
|
|
23261
23718
|
var NotificationConfigSchema = exports_external.object({
|
|
@@ -23383,6 +23840,28 @@ var WebsearchConfigSchema = exports_external.object({
|
|
|
23383
23840
|
provider: WebsearchProviderSchema.optional()
|
|
23384
23841
|
});
|
|
23385
23842
|
|
|
23843
|
+
// src/config/schema/runtime-fallback.ts
|
|
23844
|
+
var RuntimeFallbackConfigSchema = exports_external.object({
|
|
23845
|
+
enabled: exports_external.boolean().optional().default(false),
|
|
23846
|
+
retry_on_errors: exports_external.array(exports_external.number()).optional().default([429, 500, 502, 503, 504]),
|
|
23847
|
+
max_fallback_attempts: exports_external.number().optional().default(3),
|
|
23848
|
+
cooldown_seconds: exports_external.number().optional().default(60),
|
|
23849
|
+
timeout_seconds: exports_external.number().optional().default(30),
|
|
23850
|
+
notify_on_fallback: exports_external.boolean().optional().default(true)
|
|
23851
|
+
});
|
|
23852
|
+
|
|
23853
|
+
// src/config/schema/agent-definitions.ts
|
|
23854
|
+
var AgentDefinitionPathSchema = exports_external.string().min(1);
|
|
23855
|
+
var AgentDefinitionsConfigSchema = exports_external.array(AgentDefinitionPathSchema).optional();
|
|
23856
|
+
|
|
23857
|
+
// src/config/schema/model-capabilities.ts
|
|
23858
|
+
var ModelCapabilitiesConfigSchema = exports_external.object({
|
|
23859
|
+
enabled: exports_external.boolean().optional(),
|
|
23860
|
+
auto_refresh_on_start: exports_external.boolean().optional(),
|
|
23861
|
+
refresh_timeout_ms: exports_external.number().int().positive().optional(),
|
|
23862
|
+
source_url: exports_external.string().url().optional()
|
|
23863
|
+
});
|
|
23864
|
+
|
|
23386
23865
|
// src/config/schema/matrixx-config.ts
|
|
23387
23866
|
var MatrixxConfigSchema = exports_external.object({
|
|
23388
23867
|
$schema: exports_external.string().optional(),
|
|
@@ -23408,11 +23887,15 @@ var MatrixxConfigSchema = exports_external.object({
|
|
|
23408
23887
|
notification: NotificationConfigSchema.optional(),
|
|
23409
23888
|
babysitting: BabysittingConfigSchema.optional(),
|
|
23410
23889
|
git_master: GitMasterConfigSchema.optional(),
|
|
23890
|
+
tdd_enforcer: TddEnforcerConfigSchema.optional(),
|
|
23411
23891
|
browser_automation_engine: BrowserAutomationConfigSchema.optional(),
|
|
23412
23892
|
websearch: WebsearchConfigSchema.optional(),
|
|
23413
23893
|
tmux: TmuxConfigSchema.optional(),
|
|
23414
23894
|
morpheus: MorpheusConfigSchema.optional(),
|
|
23415
23895
|
security: SecurityConfigSchema.optional(),
|
|
23896
|
+
runtime_fallback: RuntimeFallbackConfigSchema.optional(),
|
|
23897
|
+
agent_definitions: AgentDefinitionsConfigSchema.optional(),
|
|
23898
|
+
model_capabilities: ModelCapabilitiesConfigSchema.optional(),
|
|
23416
23899
|
_migrations: exports_external.array(exports_external.string()).optional()
|
|
23417
23900
|
});
|
|
23418
23901
|
// src/plugin-config.ts
|
|
@@ -24889,6 +25372,31 @@ class OpencodeClient extends _HeyApiClient {
|
|
|
24889
25372
|
}
|
|
24890
25373
|
|
|
24891
25374
|
// node_modules/@opencode-ai/sdk/dist/client.js
|
|
25375
|
+
function pick2(value, fallback) {
|
|
25376
|
+
if (!value)
|
|
25377
|
+
return;
|
|
25378
|
+
if (!fallback)
|
|
25379
|
+
return value;
|
|
25380
|
+
if (value === fallback)
|
|
25381
|
+
return fallback;
|
|
25382
|
+
if (value === encodeURIComponent(fallback))
|
|
25383
|
+
return fallback;
|
|
25384
|
+
return value;
|
|
25385
|
+
}
|
|
25386
|
+
function rewrite(request, directory) {
|
|
25387
|
+
if (request.method !== "GET" && request.method !== "HEAD")
|
|
25388
|
+
return request;
|
|
25389
|
+
const value = pick2(request.headers.get("x-opencode-directory"), directory);
|
|
25390
|
+
if (!value)
|
|
25391
|
+
return request;
|
|
25392
|
+
const url2 = new URL(request.url);
|
|
25393
|
+
if (!url2.searchParams.has("directory")) {
|
|
25394
|
+
url2.searchParams.set("directory", value);
|
|
25395
|
+
}
|
|
25396
|
+
const next = new Request(url2, request);
|
|
25397
|
+
next.headers.delete("x-opencode-directory");
|
|
25398
|
+
return next;
|
|
25399
|
+
}
|
|
24892
25400
|
function createOpencodeClient(config2) {
|
|
24893
25401
|
if (!config2?.fetch) {
|
|
24894
25402
|
const customFetch = (req) => {
|
|
@@ -24903,14 +25411,50 @@ function createOpencodeClient(config2) {
|
|
|
24903
25411
|
if (config2?.directory) {
|
|
24904
25412
|
config2.headers = {
|
|
24905
25413
|
...config2.headers,
|
|
24906
|
-
"x-opencode-directory": config2.directory
|
|
25414
|
+
"x-opencode-directory": encodeURIComponent(config2.directory)
|
|
24907
25415
|
};
|
|
24908
25416
|
}
|
|
24909
25417
|
const client2 = createClient(config2);
|
|
25418
|
+
client2.interceptors.request.use((request) => rewrite(request, config2?.directory));
|
|
24910
25419
|
return new OpencodeClient({ client: client2 });
|
|
24911
25420
|
}
|
|
24912
25421
|
// node_modules/@opencode-ai/sdk/dist/server.js
|
|
24913
|
-
|
|
25422
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
25423
|
+
|
|
25424
|
+
// node_modules/@opencode-ai/sdk/dist/process.js
|
|
25425
|
+
import { spawnSync } from "child_process";
|
|
25426
|
+
function stop(proc) {
|
|
25427
|
+
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
25428
|
+
return;
|
|
25429
|
+
if (process.platform === "win32" && proc.pid) {
|
|
25430
|
+
const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
|
|
25431
|
+
if (!out.error && out.status === 0)
|
|
25432
|
+
return;
|
|
25433
|
+
}
|
|
25434
|
+
proc.kill();
|
|
25435
|
+
}
|
|
25436
|
+
function bindAbort(proc, signal, onAbort) {
|
|
25437
|
+
if (!signal)
|
|
25438
|
+
return () => {};
|
|
25439
|
+
const abort = () => {
|
|
25440
|
+
clear();
|
|
25441
|
+
stop(proc);
|
|
25442
|
+
onAbort?.();
|
|
25443
|
+
};
|
|
25444
|
+
const clear = () => {
|
|
25445
|
+
signal.removeEventListener("abort", abort);
|
|
25446
|
+
proc.off("exit", clear);
|
|
25447
|
+
proc.off("error", clear);
|
|
25448
|
+
};
|
|
25449
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
25450
|
+
proc.on("exit", clear);
|
|
25451
|
+
proc.on("error", clear);
|
|
25452
|
+
if (signal.aborted)
|
|
25453
|
+
abort();
|
|
25454
|
+
return clear;
|
|
25455
|
+
}
|
|
25456
|
+
|
|
25457
|
+
// node_modules/@opencode-ai/sdk/dist/server.js
|
|
24914
25458
|
async function createOpencodeServer(options) {
|
|
24915
25459
|
options = Object.assign({
|
|
24916
25460
|
hostname: "127.0.0.1",
|
|
@@ -24920,19 +25464,24 @@ async function createOpencodeServer(options) {
|
|
|
24920
25464
|
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
|
|
24921
25465
|
if (options.config?.logLevel)
|
|
24922
25466
|
args.push(`--log-level=${options.config.logLevel}`);
|
|
24923
|
-
const proc =
|
|
24924
|
-
signal: options.signal,
|
|
25467
|
+
const proc = import_cross_spawn.default(`opencode`, args, {
|
|
24925
25468
|
env: {
|
|
24926
25469
|
...process.env,
|
|
24927
25470
|
OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {})
|
|
24928
25471
|
}
|
|
24929
25472
|
});
|
|
25473
|
+
let clear = () => {};
|
|
24930
25474
|
const url2 = await new Promise((resolve2, reject) => {
|
|
24931
25475
|
const id = setTimeout(() => {
|
|
25476
|
+
clear();
|
|
25477
|
+
stop(proc);
|
|
24932
25478
|
reject(new Error(`Timeout waiting for server to start after ${options.timeout}ms`));
|
|
24933
25479
|
}, options.timeout);
|
|
24934
25480
|
let output = "";
|
|
25481
|
+
let resolved = false;
|
|
24935
25482
|
proc.stdout?.on("data", (chunk) => {
|
|
25483
|
+
if (resolved)
|
|
25484
|
+
return;
|
|
24936
25485
|
output += chunk.toString();
|
|
24937
25486
|
const lines = output.split(`
|
|
24938
25487
|
`);
|
|
@@ -24940,9 +25489,14 @@ async function createOpencodeServer(options) {
|
|
|
24940
25489
|
if (line.startsWith("opencode server listening")) {
|
|
24941
25490
|
const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
|
|
24942
25491
|
if (!match) {
|
|
24943
|
-
|
|
25492
|
+
clear();
|
|
25493
|
+
stop(proc);
|
|
25494
|
+
clearTimeout(id);
|
|
25495
|
+
reject(new Error(`Failed to parse server url from output: ${line}`));
|
|
25496
|
+
return;
|
|
24944
25497
|
}
|
|
24945
25498
|
clearTimeout(id);
|
|
25499
|
+
resolved = true;
|
|
24946
25500
|
resolve2(match[1]);
|
|
24947
25501
|
return;
|
|
24948
25502
|
}
|
|
@@ -24964,17 +25518,16 @@ Server output: ${output}`;
|
|
|
24964
25518
|
clearTimeout(id);
|
|
24965
25519
|
reject(error45);
|
|
24966
25520
|
});
|
|
24967
|
-
|
|
24968
|
-
|
|
24969
|
-
|
|
24970
|
-
|
|
24971
|
-
});
|
|
24972
|
-
}
|
|
25521
|
+
clear = bindAbort(proc, options.signal, () => {
|
|
25522
|
+
clearTimeout(id);
|
|
25523
|
+
reject(options.signal?.reason);
|
|
25524
|
+
});
|
|
24973
25525
|
});
|
|
24974
25526
|
return {
|
|
24975
25527
|
url: url2,
|
|
24976
25528
|
close() {
|
|
24977
|
-
|
|
25529
|
+
clear();
|
|
25530
|
+
stop(proc);
|
|
24978
25531
|
}
|
|
24979
25532
|
};
|
|
24980
25533
|
}
|
|
@@ -27414,7 +27967,7 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
|
|
|
27414
27967
|
}
|
|
27415
27968
|
|
|
27416
27969
|
// src/features/mcp-oauth/oauth-authorization-flow.ts
|
|
27417
|
-
import { spawn
|
|
27970
|
+
import { spawn } from "child_process";
|
|
27418
27971
|
import { createHash, randomBytes } from "crypto";
|
|
27419
27972
|
import { createServer } from "http";
|
|
27420
27973
|
function generateCodeVerifier() {
|
|
@@ -27495,7 +28048,7 @@ function openBrowser(url2) {
|
|
|
27495
28048
|
args = [url2];
|
|
27496
28049
|
}
|
|
27497
28050
|
try {
|
|
27498
|
-
const child =
|
|
28051
|
+
const child = spawn(command, args, { stdio: "ignore", detached: true });
|
|
27499
28052
|
child.on("error", () => {});
|
|
27500
28053
|
child.unref();
|
|
27501
28054
|
} catch {}
|