@onmars/lunar-agent-claude 0.14.0 → 0.15.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onmars/lunar-agent-claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
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.15.1"
|
|
16
16
|
},
|
|
17
17
|
"description": "Claude CLI agent adapter for Lunar",
|
|
18
18
|
"author": "onMars Tech",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* 'opus' → 'claude-opus-4-7', 'sonnet' → 'claude-sonnet-4-6', etc.
|
|
31
31
|
* Unknown names pass through unchanged.
|
|
32
32
|
*/
|
|
33
|
-
import { beforeEach, describe, expect, it, mock, spyOn } from 'bun:test'
|
|
33
|
+
import { afterEach, beforeEach, describe, expect, it, mock, spyOn } from 'bun:test'
|
|
34
34
|
import { ClaudeAgent, type ClaudeAgentOptions } from '../adapter'
|
|
35
35
|
|
|
36
36
|
// ─── Helpers ────────────────────────────────────────────────────────
|
|
@@ -395,20 +395,26 @@ describe('buildEnv', () => {
|
|
|
395
395
|
|
|
396
396
|
beforeEach(() => {
|
|
397
397
|
// Clean env for predictable tests
|
|
398
|
-
process.env
|
|
398
|
+
for (const key of Object.keys(process.env)) {
|
|
399
|
+
delete process.env[key]
|
|
400
|
+
}
|
|
401
|
+
Object.assign(process.env, {
|
|
399
402
|
HOME: '/home/testuser',
|
|
400
403
|
PATH: '/usr/bin',
|
|
401
404
|
USER: 'testuser',
|
|
402
405
|
ANTHROPIC_API_KEY: 'sk-test-key',
|
|
403
406
|
ANTHROPIC_AUTH_TOKEN: 'oauth-test-token',
|
|
404
407
|
DISCORD_TOKEN: 'discord-secret',
|
|
405
|
-
}
|
|
408
|
+
})
|
|
406
409
|
})
|
|
407
410
|
|
|
408
411
|
// Restore after each test
|
|
409
|
-
|
|
410
|
-
process.env
|
|
411
|
-
|
|
412
|
+
afterEach(() => {
|
|
413
|
+
for (const key of Object.keys(process.env)) {
|
|
414
|
+
delete process.env[key]
|
|
415
|
+
}
|
|
416
|
+
Object.assign(process.env, originalEnv)
|
|
417
|
+
})
|
|
412
418
|
|
|
413
419
|
// --- Auth mode: stored (default) ---
|
|
414
420
|
|
|
@@ -570,9 +576,6 @@ describe('buildEnv', () => {
|
|
|
570
576
|
expect(env.MY_VAR).toBe('my_value')
|
|
571
577
|
})
|
|
572
578
|
})
|
|
573
|
-
|
|
574
|
-
// Cleanup
|
|
575
|
-
afterEach()
|
|
576
579
|
})
|
|
577
580
|
|
|
578
581
|
// ═══════════════════════════════════════════════════════════════════
|