@vierratale/ai 0.1.0-beta.3 → 0.1.0-beta.4

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 CHANGED
@@ -16,7 +16,7 @@ npx @vierratale/ai
16
16
 
17
17
  ```bash
18
18
  vierrataleai # Start chat (auto-detect provider)
19
- vierrataleai --provider ollama # Use local models
19
+ vierrataleai --provider cortex # Use local models
20
20
  vierrataleai --provider openai # Use cloud models
21
21
  vierrataleai --model vierratale-pro # Use specific model
22
22
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vierratale/ai",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "VierrataleAI - Intelligent terminal assistant",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -29,7 +29,7 @@ ${Branding.APP_NAME} ${Branding.VERSION}
29
29
  Usage: vierrataleai [options]
30
30
 
31
31
  Options:
32
- --provider, -p <name> Provider: ollama, openai (default: auto-detect)
32
+ --provider, -p <name> Provider: cortex, openai (default: auto-detect)
33
33
  --model, -m <name> Model: vierratale-lite/fast/balanced/pro/cloud
34
34
  --clear Clear screen on start
35
35
  --version, -v Show version
@@ -47,7 +47,7 @@ Commands (in chat):
47
47
  `);
48
48
  }
49
49
 
50
- async function answerWithSearch(messages, provider, query) {
50
+ async function answerWithSearch(messages, provider, query, systemPrompt) {
51
51
  Terminal.printInfo('Searching the web...');
52
52
  const results = await WebSearch.search(query);
53
53
 
@@ -156,7 +156,7 @@ async function chat(provider, systemPrompt) {
156
156
  }
157
157
 
158
158
  if (cmd === '/models') {
159
- const models = provider.name === 'ollama'
159
+ const models = provider.name === 'cortex'
160
160
  ? Catalog.getLocalModels()
161
161
  : Catalog.getCloudModels();
162
162
  Terminal.printInfo('Available models:');
@@ -188,7 +188,7 @@ async function chat(provider, systemPrompt) {
188
188
 
189
189
  if (cmd.startsWith('/provider ')) {
190
190
  const prov = cmd.split(' ')[1];
191
- if (['ollama', 'openai'].includes(prov)) {
191
+ if (['cortex', 'openai'].includes(prov)) {
192
192
  Config.save({ provider: prov });
193
193
  Terminal.printSuccess(`Provider: ${prov}`);
194
194
  } else {
@@ -208,14 +208,14 @@ async function chat(provider, systemPrompt) {
208
208
  Terminal.printWarning('Usage: /search <query>');
209
209
  continue;
210
210
  }
211
- await answerWithSearch(messages, provider, query);
211
+ await answerWithSearch(messages, provider, query, systemPrompt);
212
212
  continue;
213
213
  }
214
214
 
215
215
  const intent = detectIntent(trimmed);
216
216
  if (intent.type === 'knowledge') {
217
217
  Terminal.printSuccess(`Auto-search: "${trimmed}"`);
218
- await answerWithSearch(messages, provider, trimmed);
218
+ await answerWithSearch(messages, provider, trimmed, systemPrompt);
219
219
  continue;
220
220
  }
221
221
 
package/src/config.js CHANGED
@@ -8,7 +8,7 @@ const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
8
8
  const DEFAULTS = {
9
9
  provider: 'auto',
10
10
  model: 'vierratale-fast',
11
- ollamaHost: 'http://127.0.0.1:11434',
11
+ engineHost: 'http://127.0.0.1:11434',
12
12
  numCtx: 8192,
13
13
  temperature: 0.7,
14
14
  maxTokens: 4096,
@@ -33,10 +33,12 @@ export const Config = {
33
33
 
34
34
  load() {
35
35
  const file = loadConfigFile();
36
+ // Migrate legacy 'cortexHost' key to 'engineHost' if present.
37
+ const engineHost = file.engineHost || file.cortexHost || DEFAULTS.engineHost;
36
38
  this._config = {
37
39
  provider: getEnv('VIERRATALE_PROVIDER', file.provider || DEFAULTS.provider),
38
40
  model: getEnv('VIERRATALE_MODEL', file.model || DEFAULTS.model),
39
- ollamaHost: getEnv('VIERRATALE_OLLAMA_HOST', file.ollamaHost || DEFAULTS.ollamaHost),
41
+ engineHost: getEnv('VIERRATALE_ENGINE_HOST', engineHost),
40
42
  numCtx: parseInt(getEnv('VIERRATALE_NUM_CTX', String(file.numCtx || DEFAULTS.numCtx))),
41
43
  temperature: parseFloat(getEnv('VIERRATALE_TEMPERATURE', String(file.temperature || DEFAULTS.temperature))),
42
44
  maxTokens: parseInt(getEnv('VIERRATALE_MAX_TOKENS', String(file.maxTokens || DEFAULTS.maxTokens))),
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { Catalog } from './catalog.js';
2
2
  export { Config } from './config.js';
3
3
  export { Installer } from './installer.js';
4
- export { OllamaProvider } from './providers/ollama.js';
4
+ export { CortexProvider } from './providers/cortex.js';
5
5
  export { OpenAIProvider } from './providers/openai.js';
6
6
  export { Branding } from './ui/branding.js';
package/src/installer.js CHANGED
@@ -9,23 +9,23 @@ function runSilent(cmd) {
9
9
  });
10
10
  }
11
11
 
12
- function isOllamaRunning(host) {
12
+ function isEngineRunning(host) {
13
13
  return fetch(`${host}/api/tags`, { signal: AbortSignal.timeout(3000) })
14
14
  .then((r) => r.ok)
15
15
  .catch(() => false);
16
16
  }
17
17
 
18
- function isOllamaInstalled() {
18
+ function isEngineInstalled() {
19
19
  try {
20
- execSync('which ollama 2>/dev/null', { stdio: 'ignore' });
20
+ execSync('which cortex 2>/dev/null', { stdio: 'ignore' });
21
21
  return true;
22
22
  } catch {}
23
- const paths = ['/usr/local/bin/ollama', '/usr/bin/ollama'];
23
+ const paths = ['/usr/local/bin/cortex', '/usr/bin/cortex'];
24
24
  return paths.some((p) => existsSync(p));
25
25
  }
26
26
 
27
- async function installOllama() {
28
- await runSilent('curl -fsSL https://ollama.com/install.sh | sh');
27
+ async function installEngine() {
28
+ await runSilent('curl -fsSL https://cortex.com/install.sh | sh');
29
29
  }
30
30
 
31
31
  async function pullModel(host, model) {
@@ -55,16 +55,16 @@ async function getInstalledModels(host) {
55
55
 
56
56
  export const Installer = {
57
57
  async ensure() {
58
- const host = Config.get('ollamaHost');
58
+ const host = Config.get('engineHost');
59
59
 
60
- if (!isOllamaInstalled()) {
61
- await installOllama();
60
+ if (!isEngineInstalled()) {
61
+ await installEngine();
62
62
  }
63
63
 
64
- const running = await isOllamaRunning(host);
64
+ const running = await isEngineRunning(host);
65
65
  if (!running) {
66
66
  try {
67
- execSync('ollama serve &', { stdio: 'ignore' });
67
+ execSync('cortex serve &', { stdio: 'ignore' });
68
68
  await new Promise((r) => setTimeout(r, 3000));
69
69
  } catch {}
70
70
  }
@@ -83,7 +83,7 @@ export const Installer = {
83
83
  },
84
84
 
85
85
  async isReady() {
86
- const host = Config.get('ollamaHost');
87
- return isOllamaRunning(host);
86
+ const host = Config.get('engineHost');
87
+ return isEngineRunning(host);
88
88
  },
89
89
  };
@@ -2,10 +2,10 @@ import { BaseProvider } from './base.js';
2
2
  import { Catalog } from '../catalog.js';
3
3
  import { Config } from '../config.js';
4
4
 
5
- export class OllamaProvider extends BaseProvider {
5
+ export class CortexProvider extends BaseProvider {
6
6
  constructor() {
7
- super('ollama');
8
- this.host = Config.get('ollamaHost');
7
+ super('cortex');
8
+ this.host = Config.get('engineHost');
9
9
  }
10
10
 
11
11
  get displayName() {
@@ -40,12 +40,12 @@ export class OllamaProvider extends BaseProvider {
40
40
  const model = Catalog.getRealModel(options.model || Config.get('model'));
41
41
  const systemPrompt = options.systemPrompt || '';
42
42
 
43
- const ollamaMessages = [];
43
+ const engineMessages = [];
44
44
  if (systemPrompt) {
45
- ollamaMessages.push({ role: 'system', content: systemPrompt });
45
+ engineMessages.push({ role: 'system', content: systemPrompt });
46
46
  }
47
47
  for (const msg of messages) {
48
- ollamaMessages.push({ role: msg.role, content: msg.content });
48
+ engineMessages.push({ role: msg.role, content: msg.content });
49
49
  }
50
50
 
51
51
  const resp = await fetch(`${this.host}/api/chat`, {
@@ -53,7 +53,7 @@ export class OllamaProvider extends BaseProvider {
53
53
  headers: { 'Content-Type': 'application/json' },
54
54
  body: JSON.stringify({
55
55
  model,
56
- messages: ollamaMessages,
56
+ messages: engineMessages,
57
57
  stream: true,
58
58
  options: {
59
59
  num_ctx: Config.get('numCtx'),
@@ -1,4 +1,4 @@
1
- import { OllamaProvider } from './ollama.js';
1
+ import { CortexProvider } from './cortex.js';
2
2
  import { OpenAIProvider } from './openai.js';
3
3
  import { Config } from '../config.js';
4
4
 
@@ -7,7 +7,7 @@ let providers = {};
7
7
  function getProviders() {
8
8
  if (Object.keys(providers).length === 0) {
9
9
  providers = {
10
- ollama: new OllamaProvider(),
10
+ cortex: new CortexProvider(),
11
11
  openai: new OpenAIProvider(),
12
12
  };
13
13
  }
@@ -23,7 +23,7 @@ export const ProviderFactory = {
23
23
  if (await ps[requested].isAvailable()) return ps[requested];
24
24
  }
25
25
 
26
- for (const name of ['ollama', 'openai']) {
26
+ for (const name of ['cortex', 'openai']) {
27
27
  if (await ps[name].isAvailable()) return ps[name];
28
28
  }
29
29
 
@@ -1,6 +1,6 @@
1
1
  export const Branding = {
2
2
  APP_NAME: 'VierrataleAI',
3
- VERSION: '0.1.0-beta.3',
3
+ VERSION: '0.1.0-beta.4',
4
4
 
5
5
  colors: {
6
6
  primary: '\x1b[38;2;124;58;237m',