skimpyclaw 0.1.4 → 0.1.6

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.
@@ -57,25 +57,12 @@ describe('ToolCallGuard', () => {
57
57
  }
58
58
  });
59
59
  });
60
- describe('token budget', () => {
61
- it('does not exceed with small usage', () => {
62
- const guard = new ToolCallGuard(100_000);
63
- const r = guard.recordTokens(1000, 500);
64
- expect(r.exceeded).toBe(false);
65
- expect(r.warning).toBeUndefined();
66
- });
67
- it('warns at 80% usage', () => {
68
- const guard = new ToolCallGuard(10_000);
69
- const r = guard.recordTokens(4000, 4100);
70
- expect(r.exceeded).toBe(false);
71
- expect(r.warning).toBeDefined();
72
- expect(r.warning).toContain('warning');
73
- });
74
- it('exceeds at 100% usage', () => {
75
- const guard = new ToolCallGuard(10_000);
76
- const r = guard.recordTokens(5000, 5000);
77
- expect(r.exceeded).toBe(true);
78
- expect(r.warning).toContain('exceeded');
60
+ describe('token tracking', () => {
61
+ it('tracks tokens without enforcement', () => {
62
+ const guard = new ToolCallGuard();
63
+ guard.recordTokens(5000, 5000);
64
+ const stats = guard.getStats();
65
+ expect(stats.totalTokens).toBe(10000);
79
66
  });
80
67
  });
81
68
  describe('reset', () => {
package/dist/api.js CHANGED
@@ -22,6 +22,16 @@ import { initHeartbeat, stopHeartbeat } from './heartbeat.js';
22
22
  import { initActiveChannel, stopActiveChannel, startActiveChannel } from './channels.js';
23
23
  import { setCodeAgentConfig } from './tools.js';
24
24
  import { resolveModelSelection } from './model-selection.js';
25
+ const DEFAULT_MODEL_ALIASES = {
26
+ 'claude-fast': 'anthropic/claude-haiku-4-5',
27
+ 'claude-think': 'anthropic/claude-sonnet-4-6',
28
+ 'claude-opus': 'anthropic/claude-opus-4-6',
29
+ 'codex5.1': 'codex/gpt-5.1-codex',
30
+ 'codex5.2': 'codex/gpt-5.2-codex',
31
+ 'codex5.3': 'codex/gpt-5.3-codex',
32
+ minimax: 'minimax/MiniMax-M2.5',
33
+ kimi: 'kimi/kimi-for-coding',
34
+ };
25
35
  function validateFilename(filename) {
26
36
  return !filename.includes('..') && filename === basename(filename);
27
37
  }
@@ -413,9 +423,16 @@ export function registerDashboardAPI(fastify, config) {
413
423
  });
414
424
  // --- Model ---
415
425
  fastify.get('/api/dashboard/model', async () => {
426
+ const aliases = runtimeConfig.models?.aliases || {};
427
+ const mergedAliases = Object.keys(aliases).length > 0
428
+ ? aliases
429
+ : DEFAULT_MODEL_ALIASES;
430
+ const currentModel = getCurrentModel()
431
+ || runtimeConfig.agents?.list?.[runtimeConfig.agents?.default]?.model
432
+ || 'claude-opus';
416
433
  return {
417
- current: getCurrentModel(),
418
- aliases: runtimeConfig.models.aliases,
434
+ current: currentModel,
435
+ aliases: mergedAliases,
419
436
  agents: Object.fromEntries(Object.entries(runtimeConfig.agents.list).map(([id, agent]) => [id, agent.model])),
420
437
  };
421
438
  });