jaitus 0.3.19 → 0.3.20
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/LICENSE +1 -1
- package/README.md +66 -30
- package/package.json +1 -1
- package/src/agent/loop.js +10 -11
- package/src/api.js +3 -3
- package/src/brand.js +233 -232
- package/src/commands/doctor.js +11 -10
- package/src/commands/login.js +3 -3
- package/src/commands/logout.js +1 -1
- package/src/commands/update.js +11 -2
- package/src/errors.js +10 -9
- package/src/index.js +44 -44
- package/src/logo-data.js +2 -2
- package/src/planView.js +89 -29
- package/src/skills.js +1 -1
- package/src/tui/entries.js +2 -2
- package/src/tui/theme.js +21 -21
- package/src/tui/wordmark.js +1 -1
- package/src/tui-ink.js +2941 -2921
- package/src/tui.js +2556 -2560
- package/src/ui.js +11 -11
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Jaitus CLI — Proprietary Software Licence
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026 Jaitus. All rights reserved.
|
|
3
|
+
Copyright (c) 2026 Lakshya Pratap Singh, trading as Jaitus. All rights reserved.
|
|
4
4
|
|
|
5
5
|
This software and its source code (the "Software") are the property of Jaitus and
|
|
6
6
|
are licensed, not sold.
|
package/README.md
CHANGED
|
@@ -30,7 +30,8 @@ Set `JAITUS_RENDERER=classic` if you need the legacy renderer temporarily.
|
|
|
30
30
|
## Start
|
|
31
31
|
|
|
32
32
|
Create an account at [jaitus.com](https://www.jaitus.com) — every new account gets free
|
|
33
|
-
prompts to try it
|
|
33
|
+
prompts to try it (a set number of prompts and tokens, whichever runs out first). No card
|
|
34
|
+
needed, and linking GitHub adds more. Then:
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
37
|
jaitus login # opens your browser, nothing to copy
|
|
@@ -56,7 +57,7 @@ changing a file or running a command, showing you exactly what it is about to do
|
|
|
56
57
|
- return JSON.parse(x)
|
|
57
58
|
+ try { return JSON.parse(x) } catch { return null }
|
|
58
59
|
|
|
59
|
-
[y] once [a] always this
|
|
60
|
+
[y] once [s] this session [a] always (saved for this project) [n] no (Enter) ›
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
## Commands
|
|
@@ -67,7 +68,7 @@ changing a file or running a command, showing you exactly what it is about to do
|
|
|
67
68
|
| `jaitus "<task>"` | run one task and exit |
|
|
68
69
|
| `jaitus login` / `logout` | sign in through the browser / sign this computer out |
|
|
69
70
|
| `jaitus whoami` | which account, which plan, this period's usage |
|
|
70
|
-
| `jaitus usage` | plan
|
|
71
|
+
| `jaitus usage` | your plan's 5-hour window, weekly and monthly usage (or free prompts left) |
|
|
71
72
|
| `jaitus sessions` | list saved sessions |
|
|
72
73
|
| `jaitus mcp list` | list configured MCP servers |
|
|
73
74
|
| `jaitus config` | show or change CLI settings |
|
|
@@ -82,25 +83,57 @@ changing a file or running a command, showing you exactly what it is about to do
|
|
|
82
83
|
| | |
|
|
83
84
|
|---|---|
|
|
84
85
|
| `/help` | these commands |
|
|
85
|
-
| `/model [id]` |
|
|
86
|
+
| `/model [id]` | the model setting — Jaitus picks the model for each request |
|
|
87
|
+
| `/status` | model, mode, account, directory, context usage |
|
|
86
88
|
| `/cost` | tokens used so far this session |
|
|
87
|
-
| `/
|
|
88
|
-
| `/
|
|
89
|
-
| `/
|
|
89
|
+
| `/context` | what the model sees this turn (messages, project notes) |
|
|
90
|
+
| `/clear` | start the conversation over |
|
|
91
|
+
| `/undo` | drop the last exchange |
|
|
92
|
+
| `/compact [focus]` | summarise the conversation to free context |
|
|
93
|
+
| `/export [file]` | write the conversation to a file (txt/md/json) |
|
|
94
|
+
| `/copy` | copy the last response to the clipboard |
|
|
95
|
+
| `/diff` | uncommitted changes, staged or not, and new files |
|
|
96
|
+
| `/tasks` | review tool activity from this session |
|
|
97
|
+
| `/image <path>` | attach an image (png/jpg/gif/webp) the model will see with your next message |
|
|
98
|
+
| `/memory [text]` | show or append to `JAITUS.md` (`#` does this inline) |
|
|
99
|
+
| `/permissions [mode\|rules\|default]` | permission mode, the mode new sessions start in, and the allow/deny rules for this project |
|
|
90
100
|
| `/skills` | list project workflows |
|
|
91
|
-
| `/sessions` | list saved sessions |
|
|
92
|
-
| `/resume <id>` | load
|
|
101
|
+
| `/sessions` | list saved sessions in this directory |
|
|
102
|
+
| `/resume <id>` | load another saved session |
|
|
93
103
|
| `/rename <title>` | name this session |
|
|
94
|
-
| `/hooks` | show lifecycle hooks |
|
|
95
|
-
| `/tui [fullscreen\|default]` | switch renderer, relaunching with
|
|
96
|
-
| `/
|
|
97
|
-
| `/
|
|
98
|
-
| `/
|
|
104
|
+
| `/hooks` | show configured lifecycle hooks |
|
|
105
|
+
| `/tui [fullscreen\|default]` | switch renderer, relaunching with this conversation intact |
|
|
106
|
+
| `/theme [name]` | colour theme: dark, light, ocean, daltonized, auto (the default: asks the terminal for its background colour) |
|
|
107
|
+
| `/vim` | toggle Vim modal editing for the prompt |
|
|
108
|
+
| `/attach <id>` | watch a background job log live (Esc stops watching) |
|
|
109
|
+
| `/stop <id>` | stop a running background job |
|
|
110
|
+
| `/debug` | terminal and renderer diagnostics for bug reports |
|
|
99
111
|
| `/agent <task>` | run an isolated read-only side task |
|
|
100
|
-
| `/
|
|
101
|
-
| `/
|
|
102
|
-
| `/
|
|
103
|
-
| `/
|
|
112
|
+
| `/btw <question>` | side question, answered without touching history |
|
|
113
|
+
| `/research [--deep] <q>` | web research with sources (read-only) |
|
|
114
|
+
| `/ask <question>` | read-only explanation mode; never edits files |
|
|
115
|
+
| `/architect <task>` | read-only architecture mode; compare designs and risks |
|
|
116
|
+
| `/code` | implementation mode; keeps the current approval policy |
|
|
117
|
+
| `/explain <topic>` | explain a file, symbol, error or concept from this project |
|
|
118
|
+
| `/test [args]` | run the project tests; `--fix` lets the agent repair failures |
|
|
119
|
+
| `/review [--fix]` | review the diff for bugs; `--fix` applies the findings |
|
|
120
|
+
| `/security-review [--fix]` | review the diff for vulnerabilities |
|
|
121
|
+
| `/simplify [--fix]` | readability-only pass over the change |
|
|
122
|
+
| `/commit` | review the diff, write a real message, commit (push is separate) |
|
|
123
|
+
| `/plan [task]` | read-only plan mode, optionally for one task |
|
|
124
|
+
| `/branch [name]` | branch the conversation, return with `/resume` |
|
|
125
|
+
| `/rewind [turn]` | restore conversation and files to an earlier turn |
|
|
126
|
+
| `/feedback [text]` | save a note about a problem, with session details, on this computer |
|
|
127
|
+
| `/login` | sign in as a different account |
|
|
128
|
+
| `/logout` | sign this device out and leave |
|
|
129
|
+
| `/doctor` | diagnose setup problems |
|
|
130
|
+
| `/whoami` | who you are signed in as |
|
|
131
|
+
| `/usage` | your plan's 5-hour window, weekly and monthly usage (or free prompts left) |
|
|
132
|
+
| `/init` | create `JAITUS.md` and `.jaitusignore` here |
|
|
133
|
+
| `/mcp [list\|add\|remove]` | list or configure MCP tool servers |
|
|
134
|
+
| `/config [key] [value]` | show or change CLI settings |
|
|
135
|
+
| `/update` | check whether a newer version is published |
|
|
136
|
+
| `/exit` | leave (the only way out — `Ctrl+C` never exits) |
|
|
104
137
|
|
|
105
138
|
Arrow keys, Home/End, `Ctrl+A`/`Ctrl+E`, `Ctrl+W` (delete a word), `Ctrl+U`/`Ctrl+K`
|
|
106
139
|
(delete to the start/end) all work, and the cursor is drawn where you are typing.
|
|
@@ -140,7 +173,7 @@ Drag selects and copies on release; double-click selects a word, triple-click a
|
|
|
140
173
|
|
|
141
174
|
| | |
|
|
142
175
|
|---|---|
|
|
143
|
-
| `--model <id>` |
|
|
176
|
+
| `--model <id>` | model id for this run (leave it out: Jaitus picks the model for each request) |
|
|
144
177
|
| `--print, -p` | headless one-prompt mode |
|
|
145
178
|
| `--continue, -c` | continue the latest session in this directory |
|
|
146
179
|
| `--resume, -r <id>` | resume a saved session |
|
|
@@ -195,13 +228,14 @@ Environment variables it reads: `NO_COLOR`, `FORCE_COLOR`, `JAITUS_ASCII` (plain
|
|
|
195
228
|
`JAITUS_NO_BANNER`, `JAITUS_DEBUG` (stack traces).
|
|
196
229
|
Renderer: fullscreen on capable terminals, classic scrollback on legacy consoles
|
|
197
230
|
or pipes. Force either way with `JAITUS_FULLSCREEN=1` / `JAITUS_NO_FULLSCREEN=1`
|
|
198
|
-
(`/tui` switches mid-session), `JAITUS_16COLOR=1` for sixteen
|
|
231
|
+
(`/tui` switches mid-session), `JAITUS_16COLOR=1` for sixteen colours,
|
|
199
232
|
`JAITUS_NO_ANIMATION=1` for reduced motion.
|
|
200
233
|
|
|
201
234
|
## Extending it
|
|
202
235
|
|
|
203
236
|
- `.jaitus/skills/<name>/SKILL.md` adds a workflow available as `/<name>`, in the open
|
|
204
|
-
Agent Skills format. Skills
|
|
237
|
+
Agent Skills format. Skills written for other coding agents in the same format are
|
|
238
|
+
picked up too.
|
|
205
239
|
- `.jaitus/hooks.json` adds lifecycle commands. A non-zero `beforePrompt` hook blocks the
|
|
206
240
|
request; hook output is not echoed into the transcript.
|
|
207
241
|
- `.mcp.json` configures local stdio MCP servers. Use `jaitus mcp list`, `jaitus mcp add`
|
|
@@ -211,13 +245,14 @@ or pipes. Force either way with `JAITUS_FULLSCREEN=1` / `JAITUS_NO_FULLSCREEN=1`
|
|
|
211
245
|
|
|
212
246
|
## Safety
|
|
213
247
|
|
|
214
|
-
-
|
|
215
|
-
included.
|
|
248
|
+
- The file tools only read and write inside the folder you started it in, symlinks
|
|
249
|
+
included. Shell commands run as you and can reach anything you can, which is why each
|
|
250
|
+
one asks first unless you allow it.
|
|
216
251
|
- Writes and commands need permission. `--yes` skips the prompts and is deliberately not
|
|
217
252
|
the default; without a terminal to ask in, an action that needs permission is refused
|
|
218
253
|
rather than assumed.
|
|
219
254
|
- Commands run with no TTY, so anything interactive exits instead of hanging forever.
|
|
220
|
-
- The agent runs until the task is done. If it repeats the same action four times without changing anything it stops and says so, rather than
|
|
255
|
+
- The agent runs until the task is done. If it repeats the same action four times without changing anything it stops and says so, rather than burning through your plan's limits.
|
|
221
256
|
- `jaitus doctor` never prints your sign-in token — only whether you are signed in.
|
|
222
257
|
|
|
223
258
|
## Signing in
|
|
@@ -227,14 +262,15 @@ or pipes. Force either way with `JAITUS_FULLSCREEN=1` / `JAITUS_NO_FULLSCREEN=1`
|
|
|
227
262
|
browser, the browser carries back a single-use code, and the CLI exchanges that code over
|
|
228
263
|
HTTPS for a short-lived sign-in token that renews itself. No token ever travels in a URL.
|
|
229
264
|
|
|
230
|
-
Each computer you sign in on
|
|
231
|
-
it out. `jaitus logout` signs out this computer only.
|
|
265
|
+
Each computer you sign in on is listed under **Signed-in devices** on your dashboard,
|
|
266
|
+
where you can sign it out. `jaitus logout` signs out this computer only.
|
|
232
267
|
|
|
233
268
|
## Plans
|
|
234
269
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
270
|
+
Plans are listed at [jaitus.com](https://www.jaitus.com). A plan lasts 30 days and does
|
|
271
|
+
not renew automatically — buy another 30 days when you want to keep going. Each plan has
|
|
272
|
+
a 5-hour window, a weekly limit and a monthly limit; `jaitus whoami` and `jaitus usage`
|
|
273
|
+
show each as a percentage, with when it resets.
|
|
238
274
|
|
|
239
275
|
## Requirements
|
|
240
276
|
|
|
@@ -242,5 +278,5 @@ Node 20 or newer.
|
|
|
242
278
|
|
|
243
279
|
## Licence
|
|
244
280
|
|
|
245
|
-
Proprietary. © 2026 Jaitus. All rights reserved. Use is governed by the Jaitus Terms of
|
|
281
|
+
Proprietary. © 2026 Lakshya Pratap Singh, trading as Jaitus. All rights reserved. Use is governed by the Jaitus Terms of
|
|
246
282
|
Service at [jaitus.com/terms](https://www.jaitus.com/terms). See `LICENSE`.
|
package/package.json
CHANGED
package/src/agent/loop.js
CHANGED
|
@@ -249,7 +249,7 @@ export function repairToolPairs(messages) {
|
|
|
249
249
|
// but not free — was ~75% of what a session cost: 109 requests averaged 46k tokens of
|
|
250
250
|
// context each, most of it tool output from many steps ago (a file read at step 3 is
|
|
251
251
|
// still paid for at step 60). This is the documented "clear old tool results" strategy
|
|
252
|
-
// (
|
|
252
|
+
// (context editing, also known as micro-compaction): once
|
|
253
253
|
// the conversation passes TRIM_AT, the outputs of all but the KEEP_RECENT latest tool
|
|
254
254
|
// calls are replaced with a line saying they were cleared and can be re-run. It clears
|
|
255
255
|
// at least TRIM_AT_LEAST at a time, because each clearing breaks the prompt cache once
|
|
@@ -257,14 +257,14 @@ export function repairToolPairs(messages) {
|
|
|
257
257
|
// "file written", an exit code) are kept: they carry meaning and cost nothing.
|
|
258
258
|
// 100k was the documented default for 200k-window models. Here the window is up to 1M, so
|
|
259
259
|
// that ceiling was rarely near: production requests averaged 53k tokens and two thirds of
|
|
260
|
-
// all input tokens came from requests over 60k. At 40k a clearing (one cache break
|
|
261
|
-
//
|
|
260
|
+
// all input tokens came from requests over 60k. At 40k a clearing (one cache break)
|
|
261
|
+
// pays for itself within about ten later requests.
|
|
262
262
|
export const TRIM_AT = 40_000; // estimated tokens of conversation
|
|
263
263
|
export const KEEP_RECENT = 6; // latest tool results always kept whole
|
|
264
264
|
export const TRIM_AT_LEAST = 12_000; // estimated tokens a clearing must free
|
|
265
265
|
// Past DEEP_AT only the newest KEEP_RECENT_DEEP results stay whole. Production, 7 days to
|
|
266
|
-
// 2 Oct: requests carrying 150k+ tokens were a quarter of all requests and
|
|
267
|
-
//
|
|
266
|
+
// 2 Oct: requests carrying 150k+ tokens were a quarter of all requests and most of all
|
|
267
|
+
// usage — every step of a long task re-sent the outputs of its last six tools whole,
|
|
268
268
|
// up to 60,000 characters each.
|
|
269
269
|
export const DEEP_AT = 100_000;
|
|
270
270
|
export const KEEP_RECENT_DEEP = 3;
|
|
@@ -364,10 +364,9 @@ export async function streamTurn({ client, messages, model, system, tools, onTex
|
|
|
364
364
|
// `credits` is what the gateway counted against the plan for this request — real cost,
|
|
365
365
|
// the one unit the plan, the dashboard and this CLI all show.
|
|
366
366
|
const usage = { input_tokens: 0, output_tokens: 0, cache_read_input_tokens: 0, cache_creation_input_tokens: 0, credits: 0 };
|
|
367
|
-
// Usage can arrive at the START of a stream (
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
// alone recorded every OpenAI-format turn as 0 input tokens.
|
|
367
|
+
// Usage can arrive at the START of a stream (in message_start) or only at the END, in
|
|
368
|
+
// message_delta (streams whose usage exists only once generation finishes). Reading
|
|
369
|
+
// input from message_start alone recorded every end-reported turn as 0 input tokens.
|
|
371
370
|
const takeUsage = (u) => {
|
|
372
371
|
if (!u) return;
|
|
373
372
|
for (const k of ['input_tokens', 'output_tokens', 'cache_read_input_tokens', 'cache_creation_input_tokens', 'credits']) {
|
|
@@ -563,7 +562,7 @@ export async function runAgent({
|
|
|
563
562
|
let streamed = false;
|
|
564
563
|
const spin = tui ? { stop: () => {}, update: () => {} } : (silent ? { stop: () => {}, update: () => {} } : spinner(glyph('Working…', 'Working...')));
|
|
565
564
|
if (tui) tui.setStatus(`${c.brand(glyph('•', '*'))} ${c.brand(glyph('Working…', 'Working...'))}`);
|
|
566
|
-
//
|
|
565
|
+
// Assistant cell: the • leads the turn the way › leads the
|
|
567
566
|
// user's. In scrollback the marker lands before the first streamed chunk.
|
|
568
567
|
let turnVoiced = false;
|
|
569
568
|
|
|
@@ -918,7 +917,7 @@ export async function runAgent({
|
|
|
918
917
|
}
|
|
919
918
|
}
|
|
920
919
|
|
|
921
|
-
// Every tool_result first, then any images, in the same user message.
|
|
920
|
+
// Every tool_result first, then any images, in the same user message. The message
|
|
922
921
|
// format requires the results to lead the message; an image between two results
|
|
923
922
|
// (read_image followed by another call in one batch) was a rejected request.
|
|
924
923
|
const images = [];
|
package/src/api.js
CHANGED
|
@@ -17,8 +17,8 @@ export class NotSignedIn extends Error {}
|
|
|
17
17
|
// id) instead of eternity. The caller's signal (Esc) still wins: it aborts through the
|
|
18
18
|
// same controller, and only a genuine user abort reads as one.
|
|
19
19
|
//
|
|
20
|
-
// A turn is bounded by SILENCE, not by its length. Until the reply starts, the
|
|
21
|
-
// may be
|
|
20
|
+
// A turn is bounded by SILENCE, not by its length. Until the reply starts, the server
|
|
21
|
+
// may still be retrying on its side (each try gets a 20-45 s budget), so the first
|
|
22
22
|
// byte gets a few minutes. Once it starts, the gateway writes a heartbeat at least every
|
|
23
23
|
// 10 s for as long as the provider is working, so 90 s without a single byte means the
|
|
24
24
|
// connection is dead — while a long, healthy answer streams for as long as it needs.
|
|
@@ -94,7 +94,7 @@ export function createClient() {
|
|
|
94
94
|
|
|
95
95
|
// x-jaitus-features: what this build understands, so the gateway can use newer error
|
|
96
96
|
// codes (a used-up usage window) without an older CLI reading them as "went wrong".
|
|
97
|
-
const base = { 'Content-Type': 'application/json', 'user-agent': `jaitus-cli/${version()}`, 'x-jaitus-features': 'usage-window' };
|
|
97
|
+
const base = { 'Content-Type': 'application/json', 'user-agent': `jaitus-cli/${version()}`, 'x-jaitus-features': 'usage-window plan-expired' };
|
|
98
98
|
// x-jaitus-device: this computer's hashed identifiers (machine.js), which the free
|
|
99
99
|
// tier is limited by. Built once per process.
|
|
100
100
|
const headers = (token) => ({ ...base, 'x-jaitus-device': machineHeader(), authorization: `Bearer ${token}` });
|