jaitus 0.3.4 → 0.3.5
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 +33 -37
- package/bin/jaitus.js +8 -0
- package/package.json +2 -2
- package/src/agent/loop.js +186 -28
- package/src/agent/permissions.js +50 -17
- package/src/agent/rules.js +85 -14
- package/src/agent/tools.js +266 -50
- package/src/background.js +34 -7
- package/src/commands/commit.js +63 -46
- package/src/commands/doctor.js +1 -1
- package/src/commands/explain.js +5 -5
- package/src/commands/logout.js +2 -0
- package/src/commands/research.js +5 -6
- package/src/commands/review.js +8 -11
- package/src/commands/test.js +18 -14
- package/src/config.js +12 -1
- package/src/errors.js +4 -0
- package/src/index.js +567 -118
- package/src/mcp.js +209 -72
- package/src/project.js +0 -0
- package/src/session.js +18 -0
- package/src/sessions.js +20 -2
- package/src/terminal.js +46 -11
- package/src/tui/ansi.js +3 -1
- package/src/tui/clipboard.js +100 -7
- package/src/tui/entries.js +5 -5
- package/src/tui/highlight.js +4 -4
- package/src/tui/markdown.js +1 -1
- package/src/tui/theme.js +8 -0
- package/src/tui-ink.js +493 -103
- package/src/tui.js +4 -0
- package/src/ui.js +5 -1
package/src/tui.js
CHANGED
|
@@ -792,6 +792,10 @@ export function createTui({ slashCommands = [], fileProvider = null, meta = {},
|
|
|
792
792
|
/** Clipboard write: tmux, native tools, then OSC 52; returns the path used or ''. */
|
|
793
793
|
function copyText(text) {
|
|
794
794
|
if (!text) return '';
|
|
795
|
+
// The terminal tests' stand-in clipboard (see tui/clipboard.js): never the real one.
|
|
796
|
+
if (process.env.JAITUS_CLIPBOARD_DIR) {
|
|
797
|
+
try { fs.writeFileSync(path.join(process.env.JAITUS_CLIPBOARD_DIR, 'copied.txt'), text); return 'clipboard'; } catch { return ''; }
|
|
798
|
+
}
|
|
795
799
|
// Inside tmux also feed the paste buffer so tmux copy-mode sees it.
|
|
796
800
|
if (process.env.TMUX) {
|
|
797
801
|
try {
|
package/src/ui.js
CHANGED
|
@@ -17,6 +17,7 @@ import fs from 'node:fs';
|
|
|
17
17
|
import path from 'node:path';
|
|
18
18
|
import os from 'node:os';
|
|
19
19
|
import { loadSettings, HOME } from './config.js';
|
|
20
|
+
import { terminalBackground } from './terminal.js';
|
|
20
21
|
|
|
21
22
|
// Read without re-entering config's write paths; failures mean defaults.
|
|
22
23
|
function loadSettingsFile() { return loadSettings(); }
|
|
@@ -69,7 +70,8 @@ export const glyph = (uni, ascii) => (unicode() ? uni : ascii);
|
|
|
69
70
|
// Every colour in the CLI renders through these named tokens, never raw codes:
|
|
70
71
|
// swapping the active map reskins the app without touching call sites. Presets
|
|
71
72
|
// ship for dark terminals (default), light terminals, a colorblind-safe
|
|
72
|
-
// daltonized pair, and plain ANSI. `auto` picks light/dark from
|
|
73
|
+
// daltonized pair, and plain ANSI. `auto` picks light/dark from the background the
|
|
74
|
+
// terminal reports (OSC 11, see terminal.js), else COLORFGBG, else dark.
|
|
73
75
|
// A `~/.jaitus/theme.json` file may override individual tokens with raw ANSI
|
|
74
76
|
// code strings, e.g. { "brand": "38;5;209" }.
|
|
75
77
|
const BASE_TOKENS = {
|
|
@@ -115,6 +117,8 @@ export function themeName() {
|
|
|
115
117
|
// without anyone configuring anything; unknown backgrounds stay dark.
|
|
116
118
|
const raw = process.env.JAITUS_THEME || loadSettingsSafe().theme || 'auto';
|
|
117
119
|
if (raw === 'auto') {
|
|
120
|
+
const reported = terminalBackground();
|
|
121
|
+
if (reported) return reported;
|
|
118
122
|
const bg = String(process.env.COLORFGBG || '').split(/[;:]/).pop();
|
|
119
123
|
return ['7', '15', '11', '14'].includes(bg) ? 'light' : 'dark';
|
|
120
124
|
}
|