@astudioplus/compressor 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -5,9 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.1] - 2026-06-10
9
+
10
+ ### Fixed
11
+
12
+ - Package-root discovery keyed on the literal name `compressor`, so after the
13
+ rename to `@astudioplus/compressor` every CLI command threw "could not locate
14
+ the compressor package root" when installed from npm. Discovery now keys on the
15
+ `compressor` bin entry, which survives any scope/name change. Regression test
16
+ added. (0.1.0 was unusable when installed; 0.1.1 is the first working release.)
17
+ - `compressor --version` now reports the package version.
18
+
8
19
  ## [0.1.0] - 2026-06-10
9
20
 
10
- Initial release.
21
+ Initial release. (Broken when installed from npm — see 0.1.1.)
11
22
 
12
23
  ### Added
13
24
 
@@ -49,4 +60,5 @@ Initial release.
49
60
  - `stats` command: actual usage aggregated from local Claude Code transcripts.
50
61
  - `count` command: estimated token counts per file, `--exact` via the Anthropic `count_tokens` endpoint.
51
62
 
63
+ [0.1.1]: https://github.com/anvanster/compressor/releases/tag/v0.1.1
52
64
  [0.1.0]: https://github.com/anvanster/compressor/releases/tag/v0.1.0
package/dist/cli/index.js CHANGED
@@ -5,7 +5,7 @@ const program = new Command();
5
5
  program
6
6
  .name('compressor')
7
7
  .description('Token optimization for AI coding agents: instruction packs, tool-output compression, measured savings')
8
- .version('0.1.0');
8
+ .version('0.1.1');
9
9
  program
10
10
  .command('init')
11
11
  .description('install the instruction pack + PostToolUse hook for the given agents')
package/dist/paths.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { PackMode } from './packs/types.ts';
2
+ export declare function isCompressorRoot(dir: string): boolean;
2
3
  export declare function packageRoot(): string;
3
4
  /**
4
5
  * Hook command for ownership matching in status/uninstall — must work even
package/dist/paths.js CHANGED
@@ -1,16 +1,26 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- function isCompressorRoot(dir) {
4
+ export function isCompressorRoot(dir) {
5
5
  const pkgPath = path.join(dir, 'package.json');
6
6
  if (!existsSync(pkgPath)) {
7
7
  return false;
8
8
  }
9
9
  try {
10
10
  const parsed = JSON.parse(readFileSync(pkgPath, 'utf8'));
11
- return (typeof parsed === 'object' &&
12
- parsed !== null &&
13
- parsed['name'] === 'compressor');
11
+ if (typeof parsed !== 'object' || parsed === null) {
12
+ return false;
13
+ }
14
+ const pkg = parsed;
15
+ // Identify our package by the `compressor` bin, not its name — survives the
16
+ // unscoped→@astudioplus/compressor rename and any future scope change. The
17
+ // name check is a belt-and-suspenders fallback.
18
+ const bin = pkg['bin'];
19
+ if (typeof bin === 'object' && bin !== null && 'compressor' in bin) {
20
+ return true;
21
+ }
22
+ const name = pkg['name'];
23
+ return name === 'compressor' || name === '@astudioplus/compressor';
14
24
  }
15
25
  catch {
16
26
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astudioplus/compressor",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Reduce token usage in AI coding agents (Claude Code, Copilot, Cursor) with instruction packs and tool-output compression hooks — savings you can measure.",
5
5
  "type": "module",
6
6
  "author": "Andrey Vasilevsky <anvanster@gmail.com>",