Skip to content

Commit 481ff55

Browse files
committed
upgrade dependencies and improve imports
1 parent 2628ac4 commit 481ff55

27 files changed

+679
-675
lines changed

docs/tool-whitelist.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Tools are capabilities that allow AI models to interact with your vault and the
1515
- **Web Search**: Search the web via Brave Search API
1616

1717
**Privacy Guarantee**: All tool calls require your explicit approval at three layers:
18+
1819
1. Approve the tool execution request
1920
2. Review the results before sharing with AI
2021
3. Select exactly what data to share
@@ -25,12 +26,12 @@ See [v3.0.0 Release Notes](https://github.com/obsidian-chatgpt-md/obsidian-chatg
2526

2627
The default whitelist includes **161 patterns** covering models from live API testing:
2728

28-
| Provider | Patterns | Models Tested | Tool Support |
29-
|----------|----------|---------------|--------------|
30-
| OpenAI | 36 | 119 | 56 models |
31-
| Anthropic | 9 | 9 | 9 models (100%) |
32-
| Gemini | 7 | 29 | 7 models |
33-
| OpenRouter | 109 | 346 | 122 models |
29+
| Provider | Patterns | Models Tested | Tool Support |
30+
| ---------- | -------- | ------------- | --------------- |
31+
| OpenAI | 36 | 119 | 56 models |
32+
| Anthropic | 9 | 9 | 9 models (100%) |
33+
| Gemini | 7 | 29 | 7 models |
34+
| OpenRouter | 109 | 346 | 122 models |
3435

3536
**Test Date**: 2026-02-01
3637
**Total Tested**: 503 models
@@ -47,14 +48,17 @@ The whitelist uses flexible pattern matching to handle model versioning:
4748
```
4849
gpt-4o
4950
```
51+
5052
Matches only `gpt-4o`
5153

5254
### Date Suffix Auto-Match
5355

5456
```
5557
gpt-4o
5658
```
59+
5760
Matches:
61+
5862
- `gpt-4o`
5963
- `gpt-4o-2025-04-16`
6064
- `gpt-4o-20251101`
@@ -66,7 +70,9 @@ Date suffixes are automatically matched, so you don't need to list every version
6670
```
6771
gpt-4*
6872
```
73+
6974
Matches anything starting with `gpt-4`:
75+
7076
- `gpt-4`
7177
- `gpt-4-turbo`
7278
- `gpt-4o`
@@ -78,6 +84,7 @@ Matches anything starting with `gpt-4`:
7884
# This is a comment
7985
gpt-4o
8086
```
87+
8188
Lines starting with `#` are ignored.
8289

8390
## Configuration
@@ -185,6 +192,7 @@ toolEnabledModels: |
185192
### OpenRouter
186193
187194
**Tool Support**: 109 confirmed patterns including:
195+
188196
- DeepSeek (V3, R1 series)
189197
- Qwen (2.5, 3 series)
190198
- Mistral (Large, Ministral)
@@ -215,10 +223,7 @@ Use the **WhitelistValidator** to see which of your configured models support to
215223
```typescript
216224
import { validateWhitelist } from "src/Services/WhitelistValidator";
217225

218-
const result = validateWhitelist(
219-
["gpt-4o", "claude-3-haiku", "unknown-model"],
220-
whitelist
221-
);
226+
const result = validateWhitelist(["gpt-4o", "claude-3-haiku", "unknown-model"], whitelist);
222227

223228
console.log(result.matchRate); // Percentage supporting tools
224229
console.log(result.unmatchedModelDetails); // Models not on whitelist
@@ -231,19 +236,22 @@ console.log(result.unmatchedModelDetails); // Models not on whitelist
231236
**Cause**: Model returned an error when tools were in the API request.
232237

233238
**Solutions**:
239+
234240
1. Check if model is actually on whitelist
235241
2. Try a confirmed model from default whitelist
236242
3. Enable Debug Mode to see API response
237243

238244
#### Tools not offered when expected
239245

240246
**Cause**: Multiple possible reasons:
247+
241248
1. Tool calling disabled in settings
242249
2. Model not on whitelist
243250
3. Model doesn't understand it can use tools
244251
4. No relevant tools for the query
245252

246253
**Solutions**:
254+
247255
1. Check `enableToolCalling` is on
248256
2. Verify model is in whitelist
249257
3. Try explicit query: "Search my notes for..."
@@ -254,6 +262,7 @@ console.log(result.unmatchedModelDetails); // Models not on whitelist
254262
**Cause**: Whitelist needs full `provider/model` format.
255263

256264
**Solution**:
265+
257266
```yaml
258267
# Correct
259268
toolEnabledModels: |
@@ -383,6 +392,7 @@ Note: The `!` exclusion syntax is not currently supported. You must explicitly l
383392
### Q: Why isn't my model on the whitelist?
384393

385394
**A**: The model either:
395+
386396
1. Hasn't been tested yet (new models added regularly)
387397
2. Failed tool support testing (errors or inconsistent behavior)
388398
3. Is too old and doesn't support modern tool calling
@@ -396,6 +406,7 @@ Test it yourself and add it if it works!
396406
### Q: How often is the whitelist updated?
397407

398408
**A**: The whitelist is updated when:
409+
399410
- Major providers release new models
400411
- Community testing confirms additional models
401412
- Bug reports indicate false positives/negatives
@@ -405,6 +416,7 @@ Check the test date in the whitelist header for last update.
405416
### Q: What if a model stops supporting tools?
406417

407418
**A**: This is rare but possible. If you encounter this:
419+
408420
1. Enable Debug Mode to confirm the error
409421
2. Remove the model from your whitelist
410422
3. Report it as an issue

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@
2121
"keywords": [],
2222
"author": "",
2323
"dependencies": {
24-
"@ai-sdk/anthropic": "^3.0.1",
25-
"@ai-sdk/google": "^3.0.1",
26-
"@ai-sdk/openai": "^3.0.1",
27-
"@ai-sdk/openai-compatible": "^2.0.1",
28-
"@openrouter/ai-sdk-provider": "^1.5.4",
29-
"ai": "6.0.3",
30-
"zod": "4.2.1"
24+
"@ai-sdk/anthropic": "^3.0.35",
25+
"@ai-sdk/google": "^3.0.20",
26+
"@ai-sdk/openai": "^3.0.25",
27+
"@ai-sdk/openai-compatible": "^2.0.26",
28+
"@openrouter/ai-sdk-provider": "^2.1.1",
29+
"ai": "6.0.67",
30+
"zod": "4.3.6"
3131
},
3232
"devDependencies": {
33-
"@codemirror/state": "^6.5.3",
34-
"@codemirror/view": "^6.39.7",
35-
"@types/node": "^25.0.3",
36-
"@typescript-eslint/eslint-plugin": "8.50.1",
37-
"@typescript-eslint/parser": "8.50.1",
33+
"@codemirror/state": "^6.5.4",
34+
"@codemirror/view": "^6.39.12",
35+
"@types/node": "^25.2.0",
36+
"@typescript-eslint/eslint-plugin": "8.54.0",
37+
"@typescript-eslint/parser": "8.54.0",
3838
"builtin-modules": "5.0.0",
3939
"esbuild": "0.27.2",
4040
"eslint": "^9.39.2",
4141
"obsidian": "latest",
42-
"prettier": "^3.7.4",
42+
"prettier": "^3.8.1",
4343
"tslib": "2.8.1",
4444
"typescript": "5.9.3"
4545
}

scripts/tool-whitelist/QUICK-START.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ node scripts/tool-whitelist/generate-whitelist.mjs
6565
## Options Cheat Sheet
6666

6767
### test-models-tools.mjs
68+
6869
- `--limit N` - Test only N models per provider
6970
- `--provider name` - Test only: openai|anthropic|gemini|openrouter
7071

7172
### generate-whitelist.mjs
73+
7274
- `--min-success-rate N` - Minimum rate 0-1 (default: 1.0)
7375
- `--output path` - Custom output path
7476

scripts/tool-whitelist/README-WHITELIST-MAINTENANCE.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ node scripts/tool-whitelist/fetch-available-models.mjs
2929
**Output**: `scripts/tool-whitelist/available-models.json`
3030

3131
**What it does**:
32+
3233
- Queries each provider's API for available models
3334
- Saves model metadata (id, name, created date, etc.)
3435
- No tool testing - just discovery
3536

3637
**Example output**:
38+
3739
```json
3840
{
3941
"fetchedAt": "2026-02-01T12:00:00.000Z",
@@ -62,18 +64,21 @@ node scripts/tool-whitelist/test-models-tools.mjs --provider openai
6264
```
6365

6466
**Options**:
67+
6568
- `--limit N` - Test only first N models per provider
6669
- `--provider name` - Test only specific provider (openai|anthropic|gemini|openrouter)
6770

6871
**Output**: `scripts/tool-whitelist/tool-test-results.json`
6972

7073
**What it does**:
74+
7175
- Loads models from `available-models.json`
7276
- Makes actual API calls with tool definitions
7377
- Records which models successfully call tools
7478
- Saves detailed results including errors
7579

7680
**Example output**:
81+
7782
```json
7883
{
7984
"testedAt": "2026-02-01T12:30:00.000Z",
@@ -107,19 +112,22 @@ node scripts/tool-whitelist/generate-whitelist.mjs --output my-whitelist.txt
107112
```
108113

109114
**Options**:
115+
110116
- `--min-success-rate N` - Minimum success rate 0-1 (default: 1.0)
111117
- `--output path` - Custom output path (default: scripts/tool-whitelist/generated-whitelist.txt)
112118

113119
**Output**: `scripts/tool-whitelist/generated-whitelist.txt`
114120

115121
**What it does**:
122+
116123
- Reads `tool-test-results.json`
117124
- Filters models that support tools
118125
- Groups by base pattern (removes date suffixes)
119126
- Generates formatted whitelist
120127
- Shows comparison with current whitelist
121128

122129
**Example output**:
130+
123131
```
124132
# OpenAI
125133
gpt-5.2
@@ -143,11 +151,11 @@ After reviewing the generated whitelist:
143151

144152
## Files Generated
145153

146-
| File | Purpose | Created By |
147-
|------|---------|------------|
148-
| `available-models.json` | All available models from providers | Step 1 |
149-
| `tool-test-results.json` | Tool support test results | Step 2 |
150-
| `generated-whitelist.txt` | New default whitelist | Step 3 |
154+
| File | Purpose | Created By |
155+
| ------------------------- | ----------------------------------- | ---------- |
156+
| `available-models.json` | All available models from providers | Step 1 |
157+
| `tool-test-results.json` | Tool support test results | Step 2 |
158+
| `generated-whitelist.txt` | New default whitelist | Step 3 |
151159

152160
## Example Full Workflow
153161

@@ -177,23 +185,27 @@ cat scripts/tool-whitelist/generated-whitelist.txt
177185
### Testing Strategy
178186

179187
**Quick validation** (fast, cheap):
188+
180189
```bash
181190
node scripts/tool-whitelist/test-models-tools.mjs --limit 5
182191
```
183192

184193
**Thorough validation** (slow, expensive):
194+
185195
```bash
186196
node scripts/tool-whitelist/test-models-tools.mjs
187197
```
188198

189199
**Provider-specific**:
200+
190201
```bash
191202
node scripts/tool-whitelist/test-models-tools.mjs --provider gemini
192203
```
193204

194205
### Automation
195206

196207
These scripts are **intentionally manual**:
208+
197209
- No automatic updates to source code
198210
- Human review required
199211
- Prevents accidental whitelist corruption
@@ -203,13 +215,15 @@ These scripts are **intentionally manual**:
203215
### "Error loading available-models.json"
204216

205217
Run step 1 first:
218+
206219
```bash
207220
node scripts/tool-whitelist/fetch-available-models.mjs
208221
```
209222

210223
### "Error loading tool-test-results.json"
211224

212225
Run step 2 first:
226+
213227
```bash
214228
node scripts/tool-whitelist/test-models-tools.mjs
215229
```
@@ -223,6 +237,7 @@ node scripts/tool-whitelist/test-models-tools.mjs
223237
## Maintenance Schedule
224238

225239
**Recommended frequency**:
240+
226241
- **Monthly**: Quick validation (`--limit 5`)
227242
- **Quarterly**: Full validation (all models)
228243
- **On-demand**: When new major models are released

0 commit comments

Comments
 (0)