@paxnax/berliner 0.9.0 → 0.10.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Panta Dev EOOD
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -14,7 +14,7 @@ With Bun, run `bunx --bun @paxnax/berliner@latest setup`. To install only the co
14
14
 
15
15
  ## Quickstart
16
16
 
17
- 1. Sign in at https://berliner.app with GitHub.
17
+ 1. Sign in at https://berliner.app with GitHub and choose a plan.
18
18
  2. Run setup:
19
19
 
20
20
  ```sh
@@ -127,6 +127,7 @@ Other commands:
127
127
  - `berliner delete <session-id>`: delete a session, or one item with `--evidence <id>`. Asks to confirm unless `--yes`.
128
128
  - `berliner evidence public <id>`: let anyone with the link view one file, and print its public URL and Markdown line. `berliner evidence private <id>` makes it private again. `berliner session` shows the ids, and the URL of each public file.
129
129
  - `berliner skill`: print the agent skill (`SKILL.md`) to install in your agent.
130
+ - `berliner version [--json]`, or `berliner --version`: print this CLI's version and whether it is the latest release, with `berliner upgrade` to run when it is not. It looks the latest release up at most every 5 minutes; when the registry can't be reached it still prints the version and says so.
130
131
  - `berliner upgrade [--yes] [--no-skill] [--no-hooks]`: install the latest CLI and skill. It shows its plan (the versions, the exact install command, each skill file and each Berliner hook it updates) and asks before changing anything; a second question, or `--no-skill`, leaves your skill as it is, and `--no-hooks` leaves your hooks as they are. It brings a Berliner hook an older setup installed up to date, but never adds one; your token and config are never touched. When it updated a skill or hook, its last line names the tools to start a new session in so they load it.
131
132
  - `berliner hook <tool>`: run by the hooks setup installs, with the tool's payload on stdin. It never fails and never makes the agent wait, and prints only the reminder when a session starts; errors go to `${XDG_STATE_HOME:-~/.local/state}/berliner/hook.log`.
132
133
 
package/dist/args.js CHANGED
@@ -25,6 +25,7 @@ const config = {
25
25
  json: { type: "boolean" },
26
26
  strict: { type: "boolean" },
27
27
  help: { type: "boolean" },
28
+ version: { type: "boolean" },
28
29
  yes: { type: "boolean" },
29
30
  "no-install": { type: "boolean" },
30
31
  "no-browser": { type: "boolean" },
@@ -0,0 +1,40 @@
1
+ import { mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { cacheDir } from "../config.js";
4
+ import { print } from "../output.js";
5
+ import { currentVersion, latestVersion, newer, registryOf } from "../version.js";
6
+ // Short, unlike the daily notice's day: someone asking for the version wants to see a release within minutes of it.
7
+ const CACHE_MS = 5 * 60_000;
8
+ const LOOKUP_TIMEOUT_MS = 3000;
9
+ // The latest release, from the cache file while it is fresh (its mtime is when it was looked up); null when the registry
10
+ // can't be reached.
11
+ async function latest(env) {
12
+ const file = join(cacheDir(env), "latest-version");
13
+ try {
14
+ if (Date.now() - statSync(file).mtimeMs < CACHE_MS)
15
+ return readFileSync(file, "utf8").trim();
16
+ }
17
+ catch {
18
+ // Not looked up yet on this machine.
19
+ }
20
+ try {
21
+ const version = await latestVersion(env, LOOKUP_TIMEOUT_MS);
22
+ mkdirSync(cacheDir(env), { recursive: true, mode: 0o700 });
23
+ writeFileSync(file, version);
24
+ return version;
25
+ }
26
+ catch {
27
+ return null;
28
+ }
29
+ }
30
+ export async function version(env, values) {
31
+ const version = currentVersion();
32
+ const last = await latest(env);
33
+ const upToDate = last === null ? null : !newer(last, version);
34
+ const text = last === null
35
+ ? `berliner ${version} (couldn't reach ${registryOf(env)} to check for a newer release)`
36
+ : upToDate
37
+ ? `berliner ${version} (latest)`
38
+ : `berliner ${version}, ${last} is out: run berliner upgrade`;
39
+ print({ data: { version, latest: last, up_to_date: upToDate }, text }, values.json === true);
40
+ }
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import { team } from "./commands/team.js";
17
17
  import { summary } from "./commands/summary.js";
18
18
  import { update } from "./commands/update.js";
19
19
  import { upgrade } from "./commands/upgrade.js";
20
+ import { version } from "./commands/version.js";
20
21
  import { readConfig } from "./config.js";
21
22
  import { warn } from "./output.js";
22
23
  import { upgradeNotice } from "./version.js";
@@ -47,6 +48,7 @@ Commands:
47
48
  evidence private <id> make it viewable only by you again [--json]
48
49
  upgrade install the latest CLI, skill and hooks [--yes --no-skill --no-hooks]
49
50
  skill print the bundled SKILL.md
51
+ version print this version and whether it is the latest release [--json] (also --version)
50
52
  hook <tool> run by the hooks of claude-code, codex or opencode; reads the payload on stdin
51
53
 
52
54
  Environment: BERLINER_TOKEN, BERLINER_URL, BERLINER_VENDOR_SUBSCRIPTION_SLUG (the subscription of new sessions),
@@ -70,6 +72,7 @@ const handled = new Set([
70
72
  "skill",
71
73
  "hook",
72
74
  "upgrade",
75
+ "version",
73
76
  ]);
74
77
  const cfg = () => readConfig(process.env);
75
78
  try {
@@ -80,6 +83,8 @@ try {
80
83
  await hook(process.env, args.positionals, args.values);
81
84
  else if (args.error)
82
85
  throw new CliError(args.error, "usage");
86
+ else if (args.command === "version" || args.values.version)
87
+ await version(process.env, args.values);
83
88
  else if (args.command === "setup")
84
89
  await setup(process.env, args.values);
85
90
  else if (args.command === "report")
@@ -117,8 +122,8 @@ catch (err) {
117
122
  console.error(usage);
118
123
  process.exitCode = softFail ? 0 : 1;
119
124
  }
120
- // The hook carries it in the session-start reminder instead, and upgrade looks for itself.
121
- if (args.command !== "hook" && args.command !== "upgrade") {
125
+ // The hook carries it in the session-start reminder instead, and upgrade and version look for themselves.
126
+ if (args.command !== "hook" && args.command !== "upgrade" && args.command !== "version" && !args.values.version) {
122
127
  const notice = await upgradeNotice(process.env);
123
128
  if (notice)
124
129
  console.error(notice);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paxnax/berliner",
3
- "version": "0.9.0",
4
- "description": "Report coding-agent sessions to Berliner",
3
+ "version": "0.10.1",
4
+ "description": "The receipt for agent work: reports coding-agent sessions to Berliner",
5
5
  "keywords": [
6
6
  "claude-code",
7
7
  "codex",
@@ -11,6 +11,7 @@
11
11
  "cli"
12
12
  ],
13
13
  "homepage": "https://berliner.app",
14
+ "license": "MIT",
14
15
  "type": "module",
15
16
  "engines": {
16
17
  "node": ">=22"