@kylecheng3146/agent-ops 0.1.8 → 0.1.9

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.
@@ -1,3 +1,26 @@
1
- // Single source of the published CLI version. Release preparation updates
2
- // this constant; bin.ts and the hook entry both read it from here.
3
- export const CLI_VERSION = "0.1.7";
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ function readPackageVersion() {
5
+ let directory = dirname(fileURLToPath(import.meta.url));
6
+ while (true) {
7
+ try {
8
+ const metadata = JSON.parse(readFileSync(join(directory, "package.json"), "utf8"));
9
+ if (metadata.name === "@kylecheng3146/agent-ops" &&
10
+ typeof metadata.version === "string") {
11
+ return metadata.version;
12
+ }
13
+ }
14
+ catch {
15
+ // Keep walking until the package root is found.
16
+ }
17
+ const parent = dirname(directory);
18
+ if (parent === directory) {
19
+ break;
20
+ }
21
+ directory = parent;
22
+ }
23
+ throw new Error("Unable to locate the package version.");
24
+ }
25
+ // package.json is the single source of the published CLI version.
26
+ export const CLI_VERSION = readPackageVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kylecheng3146/agent-ops",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Evidence-driven development loops for Codex, Claude Code, and opencode",
5
5
  "type": "module",
6
6
  "license": "MIT",