llmist 0.1.6 → 0.2.1
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 +58 -11
- package/dist/{chunk-MO5ONHPZ.js → chunk-I55AV3WV.js} +2 -2
- package/dist/{chunk-PVHHXDCV.js → chunk-VRTKJK2X.js} +2 -2
- package/dist/{chunk-J3NCIWMY.js → chunk-VYBRYR2S.js} +82 -33
- package/dist/chunk-VYBRYR2S.js.map +1 -0
- package/dist/cli.cjs +258 -41
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +180 -11
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +81 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/testing/index.cjs +81 -32
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +2 -2
- package/package.json +8 -2
- package/dist/chunk-J3NCIWMY.js.map +0 -1
- /package/dist/{chunk-MO5ONHPZ.js.map → chunk-I55AV3WV.js.map} +0 -0
- /package/dist/{chunk-PVHHXDCV.js.map → chunk-VRTKJK2X.js.map} +0 -0
package/README.md
CHANGED
|
@@ -110,13 +110,13 @@ console.log(answer); // "15 times 23 equals 345"
|
|
|
110
110
|
```typescript
|
|
111
111
|
// Use model shortcuts
|
|
112
112
|
.withModel('gpt-5-nano') // OpenAI gpt-5-nano
|
|
113
|
-
.withModel('sonnet') // Claude
|
|
114
|
-
.withModel('haiku') // Claude
|
|
113
|
+
.withModel('sonnet') // Claude Sonnet 4.5
|
|
114
|
+
.withModel('haiku') // Claude Haiku 4.5
|
|
115
115
|
.withModel('flash') // Gemini 2.0 Flash
|
|
116
116
|
|
|
117
117
|
// Or full names
|
|
118
118
|
.withModel('openai:gpt-5-nano')
|
|
119
|
-
.withModel('anthropic:claude-
|
|
119
|
+
.withModel('anthropic:claude-sonnet-4-5')
|
|
120
120
|
.withModel('gemini:gemini-2.0-flash')
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -288,7 +288,7 @@ for await (const event of agent.run()) {
|
|
|
288
288
|
### 🧪 Mock Testing
|
|
289
289
|
|
|
290
290
|
```typescript
|
|
291
|
-
import { mockLLM, createMockClient } from 'llmist';
|
|
291
|
+
import { LLMist, mockLLM, createMockClient } from 'llmist';
|
|
292
292
|
|
|
293
293
|
mockLLM()
|
|
294
294
|
.forModel('gpt-5')
|
|
@@ -296,8 +296,8 @@ mockLLM()
|
|
|
296
296
|
.returns('The answer is 42')
|
|
297
297
|
.register();
|
|
298
298
|
|
|
299
|
-
const
|
|
300
|
-
|
|
299
|
+
const mockClient = createMockClient();
|
|
300
|
+
const answer = await mockClient.createAgent()
|
|
301
301
|
.withModel('gpt-5')
|
|
302
302
|
.askAndCollect('Calculate 2 + 2');
|
|
303
303
|
|
|
@@ -312,12 +312,12 @@ console.log(answer); // "The answer is 42" - no API call made!
|
|
|
312
312
|
const client = new LLMist();
|
|
313
313
|
|
|
314
314
|
// Get model specs
|
|
315
|
-
const
|
|
316
|
-
console.log(
|
|
317
|
-
console.log(
|
|
315
|
+
const gpt5 = client.modelRegistry.getModelSpec('gpt-5');
|
|
316
|
+
console.log(gpt5.contextWindow); // 272000
|
|
317
|
+
console.log(gpt5.pricing.input); // 1.25 per 1M tokens
|
|
318
318
|
|
|
319
319
|
// Estimate costs
|
|
320
|
-
const cost = client.modelRegistry.estimateCost('
|
|
320
|
+
const cost = client.modelRegistry.estimateCost('gpt-5', 10_000, 2_000);
|
|
321
321
|
console.log(`$${cost.totalCost.toFixed(4)}`);
|
|
322
322
|
|
|
323
323
|
// Find cheapest model
|
|
@@ -335,7 +335,7 @@ const messages = [
|
|
|
335
335
|
];
|
|
336
336
|
|
|
337
337
|
const tokens = await client.countTokens('openai:gpt-5', messages);
|
|
338
|
-
const cost = client.modelRegistry.estimateCost('
|
|
338
|
+
const cost = client.modelRegistry.estimateCost('gpt-5', tokens, 1000);
|
|
339
339
|
```
|
|
340
340
|
|
|
341
341
|
Uses provider-specific methods (tiktoken for OpenAI, native APIs for Anthropic/Gemini).
|
|
@@ -438,6 +438,53 @@ Contributions welcome! Please ensure:
|
|
|
438
438
|
4. ✅ Types are properly defined
|
|
439
439
|
5. ✅ Examples/docs updated for API changes
|
|
440
440
|
|
|
441
|
+
### Commit Message Convention
|
|
442
|
+
|
|
443
|
+
This project follows [Conventional Commits](https://www.conventionalcommits.org/) specification. All commit messages must be formatted as:
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
<type>(<scope>): <subject>
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Types:**
|
|
450
|
+
- `feat:` - New feature (triggers minor version bump)
|
|
451
|
+
- `fix:` - Bug fix (triggers patch version bump)
|
|
452
|
+
- `docs:` - Documentation only changes
|
|
453
|
+
- `style:` - Code style changes (formatting, missing semi-colons, etc)
|
|
454
|
+
- `refactor:` - Code refactoring without feature changes
|
|
455
|
+
- `perf:` - Performance improvements
|
|
456
|
+
- `test:` - Adding or updating tests
|
|
457
|
+
- `build:` - Build system or dependency changes
|
|
458
|
+
- `ci:` - CI configuration changes
|
|
459
|
+
- `chore:` - Other changes that don't modify src or test files
|
|
460
|
+
|
|
461
|
+
**Breaking Changes:** Add `BREAKING CHANGE:` in the footer to trigger major version bump.
|
|
462
|
+
|
|
463
|
+
**Examples:**
|
|
464
|
+
```bash
|
|
465
|
+
feat(agent): add support for streaming tool calls
|
|
466
|
+
fix(cli): prevent crash on invalid gadget path
|
|
467
|
+
docs: update API documentation for v2
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
**Note:** Git hooks will validate your commit messages locally.
|
|
471
|
+
|
|
472
|
+
### Release Process
|
|
473
|
+
|
|
474
|
+
Releases are fully automated using [semantic-release](https://github.com/semantic-release/semantic-release):
|
|
475
|
+
|
|
476
|
+
1. Merge PR to `main` branch
|
|
477
|
+
2. CI workflow runs automatically
|
|
478
|
+
3. If CI passes, release workflow:
|
|
479
|
+
- Analyzes commits since last release
|
|
480
|
+
- Determines version bump based on commit types
|
|
481
|
+
- Updates `package.json` and `CHANGELOG.md`
|
|
482
|
+
- Creates git tag and GitHub release
|
|
483
|
+
- Publishes to npm
|
|
484
|
+
- Syncs changes back to `dev` branch
|
|
485
|
+
|
|
486
|
+
**No manual version bumps needed!**
|
|
487
|
+
|
|
441
488
|
---
|
|
442
489
|
|
|
443
490
|
## 📄 License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseGadget
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VYBRYR2S.js";
|
|
4
4
|
|
|
5
5
|
// src/gadgets/create-gadget.ts
|
|
6
6
|
function createGadget(config) {
|
|
@@ -19,4 +19,4 @@ function createGadget(config) {
|
|
|
19
19
|
export {
|
|
20
20
|
createGadget
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-I55AV3WV.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
init_client,
|
|
8
8
|
init_constants,
|
|
9
9
|
init_logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VYBRYR2S.js";
|
|
11
11
|
|
|
12
12
|
// src/gadgets/validation.ts
|
|
13
13
|
function validateAndApplyDefaults(schema, params) {
|
|
@@ -898,4 +898,4 @@ export {
|
|
|
898
898
|
MockGadgetBuilder,
|
|
899
899
|
mockGadget
|
|
900
900
|
};
|
|
901
|
-
//# sourceMappingURL=chunk-
|
|
901
|
+
//# sourceMappingURL=chunk-VRTKJK2X.js.map
|
|
@@ -91,17 +91,17 @@ var init_model_shortcuts = __esm({
|
|
|
91
91
|
"gpt5-mini": "openai:gpt-5-mini",
|
|
92
92
|
"gpt5-nano": "openai:gpt-5-nano",
|
|
93
93
|
// Anthropic aliases
|
|
94
|
-
sonnet: "anthropic:claude-
|
|
95
|
-
"claude-sonnet": "anthropic:claude-
|
|
96
|
-
haiku: "anthropic:claude-
|
|
97
|
-
"claude-haiku": "anthropic:claude-
|
|
98
|
-
opus: "anthropic:claude-
|
|
99
|
-
"claude-opus": "anthropic:claude-
|
|
94
|
+
sonnet: "anthropic:claude-sonnet-4-5",
|
|
95
|
+
"claude-sonnet": "anthropic:claude-sonnet-4-5",
|
|
96
|
+
haiku: "anthropic:claude-haiku-4-5",
|
|
97
|
+
"claude-haiku": "anthropic:claude-haiku-4-5",
|
|
98
|
+
opus: "anthropic:claude-opus-4-5",
|
|
99
|
+
"claude-opus": "anthropic:claude-opus-4-5",
|
|
100
100
|
// Gemini aliases
|
|
101
101
|
flash: "gemini:gemini-2.0-flash",
|
|
102
102
|
"gemini-flash": "gemini:gemini-2.0-flash",
|
|
103
|
-
"gemini-pro": "gemini:gemini-2.
|
|
104
|
-
pro: "gemini:gemini-2.
|
|
103
|
+
"gemini-pro": "gemini:gemini-2.5-pro",
|
|
104
|
+
pro: "gemini:gemini-2.5-pro"
|
|
105
105
|
};
|
|
106
106
|
KNOWN_MODEL_PATTERNS = [
|
|
107
107
|
/^gpt-?\d/i,
|
|
@@ -1707,30 +1707,6 @@ var init_anthropic_models = __esm({
|
|
|
1707
1707
|
"src/providers/anthropic-models.ts"() {
|
|
1708
1708
|
"use strict";
|
|
1709
1709
|
ANTHROPIC_MODELS = [
|
|
1710
|
-
{
|
|
1711
|
-
provider: "anthropic",
|
|
1712
|
-
modelId: "claude-opus-4-5-20251124",
|
|
1713
|
-
displayName: "Claude Opus 4.5",
|
|
1714
|
-
contextWindow: 2e5,
|
|
1715
|
-
maxOutputTokens: 64e3,
|
|
1716
|
-
pricing: {
|
|
1717
|
-
input: 5,
|
|
1718
|
-
output: 25,
|
|
1719
|
-
cachedInput: 0.5
|
|
1720
|
-
},
|
|
1721
|
-
knowledgeCutoff: "2025-03",
|
|
1722
|
-
features: {
|
|
1723
|
-
streaming: true,
|
|
1724
|
-
functionCalling: true,
|
|
1725
|
-
vision: true,
|
|
1726
|
-
reasoning: true
|
|
1727
|
-
},
|
|
1728
|
-
metadata: {
|
|
1729
|
-
family: "Claude 4",
|
|
1730
|
-
releaseDate: "2025-11-24",
|
|
1731
|
-
notes: "Most powerful model. 80.9% SWE-bench Verified, 66.3% OSWorld. Best for coding and computer use."
|
|
1732
|
-
}
|
|
1733
|
-
},
|
|
1734
1710
|
{
|
|
1735
1711
|
provider: "anthropic",
|
|
1736
1712
|
modelId: "claude-sonnet-4-5-20250929",
|
|
@@ -1919,6 +1895,79 @@ var init_anthropic_models = __esm({
|
|
|
1919
1895
|
releaseDate: "2024-03-07",
|
|
1920
1896
|
notes: "Legacy model - upgrade to Haiku 4.5 for better performance"
|
|
1921
1897
|
}
|
|
1898
|
+
},
|
|
1899
|
+
// Modern aliases (recommended by Anthropic)
|
|
1900
|
+
{
|
|
1901
|
+
provider: "anthropic",
|
|
1902
|
+
modelId: "claude-haiku-4-5",
|
|
1903
|
+
displayName: "Claude Haiku 4.5",
|
|
1904
|
+
contextWindow: 2e5,
|
|
1905
|
+
maxOutputTokens: 64e3,
|
|
1906
|
+
pricing: {
|
|
1907
|
+
input: 1,
|
|
1908
|
+
output: 5,
|
|
1909
|
+
cachedInput: 0.1
|
|
1910
|
+
},
|
|
1911
|
+
knowledgeCutoff: "2025-02",
|
|
1912
|
+
features: {
|
|
1913
|
+
streaming: true,
|
|
1914
|
+
functionCalling: true,
|
|
1915
|
+
vision: true,
|
|
1916
|
+
reasoning: true
|
|
1917
|
+
},
|
|
1918
|
+
metadata: {
|
|
1919
|
+
family: "Claude 4",
|
|
1920
|
+
releaseDate: "2025-10-01",
|
|
1921
|
+
notes: "Alias for claude-haiku-4-5-20251001. Fastest model with near-frontier intelligence."
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
provider: "anthropic",
|
|
1926
|
+
modelId: "claude-sonnet-4-5",
|
|
1927
|
+
displayName: "Claude Sonnet 4.5",
|
|
1928
|
+
contextWindow: 2e5,
|
|
1929
|
+
maxOutputTokens: 64e3,
|
|
1930
|
+
pricing: {
|
|
1931
|
+
input: 3,
|
|
1932
|
+
output: 15,
|
|
1933
|
+
cachedInput: 0.3
|
|
1934
|
+
},
|
|
1935
|
+
knowledgeCutoff: "2025-01",
|
|
1936
|
+
features: {
|
|
1937
|
+
streaming: true,
|
|
1938
|
+
functionCalling: true,
|
|
1939
|
+
vision: true,
|
|
1940
|
+
reasoning: true
|
|
1941
|
+
},
|
|
1942
|
+
metadata: {
|
|
1943
|
+
family: "Claude 4",
|
|
1944
|
+
releaseDate: "2025-09-29",
|
|
1945
|
+
notes: "Alias for claude-sonnet-4-5-20250929. Smartest model for complex agents and coding."
|
|
1946
|
+
}
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
provider: "anthropic",
|
|
1950
|
+
modelId: "claude-opus-4-5",
|
|
1951
|
+
displayName: "Claude Opus 4.5",
|
|
1952
|
+
contextWindow: 2e5,
|
|
1953
|
+
maxOutputTokens: 64e3,
|
|
1954
|
+
pricing: {
|
|
1955
|
+
input: 5,
|
|
1956
|
+
output: 25,
|
|
1957
|
+
cachedInput: 0.5
|
|
1958
|
+
},
|
|
1959
|
+
knowledgeCutoff: "2025-03",
|
|
1960
|
+
features: {
|
|
1961
|
+
streaming: true,
|
|
1962
|
+
functionCalling: true,
|
|
1963
|
+
vision: true,
|
|
1964
|
+
reasoning: true
|
|
1965
|
+
},
|
|
1966
|
+
metadata: {
|
|
1967
|
+
family: "Claude 4",
|
|
1968
|
+
releaseDate: "2025-11-24",
|
|
1969
|
+
notes: "Alias for claude-opus-4-5-20251124. Most powerful model for coding and computer use."
|
|
1970
|
+
}
|
|
1922
1971
|
}
|
|
1923
1972
|
];
|
|
1924
1973
|
}
|
|
@@ -4445,4 +4494,4 @@ export {
|
|
|
4445
4494
|
init_builder,
|
|
4446
4495
|
BaseGadget
|
|
4447
4496
|
};
|
|
4448
|
-
//# sourceMappingURL=chunk-
|
|
4497
|
+
//# sourceMappingURL=chunk-VYBRYR2S.js.map
|