consult-llm-mcp 2.5.3 → 2.5.5-beta.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/CHANGELOG.md +198 -0
- package/README.md +25 -22
- package/package.json +24 -51
- package/run.sh +65 -0
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -39
- package/dist/clipboard.d.ts +0 -1
- package/dist/clipboard.js +0 -10
- package/dist/clipboard.test.d.ts +0 -1
- package/dist/clipboard.test.js +0 -21
- package/dist/config.d.ts +0 -52
- package/dist/config.js +0 -120
- package/dist/config.test.d.ts +0 -1
- package/dist/config.test.js +0 -167
- package/dist/executors/api.d.ts +0 -3
- package/dist/executors/api.js +0 -29
- package/dist/executors/cli-runner.d.ts +0 -17
- package/dist/executors/cli-runner.js +0 -57
- package/dist/executors/codex-cli.d.ts +0 -6
- package/dist/executors/codex-cli.js +0 -90
- package/dist/executors/cursor-cli.d.ts +0 -6
- package/dist/executors/cursor-cli.js +0 -116
- package/dist/executors/gemini-cli.d.ts +0 -6
- package/dist/executors/gemini-cli.js +0 -76
- package/dist/executors/types.d.ts +0 -15
- package/dist/executors/types.js +0 -1
- package/dist/external-dirs.d.ts +0 -6
- package/dist/external-dirs.js +0 -19
- package/dist/external-dirs.test.d.ts +0 -1
- package/dist/external-dirs.test.js +0 -23
- package/dist/file.d.ts +0 -4
- package/dist/file.js +0 -17
- package/dist/git-worktree.d.ts +0 -9
- package/dist/git-worktree.js +0 -40
- package/dist/git-worktree.test.d.ts +0 -1
- package/dist/git-worktree.test.js +0 -35
- package/dist/git.d.ts +0 -1
- package/dist/git.js +0 -17
- package/dist/git.test.d.ts +0 -1
- package/dist/git.test.js +0 -43
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -25
- package/dist/llm-cost.d.ts +0 -7
- package/dist/llm-cost.js +0 -38
- package/dist/llm-query.d.ts +0 -7
- package/dist/llm-query.js +0 -18
- package/dist/llm.d.ts +0 -7
- package/dist/llm.js +0 -89
- package/dist/llm.test.d.ts +0 -1
- package/dist/llm.test.js +0 -603
- package/dist/logger.d.ts +0 -7
- package/dist/logger.js +0 -70
- package/dist/main.d.ts +0 -2
- package/dist/main.js +0 -21
- package/dist/main.logic.d.ts +0 -10
- package/dist/main.logic.js +0 -145
- package/dist/main.logic.test.d.ts +0 -1
- package/dist/main.test.d.ts +0 -1
- package/dist/main.test.js +0 -113
- package/dist/mcp-server.d.ts +0 -2
- package/dist/mcp-server.js +0 -220
- package/dist/models.d.ts +0 -1
- package/dist/models.js +0 -10
- package/dist/prompt-builder.d.ts +0 -4
- package/dist/prompt-builder.js +0 -18
- package/dist/prompt.test.d.ts +0 -1
- package/dist/prompt.test.js +0 -113
- package/dist/schema.d.ts +0 -59
- package/dist/schema.js +0 -64
- package/dist/schema.test.d.ts +0 -1
- package/dist/schema.test.js +0 -81
- package/dist/server.d.ts +0 -8
- package/dist/server.js +0 -143
- package/dist/server.test.d.ts +0 -1
- package/dist/server.test.js +0 -258
- package/dist/system-prompt.d.ts +0 -7
- package/dist/system-prompt.js +0 -81
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v2.5.4 (2026-03-07)
|
|
4
|
+
|
|
5
|
+
- Rewrote server from TypeScript to Rust
|
|
6
|
+
- Distributed as cross-compiled native binaries (macOS arm64/x64, Linux
|
|
7
|
+
x64/arm64) via npm with a POSIX sh launcher
|
|
8
|
+
- Added `MCP_DEBUG_STDIN` env var for raw stdin transport logging
|
|
9
|
+
|
|
10
|
+
## v2.5.3 (2026-03-06)
|
|
11
|
+
|
|
12
|
+
- Added `CONSULT_LLM_` prefix to backend and reasoning effort env vars:
|
|
13
|
+
`CONSULT_LLM_GEMINI_BACKEND`, `CONSULT_LLM_OPENAI_BACKEND`,
|
|
14
|
+
`CONSULT_LLM_CODEX_REASONING_EFFORT`. Old unprefixed names still work with a
|
|
15
|
+
deprecation warning.
|
|
16
|
+
|
|
17
|
+
## v2.5.2 (2026-03-06)
|
|
18
|
+
|
|
19
|
+
- Fixed Codex CLI thread resumption failing due to unsupported `--add-dir` flag
|
|
20
|
+
in `codex exec resume`
|
|
21
|
+
|
|
22
|
+
## v2.5.1 (2026-03-06)
|
|
23
|
+
|
|
24
|
+
- Consult skill now queries both Gemini and Codex in parallel by default, with
|
|
25
|
+
`--gemini` and `--codex` flags for single-model consultation
|
|
26
|
+
- CLI backends now receive main worktree path as additional context when running
|
|
27
|
+
inside a git worktree
|
|
28
|
+
- CLI backends now detect external file directories (outside workspace) and pass
|
|
29
|
+
them to Gemini/Codex so referenced files are accessible
|
|
30
|
+
- Debate skill now supports multi-round debates via `--rounds` flag (default 2,
|
|
31
|
+
max 3)
|
|
32
|
+
- Reduced anchoring bias in debate/debate-vs final review phase
|
|
33
|
+
- Added `install-skills` script for easy skill installation
|
|
34
|
+
|
|
35
|
+
## v2.5.0 (2026-03-05)
|
|
36
|
+
|
|
37
|
+
- Added gpt-5.4 model support ($2.50/$15 per million tokens)
|
|
38
|
+
|
|
39
|
+
## v2.4.2 (2026-02-28)
|
|
40
|
+
|
|
41
|
+
- Added gemini-3.1-pro-preview model support
|
|
42
|
+
- Filter unavailable models from the tool schema based on configured API keys
|
|
43
|
+
and CLI backends, preventing errors when selecting unconfigured models
|
|
44
|
+
|
|
45
|
+
## v2.4.1 (2026-02-25)
|
|
46
|
+
|
|
47
|
+
- Updated tool description to tell callers not to inline file contents in the
|
|
48
|
+
prompt field, since the server reads files automatically via the `files`
|
|
49
|
+
parameter
|
|
50
|
+
|
|
51
|
+
## v2.3.0 (2026-02-25)
|
|
52
|
+
|
|
53
|
+
- Added Cursor CLI (`cursor-agent`) as a new executor backend
|
|
54
|
+
- Replaced `GEMINI_MODE`/`OPENAI_MODE` with `GEMINI_BACKEND`/`OPENAI_BACKEND`
|
|
55
|
+
for backend routing (legacy env vars still work with deprecation warnings)
|
|
56
|
+
- Added `CONSULT_LLM_EXTRA_MODELS` environment variable for adding models
|
|
57
|
+
without code changes
|
|
58
|
+
- Removed gpt-5.1 and Claude models from built-in model list
|
|
59
|
+
|
|
60
|
+
## v2.2.0 (2026-02-14)
|
|
61
|
+
|
|
62
|
+
- Added `task_mode` parameter for adaptive system prompts with five modes:
|
|
63
|
+
`review`, `plan`, `create`, `debug`, and `general` (default)
|
|
64
|
+
|
|
65
|
+
## v2.1.0 (2026-02-12)
|
|
66
|
+
|
|
67
|
+
- Added multi-turn conversation support for CLI modes via `thread_id` parameter
|
|
68
|
+
- Codex CLI: uses `--json` output and `exec resume` for session continuity
|
|
69
|
+
- Gemini CLI: uses `-o json` output and `-r` flag for session resume
|
|
70
|
+
- Responses include a `[thread_id:xxx]` prefix for follow-up requests
|
|
71
|
+
- Replaced generic CLI executor with dedicated Codex and Gemini executors
|
|
72
|
+
- Added debate skill example (`skills/debate/SKILL.md`) showcasing multi-turn
|
|
73
|
+
conversations
|
|
74
|
+
|
|
75
|
+
## v2.0.1 (2026-02-05)
|
|
76
|
+
|
|
77
|
+
- Added gpt-5.3-codex model support
|
|
78
|
+
|
|
79
|
+
## v2.0.0 (2026-02-04)
|
|
80
|
+
|
|
81
|
+
- Log files now stored in XDG state directory
|
|
82
|
+
(`~/.local/state/consult-llm-mcp/`) instead of `~/.consult-llm-mcp/logs/`,
|
|
83
|
+
following the XDG Base Directory Specification
|
|
84
|
+
|
|
85
|
+
## v1.7.2 (2026-02-04)
|
|
86
|
+
|
|
87
|
+
- Extracted model definitions to dedicated module, resolving a circular
|
|
88
|
+
dependency between config and schema
|
|
89
|
+
|
|
90
|
+
## v1.7.1 (2026-02-04)
|
|
91
|
+
|
|
92
|
+
- Removed o3 model, succeeded by gpt-5.2 which is now the default OpenAI model
|
|
93
|
+
- Documented model selection behavior and `CONSULT_LLM_ALLOWED_MODELS` usage
|
|
94
|
+
|
|
95
|
+
## v1.7.0 (2026-01-29)
|
|
96
|
+
|
|
97
|
+
- Added configurable system prompt path via `CONSULT_LLM_SYSTEM_PROMPT_PATH`
|
|
98
|
+
environment variable
|
|
99
|
+
|
|
100
|
+
## v1.5.0 (2026-01-12)
|
|
101
|
+
|
|
102
|
+
- Added gpt-5.2-codex model support
|
|
103
|
+
- Added `CONSULT_LLM_ALLOWED_MODELS` environment variable to filter which models
|
|
104
|
+
are available in the tool schema
|
|
105
|
+
|
|
106
|
+
## v1.4.7 (2025-12-12)
|
|
107
|
+
|
|
108
|
+
- Added gpt-5.2 model support
|
|
109
|
+
|
|
110
|
+
## v1.4.6 (2025-12-03)
|
|
111
|
+
|
|
112
|
+
- Removed 5-minute timeout from CLI executors
|
|
113
|
+
|
|
114
|
+
## v1.4.5 (2025-12-02)
|
|
115
|
+
|
|
116
|
+
- Improved system prompt by removing redundant "no critical issues found"
|
|
117
|
+
statement
|
|
118
|
+
- Fixed `init-prompt` command to use npx
|
|
119
|
+
- Moved skill and slash command examples to separate files
|
|
120
|
+
|
|
121
|
+
## v1.4.4 (2025-11-26)
|
|
122
|
+
|
|
123
|
+
- Added support for gemini-3-pro-preview model
|
|
124
|
+
|
|
125
|
+
## v1.4.3 (2025-11-22)
|
|
126
|
+
|
|
127
|
+
- Added `--skip-git-repo-check` to Codex CLI args, fixing issues when running
|
|
128
|
+
outside git repositories
|
|
129
|
+
|
|
130
|
+
## v1.4.2 (2025-11-21)
|
|
131
|
+
|
|
132
|
+
- Added gpt-5.1-codex-max model support
|
|
133
|
+
- Made Codex CLI reasoning effort configurable
|
|
134
|
+
- Fixed Codex CLI execution
|
|
135
|
+
|
|
136
|
+
## v1.4.1 (2025-11-19)
|
|
137
|
+
|
|
138
|
+
- Added test suite with vitest
|
|
139
|
+
- Fixed web mode file handling
|
|
140
|
+
- Split server entry point for better modularity
|
|
141
|
+
|
|
142
|
+
## v1.4.0 (2025-11-18)
|
|
143
|
+
|
|
144
|
+
- Added Codex CLI support as a new executor backend
|
|
145
|
+
- Refactored LLM execution to a functional executor pattern
|
|
146
|
+
- Migrated to Zod v4 with native JSON schema generation
|
|
147
|
+
- Added example Claude Code skill to README
|
|
148
|
+
|
|
149
|
+
## v1.3.0 (2025-11-16)
|
|
150
|
+
|
|
151
|
+
- Added web mode: copies the formatted prompt to clipboard for pasting into
|
|
152
|
+
browser-based LLMs instead of querying an API directly
|
|
153
|
+
|
|
154
|
+
## v1.2.0 (2025-10-25)
|
|
155
|
+
|
|
156
|
+
- Added custom system prompt support, configurable via file
|
|
157
|
+
- Added environment variable documentation
|
|
158
|
+
- Set up ESLint and code quality checks
|
|
159
|
+
|
|
160
|
+
## v1.1.2 (2025-10-25)
|
|
161
|
+
|
|
162
|
+
- Added `--version` flag to display the server version
|
|
163
|
+
|
|
164
|
+
## v1.1.1 (2025-10-25)
|
|
165
|
+
|
|
166
|
+
- Added Gemini CLI mode support with a dedicated system prompt and instructions
|
|
167
|
+
- Enforced code file context requirement in the tool description
|
|
168
|
+
- Improved code review guidance in prompts
|
|
169
|
+
|
|
170
|
+
## v1.1.0 (2025-07-28)
|
|
171
|
+
|
|
172
|
+
- Added Gemini CLI mode as an alternative to the Gemini API, with free quota
|
|
173
|
+
support
|
|
174
|
+
- Added debug logging and configuration logging with sensitive data redaction
|
|
175
|
+
|
|
176
|
+
## v1.0.5 (2025-06-29)
|
|
177
|
+
|
|
178
|
+
- Improved system prompt for more concise and critical analysis
|
|
179
|
+
- Updated tool description to emphasize neutral, unbiased questioning
|
|
180
|
+
- Moved main prompt to the `prompt` field instead of embedding in markdown
|
|
181
|
+
|
|
182
|
+
## v1.0.4 (2025-06-25)
|
|
183
|
+
|
|
184
|
+
- Added system prompt to LLM queries for enhanced analysis and recommendations
|
|
185
|
+
- Added `prompt` parameter to the tool
|
|
186
|
+
|
|
187
|
+
## v1.0.3 (2025-06-23)
|
|
188
|
+
|
|
189
|
+
- Added deepseek-reasoner and gemini-2.5-pro model options
|
|
190
|
+
- Added API key validation checks for OpenAI, Gemini, and DeepSeek models
|
|
191
|
+
|
|
192
|
+
## v1.0.2 (2025-06-23)
|
|
193
|
+
|
|
194
|
+
- Added server version logging and version in server metadata
|
|
195
|
+
|
|
196
|
+
## v1.0.1 (2025-06-23)
|
|
197
|
+
|
|
198
|
+
Initial release.
|
package/README.md
CHANGED
|
@@ -483,6 +483,11 @@ See the "Using web mode..." example above for a concrete transcript.
|
|
|
483
483
|
(optional)
|
|
484
484
|
- Overrides the default `~/.consult-llm-mcp/SYSTEM_PROMPT.md` location
|
|
485
485
|
- Useful for project-specific prompts
|
|
486
|
+
- `MCP_DEBUG_STDIN` - Log raw JSON-RPC messages received on stdin (optional)
|
|
487
|
+
- Set to `1` to enable
|
|
488
|
+
- Logs every message as `RAW RECV` entries and poll timing gaps as
|
|
489
|
+
`STDIN POLL` entries in `mcp.log`
|
|
490
|
+
- Useful for debugging transport-level issues
|
|
486
491
|
|
|
487
492
|
### Custom system prompt
|
|
488
493
|
|
|
@@ -780,51 +785,49 @@ forth before synthesizing and implementing. See
|
|
|
780
785
|
|
|
781
786
|
To work on the MCP server locally and use your development version:
|
|
782
787
|
|
|
783
|
-
1. Clone the repository
|
|
788
|
+
1. Clone the repository:
|
|
784
789
|
|
|
785
790
|
```bash
|
|
786
791
|
git clone https://github.com/raine/consult-llm-mcp.git
|
|
787
792
|
cd consult-llm-mcp
|
|
788
|
-
npm install
|
|
789
793
|
```
|
|
790
794
|
|
|
791
|
-
2. Build
|
|
795
|
+
2. Build and test:
|
|
792
796
|
|
|
793
797
|
```bash
|
|
794
|
-
|
|
798
|
+
cargo build
|
|
799
|
+
cargo test
|
|
800
|
+
just check # format, lint, test
|
|
795
801
|
```
|
|
796
802
|
|
|
797
|
-
3.
|
|
798
|
-
|
|
799
|
-
```bash
|
|
800
|
-
npm link
|
|
801
|
-
```
|
|
802
|
-
|
|
803
|
-
4. Add the MCP server to Claude Code using the global command:
|
|
803
|
+
3. Add the MCP server to Claude Code using your local build:
|
|
804
804
|
```bash
|
|
805
|
-
claude mcp add consult-llm -- consult-llm-mcp
|
|
805
|
+
claude mcp add consult-llm -- /path/to/consult-llm-mcp/target/debug/consult-llm-mcp
|
|
806
806
|
```
|
|
807
807
|
|
|
808
|
-
Now when you make changes
|
|
808
|
+
Now when you make changes, rebuild with `cargo build` and restart Claude Code.
|
|
809
809
|
|
|
810
|
-
|
|
811
|
-
2. Restart Claude Code to pick up the changes
|
|
810
|
+
### Releasing
|
|
812
811
|
|
|
813
|
-
|
|
812
|
+
Requires [zig](https://ziglang.org/),
|
|
813
|
+
[cargo-zigbuild](https://github.com/rust-cross/cargo-zigbuild), and
|
|
814
|
+
cross-compilation targets:
|
|
814
815
|
|
|
815
816
|
```bash
|
|
816
|
-
|
|
817
|
+
brew install zig
|
|
818
|
+
cargo install cargo-zigbuild
|
|
819
|
+
rustup target add aarch64-apple-darwin x86_64-apple-darwin x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
|
|
817
820
|
```
|
|
818
821
|
|
|
819
|
-
|
|
820
|
-
without rebuilding.
|
|
821
|
-
|
|
822
|
-
To unlink the global version later:
|
|
822
|
+
Publish a new version:
|
|
823
823
|
|
|
824
824
|
```bash
|
|
825
|
-
|
|
825
|
+
scripts/publish patch # or minor, major
|
|
826
826
|
```
|
|
827
827
|
|
|
828
|
+
This cross-compiles for all platforms, stages the binaries, publishes to npm,
|
|
829
|
+
then commits and tags.
|
|
830
|
+
|
|
828
831
|
## Related projects
|
|
829
832
|
|
|
830
833
|
- [workmux](https://github.com/raine/workmux) — Git worktrees + tmux windows for
|
package/package.json
CHANGED
|
@@ -1,36 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "consult-llm-mcp",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5-beta.0",
|
|
4
4
|
"description": "MCP server for consulting powerful AI models",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/main.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"consult-llm-mcp": "./dist/main.js"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "./scripts/generate-version && tsc",
|
|
12
|
-
"dev": "tsx src/main.ts",
|
|
13
|
-
"start": "node dist/main.js",
|
|
14
|
-
"test": "vitest",
|
|
15
|
-
"test:run": "vitest run",
|
|
16
|
-
"format": "oxfmt --write .",
|
|
17
|
-
"check": "concurrently \"pnpm:check:*\"",
|
|
18
|
-
"check:types": "tsc --noEmit",
|
|
19
|
-
"check:format": "oxfmt --check .",
|
|
20
|
-
"check:lint": "biome lint .",
|
|
21
|
-
"check:test": "vitest run",
|
|
22
|
-
"install-global": "npm run build && npm install -g .",
|
|
23
|
-
"prepublishOnly": "pnpm run check && npm run build",
|
|
24
|
-
"publish:dry": "npm publish --dry-run"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [
|
|
27
|
-
"mcp",
|
|
28
|
-
"openai",
|
|
29
|
-
"gemini",
|
|
30
|
-
"llm",
|
|
31
|
-
"ai"
|
|
32
|
-
],
|
|
33
|
-
"author": "",
|
|
34
5
|
"repository": {
|
|
35
6
|
"type": "git",
|
|
36
7
|
"url": "git+https://github.com/raine/consult-llm-mcp.git"
|
|
@@ -39,28 +10,30 @@
|
|
|
39
10
|
"bugs": {
|
|
40
11
|
"url": "https://github.com/raine/consult-llm-mcp/issues"
|
|
41
12
|
},
|
|
42
|
-
"files": [
|
|
43
|
-
"dist",
|
|
44
|
-
"README.md"
|
|
45
|
-
],
|
|
46
|
-
"engines": {
|
|
47
|
-
"node": ">=18.0.0"
|
|
48
|
-
},
|
|
49
13
|
"license": "MIT",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"clipboardy": "^5.3.1",
|
|
53
|
-
"openai": "^6.25.0",
|
|
54
|
-
"prettier": "^3.8.1",
|
|
55
|
-
"zod": "^4.3.6"
|
|
14
|
+
"bin": {
|
|
15
|
+
"consult-llm-mcp": "./run.sh"
|
|
56
16
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
17
|
+
"files": [
|
|
18
|
+
"run.sh",
|
|
19
|
+
"README.md",
|
|
20
|
+
"CHANGELOG.md"
|
|
21
|
+
],
|
|
22
|
+
"os": [
|
|
23
|
+
"darwin",
|
|
24
|
+
"linux"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"openai",
|
|
29
|
+
"gemini",
|
|
30
|
+
"llm",
|
|
31
|
+
"ai"
|
|
32
|
+
],
|
|
33
|
+
"optionalDependencies": {
|
|
34
|
+
"consult-llm-mcp-darwin-arm64": "2.5.5-beta.0",
|
|
35
|
+
"consult-llm-mcp-darwin-x64": "2.5.5-beta.0",
|
|
36
|
+
"consult-llm-mcp-linux-x64": "2.5.5-beta.0",
|
|
37
|
+
"consult-llm-mcp-linux-arm64": "2.5.5-beta.0"
|
|
65
38
|
}
|
|
66
39
|
}
|
package/run.sh
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Resolve symlinks to find the actual script directory (npm creates symlinks in .bin/)
|
|
5
|
+
# When invoked via PATH, $0 may be just the command name without a path
|
|
6
|
+
script="$0"
|
|
7
|
+
case "$script" in
|
|
8
|
+
*/*) ;;
|
|
9
|
+
*) script="$(command -v "$script" 2>/dev/null || echo "$script")" ;;
|
|
10
|
+
esac
|
|
11
|
+
while [ -L "$script" ]; do
|
|
12
|
+
target="$(readlink "$script")"
|
|
13
|
+
case "$target" in
|
|
14
|
+
/*) script="$target" ;;
|
|
15
|
+
*) script="$(dirname "$script")/$target" ;;
|
|
16
|
+
esac
|
|
17
|
+
done
|
|
18
|
+
DIR="$(cd -P "$(dirname "$script")" && pwd)"
|
|
19
|
+
|
|
20
|
+
OS="$(uname -s)"
|
|
21
|
+
ARCH="$(uname -m)"
|
|
22
|
+
|
|
23
|
+
case "$OS:$ARCH" in
|
|
24
|
+
Darwin:arm64 | Darwin:aarch64) PLATFORM="darwin-arm64" ;;
|
|
25
|
+
Darwin:x86_64) PLATFORM="darwin-x64" ;;
|
|
26
|
+
Linux:x86_64 | Linux:amd64) PLATFORM="linux-x64" ;;
|
|
27
|
+
Linux:aarch64 | Linux:arm64) PLATFORM="linux-arm64" ;;
|
|
28
|
+
*)
|
|
29
|
+
echo "consult-llm-mcp: unsupported platform: $OS $ARCH" >&2
|
|
30
|
+
exit 1
|
|
31
|
+
;;
|
|
32
|
+
esac
|
|
33
|
+
|
|
34
|
+
PKG_NAME="consult-llm-mcp-$PLATFORM"
|
|
35
|
+
BIN_NAME="consult-llm-mcp"
|
|
36
|
+
|
|
37
|
+
# Fast path: check common node_modules layouts
|
|
38
|
+
for candidate in \
|
|
39
|
+
"$DIR/../$PKG_NAME/$BIN_NAME" \
|
|
40
|
+
"$DIR/node_modules/$PKG_NAME/$BIN_NAME"; do
|
|
41
|
+
if [ -f "$candidate" ]; then
|
|
42
|
+
[ -x "$candidate" ] || chmod +x "$candidate" 2>/dev/null || true
|
|
43
|
+
exec "$candidate" "$@"
|
|
44
|
+
fi
|
|
45
|
+
done
|
|
46
|
+
|
|
47
|
+
# Fallback: use Node's require.resolve for non-standard layouts (pnpm, yarn pnp, etc.)
|
|
48
|
+
if command -v node >/dev/null 2>&1; then
|
|
49
|
+
BIN="$(PKG_NAME="$PKG_NAME" BIN_NAME="$BIN_NAME" SEARCH_DIR="$DIR" node -e "
|
|
50
|
+
try {
|
|
51
|
+
const p = require('path');
|
|
52
|
+
const pkg = require.resolve(process.env.PKG_NAME + '/package.json', { paths: [process.env.SEARCH_DIR] });
|
|
53
|
+
process.stdout.write(p.join(p.dirname(pkg), process.env.BIN_NAME));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
" 2>/dev/null)" && [ -f "$BIN" ] && {
|
|
58
|
+
[ -x "$BIN" ] || chmod +x "$BIN" 2>/dev/null || true
|
|
59
|
+
exec "$BIN" "$@"
|
|
60
|
+
}
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
echo "consult-llm-mcp: could not find platform binary package '$PKG_NAME'" >&2
|
|
64
|
+
echo "Ensure npm install was not run with --no-optional or --omit=optional." >&2
|
|
65
|
+
exit 1
|
package/dist/cli.d.ts
DELETED
package/dist/cli.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { getClientForModel } from './index.js';
|
|
3
|
-
async function main() {
|
|
4
|
-
const args = process.argv.slice(2);
|
|
5
|
-
if (args.length === 0) {
|
|
6
|
-
console.error('Usage: llmtool <prompt>');
|
|
7
|
-
console.error('Environment variables:');
|
|
8
|
-
console.error(' OPENAI_API_KEY - Required for GPT models');
|
|
9
|
-
console.error(' GEMINI_API_KEY - Required for Gemini models');
|
|
10
|
-
console.error(' MODEL - Model to use (default: gpt-3.5-turbo)');
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
const prompt = args.join(' ');
|
|
14
|
-
const model = process.env.MODEL || 'gpt-3.5-turbo';
|
|
15
|
-
try {
|
|
16
|
-
const { client } = getClientForModel(model);
|
|
17
|
-
const completion = await client.chat.completions.create({
|
|
18
|
-
model,
|
|
19
|
-
messages: [{ role: 'user', content: prompt }],
|
|
20
|
-
temperature: 0.7,
|
|
21
|
-
});
|
|
22
|
-
const response = completion.choices[0]?.message?.content;
|
|
23
|
-
if (response) {
|
|
24
|
-
console.log(response);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
console.error('No response from the model');
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error('Error:', error instanceof Error ? error.message : String(error));
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
main().catch((error) => {
|
|
37
|
-
console.error('Fatal error:', error);
|
|
38
|
-
process.exit(1);
|
|
39
|
-
});
|
package/dist/clipboard.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function copyToClipboard(text: string): Promise<void>;
|
package/dist/clipboard.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import clipboard from 'clipboardy';
|
|
2
|
-
export async function copyToClipboard(text) {
|
|
3
|
-
try {
|
|
4
|
-
await clipboard.write(text);
|
|
5
|
-
}
|
|
6
|
-
catch (error) {
|
|
7
|
-
const message = error instanceof Error ? error.message : 'Unknown clipboard error';
|
|
8
|
-
throw new Error(`Failed to copy prompt to clipboard: ${message}`);
|
|
9
|
-
}
|
|
10
|
-
}
|
package/dist/clipboard.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/clipboard.test.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, afterEach } from 'vitest';
|
|
2
|
-
import { copyToClipboard } from './clipboard.js';
|
|
3
|
-
const writeMock = vi.hoisted(() => vi.fn());
|
|
4
|
-
vi.mock('clipboardy', () => ({
|
|
5
|
-
default: {
|
|
6
|
-
write: writeMock,
|
|
7
|
-
},
|
|
8
|
-
}));
|
|
9
|
-
afterEach(() => {
|
|
10
|
-
writeMock.mockReset();
|
|
11
|
-
});
|
|
12
|
-
describe('copyToClipboard', () => {
|
|
13
|
-
it('writes text to clipboard', async () => {
|
|
14
|
-
await copyToClipboard('hello world');
|
|
15
|
-
expect(writeMock).toHaveBeenCalledWith('hello world');
|
|
16
|
-
});
|
|
17
|
-
it('wraps clipboard errors with a descriptive message', async () => {
|
|
18
|
-
writeMock.mockRejectedValueOnce(new Error('OS error'));
|
|
19
|
-
await expect(copyToClipboard('x')).rejects.toThrow('Failed to copy prompt to clipboard: OS error');
|
|
20
|
-
});
|
|
21
|
-
});
|
package/dist/config.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod/v4';
|
|
2
|
-
export interface ProviderAvailability {
|
|
3
|
-
geminiApiKey?: string;
|
|
4
|
-
geminiBackend: string;
|
|
5
|
-
openaiApiKey?: string;
|
|
6
|
-
openaiBackend: string;
|
|
7
|
-
deepseekApiKey?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function filterByAvailability(models: string[], providers: ProviderAvailability): string[];
|
|
10
|
-
/** Build the final model catalog from built-in + extra + allowlist filtering. */
|
|
11
|
-
export declare function buildModelCatalog(builtinModels: readonly string[], extraModelsRaw?: string, allowedModelsRaw?: string): string[];
|
|
12
|
-
export declare const SupportedChatModel: z.ZodEnum<{
|
|
13
|
-
[x: string]: string;
|
|
14
|
-
}>;
|
|
15
|
-
export type SupportedChatModel = z.infer<typeof SupportedChatModel>;
|
|
16
|
-
export declare const fallbackModel: string;
|
|
17
|
-
declare const Config: z.ZodObject<{
|
|
18
|
-
openaiApiKey: z.ZodOptional<z.ZodString>;
|
|
19
|
-
geminiApiKey: z.ZodOptional<z.ZodString>;
|
|
20
|
-
deepseekApiKey: z.ZodOptional<z.ZodString>;
|
|
21
|
-
defaultModel: z.ZodOptional<z.ZodEnum<{
|
|
22
|
-
[x: string]: string;
|
|
23
|
-
}>>;
|
|
24
|
-
geminiBackend: z.ZodDefault<z.ZodEnum<{
|
|
25
|
-
api: "api";
|
|
26
|
-
"gemini-cli": "gemini-cli";
|
|
27
|
-
"cursor-cli": "cursor-cli";
|
|
28
|
-
}>>;
|
|
29
|
-
openaiBackend: z.ZodDefault<z.ZodEnum<{
|
|
30
|
-
api: "api";
|
|
31
|
-
"cursor-cli": "cursor-cli";
|
|
32
|
-
"codex-cli": "codex-cli";
|
|
33
|
-
}>>;
|
|
34
|
-
codexReasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
35
|
-
none: "none";
|
|
36
|
-
minimal: "minimal";
|
|
37
|
-
low: "low";
|
|
38
|
-
medium: "medium";
|
|
39
|
-
high: "high";
|
|
40
|
-
xhigh: "xhigh";
|
|
41
|
-
}>>;
|
|
42
|
-
systemPromptPath: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
type ParsedConfig = z.infer<typeof Config>;
|
|
45
|
-
export type Config = ParsedConfig & {
|
|
46
|
-
allowedModels: string[];
|
|
47
|
-
};
|
|
48
|
-
/** Prefer CONSULT_LLM_-prefixed env var, fall back to unprefixed with deprecation warning. */
|
|
49
|
-
export declare function migratePrefixedEnv(prefixed: string | undefined, unprefixed: string | undefined, unprefixedName: string, prefixedName: string): string | undefined;
|
|
50
|
-
export declare function migrateBackendEnv(newVar: string | undefined, oldVar: string | undefined, providerCliValue: string, legacyName: string, newName: string): string | undefined;
|
|
51
|
-
export declare const config: Config;
|
|
52
|
-
export {};
|