ucode-agent 1.1.0 → 1.3.0

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/src/ui/theme.js CHANGED
@@ -254,3 +254,21 @@ export function asLabel(text) {
254
254
  .replace(/\s+/g, ' ')
255
255
  .replace(/(?<=[\w)\]"'`])[.。]+$/, '');
256
256
  }
257
+
258
+ /**
259
+ * The model's checklist, as one short line — done ticked, the current item
260
+ * marked, the rest dim — so progress is visible without taking over the screen.
261
+ */
262
+ export function planLine(items) {
263
+ const list = (Array.isArray(items) ? items : []).slice(0, 6);
264
+ if (!list.length) return '';
265
+ const done = list.filter((i) => i?.done).length;
266
+ const current = list.findIndex((i) => !i?.done);
267
+ const parts = list.map((item, i) => {
268
+ const text = clip(String(item?.text ?? '').trim(), 30);
269
+ if (item?.done) return `${theme.ok('✓')} ${dim(text)}`;
270
+ if (i === current) return `${blue('▸')} ${chalk.white(text)}`;
271
+ return dim(`○ ${text}`);
272
+ });
273
+ return ` ${sky(`plan ${done}/${list.length}`)} ${parts.join(dim(' · '))}`;
274
+ }
package/ucode.js CHANGED
@@ -14,6 +14,7 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
14
14
 
15
15
  import { Agent } from './src/core/loop.js';
16
16
  import { setModel, modelName, MODELS, DEFAULT_MODEL, ENV_FILE } from './src/core/provider.js';
17
+ import { VERSION } from './src/core/version.js';
17
18
  import { Plain } from './src/ui/plain.js';
18
19
  import { blue, dim, sky } from './src/ui/theme.js';
19
20
 
@@ -50,7 +51,7 @@ function usage() {
50
51
  ' -v, --version print the version\n' +
51
52
  ' -h, --help this message\n\n' +
52
53
  ` ${sky('Models')}\n${models}\n\n` +
53
- ` Needs OPENROUTER_API_KEY in the environment or in ${ENV_FILE}\n` +
54
+ ` Needs UCODE_API_KEY in the environment or in ${ENV_FILE}\n` +
54
55
  ' Free keys: https://openrouter.ai/keys\n\n'
55
56
  );
56
57
  }
@@ -61,9 +62,7 @@ async function main() {
61
62
  if (args.help) return usage();
62
63
 
63
64
  if (args.version) {
64
- const here = path.dirname(fileURLToPath(import.meta.url));
65
- const pkg = JSON.parse(await readFile(path.join(here, 'package.json'), 'utf8'));
66
- process.stdout.write(`${pkg.version}\n`);
65
+ process.stdout.write(`${VERSION}\n`);
67
66
  return;
68
67
  }
69
68