ucode-agent 1.65.0 → 1.67.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/LICENSE +662 -21
- package/LICENSE-DOCS +404 -0
- package/NOTICE +47 -0
- package/README.md +19 -622
- package/package.json +21 -7
- package/skills/LICENSE +19 -0
- package/src/core/attach.js +1 -0
- package/src/core/commands.js +1 -0
- package/src/core/context.js +1 -0
- package/src/core/csscheck.js +1 -0
- package/src/core/doctor.js +1 -0
- package/src/core/failure.js +1 -0
- package/src/core/genericcheck.js +1 -0
- package/src/core/git.js +1 -0
- package/src/core/headless.js +1 -0
- package/src/core/history.js +1 -0
- package/src/core/htmlcheck.js +1 -0
- package/src/core/jslogic.js +1 -0
- package/src/core/lessons.js +1 -0
- package/src/core/livelog.js +1 -0
- package/src/core/login.js +1 -0
- package/src/core/loop.js +4064 -4043
- package/src/core/mcp.js +1 -0
- package/src/core/mcpcli.js +1 -0
- package/src/core/openable.js +1 -0
- package/src/core/opener.js +1 -0
- package/src/core/provider.js +1 -0
- package/src/core/relink.js +1 -0
- package/src/core/scope.js +1 -0
- package/src/core/settings.js +1 -0
- package/src/core/skills.js +1 -0
- package/src/core/snapshot.js +1 -0
- package/src/core/stuck.js +1 -0
- package/src/core/terminal.js +29 -4
- package/src/core/tests.js +1 -0
- package/src/core/undo.js +1 -0
- package/src/core/updater.js +1 -0
- package/src/core/version.js +1 -0
- package/src/core/voice.js +1 -0
- package/src/core/window.js +1 -0
- package/src/tools/blocks.js +1 -0
- package/src/tools/browser.js +1 -0
- package/src/tools/cache.js +1 -0
- package/src/tools/deploy.js +1 -0
- package/src/tools/files.js +1 -0
- package/src/tools/fuzzy.js +1 -0
- package/src/tools/index.js +1 -0
- package/src/tools/rename.js +1 -0
- package/src/tools/scaffold.js +1 -0
- package/src/tools/search.js +1 -0
- package/src/tools/shared.js +2 -1
- package/src/tools/shell.js +1 -0
- package/src/tools/symbols.js +1 -0
- package/src/tools/types.js +1 -0
- package/src/tools/web.js +1 -0
- package/src/ui/activity.js +1 -0
- package/src/ui/markdown.js +1 -0
- package/src/ui/plain.js +4 -3
- package/src/ui/screen.js +2012 -1833
- package/src/ui/theme.js +20 -9
- package/templates/LICENSE +23 -0
- package/ucode.js +1 -0
- package/LICENSE-APACHE +0 -202
package/src/core/mcp.js
CHANGED
package/src/core/mcpcli.js
CHANGED
package/src/core/openable.js
CHANGED
package/src/core/opener.js
CHANGED
package/src/core/provider.js
CHANGED
package/src/core/relink.js
CHANGED
package/src/core/scope.js
CHANGED
package/src/core/settings.js
CHANGED
package/src/core/skills.js
CHANGED
package/src/core/snapshot.js
CHANGED
package/src/core/stuck.js
CHANGED
package/src/core/terminal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only - ucode, made and tested by om dixit. Additional terms: see NOTICE.
|
|
1
2
|
/**
|
|
2
3
|
* terminal.js — changing the terminal ucode runs in, when the user asks:
|
|
3
4
|
* "make my terminal dark green", "bigger font", "a bit see-through".
|
|
@@ -79,6 +80,14 @@ export function cleanRequest(req = {}) {
|
|
|
79
80
|
return out;
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
const IMAGE_KEYS = ['backgroundImage', 'backgroundImageOpacity', 'backgroundImageStretchMode', 'backgroundImageAlignment'];
|
|
84
|
+
|
|
85
|
+
/** Whether any profile draws a picture behind the text. */
|
|
86
|
+
export const hasBackgroundImage = (settings) => {
|
|
87
|
+
const profiles = Array.isArray(settings?.profiles) ? settings.profiles : [settings?.profiles?.defaults, ...(settings?.profiles?.list ?? [])];
|
|
88
|
+
return profiles.some((p) => p?.backgroundImage);
|
|
89
|
+
};
|
|
90
|
+
|
|
82
91
|
/** Windows Terminal: set the look on the defaults, and on any profile that overrides it. */
|
|
83
92
|
export function applyToWindowsTerminal(settings, want) {
|
|
84
93
|
const next = structuredClone(settings);
|
|
@@ -86,7 +95,14 @@ export function applyToWindowsTerminal(settings, want) {
|
|
|
86
95
|
next.profiles ??= {};
|
|
87
96
|
next.profiles.defaults ??= {};
|
|
88
97
|
const set = (profile) => {
|
|
89
|
-
if (want.background)
|
|
98
|
+
if (want.background) {
|
|
99
|
+
profile.background = want.background;
|
|
100
|
+
// A background picture is drawn over the colour, so a colour set under
|
|
101
|
+
// one never shows: asked for black, the window stayed the picture's
|
|
102
|
+
// purple while ucode said it had changed. The picture goes, and the
|
|
103
|
+
// backup keeps it for /theme terminal reset.
|
|
104
|
+
for (const key of IMAGE_KEYS) delete profile[key];
|
|
105
|
+
}
|
|
90
106
|
if (want.foreground) profile.foreground = want.foreground;
|
|
91
107
|
if (want.cursor) profile.cursorColor = want.cursor;
|
|
92
108
|
if (want.font || want.font_size) {
|
|
@@ -99,7 +115,7 @@ export function applyToWindowsTerminal(settings, want) {
|
|
|
99
115
|
};
|
|
100
116
|
set(next.profiles.defaults);
|
|
101
117
|
// A profile with its own value would hide the default, so it changes too.
|
|
102
|
-
const keys = ['background', 'foreground', 'cursorColor', 'font', 'opacity'];
|
|
118
|
+
const keys = ['background', 'foreground', 'cursorColor', 'font', 'opacity', 'backgroundImage'];
|
|
103
119
|
for (const profile of next.profiles.list ?? []) {
|
|
104
120
|
if (keys.some((k) => profile[k] !== undefined)) set(profile);
|
|
105
121
|
}
|
|
@@ -178,8 +194,17 @@ export async function customizeTerminal(request, { env = process.env, platform =
|
|
|
178
194
|
await fs.mkdir(backups(), { recursive: true });
|
|
179
195
|
const backup = path.join(backups(), 'windows-terminal.json');
|
|
180
196
|
if (!existsSync(backup)) await fs.writeFile(backup, JSON.stringify({ file, text }));
|
|
181
|
-
|
|
182
|
-
|
|
197
|
+
const next = applyToWindowsTerminal(settings, want);
|
|
198
|
+
await fs.writeFile(file, `${JSON.stringify(next, null, 4)}\n`);
|
|
199
|
+
// Read back what Windows Terminal will read, rather than trusting the write.
|
|
200
|
+
const check = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
201
|
+
if (want.background && check.profiles?.defaults?.background !== want.background) {
|
|
202
|
+
return { ok: false, message: 'Windows Terminal\'s settings did not take the change.' };
|
|
203
|
+
}
|
|
204
|
+
const picture = want.background && hasBackgroundImage(settings)
|
|
205
|
+
? ' Its background picture was taken off so the colour shows (it comes back with /theme terminal reset).'
|
|
206
|
+
: '';
|
|
207
|
+
return { ok: true, message: `Changed Windows Terminal — every tab, and it stays.${picture} "/theme terminal reset" puts it back.` };
|
|
183
208
|
}
|
|
184
209
|
|
|
185
210
|
if (kind === 'apple-terminal') return appleTerminal(want);
|
package/src/core/tests.js
CHANGED
package/src/core/undo.js
CHANGED
package/src/core/updater.js
CHANGED
package/src/core/version.js
CHANGED
package/src/core/voice.js
CHANGED
package/src/core/window.js
CHANGED
package/src/tools/blocks.js
CHANGED
package/src/tools/browser.js
CHANGED
package/src/tools/cache.js
CHANGED
package/src/tools/deploy.js
CHANGED
package/src/tools/files.js
CHANGED
package/src/tools/fuzzy.js
CHANGED
package/src/tools/index.js
CHANGED
package/src/tools/rename.js
CHANGED
package/src/tools/scaffold.js
CHANGED
package/src/tools/search.js
CHANGED
package/src/tools/shared.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only - ucode, made and tested by om dixit. Additional terms: see NOTICE.
|
|
1
2
|
/**
|
|
2
3
|
* shared.js — the plumbing every tool sits on.
|
|
3
4
|
*
|
|
@@ -103,7 +104,7 @@ export async function confirm(action, detail, risk = 'write', always = null) {
|
|
|
103
104
|
/** A command about to run, put to the user first when they asked for that. */
|
|
104
105
|
export async function approveCommand(command, where) {
|
|
105
106
|
if (!policy.askCommands || allowedNow(command)) return;
|
|
106
|
-
await confirm(`run ${String(command).trim()
|
|
107
|
+
await confirm(`run ${String(command).trim()}`, `in ${where}`, 'command', commandKey(command));
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
// ---------------------------------------------------------------------------
|
package/src/tools/shell.js
CHANGED
package/src/tools/symbols.js
CHANGED
package/src/tools/types.js
CHANGED
package/src/tools/web.js
CHANGED
package/src/ui/activity.js
CHANGED
package/src/ui/markdown.js
CHANGED
package/src/ui/plain.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only - ucode, made and tested by om dixit. Additional terms: see NOTICE.
|
|
1
2
|
/**
|
|
2
3
|
* plain.js — the interface for when there is no terminal to draw on.
|
|
3
4
|
*
|
|
@@ -14,7 +15,7 @@ import chalk from 'chalk';
|
|
|
14
15
|
import {
|
|
15
16
|
theme, blue, sky, dim, boxTop, boxBottom, boxRow,
|
|
16
17
|
BANNER, BANNER_WIDTH, SPINNER, clip, shortenPath, asLabel, padVis, visLen, planLine, bannerPaint, modeChip, narrationMark, groupKind,
|
|
17
|
-
tidyReply, trimAnswer,
|
|
18
|
+
tidyReply, trimAnswer, CREDIT,
|
|
18
19
|
} from './theme.js';
|
|
19
20
|
import { formatDuration, doneLine } from './activity.js';
|
|
20
21
|
import { renderer, render } from './markdown.js';
|
|
@@ -101,7 +102,7 @@ export class Plain {
|
|
|
101
102
|
['keys', '/help'],
|
|
102
103
|
['', ''],
|
|
103
104
|
['', ''],
|
|
104
|
-
['',
|
|
105
|
+
['', CREDIT],
|
|
105
106
|
];
|
|
106
107
|
|
|
107
108
|
// There is no input box to hang the status off here, so it goes on the
|
|
@@ -116,7 +117,7 @@ export class Plain {
|
|
|
116
117
|
return ` ${bannerPaint(i)(art)} ${right}`;
|
|
117
118
|
})
|
|
118
119
|
: [
|
|
119
|
-
` ${blue.bold('U C O D E')} ${dim(
|
|
120
|
+
` ${blue.bold('U C O D E')} ${dim(CREDIT)}`,
|
|
120
121
|
...facts
|
|
121
122
|
.filter(([label]) => label)
|
|
122
123
|
.map(([label, value]) => ` ${dim(label.padEnd(9))}${chalk.white(clip(value, width - 16))}`),
|