@onmars/lunar-agent-claude 0.6.1 → 0.7.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/package.json +2 -2
- package/src/__tests__/adapter.test.ts +7 -7
- package/src/adapter.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onmars/lunar-agent-claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@onmars/lunar-core": "^0.
|
|
15
|
+
"@onmars/lunar-core": "^0.7.0"
|
|
16
16
|
},
|
|
17
17
|
"description": "Claude CLI agent adapter for Lunar",
|
|
18
18
|
"author": "onMars Tech",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* ## resolveModelAlias() — Model name resolution
|
|
29
29
|
* Maps short aliases to full Claude model IDs.
|
|
30
|
-
* 'opus' → 'claude-opus-4-
|
|
30
|
+
* 'opus' → 'claude-opus-4-7', 'sonnet' → 'claude-sonnet-4-6', etc.
|
|
31
31
|
* Unknown names pass through unchanged.
|
|
32
32
|
*/
|
|
33
33
|
import { beforeEach, describe, expect, it, mock, spyOn } from 'bun:test'
|
|
@@ -216,8 +216,8 @@ describe('buildArgs', () => {
|
|
|
216
216
|
const agent = createAgent({ model: 'opus', context1m: true })
|
|
217
217
|
const args = callBuildArgs(agent, { prompt: 'hello' })
|
|
218
218
|
|
|
219
|
-
// 'opus' alias resolves to 'claude-opus-4-
|
|
220
|
-
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-
|
|
219
|
+
// 'opus' alias resolves to 'claude-opus-4-7', then gets [1m]
|
|
220
|
+
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-7[1m]')
|
|
221
221
|
})
|
|
222
222
|
|
|
223
223
|
it('resolves "sonnet" alias with context1m', () => {
|
|
@@ -274,7 +274,7 @@ describe('buildArgs', () => {
|
|
|
274
274
|
const agent = createAgent({ model: 'opus', context1m: false })
|
|
275
275
|
const args = callBuildArgs(agent, { prompt: 'hello', context1m: true })
|
|
276
276
|
|
|
277
|
-
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-
|
|
277
|
+
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-7[1m]')
|
|
278
278
|
})
|
|
279
279
|
|
|
280
280
|
it('per-query model + context1m together', () => {
|
|
@@ -310,7 +310,7 @@ describe('buildArgs', () => {
|
|
|
310
310
|
expect(args[8]).toBe('--append-system-prompt')
|
|
311
311
|
expect(args[9]).toBe('Be concise')
|
|
312
312
|
expect(args[10]).toBe('--model')
|
|
313
|
-
expect(args[11]).toBe('claude-opus-4-
|
|
313
|
+
expect(args[11]).toBe('claude-opus-4-7[1m]')
|
|
314
314
|
expect(args[12]).toBe('--max-turns')
|
|
315
315
|
expect(args[13]).toBe('5')
|
|
316
316
|
expect(args[14]).toBe('--permission-mode')
|
|
@@ -741,10 +741,10 @@ describe('ClaudeAgent — destroy', () => {
|
|
|
741
741
|
// ═══════════════════════════════════════════════════════════════════
|
|
742
742
|
|
|
743
743
|
describe('model alias resolution', () => {
|
|
744
|
-
it('opus → claude-opus-4-
|
|
744
|
+
it('opus → claude-opus-4-7 (only with context1m)', () => {
|
|
745
745
|
const agent = createAgent({ model: 'opus', context1m: true })
|
|
746
746
|
const args = callBuildArgs(agent, { prompt: 'test' })
|
|
747
|
-
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-
|
|
747
|
+
expect(args[args.indexOf('--model') + 1]).toBe('claude-opus-4-7[1m]')
|
|
748
748
|
})
|
|
749
749
|
|
|
750
750
|
it('sonnet → claude-sonnet-4-6 (only with context1m)', () => {
|
package/src/adapter.ts
CHANGED
|
@@ -46,7 +46,8 @@ export interface ClaudeAgentOptions {
|
|
|
46
46
|
* This map resolves common aliases before appending the suffix.
|
|
47
47
|
*/
|
|
48
48
|
export const CLAUDE_MODEL_ALIASES: Record<string, string> = {
|
|
49
|
-
opus: 'claude-opus-4-
|
|
49
|
+
opus: 'claude-opus-4-7',
|
|
50
|
+
'opus-4.6': 'claude-opus-4-6',
|
|
50
51
|
sonnet: 'claude-sonnet-4-6',
|
|
51
52
|
'sonnet-4.5': 'claude-sonnet-4-5',
|
|
52
53
|
haiku: 'claude-haiku-4-5',
|