@vierratale/ai 0.1.0-beta.7 → 0.1.0-beta.9

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
@@ -23,7 +23,7 @@ vierrataleai --provider cortex # Use local models
23
23
  vierrataleai --provider openai # Use cloud models (OpenAI)
24
24
  vierrataleai --provider anthropic # Use cloud models (Claude)
25
25
  vierrataleai --provider gemini # Use cloud models (Gemini)
26
- vierrataleai --model vierratale-pro # Use specific model
26
+ vierrataleai --model VRTL-6.pro # Use specific model
27
27
  ```
28
28
 
29
29
  ## Models
@@ -32,23 +32,27 @@ Local models run through the **Cortex** engine:
32
32
 
33
33
  | Model | Backend |
34
34
  |-------|---------|
35
- | vierratale-lite | qwen2.5-coder:0.5b |
36
- | vierratale-fast | qwen2.5-coder:1.5b |
37
- | vierratale-small | qwen2.5-coder:3b |
38
- | vierratale-balanced | qwen2.5-coder:7b |
39
- | vierratale-plus | qwen2.5-coder:14b |
40
- | vierratale-pro | qwen2.5-coder:32b |
35
+ | VRTL-1.lite | qwen3:0.6b |
36
+ | VRTL-2.fast | gemma3:1b |
37
+ | VRTL-3.small | llama3.2:1b |
38
+ | VRTL-4.balanced | qwen2.5:1.5b |
39
+ | VRTL-5.plus | qwen3:1.7b |
40
+ | VRTL-6.pro | qwen2.5:3b |
41
41
 
42
42
  Cloud models are available when the matching provider + API key is configured:
43
43
 
44
44
  | Model | Backend |
45
45
  |-------|---------|
46
- | vierratale-cloud-mini | gpt-4o-mini (OpenAI) |
47
- | vierratale-cloud | gpt-4o (OpenAI) |
48
- | vierratale-cloud-fast | claude-3-5-haiku-20241022 (Anthropic) |
49
- | vierratale-cloud-pro | claude-sonnet-4-20250514 (Anthropic) |
50
- | vierratale-cloud-lite | gemini-2.0-flash (Gemini) |
51
- | vierratale-cloud-plus | gemini-1.5-pro (Gemini) |
46
+ | VRTL-7.cloud-mini | gpt-4o-mini (OpenAI) |
47
+ | VRTL-8.cloud | gpt-4o (OpenAI) |
48
+ | VRTL-9.cloud-fast | claude-3-5-haiku-20241022 (Anthropic) |
49
+ | VRTL-10.cloud-pro | claude-sonnet-4-20250514 (Anthropic) |
50
+ | VRTL-11.cloud-lite | gemini-2.0-flash (Gemini) |
51
+ | VRTL-12.cloud-plus | gemini-1.5-pro (Gemini) |
52
+
53
+ > Legacy `vierratale-*` model names (e.g. `vierratale-fast`, `vierratale-cloud`)
54
+
55
+ > still work and are stored as VRTL names.
52
56
 
53
57
  ## Commands
54
58
 
@@ -58,6 +62,8 @@ Cloud models are available when the matching provider + API key is configured:
58
62
  - `/models` - List available models
59
63
  - `/system [text]` - Set a custom system prompt / persona
60
64
  - `/search <query>` - Search the web and summarize with AI
65
+ - `/fetch <url>` - Open a link and summarize its content
66
+ - `/log [n|path]` - Show the last n log entries (default 30) or the log file path
61
67
  - `/clear` - Clear screen
62
68
  - `/new` - Start a new conversation (clear memory)
63
69
  - `/quit` - Exit
@@ -65,14 +71,112 @@ Cloud models are available when the matching provider + API key is configured:
65
71
  ## Smart Search
66
72
 
67
73
  Asking a question (Who/What/When/Where/Why/How...?) automatically searches the
68
- web and summarizes the results with AI. For example:
74
+ web and summarizes the results with AI. Bare mentions of specific topics also
75
+ trigger a search — e.g. `timun mas from indonesia`, `the legend of roro
76
+ jonggrang`. For example:
69
77
 
70
78
  ```
71
79
  > Who is Cristiano Ronaldo?
80
+ > timun mas from indonesia
81
+ ```
82
+
83
+ triggers a live web search and answers from the results. If no web results come
84
+ back, the AI answers from its own knowledge instead of going quiet. Use
85
+ `/search <query>` to force a search explicitly.
86
+
87
+ Story requests about any subject work the same way — no matter how they're
88
+ phrased (`a story about X`, `the legend of X`, `tell me about X`, `narrate the
89
+ tale of X`, `write X into a txt file`). The subject is pulled out of the
90
+ sentence, searched first, and the reply is saved to a `<subject>.txt` file.
91
+ A generic `tell me a story` (no subject) is told directly from the model — and
92
+ is also saved to a `.txt` file.
93
+
94
+ Greetings (`hi`, `hello`, `hey`, `good morning`, ...) are answered instantly
95
+ with a short fixed reply — they never reach the model.
96
+
97
+ ## Writing Files
98
+
99
+ Ask the AI to create code, configs, scripts, web pages, or a whole project. When it
100
+ responds, it lists each file with a `FILE: <path>` header followed by a code
101
+ fence (and `FOLDER: <path>` for empty folders) — just running in the chat writes
102
+ them to your disk in the current working directory. Any file type is supported,
103
+ including JSON config files and HTML pages. Nested folders are created automatically, existing
104
+ files are skipped unless you confirm to overwrite, and nothing is ever written
105
+ outside the working directory.
106
+
107
+ If the AI ever answers with the code but forgets the `FILE:` header (or writes an
108
+ HTML page without a fence), the assistant rescues it: any `FILE: <path>` line in
109
+ the reply is honored even without a fence, otherwise the request is used to
110
+ infer a filename and the code block is saved anyway. Filename inference covers
111
+ many formats, not just web pages:
112
+
113
+ | Request contains… | Saved as |
114
+ |--------------------|----------|
115
+ | `html` / `webpage` / `website` / `page` | `index.html` |
116
+ | `css` | `style.css` |
117
+ | `python` / `py` | `script.py` |
118
+ | `flask` / `django` / `fastapi` / `streamlit` / `app` | `app.py` |
119
+ | `javascript` / `js` / `script` | `script.js` |
120
+ | `typescript` / `ts` | `script.ts` |
121
+ | `bash` / `zsh` / `shell` | `script.sh` |
122
+ | `json` / `yaml` / `yml` / `csv` / `sql` | `output.json` / `.yml` / `.csv` / `.sql` |
123
+
124
+ When the request has no hint at all, the fence language in the reply picks the
125
+ name (```python → `script.py`, ```css → `style.css`, …). Saving also kicks in
126
+ whenever the reply itself contains a `FILE:`/`FOLDER:` line, or when a reply is
127
+ basically just one substantial code block, even if the request phrasing wasn't
128
+ matched.
129
+
130
+ For file requests, a short format instruction is silently attached to your
131
+ message so the model emits complete `FILE:` blocks with closed fences. And if
132
+ the model ever answers a file request *without any code* (free-style prose,
133
+ interrupted before a fence), nothing is saved and you get a notice telling you
134
+ to ask again — a `.py` file full of chatter is never created.
135
+
136
+ Example of what the AI emits:
137
+
138
+ ```
139
+ FILE: config.json
140
+ ```json
141
+ {
142
+ "name": "my-app",
143
+ "port": 3000
144
+ }
145
+ ```
146
+
147
+ FILE: index.html
148
+ ```html
149
+ <!doctype html>
150
+ <html><body>Hello</body></html>
72
151
  ```
73
152
 
74
- triggers a live web search and answers from the results. Use `/search <query>`
75
- to force a search explicitly.
153
+ FILE: src/hello.js
154
+ ```js
155
+ console.log('Hello VierrataleAI');
156
+ ```
157
+
158
+ ## Chat UI
159
+
160
+ The chat runs in a clean, minimal full-screen interface: your turns are labelled
161
+ `You` and the assistant's `AI`, with plain wrapped text in between. Code blocks
162
+ are the exception — they render inside a green bordered box with their language
163
+ tag (`╭─ html ─╮`), so files stand out at a glance. The latest reply stays pinned
164
+ to the bottom of the terminal while it streams in (no screen flashing), and
165
+ internal search/fetch context stays hidden.
166
+
167
+ ## Automatic Logging
168
+
169
+ Everything that happens in a session is written automatically to a per-day log
170
+ file in `~/.config/vierrataleai/logs/` (e.g. `vierrataleai-20260101.log`):
171
+ app/session start, every user message, every AI reply, every file write or
172
+ skip, and any errors — with a timestamp. The logs are plain text and safe to
173
+ grep. To inspect them from inside the chat:
174
+
175
+ ```
176
+ /log # show the last 30 entries
177
+ /log 100 # show the last 100 entries
178
+ /log path # print the log file path
179
+ ```
76
180
 
77
181
  ## Conversation Memory
78
182
 
@@ -1,3 +1,76 @@
1
1
  #!/usr/bin/env node
2
+ // VierrataleAI launcher + installer.
3
+ //
4
+ // Running without flags starts the assistant (same as before).
5
+ // Running with --install (or --setup / install) installs the engine + model and
6
+ // creates a global "vierrataleai" command, then starts the assistant.
7
+ //
8
+ // Installation progress is always the fake animated bar — real engine/model
9
+ // output is deliberately hidden so first-run feels quick and clean.
2
10
  import { run } from '../src/cli.js';
3
- run();
11
+ import { Installer } from '../src/installer.js';
12
+ import { Config } from '../src/config.js';
13
+ import { Branding } from '../src/ui/branding.js';
14
+ import { Terminal } from '../src/ui/terminal.js';
15
+
16
+ const C = Branding.colors;
17
+
18
+ const INSTALL_STEPS = [
19
+ 'Checking the AI engine',
20
+ 'Installing dependencies',
21
+ 'Downloading the model',
22
+ 'Linking the vierrataleai command',
23
+ 'Optimizing for this device',
24
+ ];
25
+
26
+ function delay(ms) {
27
+ return new Promise((r) => setTimeout(r, ms));
28
+ }
29
+
30
+ async function fakeProgress(steps, work) {
31
+ const frames = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
32
+ let i = 0;
33
+ const tty = process.stdout.isTTY;
34
+ const timer = setInterval(() => {
35
+ if (!tty) return;
36
+ i++;
37
+ const stage = steps[Math.floor((i / 10) % steps.length)];
38
+ const pct = String(8 + ((i * 7) % 85)).padStart(3, ' ');
39
+ const bar = frames[i % frames.length];
40
+ const fillLen = 1 + (i % 20);
41
+ const fill = '█'.repeat(fillLen) + '░'.repeat(Math.max(0, 20 - fillLen));
42
+ process.stdout.write(`\r ${C.accent}${bar}${C.reset} ${C.bold}${pct}%${C.reset} ${C.dim}${stage}${C.reset} [${C.accent}${fill}${C.reset}]`);
43
+ }, 110);
44
+ try {
45
+ return await work;
46
+ } finally {
47
+ clearInterval(timer);
48
+ if (tty) process.stdout.write('\r\x1b[2K');
49
+ process.stdout.write(` ${C.success}✔${C.reset} ${C.bold}${C.dim}100%${C.reset} ${C.dim}Ready${C.reset}\n`);
50
+ }
51
+ }
52
+
53
+ async function main() {
54
+ const args = process.argv.slice(2);
55
+ const doInstall = args.includes('--install') || args.includes('--setup') || args.includes('install');
56
+
57
+ Config.load();
58
+
59
+ if (doInstall) {
60
+ console.log(`\n ${C.bold}${C.primary}${Branding.APP_NAME} ${Branding.VERSION}${C.reset} ${C.dim}— installer${C.reset}\n`);
61
+ const result = await fakeProgress(INSTALL_STEPS, Installer.install());
62
+ if (!result.command) {
63
+ Terminal.printInfo('Could not create a global "vierrataleai" command; run it via the bin script.');
64
+ } else {
65
+ Terminal.printSuccess(`Engine + model installed; "vierrataleai" command available at ${result.command}`);
66
+ }
67
+ console.log();
68
+ }
69
+
70
+ return run();
71
+ }
72
+
73
+ main().catch((err) => {
74
+ console.error(err);
75
+ process.exit(1);
76
+ });
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@vierratale/ai",
3
- "version": "0.1.0-beta.7",
3
+ "version": "0.1.0-beta.9",
4
4
  "description": "VierrataleAI - Intelligent terminal assistant",
5
5
  "type": "module",
6
+ "files": [
7
+ "bin/",
8
+ "scripts/",
9
+ "src/",
10
+ "README.md"
11
+ ],
6
12
  "bin": {
7
13
  "vierrataleai": "./bin/vierrataleai.js"
8
14
  },
package/src/catalog.js CHANGED
@@ -1,16 +1,36 @@
1
+ // Model catalog. Display names use the countable VRTL branding:
2
+ // VRTL-<number>.<word>, e.g. VRTL-2.fast, VRTL-7.cloud-mini.
1
3
  const MODELS = {
2
- 'qwen2.5-coder:0.5b': 'vierratale-lite',
3
- 'qwen2.5-coder:1.5b': 'vierratale-fast',
4
- 'qwen2.5-coder:3b': 'vierratale-small',
5
- 'qwen2.5-coder:7b': 'vierratale-balanced',
6
- 'qwen2.5-coder:14b': 'vierratale-plus',
7
- 'qwen2.5-coder:32b': 'vierratale-pro',
8
- 'gpt-4o-mini': 'vierratale-cloud-mini',
9
- 'gpt-4o': 'vierratale-cloud',
10
- 'claude-3-5-haiku-20241022': 'vierratale-cloud-fast',
11
- 'claude-sonnet-4-20250514': 'vierratale-cloud-pro',
12
- 'gemini-2.0-flash': 'vierratale-cloud-lite',
13
- 'gemini-1.5-pro': 'vierratale-cloud-plus',
4
+ 'qwen3:0.6b': 'VRTL-1.lite',
5
+ 'gemma3:1b': 'VRTL-2.fast',
6
+ 'llama3.2:1b': 'VRTL-3.small',
7
+ 'qwen2.5:1.5b': 'VRTL-4.balanced',
8
+ 'qwen2.5-coder:1.5b': 'VRTL-4.coder',
9
+ 'qwen3:1.7b': 'VRTL-5.plus',
10
+ 'qwen2.5:3b': 'VRTL-6.pro',
11
+ 'gpt-4o-mini': 'VRTL-7.cloud-mini',
12
+ 'gpt-4o': 'VRTL-8.cloud',
13
+ 'claude-3-5-haiku-20241022': 'VRTL-9.cloud-fast',
14
+ 'claude-sonnet-4-20250514': 'VRTL-10.cloud-pro',
15
+ 'gemini-2.0-flash': 'VRTL-11.cloud-lite',
16
+ 'gemini-1.5-pro': 'VRTL-12.cloud-plus',
17
+ };
18
+
19
+ // Older `vierratale-<word>` names, accepted everywhere for backwards
20
+ // compatibility (existing config files may still contain them).
21
+ const LEGACY_DISPLAY = {
22
+ 'vierratale-lite': 'VRTL-1.lite',
23
+ 'vierratale-fast': 'VRTL-2.fast',
24
+ 'vierratale-small': 'VRTL-3.small',
25
+ 'vierratale-balanced': 'VRTL-4.balanced',
26
+ 'vierratale-plus': 'VRTL-5.plus',
27
+ 'vierratale-pro': 'VRTL-6.pro',
28
+ 'vierratale-cloud-mini': 'VRTL-7.cloud-mini',
29
+ 'vierratale-cloud': 'VRTL-8.cloud',
30
+ 'vierratale-cloud-fast': 'VRTL-9.cloud-fast',
31
+ 'vierratale-cloud-pro': 'VRTL-10.cloud-pro',
32
+ 'vierratale-cloud-lite': 'VRTL-11.cloud-lite',
33
+ 'vierratale-cloud-plus': 'VRTL-12.cloud-plus',
14
34
  };
15
35
 
16
36
  const REVERSE = Object.fromEntries(
@@ -18,26 +38,48 @@ const REVERSE = Object.fromEntries(
18
38
  );
19
39
 
20
40
  const LOCAL_MODELS = [
21
- 'vierratale-lite',
22
- 'vierratale-fast',
23
- 'vierratale-small',
24
- 'vierratale-balanced',
25
- 'vierratale-plus',
26
- 'vierratale-pro',
41
+ 'VRTL-1.lite',
42
+ 'VRTL-2.fast',
43
+ 'VRTL-3.small',
44
+ 'VRTL-4.balanced',
45
+ 'VRTL-4.coder',
46
+ 'VRTL-5.plus',
47
+ 'VRTL-6.pro',
27
48
  ];
28
49
 
29
50
  const CLOUD_MODELS = [
30
- 'vierratale-cloud-mini',
31
- 'vierratale-cloud',
32
- 'vierratale-cloud-fast',
33
- 'vierratale-cloud-pro',
34
- 'vierratale-cloud-lite',
35
- 'vierratale-cloud-plus',
51
+ 'VRTL-7.cloud-mini',
52
+ 'VRTL-8.cloud',
53
+ 'VRTL-9.cloud-fast',
54
+ 'VRTL-10.cloud-pro',
55
+ 'VRTL-11.cloud-lite',
56
+ 'VRTL-12.cloud-plus',
36
57
  ];
37
58
 
59
+ const TIERS = {
60
+ 'VRTL-1.lite': 'minimal',
61
+ 'VRTL-2.fast': 'fast',
62
+ 'VRTL-3.small': 'small',
63
+ 'VRTL-4.balanced': 'balanced',
64
+ 'VRTL-4.coder': 'coder',
65
+ 'VRTL-5.plus': 'plus',
66
+ 'VRTL-6.pro': 'professional',
67
+ 'VRTL-7.cloud-mini': 'cloud-mini',
68
+ 'VRTL-8.cloud': 'cloud',
69
+ 'VRTL-9.cloud-fast': 'cloud-fast',
70
+ 'VRTL-10.cloud-pro': 'cloud-pro',
71
+ 'VRTL-11.cloud-lite': 'cloud-lite',
72
+ 'VRTL-12.cloud-plus': 'cloud-plus',
73
+ };
74
+
38
75
  export const Catalog = {
76
+ // Map any known name (new or legacy) to the current VRTL display name.
77
+ normalize(displayName) {
78
+ return LEGACY_DISPLAY[displayName] || displayName;
79
+ },
80
+
39
81
  getRealModel(displayName) {
40
- return REVERSE[displayName] || displayName;
82
+ return REVERSE[this.normalize(displayName)] || displayName;
41
83
  },
42
84
 
43
85
  getDisplayName(realModel) {
@@ -57,23 +99,23 @@ export const Catalog = {
57
99
  },
58
100
 
59
101
  getDefaultModel() {
60
- return 'vierratale-fast';
102
+ return 'VRTL-2.fast';
61
103
  },
62
104
 
63
105
  getDefaultCloudModel() {
64
- return 'vierratale-cloud-mini';
106
+ return 'VRTL-7.cloud-mini';
65
107
  },
66
108
 
67
109
  isLocalModel(displayName) {
68
- return LOCAL_MODELS.includes(displayName);
110
+ return LOCAL_MODELS.includes(this.normalize(displayName));
69
111
  },
70
112
 
71
113
  isCloudModel(displayName) {
72
- return CLOUD_MODELS.includes(displayName);
114
+ return CLOUD_MODELS.includes(this.normalize(displayName));
73
115
  },
74
116
 
75
117
  getVendorForCloudModel(displayName) {
76
- const real = REVERSE[displayName];
118
+ const real = REVERSE[this.normalize(displayName)];
77
119
  if (real && real.startsWith('claude-')) return 'anthropic';
78
120
  if (real && real.startsWith('gemini-')) return 'gemini';
79
121
  if (real && real.startsWith('gpt-')) return 'openai';
@@ -81,30 +123,17 @@ export const Catalog = {
81
123
  },
82
124
 
83
125
  getModelInfo(displayName) {
84
- const real = REVERSE[displayName];
126
+ const name = this.normalize(displayName);
127
+ const real = REVERSE[name];
85
128
  if (!real) return null;
86
- const isLocal = LOCAL_MODELS.includes(displayName);
87
- const isCloud = CLOUD_MODELS.includes(displayName);
88
- const tiers = {
89
- 'vierratale-lite': 'minimal',
90
- 'vierratale-fast': 'fast',
91
- 'vierratale-small': 'small',
92
- 'vierratale-balanced': 'balanced',
93
- 'vierratale-plus': 'plus',
94
- 'vierratale-pro': 'professional',
95
- 'vierratale-cloud-mini': 'cloud-mini',
96
- 'vierratale-cloud': 'cloud',
97
- 'vierratale-cloud-fast': 'cloud-fast',
98
- 'vierratale-cloud-pro': 'cloud-pro',
99
- 'vierratale-cloud-lite': 'cloud-lite',
100
- 'vierratale-cloud-plus': 'cloud-plus',
101
- };
129
+ const isLocal = LOCAL_MODELS.includes(name);
130
+ const isCloud = CLOUD_MODELS.includes(name);
102
131
  return {
103
132
  displayName,
104
133
  realModel: real,
105
134
  isLocal,
106
135
  isCloud,
107
- tier: tiers[displayName] || 'unknown',
136
+ tier: TIERS[name] || 'unknown',
108
137
  };
109
138
  },
110
- };
139
+ };