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.
Files changed (63) hide show
  1. package/LICENSE +662 -21
  2. package/LICENSE-DOCS +404 -0
  3. package/NOTICE +47 -0
  4. package/README.md +19 -622
  5. package/package.json +21 -7
  6. package/skills/LICENSE +19 -0
  7. package/src/core/attach.js +1 -0
  8. package/src/core/commands.js +1 -0
  9. package/src/core/context.js +1 -0
  10. package/src/core/csscheck.js +1 -0
  11. package/src/core/doctor.js +1 -0
  12. package/src/core/failure.js +1 -0
  13. package/src/core/genericcheck.js +1 -0
  14. package/src/core/git.js +1 -0
  15. package/src/core/headless.js +1 -0
  16. package/src/core/history.js +1 -0
  17. package/src/core/htmlcheck.js +1 -0
  18. package/src/core/jslogic.js +1 -0
  19. package/src/core/lessons.js +1 -0
  20. package/src/core/livelog.js +1 -0
  21. package/src/core/login.js +1 -0
  22. package/src/core/loop.js +4064 -4043
  23. package/src/core/mcp.js +1 -0
  24. package/src/core/mcpcli.js +1 -0
  25. package/src/core/openable.js +1 -0
  26. package/src/core/opener.js +1 -0
  27. package/src/core/provider.js +1 -0
  28. package/src/core/relink.js +1 -0
  29. package/src/core/scope.js +1 -0
  30. package/src/core/settings.js +1 -0
  31. package/src/core/skills.js +1 -0
  32. package/src/core/snapshot.js +1 -0
  33. package/src/core/stuck.js +1 -0
  34. package/src/core/terminal.js +29 -4
  35. package/src/core/tests.js +1 -0
  36. package/src/core/undo.js +1 -0
  37. package/src/core/updater.js +1 -0
  38. package/src/core/version.js +1 -0
  39. package/src/core/voice.js +1 -0
  40. package/src/core/window.js +1 -0
  41. package/src/tools/blocks.js +1 -0
  42. package/src/tools/browser.js +1 -0
  43. package/src/tools/cache.js +1 -0
  44. package/src/tools/deploy.js +1 -0
  45. package/src/tools/files.js +1 -0
  46. package/src/tools/fuzzy.js +1 -0
  47. package/src/tools/index.js +1 -0
  48. package/src/tools/rename.js +1 -0
  49. package/src/tools/scaffold.js +1 -0
  50. package/src/tools/search.js +1 -0
  51. package/src/tools/shared.js +2 -1
  52. package/src/tools/shell.js +1 -0
  53. package/src/tools/symbols.js +1 -0
  54. package/src/tools/types.js +1 -0
  55. package/src/tools/web.js +1 -0
  56. package/src/ui/activity.js +1 -0
  57. package/src/ui/markdown.js +1 -0
  58. package/src/ui/plain.js +4 -3
  59. package/src/ui/screen.js +2012 -1833
  60. package/src/ui/theme.js +20 -9
  61. package/templates/LICENSE +23 -0
  62. package/ucode.js +1 -0
  63. package/LICENSE-APACHE +0 -202
package/src/core/mcp.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
  * mcp.js — tools from MCP servers: GitHub, docs, databases, whatever the user connects.
3
4
  *
@@ -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
  * mcpcli.js — `ucode mcp add | list | remove`, the way to connect a server
3
4
  * without editing JSON by hand. Servers go in ~/.ucode/mcp.json (every
@@ -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
  * openable.js — a page that works when you double-click it.
3
4
  *
@@ -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
  * opener.js — showing a finished page or a running server in the user's own
3
4
  * browser.
@@ -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
  * provider.js — the only module that knows a model provider exists.
3
4
  *
@@ -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
  * relink.js — taking an app's own folder back out of its own links.
3
4
  *
package/src/core/scope.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
  * scope.js — keeping a new app to what was asked for.
3
4
  *
@@ -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
  * settings.js — what ucode may do without asking, and what runs around its work.
3
4
  *
@@ -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
  * skills.js — instruction packs, disclosed progressively.
3
4
  *
@@ -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
  * snapshot.js — the whole project as it was before each turn, for /undo.
3
4
  *
package/src/core/stuck.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
  * stuck.js — noticing when the model is going round in circles.
3
4
  *
@@ -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) profile.background = 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
- await fs.writeFile(file, `${JSON.stringify(applyToWindowsTerminal(settings, want), null, 4)}\n`);
182
- return { ok: true, message: 'Changed Windows Terminal — every tab, and it stays. "/theme terminal reset" puts it back.' };
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
@@ -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
  * tests.js — running the tests a change actually affects.
3
4
  *
package/src/core/undo.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
  * undo.js — what every file looked like before this turn touched it.
3
4
  *
@@ -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
  * updater.js — staying current without anyone running npm by hand.
3
4
  *
@@ -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
  * version.js — the version, read from package.json rather than typed twice.
3
4
  *
package/src/core/voice.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
  * voice.js — the mic button: say what you want instead of typing it.
3
4
  *
@@ -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
  * window.js — keeping a long conversation inside the model's context.
3
4
  *
@@ -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
  * blocks.js — pieces of an app that are already right.
3
4
  *
@@ -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
  * browser.js — looking at the app the way a person would.
3
4
  *
@@ -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
  * cache.js — the starter's packages, installed once and reused.
3
4
  *
@@ -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
  * deploy.js — put the app online on Vercel.
3
4
  *
@@ -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
  * files.js — reading and changing files.
3
4
  *
@@ -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
  * fuzzy.js — finding the text an edit meant when it is not in the file as written.
3
4
  *
@@ -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
  * index.js — the tool registry: schemas, argument checking, dispatch, and the
3
4
  * line the user reads while each one runs.
@@ -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
  * rename.js — renaming a name everywhere it is that name.
3
4
  *
@@ -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
  * scaffold.js — starting an app from a starter that is known to work.
3
4
  *
@@ -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
  * search.js — finding things: what is in a directory, which files match a
3
4
  * name pattern, and which lines match a regular expression.
@@ -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().slice(0, 160)}`, `in ${where}`, 'command', commandKey(command));
107
+ await confirm(`run ${String(command).trim()}`, `in ${where}`, 'command', commandKey(command));
107
108
  }
108
109
 
109
110
  // ---------------------------------------------------------------------------
@@ -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
  * shell.js — running commands.
3
4
  *
@@ -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
  * symbols.js — a map of what this codebase declares, so "where is the tip
3
4
  * calculated" is one lookup rather than five greps.
@@ -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
  * types.js — asking the app's own TypeScript what something actually is.
3
4
  *
package/src/tools/web.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
  * web.js — looking things up outside the project.
3
4
  *
@@ -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
  * activity.js — what the status row shows while ucode is working.
3
4
  *
@@ -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
  * markdown.js — turning a reply into styled terminal text.
3
4
  *
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, look,
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
- ['', look.byline],
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('terminal coding agent')}`,
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))}`),