@compilr-dev/sdk 0.9.1 → 0.9.3

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.
@@ -293,7 +293,7 @@ function compressFileList(output) {
293
293
  const lines = output.split('\n').filter((l) => l.trim());
294
294
  if (lines.length <= 20)
295
295
  return output;
296
- // Group by top-level directory, cap entries
296
+ // Group by top-level directory, cap entries per directory
297
297
  const groups = new Map();
298
298
  for (const line of lines) {
299
299
  const parts = line.replace(/^\.\//, '').split('/');
@@ -302,16 +302,16 @@ function compressFileList(output) {
302
302
  arr.push(line);
303
303
  groups.set(dir, arr);
304
304
  }
305
- const maxPerDir = 10;
305
+ const maxPerDir = 5;
306
306
  const result = [];
307
307
  for (const [dir, files] of groups) {
308
308
  if (dir !== '.')
309
- result.push(`${dir}/`);
309
+ result.push(`${dir}/ (${String(files.length)} files)`);
310
310
  const shown = files.slice(0, maxPerDir);
311
311
  for (const f of shown)
312
312
  result.push(f);
313
313
  if (files.length > maxPerDir) {
314
- result.push(` ... +${String(files.length - maxPerDir)} more in ${dir}/`);
314
+ result.push(` ... +${String(files.length - maxPerDir)} more`);
315
315
  }
316
316
  }
317
317
  if (result.length < lines.length) {
@@ -41,6 +41,9 @@ export function createCompressorHook(config) {
41
41
  const command = ctx.input.command ?? '';
42
42
  const compressed = compressBashOutput(command, stdout);
43
43
  if (compressed !== null && compressed.length < stdout.length) {
44
+ const saved = stdout.length - compressed.length;
45
+ const pct = Math.round((saved / stdout.length) * 100);
46
+ console.log(`[compressor] bash "${command.slice(0, 40)}" ${String(stdout.length)} → ${String(compressed.length)} chars (${String(pct)}% saved)`); // eslint-disable-line no-console
44
47
  return {
45
48
  result: {
46
49
  ...ctx.result,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",