clarity-ai 6.4.0 → 6.4.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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ---
4
4
 
5
- ## 6.4.0 (2026-06-06)
5
+ ## 6.4.1 (2026-06-06)
6
6
 
7
7
  ### Clarity Flash 14B Model
8
8
  - Added `Clarity Flash 14B` to `/model` picker — 128K context, HuggingFace Inference API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-ai",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "description": "Premium terminal AI agent — Clarity Flash 14B model, HF Inference API, fixed-height viewport, TrueColor theme",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,9 @@ export async function* callAI(providerName, model, messages, options = {}) {
22
22
  if (!provider) throw { type: 'config_error', message: 'Unknown provider: ' + providerName };
23
23
 
24
24
  const key = getKey(providerName);
25
- if (!key) throw { type: 'auth_error', provider: providerName, message: 'No API key set for ' + providerName, hint: '/keys ' + providerName + ' <your-key>' };
25
+ if (!key && providerName !== 'huggingface') {
26
+ throw { type: 'auth_error', provider: providerName, message: 'No API key set for ' + providerName, hint: '/keys ' + providerName + ' <your-key>' };
27
+ }
26
28
 
27
29
  const modelName = model.replace(/^[^/]+\//, '');
28
30
 
@@ -42,13 +44,13 @@ export async function* callAI(providerName, model, messages, options = {}) {
42
44
  const extraHeaders = {};
43
45
  if (providerName === 'huggingface') {
44
46
  endpoint = provider.endpoint + '/' + modelName + '/v1/chat/completions';
45
- extraHeaders['Authorization'] = 'Bearer ' + key;
47
+ if (key) extraHeaders['Authorization'] = 'Bearer ' + key;
46
48
  } else if (providerName === 'openrouter') {
47
49
  extraHeaders['HTTP-Referer'] = 'https://clarity-ai.local';
48
50
  extraHeaders['X-Title'] = 'CLARITY AI';
49
51
  }
50
52
 
51
- const stream = streamResponse(endpoint, body, key, extraHeaders, options.signal);
53
+ const stream = streamResponse(endpoint, body, key || 'none', extraHeaders, options.signal);
52
54
  for await (const event of stream) {
53
55
  yield event;
54
56
  }